diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000000000000000000000000000000000..ff0f1ecf93fe639525f845c20827c08d85235f1f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,61 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.avro filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.lz4 filter=lfs diff=lfs merge=lfs -text +*.mds filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +# Audio files - uncompressed +*.pcm filter=lfs diff=lfs merge=lfs -text +*.sam filter=lfs diff=lfs merge=lfs -text +*.raw filter=lfs diff=lfs merge=lfs -text +# Audio files - compressed +*.aac filter=lfs diff=lfs merge=lfs -text +*.flac filter=lfs diff=lfs merge=lfs -text +*.mp3 filter=lfs diff=lfs merge=lfs -text +*.ogg filter=lfs diff=lfs merge=lfs -text +*.wav filter=lfs diff=lfs merge=lfs -text +# Image files - uncompressed +*.bmp filter=lfs diff=lfs merge=lfs -text +*.gif filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.tiff filter=lfs diff=lfs merge=lfs -text +# Image files - compressed +*.jpg filter=lfs diff=lfs merge=lfs -text +*.jpeg filter=lfs diff=lfs merge=lfs -text +*.webp filter=lfs diff=lfs merge=lfs -text +# Video files - compressed +*.mp4 filter=lfs diff=lfs merge=lfs -text +*.webm filter=lfs diff=lfs merge=lfs -text +harbor/sources/druid-v9/task/grader/lib/budget-agent.jar filter=lfs diff=lfs merge=lfs -text diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..c0542a8e0f47ed6d3ee0aac5f5bddf8019ce8482 --- /dev/null +++ b/LICENSE @@ -0,0 +1,32 @@ +This dataset is a collection of tasks. Each task includes code from an +open-source repository (the `patch`, `test_patch`, `grader_files` and +`dockerfile` fields may quote or modify it). That code stays under the licence +of its upstream repository, listed per task below as reported by GitHub. + +The task text and grader design, where they are not upstream code, are +copyright 2026 Toptal, LLC. Contact Toptal, LLC for licence terms. + +- BabylonJS__Babylon.js-babylonjs_scene_remove_owner_refs_contract-382616f8: Apache-2.0 (https://github.com/BabylonJS/Babylon.js) +- MathNya__umya-spreadsheet-umya_structural_edit_reference_owners_contract: MIT (https://github.com/MathNya/umya-spreadsheet) +- SickChill__SickChill-sickchill_episode_metadata_files_contract-2e2a49e4: GPL-3.0 (https://github.com/SickChill/SickChill) +- Zettlr__Zettlr-zettlr_clickable_keywords: GPL-3.0 (https://github.com/Zettlr/Zettlr) +- agronholm__apscheduler-apscheduler-expired-job-lease: MIT (https://github.com/agronholm/apscheduler) +- aio-libs__aioftp-aioftp-stream-abort-desynchronization: Apache-2.0 (https://github.com/aio-libs/aioftp) +- alibaba__druid-druid_lenient_script: Apache-2.0 (https://github.com/alibaba/druid) +- alibaba__hooks-ahooks_request_cache_races: MIT (https://github.com/alibaba/hooks) +- apache__geode-geode_oql_index_null_semantics_contract-1c066303: Apache-2.0 (https://github.com/apache/geode) +- bashrc2__epicyon-epicyon_deleted_post_announce_cache_contract-1c066303: AGPL-3.0 (https://github.com/bashrc2/epicyon) +- buchgr__bazel-remote-bazel_remote_disk_eviction_accounting_contract-afe5ea56: Apache-2.0 (https://github.com/buchgr/bazel-remote) +- celery__celery-celery_retry_expires_countdown_contract: NOASSERTION (https://github.com/celery/celery) +- colinhacks__zod-zod-json-schema-target-legality: MIT (https://github.com/colinhacks/zod) +- coredns__coredns-coredns__4097: Apache-2.0 (https://github.com/coredns/coredns) +- dgraph-io__badger-journal_recovery_after_unclean_stop: Apache-2.0 (https://github.com/dgraph-io/badger) +- dotnet__Open-XML-SDK-open_xml_sdk_deletepart_refs_contract-1c066303: MIT (https://github.com/dotnet/Open-XML-SDK) +- igniterealtime__Openfire-openfire_userdeleting_last_owner_contract-0163de9c: Apache-2.0 (https://github.com/igniterealtime/Openfire) +- mikro-orm__mikro-orm-mikro-orm-pessimistic-locking: MIT (https://github.com/mikro-orm/mikro-orm) +- ory__kratos-kratos_cleanup_stale_flows_courier_contract: Apache-2.0 (https://github.com/ory/kratos) +- pallets__click-click-help-defaults: BSD-3-Clause (https://github.com/pallets/click) +- python-rope__rope-rope_rename_all_reexport_owners_contract-1c066303: LGPL-3.0 (https://github.com/python-rope/rope) +- sequelize__sequelize-sequelize-bulkcreate-ignore-duplicates: MIT (https://github.com/sequelize/sequelize) +- terser__terser-retained_top_level_names_keep_their_values: NOASSERTION (https://github.com/terser/terser) +- tsileo__microblog.pub-microblogpub_deleted_object_resurrect_lookup_contract-382616f8: AGPL-3.0 (https://github.com/tsileo/microblog.pub) diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..22e622cc8762e13cbb0291a94c35c697e82ee628 --- /dev/null +++ b/README.md @@ -0,0 +1,417 @@ +--- +# Dataset card metadata. Spec: https://github.com/huggingface/hub-docs/blob/main/datasetcard.md?plain=1 +pretty_name: EC SWE +language: +- en +language_details: en-US +license: other +license_name: mixed-upstream +license_link: LICENSE +license_details: >- + Each task carries code from an open-source upstream repository (patch, + test_patch, grader_files, dockerfile), under that repository's licence; the + repo_license column names it per row. The task text and grader design are + copyright 2026 Toptal, LLC; contact Toptal, LLC for licence terms. +tags: +- code +- software-engineering +- swe-bench +- agents +- coding-agents +- benchmark +- evaluation +- bug-fixing +- program-repair +- multi-language +annotations_creators: +- expert-generated +language_creators: +- expert-generated +multilinguality: +- monolingual +size_categories: +- n<1K +source_datasets: +- original +task_categories: +- text-generation +task_ids: +- language-modeling +configs: +- config_name: default + data_files: + - split: test + path: data/test.parquet +dataset_info: + config_name: default + features: + - name: instance_id + dtype: string + - name: repo + dtype: string + - name: base_commit + dtype: string + - name: setup_patch + dtype: string + - name: problem_statement + dtype: string + - name: patch + dtype: string + - name: test_patch + dtype: string + - name: patch_files + list: string + - name: grader + list: + - name: criterion + dtype: string + - name: weight + dtype: float64 + - name: grader_files + list: + - name: path + dtype: string + - name: encoding + dtype: string + - name: content + dtype: string + - name: dockerfile + dtype: string + - name: language + dtype: string + - name: repo_license + dtype: string + - name: hud_task + dtype: string + - name: difficulty + dtype: string + - name: agent_runs + dtype: int64 + - name: agent_rewards + list: float64 + - name: agent_mean_reward + dtype: float64 + - name: agent_solve_rate + dtype: float64 + - name: agent_models + list: string + - name: gold_reward + dtype: float64 + - name: base_reward + dtype: float64 + splits: + - name: test + num_bytes: 16944456 + num_examples: 24 + download_size: 7713543 + dataset_size: 16944456 +--- + +# Dataset Card for ExpertCrowd SWE (EC-SWE) + +This dataset contains real software engineering tasks for evaluating coding +agents. Each one is a bug or missing behaviour in a real open-source repository, pinned to a +commit, with a written problem statement, a reference fix, and a weighted +grader backed by hidden tests. The tasks were chosen to sit at the typical +difficulty of the pool of reviewed tasks they were drawn from, measured by how +well current frontier agents scored on them: no outliers at either end. Mean +agent reward runs from 0.34 to 0.43, and 1.6% of agent runs scored a full 1.0. + +## Dataset Details + +### Dataset Description + +Every task was written by a software engineer, run on the HUD evaluation +platform, and accepted by a human reviewer (review status `verified`). Before a +task can be accepted, its reference fix has to score 1.0 on every grader +criterion, the unchanged repository has to fail, and at least 5 agent runs on a +current frontier model have to be graded. Automated checks also look at the +prompt (it must state the symptom, not the fix), the grader (weights add up to +100, each criterion is one observable requirement), and whether the task +overlaps a public benchmark. + +This dataset keeps the tasks closest to the typical difficulty of all verified tasks with agent scores, chosen from those that met every export +check (see [Curation Rationale](#curation-rationale)). + +## Uses + +### Direct Use + +- Evaluating coding agents on realistic repository-level tasks: give the agent + `problem_statement` and a checkout of `repo` at `base_commit` with + `setup_patch` applied, then score the resulting diff with the task's grader. +- Studying difficulty: every task carries the per-run rewards of 128 graded + agent runs, so results can be compared against a known baseline. +- Building or validating graders and task-quality tooling, using the reference + fix, the hidden tests and the weighted criteria together. + +## Dataset Structure + +One split, `test`, with one row per task. + +| Field | Type | What it holds | +| --- | --- | --- | +| `instance_id` | string | `__-`, unique | +| `repo` | string | upstream GitHub repository, `owner/name` | +| `base_commit` | string | the 40-character upstream commit the task is built on | +| `setup_patch` | string | a patch the environment applies to `base_commit` before the agent starts; empty for most tasks. Apply it first: `patch` and `test_patch` are written against the result | +| `problem_statement` | string | the exact prompt the agent was sent, including a short preamble about the workspace (`/workspace/repo`) and resource limits | +| `patch` | string | the reference fix, non-test files only | +| `test_patch` | string | test files the reference fix adds or changes (may be empty) | +| `patch_files` | list of string | every file the reference fix touches | +| `grader` | list of (criterion, weight) | the grader's criteria and their weights in percent; weights add up to 100 | +| `grader_files` | list of (path, encoding, content) | the grader as built into the task environment (`grader/`, `grading/` or `protected/`): hidden tests, the repository's regression suite where the grader reruns it, and the script that scores a run. `encoding` is `utf-8`, or `base64` for binary fixtures. The author's calibration notes, control diffs and adversarial manifests are left out | +| `dockerfile` | string | the environment the agent ran in | +| `language`, `repo_license` | string | from the GitHub API for `repo` | +| `hud_task` | string | the task's name on HUD, for tracing a row back | +| `difficulty` | string | bucket of `agent_mean_reward`: very hard (under 0.2), hard, medium, easy, very easy (0.8 and up) | +| `agent_runs`, `agent_rewards` | int, list of float | graded agent runs on current models and each run's reward (0 to 1) | +| `agent_mean_reward`, `agent_solve_rate` | float | mean reward, and the share of runs that scored a full 1.0 | +| `agent_models` | list of string | the models those runs used | +| `gold_reward`, `base_reward` | float | reward of the reference fix (1.0) and of the unchanged repository | + +```python +from datasets import load_dataset + +ds = load_dataset("ExpertCrowd/ec-swe", split="test") +hard = ds.filter(lambda r: r["difficulty"] in ("very hard", "hard")) +``` + +### At a glance + +- **Tasks:** one per repository +- **Graded agent runs behind the difficulty numbers:** 128 +- **Models those runs used:** claude-fable-5, claude-fable-5-1, claude-opus-5, gemini-3.8-flash, gpt-6-astra + +| Language | Tasks | +| --- | --- | +| Python | 8 | +| TypeScript | 6 | +| Go | 4 | +| Java | 3 | +| JavaScript | 1 | +| Rust | 1 | +| C# | 1 | + +### Difficulty + +Difficulty is the mean reward of graded agent runs on current frontier models. +The tasks sit around the middle of the distribution of every verified task with +5 or more graded agent runs, so the mean and median stay close to the pool's +while the very hard and easy tails are left out: + +| Mean agent reward | Difficulty | All verified with agent scores (124) | This dataset | +| --- | --- | --- | --- | +| 0.0 to 0.2 | very hard | 5 (4%) | 0% | +| 0.2 to 0.4 | hard | 61 (49%) | 62% | +| 0.4 to 0.6 | medium | 55 (44%) | 38% | +| 0.6 to 0.8 | easy | 3 (2%) | 0% | +| 0.8 to 1.0 | very easy | 0 (0%) | 0% | +| **mean** | | **0.377** | **0.380** | +| **median** | | **0.379** | **0.373** | + +### Tasks + +| Instance | Repository | Language | Difficulty | Mean reward | +| --- | --- | --- | --- | --- | +| `bashrc2__epicyon-epicyon_deleted_post_announce_cache_contract-1c066303` | bashrc2/epicyon | Python | hard | 0.34 | +| `apache__geode-geode_oql_index_null_semantics_contract-1c066303` | apache/geode | Java | hard | 0.34 | +| `coredns__coredns-coredns__4097` | coredns/coredns | Go | hard | 0.34 | +| `sequelize__sequelize-sequelize-bulkcreate-ignore-duplicates` | sequelize/sequelize | TypeScript | hard | 0.34 | +| `MathNya__umya-spreadsheet-umya_structural_edit_reference_owners_contract` | MathNya/umya-spreadsheet | Rust | hard | 0.35 | +| `alibaba__druid-druid_lenient_script` | alibaba/druid | Java | hard | 0.35 | +| `aio-libs__aioftp-aioftp-stream-abort-desynchronization` | aio-libs/aioftp | Python | hard | 0.35 | +| `python-rope__rope-rope_rename_all_reexport_owners_contract-1c066303` | python-rope/rope | Python | hard | 0.35 | +| `SickChill__SickChill-sickchill_episode_metadata_files_contract-2e2a49e4` | SickChill/SickChill | Python | hard | 0.35 | +| `igniterealtime__Openfire-openfire_userdeleting_last_owner_contract-0163de9c` | igniterealtime/Openfire | Java | hard | 0.36 | +| `Zettlr__Zettlr-zettlr_clickable_keywords` | Zettlr/Zettlr | TypeScript | hard | 0.36 | +| `buchgr__bazel-remote-bazel_remote_disk_eviction_accounting_contract-afe5ea56` | buchgr/bazel-remote | Go | hard | 0.37 | +| `terser__terser-retained_top_level_names_keep_their_values` | terser/terser | JavaScript | hard | 0.38 | +| `ory__kratos-kratos_cleanup_stale_flows_courier_contract` | ory/kratos | Go | hard | 0.38 | +| `dotnet__Open-XML-SDK-open_xml_sdk_deletepart_refs_contract-1c066303` | dotnet/Open-XML-SDK | C# | hard | 0.39 | +| `dgraph-io__badger-journal_recovery_after_unclean_stop` | dgraph-io/badger | Go | medium | 0.40 | +| `BabylonJS__Babylon.js-babylonjs_scene_remove_owner_refs_contract-382616f8` | BabylonJS/Babylon.js | TypeScript | medium | 0.40 | +| `alibaba__hooks-ahooks_request_cache_races` | alibaba/hooks | TypeScript | medium | 0.41 | +| `celery__celery-celery_retry_expires_countdown_contract` | celery/celery | Python | medium | 0.43 | +| `colinhacks__zod-zod-json-schema-target-legality` | colinhacks/zod | TypeScript | medium | 0.43 | +| `pallets__click-click-help-defaults` | pallets/click | Python | medium | 0.43 | +| `tsileo__microblog.pub-microblogpub_deleted_object_resurrect_lookup_contract-382616f8` | tsileo/microblog.pub | Python | medium | 0.43 | +| `mikro-orm__mikro-orm-mikro-orm-pessimistic-locking` | mikro-orm/mikro-orm | TypeScript | medium | 0.43 | +| `agronholm__apscheduler-apscheduler-expired-job-lease` | agronholm/apscheduler | Python | medium | 0.43 | + +## Running the tasks + +There are two ways to run a task: on HUD, the platform the tasks were written for, or with +Harbor on your own machine. + +### On HUD + +Every task runs on HUD, including the nine that have no Harbor package. The tasks are +published there as the taskset [`ec-swe`](https://www.hud.ai/shared/tasksets/979e6e02-d726-46f6-a066-914afc5c9f44), +which anyone can view; it is still being filled as its environments are built. + +To run a task in a HUD workspace of your own: each folder under `harbor/sources/` is the build +source of one task's HUD environment. With a HUD account, on Linux, macOS or WSL: + +```bash +pip install hud # the hud command +hud set HUD_API_KEY= # a key from hud.ai/project/api-keys +hf download ExpertCrowd/ec-swe --repo-type dataset --include "harbor/sources/**" --local-dir ec-swe +cd ec-swe/harbor/sources/ +hud deploy # builds the environment in your HUD workspace +hud sync tasks my-ec-swe tasks.py # puts this folder's task into a taskset of yours +hud eval my-ec-swe claude --full # runs it on the platform with an agent +``` + +Results appear as jobs and traces on hud.ai (`hud jobs`). On HUD the agent and the grader +share one container, kept apart by file permissions, and the four tasks with a criterion +judged by a model get that judge from HUD's gateway. The commands follow HUD's +documentation. We rehearsed `hud deploy` and `hud sync tasks` for every folder in their +dry-run mode and ran them in full for the terser folder; we have not run an agent with +`hud eval` from this folder. + +### With Harbor + +The `harbor/` folder of this repository makes tasks runnable end +to end with [Harbor](https://github.com/harbor-framework/harbor) 0.23.0 and +Docker, and nothing else. Each task is packaged as two containers: one for the +agent, holding the repository at its base commit and nothing from the grading +side, and a separate one that grades the patch the agent leaves behind with the +task's original grader. Both are offline by default. The folder holds each +task's complete build context, so its environment can be rebuilt from this +repository alone. + +```bash +hf download ExpertCrowd/ec-swe --repo-type dataset --include "harbor/**" --local-dir ec-swe +cd ec-swe/harbor +pip install harbor==0.23.0 +python build_images.py --task +harbor run -p tasks/ -a oracle # the reference fix: reward 1.0 +harbor run -p tasks/ -a nop # no change: reward 0.0 +harbor run -p tasks/ -a -m --allow-agent-host +``` + +`harbor/README.md` has the requirements, a table that maps each task folder to +its `instance_id` here, the scripted checks, and what was recorded for each +task. Every packaged task was run through Harbor on the files in the folder: an +empty change scores 0, and the reference fix scores 1.0 with every criterion +equal to the task's original grading. The folder contains the reference fixes +and the hidden graders, as the rows of this dataset do. + +11 more (badger, bazel-remote, celery, geode, kratos, microblogpub, open-xml-sdk, openfire, terser, umya, zettlr) are packaged and are being re-checked; they are added +as each one passes. + +Nine tasks have no Harbor package yet: click, sequelize, druid and hooks (one criterion each +is judged by a model), SickChill, Babylon.js, mikro-orm, aioftp and apscheduler. The folder +holds the complete build context of each, and `harbor/README.md` says for each how it is +built and graded and what it needs. + +## Dataset Creation + +### Curation Rationale + +The goal was a public set at the typical difficulty of the full pool: hard +enough that no current agent solves the tasks reliably, without tasks so hard +that every agent scores near zero, or so easy that they no longer separate +models. + +1. **Pool.** Every task whose current review status on HUD is `verified'. Validation copies of a task are not tasks and were + left out. +2. **Export checks.** A task was kept only if HUD gave a prompt, a GitHub + repository and a pinned 40-character commit, a non-empty reference fix, + grader weights adding up to 100, a reference run on the current task version + scoring 1.0, and at least 5 graded agent runs on a current model. The + repository had to be an established upstream project, not one created for + the task, and the environment could not depend on a task author's personal + images. Two tasks with the same reference fix, or the same repository and + scenario, count once. +3. **Stratified sample.** All verified tasks with 5 or more + graded agent runs were ranked by mean agent reward and cut into bins of + equal size. Each bin contributed one task that passed the export checks, + preferring a repository not yet in the sample. Matching against the whole + scored pool, not only the exportable part, keeps the export checks from + skewing the difficulty curve. +4. **Typical difficulty.** From that sample, the tasks whose mean agent + reward was closest to the sample mean (0.374) were kept: every task within + 0.059 of it. The nearest task left out was 0.064 away, so the cut does not + split a tie. + +### Source Data + +#### Data Collection and Processing + +Task authors chose a bug or missing behaviour in an open-source repository, +wrote the problem statement, built a container that checks out the repository at +a pinned commit, wrote a reference fix and a hidden-test grader, and ran the +task on HUD: a reference run, a run with no fix, and at least 5 agent runs. The +export reads the prompt from the agent's own trace, the criteria and weights +from the reference run's grading, and the repository, commit, reference fix and +grader from the environment build. + +#### Who are the source data producers? + +The code comes from the upstream open-source projects named in `repo`, written +by their contributors. The problem statements, reference fixes, hidden tests and +graders were written by professional software engineers contracted to build the +tasks. + +### Annotations + +#### Annotation process + +Each task was reviewed on HUD by a human reviewer, who could send it back for +revision or reject it; only tasks marked `verified` are included. Automated +checks run before review on the prompt, the grader, the reference and baseline +runs, and overlap with public benchmarks. The difficulty fields come from graded +agent runs, not from people. + +#### Who are the annotators? + +Experienced software engineers acting as reviewers, separate from each task's +author. + +#### Personal and Sensitive Information + +The tasks are about source code. Author and reviewer names were left out of +the export. Upstream code can contain contributor names in comments, licence +headers or commit metadata, as it does in the upstream repositories. + +## Recommendations + +Report `agent_solve_rate`-style full solves alongside mean reward, report +results per difficulty bucket as well as overall, and give the model's training +cutoff relative to this dataset's release. + +## Citation + +**BibTeX:** + +```bibtex +@misc{toptal2026ecswe, + author = {{Toptal, LLC}}, + title = {{EC SWE}}, + year = {2026}, + publisher = {Hugging Face}, + howpublished = {\url{https://huggingface.co/datasets/ExpertCrowd/ec-swe}} +} +``` + +**APA:** + +Toptal, LLC. (2026). *EC SWE* [Data set]. Hugging Face. +https://huggingface.co/datasets/ExpertCrowd/ec-swe + +## Glossary + +- **Gold run:** the task run with the reference fix applied. It must score 1.0. +- **Base run:** the task run on the unchanged repository. It should score low. +- **Reward:** the grader's weighted score for one run, 0 to 1. +- **Verified:** a task a human reviewer accepted on HUD. + +## Dataset Card Authors + +Toptal, LLC + +## Dataset Card Contact + +Toptal, LLC, through the ExpertCrowd organization on Hugging Face. diff --git a/data/test.parquet b/data/test.parquet new file mode 100644 index 0000000000000000000000000000000000000000..77fd2b565caef93e621c9d15ffb86edb29e2fb2b --- /dev/null +++ b/data/test.parquet @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d46fa9d12cfc210336016075e357f6230b5aaa42fdc4276a3a30671ef97d62c +size 7713543 diff --git a/harbor/README.md b/harbor/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fa7c6985cb310e7543d894282998d89ed873dc86 --- /dev/null +++ b/harbor/README.md @@ -0,0 +1,317 @@ +# ExpertCrowd SWE tasks: runnable Harbor packages + +This folder makes 4 ExpertCrowd software-engineering tasks runnable end +to end with [Harbor](https://github.com/harbor-framework/harbor) and Docker, and +nothing else. Each task is a real repository at a fixed commit, a written +request, and the original hidden rubric that scores a change to that repository. +An agent works in one container; a second container, which the agent never +sees, grades the patch it leaves behind. The table under "Recorded +qualification" maps each task folder to its row in `data/test.parquet`. + +The folder contains the reference solutions and the hidden graders. A model you +are evaluating must see only the task prompt and its own sandbox, which is what +Harbor gives it. Do not put the other files where that model, or its training +data, can reach them. + +## Two ways to run a task + +- **With Harbor, on your own machine.** 4 tasks are packaged for + this under `tasks/`. Everything on this page up to "Tasks without a Harbor + package" is about this route. +- **On HUD, the platform the tasks were written for.** All 24 tasks run there, + and the agent results in the dataset come from such runs. The tasks are + published there as the taskset + [`ec-swe`](https://www.hud.ai/shared/tasksets/979e6e02-d726-46f6-a066-914afc5c9f44), + which anyone can view; it is still being filled as its environments are + built. To run a task in a workspace of your own: each folder under + `sources/` is the build source of a task's HUD environment. With a HUD + account and the `hud` command, on Linux, macOS or WSL: + + ```bash + pip install hud # the hud command + hud set HUD_API_KEY= # a key from hud.ai/project/api-keys + cd sources/ + hud deploy # builds the environment in your HUD workspace + hud sync tasks my-ec-swe tasks.py # puts this folder's task into a taskset of yours + hud eval my-ec-swe claude --full # runs it on the platform with an agent + ``` + + Results appear as jobs and traces on hud.ai (`hud jobs`). This is also the + route for the nine tasks without a Harbor package, including the four with a + criterion judged by a model, which HUD's gateway serves. The commands follow + HUD's documentation; we rehearsed `hud deploy` and `hud sync tasks` for every + folder in their dry-run mode and ran them in full for the terser folder; we + have not run an agent with `hud eval` from this folder. The build + sources are the ones the platform built the recorded environments from, with + the changes listed under "Contents". + +## What you need + +- Docker with Compose and BuildKit, on Linux, macOS or Windows with WSL. +- Python 3.12 and Harbor 0.23.0: `pip install harbor==0.23.0`. +- Network access while images are built. Tasks themselves run offline. +- Disk: allow 5 to 10 GB per task for its images. Each task container is + limited to 2 CPUs and 8 GiB. + +No GPU, model account or API key is needed for the checks below. + +## Quick start + +From this folder: + +```bash +python verify_bundle.py +python build_images.py --task coredns_rewrite_svcb_opt +harbor run -p tasks/coredns_rewrite_svcb_opt -a oracle # the reference fix: reward 1.0 +harbor run -p tasks/coredns_rewrite_svcb_opt -a nop # no change: reward 0.0 +python run_checks.py --task coredns_rewrite_svcb_opt --output checks-001 +``` + +1. `verify_bundle.py` checks every file against `checksums.json`. +2. `build_images.py` builds the task's source image from `sources/`. Leave out + `--task` to build every task. A build takes ten to forty minutes: most tasks + finish their build by scoring their own reference fix and the untouched + repository, and refuse to produce an image unless those score 1.0 and 0.0. +3. `harbor run` with Harbor's `oracle` agent applies the reference fix and with + its `nop` agent changes nothing. These two need no script from this folder. +4. `run_checks.py` runs five scripted checks per task and exits 0 only if each + gives what is expected: + +| Check | What is submitted | Expected | +| --- | --- | --- | +| `noop` | nothing | reward 0 | +| `reference` | the reference fix | reward 1, and the agent's container is isolated | +| `broken` | the reference fix plus a syntax error | reward 0, graded normally | +| `infra` | the reference fix, with one grader file removed from the verifier | no reward: the attempt is invalid | +| `tamper` | nothing, while a process keeps writing a full score to the result file | reward 0 | + +## Running an agent + +```bash +harbor run -p tasks/coredns_rewrite_svcb_opt -a -m --allow-agent-host +``` + +Harbor's agents run inside the task's container, so they need to reach their +model. Every task here declares no network for both phases; +`--allow-agent-host` opens the agent phase to the hosts you name and nothing +else, and the verifier stays offline. `harbor run --help` lists the agents. +An agent that installs itself into the container may need further hosts for +that step (`--allow-environment-host`). + +Only Harbor's `oracle` and `nop` agents were run for the qualification below. +No run with a model-backed Harbor agent is part of this folder yet. + +## Recorded qualification + +Every task below was run with stock Harbor 0.23.0 on the files shipped here, +with these results. + +| Task folder | `instance_id` in the dataset | Language | Criteria | Empty change | Reference fix | Agent image scan | +| --- | --- | --- | --- | --- | --- | --- | +| `coredns_rewrite_svcb_opt` | `coredns__coredns-coredns__4097` | Go | 7 | 0 | 1 | clean | +| `epicyon_deleted_post_announce_cache_contract` | `bashrc2__epicyon-epicyon_deleted_post_announce_cache_contract-1c066303` | Python | 11 | 0 | 1 | clean | +| `rope_rename_all_reexport_owners_contract` | `python-rope__rope-rope_rename_all_reexport_owners_contract-1c066303` | Python | 8 | 0 | 1 | clean | +| `zod_json_schema_target_legality` | `colinhacks__zod-zod-json-schema-target-legality` | TypeScript | 12 | 0 | 1 | clean | + +The `broken`, `infra` and `tamper` checks, and the author's calibration patches where a task has them, have also been run on these exact files for 1 of the tasks: `coredns_rewrite_svcb_opt`. For the other tasks the `broken` and `infra` checks and the calibration patches last passed on an earlier build of the package, and all of these checks are being repeated on the files here. `manifest.json` records per task which checks ran on which build (`checks_on_shipped_files`, `further_checks`). + +- **Empty change** and **Reference fix** are the rewards of Harbor's `nop` and + `oracle` runs. +- **Reference fix** also means that every criterion's value and weight equals + what the task's own grading code gives the reference fix inside its + unmodified source image, and that the isolation check passed: the agent runs + as an unprivileged user, sees none of the grading files and gets no traffic + out. +- **Agent image scan** means no line of the reference patch, the hidden graders + or the criterion names is in the agent's image, other than lines the public + repository already contained. +- **Author's calibration patches** are partial, alternative and cheating + solutions the task's author shipped with the task. Each patch is submitted + through the package and has to reproduce the score the author's own build + recorded. + +The per-task records are in `evidence//`: a summary, the native grading +of the reference, the author's calibration output, each verifier report and the +agent image scan. + +## How a score is produced + +- The agent's container holds the repository at its base commit with a fresh + one-commit history, the toolchain, and nothing from the grading side. The + agent runs as an unprivileged user. +- When the agent finishes, a hook in the task captures its change as a patch + against a protected copy of the base commit. Only that patch reaches the + verifier. +- The verifier is a fresh container. It checks its own grader files against + recorded hashes, applies the patch, and runs the task's original grading code + unchanged. Grader commands, and with them the submitted code, run as an + unprivileged user; the report, the rubric files and the repository's original + history belong to root. +- The reward is the task's original reward: weighted criteria between 0 and 1, + with partial credit. Most tasks mark some criteria as blockers and cap the + reward at 0.6 when one fails. A few tasks apply a rule of their own instead + (`reward_rule` is `authored` in `manifest.json`); their reward is kept as + computed and cross-checked against the criteria. +- An attempt is **invalid**, and gets no reward, when grading itself could not + be completed: a missing grader file or dependency, a grader command that + timed out or ended outside its pass/fail contract, missing criteria, or a + report that does not add up. Harbor reports it as an error, not as a score. + Re-run or exclude it; do not average it in as a zero. +- A submission that does not compile is not an invalid attempt. Several tasks' + graders report "could not judge" when the build breaks. The verifier then + resets the repository and puts the same check to the untouched code. If the + grader reaches a verdict there, the submission is what broke it: the + criterion counts as unmet and the attempt is scored. If it cannot judge the + untouched code either, the environment is at fault and the attempt is invalid. + +## Contents + +- `tasks//`: one Harbor task per folder: `instruction.md` (the prompt + the agent receives), `task.toml`, `environment/` (agent image recipe), + `tests/` (verifier recipe, verifier and its pinned configuration) and + `solution/` (reference fix). +- `sources/`: each task's build context as downloaded from HUD. In eighteen of + them the environment name was changed to a neutral one (`ec-swe-...`, at most + three lines in `env.py`, `pyproject.toml` and `tasks.py`), and druid's had + comments shortened and three unused files removed; `manifest.json` lists the + changed files per task (`source_edited`). Every packaged task was built and + checked from the files here. `sources/archives/` holds the original archive + of each context that was not changed. + `build_images.py` builds from these. +- `build_images.py`, `run_checks.py`, `verify_bundle.py`: standard-library + scripts; `run_checks.py` calls the `harbor` command. +- `evidence/`: the recorded qualification. +- `manifest.json`, `checksums.json`: versions, image names and file hashes. + +## Limits of what is shown + +- The checks are scripted. They show that each task can be built, attempted, + graded and scored as its author intended. They do not measure any model. +- Everything was qualified on one machine (Docker Desktop on Windows, through + WSL). It has not been repeated on a second machine. As a test of the download + itself, this folder was fetched from the Hub into an empty Linux directory on + that machine, and one task (`retained_top_level_names_keep_their_values`) was + built and put through all five checks from there. +- Task images are built on your machine, so their image IDs differ from the + ones recorded here. What is pinned is the content of the grader files, which + the verifier checks before every grading. +- Builds download base images and dependencies. A recipe that builds today can + stop building when an upstream package is withdrawn. +- A download gives every file mode 644. The images were qualified from build + contexts in which every file had mode 777, and some images keep the modes of + files they copy. `build_images.py` builds from a temporary copy with mode + 777 for that reason. If you build a `Dockerfile.hud` by hand, give its + context the same modes first. +- Run one task at a time on a machine that is otherwise quiet when a score + matters: some repositories' own test suites are timing-sensitive, and a busy + machine has turned a correct fix's gate red here. +- The graders execute the submitted code. The isolation described above is a + concrete, tested boundary, not a security certification. + +## Tasks without a Harbor package + +Nine of the dataset's 24 tasks have no package under `tasks/` yet. The complete +build context of each is under `sources/` (unmodified, except druid's: see its +entry), so you can +build the task's image and run it in a setup of your own. This section says how +each is meant to run, what it needs, and what was seen when it was tried here. +None of these routes gives the isolation of the packaged tasks: the agent and +the grader share one container, separated by file permissions. + +**Building.** `python build_images.py --task ` builds the image +`ec-swe-:source-v` from `sources/-v/Dockerfile.hud`, the same +way as for the packaged tasks. `` is the bold name in the list below. + +**How these images run a task.** Each image is an environment for the HUD agent +harness. Its default command, `hud serve tasks.py`, serves the task; a harness +built on the `hud` Python package (each `Dockerfile.hud` pins the version) +connects to it, lets the agent work in the checkout as UID 1000, and then calls +the task's grading in the same container as root. `/hud`, which holds the hidden +tests, the grader and the reference fix, is readable by root only. + +**Grading without the harness.** In the standard layout (click, sequelize, +hooks, sickchill, babylonjs, mikro-orm) two functions in `/app/tasks.py` do the +work: `_setup()` prepares the checkout in `/workspace/repo`, and +`_grade(mode)` returns the reward and the criteria. With `mode` `"golden"` it +grades the reference fix; with `None` it grades the changes made to the +checkout since setup. The results reported below were obtained by running this +script inside the image, as root and with no network: + +```python +import asyncio, json, sys +sys.path.insert(0, "/app") +import tasks + +async def main(): + await tasks._setup() + result = await tasks._grade("golden") + print(json.dumps(result.model_dump(mode="json"))) + +asyncio.run(main()) +``` + +```bash +docker run --rm -i --network none ec-swe-:source-v /opt/hudvenv/bin/python - < script.py +``` + +**The tasks** + +- **click** (`pallets__click-click-help-defaults`, Python, `sources/click-v9`). + Standard layout. One criterion, `maintainer_review` (6.25 of 100 points), is + decided by a language model through HUD's gateway, so grading needs + `HUD_API_KEY` in the container's environment and network access to that + gateway. When the judge cannot be reached, the task's own code drops that + criterion, rescales the others and records `judge_errors` in the result. Not + built or run here. +- **sequelize** (`sequelize__sequelize-sequelize-bulkcreate-ignore-duplicates`, + TypeScript, `sources/sequelize-v27`). As click: `maintainer_review` is 6.25 + points. Not built or run here. +- **hooks** (`alibaba__hooks-ahooks_request_cache_races`, TypeScript, + `sources/hooks-v4`). As click: `maintainer_review` is 3 points. Not built or + run here. +- **druid** (`alibaba__druid-druid_lenient_script`, Java, `sources/druid-v9`). + As click: `maintainer_review` is 2 points. The layout differs a little: there + is no `coding/` folder and no `tasks._grade`, the scenario function in + `tasks.py` does the grading, and the HUD runtime is in `/opt/hudenv`, so the + script above does not apply. This build context is not byte-identical to the + original: comments that recorded internal review history were shortened in + `tasks.py` and `preflight.sh`, and three files the image build does not read + were removed. `tasks.py` is the same program. Not built or run here. +- **sickchill** + (`SickChill__SickChill-sickchill_episode_metadata_files_contract-2e2a49e4`, + Python, `sources/sickchill-v7`). Builds here; the build, which has network + access, ends by scoring the reference fix 1.0 and the untouched repository + 0.0. Graded afterwards with no network, the reference fix scored 0.6: the + criteria of the fix itself passed (0.97 before the cap), and the gate failed + because the repository suite it runs includes tests that fetch from + pypi.org. Grade it with network access, or add those tests to + `task/grader/suite_deselect.txt`, the task's own list of network-dependent + tests, and rebuild. +- **mikro-orm** (`mikro-orm__mikro-orm-mikro-orm-pessimistic-locking`, + TypeScript, `sources/mikro-orm-v7`, image about 10 GB). Builds here. Graded + with the script above, the reference fix scored 1.0. Its grader starts + database servers (PostgreSQL, MySQL, SQL Server), some of them under their + own accounts with `runuser`, which needs root. The packaged verifier runs + grader commands as an unprivileged user, which is why there is no package + yet. +- **babylonjs** + (`BabylonJS__Babylon.js-babylonjs_scene_remove_owner_refs_contract-382616f8`, + TypeScript, `sources/babylonjs-v8`, image about 10 GB). Builds here. Grading + the reference fix with the script above did not complete on the + qualification machine (16 CPUs, 31 GB of memory, Docker Desktop on Windows): + setup changes the owner of the whole dependency tree and ran into its + 600-second limit twice, and on a third attempt grading had not finished after + two hours. It may behave on a Linux host with a fast local disk; that has + not been tried. +- **aioftp** (`aio-libs__aioftp-aioftp-stream-abort-desynchronization`, Python, + `sources/aioftp-v11`) and **apscheduler** + (`agronholm__apscheduler-apscheduler-expired-job-lease`, Python, + `sources/apscheduler-v17`). A different layout: the checkout is at + `/home/ubuntu/`, the HUD runtime is in `/hud/.venv`, and grading is the + function `grading.runner.grade_repository` in `/hud/grading`. The scenarios + (the task itself, `reference_gold` and `reference_base`) are defined in + `env.py`; there is no `tasks._grade`, so the script above does not apply. + Not built or run here. + +**Packaged, not yet in `tasks/`.** `badger`, `bazel-remote`, `celery`, `geode`, `kratos`, `microblogpub`, `open-xml-sdk`, `openfire`, `terser`, `umya`, `zettlr`: its build files were given a neutral environment name; the package is being rebuilt and re-checked on them. + diff --git a/harbor/build_images.py b/harbor/build_images.py new file mode 100644 index 0000000000000000000000000000000000000000..921874abad54a30b7d09c52529364533de4a3aa7 --- /dev/null +++ b/harbor/build_images.py @@ -0,0 +1,79 @@ +"""Build the task source images from this folder. + + python build_images.py every packaged task + python build_images.py --task one task (repeatable) + +A task without a package is built only when it is named: its id is the short +name under "unpackaged" in manifest.json (README, "Tasks without a Harbor +package"). + +Each image is built from the task's original build context under sources/ and +tagged with the name its Harbor task expects. A build downloads its base image +and the repository's dependencies, so it needs network access; nothing is +downloaded when tasks run. Most builds end with the task's own calibration: +the reference fix must score 1.0 and the untouched repository 0.0 or the image +is not produced. Expect ten to forty minutes and several gigabytes per task. + +The images were qualified from build contexts in which every file had mode 777 +(a Windows disk seen from Linux), and some images keep the modes of files they +copy. A download gives files mode 644. So that your images match the qualified +ones, each build runs from a temporary copy of the context with mode 777; the +files under sources/ are left as they are. +""" + +import argparse +import json +import os +import shutil +import subprocess +import tempfile +import time +from pathlib import Path + +parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) +parser.add_argument("--task", action="append", default=[]) +parser.add_argument("--docker-context") +args = parser.parse_args() +root = Path(__file__).resolve().parent +manifest = json.loads((root / "manifest.json").read_text()) +context = args.docker_context or ("desktop-linux" if os.name == "nt" else None) +docker = ["docker", *(["--context", context] if context else [])] +known = {task["task_id"]: task for task in manifest["tasks"]} +extra = {task["task_id"]: task for task in manifest.get("unpackaged", []) if task["source_folder"]} +unknown = [name for name in args.task if name not in known and name not in extra] +if unknown: + raise SystemExit("Unknown task: " + ", ".join(unknown) + ". See manifest.json.") +known.update({name: extra[name] for name in args.task if name in extra}) +logs = root / "build-logs" +logs.mkdir(exist_ok=True) +built = {} +for task_id, task in known.items(): + if args.task and task_id not in args.task: + continue + source = root / "sources" / task["source_folder"] + scratch = None + if os.name != "nt": + scratch = Path(tempfile.mkdtemp(prefix="ec-swe-build-")) + source = Path(shutil.copytree(source, scratch / source.name)) + for path in [source, *source.rglob("*")]: + path.chmod(0o777) + log = logs / f"{task_id}.log" + started = time.time() + print(f"building {task['source_image']} (log: {log.relative_to(root)})", flush=True) + with log.open("wb") as handle: + code = subprocess.run( + [*docker, "build", "--progress=plain", "-f", str(source / task["dockerfile"]), + "-t", task["source_image"], str(source)], + stdout=handle, stderr=subprocess.STDOUT, + ).returncode + if scratch: + shutil.rmtree(scratch, ignore_errors=True) + if code: + raise SystemExit(f"Build failed for {task_id}; see {log}") + image_id = subprocess.check_output( + [*docker, "image", "inspect", task["source_image"], "--format", "{{.Id}}"], text=True + ).strip() + built[task_id] = {"image": task["source_image"], "id": image_id, "seconds": round(time.time() - started)} + print(f" done in {built[task_id]['seconds']}s: {image_id}", flush=True) +(root / "built-images.json").write_text(json.dumps(built, indent=2) + "\n") +print(f"Built {len(built)} task image(s)") diff --git a/harbor/checksums.json b/harbor/checksums.json new file mode 100644 index 0000000000000000000000000000000000000000..8558f5ab0dbd2af9536258dccab8d88c1b30a94d --- /dev/null +++ b/harbor/checksums.json @@ -0,0 +1,1078 @@ +{ + "build_images.py": "5c2f827a1350e6c455b04e6ea229ecef2b4a43ced0e4b774148deeabba8db303", + "evidence/coredns/agent-image-scan.txt": "4e1edc5f09a7f182869fe2a40a70e30e9d6b079ce0b47c2196f1aaa435f8ffd1", + "evidence/coredns/native-reference.json": "0a3e953c981dd02758fec46485f491a2a990cabcb0c78842397b2e073d6497cb", + "evidence/coredns/reports/broken.json": "a5acea37b4909f65f1ca63e2607f6b05301d6ef56923fb490297f4c160c21717", + "evidence/coredns/reports/infra.json": "3c48057993248ed8b3acb81b49a376b8a7d56511bf3848bc623b1badc446c8d4", + "evidence/coredns/reports/noop.json": "a45b68d91f121ba72252d9645979f68d8827ff8195c7fddb55ed09742f352ea0", + "evidence/coredns/reports/reference.json": "b1000f7cd9d1969b351a21314d071e21503d466469688f0a747f32d0738aa66a", + "evidence/coredns/reports/tamper.json": "a45b68d91f121ba72252d9645979f68d8827ff8195c7fddb55ed09742f352ea0", + "evidence/coredns/summary.json": "da336060e3e3629d3fef5d3b1142034cabc7ac8651f93661fcbd7acde89ba17d", + "evidence/epicyon/agent-image-scan.txt": "64bde5342e850db50b7fc29e3b18160ee613b929eb011425c21719693bc9e402", + "evidence/epicyon/author-calibration.txt": "3facadd155d7c36a78c7e9692a77ede6587591dc7ea3967484c369cf4f983768", + "evidence/epicyon/native-reference.json": "b7f6c5e5a0d72d3730bc41be18424a3c8dcccdac5756acb715d863057ef3db91", + "evidence/epicyon/reports/noop.json": "dd0da4de4215149b055db12dbc7ca1ad46805b81439c399345968445b1422bed", + "evidence/epicyon/reports/reference.json": "44e7f3b2a30f3a601f2fb491e298f7e2f39df2e80fa0bbc41fbf62f84654989b", + "evidence/epicyon/summary.json": "2f5b5c861dd3d47bd7c88045042758ecd0757a8ce24f64bbf3a0c2ee2d560081", + "evidence/packages-reproduced-by-final-converter.json": "a19439e007e957970955649216ca9738fa181bbdca275e00619893e621010393", + "evidence/rope/agent-image-scan.txt": "d69fcb18a03b44b915c8c5e88b48824deafc13f1a34fe39894653f1a154329c5", + "evidence/rope/author-calibration.txt": "0d1b481326461e13a6a6e6c2df973653c01631c04b1c741152322fc1574b4130", + "evidence/rope/native-reference.json": "4c169c74a8706e4776144e3df78544db018bdbf97aa16c5f94002cde8be9fb27", + "evidence/rope/reports/noop.json": "128fef862b573ae48015d06adf6a122564f14ffd12635edf21c361be1f74d6fe", + "evidence/rope/reports/reference.json": "2dea5236ae7b7eb04588e72556e210d7a85647b682f608c83edaf714de728620", + "evidence/rope/summary.json": "01646c0c531e926a11e633e9b7a284d1c7978852e9c81be035c3312cb732fd7c", + "evidence/zod/agent-image-scan.txt": "8bf4a7a7fd0cc01b30ba4835412f5625c07d3b6a3c95525026a1b1aa2e5db831", + "evidence/zod/native-reference.json": "46ac67cdc04ad29ea3517cc4b9a5431d017fd5e52634b530d238bd1b546c2333", + "evidence/zod/reports/noop.json": "27c567c24789b240b14d24cb2d25a9e9151cb3d83c18e74dbb0559cc86cec2c8", + "evidence/zod/reports/reference.json": "c77ba9fd4d0e99f08abd78e2a7100e691c46b890be98516c63a94803944935e8", + "evidence/zod/summary.json": "258f27fc7d7f73e309197a549fff28c6593289b5f939268b77c3cd8dccc6137e", + "manifest.json": "6bd1860c130742bc354cdc208cfa26d8fa23f0a11e92cba190c327ff7331df4a", + "README.md": "3567b902ee31834cb7e1faca2f46f7be3cc821c71825f3758ca309f61ad0be98", + "run_checks.py": "7b6e6b1b73094340091cfa149c2651d9090fd3d2966499e22fecfae78b496634", + "sources/aioftp-v11/.dockerignore": "ecdcac502122148f8a35d7f4836863e16e6dbd07228292aabfe6d94ec881b59b", + "sources/aioftp-v11/.gitignore": "cc4a0a767c03feb5e81b43560711e3260d719b16dcfde27af0fad38667b9f281", + "sources/aioftp-v11/Dockerfile.hud": "4ee69d7445d14257303975157314b2d4c1ca140c0f8686b8e3f165a4efb71688", + "sources/aioftp-v11/env.py": "bb68cf0e971dc83703016eaffff6e6e6c785bb1bbe5323287d5079a9d342152a", + "sources/aioftp-v11/gold.diff": "90b71765ae5d945b112d042be7044a1f152625dcdb70a14450d0ef32ec1036d3", + "sources/aioftp-v11/grading/__init__.py": "015ba2b8bb43cf17f189470599dbf5120a57562ea1880f1c5b209bec05d6ace0", + "sources/aioftp-v11/grading/adversarial-manifest.json": "c36ba9489b0c114dc589eaa256351943fb0106df91af06d664439a0813edb1f1", + "sources/aioftp-v11/grading/baseline/pyproject.toml": "9ccc6e1b7b1a5717bb2c5073f8f581e7240b98e59d4127f9c230ad61f5825365", + "sources/aioftp-v11/grading/baseline/tests/__pycache__/conftest.cpython-312-pytest-9.1.1.pyc": "526d7f60a5c8759582d72327e3a45f12fa6b2a36ad3e1931c3217d0de5fd97ff", + "sources/aioftp-v11/grading/baseline/tests/conftest.py": "ed906a09fc0abba18bcabf32d85e4b9c75687ba05eefc3612d0eba873c6a9fce", + "sources/aioftp-v11/grading/baseline/tests/test_abort.py": "24ca0b95436da88d887baa7da140ab1849f07036d84b6e4d5e2262f6fa93bf87", + "sources/aioftp-v11/grading/baseline/tests/test_client_side_socks.py": "17a49bdb9b7237efee5782bc075aabaa4bde9a8641186110e22991a58ffe4b46", + "sources/aioftp-v11/grading/baseline/tests/test_connection.py": "86cc26e7b59ddf336d095efd8ccdedb9119a6b4806304349bcced88bc66e33ef", + "sources/aioftp-v11/grading/baseline/tests/test_corner_cases.py": "ef968f43914f83db0df6b54c7980dcda81b0f1221708fff8bb31c8c77c5e1d81", + "sources/aioftp-v11/grading/baseline/tests/test_current_directory.py": "2ee6ffdfb86f19c8908b894f0098a0db3a3bb6eede9a87736594b92bacefaddf", + "sources/aioftp-v11/grading/baseline/tests/test_directory_actions.py": "a0986ec439bcf96a872d9718c6e1dcc15194c387f921969d2b30af3e8b61cc0d", + "sources/aioftp-v11/grading/baseline/tests/test_extra.py": "4894930934b98a55fac231fc38079a8773a90bbeaecf2a4ba2a1a614f47b50c7", + "sources/aioftp-v11/grading/baseline/tests/test_file.py": "10d8d4abfd0376b6dcafdcb38ff305fadf919b92ca66ac567df76c2664d84f8e", + "sources/aioftp-v11/grading/baseline/tests/test_list_fallback.py": "cd2dee24f1003d50ae477cf5862dd9486e4f2f6fb06f13758f32cfb6ff2e193c", + "sources/aioftp-v11/grading/baseline/tests/test_login.py": "a7926c0f6df8fc085360657a9f7a8ad120d27c131fe9326301068caf825b5dc5", + "sources/aioftp-v11/grading/baseline/tests/test_maximum_connections.py": "66ded716880acd974cf015e54217c1fe71324b4be70705889a6ac35f676be77e", + "sources/aioftp-v11/grading/baseline/tests/test_passive.py": "44b2f152aac276cf6857e7ad11e02dce3bdcda12524818bd38dff0d49f518a85", + "sources/aioftp-v11/grading/baseline/tests/test_pathio.py": "f1acb1890aec9fa9ca4c95c93b6d2dbc0223e082eb9ce467933f6e38f3c63618", + "sources/aioftp-v11/grading/baseline/tests/test_permissions.py": "681d606ff0bec087246eb43fc80023c6e1a1875235fce580577c30794766d71d", + "sources/aioftp-v11/grading/baseline/tests/test_restart.py": "edc763956c87af6a926e84499c83926652c3378d0a9621c12aa19d634b528149", + "sources/aioftp-v11/grading/baseline/tests/test_simple_functions.py": "05b0d65b6f3393d3276288003fe2a40ab5185b1632b2aa820ef1ac1c053ac0e6", + "sources/aioftp-v11/grading/baseline/tests/test_throttle.py": "3906d83a367b56a590c28f40a0f23734d307ff573b58a6ac29295e15cc0fb4f0", + "sources/aioftp-v11/grading/baseline/tests/test_tls.py": "b89c6b596319ca147f8c80399a1c2fd9ff548d3c68441c77d74c6876d4032424", + "sources/aioftp-v11/grading/baseline/tests/test_user.py": "e98fd4bed2495d2233bb4843bb3bdd75bd15f90fd0b2e78e85cc5971d65f4e8d", + "sources/aioftp-v11/grading/graders.py": "878a4661ad6e293c73f48e51189a299320c36c2fbaa4c0c0ff4fd9ed109fabf4", + "sources/aioftp-v11/grading/integrity.py": "a91045832e8e9523b6ee9604d7015903ec8c4e1d817b209098653361043c78d4", + "sources/aioftp-v11/grading/probes/client_probe.py": "7ba5666795d5e37f71d578d5401b4fc169e40f3d5e1961d6efd88fcd5e38e24a", + "sources/aioftp-v11/grading/probes/hudprobe_common.py": "1160eef42a1a60b22cb6943d21c634a1bb66558074fd5d2d98978a18b303a97c", + "sources/aioftp-v11/grading/probes/hudprobe_fixture.py": "1b5e85b4e09fbd881de2b9dc5848faa220adac287104b49fdf90a684dfd2879e", + "sources/aioftp-v11/grading/probes/server_probe.py": "a2f2273cb42233d19e105fdded53d7937251aa9fe348d9593d0b775e8b9265f7", + "sources/aioftp-v11/grading/regression.py": "435f6f69f8d7fd20ea80772aad277d5fecfbcba6b4a2b8ea37d7f121fc3bbfc9", + "sources/aioftp-v11/grading/runner.py": "2eef4deaa92c8df8732154b3d33e82bff660cfaa1b55d1c2aed86009216d2f1a", + "sources/aioftp-v11/pyproject.toml": "894957c394eb655e825a9ab8ece7ee5f01171c4d1e41a67c89e86fcaa66f8b9d", + "sources/aioftp-v11/runtime/aioftp-dev-requirements.txt": "a65297fd0973c1dbbcd25004ed49b58f26dfc2868876eeff0c2bf2b5b5e25153", + "sources/aioftp-v11/runtime/aioftp_ipv6_loopback.py": "2514b815796647ad6ecf69bc842a9ff1c81c0b5eb840d6fc2ec5c1dcba63a468", + "sources/aioftp-v11/task/__init__.py": "3180fc4f9067aa9f8414a0ee316839d4403f40a95b45123a958105d3b7c9c63b", + "sources/aioftp-v11/task/prompt.md": "a25b3a327144d41ec056ef28ee50b947ab8ba54b0beefaadc10042f4a12af336", + "sources/aioftp-v11/task/rubric.md": "5d7e1ba0f45ed6a4212d5d1509330b21c22d1dc3c248bb29eb07d848a84804ad", + "sources/aioftp-v11/tasks.py": "f1ae735b341ac16bff0383632a5f9568ab9971bc51cee6833825afb9c345ab50", + "sources/aioftp-v11/uv.lock": "33ff3a287a49bc7e6f5b2dabc4a182c39bb68059ed73db6b9610c5ef885da2c4", + "sources/apscheduler-v17/.dockerignore": "9cbc9649b96610a1459489a3b71b97cc72612d6206ae7241fc85bbc03cfb0dfc", + "sources/apscheduler-v17/.gitignore": "cc4a0a767c03feb5e81b43560711e3260d719b16dcfde27af0fad38667b9f281", + "sources/apscheduler-v17/.hud_eval.toml": "29b6b75bb7aaa7d7c5970698698db0c2448859e16250ac811e96206ae3beb0bd", + "sources/apscheduler-v17/Dockerfile.hud": "673bd394462237ae0a148bbf8d9ea9881d8784cfa4e165d10f6d85bf4d6e3533", + "sources/apscheduler-v17/env.py": "4244e191b77245c5610e24db4a56dd5ca453281c4717d172f2eba6b6ef680724", + "sources/apscheduler-v17/gold.diff": "edb02a29a38511ccf87549d1eb5b37476ee885f08a09980e46d81d30edf2cb7c", + "sources/apscheduler-v17/grading/__init__.py": "a3800996e7c812ac92878ae0d890add84d6f77a57e8124381bfd64036b2f6464", + "sources/apscheduler-v17/grading/adversarial-manifest.json": "a748fa89abe930cc04c07ec94cc788515d0b4035fec94660472beacb90a683f2", + "sources/apscheduler-v17/grading/baseline/pyproject.toml": "e6bd657757a49ce4af4c47a8f5a619468b19c118648f22088fbe44b3faf5f78e", + "sources/apscheduler-v17/grading/baseline/tests/conftest.py": "ae7927e46a63aa5e07a6253c533020b70f799a5e620aabff3ada6ae0afe76144", + "sources/apscheduler-v17/grading/baseline/tests/test_datastores.py": "c1777bfbf7cfc923e73bc1151d907ab412a8e195aac25dfe0f979d8d6cc422af", + "sources/apscheduler-v17/grading/baseline/tests/test_eventbrokers.py": "230e2875089e3b4dd8bb1a5647f71c786dbedd958af372e5471c8def186745af", + "sources/apscheduler-v17/grading/baseline/tests/test_marshalling.py": "35badaaea0fbb6e366988bc1a3b01deab1cc1918e216cc7dbf7ac76be9162571", + "sources/apscheduler-v17/grading/baseline/tests/test_schedulers.py": "bf48138a2b39414af902040e1783279441b10565f354f33856d5c2bc71aaaf04", + "sources/apscheduler-v17/grading/baseline/tests/test_serializers.py": "23bd3696bfe30335a80383d34d71ebe3effdee686f4b8802b24c5f71b2db82c0", + "sources/apscheduler-v17/grading/baseline/tests/triggers/test_calendarinterval.py": "e19605d5e2896e48d82c31112488d6a2179a023432c0c2cfd6a099af0ccf8549", + "sources/apscheduler-v17/grading/baseline/tests/triggers/test_combining.py": "85bdd7e75f5bb401931ed51097af4b8a3ea9594f0a4eda13623a7767951828f3", + "sources/apscheduler-v17/grading/baseline/tests/triggers/test_cron.py": "a45896ea795519e0c8b80301b2a3c7e0ac72c91da1dbf8094a2384328743a021", + "sources/apscheduler-v17/grading/baseline/tests/triggers/test_date.py": "13d0d257464527f2e8b665b20284ad1b48ba34fa24c62d7d8eef88c9575d7817", + "sources/apscheduler-v17/grading/baseline/tests/triggers/test_interval.py": "06a15396b2dfff862afca5dba8fd3991bd72855ccc8e1682f8a539dd38150358", + "sources/apscheduler-v17/grading/graders.py": "4472b77c0865583507fff6deb56e3db5950e84b6c61b96d6a54edf9166ce178f", + "sources/apscheduler-v17/grading/probes/probe_cases.py": "59857d9e5480e47ee197a2bb246a7ab162d303bc8b32bf91cb5a5913108af943", + "sources/apscheduler-v17/grading/probes/probe_main.py": "3e2b5b79e9707e5c3f80265a46e52c09d3b916f96a0ce13c31e00b43efe6c1b2", + "sources/apscheduler-v17/grading/probes/wall_main.py": "c3318e919e22e032f248ed3e7fef6d763b99ccc6649fc4ba87cb45e913dabc55", + "sources/apscheduler-v17/grading/runner.py": "e8860dd3005bf17056d7685f1726c49c3dc6949fc0b4df1cdd99807b86ef75e5", + "sources/apscheduler-v17/pyproject.toml": "6150e9dced1184ad153f785cbf56513b06f3eae50d9106bc6f6e0acb9f97f2a3", + "sources/apscheduler-v17/runtime/apscheduler-test-requirements.txt": "ec944173f45c14ebe8ba911a72573f5112417a98aee3d671dbcdb5d99f6ba722", + "sources/apscheduler-v17/task/__init__.py": "3180fc4f9067aa9f8414a0ee316839d4403f40a95b45123a958105d3b7c9c63b", + "sources/apscheduler-v17/task/prompt.md": "a14f4676537227c39e924c6decd77b2d6f8ca1782d4818ee7b01c7c554208dd3", + "sources/apscheduler-v17/task/rubric.md": "7858794e9039ebeab082bf2618a72555f028c9cb4be4554b6c19b4500690f17b", + "sources/apscheduler-v17/tasks.py": "e6f5daa900ac5317fc0d800836b46c9d33e6f177959ebf4d42824f486b559f73", + "sources/apscheduler-v17/uv.lock": "4eafff4d607e40e957b1d74af27e31afeb952eb997efdbc51265b2c3347ac5f4", + "sources/archives/aioftp-v11.tar.gz": "1895ed12246b0256d2bbc9368415967403638236132865c097a56d591b19d67b", + "sources/archives/apscheduler-v17.tar.gz": "f0fac3c28154c8042b2b8a01b2441a9a83eb8556424060fba860dbec19281586", + "sources/archives/coredns-v4.tar.gz": "f3e54c704918dc7b5043354e24681e708f15164f4069f857d4abf9de0faf796d", + "sources/archives/mikro-orm-v7.tar.gz": "8031b2f407a804aa05ef75b76e91f8e6c194db01614878e49f41967128e9062b", + "sources/archives/zod-v7.tar.gz": "feb1e6acfc057e95a3a89532cb7f322f2c08f6bfea65556d66a04ceca877a5bc", + "sources/babylonjs-v8/calibrate.py": "f9c3ab4fb2a84e59a9b2caeb7d460dd149a938aee0ae567857db10b43fc67cb8", + "sources/babylonjs-v8/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/babylonjs-v8/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/babylonjs-v8/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/babylonjs-v8/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/babylonjs-v8/Dockerfile.hud": "1bf6fda56ec77ff82b379ef800eaac4c421c65629867be3f6eebc0b84834182d", + "sources/babylonjs-v8/env.py": "f2be94e0ce17711aac024344612f1fa5521ee8955f873630a4fa8da3d3d4870c", + "sources/babylonjs-v8/pyproject.toml": "9d131674a6b9f142982d457c30b8523ee0620de1afd8111f01fd9f89726b4498", + "sources/babylonjs-v8/task/gold.diff": "0b210c1391f278f9ddece65c4a091d21c6be7eb595ee940e22fb785455253ab5", + "sources/babylonjs-v8/task/grader/controls/alt.diff": "8245813e33063b5fcdb339aad972fedee84dc62f93a8b4e2aceff957336b51f2", + "sources/babylonjs-v8/task/grader/controls/cheat.diff": "52feee2ac523d8e63e4119379bcfdf90f9511847fea2e338fc038b16ee8a9bde", + "sources/babylonjs-v8/task/grader/controls/lazy.diff": "f9a88f5220ee3b578097a11352f31f6071afb1b5db3d409704c66a6e068b0165", + "sources/babylonjs-v8/task/grader/controls/w1.diff": "b323dd01b5dae2dd8b103652f22ba5bfa932bca615d8ca2cabfc012da19da69f", + "sources/babylonjs-v8/task/grader/harness/cells.test.ts": "aa940296ffa498584135e2b87729186971a0db103e1f17b01a0b16cf50d01afc", + "sources/babylonjs-v8/task/grader/harness/vitest.hud.mjs": "817d8cdf92b3c1c6fefef65a84bb45c66f0a3a5ba071167a27d0df28dfe37d66", + "sources/babylonjs-v8/task/grader/run_grading.sh": "8150f6bab74a137ef8a264e447b90f8f05b025ba59a994e4219e67f5a94e9925", + "sources/babylonjs-v8/task/prompt.md": "25fcc0a593f29e2d78bd000043980ab1d93d9359b8315013f582f7f7bbda8670", + "sources/babylonjs-v8/tasks.py": "5c647abf07c219e0efdda59c856636b6adb7b98c308494e5d18c8f8eddc7bf3a", + "sources/badger-v2/calibrate.py": "f35c8dc1c8faa328004feb739d066c6e0caa1041ffaa306fe33304f3080382e5", + "sources/badger-v2/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/badger-v2/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/badger-v2/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/badger-v2/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/badger-v2/Dockerfile.hud": "f0031feca767b0ed9ff2c2de0cdc9e714c74d7f63e8a0f3e1d1deef45fad540c", + "sources/badger-v2/env.py": "87a7c5c754cb9669455e2fac0406278b4bf4679b8deeeebae8fa96e0e047ec2d", + "sources/badger-v2/faultprobe.py": "ba1202bfe1e1ba103901e47f82649a2a4f4e8e7dba9e7b92483e4e7c9b3c095f", + "sources/badger-v2/mutprobe.py": "738a7c8a4410fb62cad5e76068087de45aa14941b2b8df3424bce000feb12aaf", + "sources/badger-v2/pyproject.toml": "a03b1dea5baa5623194be4450e10da4102c051a58aba8d0e8495be07831b5742", + "sources/badger-v2/task/gold.diff": "1027bd83dbb91dd242cc39b17e16c23c3ff4999fdc00f7170453d19e49eabe00", + "sources/badger-v2/task/grader/driver/build_driver.sh": "441f9f33f5c46dfe5e37c50f80bd38c085d534fc23997fe1ce4fb31e02ff32d2", + "sources/badger-v2/task/grader/driver/child.go": "5364e132b51e3f777326f9eca47f5774f1cb19e9906dc9e8019cc1b6b7a8faa6", + "sources/badger-v2/task/grader/driver/fixtures.go": "dd98bbe8d6677a2d5444b0f40fee8d9ce18ea66e0d5a56c6e1b1a252047d6148", + "sources/badger-v2/task/grader/driver/go.mod.tmpl": "37a9e476e0340c8761ee1acec40b52ecb51e83add3e4af67c1882af3cda3bd32", + "sources/badger-v2/task/grader/driver/go.sum": "1b55494a77d5610e01a7f7bd4973e66b0f913d8c275195d80fa438e520399cf7", + "sources/badger-v2/task/grader/driver/main.go": "86325fba79d5f649ae2230436729c867e45bd61c46146a07d7fac11e1b27bf18", + "sources/badger-v2/task/grader/driver/observe.go": "d6c392bb9326c51af06ddd0775a1989e62a6b9ffb9927e08c5f024f800ab13a0", + "sources/badger-v2/task/grader/driver/program.go": "66b27109098e62f14f4ebe7fe5ab9c391445a6b79b85ec247024ebb4963dd4ac", + "sources/badger-v2/task/grader/driver/surgery.go": "591ebfbfab53d861121e07ab860dd0d9abf0bd069fd0f36ef72e008d3a1b9756", + "sources/badger-v2/task/grader/driver/verify.go": "5253733c38e8d6d4662e7e4ed0391e0f77f1092947bd4226d5d81f4a08125ce5", + "sources/badger-v2/task/grader/fixtures/killed_and_whole.tar.gz": "1493ffe05f758ea41e59b8a42b8e5e307e2534ff84d26c4fd7fa018dfd91d252", + "sources/badger-v2/task/grader/fixtures/torn_log_with_older_ones_behind_it.tar.gz": "084f0ca0babf200047b55f2702addac5c0203bf063cde3c9f3a76cc1664e6e7c", + "sources/badger-v2/task/grader/fixtures/torn_value_log.tar.gz": "8da672d8a0f83f69f83936eb94ce36578b81fd325c260b20d2a2745785a1f6be", + "sources/badger-v2/task/grader/run_grading.sh": "5f527d179db7944b29d59613561bd3dcfacff3b488b8028a4f3896263c3e51f9", + "sources/badger-v2/task/grader/tests/check_journal.py": "8945d49e75a4f2f94f14f1cfb704274a88fe3a457f57e3c3dddc8fc99346cab1", + "sources/badger-v2/task/grader/tests/new_vet_diagnostics.py": "219421ebc76649bf399c54128f2bfb53b5d7b7868c6e342d144fc570ed20e5cc", + "sources/badger-v2/task/prompt.md": "e235e9cfb731a8d638fe30c29652eb17c5e2241a76c3b1a674fca88f0f792110", + "sources/badger-v2/tasks.py": "bbf54c844b7da9fd1349ce772688c1122e00b4423873eea5feef6f3843983690", + "sources/badger-v2/test_weights_and_faults.py": "3eaeaa76cdcca818d0c6960f6e3ac883c5a3d4bee1065920362c5783556856bb", + "sources/bazel-remote-v2/calibrate.py": "83618027d796594887ebc44be632e69cd8f89eb39e66039b8c87971f8ef968d6", + "sources/bazel-remote-v2/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/bazel-remote-v2/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/bazel-remote-v2/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/bazel-remote-v2/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/bazel-remote-v2/Dockerfile.hud": "52de60a32cba13c875c751ddc3a45bb369f050965eaff6595aaa573c82107de3", + "sources/bazel-remote-v2/env.py": "2ba1517a839fd7b38b3f9e701ef4741351e3b3c3f577eb4a56a65946ffc956c5", + "sources/bazel-remote-v2/pyproject.toml": "e2593954ec69b158120f49775b8ee54e5058b888319e492cf5ced12dea67691a", + "sources/bazel-remote-v2/task/gold.diff": "1976bdc9791db2f87dce423eb2f6ed5056c82a42c0973e23156dad1db9b10851", + "sources/bazel-remote-v2/task/grader/controls/alt.diff": "43162609826d241f9faf52830f446f4bc6d78b67b0ff8d6bcb9c4a22855ad2d0", + "sources/bazel-remote-v2/task/grader/controls/cheat.diff": "9dbe991b917ff847efea11cb31dff05ad9a6df9f1f0c9c1cfaffb60535312722", + "sources/bazel-remote-v2/task/grader/controls/lazy.diff": "2a15431225ec43bf4b70ea490ee83669886f455da71a3ab6ed01f47c7a4d915f", + "sources/bazel-remote-v2/task/grader/harness/spec/cells_test.go": "de51528d91ed7b44452861c036e782a66df838bfbc6748abccaed1ab704cf195", + "sources/bazel-remote-v2/task/grader/harness/suite_gate.py": "c2fe01b49f83cf4d28ee0ab36b42285f2e6c205ca45003d82a9d3d29c5b36b8d", + "sources/bazel-remote-v2/task/grader/run_grading.sh": "344e3b6df0af414c9a49287a333e2d79ed25da263dccc76718bc6dc15c0d1448", + "sources/bazel-remote-v2/task/prompt.md": "9518d37eeeed2f588b5dc636f6588283863f56f975aa9af9df3281316065b8dd", + "sources/bazel-remote-v2/tasks.py": "d7e4325c619978a106a8a61e30b8db95e9aa25ce10e234c0479ee317916bbe47", + "sources/celery-v12/calibrate.py": "b4c5f350bcd17f82274e87cc39498c2deae3fde4a51e850ffa2d65552816f968", + "sources/celery-v12/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/celery-v12/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/celery-v12/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/celery-v12/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/celery-v12/Dockerfile.hud": "3b30ad740df775d3f1799fd49afff769fcd8ca8b608b80209ea8572641ed8d93", + "sources/celery-v12/env.py": "6a239c604eaf5e839018fa69cf3ba85e98e2bb0fe902cde4b82653c8be542e8e", + "sources/celery-v12/pyproject.toml": "15cb6dd48c9c0b4548b548f2b381f1c67bd70efe7c6b101bd6b7ea9d8ae3ea56", + "sources/celery-v12/task/gold.diff": "6852a28943b827603b65f459bc2934644b6366cca96ced331fcc4d746ecbcf73", + "sources/celery-v12/task/grader/cells/spec_cells.py": "47c7f8ca6e284806077729f2bb4b00e81a40bad14805e87c56f359569a8ed2f4", + "sources/celery-v12/task/grader/controls/alt.diff": "30a2383a0e725ea274d49555bbf29a347af6da28b18aaa9b0fa3ceaccfc4375f", + "sources/celery-v12/task/grader/controls/cheat.diff": "5b8b9b695a1744ea47a70a9ee09a56bcf66286394b4b6cbfaaa71898bacb5edb", + "sources/celery-v12/task/grader/controls/lazy.diff": "d2120c004c28db2b0ac3db4c7aee9fbb1dd21546c41000f9f3846a7ff043f784", + "sources/celery-v12/task/grader/run_grading.sh": "07ca34d1dbc78a055cae51867c5da26615df6c7217686ce754ef5f9cc72748b9", + "sources/celery-v12/task/grader/suite_deselect.txt": "a5d6a8df2b8d703402f3582aad58457725ff273e34c67989c6054d71f4f03d7b", + "sources/celery-v12/task/prompt.md": "c030c10f98599a520ea0ad07ebcf6bf95c42b43c7fbcd1438a67d870643fc965", + "sources/celery-v12/tasks.py": "fd2d22dc91aff67df560189eada02c53d0184b38f652968da3c6740efb652e18", + "sources/celery-v12/toolchain/requirements-agent.txt": "7db5a40345fbd899c41c12c8d5d7d808b961e0a260d6ab5e7b92b3a43c29187a", + "sources/click-v9/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/click-v9/coding/github.py": "5111a2264c70710a90ea6ecf154147eb7757311bca4f1bce7ea975c0da9525ae", + "sources/click-v9/coding/repo.py": "f9b001028bb965a50740cdf90f84ba1dc93fda3daa831c42e58d712c6af74113", + "sources/click-v9/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/click-v9/Dockerfile.hud": "e81f85447f1b496b6651f8caf1223bf591c9af8fe3ec7ab1c5b2bf0378aef54a", + "sources/click-v9/env.py": "bacecba58799114163fb06badab8923c430fb577123b647d8ef6844231b9d770", + "sources/click-v9/instances/.none/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "sources/click-v9/task/base.diff": "4233e1efac3624a7747b8340e162763cc096b491c78f33b8ea329bfd9f9f7ecb", + "sources/click-v9/task/gold.diff": "a4b6ffd958b6cb2d73f76f8410ebf72bec46d78669724ee72cdb907af8eac6b2", + "sources/click-v9/task/grader/maintainer_review.judge.json": "374ab90b38347f2dd0c2b4678b83ed443f20163ce9e94babfc4b1c435eb7173f", + "sources/click-v9/task/grader/run_grading.sh": "8cdaddf00bc1ba76f226900f2bb892724ea5707027cca0f0f2ae1998d52e382d", + "sources/click-v9/task/grader/tests/__hidden__multi_empty_string.py": "cc20a835b8c55766f7b62588bf3689b7ca63bc94cbfd106ec28cc736a02aa212", + "sources/click-v9/task/grader/tests/__hidden__multi_enum.py": "bc06c08b5f8fb9829bb65a1db01fc9ad1a885acbd3c6357303f94a5e67aa2ef9", + "sources/click-v9/task/grader/tests/__hidden__nested_values.py": "0742b77e0b55f80c2f02fcc7ce1aa743baa589f79dc067b18c24c5ce7ae3f394", + "sources/click-v9/task/grader/tests/__hidden__prompt_function.py": "cc044df56a1bc062b7d4974c8b786b811fd6012be97a4de1a028b58d2fe90fb3", + "sources/click-v9/task/grader/tests/__hidden__prompt_rendering.py": "2b98173cb8cd1618e1c9cad58838807863bce2c08ec92726d8c7521e016d74fe", + "sources/click-v9/task/grader/tests/__hidden__typeback_multi.py": "ddcbf8a78634741148b509800221f4fa6b7f7281327cfb028be99a4f59a454cd", + "sources/click-v9/task/grader/tests/__hidden__typeback_single.py": "707588128bd9a211a391add23f3512f2b3755f35356f12520a0a8def156e4f05", + "sources/click-v9/task/grader/tests/__hidden__untouched_paths.py": "72f44182a4f38e5e7607b60ffd18f5b0f3c48086617f61d8725669428aa820f6", + "sources/click-v9/task/grader/tests/_fixtures.py": "77464690ab977f8c39e0704b061920a72ddd7982c54171b52ff9f6393a5b2202", + "sources/click-v9/task/prompt.md": "bdcc4b7a286451ba09dfa4460d3e30e6097f05425c68b39974b1700ee15f864b", + "sources/click-v9/tasks.py": "c41166d46072623ba329638e4626cef8aa4a850334e3d01b91a5fb072cc7c3e1", + "sources/coredns-v4/.hud/config.json": "6b9637325ad710fbc32104a48ffa447864b435122be4c84f946d6f3c7c722d6a", + "sources/coredns-v4/.hud_eval.toml": "e73965b0804c9d665af0c9fd934ab1d36011f53c17845f0e8bf2290b1bfb0d75", + "sources/coredns-v4/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/coredns-v4/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/coredns-v4/coding/repo.py": "f7ca325465530ac6aa06652dd9468696483cddefaf78c80e25926f6785ad1701", + "sources/coredns-v4/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/coredns-v4/Dockerfile.hud": "cb7b827e8c9703e63dc381a2bb35fc52643ad1ba92461be42acee83e49383126", + "sources/coredns-v4/env.py": "054616eccc94d169ddbcfbe67af6fb40551e5a3cac8361005ebaf3e001de0d62", + "sources/coredns-v4/task/gold.diff": "e63695cb627adef3e6042ff8efd7933e561f74233a25ada6a6170c825c0b149d", + "sources/coredns-v4/task/grader/run_grading.sh": "8a5271158f80eb13a869e403d24f92bc8a642f28623f4de0cf9fe48db34e8d0f", + "sources/coredns-v4/task/grader/tests/answer_extended_records_hidden_test.go": "ac202d6a183816b45c4a2fa0d04f459dd99fe901bf75d2e9108348b7c53e6719", + "sources/coredns-v4/task/prompt.md": "4461641c85775edc5f12dbdb874cf79b99fc4b9758d8d1fdf6dc2c0aeea4afca", + "sources/coredns-v4/tasks.py": "fa3d685fd68ecec248c9e091ebad8b2d7ed28ea7a86d0089595396fa9530b459", + "sources/druid-v9/Dockerfile.hud": "ca6bfacd7b32bc087e13862b268ef20fbcbc43757ca2a6eb1b0944400142ff5c", + "sources/druid-v9/env.py": "e77d13f90f806a82e710ce2df91341be5bab2ab83c477fa2fd178b8cc573cf64", + "sources/druid-v9/judge-check.py": "4c5f2b1506cec8748dae9a67792d522ec0120c0c732832312fd0246f764ad69a", + "sources/druid-v9/preflight.sh": "434aec61de056048fd165285b58422663e50e33f87fbb924afcac05bb3340cd4", + "sources/druid-v9/pyproject.toml": "d610819e2e35a1fd868d505fe5010b590c93e4c34a1f5a3cfa3f7339c56af81b", + "sources/druid-v9/task/alt.diff": "c16e1c0eab8ae2ce065991979d5d3b4db51596eb17aa938114c34737e3528b28", + "sources/druid-v9/task/gold.diff": "adce1565f26d78f982a19fa3f5e7f18e44ddbae5dfe631a0f3fec6442daa228c", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.mysql.clean.sql": "cbb3164274f0e6503bca21365ae1fdcc4f2ef0a124d75f3a92519018fda561e5", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.mysql.expected": "99e412d825fe24e8ce588ea0057c9e82880941b51793c403f2b2bd6223b10dbf", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.mysql.sql": "75f23ccd11e80b3abac102becda459f5bf47d455021c91b94f55f863ac5cf49b", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.oracle.clean.sql": "e0fea6bc9aa58e939107749ab20ac20b75903b5759a9b2a1a5675f5f4c50cb35", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.oracle.expected": "9956862d75d073bb1726dfb75d86e10305faa0c808437b5e705b1fa7ba68bae7", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.oracle.sql": "c4d57a411781daecf57849f6d54b978bcfdeabc44ee6c17447f7e602043e48a6", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.postgresql.clean.sql": "6f8b13dc632e53b8fbbc66bcc7a7e22fdf36d1232c999c9fef064e0283c66dbf", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.postgresql.expected": "ea3cc5fba461b8c352709a0d0bad6c8a1b33a404e3fd8e4737c2fdb25d0d28ff", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.postgresql.sql": "1cca12ebd07a55a5bb5ebf5f63492f13e26e984d902f4f07d10b9f4c6cdc115d", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.sqlserver.clean.sql": "d6e205602e295dfa60ca69f7e116f59f10e2070b24b6fb6b67f590f56f3af3dd", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.sqlserver.expected": "90effc22535965223f0bcc2f55d83fcf4a4ca0df28aefefc998d612e3711dfa2", + "sources/druid-v9/task/grader/fixtures/block_extent/block_extent.sqlserver.sql": "34d0684ff39d1270f6c11e5d8b4dfeb4f03df12329855aabb7f9836c1e2abe25", + "sources/druid-v9/task/grader/fixtures/budget/budget.mysql.clean.sql": "01483a80afd6fda225e58b49f564ba613a503b96c1051b5d28b0ea254107ad80", + "sources/druid-v9/task/grader/fixtures/budget/budget.mysql.expected": "07bee126cc83afc0c1fec82d58b6ad59b7a49d8ad56468f1cd0e5eca3210a7e0", + "sources/druid-v9/task/grader/fixtures/budget/budget.mysql.sql": "030e8475d8fe10f149eab41f9fba8e88eaf06a02535779b28dbe88730c2aa808", + "sources/druid-v9/task/grader/fixtures/budget/budget.oracle.clean.sql": "c3f0172d6242aeca2b2d645afedfe752eeedb1a217bb394b1093c1bf7911e5f5", + "sources/druid-v9/task/grader/fixtures/budget/budget.oracle.expected": "5eeba8ce0d49158efd361221f9db2c361b4b8ef80003c8161e93026631a83bde", + "sources/druid-v9/task/grader/fixtures/budget/budget.oracle.sql": "a41aa27b241dba9c7690b5b21e256ca792f1234b15e9b41931811e2abca917ca", + "sources/druid-v9/task/grader/fixtures/budget/budget.postgresql.clean.sql": "1a4f79a991ed90f1501ff3b82ce0201f26e4ae35ccdfb480636996921fb50e7b", + "sources/druid-v9/task/grader/fixtures/budget/budget.postgresql.expected": "735e667a43f1f812e347d67096fb75ee8a3c253748dc3240e8c2ffb5d3a306a8", + "sources/druid-v9/task/grader/fixtures/budget/budget.postgresql.sql": "15fcb623b46dc7ee8c690f0c2ecd513637029daa026563f63a6eb09b6bd27d27", + "sources/druid-v9/task/grader/fixtures/budget/budget.sqlserver.clean.sql": "0c6d2048c4f1557540fa0f42d5875e14736c737af3eccecc0b88e8a837033a78", + "sources/druid-v9/task/grader/fixtures/budget/budget.sqlserver.expected": "78cae58e75584566a870943619c588eba3eda6a3a973e0ee51525c87fc4ff0d6", + "sources/druid-v9/task/grader/fixtures/budget/budget.sqlserver.sql": "ff32b9f21b84311fb197453c964f3f4f0b27731cc134ecc773e2a7d7ff5a296d", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.mysql.clean.sql": "16536841d0b038842cfed4fde2a1c176776a5f5d8cbe332fad25e32fcd4fdad5", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.mysql.expected": "fb52855a3ab4ff82710595850f6d1ac2f15f01daffc3aacf71185002e439032f", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.mysql.sql": "16536841d0b038842cfed4fde2a1c176776a5f5d8cbe332fad25e32fcd4fdad5", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.oracle.clean.sql": "add4aedcaafe82f0f4e0864b120a7741ae29dc8109e4a5a27368e9740d48095e", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.oracle.expected": "36d091f8fb9ae38e4b4162da379d94f39c59b97c4e73d802cd2c05c6ef38e2a9", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.oracle.sql": "add4aedcaafe82f0f4e0864b120a7741ae29dc8109e4a5a27368e9740d48095e", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.postgresql.clean.sql": "cca8796158ee25718a71251ad370f16c8626b2cf2ea572c86bdc14c214f6088a", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.postgresql.expected": "98b24706c0b955030ebd1dc296d30a43e7a4d1e1923fbabf955512ccde5e3d22", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.postgresql.sql": "cca8796158ee25718a71251ad370f16c8626b2cf2ea572c86bdc14c214f6088a", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.sqlserver.clean.sql": "3024ae747d620baf53e7184674fe499b05b490478b7fd04ac7fc24bac1681d5a", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.sqlserver.expected": "96283d91327d3ec5d14f87a89abed4bc53f0ed5240814eae67dae5c1eb79a23e", + "sources/druid-v9/task/grader/fixtures/clean_equals_strict/clean_equals_strict.sqlserver.sql": "3024ae747d620baf53e7184674fe499b05b490478b7fd04ac7fc24bac1681d5a", + "sources/druid-v9/task/grader/fixtures/comments/comments.mysql.clean.sql": "45fc52e95ae5bd7550d32d74e746d4220001bce017e1c1d8c0e3a80ad95ed8d7", + "sources/druid-v9/task/grader/fixtures/comments/comments.mysql.expected": "2dcbf978e509c56b97413e67c67510b63c9f248ad90cb065bece413f0d346721", + "sources/druid-v9/task/grader/fixtures/comments/comments.mysql.sql": "1134594012868337098e29e878cf59430b41863ca5335c621675ba0142bc664d", + "sources/druid-v9/task/grader/fixtures/comments/comments.oracle.clean.sql": "b89de53897ff885921ce516d8bfcf6a3a7ea8798cb39405dbd9b1dff37257d28", + "sources/druid-v9/task/grader/fixtures/comments/comments.oracle.expected": "7df627031e262f805de6a64f527eeddecef21aeff528c02923a01fcae7b6a7cd", + "sources/druid-v9/task/grader/fixtures/comments/comments.oracle.sql": "1a785a5295f1e3f806432c50b29007df68a071b588153d77eb94925b198c841d", + "sources/druid-v9/task/grader/fixtures/comments/comments.postgresql.clean.sql": "fcb10ef1200b2bc7137b4f48bbd4a9137cfa99b5abd89c86cf95d8ebf74ee2ac", + "sources/druid-v9/task/grader/fixtures/comments/comments.postgresql.expected": "51558f1629294fb591011c6448a3f5fa03d2e2066e2e9af49d94d16e018c9438", + "sources/druid-v9/task/grader/fixtures/comments/comments.postgresql.sql": "08c130beeb2cc5dd7e2eee5cdbde06ead2d7b440a6a584aabfea31cd12a02407", + "sources/druid-v9/task/grader/fixtures/comments/comments.sqlserver.clean.sql": "f26f79f328556f06cdaedb6290a1381fb1b5759b35299f905148bb63a43e9cef", + "sources/druid-v9/task/grader/fixtures/comments/comments.sqlserver.expected": "b8cb3759c77bee28897da159187068292f998248b171dd97dada5307dbcb30fa", + "sources/druid-v9/task/grader/fixtures/comments/comments.sqlserver.sql": "ba1f8d95cccc201951b570653d66006bedb5b06c6e360e3e1c1c9053bca89a1d", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.mysql.clean.sql": "01f11cbe6d7a8a8f366c4cf429f3650c047fa6ac45a7bc53ebe45a54cad022bb", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.mysql.expected": "351dd6eed1361178bb680195c697d31d8b6c9a8529bfb7d05e2b9275a3240b7a", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.mysql.sql": "dfc8aab9881b345fcb24413be752d9f19590357fca757f0c12e708a3f0329832", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.oracle.clean.sql": "8c378b64659bf194a2339d37b2700898a36600fd96d0d5690b3885d4a9f2ec9a", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.oracle.expected": "4a59b303bf1ad531f92769609241806a3c1c5b89009d312f5441bbca50d695ac", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.oracle.sql": "7bd557c883d7c230e4022ce844d8fea3dd5a1a40f15f233bd6839f65f2e43df0", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.postgresql.clean.sql": "4ac4be1dc824fd808a871f947059fedbe87817066e3cd1cc89903ea9eb0e2443", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.postgresql.expected": "04ea1305d691b9614e20c4fc5375b8cd0ab69958c1370a223337ac4c6f9e3630", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.postgresql.sql": "c796ea82da70469a67c654c484154145d24ccbb049400229eaf64eb278324a48", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.sqlserver.clean.sql": "f35c01e5395098279f255e5d44bf19fc5a161c043e6579cc667cf7313a506622", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.sqlserver.expected": "893ca3c638cef458c7fa0f16b8cd07f3afada1cc53c21d97fe96820fc9485e55", + "sources/druid-v9/task/grader/fixtures/error_identity/error_identity.sqlserver.sql": "489097faa36bee380409a2d735fbcab9e4e4d16d8258263cf65ec93fd02aa06c", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.mysql.clean.sql": "ba2f50c5beffae404d8403aa8ded5b5aa374d9fe1f97988b2ff0fc233e9a62b5", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.mysql.expected": "9027f7f6d80629950f100316952bd44f55ab9b935fd8a91ca9b689bb1c7d4917", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.mysql.sql": "fe647603715bddb5de037e6f91993d0e0ea047b2dd7ba1a320bac2d6f039a32c", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.oracle.clean.sql": "f32f8a69c2b3f5379ca883590b12cf11ccc050aa1f922b5b6719fe4cc866dab3", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.oracle.expected": "c4a4a53e96d685fcc0c0cb5ff255b5770a839247663e7a3d9b7cf94dadfffd6a", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.oracle.sql": "450c5045a58ddd759c00f7af2c686412165dce75fa6997f7a832da7f913cba41", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.postgresql.clean.sql": "e2bf00f083927874c1099cf1c801f63f1053cbc3784d402520fa482c0ea7016d", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.postgresql.expected": "6445a61cfe16bb73565a9266fdf027f406fa775ab0308c26638b63ed9681ac6d", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.postgresql.sql": "6f62d28b9294d904b2434b17ff3eb85f745f8e6522976e41df9d25a7094229b6", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.sqlserver.clean.sql": "25f8b6e05eab128d43e1bd6c928df60c9a2278c2b12e13c0c8e76b88d8a71a03", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.sqlserver.expected": "f5f880a13db1857e6035f9a708f56c8bbab040b1a1d22b84ac6c7bf0bb4a16aa", + "sources/druid-v9/task/grader/fixtures/keyword_context/keyword_context.sqlserver.sql": "2c296c6be24c3c7f4e468b4d887e4f2c067cd4664d48e5ab519714c8656226d4", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.mysql.clean.sql": "f84dd92f038eea6960970dbcb61219938d06a3ba2358d4afc8b0ae7d8439eed9", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.mysql.expected": "56d079ee888eb48f76ba1e6f21ea8654bf3c2aaf6c6d12ca00c0a889d78fc6c2", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.mysql.sql": "e9038561f0478b143050d5a967cdb0662a51ea852b9cbfb36b0121cc66e49458", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.oracle.clean.sql": "b0ddb5ac8f574b1d1448bc02e6565333cafa377a618d6871b1767a8e12337f6d", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.oracle.expected": "6e4f011583a1233b72d1123dc702be492575acba49d2dcfa6a3cf9ebf740bc61", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.oracle.sql": "0a9ff16972a47bcbd5ea92ee1bba9afdb9a6ae9fb5b09cc86348388c57aa4b9f", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.postgresql.clean.sql": "33cb36b3ae9be7ea2586daa6585235926718255a14e347271072ec37d5818082", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.postgresql.expected": "548df167b18e3a45276f3f33ed8ff15e854712eefc8eb43794176d43587e62ab", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.postgresql.sql": "2ce8d455b4f960554dfe28f6d1abe2a45239229059558102f493315865293af6", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.sqlserver.clean.sql": "5e88795e075c5b40931ecdcef5c77ec37abadeb5f956370d1123c2aa3ff89361", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.sqlserver.expected": "b0ee43e8f7a55bd4d640fe9212252474ba48e5a6b60b1ad41c13de89d0f7b7f4", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-0.sqlserver.sql": "c49a90c5413c5d700148e92df86675be03ce5e6790c0a0f501ef1d187051a3d7", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.mysql.clean.sql": "c579e5a660d6901305098ddd794f56cb3037119da2d017d19e21c44991868198", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.mysql.expected": "fe47de4fd9a9a60adaa00415357a0537e89f2e29208c5f49319aa009e14c55f7", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.mysql.sql": "5900f2a965747f01dea3f54688f8fd6699efb87e07355dcc1bfb7d7f24271c88", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.oracle.clean.sql": "9a829badaab95515a91ca1160c0ffb0f572a7fdbeeb2f6bb0cad56821ea38bf6", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.oracle.expected": "5a5fad0fae2e6508047aefa831a92b4b41f5c2a66e3347169f5a8ae3a7e73df8", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.oracle.sql": "324cfd3e4a2915790b4301c85bea8c92a11e332da8e3729af2d2dbc69e541313", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.postgresql.clean.sql": "313faf7f26f862b5f52ed232b5c9bc78685f9c70b7ab03c2c10bca9fba7e7466", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.postgresql.expected": "5c61e19384359cc984153ca22cda9ce92c352036cd5c7020eba4930d593c1e52", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.postgresql.sql": "8bdd3ac12f059918cde60a0a62e67689c3c3b1cefa3f2dafb5343b29e7b46347", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.sqlserver.clean.sql": "a98d78a2f6499fa7f7eac0ffe75d7faa67e5a3a1c9330c904e3048f7f21965d0", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.sqlserver.expected": "e06615849d50f44839a411a42b14d0d3b65b9262acbc09650b2e2b6838094fe0", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-1.sqlserver.sql": "913c7e50f0a2544dba2e52f578a27b5590bdd278c0787b657bf1294105562600", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.mysql.clean.sql": "faa67f8f5f5728e03bbe7f3b4ae78c20930ba6d243b4c3d657d2e73730e313af", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.mysql.expected": "ed672295b2f2077c0c56125d5e3a92bfd4bab13b60d08fbbe09d6cbc841e79cb", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.mysql.sql": "9d5e6977bfb3c88d15ccd708f1950c6cce9638e53d29e9e8a238b33201220621", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.oracle.clean.sql": "8227d697b5f73f9bb736e6a53184059095f8167076bc16edb5f49e7fdfe83108", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.oracle.expected": "1e4b77a64159dae00be3f085555cde8c5535716af092161711a9b928faee5e88", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.oracle.sql": "3311b4605059b19774a3c1f30b3dbeb64f4e86a7607deea81930fd72e2cfed57", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.postgresql.clean.sql": "ced74b5e59c88d84dec58419448a90fed2efd0d4d33a5de92ce1ee959a8a09cd", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.postgresql.expected": "c4662ab2ccda5798c27a1bae6257ec43c338463ff9addf6d93d1fb5374e947a3", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.postgresql.sql": "8b202fe0bde93e6e0f4c78395c646c914db85bb9cd8c2b48cd73cdbbfa25283e", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.sqlserver.clean.sql": "262e93498b82d72ffda9dce3b133a988c24e8d7023a168c22ffc0e9cd077e9f1", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.sqlserver.expected": "cfbfb6241a0aa89518ea2767ebd699735fc5df49eb190b6146c25e5a287a4328", + "sources/druid-v9/task/grader/fixtures/lexer_tail/lexer_tail-2.sqlserver.sql": "86ed93179159b614bb4b8ead77aa044c2147cfcd8590c43d9ed8abb16ab38234", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.mysql.clean.sql": "94957946316a79fcb8045b3144ccae66773b060777cb2fad5a9bfd0aad62e67a", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.mysql.expected": "8353c892f4a71fe583785fad8b3d69e317c9cf96f53cb463688ec83ff7159809", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.mysql.sql": "c255b176ab699aa49f5076dba8a10acb3effdd378851f8dc7e119dce1edf3245", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.oracle.clean.sql": "d0d639b46d555a409082de1d59de6d6ad0434b21f178a1546d6a99583865ef88", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.oracle.expected": "fc17dae0db0fc422f6e81f3f494ab98046d95dca0736be46801551d65710f9a1", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.oracle.sql": "f2f9702f45f1762a4df9cee57db6082471fe5d86663cc11d7f785cde570f891b", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.postgresql.clean.sql": "9e2b2cd3d197b12abeff88d8d6b9a5102c102f42ebb944e6caee1111e6fa1271", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.postgresql.expected": "df42466380c25e23f5becc0afa306693c74371442c6d1f2358452a8c3aa5f358", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.postgresql.sql": "86f23839b192a4f93179a2a1c2f0e1d24a1d7bae996c2418461c53a160d889c7", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.sqlserver.clean.sql": "6ae2ed9b17d696c17f06347cc11aa0fb077c64c0317d44a6e789dd94f806dd66", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.sqlserver.expected": "1b8b73744b5094824dc8a5ae9ae71910597adc0976763f6ef6c86622ae38ac9b", + "sources/druid-v9/task/grader/fixtures/line_endings/line_endings.sqlserver.sql": "4883eee6a6b4e1cf88af74a0ebe3b4df469303d4625f48fc42c0a25b948748e9", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.mysql.clean.sql": "c78d52eca76b94e9ae695d2fa92b9d379d74e7e9aecf5cc8c89272c573197261", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.mysql.expected": "521e9e48bf4c433a1e0059386e6989fed46ba472eef3f0e18b1de26de59942fd", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.mysql.sql": "3c797df67335c00fe2626aabff3b2d3cd50b0f45475f18d7715bf72a526d2244", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.oracle.clean.sql": "5289adca97630e277e9907107e688f394037bfd454351b8acc351151a47c7cd1", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.oracle.expected": "f464879018a173ca6fb0566fcbe0df8b313fcc28268cb2fa7c4e096e82b6b9af", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.oracle.sql": "aea596b0f04354ca83de0f02f8a37f9ef2b25e3820189f1821f136f652255150", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.postgresql.clean.sql": "3773327c9207cd0bffc6c6cd6d358f525ea1621ad55e5c1579091ce6b00c374a", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.postgresql.expected": "dec9256dd2bf0b428704ee9a125aabd3a82ce679e0b5e974fba9e4b43615d3fe", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.postgresql.sql": "1de6a80b44ba9e54f59db3c09cdd918d21ae55db4700bbf6a1ce087b908ed853", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.sqlserver.clean.sql": "9ae85b0a289df63f0199dc4dd5099b54128f3e849937f2dbe491d669ea771fe2", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.sqlserver.expected": "fdda2566bf1a83139556afd34de4c9a3ae41be6d121548a21133da6b555b64b0", + "sources/druid-v9/task/grader/fixtures/mixed/mixed.sqlserver.sql": "ab3769eb7bc2a620d60b010f41fa28ad0d872da1ace192dee72f07e62b34b318", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.mysql.clean.sql": "67acb13d238d6e9fe368fa48e5059a76730d5daf6ad61e36a011bf717949b9ef", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.mysql.expected": "18fde8846a569793208e8c309a9c227a8eafa5875714356544ee8a1b6caeaec1", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.mysql.sql": "6a70eb2cfdfa29f43e7f93035be9f78d1b9ce0389cca1d877d448a9370b7a2d3", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.oracle.clean.sql": "99fe329aaa67b3bfa078c8edaa83276cb2ee2881bbc353d1c3ed1df4461e9268", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.oracle.expected": "10e45104ab2e52edbb60e9e5574b212d16e331ce32440100240eef97e1ff162b", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.oracle.sql": "86358dbd104f2a5a8b4c9bb80b4e63b43ebd34053390b18430295ff966e2d9bf", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.postgresql.clean.sql": "cb7fb4adb4ba2e514ce005865f0ec564d38f13da6e9059ade8d424949b94ff8c", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.postgresql.expected": "a206593ca02a891afdbf01599c9f7e23b33144a74812aed7a9c4f6ac4d0a0ac6", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.postgresql.sql": "cf24f7a7d75b08e8e78eb15bae48bfbca56e10cc123b8e7a62f57c4f7d4e6075", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.sqlserver.clean.sql": "5ea4a602179735f1e56c2321d2a30bb3e8d3895ae45f307140d6dfb6348a501c", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.sqlserver.expected": "bd924f7b9203b13ebf28d8512ee628ebdf8f35a7b8bf574989a15a2ab0457663", + "sources/druid-v9/task/grader/fixtures/simple_bad/simple_bad.sqlserver.sql": "62d0676e1441d69034fb448877b8e881aeefff0686aaf684beabf5f224dbdd54", + "sources/druid-v9/task/grader/lib/budget-agent.jar": "47e3e688e210baa701e90717544375ed2a1ecad2f3186cf0cd14840bb41165e5", + "sources/druid-v9/task/grader/maintainer_review.judge.json": "54c754dfc30eac8ed0fcc78ac988ae37f337b14ee2953b8470a4adf35f8f0413", + "sources/druid-v9/task/grader/run_grading.sh": "b5595934139fff27473eb59ddfedbb4edf1891e93d3d1615784f893e7bd4d5f6", + "sources/druid-v9/task/grader/src/BudgetAgent.java": "ef84245cbbb4d8829f4305380db6733be919822744c294bc5813e353efee3ff4", + "sources/druid-v9/task/grader/src/BudgetCounter.java": "b4d4ccae9a5fb774e10f49a9ca73256e065e582664dc444746d693b55269971f", + "sources/druid-v9/task/grader/src/Hidden.java": "dc23fc5ee7be36101bd7bb717200333c8f667fc1394135111d268d13536e303e", + "sources/druid-v9/task/lazy.diff": "951ac6592704b66a377f3b02ef36cc0e03b68cf2d838c58c97fd3f2b4c39b2d8", + "sources/druid-v9/task/prompt.md": "196f1f60de0d46002f178a6540d15e71c2403c0aa69dd468fb770bd033939fc3", + "sources/druid-v9/tasks.py": "1a6e16c78ba36725c41ed9ead1809124f382f04b0a5a6ff7b1de037372d37910", + "sources/druid-v9/toolchain-probe.py": "6d6ca0d58d297375b6607f0d919ef9fdeb241720a10146d976d88a5e961d7182", + "sources/druid-v9/uv.lock": "7dca28eefe3293ca302eec58c1d9f9daf3752e8f96a781a0c74e21032f3e9059", + "sources/epicyon-v7/calibrate.py": "396e24518927a131d5d0699cc28dc371660e7d9f0d831d4ba0bda514b5c4db7e", + "sources/epicyon-v7/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/epicyon-v7/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/epicyon-v7/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/epicyon-v7/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/epicyon-v7/Dockerfile.hud": "cf2cd6e314c672847561198dbeb07607a642dc4c86ab1f8958fd38bc1ffc5616", + "sources/epicyon-v7/env.py": "cbf687662764e57fae1b0f9fd3aaa1df970d0ce0dab3fb7dda53b1f12701b75c", + "sources/epicyon-v7/pyproject.toml": "7d873e18de052e89e988a7386275ab6bffe9d0a92c7235d988b8fa1e7f3375cf", + "sources/epicyon-v7/task/gold.diff": "4b964a50fd786b7f34ed5e4a8c78b52d0f5dd480a60d431eef34635129f6c212", + "sources/epicyon-v7/task/grader/controls/alt.diff": "603532c7a7886bf2c73fcaf28b725b4369a99a35082535d926d8bf014bd2351f", + "sources/epicyon-v7/task/grader/controls/cheat.diff": "4b3fd6202fc040947f3c7a5ec0bbe5c547924d2f16fe56cda1ba10459db66bb8", + "sources/epicyon-v7/task/grader/controls/lazy.diff": "da978a9312bbf03c847cccb00ba2d0f5d180b7a67217f8ae7f5b055ab64177f6", + "sources/epicyon-v7/task/grader/controls/noop.diff": "3ceb2e24c7eac59d17c69e4c04d545a0b97fcea28546424b2e598bb847451c39", + "sources/epicyon-v7/task/grader/harness/spec_cells.py": "087fe45d3b0065541379cec1e1362a09c3ddbaaeb3c78e65efaacb60493b5a77", + "sources/epicyon-v7/task/grader/run_grading.sh": "379d63d5f7125239f83dfe73a6700834290f32b474e0a25e0c3a6d9323fbcbbe", + "sources/epicyon-v7/task/prompt.md": "51b6871d06aa62a33ced04ad4a8119ad17de44c443ba26c93b7f9a22da965681", + "sources/epicyon-v7/tasks.py": "9411527ed4a3fe5eb5c68671f7321d2f3b5b0e95209b139cd11cfe4afc1b55b6", + "sources/epicyon-v7/toolchain/requirements-agent.txt": "3ac80903c9defe1bbf6328b3e95b4bdf9e438de606fb809c03a5057b89e85c4f", + "sources/geode-v3/calibrate.py": "76a9d572a9f4d7cedf929a7ce526bf923d081e41bf8714f95f8284d3a9184213", + "sources/geode-v3/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/geode-v3/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/geode-v3/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/geode-v3/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/geode-v3/Dockerfile.hud": "0371a78f3e680245772d7e800ce0bb557895cfbe291f79524701d3bfad49a650", + "sources/geode-v3/env.py": "c85f0e70d3c4f636365ec06528dac3d2fab93e24d52f28c90a23d3fceb195296", + "sources/geode-v3/pyproject.toml": "91f4a5054a76fe32d689c287ddc98379db2696944f9dc7fe61a3dcc87ef737e4", + "sources/geode-v3/task/gold.diff": "2599678bb69439beaf1798a7298b4dda232e339353472fad93e5bc3ecfba0bc6", + "sources/geode-v3/task/grader/board_smoke.py": "c18468574b5911aa1216888276bfdcef835d126579a56df9a6b0194c89d54e8f", + "sources/geode-v3/task/grader/harness/HiddenOqlChecks.java": "cd6b0fe03c13bf12779ed8553088b329b07207a95c8752aeb9b6ef6c0f8e4b44", + "sources/geode-v3/task/grader/harness/prepare_grader.py": "e8352df74b187e39f3f5d09e661146d5adf5f2c4a9f4f8d7656b603c2e403b2b", + "sources/geode-v3/task/grader/harness/printcp.gradle": "a61e5226f15d9d86e5a8c896fcfc5eba7a3e11ffa2955ee674a7ba79318adde4", + "sources/geode-v3/task/grader/run_grading.sh": "de757a0f6a53bc43511bdd17e8f0dd5289ddf771bf4bc074d02a42f79e68cd2a", + "sources/geode-v3/task/prompt.md": "b7cd7309f58fab1d52c2e994d5a30c425805ffcf452d85230bc057cc5b125cb9", + "sources/geode-v3/tasks.py": "555edd17d7e21d283be9055ad5d8b081b05b0b7693419a907a1695c7d43268ec", + "sources/hooks-v4/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/hooks-v4/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/hooks-v4/coding/repo.py": "f7ca325465530ac6aa06652dd9468696483cddefaf78c80e25926f6785ad1701", + "sources/hooks-v4/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/hooks-v4/Dockerfile.hud": "aa2dad85f55a34c5953cdb82fb361c3b3acebbbaedfdd96f69c95df4afbbd6d1", + "sources/hooks-v4/env.py": "a61e44a30a33416cd70fd26a21c74b6a86aa69b6a791fe770a4c75c2d85f26cd", + "sources/hooks-v4/instances/.none/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "sources/hooks-v4/task/gold.diff": "dc6b980023955c10dc57d98e5c27448ae5097c4876e773cb55d26ae963eb0b2d", + "sources/hooks-v4/task/grader/maintainer_review.judge.json": "5b373be4e2743a2b57bceb68838a58a9c2143ddbb714f0c1fdcb7a51ef4bcc47", + "sources/hooks-v4/task/grader/run_grading.sh": "94fd489cf97569c3ef89ebb85f799080c692934f0d54f8f628e90820e3d3f277", + "sources/hooks-v4/task/grader/tests/__hidden__answers_out_of_order.spec.tsx": "d1faeb9a3cb3e001b5fc0a46932595854b1b9c401a947bb4ffdfe1396c3eba05", + "sources/hooks-v4/task/grader/tests/__hidden__built_in_cache_two_components.spec.tsx": "7ed1a06965a6c9fcaab228e1d5218ad0ac0301ed66b31fd9cd9c0d2552f42d8c", + "sources/hooks-v4/task/grader/tests/__hidden__caller_screen_unchanged.spec.tsx": "7623ece5dca84371aa2e698f58937f8363e8fa7c488b80b43315f6c1fed811b3", + "sources/hooks-v4/task/grader/tests/__hidden__different_pages_at_once.spec.tsx": "e367bfa06fcb43ba0a7bd650a25e2dc1808cf67e311a1f4cee1a5cedd26801ba", + "sources/hooks-v4/task/grader/tests/__hidden__duplicate_request.spec.tsx": "47114da43bbd27fc53ed0d25133984110037e97ec21e972f096a52a9423d254d", + "sources/hooks-v4/task/grader/tests/__hidden__fixture.ts": "b0b30a9fd8bacd291fcc6b1cd74f05dae8dd4659a35f985284728fbfa5c9faec", + "sources/hooks-v4/task/grader/tests/__hidden__fresh_page_served_on_return.spec.tsx": "f1e75caa4a5a796633a2cf0745c347de2d93889e3a2cf09aa7d2c8e738fb5cd8", + "sources/hooks-v4/task/grader/tests/__hidden__key_per_page_late_answer_kept.spec.tsx": "7ef12dfe0a1cb267c3ba77fcd39f404606e319be2252fb9b7d4a4a3d95cb215f", + "sources/hooks-v4/task/grader/tests/__hidden__key_per_page_panel_keeps_own_page.spec.tsx": "272a6e19d4dda68e9ae74f2630e8071a1e643bd483a483384be09d775bd9ec2d", + "sources/hooks-v4/task/grader/tests/__hidden__late_page_kept_for_reader.spec.tsx": "b9251845782dea8f9679c3d62c56532fef12f19e49eb57cda788e69ac724e842", + "sources/hooks-v4/task/grader/tests/__hidden__late_shown_page_saved.spec.tsx": "d95750438157e5575626361600fed89198fafdf5846955778adbb5bdd096e1ab", + "sources/hooks-v4/task/grader/tests/__hidden__mid_load_panel_consistent.spec.tsx": "f5737ec5f3db627939b8c1fe602b7dae9a542bab5ba4d50d61d4ea4863e09910", + "sources/hooks-v4/task/grader/tests/__hidden__mid_load_panel_ends_on_page.spec.tsx": "ddd6180aa366e30f60e2a635acbb172f6a1321d4d7443dbaccdb2f300606904a", + "sources/hooks-v4/task/grader/tests/__hidden__mutate_reaches_own_page.spec.tsx": "4ffd04e910901ac00b5e691d6d6d8bc7d97f8c8c618a6c51bcf1f6fb1aca4ffb", + "sources/hooks-v4/task/grader/tests/__hidden__own_late_response.spec.tsx": "df302fefc4588559e62f7f577b69219d346f68d5c860641da87fb551ef952900", + "sources/hooks-v4/task/grader/tests/__hidden__own_page_after_another_loaded.spec.tsx": "e46165fe5e51bd31790b822eda4e46e0293b261fb5ac933a654389fc079387f5", + "sources/hooks-v4/task/grader/tests/__hidden__refresh_first_answer_last.spec.tsx": "927c000bd96cc752c2d4a1b7597bc356cb666d00c0374bf45c914dbc596d58de", + "sources/hooks-v4/task/grader/tests/__hidden__refreshed_page_reaches_sharer.spec.tsx": "0c72f0b7cbc0d8b5d5eca2991e140c2f788673736ea24165119b0719ec7ed5d0", + "sources/hooks-v4/task/grader/tests/__hidden__same_page_older_answer_last.spec.tsx": "4d2d672804fca1a04f5e0f92d1bfe0965f16bd0022bce67ec867c364b17fe7b4", + "sources/hooks-v4/task/grader/tests/__hidden__second_panel_auto_loads_page.spec.tsx": "b0cda32b933d99fa542664b70589c39a7f0993df14208d8059bc097876797769", + "sources/hooks-v4/task/grader/tests/__hidden__shared_late_cache.spec.tsx": "b81a6bf51ffc5009887c6399d7756e0e3127dc3a6f79262a4095a65d0865c57f", + "sources/hooks-v4/task/grader/tests/__hidden__shared_late_response.spec.tsx": "4b43417856c93ab091fa3ab915e9b8d9d8e26e3721a89324f6d4d183782fcf1a", + "sources/hooks-v4/task/grader/tests/__hidden__single_entry_store.spec.tsx": "92726d9da8f48baab3903400af852ab02e7a782b0ee6b88f08548e92833b1f95", + "sources/hooks-v4/task/grader/tests/__hidden__single_entry_store_two_components.spec.tsx": "f3f8e1bf29c465ab772448cd29a716bca2eb6c17ba4864fe14263b4d7bfb4211", + "sources/hooks-v4/task/grader/tests/__hidden__skipped_page_lands_last_saved.spec.tsx": "cac9360fef70ff8ff7918e2f5271f8e69518b70bb963a3d42386c054ea7de6fb", + "sources/hooks-v4/task/grader/tests/__hidden__skipped_page_saved.spec.tsx": "5762894a13bb26b7cab4ec7caa90bd6253e95ab939c0f398e62f34d220527586", + "sources/hooks-v4/task/inert.diff": "8269f7fce0415640175f3628a21ad557009a137d35e0e0c057bf94d4e8b88290", + "sources/hooks-v4/task/prompt.md": "69eab063bcc73ac7275e64bd798b8a95f2bf68fc807d8fb64f0328071b291ecd", + "sources/hooks-v4/task/submission/grader.txt": "ca62412abc0cfeeb71949ca80e4826899235861c0ee588c6fe91020ff0c1b114", + "sources/hooks-v4/tasks.py": "c2e61dae6e2431deb00a8f2496d5888512d70be77240729dab161b424fa40495", + "sources/kratos-v10/calibrate.py": "c973b15d0af98fa92c1356dd8893cf224a611eec05cb99dcc76f554ff54943de", + "sources/kratos-v10/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/kratos-v10/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/kratos-v10/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/kratos-v10/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/kratos-v10/Dockerfile.hud": "7cb2ef5f8b62c0133ced3061d9609e572e923d8feca34b3f8d4930c0b81835c3", + "sources/kratos-v10/env.py": "f500868545909809d90d32c59d3c484f2f2dfd401c5095a1d62e16604d9c8b77", + "sources/kratos-v10/pyproject.toml": "4084bb822ac3b7bda9ebc4c9c4e06012ddcb71e4baaff9573b98ef4795c5e95b", + "sources/kratos-v10/task/gold.diff": "7c8fb3f5a34a06f930c91af9ddf004e946dfadbfbf17721b94ba6669e2f23062", + "sources/kratos-v10/task/grader/harness/board.json": "f58568b0e7d41942cd8311ae566e61fd1259291d93b2f4a8afcebee16b5b19e7", + "sources/kratos-v10/task/grader/harness/cells_test.go": "cf3052230ff44491db7f191206603fb73cdf24c59de4331f7839bf3026cb7a7c", + "sources/kratos-v10/task/grader/harness/run_grading.sh": "82c1ca34535b2da3c93e728229e508319224cd3e9f35f54139d38b8f98f1d913", + "sources/kratos-v10/task/grader/harness/suite_gate.py": "de0fc10861f98f87af69bc34b8c49248f386cbb35d47396b1e37576f8962b688", + "sources/kratos-v10/task/prompt.md": "239e21d58525fb1d4f03502a02aaf35855cfcdad5b16eb89547947c9b6b2780e", + "sources/kratos-v10/tasks.py": "e3b3f5fe4fec8e4d3f1c8261ef9ce13fc8058031634162dc72c17d8ee368dc5a", + "sources/microblogpub-v4/calibrate.py": "bc13a956fccd1bf2dfabd5cb1009d6589b4ecf13fefac05f0f17d34515df2557", + "sources/microblogpub-v4/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/microblogpub-v4/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/microblogpub-v4/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/microblogpub-v4/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/microblogpub-v4/Dockerfile.hud": "799f1590dfb23ea154988b38c4883dd5074968560e3f73013e1c5ad4ac9a4a29", + "sources/microblogpub-v4/env.py": "786e3492cd374bda3063e4f581c4e8fbca2759d1d2a2337cc6791b53cfae1dd0", + "sources/microblogpub-v4/pyproject.toml": "efbf37cdf4eeb25c1a2534e6b3ba1528465531e0650414a637f7723a64dc8053", + "sources/microblogpub-v4/task/gold.diff": "d43f80e5971ffe240742e13601cc48669f55d38e3b3e405347c7039e31acdf39", + "sources/microblogpub-v4/task/grader/controls/alt.diff": "1582e6b71b39d4159f2c7a5cc0a1ea1db7bec4986b86459c308f4319f0e4376a", + "sources/microblogpub-v4/task/grader/controls/build_trees.sh": "83cc518dd18ae3536b18f8d6332aab0da273e143d04c115e351a365c370d5d7e", + "sources/microblogpub-v4/task/grader/controls/cheat.diff": "4289d896b1df5c6e20fa161d5b2255d7e756d597bc021d52d9d4dfd89dcc8cbb", + "sources/microblogpub-v4/task/grader/controls/lazy.diff": "75087908c1522b78c77ddb38956b795cb6c70d898f5845fb197cf6dd2ca2734f", + "sources/microblogpub-v4/task/grader/controls/noop.diff": "df127c1fc7ea3d64702d58601ed0b667c36cd406ce4b437aa181e5cad4290a19", + "sources/microblogpub-v4/task/grader/controls/obvious.diff": "0c894aa75bd1cc253e7bba730b589eee65c5a8131490800d645c0375bb2cc8a2", + "sources/microblogpub-v4/task/grader/controls/straw_b.diff": "de7a77955f75affbd687ac6f42320c26543a8e0149628d19127e3ae9fb85f543", + "sources/microblogpub-v4/task/grader/harness/cells.py": "d94fb228fc314de2182152112f5ca826688e53cad022b3a832af5535a62692bb", + "sources/microblogpub-v4/task/grader/harness/cells_test.py": "66c8240b133f7c0cae3134667310e861c66cf9ee19cbdb81d4b9defc5e598117", + "sources/microblogpub-v4/task/grader/harness/suite_gate.py": "9384bd33b513663cc46d0d4f06520c3d9eb163b3572922e40cde15dd38fce260", + "sources/microblogpub-v4/task/grader/run_grading.sh": "5f85557dbc19f9fe06312b2fd425cfcf2976f1db49d703f68acd3083168a96e7", + "sources/microblogpub-v4/task/prompt.md": "b5503c4ce52ac738d64c5cda7e702e6cf692e31b587d123fe258e80950a8293e", + "sources/microblogpub-v4/tasks.py": "fde14896af0866a4efcb2c511a30e6b78f940ae01c52fd7489c3a37884cc1149", + "sources/microblogpub-v4/toolchain/requirements-agent.txt": "b3d4a81d5d0902b7372b75b4a18a253525e01a59a32fd5caeb8fcee358126e05", + "sources/mikro-orm-v7/.dockerignore": "4bc219f17353779fe9b5200ce73e0503cf83924ed2562898e628bf7292b581b4", + "sources/mikro-orm-v7/coding/__init__.py": "01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b", + "sources/mikro-orm-v7/coding/repo.py": "76995d1d0b2deadc2e4de12eead1db55a9b12a9a2d0b518c0f98e417973d5a66", + "sources/mikro-orm-v7/Dockerfile.hud": "868d058839826b6690116b55a792adfb9451a03ff82f13d10fbb5caf737356f6", + "sources/mikro-orm-v7/env.py": "2b7d0e0019d64d02999764a6dab4e2a3a53b1c21fdd895e6be0f52705fc17a7d", + "sources/mikro-orm-v7/task/alt/alternative.diff": "ec1558548e2afa48a54445aea808a00b8714789ea793fa1b014262ee53644fcc", + "sources/mikro-orm-v7/task/checks/attack-api-changed-signature-over-gold.diff": "9554d31b7d2e8f8894ec84da86e26628748a6f59077ac89dfa355a070e8fed74", + "sources/mikro-orm-v7/task/checks/attack-api-exported-helper-over-gold.diff": "28b782d951805ad5b1666639e8ff4f41b89508c529fa5b307b5a883d644aa70f", + "sources/mikro-orm-v7/task/checks/attack-api-member-hidden-as-internal-over-gold.diff": "919ff3b1eaa8eb8a4fc97fd48b45b409696ea0d39569ff2aec6491d037379148", + "sources/mikro-orm-v7/task/checks/attack-api-module-augmentation-over-gold.diff": "a92042e10b20ccecf1194e6e34ba71f90ad32225ff0d66bc3a9c0b2e21401443", + "sources/mikro-orm-v7/task/checks/attack-api-new-find-option-over-gold.diff": "35ab2ecb79fb5f3b9e7c9570f0fb83dd885172718ed55f47c22ae394f48d3f5b", + "sources/mikro-orm-v7/task/checks/attack-api-protected-qb-member-over-gold.diff": "6b5c0671c41b7dd23be9975d051723fcc44ecb1349c35317d4d83f29bd9ac672", + "sources/mikro-orm-v7/task/checks/attack-api-public-qb-method-over-gold.diff": "679bf326df93b3493988ee9daf1f86e2836923c8779decb81ed58c5fadcefde5", + "sources/mikro-orm-v7/task/checks/attack-companion-no-key-update-over-gold.diff": "329be4898d2574b8c47d7de2203afb4e112352e8d67a887ee4deb9ec573809e7", + "sources/mikro-orm-v7/task/checks/attack-companion-partial-write-over-gold.diff": "5f393754251bbec35d4c6d83ec116bacf479204964e967acc66517c36903fdf9", + "sources/mikro-orm-v7/task/checks/attack-companion-read-over-gold.diff": "3ce95e9d270849e18d4d24028c70a231523b8d3b20e3b751ca7b719e6371a5e2", + "sources/mikro-orm-v7/task/checks/attack-companion-write-or-fail-over-gold.diff": "0183baa236ae7a10fa97e1315dc57b0dd826d20925a6e4180393c33bf539af06", + "sources/mikro-orm-v7/task/checks/attack-conv-break-preservation-suite-over-gold.diff": "c0fc28776193973df1f0005dff659093185571d94eb7f7cda0b2bfff55f241b2", + "sources/mikro-orm-v7/task/checks/attack-conv-comment-out-test-over-gold.diff": "4075352d4f94c11de6f974a5138e7acefb39b4bb903d5caed0718697d88fc528", + "sources/mikro-orm-v7/task/checks/attack-conv-delete-existing-test-over-gold.diff": "d770afab03743d0e5e933ffd06854ad085710cee5de0322cfb62158b9ca4f71c", + "sources/mikro-orm-v7/task/checks/attack-conv-drop-assertion-over-gold.diff": "3b8f55dad87da4b5f0e9757151b4a95302a5acf40eb1cb07c73d8f3a683bc0fe", + "sources/mikro-orm-v7/task/checks/attack-conv-lockfile-change-over-gold.diff": "681a38af39c08f22f1e09994f2f3646e4627156877991fc00a78d3fea9224b20", + "sources/mikro-orm-v7/task/checks/attack-conv-oxlint-error-over-gold.diff": "b578a2630fa336cae2cf36a0a7257df98afb4b433a7e3d1a14cb78c9b29a883c", + "sources/mikro-orm-v7/task/checks/attack-conv-root-scratch-file-over-gold.diff": "35ec3629d4b7491d4b72510ff2c13b127af04146f035683ba1cd4daf9c1fb518", + "sources/mikro-orm-v7/task/checks/attack-conv-skip-existing-test-over-gold.diff": "5306ea286e80b5d302fcd3d986955f805f308d9c5f8af632c18ebbd1a62a68d9", + "sources/mikro-orm-v7/task/checks/attack-conv-type-error-over-gold.diff": "b69ea073e828e05c70fc433273b8719500bda62fe2f08a305a6e860f8bd1be97", + "sources/mikro-orm-v7/task/checks/attack-conv-unformatted-over-gold.diff": "94a426ebaa91b242bdbdd5ee3e0291e3ba8cf5e234242329e970789011011e6e", + "sources/mikro-orm-v7/task/checks/attack-conv-vitest-config-exclude-over-gold.diff": "aa8e4fdc794f6876d54eb831cd717f6515e472326dd9685dade6468f1117ad4e", + "sources/mikro-orm-v7/task/checks/attack-conv-weaken-matcher-over-gold.diff": "447acd4dbb988d2a755ac447ae859eace2615dba5956cf649a8397cd9ff97e7e", + "sources/mikro-orm-v7/task/checks/attack-disable-all-lock-clauses.diff": "d5ed7f3af64fc7ca2f0a8616964ee422956945dae1ca2c5255f1df8a50e45457", + "sources/mikro-orm-v7/task/checks/attack-empty-lock-query-over-gold.diff": "f9f96438d3be454f991170cda176f15ef706818c66684ef29275bdb217327134", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-count-only-lock-after-read-over-gold.diff": "21f67d4d26ba84454e44ab6d7c9f5c3bc529751dc9de1ec04e8e7c29e4def941", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-count-read-only-lock-after-read-over-gold.diff": "154b926d1d47f9a31368b94ae4259fb5d3c648317647cade1eed1c13ef27fbbe", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-distinct-read-only-lock-after-read-over-gold.diff": "fd528b6c01ac175ce5a5a76b6e92c5975ac314ddb66c3d717bfaa0789af6fb22", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-distinct-write-only-lock-after-read-over-gold.diff": "94fc253325ae4f1ba75a246f06ef85f86cf0d7a50eca295d59726fdad0c60e6e", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-fail-fast-released-preflight-over-gold.diff": "0696f4599dca7b40b26f0b31478426943f40f13b3c411616308793368d3f1f67", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-fail-fast-short-lock-timeout-over-gold.diff": "27f0350a9f5a886e1bb729f1de337f12f794998e3518d4076104be1367d448a8", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-fail-fast-waits-over-gold.diff": "ca5db5bed3569c6e9be169d46233b20eb76a7205247b9cb6a1817c5fdeb50f3b", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-grouped-only-lock-after-read-over-gold.diff": "1e9da678a8ba103aca79d69c1a7635fec549bc7d5373e01a479a72d13c1b8fbd", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-grouped-read-only-lock-after-read-over-gold.diff": "7919cd5bba5c61860012692458a7f5a50143686c9167374ef995dc5871869d4e", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-lock-after-read-over-gold.diff": "039a6bc5dd4737e9de2b8927c66fcfd642ff94d8da4dcd44312960e4a4732aa8", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-lock-cap-7-over-gold.diff": "0ff3f078703732e8bdffbad6d9f03a9d5e448f9a31976f185be932e9330e5586", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-lock-mode-and-scope-collapse-over-gold.diff": "4ad49ebbefcefcf9cadb86a95971f6b82e93ccbf58b14a74a615c08a40d2e117", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-partial-waits-over-gold.diff": "d5af02a15170785600b20970350547593852b57a5951c3684641a702094a6449", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-read-as-write-over-gold.diff": "08223643976522d1a429d77f82a5689d98d4aaf40d89b81b4a37c6c6885039d3", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-scope-dropped-over-gold.diff": "738a87ef91ee27c74b94d2dcda61a34054458676397470ddfe5dc2663c83f4d9", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-scope-only-lock-after-read-over-gold.diff": "544ddeaae2eadde5864b418623253c7fff89f6ba50fb2b6431ff4807eeb049dd", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-scope-root-only-over-gold.diff": "8e4a7daba84b3cf53b76759b2116cc3113b681805160c367152dd9b85988b914", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-skip-fail-swapped-over-gold.diff": "c7fdf40bf52b00ba188b070e3f0f0f16da56b17fa208d92a6058f08f6cd0f729", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-stale-id-set-over-gold.diff": "7adac95952bed160bdc138c1ce7852d7bbd586bd6df1d70c8c65c973764c6edd", + "sources/mikro-orm-v7/task/checks/attack-f1-shaped-unscoped-read-as-write-over-gold.diff": "3e7d4884664b29ed695ce066afc39757ebddd767fd456283c03bf1baa003473f", + "sources/mikro-orm-v7/task/checks/attack-f2-all-rows-over-gold.diff": "6ac497c5e5313c813b2b57c834bc92c6716bb3b18f31177a8e7e95086c119884", + "sources/mikro-orm-v7/task/checks/attack-f2-combined-fabrication-shadow-state-over-gold.diff": "a210f444f10f8b2583e251cd11a6c046106352057239812b349fffb55b797e6f", + "sources/mikro-orm-v7/task/checks/attack-f2-corrupt-returns-over-gold.diff": "021ec9c003aaca6dd6866ce5e45a6ba40271ff384b4d65aab9582e59ac9a789c", + "sources/mikro-orm-v7/task/checks/attack-f2-disguised-illegal-clause-over-gold.diff": "1af87dffe9e8057c1d19858e756a395ac2da17c8fc279a018efc9b5ad9f20b4f", + "sources/mikro-orm-v7/task/checks/attack-f2-driver-shadow-state-over-gold.diff": "07bd81c0f8e8485fb021a11541b3a8eddf0232c759c3fe0bfadf16767d6ea7ef", + "sources/mikro-orm-v7/task/checks/attack-f2-first-row-only-over-gold.diff": "26807bde2358620972fc0e1072aef700e56636f2175d7c4d4e97e0aacf17cf8a", + "sources/mikro-orm-v7/task/checks/attack-f2-memoized-results-over-gold.diff": "df45271e83ee328c42cfa567c3b4bf4742ae0e38380debc1ed6c81c43fffcf5f", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-corrupt-name-over-gold.diff": "d5f7f599c0e9da5d8d7941f1b09be45029f5e3bd4d2bb17da7aea43bdf92b1a3", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-hint-other-table-over-gold.diff": "b15fcd544eb0f6d7ede625a98f814389563b00a0de455a6f2ce870c4807cc6af", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-in-set-clause-over-gold.diff": "6a388ecb4c90254f1552636e75a8bd3d1c7abe273c312d918bd64558722b6e4c", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-nolock-over-gold.diff": "d3ea2d5e5fa257806e5bda6eb2fdc49157c9841f68c4b09a8fdbbd330d8fbfb3", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-other-rows-over-gold.diff": "0d82ce1d32770bc526a137ad2b9f127c61f1665ee8442dda8b3eff0ebd375ae2", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-rowlock-other-table-over-gold.diff": "cb5a5397e1ec0d7dfc6e03100b498a4a4ae92bd8564d3002bbd77dc4b7e9dbfd", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-top-one-over-gold.diff": "9012f35dcf68b62446c2cd0fc14bd600e16244bccfa52b11faff302d1c667582", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-whole-table-count-over-gold.diff": "05d8971143267e30f4f1921efa39da843bf8857ea4925b9b44e02201dbce3ba3", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-whole-table-over-gold.diff": "3e88f6267eb17c44e92c1c42c7036ab4cd95524d0ad5d278743709dc3bdf01f5", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-whole-table-scan-over-gold.diff": "af17697feb66f546031c363b8ff759f65669babd734fcd10a14ee6e60b32dfe0", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-nested-without-updlock-over-gold.diff": "475ea25d5b2d67cfe4930cdd62624e20772f251ecc1a506194002b00279e611c", + "sources/mikro-orm-v7/task/checks/attack-f2-mssql-top-rowlock-readpast-over-gold.diff": "7f2d45ea06c77463c903059dbe11c69aaf54abcb5644499fccd1275acdd5a9c8", + "sources/mikro-orm-v7/task/checks/attack-f2-mysql-derived-all-rows-over-gold.diff": "9936703517ec857b500b1b23ec78c2c716e792fdcafcf17e191f13d9f816c23c", + "sources/mikro-orm-v7/task/checks/attack-f2-mysql-nonderived-same-target-over-gold.diff": "a09b97659f86839d4efccf4b4ea83793af8610eb7d982aa963eda0545b5eebc5", + "sources/mikro-orm-v7/task/checks/attack-f2-skip-mutations-fabricate-returns-over-gold.diff": "66abdf1bf36117a4b4ec1f7e1125c469e8b1747115d294cb9526d6f0d1b1664c", + "sources/mikro-orm-v7/task/checks/attack-f2-update-only-repair.diff": "2a2cdb1d043cfa2f9a73724964ec7e1d532a603bad3ef5e18142871531db3124", + "sources/mikro-orm-v7/task/checks/attack-f2b-conflict-all-rows-over-gold.diff": "13c03d8760a8b4fcfabddbe7a3fcdcc68d9f4f498d4f3fce4439937143d05444", + "sources/mikro-orm-v7/task/checks/attack-f2b-conflict-first-row-only-over-gold.diff": "201842b0d15ea2b8fd99608956807a7fb7a19d8b6232715fddcea719b9c26291", + "sources/mikro-orm-v7/task/checks/attack-f2b-conflict-memoized-over-gold.diff": "9dba9f303b5638c50fb1251eb10eb01f5ffd569eefe3a0803ed5377d274257b8", + "sources/mikro-orm-v7/task/checks/attack-f2b-correct-sql-ineffective-over-gold.diff": "b5da886f1bcfb684bb8c655800704179930e9240da14f1a6575152d424b9cab0", + "sources/mikro-orm-v7/task/checks/attack-f2b-fabricated-conflict-over-gold.diff": "cbb1e8c7be7f58a98a969fc9bc36b6ae8d24d22416db3b3ccc99c61a7cceaf2b", + "sources/mikro-orm-v7/task/checks/attack-f2b-fail-fast-waits-over-gold.diff": "f84939baa511dfcf5ad4a40070d9fc3665e6f94fbc85daeec94bb9a19b2b4196", + "sources/mikro-orm-v7/task/checks/attack-f2b-fail-prefix-lock-over-gold.diff": "e877c0912d6f2ff05260bb5c742949689985ef826b69f31d54e81ff2698a0eef", + "sources/mikro-orm-v7/task/checks/attack-f2b-fixed-row-subset-over-gold.diff": "94fe3459f27ca4a8b3bfb5005f69d0b7d665a18f742177712f30d504c88721b2", + "sources/mikro-orm-v7/task/checks/attack-f2b-neighbour-prelock-over-gold.diff": "9fcd93e78aa6e38f388e457a448dc87e8f1e4bce2eada50cd724e5bf34bd3102", + "sources/mikro-orm-v7/task/checks/attack-f2b-released-preflight-over-gold.diff": "6d6dbd9d7440bd672388d2a698cf0d1660216a6a7fbd8638fb92bc4faee1e56d", + "sources/mikro-orm-v7/task/checks/attack-f2b-short-lock-timeout-over-gold.diff": "d6d40fd996f655234da592390dd7836eaf953fbd21a4dce77694b59838612573", + "sources/mikro-orm-v7/task/checks/attack-f2b-skip-count-lies-over-gold.diff": "80e27c055ba7d740967116ad3bf8c9de6eba4889109b44f123c919b45063fbec", + "sources/mikro-orm-v7/task/checks/attack-f2b-skip-released-preflight-over-gold.diff": "61d88f0d32afa125412934533a01cc20a1c869033a02fa467d0d06dd73233761", + "sources/mikro-orm-v7/task/checks/attack-f2b-skip-waits-over-gold.diff": "a829da69d49d388a2f4f4e01852f383370b5f20fff70236a3ffce5be002fd26e", + "sources/mikro-orm-v7/task/checks/attack-f2b-upsert-unprotected-over-gold.diff": "da9706decc36da5091993029a37b5edf69b881cdeb0d498b74408bf420ab7ef7", + "sources/mikro-orm-v7/task/checks/attack-f2b-whole-table-fail-only-over-gold.diff": "d418c736f09731e56f4e20ed0284cfc5270711a63b4bdf063ec573a634ef7550", + "sources/mikro-orm-v7/task/checks/attack-f2b-whole-table-over-gold.diff": "a4f2a2531608a7ce3cd1e0281af685a74c45fe708ed2ebed50c03d247aeda322", + "sources/mikro-orm-v7/task/checks/attack-f3-comment-fabrication-over-gold.diff": "c92f8a566339f0d86407ce16da478e39e7a9604ec5d512b4a2888dccbf0f30f4", + "sources/mikro-orm-v7/task/checks/attack-f3-correct-sql-ineffective-over-gold.diff": "f5748c804b5c612a47c06bb4491a46e50937c1b2944e8af4e18f542c62301141", + "sources/mikro-orm-v7/task/checks/attack-f3-driver-observer-spoof-over-gold.diff": "750b3d98c6452779577fe492821ee3ebfaa68324925c71d56ec1b6ad2a61e61a", + "sources/mikro-orm-v7/task/checks/attack-f3-dropped-retention-over-gold.diff": "37bd555eb9a484239b9254e4c508176084b9651a3f806dca1b012598359de626", + "sources/mikro-orm-v7/task/checks/attack-f3-fabricated-read-conflict-over-gold.diff": "a3c7c52fe9d259c25c01839caf10d69ad55b329801f068c1658568b2c7635386", + "sources/mikro-orm-v7/task/checks/attack-f3-fabricated-write-conflict-over-gold.diff": "13c4744863b2c979d166e52c1d1b9d7d49ab93f399a19cf18afa2ea012d234e3", + "sources/mikro-orm-v7/task/checks/attack-f3-first-returned-only-over-gold.diff": "558abe513de7deb3ce6b62ecdbeb764dd8f57cf705e8a61e32b9966cf73ef647", + "sources/mikro-orm-v7/task/checks/attack-f3-held-request-fabricated-error-over-gold.diff": "45fcec2bf2aec92306267d3bf815629a5581a909b2fe774497de84981092c671", + "sources/mikro-orm-v7/task/checks/attack-f3-incompatible-hints-over-gold.diff": "5c139e50d585af7f2aae1123f2f9d6f00abb1e105a46c72941ce728f67e0e96e", + "sources/mikro-orm-v7/task/checks/attack-f3-read-modes-missing-payload-over-gold.diff": "6daf306b0f988786821494e419958a1d943227b72b3f7879113391de34cd91cd", + "sources/mikro-orm-v7/task/checks/attack-f3-read-modes-shifted-payload-over-gold.diff": "83f7c87cff190daef3b5ecf53555fa1497b2e1d691b01027f0fc3ba6b9443fb8", + "sources/mikro-orm-v7/task/checks/attack-f3-read-modes-to-write-over-gold.diff": "90a2b9c29cc32aeedde6df1a0da3e30344dc47d5b827b904c9a0d75c41b7559f", + "sources/mikro-orm-v7/task/checks/attack-f3-read-or-fail-corrupt-values-over-gold.diff": "645c3d42a30c2217af0a6bb659dc73c980fffdb09a9ac2a9fb9d5e2f84ff86ef", + "sources/mikro-orm-v7/task/checks/attack-f3-read-or-fail-first-protected-over-gold.diff": "acc7e0b0e1bc066cd3257bbb8cb6501416e4814ca2d4b4cd47f774806426f7a3", + "sources/mikro-orm-v7/task/checks/attack-f3-read-or-fail-top-one-over-gold.diff": "49380a682ec2c51e4b64462ee3924f3d47e85f08918c8fbbbb5cdf6842c17ebd", + "sources/mikro-orm-v7/task/checks/attack-f3-read-or-fail-waits-over-gold.diff": "8d8e2f5d60ae5bc824638c9a22d8df0f79744fcd504945fcf2a18f077867c381", + "sources/mikro-orm-v7/task/checks/attack-f3-read-to-write-over-gold.diff": "d63de22077d4a3e2fab930391d1d9a6982d9267a1b02fe20a1bcf6d26f0d5a4d", + "sources/mikro-orm-v7/task/checks/attack-f3-swapped-read-conflicts-over-gold.diff": "6d4a0e4cb92dbf602a97e16d2f6311140208417c5419f41191a5f0c188d3fb2b", + "sources/mikro-orm-v7/task/checks/attack-f3-whole-table-read-over-gold.diff": "c1d4a04fd5927f099b1e8aaaac6aa34bf6c77012405ab2fae20d0e94523ccb2f", + "sources/mikro-orm-v7/task/checks/attack-f3-write-correct-sql-ineffective-over-gold.diff": "1b0582a25667a49b3b33312c9a9702d885356a870abef91efa3b37425792cc2a", + "sources/mikro-orm-v7/task/checks/attack-f3-write-corrupt-records-over-gold.diff": "a3200d2adeff9d3a59ea5a76eab4ae2bee32d872763bbf7c20a12d8c66a3de54", + "sources/mikro-orm-v7/task/checks/attack-f3-write-first-protected-over-gold.diff": "a774689d3662e7060fa96fe0454899db8136588ff426a10fbe6ffbc817dd4609", + "sources/mikro-orm-v7/task/checks/attack-f3-write-or-fail-waits-over-gold.diff": "7bdbbeccbe67279b51b8fbd8c1b63cc0557b2bea775ad6b58ff6481d93191bc2", + "sources/mikro-orm-v7/task/checks/attack-f3-write-shared-substitution-over-gold.diff": "4edc04cf495679dca155885f1f1bb5d60b58a7145b2e43b4cd5041a96751ddb7", + "sources/mikro-orm-v7/task/checks/attack-f3-write-swapped-conflicts-over-gold.diff": "90075a0caf8fdb07dabe4267b18bd734cda23d0519e2d6e6b66e09051de48299", + "sources/mikro-orm-v7/task/checks/attack-f3-write-truncated-records-over-gold.diff": "dd5cb1067218444f5c1995e00ffb11315572bb71c1b19be28545a050b23e332b", + "sources/mikro-orm-v7/task/checks/attack-f3-write-whole-table-over-gold.diff": "374d5ceaab485c054ca4afe7652722a0601ff56809e91a012e449999064b2c65", + "sources/mikro-orm-v7/task/checks/attack-f3-wrong-conflict-over-gold.diff": "e2f0be08cce2f11532b620f67c7e42b08b26a655b78baf853d80c834e00eb999", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-borrowed-shared-protection-over-gold.diff": "a5e94649f29a6f4df0faeefd6717f4b468b88fdd02b7ceca8308de01ecc03986", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-capped-three-rows-over-gold.diff": "f763e190edecea050159cae06c84eebec213dd1b5aaed5be5d93636084da7684", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-exclusive-preflight-over-gold.diff": "ced95adffc2b07b37d4e0a4cbc184b9399a2fd3a79f27c739573d220f234aef1", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-first-statement-probe-then-wait-over-gold.diff": "eee6a1b34619f58ce47649d837f2c5ee58ce152dc96bee0e978cecf991494ce5", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-own-lock-compensated-probe-then-wait-over-gold.diff": "3ad2c423875a0ba68500d9c33683b5c4728a14640db34211a82092d8e14b68d8", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-own-locked-rows-dropped-over-gold.diff": "33a2e64c8c53e7adf91f500dd3dced0bf454f930b111707b6d1c1f47636baa62", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-released-probe-then-wait-over-gold.diff": "45527cf4808eb71e0196aeeff6f853bcb3a409204e9ec77acee2b39d91a240a5", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-same-session-exclusive-skip-preflight-over-gold.diff": "f10386f87e9b4d42e4b9c7974c38269bab1d17c3bb21e0b34ad00e21ce72d88b", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-side-held-own-lock-compensated-over-gold.diff": "9faa84a7c88772bf3293e9805fbdafd66815559414addbfe1c8b40fb51ea55cc", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-side-held-released-on-write-over-gold.diff": "0a6f902ddee2271325f93cf4c3d1ee0b3b8f1cf3cbd502a99d1b12a38a3d4cbf", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-side-held-transaction-migration-over-gold.diff": "ac8b7ea327ba1e5ba22b10d42bb541fb2e085dfab0be85573f143f5d9b8d9c15", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-side-held-writes-in-side-over-gold.diff": "a109a34c94f9578715588dd2426426dc52bb4cf828aa13cbdfaa327f39658e54", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-partial-read-wait-then-skip-over-gold.diff": "2ecd9fbb55ab3b527813d92a5300d6c6fb7de0626937d3fadc68f6ebeedc8ab3", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-broadened-query-over-gold.diff": "0605d7f736e1af76d8b4eaa1f0f5679ea221b89045575b999c6ea8b42c6123d1", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-correct-sql-ineffective-over-gold.diff": "c2c8f54c48a3fc69487b81d2fc229e2e0e72bc395532f01feea600c1423a883d", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-corrupt-results-over-gold.diff": "7688e3ddfd40a8fd71751ce2dbf09af7f04b5cb3d243f6dfeb7894d766f9795a", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-dropped-lock-over-gold.diff": "64bcde690f32001f90005759daf189524f56e66000712b5c15dbad6982c0fefd", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-exclusive-substitution-over-gold.diff": "05b3fc68df395b3931222131299e2f19e91cdd508fa4a2077bd03d7877910f1b", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-fabricated-conflict-over-gold.diff": "0872e36abd35ba895575fe2d7897951c50f4ff595f4c69dfbff317b49f471d2c", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-first-row-only-over-gold.diff": "5104eab8b4592088c456d780073aa565e4637265e16c4c9c2084b45899371b0e", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-inert-version-comment-over-gold.diff": "e73e4a9a9fe7a191db70762370742d58b4e43397c442a07e7423372644cefce3", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-ordinary-wait-over-gold.diff": "5557f6506467f91037fbffff6ff04f3be6d196c4b717b5e2a0d28126d18309b7", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-overbroad-preflight-over-gold.diff": "c0da6c5a464a18774a1588e16a6a615f66d7759df667cfc2a385bfb7fc55a6f5", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-same-session-exclusive-preflight-over-gold.diff": "47f41ddc6448db643741cd778229f6d4679c70cd4c5c5b0fe9b2ef9c113f009d", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-separate-preflight-over-gold.diff": "71b89dac1b1dacf6541c394277d203f0f7ebaecf14b56e41b30627aa44d9d260", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-swapped-conflicts-over-gold.diff": "ad121df3c255763c512b96df38c235056f4fb612ea5b0280d735e73e4c1796bb", + "sources/mikro-orm-v7/task/checks/attack-f4-mysql-read-truncated-results-over-gold.diff": "5ee1556983294cc0540e3e53fc5773512f27cafc6fdc35a98a59c9d64d5c053e", + "sources/mikro-orm-v7/task/checks/attack-f5-arbitrary-exception-over-gold.diff": "262e45a5e73cb5cb976e8b872c64db58d74544fcd88c07e6989c6e9ac5db31ee", + "sources/mikro-orm-v7/task/checks/attack-f5-default-wait-all-modes-over-gold.diff": "84af5f6c5f5d79548e995b49c4352f173c0fbb7940442a8db26864f01c6ff8bc", + "sources/mikro-orm-v7/task/checks/attack-f5-fake-comment-literal-over-gold.diff": "c9595099660591344cc2c1fd178e3557f3fa84784430009c0d3d0664dac34c94", + "sources/mikro-orm-v7/task/checks/attack-f5-no-lock-over-gold.diff": "fee4ac6d86d53811bb32bc2781ad1ab8358c596a3047b523c4d5d127e6b0ecbc", + "sources/mikro-orm-v7/task/checks/attack-f5-plain-unscoped-physical-table-over-gold.diff": "e76d2af169b9aafdb5cb6e442625cf4d7094f6aee46b6f8002ef5f28e1e50060", + "sources/mikro-orm-v7/task/checks/attack-f5-plain-unscoped-root-plus-extra-over-gold.diff": "99abb4838c605abb7baefa0c0b8901f558c6af570cf6505ff76c2a0677550f0d", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-comment-only-over-gold.diff": "4e3b06661219d7cbfc515f63c3fe71a18207270235794f13515af1bed01ba034", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-derived-table-over-gold.diff": "73f4324b8e86c7dade6c9629c9154bd1f209c4710a9d94792dddf5afd6d59227", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-double-fetch-over-gold.diff": "7ab3d22fe9f69fee00b83a58049bfcfe4480864e00d4956a51356079c0b6f71c", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-dropped-over-gold.diff": "e0a55ea83cd19880751ca3db4c08e3ee993491228d50cec49eabf2ad020af99d", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-dropped-when-no-offset-over-gold.diff": "e2d6265a798f9f32565c74d90051ce9e8d832dc6a9bde65f740ebe3193310c07", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-join-of-alias-only-over-gold.diff": "d5138b1dde8fd675cdb608c2efa5278924075d3b67f7e7f7d71ece7746c3a76e", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-join-of-root-and-view-over-gold.diff": "68883fa7997dd92f313e95b447eb5e4879355c8b5da10367c8a050dfa05f249e", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-join-unscoped-over-gold.diff": "d379ca8c174fc6f021a3421c98c4e07f24be7d437f9f315142537259a33b6f6e", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-left-join-of-root-over-gold.diff": "64209e344f841c60cbee4e56f93f1aa67ff81b1e7da5fc1871b466cf0ecfd2e8", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-lock-in-subquery-over-gold.diff": "bdcc7344811271470bdbf8c123b321b31f09439c877187779d97b351eac3a758", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-modifier-dropped-over-gold.diff": "d4eda511826365983f460e62e58e04e40784abadb16423bcb0e443700519128e", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-offset-dropped-over-gold.diff": "b49e03e290588c65b15f60f18fc2e96e808c1cceff7d9181d724b9ee02eec744", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-outer-order-dropped-over-gold.diff": "eae48c4d7debe31007f071d3fee96e5c30b12e4e8418e9f9091734826504fe7a", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-scope-dropped-over-gold.diff": "1155e8636fa5167be73cd5e1f55b3d2dd0b6307b366308fcf9323ada5139e336", + "sources/mikro-orm-v7/task/checks/attack-f5-rowlimit-top-rownum-over-gold.diff": "58c29b19247d73caab73ee198b7ad52156608a6b73f750b8b3b2819c6dafb34f", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-always-root-over-gold.diff": "7ed6b61d5f4ff509b59e49d02b16dd84c7db3376f1a903a053e982f4904c8055", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-as-comment-over-gold.diff": "ddb361564cb1289998cc88e848ee46cb4adb6ad87e09ecc5ca80453e80fe21da", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-broadened-with-root-over-gold.diff": "b50809466578416d8f57c0c853a5374e494277f1aa5e5ce20a558a2788a0689b", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-default-wait-only-over-gold.diff": "ae68716c882795a74069a36d5cb009a472e84721b8f7a96141f8c760cf5125e3", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-physical-table-over-gold.diff": "aca644d21949f4fac0e0c55a61dfa1510802b590b241db9092a3968f15f0441d", + "sources/mikro-orm-v7/task/checks/attack-f5-scope-quoted-modifier-over-gold.diff": "bb99b8f2b3481c1c34b03f090adc70e491ef0dce3f031ce44f4606cd6842a88b", + "sources/mikro-orm-v7/task/checks/attack-f5-swapped-skip-fail-over-gold.diff": "6632ada112fa48b7afcbe2f0fc37e9fed2122ba029630c58661bd4ebd0e1ae3f", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-both-always-over-gold.diff": "d0461f11c049d2d423bca4581626b75c32e38b03b26cdec661e4b988ea27a3fc", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-correct-sql-ineffective-over-gold.diff": "6e594226723d71a6ee53c73c419eca4dfacc73a15863ed2d530bdb940ab863e6", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-corrupt-records-over-gold.diff": "faf464f4cd172e4fae9cda5f222cb4889a645d1d667957d047c583399ec51e0d", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-first-result-only-over-gold.diff": "4f183d6dc2c51f1b6604607488d46ec9eb88d2f8c9db33598767bebbab0644b2", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-hard-coded-alias-over-gold.diff": "8698356a16fa19a367a13df8f341a56dbbe2f4cce567de0ea1db7af4721b3470", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-root-always-over-gold.diff": "834b21bceb8d39225f260b05bb26c00e792665638ab56aaa5cf232e661455282", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-truncated-records-over-gold.diff": "bcd6d14f2cf299f1d65d1cdb1aa477a268fe120d9a89a392304db82501bb8b90", + "sources/mikro-orm-v7/task/checks/attack-f6-mssql-scope-wrong-alias-over-gold.diff": "ee42acc28c0e8b38511e852ed312b6a7bbc17ea059b7479783dea899e55e3017", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-both-always-over-gold.diff": "6e0f95158bd47a1c96d0e40c7f251d213ddcee93e49957628dff337e1a421837", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-correct-sql-ineffective-over-gold.diff": "445fc42132b95fc405e8910700c6350c2156c43d7c750ce16f2f00413ccd9e3b", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-corrupt-records-over-gold.diff": "7f7836314cc30203372524fb649a40e2d8f81f4178188117853d22965518e7a4", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-dropped-over-gold.diff": "b734acfc81d67cd63f29b87ff17876204b249b760eb5626f5f42c60b51ce1264", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-first-result-only-over-gold.diff": "c552e1ec341f6b559b1b5b77f24b7b037a78830fd4081a3413383d831554d675", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-reused-aliases-over-gold.diff": "01f68db710df104ffa8ebf3b833a799bad77323fda735b8490152ef9c27cf447", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-root-always-over-gold.diff": "c5dcf2d3362ecf24968ab2e129a1a9c7388edb4ee735da8edaa0446de5f8dabf", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-truncated-records-over-gold.diff": "f13b8da4b40e72a5e4fbf8956feaaa4f070a5acb6a9d1301561ea29fb615b830", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-weakened-lock-over-gold.diff": "8e3e3e5341175e91c8f242dc3083728bbf2d0f78493842b4a4af7fcba178ee17", + "sources/mikro-orm-v7/task/checks/attack-f6-mysql-scope-wrong-alias-over-gold.diff": "1eb5a2f623afb2ea470bea0dcd6f8ff8dcb72defa7c11535ee5febac8d58c094", + "sources/mikro-orm-v7/task/checks/attack-fabricated-orm-conflict-over-gold.diff": "f2d1cd6392ae9709a8ff547fb6308ab7410966b80a9d9eb726b4c0b1790bad57", + "sources/mikro-orm-v7/task/checks/attack-first-row-only-over-gold.diff": "afd5869481a3c7443330989cc4d34aa2e2bdcd0ca54612a7516d1a05d0071533", + "sources/mikro-orm-v7/task/checks/attack-matching-failures-over-gold.diff": "053f8b22f4b5a7b2c3614c21e59118f85870fd3254f23f8f6614530a893d43f5", + "sources/mikro-orm-v7/task/checks/attack-production-comment-no-op.diff": "83248735d4d52ff47beb4e071db41d3094d7a4cc226a04c66849b7ea1b053ee9", + "sources/mikro-orm-v7/task/checks/attack-whole-table-lock-over-gold.diff": "c3d7215bf566a838a4420294a7dcc7002ae3b11a27e7fc08aeba739e72a9885e", + "sources/mikro-orm-v7/task/checks/attack-wrong-lock-subset-over-gold.diff": "5bcfc2a92bbf895039c7a386995c0ef85ea012a5f66cddf3a57ae3100447626d", + "sources/mikro-orm-v7/task/checks/correct-api-internal-protected-member-over-gold.diff": "eb354a1b6ad3b5ae7c7f8272e0335f18a205a59579a06e026f805101adfd6e64", + "sources/mikro-orm-v7/task/checks/correct-api-private-helper-over-gold.diff": "b8b1aed21d6568c1ed4a1c24a97bab18257e09917acc7f668f409b8b23d7b04c", + "sources/mikro-orm-v7/task/checks/correct-conv-new-test-and-docs-over-gold.diff": "bf1024531325b3e7289ba73caec888b81b9c03ab460d8f5eeac9d399dfb45570", + "sources/mikro-orm-v7/task/checks/correct-conv-updated-expected-sql-over-gold.diff": "3e10cd6e85107f079b2546f85142d0fe05311d23c4621fdd07a0484188bec7c1", + "sources/mikro-orm-v7/task/checks/correct-f2-mssql-nested-updlock-over-gold.diff": "6db1255250aa505af29dc05a0e8e698a2b7b1d12b6e4e62bef279fcca5884e5a", + "sources/mikro-orm-v7/task/checks/correct-f2-mssql-rowlock-only-over-gold.diff": "b2f78fd94bf65706b18a0585a1ae5020d4ef5ed8596d28265b63457c991cf320", + "sources/mikro-orm-v7/task/checks/correct-f2-mssql-top-updlock-rowlock-over-gold.diff": "aff5ca1d76d7f12c99fd95a1dd1d0be0cb2854370d8877ba2aaa3f19439c8dd6", + "sources/mikro-orm-v7/task/checks/correct-f2-mysql-derived-in-form-over-gold.diff": "1a33482df262aee63795c2d69b542ca8419595f245fc5902d10631c4d785c875", + "sources/mikro-orm-v7/task/checks/correct-f2-only-querybuilder-repair.diff": "57bc3e7925560045d3a0f0221c146f24862e54895f8a764a3210e3499d2b50d5", + "sources/mikro-orm-v7/task/checks/correct-f3-read-session-isolation.diff": "d6689c36ad5aca0928c2b97c7e9fa580dbdb86bf9f94ba9d1a88ae8379871dba", + "sources/mikro-orm-v7/task/checks/correct-f3-switch-repair.diff": "5915eaf37615edfca3293b2caf8b30ce64c1c89ca84ee2b7328f9eaeb7be9c97", + "sources/mikro-orm-v7/task/checks/correct-f3-write-switch-repair.diff": "2bfb2063eb2fde3e67e1778eae991d233dcfbb52167cad37a63976dd82045705", + "sources/mikro-orm-v7/task/checks/correct-f4-mysql-read-branch-repair-over-gold.diff": "d3a64bbc0e1f6bcc1269a4d9a9d1d762889ea1caa2b82d3628d1d5af29c1318a", + "sources/mikro-orm-v7/task/checks/correct-f4-mysql-read-equivalent-comment-over-gold.diff": "caab846595278b735d002662e0e9221d7058d99d85916f641b3469e36835283d", + "sources/mikro-orm-v7/task/checks/correct-f4-mysql-read-equivalent-of-alias-over-gold.diff": "a4de754f5acb4ea234200ddb07b3429fff9da72816e912ec4cacd01b0676fe86", + "sources/mikro-orm-v7/task/checks/correct-f4-mysql-read-equivalent-spacing-over-gold.diff": "871847fed5d6b74ab83cb3537d73bec060824b6f7c48f8f2b025adadfe2ba402", + "sources/mikro-orm-v7/task/checks/correct-f4-mysql-read-equivalent-version-comment-over-gold.diff": "81d33006e794011737239168481154b8b55b87ccca5eef0f6af209f9208e995e", + "sources/mikro-orm-v7/task/checks/correct-f5-only-oracle-read-repair.diff": "0b8786e1255dff55aaf23fbb73d513c20e098aab12acb0761567547883dc636b", + "sources/mikro-orm-v7/task/checks/correct-f5-oracle-root-scope-on-unscoped-over-gold.diff": "781b28482ae6f54175e6fd2873ac994c198bd255aa828ff514441b91eaf45905", + "sources/mikro-orm-v7/task/checks/correct-f5-rowlimit-join-of-root-over-gold.diff": "8d5687bcdbe1fe4666fe7c9c72baaad911c4aef6596e43e7215454ed995dbf12", + "sources/mikro-orm-v7/task/checks/correct-f6-mssql-scope-suffix-repair-over-gold.diff": "d7a19b63e1427121bfdeb37f70894b9d824fcba656df3310451e0e4e9e168cae", + "sources/mikro-orm-v7/task/checks/correct-f6-mysql-scope-builder-repair-over-gold.diff": "aa4e0274a9c3a307d62c9670bb76a1d2a3afb4d423e6a236b63f0175b50fd0bb", + "sources/mikro-orm-v7/task/checks/invalid-old-gold-mssql-partial-read.diff": "2eb33bae67e7d498d0ac68f0a45c440d0fbbc5f9a2284e63c0547406009e7f42", + "sources/mikro-orm-v7/task/checks/invalid-old-gold-suppresses-shaped-locks.diff": "e66cc88173f2047b5b1d0b4c0e329768dc89f4937fe716890d7364b364b2eb6d", + "sources/mikro-orm-v7/task/checks/nondiscriminating-f1-shaped-prefetched-lock-set-over-gold.diff": "3d686edcde374226349cbf015491407f3fee5457617fc6b235c2a464075a0188", + "sources/mikro-orm-v7/task/checks/pfr-attack-f1-distinct-only-lock-after-read-over-gold.diff": "3f324bf9257bdc9aa41ff610b2b9be1f7ef9c59e5247db939f97c3caf053327c", + "sources/mikro-orm-v7/task/checks/pfr-attack-f1-read-modes-only-lock-after-read-over-gold.diff": "320b48b4726677e37f88040006771723d074bc569bff2ff11e0fa555695db1f7", + "sources/mikro-orm-v7/task/checks/pfr-attack-f5-oracle-scope-dropped-over-gold.diff": "1701058962c3ae68e9d3ca072f66cb53aedc6e867ed5c7854730534e5bf97e82", + "sources/mikro-orm-v7/task/checks/pfr-probe-f1-lock-cap-5-over-gold.diff": "97cd3b9ca55001ab251d29d7ec7cb162acc2eccab922ec74283d132cc03b8fb1", + "sources/mikro-orm-v7/task/checks/README.md": "f04886b8bb43da1256f295e05fd9b48f580469dbe91608f22efcbf3039945859", + "sources/mikro-orm-v7/task/checks/rv-attack-f2b-key-range-prelock-over-gold.diff": "a6fecda7e4e4b6af3fa0a5555fc151a2b74709d266062aeb60a67a7af5594cba", + "sources/mikro-orm-v7/task/checks/rv-attack-f2b-whole-table-skip-restricted-over-gold.diff": "3ef20202621dde1330ba3e001f546ffefba00390ba9e34e88fc7ce7defd2fe58", + "sources/mikro-orm-v7/task/checks/rv-correct-f2b-mysql-single-statement-over-gold.diff": "0561ff27df6c8b72c7acee948180f41ea7f8a84973b3c2336cd6c7190408be05", + "sources/mikro-orm-v7/task/checks/rv-correct-f2b-mysql-single-statement-v2-over-gold.diff": "4dd8a33b9f96a24553a4975b714a6adab71825251e7d254314d6a3f31190e382", + "sources/mikro-orm-v7/task/gold.diff": "14010e0822da5cad9d5b1a64985842b91056ceb22cc6fbfcd6c867bd1c4e6a82", + "sources/mikro-orm-v7/task/grader/conventions.cjs": "5dc7cb2c2c39d5a2712bbff7b2f85de460a1f276f5d3bd1c41c3e5810f2dd269", + "sources/mikro-orm-v7/task/grader/dml_observer.cjs": "08b54f04643271ec87c86a4671edcf636fb724ee03ab374dab4c5bcbb217d095", + "sources/mikro-orm-v7/task/grader/mssql_observer.cjs": "5fe9469334f21da1946aa0187ac295ce1516b0023e4bca7eb35ac8b9b27f401b", + "sources/mikro-orm-v7/task/grader/mysql_observer.cjs": "683bb5a98a8b5b1be08f62b19e36e50c964ddbd13866a0e9c709fd3556550581", + "sources/mikro-orm-v7/task/grader/pg_observer.cjs": "61757496a1e2584daed3defb787da91612f82b8b6c52e45b1a3b3b1ceae27ad1", + "sources/mikro-orm-v7/task/grader/public_api.cjs": "47f6c8c9f3cb39f89059b535092e314788fc1316e04ad3ca99472f704d915742", + "sources/mikro-orm-v7/task/grader/run_grading.sh": "ddbd3afdbd15ac4c8f317763239252a70fbe0b249a55550f7b40c9e9d656d6c6", + "sources/mikro-orm-v7/task/grader/tests/__hidden__dml_sql.ts": "1d9ff6ddeff38501901554543a32edc00034a64277c5edcded4b6ae0f3b4adb4", + "sources/mikro-orm-v7/task/grader/tests/__hidden__grouped_select.test.ts": "53b9c2be6f8eade2182064dbfe638c533ec666cb95b07aba2dd83a06f046d9d9", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_lock_modes.test.ts": "56235b65c6bf7959ee92bd2be40ea8f90cc49390b4a28af6b377038d1c7ddf5f", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_lock_scope.test.ts": "c0eb2bf253ba3db602110fb9a7003b98ac9ab675401b63bac5a3dc75a140c751", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_lock_scope_support.ts": "b3097725f07150272089da89773fc644e0f29540f470478d48992224b9088dd9", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_partial_read.test.ts": "ce3a52ef80d7549bed522735b9d1cfe50cfddb9dea6d05a80fc0fdc54a24c5d9", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_partial_write.test.ts": "5861e7c3d8fc9b958ccba1b601d62431f5cb9fb72641208032b8a11ea66dfec5", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_read_or_fail.test.ts": "7139d07b30d9f51a8a4c37d91b853b27d4d18ede69fe2cc42679b1ecdaa80616", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_read_support.ts": "a19e7b852520f7e181acb43a9948e3b1633f92c257515af339501705f2731846", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_write_or_fail.test.ts": "f6011525bbecbc8d7c19fe1829f16e6212300653471a9b3a4de8499269842dec", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mssql_write_support.ts": "677e117fcc90c04462f25eee3bff0fc0135237392198ffd0937ef02eb4618ac3", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mysql_lock_scope.test.ts": "9e4d63a6141e95a2b4543e525896910dec263811f3a232971af7be700b7c1cd0", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mysql_lock_scope_support.ts": "e0c49ecd0b28efc9b7991ee7f3895084771c6cb99016604f70548202fb45d961", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mysql_partial_read.test.ts": "7a86942d79f4cdfe54f954feb488fde4e2383f8bb5eff2c0485ca25b4a475dd1", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mysql_read_or_fail.test.ts": "769345957a7a58a3bb4d3b31fb1284373cb90a0d6ef12a1e1e7d836bcc4c7160", + "sources/mikro-orm-v7/task/grader/tests/__hidden__mysql_read_support.ts": "7467375f91e28a12b9d926cdf95309fa3c29e7d239b8e8b36879439a5de58b39", + "sources/mikro-orm-v7/task/grader/tests/__hidden__non_select_conflict.test.ts": "aa1cfbbadc7c3ae21bbeba6247ba51fed4e400f0d9e6566b4ba1edb25c9d1eda", + "sources/mikro-orm-v7/task/grader/tests/__hidden__non_select_lock.test.ts": "46b41e59f6178d307bcac8ce3db2dc9c656310190ab58599cbe07c3d288e2a16", + "sources/mikro-orm-v7/task/grader/tests/__hidden__oracle_read_lock_semantics.test.ts": "12f2a39caf4a2f43ab09f8a51b4463e286db5642c438256b38834a777c5198ba", + "sources/mikro-orm-v7/task/grader/tests/__hidden__support.ts": "3c5cf64279aaa0f26a45cd9dab0160320a6add0149a8a6884abf0b5360b9cdb1", + "sources/mikro-orm-v7/task/grader/vitest_verdict.cjs": "c56c8ae9181431d1f22beaeae0c9a8ec69c72a58723397595a00d45845dbccb9", + "sources/mikro-orm-v7/task/prompt.md": "3db0ebf3dbdf396cc19e7f5d81b06cd5dce27be2ae4fcc7fb769716aaebd420d", + "sources/mikro-orm-v7/tasks.py": "2740325dc1ed5ebc9a1664977311f25de56a20e1a17062e002d2d7bead2db6e1", + "sources/open-xml-sdk-v5/calibrate.py": "ccfbbd2b594bac882d8f24d4304ef6a5ce3d76499d398098a78679bcdd77f8be", + "sources/open-xml-sdk-v5/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/open-xml-sdk-v5/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/open-xml-sdk-v5/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/open-xml-sdk-v5/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/open-xml-sdk-v5/Dockerfile.hud": "dff714a5ae2a6cdcc6faec4062eac30bf388c33c4b5c20089f487ba45f839369", + "sources/open-xml-sdk-v5/env.py": "8c5657ef04817aea9e2daa5fabf91826c2accfc14a71a85be817d360d72da810", + "sources/open-xml-sdk-v5/pyproject.toml": "75b2612df79a750ad777fe8a07454dec381ba97e07c614248a6fddf34259f89f", + "sources/open-xml-sdk-v5/task/gold.diff": "0b05ea5634189310b8b39db8eb2cd6260384dd37fa1e31da6c5b5382e05b7448", + "sources/open-xml-sdk-v5/task/grader/harness/controls/alt.diff": "d32bf8a8393b002c669d4184451d4e9f0dc495387382327b915e0b6c4f1fa93f", + "sources/open-xml-sdk-v5/task/grader/harness/controls/cheat-keep-bytes.diff": "38d7777c9d1cc9edf8ffd1178dc2b2a0ae5a83a2cf16332ab4e8c2b97d417679", + "sources/open-xml-sdk-v5/task/grader/harness/controls/cheat-tests-edited.diff": "fca5e82cb79f9598a9f740461cc7ad26d53973ea8c436fcf3d7d31abf2cf5398", + "sources/open-xml-sdk-v5/task/grader/harness/controls/lazy-both.diff": "d18145badc146f845931521bc65bc49d81a5363bfca6a558c714fbfe71a18d58", + "sources/open-xml-sdk-v5/task/grader/harness/controls/lazy-case.diff": "d2339ff85590fcb6c9ffb9e0df904cec035e2f86ed5a1adb05e70ff50113177b", + "sources/open-xml-sdk-v5/task/grader/harness/controls/lazy-changeid.diff": "ce3c12527c2160098204d77c06145edada40a0d73cc38bd2efaac363cce9d37e", + "sources/open-xml-sdk-v5/task/grader/harness/controls/lazy-strict1.diff": "e3adb2ebbcb06888315a3dc683a0c1ca814ace35208a45b2f864b5211c09067d", + "sources/open-xml-sdk-v5/task/grader/harness/controls/noop.diff": "cd547b99021c0a52702bf7c6bd4b3635964d40c025dfda5c87090913af368384", + "sources/open-xml-sdk-v5/task/grader/harness/run_grading.sh": "8a63fca0e3e43ba061afb853d7ba66ca81c9448f68596943fd10b4fb8cf8db42", + "sources/open-xml-sdk-v5/task/grader/harness/spec/DeletePartRefsSpec.cs": "8f1cd5f80d73310f378459885d87a6fe72897af71e5e889cb00b40d14eb54bd3", + "sources/open-xml-sdk-v5/task/grader/harness/spec/GraderSpec.csproj": "99fe092a4ab1edbd2e0bbf31f436d9a8fe741909ca35f8a199760b09a1225659", + "sources/open-xml-sdk-v5/task/prompt.md": "34611c2c9f1b517f58ff29e1da24ad77814222e76a15e2fd99d1342517fbdfc6", + "sources/open-xml-sdk-v5/tasks.py": "f753d247c7673592516e3808091de8ac8555d97994d10f1b5c3eca9d48140d44", + "sources/openfire-v9/calibrate.py": "cf24d9dc0f8253f55e953981b8fe50578fa9317f22005c102ee4550e8957d152", + "sources/openfire-v9/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/openfire-v9/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/openfire-v9/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/openfire-v9/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/openfire-v9/Dockerfile.hud": "4da2cc73907c5b29781fa347c6376763958d38fbdd5b56335d6c5414bdb714f0", + "sources/openfire-v9/env.py": "08a8fea48013da1bfbfdf4791922dd9e8d95dc2a17af0b7d17d7de7adbecc91a", + "sources/openfire-v9/pyproject.toml": "50376590ab4a0c4de8e56adb1a38ef8e9363122a04ec6d38ef6da63e1cb8ee14", + "sources/openfire-v9/task/gold.diff": "df0a1447617c7b555c01f65ca20964e4d518d145b5dc0081755fe9333db61365", + "sources/openfire-v9/task/grader/board_smoke.py": "c95453ba720db49ea6856a2f37ce7d25398344ddd7c9d978cb58175c8cef8b65", + "sources/openfire-v9/task/grader/harness/HiddenOwnershipChecks.java": "2929de9902853a63560c940d189a02fe9efdf323957eb23b1aaba277c85ca934", + "sources/openfire-v9/task/grader/run_grading.sh": "4a5b5b5e7fd69eff9ff060d46910830f47d91670af06f9dfe6833fb285ae94e9", + "sources/openfire-v9/task/prompt.md": "1220fccfd54e0cd15470a50e30d03e6699921a0ed26ddb248508379ccf44e8c5", + "sources/openfire-v9/tasks.py": "317473bdc4396fde46516b3d0968ffd404182c167b678c11a7078c35984ae704", + "sources/rope-v3/calibrate.py": "c0066a539cccc3b59825d2336bbad544382f2a03d0b466be67d6e6bed81b40f1", + "sources/rope-v3/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/rope-v3/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/rope-v3/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/rope-v3/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/rope-v3/Dockerfile.hud": "13d649dc4799480a20a2c498d831842bef7fbafaad8d21f7efaabad012a84e03", + "sources/rope-v3/env.py": "c854bd127854d56feb7b2b2449352ccfd31b4d88aac2c3c3496a46ac1e571af8", + "sources/rope-v3/pyproject.toml": "0a4abee41fb0a93bdb201311f5bca4798d5e4463a398fb13d9fd0616bb73770e", + "sources/rope-v3/task/gold.diff": "b812775f8007850b09063abffe292378ddb4c30e31e054e33155be108ffccdde", + "sources/rope-v3/task/grader/controls/alt.diff": "61d0c2b53cdebfae55976d675f8b3bbb663bebdb7ac180313642ba28f9e4b9e5", + "sources/rope-v3/task/grader/controls/cheat.diff": "29562063f4f3cb96ea00d99176ebba0dac8e4f580aca27fa3742a774e023a053", + "sources/rope-v3/task/grader/controls/lazy.diff": "8d368b1b6c7d03cc0e537abc93d53157d00e6ff5a2cf3dd71ac7eb06cf6e7577", + "sources/rope-v3/task/grader/controls/noop.diff": "03bc7107a42c7b1a392fc57fff1e24139fe706a5a523a1b62f83a09b980a0eaf", + "sources/rope-v3/task/grader/controls/prevgold.diff": "9941839f9e481deec59bcee38385c54c27a4fced5554165684544b2cd938ae4b", + "sources/rope-v3/task/grader/controls/tamper.diff": "d0907273f4815e4097af07a2f2b11195eaab741aa2833edcb93934775a9aab59", + "sources/rope-v3/task/grader/controls/tamper_gate.diff": "aec83b3f5b8db7f1fee9fb4d9d1995b48b82f185ef14bdf5a39df93d46527459", + "sources/rope-v3/task/grader/controls/tamper_key.diff": "b968a632c34e0ecfb1b935d0725330e819687bd16796554a572510c0ddf66711", + "sources/rope-v3/task/grader/controls/tamper_report.diff": "d825d7d9a816995bbe8014c400873a72356f44eab69d4bbcb91156e1f296fd6a", + "sources/rope-v3/task/grader/controls/tamper_wire.diff": "e8dfa58ea7776eb5db6d402e0b9c0ebf9114fa3d056dc576cfc5567e23181439", + "sources/rope-v3/task/grader/harness/__init__.py": "568bd6c04614170ea6c3c66595003cfa447cd1a44d5fe78d489a7be1426fb076", + "sources/rope-v3/task/grader/harness/cells.py": "2d32421994810c0776e3d093be4a99b2667bf68e3736a21477c30c9b0190d1d8", + "sources/rope-v3/task/grader/harness/check.py": "34079134e8e56d2dfac01a6c7e63ea3717d418d03de9ae8d02090b6a85c0bb05", + "sources/rope-v3/task/grader/harness/gate.py": "9ce1d5f085a6b9ff66a60b270032f7600af3506f3b445289a69aa6b2b46919c2", + "sources/rope-v3/task/grader/harness/runner.py": "dc3fbc3ef38df32352d0de7ba144c6fbdd7a35d8d6c95e009f1112b082a870fc", + "sources/rope-v3/task/grader/harness/sandbox.py": "55ae2e0035a6ae1433cca1ae041e49e8f7390247f5585ad1e6106a02102b7c84", + "sources/rope-v3/task/grader/harness/work.py": "f74d6606d47928590e557328518c8763f6252a2d7c81879e939b6beba22a081a", + "sources/rope-v3/task/grader/run_grading.sh": "7ca28a474f8923b7a78422cefd457b820bdafd4707846015a25c7e866fbb1e64", + "sources/rope-v3/task/prompt.md": "0b98d88357123683342de96de8dd1f4622e394cd7f612ecdcd9e903367178a52", + "sources/rope-v3/tasks.py": "19a861fbb001602ddd6a4a545788d012f7a2f92aed3a0ad478bc05a1ba438cab", + "sources/sequelize-v27/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/sequelize-v27/coding/github.py": "5111a2264c70710a90ea6ecf154147eb7757311bca4f1bce7ea975c0da9525ae", + "sources/sequelize-v27/coding/repo.py": "f9b001028bb965a50740cdf90f84ba1dc93fda3daa831c42e58d712c6af74113", + "sources/sequelize-v27/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/sequelize-v27/Dockerfile.hud": "a423a858568bfabafd2fa65d49adee215bddf379d0e0e05bd013c8b3e94eb339", + "sources/sequelize-v27/env.py": "00a832aed1275112bc822a06d50e8c8cabadafaff351ff9fc65166ed514ac4a9", + "sources/sequelize-v27/task/base.diff": "c544b72311b170450bc12b12eb6e8630635d34875ea02d5cba8883bfbec1027f", + "sources/sequelize-v27/task/gold.diff": "a6fd07c900a33be6db1976de48db2231ff124eeca110de2e3d2bd9e0c6ca7684", + "sources/sequelize-v27/task/grader/maintainer_review.judge.json": "46b0369a6ab36adc79d0d3d050b9d53e9c4298dea811763d1164456ba99bcbef", + "sources/sequelize-v27/task/grader/run_grading.sh": "4d8db10d24ba0c180d3a1c3dccf8f6f3e48c38f33e65283dafe20daf98037764", + "sources/sequelize-v27/task/grader/tests/__hidden__aligned_inserted.test.js": "68f4f3477beaf1eb68f7d80c3cc55f6a044f6ba851be220b2cd26c464284de23", + "sources/sequelize-v27/task/grader/tests/__hidden__children_attachment.test.js": "15ed6727945dc7bfda54361a12c44691d43f9d1abccc046172181034b04b4d28", + "sources/sequelize-v27/task/grader/tests/__hidden__date_key.test.js": "b40caf9265a97965e97d39bf5c666eb1e5629b526f854e38d2ff3767dffc3ec3", + "sources/sequelize-v27/task/grader/tests/__hidden__expression_columns.test.js": "1aa83de8f0977f1e4a62367fce6111fa582f39a544e92906c9c3d592306e4054", + "sources/sequelize-v27/task/grader/tests/__hidden__key_variants.test.js": "db78f355d97a5c91a6b66a3fd095b925fb8d1605c3b50b2797eb661340eeb6c0", + "sources/sequelize-v27/task/grader/tests/__hidden__returning_restricted.test.js": "bbb6dde137a08f6897260e19f19604ee6500b37c5926362549c05efeece42ddc", + "sources/sequelize-v27/task/grader/tests/__hidden__skipped_honest.test.js": "13aec181b3eb55453b3e87b7c8cc163913f365a85f72c3647dc693122debef98", + "sources/sequelize-v27/task/grader/tests/__hidden__skipped_timestamps.test.js": "3ef2cd763289d2e8fa189fb2ac02b91f6657bb48a6c318c60655c9019c04796b", + "sources/sequelize-v27/task/grader/tests/__hidden__untouched_paths.test.js": "d532a0b331900df8dab72413398044c8d081423fbfdde660428a25e3f4c8f582", + "sources/sequelize-v27/task/grader/tests/_fixtures.js": "f7072ab74aff2ec24f7a79886f92fff00729020d2dcab2f21edec43084769f5e", + "sources/sequelize-v27/task/prompt.md": "0cb8dcccb3cf9f803b82100ce107e84badbe58e1aabfe4efb514ac06ec1a1879", + "sources/sequelize-v27/tasks.py": "b35afd6d4fd7d9fbecfd7e6408226e0e4e393cdf5756578ca5a5b9c49f5152a3", + "sources/sickchill-v7/calibrate.py": "55e07727d5214fae9851f8836f3d2fd7682dd1aa2b7cd1998dabbb0006f4038a", + "sources/sickchill-v7/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/sickchill-v7/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/sickchill-v7/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/sickchill-v7/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/sickchill-v7/Dockerfile.hud": "e714ab33298716d25a5e40dc4485110dffefbccd92f4ff067fcedeaa9a2321ce", + "sources/sickchill-v7/env.py": "ad96e968fc427232590e725b9e3fb607de8dd3ab9823a72bf9130697fe59f154", + "sources/sickchill-v7/pyproject.toml": "4a00f17930e707916beb26746ded279423ed0cbbd5fcd51b14ca2dd80898ac11", + "sources/sickchill-v7/task/gold.diff": "e97d5174d467e6e1814c03fb5ebf71e3f29220876ec70762c519988a252f291c", + "sources/sickchill-v7/task/grader/cells/nfo_cells.py": "4505e134402e20d8933e49b2839b350afc95548e347fdb329971274634bb66df", + "sources/sickchill-v7/task/grader/controls/alt.diff": "bc7bfa74df3ac28ca6d2922e224c7db23fd71c55d60f27481f2227aaa90be98c", + "sources/sickchill-v7/task/grader/controls/cheat.diff": "7cb0cdbc7404855a1a6e355221bcd91891026dabea13c9a70992724f13fd9acb", + "sources/sickchill-v7/task/grader/controls/lazy.diff": "6b6326182633f094df1e322a2c99d71e3c70cf5e0c684ed0fff9d7e2d4b4ecde", + "sources/sickchill-v7/task/grader/run_grading.sh": "d0b219c0289a85c0e99809746505838732d15d1aa07409010791a14f2d2249d2", + "sources/sickchill-v7/task/grader/suite_deselect.txt": "9615684d57eae8b0658cc9e38d39e0e9e62ce09175621c1fe74e22b1aa4f0398", + "sources/sickchill-v7/task/prompt.md": "536c2b817bc35900855ff38599def2f92d554029f799e397856bf405c3030e00", + "sources/sickchill-v7/tasks.py": "eceee068c2da51fc8be378352d2cf2eb25d5c1ae0a1be7ce20df67fdbf9ef774", + "sources/terser-v3/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/terser-v3/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/terser-v3/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/terser-v3/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/terser-v3/Dockerfile.hud": "936b4e5d8ecc7273e8a379921ee13dce95d6b851fcec7b5b8dda605c3342d863", + "sources/terser-v3/env.py": "e00096aaee5cc3c0780634ef324dddf7f922d9d4d5d1401e030102cccf78e8fd", + "sources/terser-v3/pyproject.toml": "8d4ce44faa0f5ae38e5ca6f3ffb9f7b93081a1414080dfd67440b625d2809fe1", + "sources/terser-v3/task/gold.diff": "0e226243373d75d69db855fac17d273c78a2aae41f16d42bfbac7fdfeba97922", + "sources/terser-v3/task/grader/.gitignore": "09fc8611bc8af2a51e1381ea348c2e8877be01b78f50eb9ce3a18a7ca3f9c344", + "sources/terser-v3/task/grader/data/corpus.json": "e92063e620cc719ad3f03f07c1d537358244919b6ede15979a5c4af0ad4c1042", + "sources/terser-v3/task/grader/data/test_tree_reference.json": "d88d92590aedb4030287ef954f9f6e22d4dd16774a1b36d1a3014badd10d79f2", + "sources/terser-v3/task/grader/data/unlisted_reference.json": "74eef3fb4ff9fdbe5ed41ac783c5e4a42e3dc955e57659dc405308a0b9e9162f", + "sources/terser-v3/task/grader/lib/apiprobe.mjs": "2412b4927bc2fffaa9bbeee211e359d745fa2fe00d81ed6f4ac02cd7f2f3323a", + "sources/terser-v3/task/grader/lib/judge.mjs": "dce316b3c48dcafc796af6bc6323fe9342c648c0689f226ca2a65965f2fa49d2", + "sources/terser-v3/task/grader/lib/testtree.mjs": "d561072afa46e5610b53903800a430eefc7dd6acc3aed553959c76d60850922f", + "sources/terser-v3/task/grader/run_grading.sh": "87f14e883f910dd3aa8cc09d185d1897744f8b6e875da691b1a4f44b34c7a450", + "sources/terser-v3/task/grader/tools/build_corpus.py": "87b5be445b0ceabe781f8506b6df6a57d7c7f9176c32a44d5e03ef821f55dfea", + "sources/terser-v3/task/grader/tools/calibrate.py": "d8b30dc2acec40e84716b9eaa3d15342667ff827701e33dfd3d54d3de229a206", + "sources/terser-v3/task/prompt.md": "38a1bb443291b7bf340ea191c343146f4cc33c7bfbb1b77d12aec4653249aa0d", + "sources/terser-v3/tasks.py": "bfb9f0bdc7265d4ca59dc8227d4dad61534019ce0b7e7abc7652434bfd9f810b", + "sources/umya-v4/calibrate.py": "dbad1dc4f1fae1ec85c1d511eaa139b098d811fb1beab549a5af3bb1beb7b18b", + "sources/umya-v4/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/umya-v4/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/umya-v4/coding/repo.py": "b1366540d1ea28ccb7cc578a311662ef4a2b9e7e5a4c27543dcbd594cc6d86da", + "sources/umya-v4/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/umya-v4/Dockerfile.hud": "ce32b2a63559a0e15e84e819f1e933f602ccfbbb50a774763b234117790f4204", + "sources/umya-v4/env.py": "6af577af8f336b6fa293d68c1d9a4556a12f0b90da98be357e9f8b3ab57c5bc1", + "sources/umya-v4/pyproject.toml": "955633fdb141b4ca36a4338d8836ebb58234eeaa39e15437ca7087c7543cd20b", + "sources/umya-v4/task/gold.diff": "c1301ffe2fb499dda5241085585df894382bd7bb90dbb95a8b806003be0d1705", + "sources/umya-v4/task/grader/harness/cells/Cargo.toml.tmpl": "32b9f89f8c892104b29351ec5c4303ce73b800895380a88d3efed034e8ab9d84", + "sources/umya-v4/task/grader/harness/cells/src/main.rs": "9fe7f70d5783d6dfcbbf6901574492eca96384c340feb9d3a2fd2dd72cb2c19f", + "sources/umya-v4/task/grader/harness/run_grading.sh": "96638bdf30d8ee9bd2b43d9e6d384e4f7abf24e9c4be8ccc08f5bece90ca4b4e", + "sources/umya-v4/task/prompt.md": "9fdbcdcbcf60dc8b006bc62d766d36191056c7b6f340d699965b97470ac29ec0", + "sources/umya-v4/task/repo.Cargo.lock": "c7a7a54508f21ea6cba82ece5f3697bf61aff338beb559209e32c8a62f9e0cd0", + "sources/umya-v4/tasks.py": "37f55ae22980a52a7b728d9b42d1c8e5243e3f56a6255fcca472ae5157d532f0", + "sources/zettlr-v32/coding/__init__.py": "9ba11441d392f54835f33527d4a098f48528824a8f8c3c255cf4c140f89523bf", + "sources/zettlr-v32/coding/github.py": "dfb450735dd44af94d51088ccd37df0470a4bf7c1339f5277aea2419bd64c694", + "sources/zettlr-v32/coding/repo.py": "f7ca325465530ac6aa06652dd9468696483cddefaf78c80e25926f6785ad1701", + "sources/zettlr-v32/coding/swe_bench_pro.py": "9b1131236eb514c62ba3a3bfb7aba61bad29df18a0293afc1bcb8a277c4ff929", + "sources/zettlr-v32/Dockerfile.hud": "aaf2fd15d1859453af7ebce7da5c92ccc52e2790817feea17c062357696b593e", + "sources/zettlr-v32/env.py": "cf2e34dd37c77bdcca8896c62b60ce41588e02c336524a034c7e2df8c93193e8", + "sources/zettlr-v32/instances/.none/.gitkeep": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "sources/zettlr-v32/task/gold.diff": "90d2cd871e6413b0f57585a251cf71eabc1cc70a52aff54d8cbe0dc267bd223e", + "sources/zettlr-v32/task/grader/failing_cases.py": "e4fcc53ba937fce4457e2e797414c4552b958a96bad11456c259dbb3a4b2833a", + "sources/zettlr-v32/task/grader/maintainer_review.judge.json": "b6b31ddab579181c1a80e50e5ef6b873f28b2f3fcd71595236a44d3134852a74", + "sources/zettlr-v32/task/grader/pinned_check.py": "32302adbe835bd4b4fbf018dcb73d7bf7b24a75b570cc8f6072146a102e3105d", + "sources/zettlr-v32/task/grader/run_grading.sh": "dba80c3f146d89933a1a7413fa718d0cfbe43ed7ec268b14910e2325e874f736", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-characters.spec.ts": "ba8915e286a5b7101384c0178537dd7e0991064a6edb7843add2352d7077a794", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-coercion.spec.ts": "4678a4cca43f833fa980e4f188a943caebf2046a240f6c951d171f3ea1f7f15a", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-documents.spec.ts": "6de17b5ab44e371d8b507103aff27a9cc420ae49de619101b2e9c8efd0dd9fda", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-empty.spec.ts": "584ae4db806b57889a98abb1b87006128c879389e5d638005681b70427a929fb", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-fieldscope.spec.ts": "4924889c397aba90ddfb41ba1809ee612100ed34beb5e075fcdc0b2f40c481f9", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-layout.spec.ts": "892680e8c6323ffe269636e7606ed80c0690743d533fb8ab8ff232f413a37465", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-outside.spec.ts": "c0cb43584266e7ff6724b4095da19e97baf97f1acc6b628c5b0b68a6e5a8e7ba", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-precision.spec.ts": "d3baf277029e6297940b0a6d0210a87c110fe5891c5da5cac1351e4f192703f5", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-quoting.spec.ts": "e6d18d72f34c089ca7f35c39696e3ee24d869c06472e92c2d538c7daf066bca1", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-sequence.spec.ts": "db3dcfe7b8b29271227ad6b3e4ab3d031873ddb32ad41c6089a1b3e5793c6e5d", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-shapes.spec.ts": "20a7b75c7dad3ea36ee8bcad750b83d44edc19cc5b7d59e6f82b9d6f1e9d1351", + "sources/zettlr-v32/task/grader/tests/__hidden__keyword-unchanged.spec.ts": "89a09138e81d7f89ceafde68df629c44ac14b25f9c9b8df93325b62927de0ae3", + "sources/zettlr-v32/task/grader/tests/util/frontmatter-click-fixture.ts": "a9f4b3355f1a441416f09fd9b800b19d5baf8c1b3c7b860033de990d3f09c932", + "sources/zettlr-v32/task/inert.diff": "e554b2589f8a046f7eaae08a22da52e4a8f6291d3639c3bb9cbeea8b6e85c484", + "sources/zettlr-v32/task/prompt.md": "b7028ec8d537cf340b47c2fa2f6551739b2650567a7463f4a60ced3fa964ee65", + "sources/zettlr-v32/tasks.py": "6a45abec792539b5e6a12ba8ef3f60f06adc7029a33fc4d78be25b2dfcc2f52c", + "sources/zod-v7/.dockerignore": "eb062fc59a85933d5a8039aec1559d292044e9c8bf224e46c97e64bc3ba2a9ea", + "sources/zod-v7/coding/__init__.py": "14d38b79b9e1fb6ecdf7af0fd822b902e8ee8b14b1c84bb6450cd3bbae5e2fac", + "sources/zod-v7/coding/repo.py": "81ab8eba289bfc1c6c98e26343ba20e72b0f34bf00ae23344fd2f8f4e1a33042", + "sources/zod-v7/Dockerfile.hud": "ca4f7f13b9b87b2ad35bc38ef14644cd7646247ea74c52c7a8419ba9b0e096f9", + "sources/zod-v7/env.py": "66f1136d4f45938fc124c917dacf125c4ed787abba35b91683d062903d8723c3", + "sources/zod-v7/pyproject.toml": "99bc46e4e460059aa29df6fd094a0cd33a7e5b4bf9bcf889f5958aec220f11cd", + "sources/zod-v7/task/alt/alt-target-layer-repair.diff": "c29b40f617d5ab8fc693f8988d46ded69a544dc8a916d790ad94db71c2988ac8", + "sources/zod-v7/task/alt/README.md": "177d355d5c38dbffbe09bb805b31b587f4d89c4aa106d07ac57982eb636cfed0", + "sources/zod-v7/task/checks/attack-g1-swallow-catch-processor.diff": "e140efeee6082839902a1461546c7b6c2a70059ac3954db1b6bac703130ccf29", + "sources/zod-v7/task/checks/attack-g1-swallow-conversion.diff": "e25e2a0a7cc732c9cd29dffd24d45416236f7c0405134857205e717d9f984a48", + "sources/zod-v7/task/checks/attack-g1-undefined-catch-aborts.diff": "986038efba98eed82896f1ae50dae0d9dd237b5a8c4a98d0b6685bfa2d3bdb34", + "sources/zod-v7/task/checks/attack-g3-type-object-only-openapi.diff": "4e4f028b3743c9258464617dc6170d88203623a24d641e3dbdd32677e1fb9c29", + "sources/zod-v7/task/checks/attack-g4-delete-annotation.diff": "9988759a03febaa59610ea463818e2e53b8b97142d3f7435e4e8f11969d55555", + "sources/zod-v7/task/checks/attack-g4-placeholder-annotation.diff": "c1d8de2cf2c34782500adf3950b522fd1e42df227be33a325712616c12744fda", + "sources/zod-v7/task/checks/attack-g4-x-extension-empty.diff": "51b4a6292ac04d7eefaeddffd125ed06a281bd82ef6ef060524debd3a82e6dfd", + "sources/zod-v7/task/checks/attack-g5-drop-every-default.diff": "9a88911ade8f492f86caa9fd00d7d11e5be1c09d57e9427ede91b17b8bdf9fab", + "sources/zod-v7/task/checks/attack-g5-empty-string-substitution.diff": "e43395b162b13d0c5a5f367e30c9f21b408f19cb5abefb3705b27cb312a478c6", + "sources/zod-v7/task/checks/attack-g5-null-element-kept.diff": "3cb33f17069a349a364ece02a0d27bcaf48419adfe4f12fcdfcf19b405bb3517", + "sources/zod-v7/task/checks/attack-g5-throw-mode-degrades.diff": "1d78694bc9726ebb5a92a903b9d70a0d3a9c610988186edf00939540d78540fc", + "sources/zod-v7/task/checks/attack-g5-zero-substitution.diff": "8cf15a0d1995b50e7fb02357f858dfbdd25b27401fa6f92930dee4f0099aba0e", + "sources/zod-v7/task/checks/attack-g6-drop-all-defaults.diff": "94bb093abaaa53d060881e2a77bc295823818db1c7d8027b49f380e8746005ad", + "sources/zod-v7/task/checks/attack-g6-eager-cycle-scan.diff": "959a1276e03f62f9d4a6f57a92f2f11e744575070cb91dd2dee562f2300552c3", + "sources/zod-v7/task/checks/attack-g6-root-only-cycle-guard.diff": "99358519d928d8afb3eab7b66bd88ad2ae60e4a15a1c9354618cf029ff1f6a21", + "sources/zod-v7/task/checks/attack-g6-swallow-default-errors.diff": "c0a564563d6d9357134f3b72c81c988e81284af44d1f076dc83d9c533ad20b15", + "sources/zod-v7/task/checks/attack-g7-degrade-null-literal-openapi.diff": "9bb9bf1fe6202a03bcba31ff71d4194b51af8b16ba63ba406be83e05c9a24f96", + "sources/zod-v7/task/checks/attack-g7-nullable-flag-only.diff": "608546825c2c3bae6fde8ab9a531905339acd003184a97eee64beccbd2bd1303", + "sources/zod-v7/task/checks/attack-g7-root-only.diff": "d1b4282fbcb9cc5f8a0c8b28c6abe0ba10bcf063dd8f340d22f68591076e5774", + "sources/zod-v7/task/checks/attack-g7-type-string-only.diff": "51faada2936d6049c628156f194c71857b23b3d3d5a00770cb8bad5e1171711f", + "sources/zod-v7/task/checks/attack-g8-accept-all-branch.diff": "54ab047f165f6183e58eff33c9cd4167956015d36326e3d4faef5e4e9708dbc4", + "sources/zod-v7/task/checks/attack-g8-drafts-only.diff": "58d513bb175a92a7b125ee9b74310dfcccde7038a41d74311eeaeb8eb5bf247e", + "sources/zod-v7/task/checks/attack-g8-every-union-never.diff": "bfe753751a606c0cf1a639ece9f113fb5507fc38e20f73077f0252513f23d972", + "sources/zod-v7/task/checks/attack-g8-inclusive-only.diff": "896142e1adb080e9cef046cb26305e969fae16c3ff916192def575fee7ed2058", + "sources/zod-v7/task/checks/attack-g8-omit-empty-combinator.diff": "174322bc53d742e8f5f106d76820eacf45fa04e05686e3be7438baeb3a61efdb", + "sources/zod-v7/task/checks/attack-g9-dedupe-before-conversion.diff": "d96ce94d8c6c082accd79574c4c86674495203d0222bc75051c48b36fb701a4d", + "sources/zod-v7/task/checks/attack-g9-drop-enum-on-repeat.diff": "1977e586f28eac04b21aed2bebf63414c21088c268a9fcd0706c694c041753a4", + "sources/zod-v7/task/checks/attack-g9-enum-processor-only.diff": "dac2040a6c659bd7f87c37a0a732bbe4dbca1b03f10bb152711fe3a67a9ecfa5", + "sources/zod-v7/task/checks/attack-g9-first-value-only.diff": "89a67420e442e5a0f30940eba9a4530a089ea9b0085171c0450b531045129538", + "sources/zod-v7/task/checks/attack-tsc-as-any-launder.diff": "7bbe9a5ae6e8e0992fab1b4440d62d6d20c93b66a15ebaad2c41cc92c6fc775b", + "sources/zod-v7/task/checks/attack-tsc-delete-candidate-config.diff": "dfbcd1c56272a0c1bf2416caa891b66b2892d58d4687520588cd7e35da55db8c", + "sources/zod-v7/task/checks/attack-tsc-expect-error-suppression.diff": "125499214bff3ce91917845f3deaf591d3cd5a42d1e1ff2fb15331d9600897fe", + "sources/zod-v7/task/checks/attack-tsc-nocheck-block-comment.diff": "ed537af2b8981c6167a369bd09ee90d8bc788898962b894df44d71c59e75f059", + "sources/zod-v7/task/checks/attack-tsc-nocheck-jsdoc.diff": "e60649355ba0ed8325f8ad52c8d963f7c629dd62c11899648e7f599da824356c", + "sources/zod-v7/task/checks/attack-tsc-nocheck-nbsp.diff": "6b9af4a23244295dbdb94e5bc241395a6f8a61ca271eb81280858e1ad5bcf2c2", + "sources/zod-v7/task/checks/attack-tsc-nocheck-suppression.diff": "cc2efe286b0af7c7a909fea4832af7a69cf25d281a66df123aa0dae8e53dafed", + "sources/zod-v7/task/checks/check-tsc-nocheck-jsdoc-mention.diff": "339beb1eff1bb6537c2da778d821c121eaeefc9e73a0c2947020131028f800c0", + "sources/zod-v7/task/checks/check-tsc-nocheck-mention-comment.diff": "3682db4fb31027983f50febd1c0410132304c69bb0cf2f676eaa8cffcff92e55", + "sources/zod-v7/task/checks/check-tsc-nocheck-prose-line-start.diff": "00bda276c51be52ee2d38458e59fe4548c590bb81e09ff27d806f3ba93466973", + "sources/zod-v7/task/checks/check-tsc-real-type-error.diff": "475548859ea9189f61f8d49256de27a77570d1e02cb719bd06594b8d52155d5b", + "sources/zod-v7/task/checks/lazy-g2-half-fix-positional-guard.diff": "dd51b17df02c9fd34916e84bafff37ad87f4fef4a4279cbbeb54f6b37338131b", + "sources/zod-v7/task/checks/noop-comment-both-files.diff": "ac1aeeecd84d737f0dd24818eb968c787f9fee1df34e1ba66d80604ba0e4502e", + "sources/zod-v7/task/checks/probe-g4-example-array-spelling.diff": "947a204d249b9000896477af83ca1a34fefaf7936005adadc9ccb7c4e3a5faf1", + "sources/zod-v7/task/checks/probe-g4-x-examples-extension.diff": "f145f16bfa0d658f09825d16c6da7678240e0d8a6436957ea03905eece0a8f5c", + "sources/zod-v7/task/checks/probe-g7-enum-only-spelling.diff": "1b4c2c027b7aab32e53100096b1098b68434a1c519958acaf9622900a465c9cd", + "sources/zod-v7/task/checks/README.md": "34982740e190d8ada7dcfa7f7a730b8695e66ba78d670003488a03c27559fc06", + "sources/zod-v7/task/gold.diff": "f5ab820e8f142e00056756db2a7835d83868cd35f7d297f9f4d8ba7fb22e529e", + "sources/zod-v7/task/grader/nocheck_scan.cjs": "39483d75a21604279f71be6a931fc1d63f17b89286a872ffc97b802e918872d8", + "sources/zod-v7/task/grader/run_grading.sh": "5a2e7511a9b497b33e7f4dda3686155bf77c9df0b6a4911c9aa4e9d6051134b7", + "sources/zod-v7/task/grader/tests/__hidden__d1_established_behavior.test.ts": "dd87cf9a23e7bbda1d56b432986fc161287de470dca2dc58e69d05a2f121169e", + "sources/zod-v7/task/grader/tests/__hidden__g1_catch_value_degrades.test.ts": "138396ad65e0ce22a58fcf14c67d1f98a165edad505b95d40287712ced214fec", + "sources/zod-v7/task/grader/tests/__hidden__g2_empty_positional_list.test.ts": "774f3763cf6344b6e765221d9f684274b309487f7408a9535ca8cb93dd2341d3", + "sources/zod-v7/task/grader/tests/__hidden__g2_empty_tuple_rest_element.test.ts": "8cdfcb52f13829394a95898cd1636afb6e605289af85290f2ca5a6fcd8ffafb0", + "sources/zod-v7/task/grader/tests/__hidden__g3_pattern_keyed_record_openapi.test.ts": "b6d7b7e8f8bb1670e15b0f442ce83dedad573f19d74a1844d77ae15986671924", + "sources/zod-v7/task/grader/tests/__hidden__g4_metadata_examples_openapi.test.ts": "fd81fe476bc6ee9c411098679a5b0887eba53a3c5af881f86239d66300ff62a9", + "sources/zod-v7/task/grader/tests/__hidden__g5_default_value_conforms.test.ts": "e3bc2dfff3a40a320d320335f230b2e26bb7ba88866291a47cd4e0b262a894de", + "sources/zod-v7/task/grader/tests/__hidden__g6_unencodable_default_degrades.test.ts": "07b47ce9f456c47c08f040ef7bdf277489eb811478361f631bff5544b0077960", + "sources/zod-v7/task/grader/tests/__hidden__g7_null_literal_openapi.test.ts": "ef6b47259bd53d9aa6c6778b1a6495d42f5436e50d3b71f2c8f68c67740cd7b4", + "sources/zod-v7/task/grader/tests/__hidden__g8_empty_union_accepts_nothing.test.ts": "edb1408a59f5103605b9ccb557516893d108000b61b82572b76c888068c9ee40", + "sources/zod-v7/task/grader/tests/__hidden__g9_enum_members_unique.test.ts": "0a8dfbf5ca10b2feccdeeb927f7322d6df37eda508d9443eb7dc4bffe183b027", + "sources/zod-v7/task/grader/tests/__hidden__support.ts": "6ddee9caf940ccdb666ca2d6d33a71af9c0dfd1adf01dbabcc2a341f95e0ac7a", + "sources/zod-v7/task/grader/tests/preservation/from-json-schema.test.ts.pristine": "5ea2b7bf02920a7bb8709f1d2db0bb4d304e40bbc4927b2d6ca40f488c79ec31", + "sources/zod-v7/task/grader/tests/preservation/manifest.json": "012eb19cf4cde1b7f67980976f62329ab226ec2f68ccfccdd5de1ec8b78dbde5", + "sources/zod-v7/task/grader/tests/preservation/payload.sha256": "da1e0e0a8e1e7c10096da6ff6b059d33d282d88d3060983a25a5986315104e02", + "sources/zod-v7/task/grader/tests/preservation/preservation.sha256": "abebefef640815814fa0a6b8d8f560db43455cc7e776e76e46f4a56986b94294", + "sources/zod-v7/task/grader/tests/preservation/to-json-schema-methods.test.ts.pristine": "2c3df06e0757019a6fa226d954653d8627055f723d69c5cc49083cdfa6c1b6a2", + "sources/zod-v7/task/grader/tests/preservation/to-json-schema.test.ts.pristine": "a26ba5e1f1e8be31fdd65b1d2ca6e481832faa2f16ea58f231d616dc8eb4120a", + "sources/zod-v7/task/grader/vitest_verdict.cjs": "27108b303bf6962fa1f8b1e9ee204fd11c9d12f6e5288780922174eff340750d", + "sources/zod-v7/task/lockfile_bound.sh": "bff20cf17a406f485647596b3029525d49b0aee5d4a1c6d5baa9ea9e5d2e7d54", + "sources/zod-v7/task/prompt.md": "ccba6e22ff101300ceadb9e2085b329510861280bde90f5ba39f741847b65401", + "sources/zod-v7/tasks.py": "909599b29e5f41d12eada51cc7b1fb20364271ff3b5f600a78da6ab9082e5ba5", + "sources/zod-v7/uv.lock": "4fda818d5c1f7c4d825afd9e5e15abd68cfde4db5d14d78ca97b371a11891ab4", + "tasks/coredns_rewrite_svcb_opt/environment/capture.py": "77c3c482a5590c9cbfc8489c556a8d57b150a0850baee666656f1b0d0d84a9f9", + "tasks/coredns_rewrite_svcb_opt/environment/capture_submission.py": "85fe091fee151a60d43160dd1cadd83edf1218844c2fb248e88dbbab22df60f8", + "tasks/coredns_rewrite_svcb_opt/environment/docker-compose.yaml": "b07573ec6bd178357718fde3cfb9df44a1a8bd4a87c7b091c8caff1807848b1a", + "tasks/coredns_rewrite_svcb_opt/environment/Dockerfile": "d2992c7636513326b91a761a57f28e798c7f7f9b50e9e55e35d0400422c0c568", + "tasks/coredns_rewrite_svcb_opt/environment/sanitize.py": "de556482d17c97d629f663f2cf9120b6388f7131bab7ceab1fce11dff2eff407", + "tasks/coredns_rewrite_svcb_opt/instruction.md": "9f79259cfdcfa90af21e5691a9eba4461e02fd2e403e5f52602c4782ad6b104a", + "tasks/coredns_rewrite_svcb_opt/solution/reference.patch": "e63695cb627adef3e6042ff8efd7933e561f74233a25ada6a6170c825c0b149d", + "tasks/coredns_rewrite_svcb_opt/solution/solve.sh": "501c85f35d754e727da636fc3448fe4e0bd93b6db15170052c13996e8ac550aa", + "tasks/coredns_rewrite_svcb_opt/task.toml": "a8c51de01e4fedb6842c9c6b919f52fadfaeb9b970c101384fb94cf422e55181", + "tasks/coredns_rewrite_svcb_opt/tests/config.json": "93dd68641c420ec7e8856c8204a49ab9ececb86deb2d4c525b74131fd0f3f5cb", + "tasks/coredns_rewrite_svcb_opt/tests/docker-compose.yaml": "8159b0badead234e0b7995f5b2c9d027b665cfb760bf2932d84806393e3cd878", + "tasks/coredns_rewrite_svcb_opt/tests/Dockerfile": "56575aa82d5efe26853dd8e78e109575eddcc4afb826eb5494dee8b3f93104a2", + "tasks/coredns_rewrite_svcb_opt/tests/evidence.py": "3e22e7f7c1bcc06ed05ae9a94cc700bee16540863d1f2985d3a58cad7a709199", + "tasks/coredns_rewrite_svcb_opt/tests/test.sh": "02c7fe9b4c0389ebd3153ee32e124d4448fd85ca67c203a2f40208a51fd2bbc5", + "tasks/coredns_rewrite_svcb_opt/tests/verify.py": "a91257b1582f794ffacd8519a92883daaa08d7cb073f0b34219028dea3364431", + "tasks/epicyon_deleted_post_announce_cache_contract/environment/capture.py": "77c3c482a5590c9cbfc8489c556a8d57b150a0850baee666656f1b0d0d84a9f9", + "tasks/epicyon_deleted_post_announce_cache_contract/environment/capture_submission.py": "85fe091fee151a60d43160dd1cadd83edf1218844c2fb248e88dbbab22df60f8", + "tasks/epicyon_deleted_post_announce_cache_contract/environment/docker-compose.yaml": "b07573ec6bd178357718fde3cfb9df44a1a8bd4a87c7b091c8caff1807848b1a", + "tasks/epicyon_deleted_post_announce_cache_contract/environment/Dockerfile": "931bc56ba5e96ca0d850dedb8f8a4961ef6981162a379b04bd6ba2ab509e87fb", + "tasks/epicyon_deleted_post_announce_cache_contract/environment/sanitize.py": "de556482d17c97d629f663f2cf9120b6388f7131bab7ceab1fce11dff2eff407", + "tasks/epicyon_deleted_post_announce_cache_contract/instruction.md": "69dbf7b09d4da26a503ed635b4a463af94d26716de81fb5af33a3802e5289bb4", + "tasks/epicyon_deleted_post_announce_cache_contract/solution/reference.patch": "4b964a50fd786b7f34ed5e4a8c78b52d0f5dd480a60d431eef34635129f6c212", + "tasks/epicyon_deleted_post_announce_cache_contract/solution/solve.sh": "1505a81da3bec73832e2bfa92d511ff3418fe0bda99334bfd546c1097877bfd6", + "tasks/epicyon_deleted_post_announce_cache_contract/task.toml": "9bd8117b0f9323c7a532219f06a5a0a84dee3ef7d9f9f4a830bf89d2bab4037c", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/config.json": "c1c6f73009bf4759269c96a18733f83bc9cf657d39e84084f0e57aa380cbd6cf", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/docker-compose.yaml": "8159b0badead234e0b7995f5b2c9d027b665cfb760bf2932d84806393e3cd878", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/Dockerfile": "f995925fa1497249568e6500c3e95c1887efc1ed25091ec98a47a20bddc9930e", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/evidence.py": "3e22e7f7c1bcc06ed05ae9a94cc700bee16540863d1f2985d3a58cad7a709199", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/test.sh": "02c7fe9b4c0389ebd3153ee32e124d4448fd85ca67c203a2f40208a51fd2bbc5", + "tasks/epicyon_deleted_post_announce_cache_contract/tests/verify.py": "a91257b1582f794ffacd8519a92883daaa08d7cb073f0b34219028dea3364431", + "tasks/manifest.json": "a4bffb15d29654246318ec49a3a181e207aea0157f5f1455a99e4b17f9dfd375", + "tasks/rope_rename_all_reexport_owners_contract/environment/capture.py": "77c3c482a5590c9cbfc8489c556a8d57b150a0850baee666656f1b0d0d84a9f9", + "tasks/rope_rename_all_reexport_owners_contract/environment/capture_submission.py": "85fe091fee151a60d43160dd1cadd83edf1218844c2fb248e88dbbab22df60f8", + "tasks/rope_rename_all_reexport_owners_contract/environment/docker-compose.yaml": "b07573ec6bd178357718fde3cfb9df44a1a8bd4a87c7b091c8caff1807848b1a", + "tasks/rope_rename_all_reexport_owners_contract/environment/Dockerfile": "a3415bb40fade4dc95af07cf9ff1dce3879a55a60ac2b1dda66e89b5d71189ec", + "tasks/rope_rename_all_reexport_owners_contract/environment/sanitize.py": "de556482d17c97d629f663f2cf9120b6388f7131bab7ceab1fce11dff2eff407", + "tasks/rope_rename_all_reexport_owners_contract/instruction.md": "e52ad0d1b6670b42d53fb7067a65e95b0650acc83989a0656d9763624ddf65b6", + "tasks/rope_rename_all_reexport_owners_contract/solution/reference.patch": "b812775f8007850b09063abffe292378ddb4c30e31e054e33155be108ffccdde", + "tasks/rope_rename_all_reexport_owners_contract/solution/solve.sh": "96eb49a8631ca5e7e663d8113fc76bd11b39a156f4be7994a79f27d58e47731c", + "tasks/rope_rename_all_reexport_owners_contract/task.toml": "019738d5f86b5de96389151b964cd05b225544a97c5ab866602114491a165e8a", + "tasks/rope_rename_all_reexport_owners_contract/tests/config.json": "97429a57bc057e8f0de4d3c34000432032903f308ca7dc248412d3d8e3404268", + "tasks/rope_rename_all_reexport_owners_contract/tests/docker-compose.yaml": "8159b0badead234e0b7995f5b2c9d027b665cfb760bf2932d84806393e3cd878", + "tasks/rope_rename_all_reexport_owners_contract/tests/Dockerfile": "c9481aa8befb16c935f2d68a890984fc272cf1a07a10e22facc8679ce6e4a8ba", + "tasks/rope_rename_all_reexport_owners_contract/tests/evidence.py": "3e22e7f7c1bcc06ed05ae9a94cc700bee16540863d1f2985d3a58cad7a709199", + "tasks/rope_rename_all_reexport_owners_contract/tests/test.sh": "02c7fe9b4c0389ebd3153ee32e124d4448fd85ca67c203a2f40208a51fd2bbc5", + "tasks/rope_rename_all_reexport_owners_contract/tests/verify.py": "a91257b1582f794ffacd8519a92883daaa08d7cb073f0b34219028dea3364431", + "tasks/zod_json_schema_target_legality/environment/capture.py": "77c3c482a5590c9cbfc8489c556a8d57b150a0850baee666656f1b0d0d84a9f9", + "tasks/zod_json_schema_target_legality/environment/capture_submission.py": "85fe091fee151a60d43160dd1cadd83edf1218844c2fb248e88dbbab22df60f8", + "tasks/zod_json_schema_target_legality/environment/docker-compose.yaml": "b07573ec6bd178357718fde3cfb9df44a1a8bd4a87c7b091c8caff1807848b1a", + "tasks/zod_json_schema_target_legality/environment/Dockerfile": "43cb9c09dd6b6b5657077d9d1e68a36519680a04475b5845123233e6fac06873", + "tasks/zod_json_schema_target_legality/environment/sanitize.py": "de556482d17c97d629f663f2cf9120b6388f7131bab7ceab1fce11dff2eff407", + "tasks/zod_json_schema_target_legality/instruction.md": "c60937527e412b5863f6cd47c81af2eb42bc1b3a7938e0c59c7ce29ae604d746", + "tasks/zod_json_schema_target_legality/solution/reference.patch": "f5ab820e8f142e00056756db2a7835d83868cd35f7d297f9f4d8ba7fb22e529e", + "tasks/zod_json_schema_target_legality/solution/solve.sh": "934221ea7fd66f8e97986f78722143b5a99c406cac1569ce956328483fb5c1e6", + "tasks/zod_json_schema_target_legality/task.toml": "c3c1436faadc21676f634b82641f732b9041f255266df0d0703dcd58dde4eb2a", + "tasks/zod_json_schema_target_legality/tests/config.json": "3ada829ce89836381daf122a9844af0e8a5ce2338a1a50d2f9b5f8d49f587d51", + "tasks/zod_json_schema_target_legality/tests/docker-compose.yaml": "8159b0badead234e0b7995f5b2c9d027b665cfb760bf2932d84806393e3cd878", + "tasks/zod_json_schema_target_legality/tests/Dockerfile": "a5c82e677c1af493e0316c6789a6d112b2b3b5cb44bc0c40ef6af3ad73c358fa", + "tasks/zod_json_schema_target_legality/tests/evidence.py": "3e22e7f7c1bcc06ed05ae9a94cc700bee16540863d1f2985d3a58cad7a709199", + "tasks/zod_json_schema_target_legality/tests/test.sh": "02c7fe9b4c0389ebd3153ee32e124d4448fd85ca67c203a2f40208a51fd2bbc5", + "tasks/zod_json_schema_target_legality/tests/verify.py": "a91257b1582f794ffacd8519a92883daaa08d7cb073f0b34219028dea3364431", + "verify_bundle.py": "0e6d635e53064e977ea083ea2b985251c541c3b0ef61285247563a6754824acd" +} diff --git a/harbor/evidence/coredns/agent-image-scan.txt b/harbor/evidence/coredns/agent-image-scan.txt new file mode 100644 index 0000000000000000000000000000000000000000..de69000cd00421b6b8b6ed1ada82b905ecc0118c --- /dev/null +++ b/harbor/evidence/coredns/agent-image-scan.txt @@ -0,0 +1,14 @@ +needles: 71 +1 matching line(s): /workspace/repo/plugin/rewrite/ttl_test.go +scan finished +absent: /hud +absent: /app +absent: /tests +present: /opt/task-tools/baseline.git +reference-patch lines in the agent's tracked files: 0, of which the pristine checkout lacks: 0 +grader lines in the agent's tracked files: 1, of which the pristine checkout lacks: 0 +reference-patch lines in total: 9, grader lines in total: 60 +private lines in 0 other files outside the checkout: 0, of which upstream lacks: 0 +--- private lines only the agent's checkout holds (expect none) +--- the agent's checkout: uncommitted changes (expect none), then its history +b21e6b7 baseline diff --git a/harbor/evidence/coredns/native-reference.json b/harbor/evidence/coredns/native-reference.json new file mode 100644 index 0000000000000000000000000000000000000000..1428383f1538226a1de732a2d859207916ba8a76 --- /dev/null +++ b/harbor/evidence/coredns/native-reference.json @@ -0,0 +1,121 @@ +{ + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "svcb_target_rewrite", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION svcb_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh svcb_target_rewrite", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "https_target_rewrite", + "weight": 0.2, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION https_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh https_target_rewrite", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "soa_mailbox_rewrite", + "weight": 0.3, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION soa_mailbox_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh soa_mailbox_rewrite", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "opt_ttl_preserved", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION opt_ttl_preserved: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh opt_ttl_preserved", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "existing_name_value_rewrite_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION existing_name_value_rewrite_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh existing_name_value_rewrite_unaffected", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "ordinary_ttl_clamp_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION ordinary_ttl_clamp_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh ordinary_ttl_clamp_unaffected", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "full_suite_regression", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION full_suite_regression: PASS\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh full_suite_regression", + "cwd": "/workspace/repo", + "timeout_seconds": 180 + } + } + } + ] +} \ No newline at end of file diff --git a/harbor/evidence/coredns/reports/broken.json b/harbor/evidence/coredns/reports/broken.json new file mode 100644 index 0000000000000000000000000000000000000000..4ce7cfae4e9ccfcf9799573106fbb47af84c4dff --- /dev/null +++ b/harbor/evidence/coredns/reports/broken.json @@ -0,0 +1,242 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "coredns_rewrite_svcb_opt", + "grader_version": "0.6.18", + "commands": [ + { + "name": "svcb_target_rewrite", + "weight": 0.25, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestSVCBTargetRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION svcb_target_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh svcb_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "https_target_rewrite", + "weight": 0.2, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestHTTPSTargetRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION https_target_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh https_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "soa_mailbox_rewrite", + "weight": 0.3, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestSOAMailboxRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION soa_mailbox_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh soa_mailbox_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "opt_ttl_preserved", + "weight": 0.25, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestTTLRuleDoesNotClampOPTPseudoRecord$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION opt_ttl_preserved: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh opt_ttl_preserved'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "existing_name_value_rewrite_unaffected", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestValueResponseReverter$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION existing_name_value_rewrite_unaffected: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh existing_name_value_rewrite_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "ordinary_ttl_clamp_unaffected", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestTtlRewrite$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION ordinary_ttl_clamp_unaffected: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh ordinary_ttl_clamp_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "full_suite_regression", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION full_suite_regression: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh full_suite_regression'", + "cwd": "/workspace/repo", + "timeout_seconds": 180 + } + } + } + ], + "status": "graded", + "patch_sha256": "aa144710c3f317d2e0d59de1514c2759ce4f896e3838d8bd45b9d21200843de8", + "result": { + "reward": 0.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "svcb_target_rewrite", + "weight": 0.25, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestSVCBTargetRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION svcb_target_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh svcb_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "https_target_rewrite", + "weight": 0.2, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestHTTPSTargetRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION https_target_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh https_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "soa_mailbox_rewrite", + "weight": 0.3, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestSOAMailboxRewrittenBySuffixAutoAnswerRule$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION soa_mailbox_rewrite: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh soa_mailbox_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "opt_ttl_preserved", + "weight": 0.25, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestTTLRuleDoesNotClampOPTPseudoRecord$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION opt_ttl_preserved: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh opt_ttl_preserved'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "existing_name_value_rewrite_unaffected", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestValueResponseReverter$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION existing_name_value_rewrite_unaffected: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh existing_name_value_rewrite_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "ordinary_ttl_clamp_unaffected", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test -run ^TestTtlRewrite$ -v ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION ordinary_ttl_clamp_unaffected: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh ordinary_ttl_clamp_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "full_suite_regression", + "weight": 0.0, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": " ----- go test ./plugin/rewrite/... (last 2000 bytes) -----\n | # github.com/coredns/coredns/plugin/rewrite [github.com/coredns/coredns/plugin/rewrite.test]\n | plugin/rewrite/name.go:466:1: syntax error: non-declaration statement outside function body\n | FAIL\tgithub.com/coredns/coredns/plugin/rewrite [build failed]\n | FAIL\n -----\nCRITERION full_suite_regression: FAIL\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh full_suite_regression'", + "cwd": "/workspace/repo", + "timeout_seconds": 180 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/coredns/reports/infra.json b/harbor/evidence/coredns/reports/infra.json new file mode 100644 index 0000000000000000000000000000000000000000..42a823496e779e4ec691100db55ca855eea7479c --- /dev/null +++ b/harbor/evidence/coredns/reports/infra.json @@ -0,0 +1,12 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "coredns_rewrite_svcb_opt", + "grader_version": "0.6.18", + "commands": [], + "status": "error", + "patch_sha256": "51f9168417f7ef7d6b8793dcf746d6bf88df29ce28a191190f08f39260727ae7", + "error": { + "type": "FileNotFoundError", + "message": "[Errno 2] No such file or directory: '/hud/grader/run_grading.sh'" + } +} \ No newline at end of file diff --git a/harbor/evidence/coredns/reports/noop.json b/harbor/evidence/coredns/reports/noop.json new file mode 100644 index 0000000000000000000000000000000000000000..5a813d768cbb0687bd6a4292c96d7b905726065a --- /dev/null +++ b/harbor/evidence/coredns/reports/noop.json @@ -0,0 +1,16 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "coredns_rewrite_svcb_opt", + "grader_version": "0.6.18", + "commands": [], + "status": "empty_patch", + "patch_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "result": { + "reward": 0.0, + "done": true, + "content": "Empty diff: no changes were made.", + "info": {}, + "isError": false, + "subscores": null + } +} \ No newline at end of file diff --git a/harbor/evidence/coredns/reports/reference.json b/harbor/evidence/coredns/reports/reference.json new file mode 100644 index 0000000000000000000000000000000000000000..648a89517793dbdb37e52ae625326e3996bad04b --- /dev/null +++ b/harbor/evidence/coredns/reports/reference.json @@ -0,0 +1,242 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "coredns_rewrite_svcb_opt", + "grader_version": "0.6.18", + "commands": [ + { + "name": "svcb_target_rewrite", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION svcb_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh svcb_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "https_target_rewrite", + "weight": 0.2, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION https_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh https_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "soa_mailbox_rewrite", + "weight": 0.3, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION soa_mailbox_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh soa_mailbox_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "opt_ttl_preserved", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION opt_ttl_preserved: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh opt_ttl_preserved'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "existing_name_value_rewrite_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION existing_name_value_rewrite_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh existing_name_value_rewrite_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "ordinary_ttl_clamp_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION ordinary_ttl_clamp_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh ordinary_ttl_clamp_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "full_suite_regression", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION full_suite_regression: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh full_suite_regression'", + "cwd": "/workspace/repo", + "timeout_seconds": 180 + } + } + } + ], + "status": "graded", + "patch_sha256": "51f9168417f7ef7d6b8793dcf746d6bf88df29ce28a191190f08f39260727ae7", + "result": { + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "svcb_target_rewrite", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION svcb_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh svcb_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "https_target_rewrite", + "weight": 0.2, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION https_target_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh https_target_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "soa_mailbox_rewrite", + "weight": 0.3, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION soa_mailbox_rewrite: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh soa_mailbox_rewrite'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "opt_ttl_preserved", + "weight": 0.25, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION opt_ttl_preserved: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh opt_ttl_preserved'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "existing_name_value_rewrite_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION existing_name_value_rewrite_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh existing_name_value_rewrite_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "ordinary_ttl_clamp_unaffected", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION ordinary_ttl_clamp_unaffected: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh ordinary_ttl_clamp_unaffected'", + "cwd": "/workspace/repo", + "timeout_seconds": 90 + } + } + }, + { + "name": "full_suite_regression", + "weight": 0.0, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "CRITERION full_suite_regression: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh full_suite_regression'", + "cwd": "/workspace/repo", + "timeout_seconds": 180 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/coredns/reports/tamper.json b/harbor/evidence/coredns/reports/tamper.json new file mode 100644 index 0000000000000000000000000000000000000000..5a813d768cbb0687bd6a4292c96d7b905726065a --- /dev/null +++ b/harbor/evidence/coredns/reports/tamper.json @@ -0,0 +1,16 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "coredns_rewrite_svcb_opt", + "grader_version": "0.6.18", + "commands": [], + "status": "empty_patch", + "patch_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "result": { + "reward": 0.0, + "done": true, + "content": "Empty diff: no changes were made.", + "info": {}, + "isError": false, + "subscores": null + } +} \ No newline at end of file diff --git a/harbor/evidence/coredns/summary.json b/harbor/evidence/coredns/summary.json new file mode 100644 index 0000000000000000000000000000000000000000..89e95d258c5f4d775d6bf130d063ef280ea9264c --- /dev/null +++ b/harbor/evidence/coredns/summary.json @@ -0,0 +1,172 @@ +{ + "name": "coredns", + "task_id": "coredns_rewrite_svcb_opt", + "image": "ec-swe-coredns:source-v4", + "build": { + "ok": true, + "image_id": "sha256:5f122f58a039aefe65ccf2fd057eceb288c09278edde20f2ff0f2598f52c22e9", + "ladder": {}, + "seconds": 0 + }, + "qualified": true, + "measure": { + "ok": true, + "hud": "0.6.18", + "path": "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", + "handed": [], + "repo_dir": "/workspace/repo", + "python_usr_local": false, + "seconds": 14, + "reused": true + }, + "parity": { + "ok": true, + "reward": 1.0, + "criteria": 7, + "unmet": [], + "info": null, + "seconds": 25, + "reused": true + }, + "prepare": { + "ok": true, + "bundle": "coredns-r4", + "converter": "b8bba68767da888f", + "pinned_files": 9, + "criteria": 7, + "seconds": 2 + }, + "controls": { + "ok": true, + "checks": { + "noop_is_zero": true, + "reference_is_one": true, + "reference_equals_native": true, + "broken_is_graded_zero": true, + "missing_grader_is_invalid": true, + "agent_is_isolated": true, + "planted_reward_is_ignored": true + }, + "results": { + "noop": { + "run": "coredns-r4-control-noop-1791885502", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 175, + "probe": false, + "status": "empty_patch", + "verifier_error": null, + "exit_codes": [], + "attempts": 1 + }, + "reference": { + "run": "coredns-r4-control-reference-1791885502", + "reward": 1.0, + "stop": "completed", + "error": null, + "seconds": 185, + "probe": true, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 0 + ], + "subscores": { + "svcb_target_rewrite": [ + 1.0, + 0.25 + ], + "https_target_rewrite": [ + 1.0, + 0.2 + ], + "soa_mailbox_rewrite": [ + 1.0, + 0.3 + ], + "opt_ttl_preserved": [ + 1.0, + 0.25 + ], + "existing_name_value_rewrite_unaffected": [ + 1.0, + 0.0 + ], + "ordinary_ttl_clamp_unaffected": [ + 1.0, + 0.0 + ], + "full_suite_regression": [ + 1.0, + 0.0 + ] + }, + "attempts": 1 + }, + "broken": { + "run": "coredns-r4-control-broken-1791885678", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 111, + "probe": false, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 1 + ], + "attempts": 1 + }, + "infra": { + "run": "coredns-r4-control-infra-1791885688", + "reward": null, + "stop": "error", + "error": "RewardFileNotFoundError: No reward file found at /jobs/coredns-r4-control-infra-1791885688/coredns_rewrite_svcb_opt__8gHWTyF/verifier/reward.txt or /jobs/coredns-r4-control-infra-1791885688/coredns_rewrite_svcb_opt__8gHWTyF/verifier/reward.json", + "seconds": 92, + "probe": false, + "status": "error", + "verifier_error": "[Errno 2] No such file or directory: '/hud/grader/run_grading.sh'", + "exit_codes": [], + "attempts": 1 + }, + "tamper": { + "run": "coredns-r4-control-tamper-1791885780", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 104, + "probe": false, + "status": "empty_patch", + "verifier_error": null, + "exit_codes": [], + "attempts": 1 + } + }, + "bundle": "coredns-r4", + "seconds": 383 + }, + "patches": { + "ok": true, + "skipped": "no calibration patches in the source", + "seconds": 0 + }, + "leak": { + "scan_finished": true, + "hits_outside_checkout": [], + "other_files_holding_only_upstream_lines": 0, + "library_files_sharing_a_line": 0, + "most_lines_shared_by_one_library_file": 0, + "private_paths_absent": true, + "public_lines_shared_with_patch_and_graders": [ + 0, + 1 + ], + "private_lines_only_in_agent_checkout": [ + 0, + 0 + ], + "ok": true, + "seconds": 31 + } +} diff --git a/harbor/evidence/epicyon/agent-image-scan.txt b/harbor/evidence/epicyon/agent-image-scan.txt new file mode 100644 index 0000000000000000000000000000000000000000..d39d16aa6cc8169d7e00f889fb42dbd6c95a49dd --- /dev/null +++ b/harbor/evidence/epicyon/agent-image-scan.txt @@ -0,0 +1,26 @@ +needles: 391 +1 matching line(s): /workspace/repo/src/webapp_hashtagswarm.py +5 matching line(s): /workspace/repo/src/webapp_utils.py +1 matching line(s): /workspace/repo/src/gemini.py +1 matching line(s): /workspace/repo/src/webapp_column_right.py +8 matching line(s): /workspace/repo/src/utils.py +1 matching line(s): /workspace/repo/src/webapp_post.py +2 matching line(s): /workspace/repo/src/person.py +2 matching line(s): /workspace/repo/src/markdown.py +1 matching line(s): /workspace/repo/src/webapp_timeline.py +3 matching line(s): /workspace/repo/src/webapp_search.py +2 matching line(s): /workspace/repo/src/webapp_profile.py +1 matching line(s): /workspace/repo/src/daemon_get_collections.py +1 matching line(s): /workspace/repo/src/follow.py +scan finished +absent: /hud +absent: /app +absent: /tests +present: /opt/task-tools/baseline.git +reference-patch lines in the agent's tracked files: 6, of which the pristine checkout lacks: 0 +grader lines in the agent's tracked files: 0, of which the pristine checkout lacks: 0 +reference-patch lines in total: 129, grader lines in total: 251 +private lines in 0 other files outside the checkout: 0, of which upstream lacks: 0 +--- private lines only the agent's checkout holds (expect none) +--- the agent's checkout: uncommitted changes (expect none), then its history +54dfc93 baseline diff --git a/harbor/evidence/epicyon/author-calibration.txt b/harbor/evidence/epicyon/author-calibration.txt new file mode 100644 index 0000000000000000000000000000000000000000..52aa5ca16814752446ca24e3a26eed3983be29e6 --- /dev/null +++ b/harbor/evidence/epicyon/author-calibration.txt @@ -0,0 +1,188 @@ +=== gold === + PASS media_file_of_a_deleted_post_is_removed w=0.0550 blocker 8.9s + PASS: media_file_of_a_deleted_post_is_removed — 2 fresh runs agree + PASS hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + PASS: hashtag_index_forgets_a_deleted_post — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_rendition — 2 fresh runs agree + PASS deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + PASS: deleted_post_is_delisted_from_the_media_log — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_json_or_attachment — 2 fresh runs agree + PASS timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + PASS: timeline_indexes_forget_a_deleted_post — 2 fresh runs agree + PASS features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + PASS: features_copy_of_a_deleted_article_is_removed — 2 fresh runs agree + PASS features_index_forgets_a_deleted_article w=0.1600 0.0s + PASS: features_index_forgets_a_deleted_article — 2 fresh runs agree + PASS event_category_index_forgets_a_deleted_event w=0.1600 0.0s + PASS: event_category_index_forgets_a_deleted_event — 2 fresh runs agree + PASS split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + PASS: split_event_category_indexes_forget_a_deleted_event — 2 fresh runs agree + ... calibration still running (12:40:09) ... + PASS gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 99.5s CORE_GREEN=1 + PASS: the repository's own checks are all there and its suite is green + -> uncapped 1.000, failed blockers none, reward 1.000 + +=== base === + ... calibration still running (12:41:09) ... + FAIL media_file_of_a_deleted_post_is_removed w=0.0550 blocker 9.1s + FAIL: the deleted post's media is still on disk: /media/2962/PmShgwJNlHh9vzi0oYe2DvamtaXhy4NK.png + FAIL hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + FAIL: the hashtag index still points at the deleted post + FAIL a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + FAIL: the deleted blog post is still published as markdown, micron + FAIL deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + FAIL: the media log still lists the deleted post's media: /media/2962/VYXCsOVxGn9aXtE6hXCQSEOAtXlGFMtq.png + FAIL a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + FAIL: the deleted blog post's own json is still there + FAIL timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + FAIL: the outbox index still lists the deleted post + FAIL features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + FAIL: the news actor still holds a copy of the deleted article + FAIL features_index_forgets_a_deleted_article w=0.1600 0.0s + FAIL: the news actor's index still lists the deleted article + FAIL event_category_index_forgets_a_deleted_event w=0.1600 0.0s + FAIL: the Music tag index still lists the deleted event + FAIL split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + FAIL: the Outdoors tag index still lists the deleted event + ... calibration still running (12:42:09) ... + FAIL gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 98.2s CORE_GREEN=0 + FAIL: no scored behaviour was fixed — this gate does not pay for an empty change + (conditional: gate_repo_suite_green_and_tests_untouched was told the core is dead and refused its weight itself; it reports FAIL and exits non-zero) + -> uncapped 0.000, failed blockers ['media_file_of_a_deleted_post_is_removed', 'gate_repo_suite_green_and_tests_untouched'], reward 0.000 + +=== noop === + FAIL media_file_of_a_deleted_post_is_removed w=0.0550 blocker 9.0s + FAIL: the deleted post's media is still on disk: /media/2962/nf7xpIWDBCvhJk9tvhysMdZZXQyBebMZ.png + FAIL hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + FAIL: the hashtag index still points at the deleted post + FAIL a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + FAIL: the deleted blog post is still published as markdown, micron + FAIL deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + FAIL: the media log still lists the deleted post's media: /media/2962/OXkJVwcseZBktiqdtA1YCSPU3Vb2Q6x4.png + FAIL a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + FAIL: the deleted blog post's own json is still there + FAIL timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + FAIL: the outbox index still lists the deleted post + FAIL features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + FAIL: the news actor still holds a copy of the deleted article + FAIL features_index_forgets_a_deleted_article w=0.1600 0.0s + FAIL: the news actor's index still lists the deleted article + FAIL event_category_index_forgets_a_deleted_event w=0.1600 0.0s + FAIL: the Music tag index still lists the deleted event + FAIL split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + FAIL: the Outdoors tag index still lists the deleted event + ... calibration still running (12:43:09) ... + ... calibration still running (12:44:09) ... + FAIL gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 97.7s CORE_GREEN=0 + FAIL: no scored behaviour was fixed — this gate does not pay for an empty change + (conditional: gate_repo_suite_green_and_tests_untouched was told the core is dead and refused its weight itself; it reports FAIL and exits non-zero) + -> uncapped 0.000, failed blockers ['media_file_of_a_deleted_post_is_removed', 'gate_repo_suite_green_and_tests_untouched'], reward 0.000 + +=== lazy === + FAIL media_file_of_a_deleted_post_is_removed w=0.0550 blocker 8.8s + FAIL: another post's media was removed too: /media/2962/S0ERe3NbiHgjFwDs9XA1aDIqAHKSiduC.png + FAIL hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + FAIL: the hashtag index still points at the deleted post + FAIL a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + FAIL: the deleted blog post is still published as markdown, micron + FAIL deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + FAIL: the media log still lists the deleted post's media: /media/2962/HlzRTOE90XNJdTWuocCt6eTJKgu2ZqRq.png + FAIL a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + FAIL: the deleted blog post's own json is still there + PASS timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + PASS: timeline_indexes_forget_a_deleted_post — 2 fresh runs agree + FAIL features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + FAIL: the news actor still holds a copy of the deleted article + FAIL features_index_forgets_a_deleted_article w=0.1600 0.0s + FAIL: the news actor's index still lists the deleted article + FAIL event_category_index_forgets_a_deleted_event w=0.1600 0.0s + FAIL: the Music tag index still lists the deleted event + FAIL split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + FAIL: the Outdoors tag index still lists the deleted event + ... calibration still running (12:45:09) ... + ... calibration still running (12:46:09) ... + PASS gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 96.1s CORE_GREEN=1 + PASS: the repository's own checks are all there and its suite is green + -> uncapped 0.085, failed blockers ['media_file_of_a_deleted_post_is_removed'], reward 0.085 + +=== alt === + PASS media_file_of_a_deleted_post_is_removed w=0.0550 blocker 9.4s + PASS: media_file_of_a_deleted_post_is_removed — 2 fresh runs agree + PASS hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + PASS: hashtag_index_forgets_a_deleted_post — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_rendition — 2 fresh runs agree + PASS deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + PASS: deleted_post_is_delisted_from_the_media_log — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_json_or_attachment — 2 fresh runs agree + PASS timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + PASS: timeline_indexes_forget_a_deleted_post — 2 fresh runs agree + PASS features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + PASS: features_copy_of_a_deleted_article_is_removed — 2 fresh runs agree + PASS features_index_forgets_a_deleted_article w=0.1600 0.0s + PASS: features_index_forgets_a_deleted_article — 2 fresh runs agree + PASS event_category_index_forgets_a_deleted_event w=0.1600 0.0s + PASS: event_category_index_forgets_a_deleted_event — 2 fresh runs agree + PASS split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + PASS: split_event_category_indexes_forget_a_deleted_event — 2 fresh runs agree + ... calibration still running (12:47:09) ... + ... calibration still running (12:48:09) ... + PASS gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 99.1s CORE_GREEN=1 + PASS: the repository's own checks are all there and its suite is green + -> uncapped 1.000, failed blockers none, reward 1.000 + +=== cheat === + PASS media_file_of_a_deleted_post_is_removed w=0.0550 blocker 9.3s + PASS: media_file_of_a_deleted_post_is_removed — 2 fresh runs agree + PASS hashtag_index_forgets_a_deleted_post w=0.0550 0.0s + PASS: hashtag_index_forgets_a_deleted_post — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_rendition w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_rendition — 2 fresh runs agree + PASS deleted_post_is_delisted_from_the_media_log w=0.0550 0.0s + PASS: deleted_post_is_delisted_from_the_media_log — 2 fresh runs agree + PASS a_deleted_blog_post_leaves_no_json_or_attachment w=0.0550 0.0s + PASS: a_deleted_blog_post_leaves_no_json_or_attachment — 2 fresh runs agree + PASS timeline_indexes_forget_a_deleted_post w=0.0550 0.0s + PASS: timeline_indexes_forget_a_deleted_post — 2 fresh runs agree + PASS features_copy_of_a_deleted_article_is_removed w=0.1600 0.0s + PASS: features_copy_of_a_deleted_article_is_removed — 2 fresh runs agree + PASS features_index_forgets_a_deleted_article w=0.1600 0.0s + PASS: features_index_forgets_a_deleted_article — 2 fresh runs agree + PASS event_category_index_forgets_a_deleted_event w=0.1600 0.0s + PASS: event_category_index_forgets_a_deleted_event — 2 fresh runs agree + PASS split_event_category_indexes_forget_a_deleted_event w=0.1600 0.0s + PASS: split_event_category_indexes_forget_a_deleted_event — 2 fresh runs agree + FAIL gate_repo_suite_green_and_tests_untouched w=0.0300 blocker 2.4s CORE_GREEN=1 + FAIL: the repository's own checks were changed or removed + -> uncapped 0.970, failed blockers ['gate_repo_suite_green_and_tests_untouched'], reward 0.600 + +=== calibration === +REWARD gold 1.000 +REWARD base 0.000 +REWARD noop 0.000 +REWARD lazy 0.085 +REWARD alt 1.000 +REWARD cheat 0.600 + gold: **1.00** (expected 1.00) OK + base: **0.00** (expected 0.00) OK + gold: all criteria green, one by one + base: all cells red one by one; the gate's own suite is green on the untouched checkout (G-4) and the gate refuses to be paid for it (G-5') + noop: 0.000 OK + lazy: 0.085 (< 0.50) OK + alt: 1.000 (>= 0.80) OK + cheat: 0.600 (uncapped 0.970, capped by gate_repo_suite_green_and_tests_untouched) OK +LADDER gold=1.000 base=0.000 noop=0.000 lazy=0.085 alt=1.000 cheat=0.600 + +CALIBRATION OK; written to /hud/.calib/calibration.json + gold: **1.00** (expected 1.00) OK + base: **0.00** (expected 0.00) OK + gold: all criteria green, one by one + base: all cells red one by one; the gate's own suite is green on the untouched checkout (G-4) and the gate refuses to be paid for it (G-5') + noop: 0.000 OK + lazy: 0.085 (< 0.50) OK + alt: 1.000 (>= 0.80) OK + cheat: 0.600 (uncapped 0.970, capped by gate_repo_suite_green_and_tests_untouched) OK +LADDER gold=1.000 base=0.000 noop=0.000 lazy=0.085 alt=1.000 cheat=0.600 diff --git a/harbor/evidence/epicyon/native-reference.json b/harbor/evidence/epicyon/native-reference.json new file mode 100644 index 0000000000000000000000000000000000000000..fcc3d704423861f07b50640cd02aa28be655243b --- /dev/null +++ b/harbor/evidence/epicyon/native-reference.json @@ -0,0 +1,185 @@ +{ + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "media_file_of_a_deleted_post_is_removed", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: media_file_of_a_deleted_post_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh media_file_of_a_deleted_post_is_removed 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "hashtag_index_forgets_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: hashtag_index_forgets_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh hashtag_index_forgets_a_deleted_post 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_rendition", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_rendition \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_rendition 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "deleted_post_is_delisted_from_the_media_log", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: deleted_post_is_delisted_from_the_media_log \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh deleted_post_is_delisted_from_the_media_log 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_json_or_attachment", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_json_or_attachment \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_json_or_attachment 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "timeline_indexes_forget_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: timeline_indexes_forget_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh timeline_indexes_forget_a_deleted_post 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_copy_of_a_deleted_article_is_removed", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_copy_of_a_deleted_article_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh features_copy_of_a_deleted_article_is_removed 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_index_forgets_a_deleted_article", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_index_forgets_a_deleted_article \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh features_index_forgets_a_deleted_article 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "event_category_index_forgets_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: event_category_index_forgets_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh event_category_index_forgets_a_deleted_event 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "split_event_category_indexes_forget_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: split_event_category_indexes_forget_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh split_event_category_indexes_forget_a_deleted_event 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the repository's own checks are all there and its suite is green\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] +} \ No newline at end of file diff --git a/harbor/evidence/epicyon/reports/noop.json b/harbor/evidence/epicyon/reports/noop.json new file mode 100644 index 0000000000000000000000000000000000000000..3231cff300bbe202d11dbdf700aae3a75447b2fc --- /dev/null +++ b/harbor/evidence/epicyon/reports/noop.json @@ -0,0 +1,377 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "epicyon_deleted_post_announce_cache_contract", + "grader_version": "0.6.15", + "commands": [ + { + "name": "media_file_of_a_deleted_post_is_removed", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted post's media is still on disk: /media/2962/2E0Haokz35sNz4rtdcPOAD8fim5pp00C.png\n CELL=media_file_of_a_deleted_post_is_removed FAIL the deleted post's media is still on disk: /media/2962/2E0Haokz35sNz4rtdcPOAD8fim5pp00C.png\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh media_file_of_a_deleted_post_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "hashtag_index_forgets_a_deleted_post", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the hashtag index still points at the deleted post\n CELL=hashtag_index_forgets_a_deleted_post FAIL the hashtag index still points at the deleted post\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh hashtag_index_forgets_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_rendition", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted blog post is still published as markdown, micron\n CELL=a_deleted_blog_post_leaves_no_rendition FAIL the deleted blog post is still published as markdown, micron\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_rendition 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "deleted_post_is_delisted_from_the_media_log", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the media log still lists the deleted post's media: /media/2962/MupdsseYdqxwX1nmyj2fRxETTraXMtfU.png\n CELL=deleted_post_is_delisted_from_the_media_log FAIL the media log still lists the deleted post's media: /media/2962/MupdsseYdqxwX1nmyj2fRxETTraXMtfU.png\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh deleted_post_is_delisted_from_the_media_log 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_json_or_attachment", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted blog post's own json is still there\n CELL=a_deleted_blog_post_leaves_no_json_or_attachment FAIL the deleted blog post's own json is still there\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_json_or_attachment 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "timeline_indexes_forget_a_deleted_post", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the outbox index still lists the deleted post\n CELL=timeline_indexes_forget_a_deleted_post FAIL the outbox index still lists the deleted post\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh timeline_indexes_forget_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_copy_of_a_deleted_article_is_removed", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the news actor still holds a copy of the deleted article\n CELL=features_copy_of_a_deleted_article_is_removed FAIL the news actor still holds a copy of the deleted article\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_copy_of_a_deleted_article_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_index_forgets_a_deleted_article", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the news actor's index still lists the deleted article\n CELL=features_index_forgets_a_deleted_article FAIL the news actor's index still lists the deleted article\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_index_forgets_a_deleted_article 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "event_category_index_forgets_a_deleted_event", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the Music tag index still lists the deleted event\n CELL=event_category_index_forgets_a_deleted_event FAIL the Music tag index still lists the deleted event\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh event_category_index_forgets_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "split_event_category_indexes_forget_a_deleted_event", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the Outdoors tag index still lists the deleted event\n CELL=split_event_category_indexes_forget_a_deleted_event FAIL the Outdoors tag index still lists the deleted event\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh split_event_category_indexes_forget_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "the repository's own tests: green \u2014 the repository's own checks are all there and its suite is green\nFAIL: no scored behaviour was fixed \u2014 this gate does not pay for an empty change\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=0 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ], + "status": "graded", + "patch_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "result": { + "reward": 0.0, + "done": true, + "content": "Blocker criteria failed (gate_repo_suite_green_and_tests_untouched, media_file_of_a_deleted_post_is_removed); cap 0.60, reward 0.000 (uncapped 0.000).", + "info": { + "uncapped_reward": 0.0, + "failed_blockers": [ + "gate_repo_suite_green_and_tests_untouched", + "media_file_of_a_deleted_post_is_removed" + ], + "blocker_cap": 0.6 + }, + "isError": false, + "subscores": [ + { + "name": "media_file_of_a_deleted_post_is_removed", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted post's media is still on disk: /media/2962/2E0Haokz35sNz4rtdcPOAD8fim5pp00C.png\n CELL=media_file_of_a_deleted_post_is_removed FAIL the deleted post's media is still on disk: /media/2962/2E0Haokz35sNz4rtdcPOAD8fim5pp00C.png\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh media_file_of_a_deleted_post_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "hashtag_index_forgets_a_deleted_post", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the hashtag index still points at the deleted post\n CELL=hashtag_index_forgets_a_deleted_post FAIL the hashtag index still points at the deleted post\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh hashtag_index_forgets_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_rendition", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted blog post is still published as markdown, micron\n CELL=a_deleted_blog_post_leaves_no_rendition FAIL the deleted blog post is still published as markdown, micron\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_rendition 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "deleted_post_is_delisted_from_the_media_log", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the media log still lists the deleted post's media: /media/2962/MupdsseYdqxwX1nmyj2fRxETTraXMtfU.png\n CELL=deleted_post_is_delisted_from_the_media_log FAIL the media log still lists the deleted post's media: /media/2962/MupdsseYdqxwX1nmyj2fRxETTraXMtfU.png\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh deleted_post_is_delisted_from_the_media_log 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_json_or_attachment", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the deleted blog post's own json is still there\n CELL=a_deleted_blog_post_leaves_no_json_or_attachment FAIL the deleted blog post's own json is still there\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_json_or_attachment 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "timeline_indexes_forget_a_deleted_post", + "weight": 0.055, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the outbox index still lists the deleted post\n CELL=timeline_indexes_forget_a_deleted_post FAIL the outbox index still lists the deleted post\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh timeline_indexes_forget_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_copy_of_a_deleted_article_is_removed", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the news actor still holds a copy of the deleted article\n CELL=features_copy_of_a_deleted_article_is_removed FAIL the news actor still holds a copy of the deleted article\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_copy_of_a_deleted_article_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_index_forgets_a_deleted_article", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the news actor's index still lists the deleted article\n CELL=features_index_forgets_a_deleted_article FAIL the news actor's index still lists the deleted article\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_index_forgets_a_deleted_article 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "event_category_index_forgets_a_deleted_event", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the Music tag index still lists the deleted event\n CELL=event_category_index_forgets_a_deleted_event FAIL the Music tag index still lists the deleted event\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh event_category_index_forgets_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "split_event_category_indexes_forget_a_deleted_event", + "weight": 0.16, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the Outdoors tag index still lists the deleted event\n CELL=split_event_category_indexes_forget_a_deleted_event FAIL the Outdoors tag index still lists the deleted event\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh split_event_category_indexes_forget_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "the repository's own tests: green \u2014 the repository's own checks are all there and its suite is green\nFAIL: no scored behaviour was fixed \u2014 this gate does not pay for an empty change\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=0 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/epicyon/reports/reference.json b/harbor/evidence/epicyon/reports/reference.json new file mode 100644 index 0000000000000000000000000000000000000000..4ebe857392af5c5c451bd233d4c0c78a06a7d62b --- /dev/null +++ b/harbor/evidence/epicyon/reports/reference.json @@ -0,0 +1,370 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "epicyon_deleted_post_announce_cache_contract", + "grader_version": "0.6.15", + "commands": [ + { + "name": "media_file_of_a_deleted_post_is_removed", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: media_file_of_a_deleted_post_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh media_file_of_a_deleted_post_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "hashtag_index_forgets_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: hashtag_index_forgets_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh hashtag_index_forgets_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_rendition", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_rendition \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_rendition 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "deleted_post_is_delisted_from_the_media_log", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: deleted_post_is_delisted_from_the_media_log \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh deleted_post_is_delisted_from_the_media_log 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_json_or_attachment", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_json_or_attachment \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_json_or_attachment 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "timeline_indexes_forget_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: timeline_indexes_forget_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh timeline_indexes_forget_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_copy_of_a_deleted_article_is_removed", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_copy_of_a_deleted_article_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_copy_of_a_deleted_article_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_index_forgets_a_deleted_article", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_index_forgets_a_deleted_article \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_index_forgets_a_deleted_article 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "event_category_index_forgets_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: event_category_index_forgets_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh event_category_index_forgets_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "split_event_category_indexes_forget_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: split_event_category_indexes_forget_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh split_event_category_indexes_forget_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the repository's own checks are all there and its suite is green\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ], + "status": "graded", + "patch_sha256": "b5866d660e5151ed07222c809e6e92e4ff78f28d7a154d244b65d4cba0f847bf", + "result": { + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "media_file_of_a_deleted_post_is_removed", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: media_file_of_a_deleted_post_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh media_file_of_a_deleted_post_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "hashtag_index_forgets_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: hashtag_index_forgets_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh hashtag_index_forgets_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_rendition", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_rendition \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_rendition 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "deleted_post_is_delisted_from_the_media_log", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: deleted_post_is_delisted_from_the_media_log \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh deleted_post_is_delisted_from_the_media_log 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "a_deleted_blog_post_leaves_no_json_or_attachment", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a_deleted_blog_post_leaves_no_json_or_attachment \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh a_deleted_blog_post_leaves_no_json_or_attachment 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "timeline_indexes_forget_a_deleted_post", + "weight": 0.055, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: timeline_indexes_forget_a_deleted_post \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh timeline_indexes_forget_a_deleted_post 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_copy_of_a_deleted_article_is_removed", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_copy_of_a_deleted_article_is_removed \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_copy_of_a_deleted_article_is_removed 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "features_index_forgets_a_deleted_article", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: features_index_forgets_a_deleted_article \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh features_index_forgets_a_deleted_article 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "event_category_index_forgets_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: event_category_index_forgets_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh event_category_index_forgets_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "split_event_category_indexes_forget_a_deleted_event", + "weight": 0.16, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: split_event_category_indexes_forget_a_deleted_event \u2014 2 fresh runs agree\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh split_event_category_indexes_forget_a_deleted_event 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the repository's own checks are all there and its suite is green\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/epicyon/summary.json b/harbor/evidence/epicyon/summary.json new file mode 100644 index 0000000000000000000000000000000000000000..8929341652c3729055b8754db55d56c8c40263fa --- /dev/null +++ b/harbor/evidence/epicyon/summary.json @@ -0,0 +1,157 @@ +{ + "name": "epicyon", + "measure": { + "ok": true, + "hud": "0.6.15", + "path": "/opt/agentvenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", + "handed": [ + "PYTHONDONTWRITEBYTECODE", + "PYTHONNOUSERSITE", + "PYTHONPATH", + "PYTHONUNBUFFERED" + ], + "repo_dir": "/workspace/repo", + "python_usr_local": true, + "seconds": 4 + }, + "parity": { + "ok": true, + "reward": 1.0, + "criteria": 11, + "unmet": [], + "info": null, + "seconds": 157 + }, + "task_id": "epicyon_deleted_post_announce_cache_contract", + "image": "ec-swe-epicyon:source-v7", + "build": { + "ok": true, + "image_id": "sha256:74752fd4e8ebf481d6f0c01fd9b7e542c539f850bf9eed8503f41aaeabd7d99d", + "ladder": { + "gold": 1.0, + "base": 0.0, + "noop": 0.0, + "lazy": 0.085, + "alt": 1.0, + "cheat": 0.6 + }, + "source_digest": "d8f491bc55257bb8", + "source": "edited", + "seconds": 0 + }, + "prepare": { + "ok": true, + "bundle": "epicyon-r7", + "converter": "b8bba68767da888f", + "pinned_files": 9, + "criteria": 11, + "seconds": 1 + }, + "qualified": false, + "controls": { + "ok": false, + "checks": { + "noop_is_zero": true, + "reference_is_one": true, + "reference_equals_native": true, + "agent_is_isolated": true + }, + "results": { + "noop": { + "run": "epicyon-r7-control-noop-1791898762", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 351, + "probe": false, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 1 + ], + "attempts": 1 + }, + "reference": { + "run": "epicyon-r7-control-reference-1791899113", + "reward": 1.0, + "stop": "completed", + "error": null, + "seconds": 413, + "probe": true, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 0 + ], + "subscores": { + "media_file_of_a_deleted_post_is_removed": [ + 1.0, + 0.055 + ], + "hashtag_index_forgets_a_deleted_post": [ + 1.0, + 0.055 + ], + "a_deleted_blog_post_leaves_no_rendition": [ + 1.0, + 0.055 + ], + "deleted_post_is_delisted_from_the_media_log": [ + 1.0, + 0.055 + ], + "a_deleted_blog_post_leaves_no_json_or_attachment": [ + 1.0, + 0.055 + ], + "timeline_indexes_forget_a_deleted_post": [ + 1.0, + 0.055 + ], + "features_copy_of_a_deleted_article_is_removed": [ + 1.0, + 0.16 + ], + "features_index_forgets_a_deleted_article": [ + 1.0, + 0.16 + ], + "event_category_index_forgets_a_deleted_event": [ + 1.0, + 0.16 + ], + "split_event_category_indexes_forget_a_deleted_event": [ + 1.0, + 0.16 + ], + "gate_repo_suite_green_and_tests_untouched": [ + 1.0, + 0.03 + ] + }, + "attempts": 1 + } + }, + "bundle": "epicyon-r7", + "complete": false, + "seconds": 765 + }, + "leak": { + "scan_finished": true, + "hits_outside_checkout": [], + "other_files_holding_only_upstream_lines": 0, + "library_files_sharing_a_line": 0, + "most_lines_shared_by_one_library_file": 0, + "private_paths_absent": true, + "public_lines_shared_with_patch_and_graders": [ + 6, + 0 + ], + "private_lines_only_in_agent_checkout": [ + 0, + 0 + ], + "ok": true, + "seconds": 26 + } +} diff --git a/harbor/evidence/packages-reproduced-by-final-converter.json b/harbor/evidence/packages-reproduced-by-final-converter.json new file mode 100644 index 0000000000000000000000000000000000000000..4068d2843ae60aa6b90b915848edb4748432bb8e --- /dev/null +++ b/harbor/evidence/packages-reproduced-by-final-converter.json @@ -0,0 +1,20 @@ +{ + "converter": "b8bba68767da888f", + "packages": { + "badger": "differs: tests/docker-compose.yaml", + "bazel-remote": "differs: tests/docker-compose.yaml", + "celery": "differs: tests/docker-compose.yaml", + "coredns": "differs: tests/docker-compose.yaml", + "epicyon": "differs: tests/docker-compose.yaml", + "geode": "differs: tests/docker-compose.yaml", + "kratos": "differs: task.toml, environment/Dockerfile, environment/capture.py, environment/capture_submission.py, environment/docker-compose.yaml, environment/sanitize.py", + "microblogpub": "differs: tests/docker-compose.yaml", + "open-xml-sdk": "differs: task.toml, environment/Dockerfile, environment/capture.py, environment/capture_submission.py, environment/docker-compose.yaml, environment/sanitize.py", + "openfire": "differs: task.toml, environment/Dockerfile, environment/capture.py, environment/capture_submission.py, environment/docker-compose.yaml, environment/sanitize.py", + "rope": "differs: tests/docker-compose.yaml", + "terser": "differs: tests/docker-compose.yaml", + "umya": "differs: task.toml, environment/Dockerfile, environment/capture.py, environment/capture_submission.py, environment/docker-compose.yaml, environment/sanitize.py", + "zettlr": "differs: tests/docker-compose.yaml", + "zod": "differs: tests/docker-compose.yaml" + } +} diff --git a/harbor/evidence/rope/agent-image-scan.txt b/harbor/evidence/rope/agent-image-scan.txt new file mode 100644 index 0000000000000000000000000000000000000000..180cc545ccfc79c271b20b5894d6c5ebcb905132 --- /dev/null +++ b/harbor/evidence/rope/agent-image-scan.txt @@ -0,0 +1,15 @@ +needles: 855 +1 matching line(s): /workspace/repo/ropetest/pycoretest.py +4 matching line(s): /workspace/repo/ropetest/refactor/renametest.py +scan finished +absent: /hud +absent: /app +absent: /tests +present: /opt/task-tools/baseline.git +reference-patch lines in the agent's tracked files: 3, of which the pristine checkout lacks: 0 +grader lines in the agent's tracked files: 0, of which the pristine checkout lacks: 0 +reference-patch lines in total: 363, grader lines in total: 485 +private lines in 0 other files outside the checkout: 0, of which upstream lacks: 0 +--- private lines only the agent's checkout holds (expect none) +--- the agent's checkout: uncommitted changes (expect none), then its history +9c94847 baseline diff --git a/harbor/evidence/rope/author-calibration.txt b/harbor/evidence/rope/author-calibration.txt new file mode 100644 index 0000000000000000000000000000000000000000..a39ea36b8196e58966a619391af1065da3254a56 --- /dev/null +++ b/harbor/evidence/rope/author-calibration.txt @@ -0,0 +1,844 @@ +=== gold === + PASS export_list_follows_the_rename w=0.08 3.0s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + PASS: an export list written as one string of names + PASS: an export list written as a block of names + PASS: export_list_follows_the_rename (11 scenarios) + PASS type_constructor_names_follow_the_rename w=0.08 1.7s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + PASS: type_constructor_names_follow_the_rename (6 scenarios) + PASS declared_attribute_names_follow_the_rename w=0.08 0.9s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + PASS: the positional attribute names a class declares for matching + PASS: declared_attribute_names_follow_the_rename (3 scenarios) + PASS string_annotations_follow_and_data_stays w=0.22 1.8s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + PASS: a literal type beside a forward reference + PASS: the metadata of an annotated type + PASS: a class body with a literal field and a forward reference + PASS: string_annotations_follow_and_data_stays (5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.8s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + PASS move_destination_list_however_built_gains_the_name w=0.22 1.3s + PASS: the list the destination publishes is built through a variable + PASS: the list the destination publishes is chosen by a condition + PASS: the list the destination publishes is a sorted copy + PASS: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + PASS: move_destination_list_however_built_gains_the_name (5 scenarios) + PASS move_source_list_however_built_loses_the_name w=0.21 1.4s + PASS: a list written as one string of names + PASS: a name put on the list at its front + PASS: a name appended to the list + PASS: a tuple of two names + PASS: a tuple of names held in a variable + PASS: move_source_list_however_built_loses_the_name (5 scenarios) + PASS gate_repo_suite_green_and_tests_untouched w=0.03 blocker 35.4s + PASS: every shipped test file is byte for byte what it was + PASS: the repository's own tests pass + -> uncapped 1.000, failed blockers none, failed gates none, reward 1.000 + +=== base === + FAIL export_list_follows_the_rename w=0.08 2.5s + FAIL: the defining module's export list + FAIL: an export list written as a tuple over several lines + FAIL: the export list of a package that re-exports the name + FAIL: an export list naming a module that is being renamed + FAIL: an export list extended in place + FAIL: prose and an unrelated list of the same word + FAIL: another module that exports a name of its own + FAIL: an export list built through a variable + FAIL: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (11 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.5s + FAIL: the name a new type is given + FAIL: a new type built from a directly imported constructor + FAIL: the bound of a type variable + PASS: a type whose name is spelled like something else + FAIL: a constraint of a type variable + FAIL: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + FAIL: a slots tuple follows the attribute + FAIL: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + FAIL: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.7s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.2s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.2s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 19.0s + RULE HOLDS: every shipped test file is byte for byte what it was + RULE HOLDS: the repository's own tests pass + FAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change + -> uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.000 + +=== noop === + FAIL export_list_follows_the_rename w=0.08 2.4s + FAIL: the defining module's export list + FAIL: an export list written as a tuple over several lines + FAIL: the export list of a package that re-exports the name + FAIL: an export list naming a module that is being renamed + FAIL: an export list extended in place + FAIL: prose and an unrelated list of the same word + FAIL: another module that exports a name of its own + FAIL: an export list built through a variable + FAIL: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (11 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.4s + FAIL: the name a new type is given + FAIL: a new type built from a directly imported constructor + FAIL: the bound of a type variable + PASS: a type whose name is spelled like something else + FAIL: a constraint of a type variable + FAIL: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + FAIL: a slots tuple follows the attribute + FAIL: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + FAIL: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.7s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 18.4s + RULE HOLDS: every shipped test file is byte for byte what it was + RULE HOLDS: the repository's own tests pass + FAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change + -> uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.000 + +=== lazy === + FAIL export_list_follows_the_rename w=0.08 2.4s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + FAIL: an export list built through a variable + FAIL: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (4 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.5s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + FAIL: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (1 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + FAIL: a slots tuple follows the attribute + FAIL: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + FAIL: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.7s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 18.6s + RULE HOLDS: every shipped test file is byte for byte what it was + RULE HOLDS: the repository's own tests pass + FAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change + -> uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.000 + +=== alt === + PASS export_list_follows_the_rename w=0.08 2.4s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + PASS: an export list written as one string of names + PASS: an export list written as a block of names + PASS: export_list_follows_the_rename (11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.5s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + FAIL: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (1 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (1 of 3 scenarios) + PASS string_annotations_follow_and_data_stays w=0.22 1.1s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + PASS: a literal type beside a forward reference + PASS: the metadata of an annotated type + PASS: a class body with a literal field and a forward reference + PASS: string_annotations_follow_and_data_stays (5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.7s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + PASS move_destination_list_however_built_gains_the_name w=0.22 1.2s + PASS: the list the destination publishes is built through a variable + PASS: the list the destination publishes is chosen by a condition + PASS: the list the destination publishes is a sorted copy + PASS: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + PASS: move_destination_list_however_built_gains_the_name (5 scenarios) + PASS move_source_list_however_built_loses_the_name w=0.21 1.1s + PASS: a list written as one string of names + PASS: a name put on the list at its front + PASS: a name appended to the list + PASS: a tuple of two names + PASS: a tuple of names held in a variable + PASS: move_source_list_however_built_loses_the_name (5 scenarios) + PASS gate_repo_suite_green_and_tests_untouched w=0.03 blocker 18.4s + PASS: every shipped test file is byte for byte what it was + PASS: the repository's own tests pass + -> uncapped 0.840, failed blockers none, failed gates none, reward 0.840 + +=== prevgold === + FAIL export_list_follows_the_rename w=0.08 2.4s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (2 of 11 scenarios) + PASS type_constructor_names_follow_the_rename w=0.08 1.5s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + PASS: type_constructor_names_follow_the_rename (6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (1 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (3 of 5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.7s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.2s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (4 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + PASS gate_repo_suite_green_and_tests_untouched w=0.03 blocker 19.4s + PASS: every shipped test file is byte for byte what it was + PASS: the repository's own tests pass + -> uncapped 0.190, failed blockers none, failed gates none, reward 0.190 + +=== cheat === + FAIL export_list_follows_the_rename w=0.08 2.6s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + FAIL: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + FAIL: an export list built through a variable + PASS: an export list added to another list + FAIL: an export list written as one string of names + PASS: an export list written as a block of names + FAIL: export_list_follows_the_rename (3 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.6s + FAIL: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + FAIL: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (2 of 6 scenarios) + PASS declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + PASS: the positional attribute names a class declares for matching + PASS: declared_attribute_names_follow_the_rename (3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + PASS: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (4 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.8s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.4s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.3s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 0.1s + FAIL: ropetest/refactor/renametest.py was edited + FAIL: the tests the repository shipped are not what it shipped + -> uncapped 0.080, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.080 + +=== tamper === + FAIL export_list_follows_the_rename w=0.08 2.7s + FAIL: the defining module's export list + FAIL: an export list written as a tuple over several lines + FAIL: the export list of a package that re-exports the name + FAIL: an export list naming a module that is being renamed + FAIL: an export list extended in place + FAIL: prose and an unrelated list of the same word + FAIL: another module that exports a name of its own + FAIL: an export list built through a variable + FAIL: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (11 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.6s + FAIL: the name a new type is given + FAIL: a new type built from a directly imported constructor + FAIL: the bound of a type variable + PASS: a type whose name is spelled like something else + FAIL: a constraint of a type variable + FAIL: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + FAIL: a slots tuple follows the attribute + FAIL: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + FAIL: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.7s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.3s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.3s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 20.1s + RULE HOLDS: every shipped test file is byte for byte what it was + RULE HOLDS: the repository's own tests pass + FAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change + -> uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.000 + +=== tamper_key === + FAIL export_list_follows_the_rename w=0.08 2.4s + FAIL: the defining module's export list + FAIL: an export list written as a tuple over several lines + FAIL: the export list of a package that re-exports the name + FAIL: an export list naming a module that is being renamed + FAIL: an export list extended in place + FAIL: prose and an unrelated list of the same word + FAIL: another module that exports a name of its own + FAIL: an export list built through a variable + FAIL: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (11 of 11 scenarios) + FAIL type_constructor_names_follow_the_rename w=0.08 1.3s + FAIL: the name a new type is given + FAIL: a new type built from a directly imported constructor + FAIL: the bound of a type variable + PASS: a type whose name is spelled like something else + FAIL: a constraint of a type variable + FAIL: a new type whose name is handed over by keyword + FAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + FAIL: a slots tuple follows the attribute + FAIL: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + FAIL: a forward reference in a signature + FAIL: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios) + FAIL move_keeps_both_export_contracts w=0.08 blocker 0.7s + FAIL: the module left behind stops exporting the name + FAIL: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + FAIL: move_keeps_both_export_contracts (2 of 3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + FAIL: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 17.5s + RULE HOLDS: every shipped test file is byte for byte what it was + RULE HOLDS: the repository's own tests pass + FAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change + -> uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.000 + +=== tamper_gate === + FAIL export_list_follows_the_rename w=0.08 2.3s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (2 of 11 scenarios) + PASS type_constructor_names_follow_the_rename w=0.08 1.4s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + PASS: type_constructor_names_follow_the_rename (6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (1 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (3 of 5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.7s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (4 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 20.6s + PASS: every shipped test file is byte for byte what it was + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_and_normal_complete_blocks_and_single_fixing failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_module_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_exception_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_instances failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_when_having_a_two_line_function_header failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_with_function_with_two_line_return failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assists_in_parens failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_line_indents_in_a_blank_line failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_single_line_indents failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassists_before_opening_of_parens failed + FAIL: 197 of the repository's own tests did not pass (the report pytest wrote) + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_and_normal_complete_blocks_and_single_fixing failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_module_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_exception_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_instances failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_when_having_a_two_line_function_header failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_with_function_with_two_line_return failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assists_in_parens failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_line_indents_in_a_blank_line failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_single_line_indents failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassists_before_opening_of_parens failed + FAIL: 197 of the repository's own tests did not pass (the record streamed as the run happened) + FAIL: the repository's own tests do not pass + -> uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.160 + +=== tamper_report === + FAIL export_list_follows_the_rename w=0.08 2.3s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (2 of 11 scenarios) + PASS type_constructor_names_follow_the_rename w=0.08 1.4s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + PASS: type_constructor_names_follow_the_rename (6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (1 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (3 of 5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.7s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (4 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 20.3s + PASS: every shipped test file is byte for byte what it was + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_and_normal_complete_blocks_and_single_fixing failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_module_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_exception_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_instances failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_when_having_a_two_line_function_header failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_with_function_with_two_line_return failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assists_in_parens failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_line_indents_in_a_blank_line failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_single_line_indents failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassists_before_opening_of_parens failed + FAIL: 197 of the repository's own tests did not pass (the report pytest wrote) + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_and_normal_complete_blocks_and_single_fixing failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_module_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_exception_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_instances failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_when_having_a_two_line_function_header failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_with_function_with_two_line_return failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assists_in_parens failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_line_indents_in_a_blank_line failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_single_line_indents failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassists_before_opening_of_parens failed + FAIL: 197 of the repository's own tests did not pass (the record streamed as the run happened) + FAIL: the repository's own tests do not pass + -> uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.160 + +=== tamper_wire === + FAIL export_list_follows_the_rename w=0.08 2.4s + PASS: the defining module's export list + PASS: an export list written as a tuple over several lines + PASS: the export list of a package that re-exports the name + PASS: an export list naming a module that is being renamed + PASS: an export list extended in place + PASS: prose and an unrelated list of the same word + PASS: another module that exports a name of its own + PASS: an export list built through a variable + PASS: an export list added to another list + FAIL: an export list written as one string of names + FAIL: an export list written as a block of names + FAIL: export_list_follows_the_rename (2 of 11 scenarios) + PASS type_constructor_names_follow_the_rename w=0.08 1.5s + PASS: the name a new type is given + PASS: a new type built from a directly imported constructor + PASS: the bound of a type variable + PASS: a type whose name is spelled like something else + PASS: a constraint of a type variable + PASS: a new type whose name is handed over by keyword + PASS: type_constructor_names_follow_the_rename (6 scenarios) + FAIL declared_attribute_names_follow_the_rename w=0.08 0.7s + PASS: a slots tuple follows the attribute + PASS: a slots list follows the attribute + FAIL: the positional attribute names a class declares for matching + FAIL: declared_attribute_names_follow_the_rename (1 of 3 scenarios) + FAIL string_annotations_follow_and_data_stays w=0.22 1.1s + PASS: a forward reference in a signature + PASS: a forward reference inside a generic + FAIL: a literal type beside a forward reference + FAIL: the metadata of an annotated type + FAIL: a class body with a literal field and a forward reference + FAIL: string_annotations_follow_and_data_stays (3 of 5 scenarios) + PASS move_keeps_both_export_contracts w=0.08 blocker 0.7s + PASS: the module left behind stops exporting the name + PASS: the module arrived in starts exporting the name + PASS: a module with no export list is not given one + PASS: move_keeps_both_export_contracts (3 scenarios) + FAIL move_destination_list_however_built_gains_the_name w=0.22 1.1s + FAIL: the list the destination publishes is built through a variable + FAIL: the list the destination publishes is chosen by a condition + FAIL: the list the destination publishes is a sorted copy + FAIL: the list the destination publishes is one string of names + PASS: the generated import does not carry the export list across + FAIL: move_destination_list_however_built_gains_the_name (4 of 5 scenarios) + FAIL move_source_list_however_built_loses_the_name w=0.21 1.1s + FAIL: a list written as one string of names + FAIL: a name put on the list at its front + FAIL: a name appended to the list + FAIL: a tuple of two names + FAIL: a tuple of names held in a variable + FAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios) + FAIL gate_repo_suite_green_and_tests_untouched w=0.03 blocker 20.2s + PASS: every shipped test file is byte for byte what it was + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_except2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_already_complete_try_blocks_with_finally2 failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_and_normal_complete_blocks_and_single_fixing failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_module_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_attribute_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_class_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_exception_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_function_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_instances failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_builtin_variable_completion_proposal failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_when_having_a_two_line_function_header failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assist_with_function_with_two_line_return failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_code_assists_in_parens failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_line_indents_in_a_blank_line failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassist_before_single_line_indents failed + FAIL: ropetest.contrib.codeassisttest.CodeAssistTest::test_codeassists_before_opening_of_parens failed + FAIL: 197 of the repository's own tests did not pass (the record streamed as the run happened) + FAIL: the repository's own tests do not pass + -> uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'], failed gates none, reward 0.160 + +=== criterion | weight | blocker | gold | base === + export_list_follows_the_rename 0.08 PASS FAIL + type_constructor_names_follow_the_rename 0.08 PASS FAIL + declared_attribute_names_follow_the_rename 0.08 PASS FAIL + string_annotations_follow_and_data_stays 0.22 PASS FAIL + move_keeps_both_export_contracts 0.08 blocker PASS FAIL + move_destination_list_however_built_gains_the_name 0.22 PASS FAIL + move_source_list_however_built_loses_the_name 0.21 PASS FAIL + gate_repo_suite_green_and_tests_untouched 0.03 blocker PASS FAIL + +=== calibration === + gold: **1.00** (expected 1.00) OK + base: **0.00** (expected 0.00) OK + noop: reward 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'] + lazy: reward 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'] + alt: reward 0.840, failed blockers none + prevgold: reward 0.190, failed blockers none + cheat: reward 0.080, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'] + tamper: reward 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'] + tamper_key: reward 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched'] + tamper_gate: reward 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'] + tamper_report: reward 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'] + tamper_wire: reward 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched'] + base: gate green on the untouched checkout (gate_repo_suite_green_and_tests_untouched, its rule holds -- G-4), and worth 0.000 there (G-5', enforced by the gate itself) + base: all criteria red, one by one + gold: gates green + gold: all criteria green, one by one + ladder noop: 0.000 (uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched']) expected == 0.000 OK + ladder lazy: 0.000 (uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched']) expected < 0.50 OK + ladder alt: 0.840 (uncapped 0.840, failed blockers none) expected >= 0.80 OK + ladder prevgold: 0.190 (uncapped 0.190, failed blockers none) expected < 0.50 OK + ladder cheat: 0.080 (uncapped 0.080, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched']) expected capped <= 0.60 OK + ladder tamper: 0.000 (uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched']) expected == 0.000 OK + ladder tamper_key: 0.000 (uncapped 0.000, failed blockers ['move_keeps_both_export_contracts', 'gate_repo_suite_green_and_tests_untouched']) expected == 0.000 OK + ladder tamper_gate: 0.160 (uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched']) expected capped <= 0.60 OK + ladder tamper_report: 0.160 (uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched']) expected capped <= 0.60 OK + ladder tamper_wire: 0.160 (uncapped 0.160, failed blockers ['gate_repo_suite_green_and_tests_untouched']) expected capped <= 0.60 OK + LADDER gold:1.000 base:0.000 noop:0.000 lazy:0.000 alt:0.840 prevgold:0.190 cheat:0.080 tamper:0.000 tamper_key:0.000 tamper_gate:0.160 tamper_report:0.160 tamper_wire:0.160 diff --git a/harbor/evidence/rope/native-reference.json b/harbor/evidence/rope/native-reference.json new file mode 100644 index 0000000000000000000000000000000000000000..a5c8d13c66e8a138007229b42335f8db3fbc71b8 --- /dev/null +++ b/harbor/evidence/rope/native-reference.json @@ -0,0 +1,137 @@ +{ + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "export_list_follows_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the defining module's export list\nPASS: an export list written as a tuple over several lines\nPASS: the export list of a package that re-exports the name\nPASS: an export list naming a module that is being renamed\nPASS: an export list extended in place\nPASS: prose and an unrelated list of the same word\nPASS: another module that exports a name of its own\nPASS: an export list built through a variable\nPASS: an export list added to another list\nPASS: an export list written as one string of names\nPASS: an export list written as a block of names\nPASS: export_list_follows_the_rename (11 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh export_list_follows_the_rename 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "type_constructor_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the name a new type is given\nPASS: a new type built from a directly imported constructor\nPASS: the bound of a type variable\nPASS: a type whose name is spelled like something else\nPASS: a constraint of a type variable\nPASS: a new type whose name is handed over by keyword\nPASS: type_constructor_names_follow_the_rename (6 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh type_constructor_names_follow_the_rename 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "declared_attribute_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a slots tuple follows the attribute\nPASS: a slots list follows the attribute\nPASS: the positional attribute names a class declares for matching\nPASS: declared_attribute_names_follow_the_rename (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh declared_attribute_names_follow_the_rename 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "string_annotations_follow_and_data_stays", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a forward reference in a signature\nPASS: a forward reference inside a generic\nPASS: a literal type beside a forward reference\nPASS: the metadata of an annotated type\nPASS: a class body with a literal field and a forward reference\nPASS: string_annotations_follow_and_data_stays (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh string_annotations_follow_and_data_stays 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_keeps_both_export_contracts", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the module left behind stops exporting the name\nPASS: the module arrived in starts exporting the name\nPASS: a module with no export list is not given one\nPASS: move_keeps_both_export_contracts (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh move_keeps_both_export_contracts 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_destination_list_however_built_gains_the_name", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the list the destination publishes is built through a variable\nPASS: the list the destination publishes is chosen by a condition\nPASS: the list the destination publishes is a sorted copy\nPASS: the list the destination publishes is one string of names\nPASS: the generated import does not carry the export list across\nPASS: move_destination_list_however_built_gains_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh move_destination_list_however_built_gains_the_name 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_source_list_however_built_loses_the_name", + "weight": 0.21, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a list written as one string of names\nPASS: a name put on the list at its front\nPASS: a name appended to the list\nPASS: a tuple of two names\nPASS: a tuple of names held in a variable\nPASS: move_source_list_however_built_loses_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "bash /hud/grader/run_grading.sh move_source_list_however_built_loses_the_name 600", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: every shipped test file is byte for byte what it was\nPASS: the repository's own tests pass\n", + "stderr": "", + "_parameters": { + "command": "CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] +} \ No newline at end of file diff --git a/harbor/evidence/rope/reports/noop.json b/harbor/evidence/rope/reports/noop.json new file mode 100644 index 0000000000000000000000000000000000000000..35e38227f7b51f432ea6d326cbcb78e352c1fd25 --- /dev/null +++ b/harbor/evidence/rope/reports/noop.json @@ -0,0 +1,281 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "rope_rename_all_reexport_owners_contract", + "grader_version": "0.6.15", + "commands": [ + { + "name": "export_list_follows_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the defining module's export list\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"a_func\"]\nFAIL: an export list written as a tuple over several lines\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = (\n | 'new_func',\n | 'other',\n | )\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = (\n | 'a_func',\n | 'other',\n | )\nFAIL: the export list of a package that re-exports the name\n pkg/__init__.py is not what it has to be\n expected pkg/__init__.py:\n | from pkg.core import new_func\n | \n | __all__ = [\"new_func\"]\n got:\n | from pkg.core import new_func\n | \n | __all__ = [\"a_func\"]\nFAIL: an export list naming a module that is being renamed\n pkg/__init__.py is not what it has to be\n expected pkg/__init__.py:\n | from pkg import base\n | \n | __all__ = [\"base\"]\n got:\n | from pkg import base\n | \n | __all__ = [\"core\"]\nFAIL: an export list extended in place\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = []\n | __all__ += [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = []\n | __all__ += [\"a_func\"]\nFAIL: prose and an unrelated list of the same word\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | \"\"\"a_func is the entry point.\n | \n | Call a_func early.\n | \"\"\"\n | # a_func is also mentioned here\n | pass\n | \n | \n | NAMES = [\"a_func\"]\n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | \"\"\"a_func is the entry point.\n | \n | Call a_func early.\n | \"\"\"\n | # a_func is also mentioned here\n | pass\n | \n | \n | NAMES = [\"a_func\"]\n | __all__ = [\"a_func\"]\nFAIL: another module that exports a name of its own\n first.py is not what it has to be\n expected first.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"a_func\"]\nFAIL: an export list built through a variable\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | exported = \"new_func\"\n | label = \"a_func\"\n | __all__ = [exported]\n got:\n | def new_func():\n | pass\n | \n | \n | exported = \"a_func\"\n | label = \"a_func\"\n | __all__ = [exported]\nFAIL: an export list added to another list\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | extra = \"new_func\"\n | __all__ = [\"other\"] + [extra]\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | extra = \"a_func\"\n | __all__ = [\"other\"] + [extra]\nFAIL: an export list written as one string of names\n mod.py publishes ['a_func', 'other'], not ['new_func', 'other']\n expected mod.py:\n | __all__ == ['new_func', 'other']\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | WORDS = \"a_func other\".split()\n | __all__ = \"a_func other\".split()\nFAIL: an export list written as a block of names\n mod.py publishes ['a_func', 'other'], not ['new_func', 'other']\n expected mod.py:\n | __all__ == ['new_func', 'other']\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = \"\"\"\n | a_func\n | other\n | \"\"\".split()\nFAIL: export_list_follows_the_rename (11 of 11 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh export_list_follows_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "type_constructor_names_follow_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the name a new type is given\n mod.py is not what it has to be\n expected mod.py:\n | import typing\n | \n | LABEL = \"Number\"\n | Count = typing.NewType(\"Count\", int)\n | \n | \n | def scale(value: Count) -> Count:\n | \"\"\"Number is a count of things.\"\"\"\n | return value\n got:\n | import typing\n | \n | LABEL = \"Number\"\n | Count = typing.NewType(\"Number\", int)\n | \n | \n | def scale(value: Count) -> Count:\n | \"\"\"Number is a count of things.\"\"\"\n | return value\nFAIL: a new type built from a directly imported constructor\n mod.py is not what it has to be\n expected mod.py:\n | from typing import NewType\n | \n | AccountId = NewType(\"AccountId\", int)\n got:\n | from typing import NewType\n | \n | AccountId = NewType(\"UserId\", int)\nFAIL: the bound of a type variable\n mod.py is not what it has to be\n expected mod.py:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | T = TypeVar(\"T\", bound=\"Figure\")\n got:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | T = TypeVar(\"T\", bound=\"Shape\")\nPASS: a type whose name is spelled like something else\nFAIL: a constraint of a type variable\n mod.py is not what it has to be\n expected mod.py:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Circle(Figure):\n | pass\n | \n | \n | T = TypeVar(\"T\", \"Circle\", \"Figure\")\n got:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Circle(Figure):\n | pass\n | \n | \n | T = TypeVar(\"T\", \"Circle\", \"Shape\")\nFAIL: a new type whose name is handed over by keyword\n mod.py is not what it has to be\n expected mod.py:\n | from typing import NewType\n | \n | Count = NewType(name=\"Count\", tp=int)\n got:\n | from typing import NewType\n | \n | Count = NewType(name=\"Number\", tp=int)\nFAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh type_constructor_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "declared_attribute_names_follow_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a slots tuple follows the attribute\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = (\"sideways\",)\n | \n | def __init__(self):\n | self.sideways = 1\n | \n | def get(self):\n | return self.sideways\n | \n | \n | class Other:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 2\n got:\n | class Point:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.sideways = 1\n | \n | def get(self):\n | return self.sideways\n | \n | \n | class Other:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 2\nFAIL: a slots list follows the attribute\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = [\"sideways\", \"down\"]\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n got:\n | class Point:\n | __slots__ = [\"across\", \"down\"]\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\nFAIL: the positional attribute names a class declares for matching\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = (\"sideways\", \"down\")\n | __match_args__ = (\"sideways\", \"down\")\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n | \n | \n | class Other:\n | __match_args__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 3\n got:\n | class Point:\n | __slots__ = (\"across\", \"down\")\n | __match_args__ = (\"across\", \"down\")\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n | \n | \n | class Other:\n | __match_args__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 3\nFAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh declared_attribute_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "string_annotations_follow_and_data_stays", + "weight": 0.22, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a forward reference in a signature\n mod.py is not what it has to be\n expected mod.py:\n | class Figure:\n | \"\"\"Shape is a shape.\"\"\"\n | \n | \n | NAMES = [\"Shape\"]\n | \n | \n | def draw(what: \"Figure\") -> \"Figure\":\n | return what\n got:\n | class Figure:\n | \"\"\"Shape is a shape.\"\"\"\n | \n | \n | NAMES = [\"Shape\"]\n | \n | \n | def draw(what: \"Shape\") -> \"Shape\":\n | return what\nFAIL: a forward reference inside a generic\n mod.py is not what it has to be\n expected mod.py:\n | from typing import List, Optional\n | \n | \n | class Figure:\n | pass\n | \n | \n | corner: Optional[\"Figure\"] = None\n | \n | \n | def each(items: List[\"Figure\"]):\n | return items\n got:\n | from typing import List, Optional\n | \n | \n | class Figure:\n | pass\n | \n | \n | corner: Optional[\"Shape\"] = None\n | \n | \n | def each(items: List[\"Shape\"]):\n | return items\nFAIL: a literal type beside a forward reference\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: \"Figure\", kind: Literal[\"Shape\", \"Circle\"]) -> \"Figure\":\n | return what\n got:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: \"Shape\", kind: Literal[\"Shape\", \"Circle\"]) -> \"Shape\":\n | return what\nFAIL: the metadata of an annotated type\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Annotated\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: Annotated[\"Figure\", \"Shape\"]):\n | return what\n got:\n | from typing import Annotated\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: Annotated[\"Shape\", \"Shape\"]):\n | return what\nFAIL: a class body with a literal field and a forward reference\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Box:\n | kind: Literal[\"Shape\"] = \"Shape\"\n | item: \"Figure\"\n got:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Box:\n | kind: Literal[\"Shape\"] = \"Shape\"\n | item: \"Shape\"\nFAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh string_annotations_follow_and_data_stays 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_keeps_both_export_contracts", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the module left behind stops exporting the name\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/a.py still contains 'a_func'\n expected pkg/a.py:\n | no a_func\n got:\n | __all__ = [\"a_func\"]\nFAIL: the module arrived in starts exporting the name\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n pkg/a.py still contains 'a_func'\n expected pkg/a.py:\n | no a_func\n got:\n | __all__ = [\"a_func\"]\nPASS: a module with no export list is not given one\nFAIL: move_keeps_both_export_contracts (2 of 3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_keeps_both_export_contracts 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_destination_list_however_built_gains_the_name", + "weight": 0.22, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the list the destination publishes is built through a variable\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | _names = [\"other\"]\n | __all__ = _names\nFAIL: the list the destination publishes is chosen by a condition\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | FLAG = True\n | __all__ = [\"other\"] if FLAG else []\nFAIL: the list the destination publishes is a sorted copy\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = sorted([\"other\"])\nFAIL: the list the destination publishes is one string of names\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = \"other\".split()\nFAIL: the generated import does not carry the export list across\n pkg/b.py still contains '__all__'\n expected pkg/b.py:\n | no __all__\n got:\n | from pkg.a import other, __all__\n | \n | \n | def a_func():\n | pass\nFAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_destination_list_however_built_gains_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_source_list_however_built_loses_the_name", + "weight": 0.21, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a list written as one string of names\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = \"a_func other\".split()\nFAIL: a name put on the list at its front\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n | __all__.insert(0, \"a_func\")\nFAIL: a name appended to the list\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n | __all__.append(\"a_func\")\nFAIL: a tuple of two names\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = (\"a_func\", \"other\")\nFAIL: a tuple of names held in a variable\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | _names = (\"a_func\", \"other\")\n | __all__ = _names\nFAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_source_list_however_built_loses_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "RULE HOLDS: every shipped test file is byte for byte what it was\nRULE HOLDS: the repository's own tests pass\nFAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=0 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ], + "status": "graded", + "patch_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "result": { + "reward": 0.0, + "done": true, + "content": "Blocker criteria failed (gate_repo_suite_green_and_tests_untouched, move_keeps_both_export_contracts); cap 0.60, reward 0.000 (uncapped 0.000).", + "info": { + "uncapped_reward": 0.0, + "failed_blockers": [ + "gate_repo_suite_green_and_tests_untouched", + "move_keeps_both_export_contracts" + ], + "blocker_cap": 0.6 + }, + "isError": false, + "subscores": [ + { + "name": "export_list_follows_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the defining module's export list\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"a_func\"]\nFAIL: an export list written as a tuple over several lines\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = (\n | 'new_func',\n | 'other',\n | )\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = (\n | 'a_func',\n | 'other',\n | )\nFAIL: the export list of a package that re-exports the name\n pkg/__init__.py is not what it has to be\n expected pkg/__init__.py:\n | from pkg.core import new_func\n | \n | __all__ = [\"new_func\"]\n got:\n | from pkg.core import new_func\n | \n | __all__ = [\"a_func\"]\nFAIL: an export list naming a module that is being renamed\n pkg/__init__.py is not what it has to be\n expected pkg/__init__.py:\n | from pkg import base\n | \n | __all__ = [\"base\"]\n got:\n | from pkg import base\n | \n | __all__ = [\"core\"]\nFAIL: an export list extended in place\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = []\n | __all__ += [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = []\n | __all__ += [\"a_func\"]\nFAIL: prose and an unrelated list of the same word\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | \"\"\"a_func is the entry point.\n | \n | Call a_func early.\n | \"\"\"\n | # a_func is also mentioned here\n | pass\n | \n | \n | NAMES = [\"a_func\"]\n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | \"\"\"a_func is the entry point.\n | \n | Call a_func early.\n | \"\"\"\n | # a_func is also mentioned here\n | pass\n | \n | \n | NAMES = [\"a_func\"]\n | __all__ = [\"a_func\"]\nFAIL: another module that exports a name of its own\n first.py is not what it has to be\n expected first.py:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"new_func\"]\n got:\n | def new_func():\n | pass\n | \n | \n | __all__ = [\"a_func\"]\nFAIL: an export list built through a variable\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | exported = \"new_func\"\n | label = \"a_func\"\n | __all__ = [exported]\n got:\n | def new_func():\n | pass\n | \n | \n | exported = \"a_func\"\n | label = \"a_func\"\n | __all__ = [exported]\nFAIL: an export list added to another list\n mod.py is not what it has to be\n expected mod.py:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | extra = \"new_func\"\n | __all__ = [\"other\"] + [extra]\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | extra = \"a_func\"\n | __all__ = [\"other\"] + [extra]\nFAIL: an export list written as one string of names\n mod.py publishes ['a_func', 'other'], not ['new_func', 'other']\n expected mod.py:\n | __all__ == ['new_func', 'other']\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | WORDS = \"a_func other\".split()\n | __all__ = \"a_func other\".split()\nFAIL: an export list written as a block of names\n mod.py publishes ['a_func', 'other'], not ['new_func', 'other']\n expected mod.py:\n | __all__ == ['new_func', 'other']\n got:\n | def new_func():\n | pass\n | \n | \n | def other():\n | pass\n | \n | \n | __all__ = \"\"\"\n | a_func\n | other\n | \"\"\".split()\nFAIL: export_list_follows_the_rename (11 of 11 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh export_list_follows_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "type_constructor_names_follow_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the name a new type is given\n mod.py is not what it has to be\n expected mod.py:\n | import typing\n | \n | LABEL = \"Number\"\n | Count = typing.NewType(\"Count\", int)\n | \n | \n | def scale(value: Count) -> Count:\n | \"\"\"Number is a count of things.\"\"\"\n | return value\n got:\n | import typing\n | \n | LABEL = \"Number\"\n | Count = typing.NewType(\"Number\", int)\n | \n | \n | def scale(value: Count) -> Count:\n | \"\"\"Number is a count of things.\"\"\"\n | return value\nFAIL: a new type built from a directly imported constructor\n mod.py is not what it has to be\n expected mod.py:\n | from typing import NewType\n | \n | AccountId = NewType(\"AccountId\", int)\n got:\n | from typing import NewType\n | \n | AccountId = NewType(\"UserId\", int)\nFAIL: the bound of a type variable\n mod.py is not what it has to be\n expected mod.py:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | T = TypeVar(\"T\", bound=\"Figure\")\n got:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | T = TypeVar(\"T\", bound=\"Shape\")\nPASS: a type whose name is spelled like something else\nFAIL: a constraint of a type variable\n mod.py is not what it has to be\n expected mod.py:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Circle(Figure):\n | pass\n | \n | \n | T = TypeVar(\"T\", \"Circle\", \"Figure\")\n got:\n | from typing import TypeVar\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Circle(Figure):\n | pass\n | \n | \n | T = TypeVar(\"T\", \"Circle\", \"Shape\")\nFAIL: a new type whose name is handed over by keyword\n mod.py is not what it has to be\n expected mod.py:\n | from typing import NewType\n | \n | Count = NewType(name=\"Count\", tp=int)\n got:\n | from typing import NewType\n | \n | Count = NewType(name=\"Number\", tp=int)\nFAIL: type_constructor_names_follow_the_rename (5 of 6 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh type_constructor_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "declared_attribute_names_follow_the_rename", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a slots tuple follows the attribute\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = (\"sideways\",)\n | \n | def __init__(self):\n | self.sideways = 1\n | \n | def get(self):\n | return self.sideways\n | \n | \n | class Other:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 2\n got:\n | class Point:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.sideways = 1\n | \n | def get(self):\n | return self.sideways\n | \n | \n | class Other:\n | __slots__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 2\nFAIL: a slots list follows the attribute\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = [\"sideways\", \"down\"]\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n got:\n | class Point:\n | __slots__ = [\"across\", \"down\"]\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\nFAIL: the positional attribute names a class declares for matching\n mod.py is not what it has to be\n expected mod.py:\n | class Point:\n | __slots__ = (\"sideways\", \"down\")\n | __match_args__ = (\"sideways\", \"down\")\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n | \n | \n | class Other:\n | __match_args__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 3\n got:\n | class Point:\n | __slots__ = (\"across\", \"down\")\n | __match_args__ = (\"across\", \"down\")\n | \n | def __init__(self):\n | self.sideways = 1\n | self.down = 2\n | \n | \n | class Other:\n | __match_args__ = (\"across\",)\n | \n | def __init__(self):\n | self.across = 3\nFAIL: declared_attribute_names_follow_the_rename (3 of 3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh declared_attribute_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "string_annotations_follow_and_data_stays", + "weight": 0.22, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a forward reference in a signature\n mod.py is not what it has to be\n expected mod.py:\n | class Figure:\n | \"\"\"Shape is a shape.\"\"\"\n | \n | \n | NAMES = [\"Shape\"]\n | \n | \n | def draw(what: \"Figure\") -> \"Figure\":\n | return what\n got:\n | class Figure:\n | \"\"\"Shape is a shape.\"\"\"\n | \n | \n | NAMES = [\"Shape\"]\n | \n | \n | def draw(what: \"Shape\") -> \"Shape\":\n | return what\nFAIL: a forward reference inside a generic\n mod.py is not what it has to be\n expected mod.py:\n | from typing import List, Optional\n | \n | \n | class Figure:\n | pass\n | \n | \n | corner: Optional[\"Figure\"] = None\n | \n | \n | def each(items: List[\"Figure\"]):\n | return items\n got:\n | from typing import List, Optional\n | \n | \n | class Figure:\n | pass\n | \n | \n | corner: Optional[\"Shape\"] = None\n | \n | \n | def each(items: List[\"Shape\"]):\n | return items\nFAIL: a literal type beside a forward reference\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: \"Figure\", kind: Literal[\"Shape\", \"Circle\"]) -> \"Figure\":\n | return what\n got:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: \"Shape\", kind: Literal[\"Shape\", \"Circle\"]) -> \"Shape\":\n | return what\nFAIL: the metadata of an annotated type\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Annotated\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: Annotated[\"Figure\", \"Shape\"]):\n | return what\n got:\n | from typing import Annotated\n | \n | \n | class Figure:\n | pass\n | \n | \n | def draw(what: Annotated[\"Shape\", \"Shape\"]):\n | return what\nFAIL: a class body with a literal field and a forward reference\n mod.py is not what it has to be\n expected mod.py:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Box:\n | kind: Literal[\"Shape\"] = \"Shape\"\n | item: \"Figure\"\n got:\n | from typing import Literal\n | \n | \n | class Figure:\n | pass\n | \n | \n | class Box:\n | kind: Literal[\"Shape\"] = \"Shape\"\n | item: \"Shape\"\nFAIL: string_annotations_follow_and_data_stays (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh string_annotations_follow_and_data_stays 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_keeps_both_export_contracts", + "weight": 0.08, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the module left behind stops exporting the name\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/a.py still contains 'a_func'\n expected pkg/a.py:\n | no a_func\n got:\n | __all__ = [\"a_func\"]\nFAIL: the module arrived in starts exporting the name\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n pkg/a.py still contains 'a_func'\n expected pkg/a.py:\n | no a_func\n got:\n | __all__ = [\"a_func\"]\nPASS: a module with no export list is not given one\nFAIL: move_keeps_both_export_contracts (2 of 3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_keeps_both_export_contracts 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_destination_list_however_built_gains_the_name", + "weight": 0.22, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: the list the destination publishes is built through a variable\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | _names = [\"other\"]\n | __all__ = _names\nFAIL: the list the destination publishes is chosen by a condition\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | FLAG = True\n | __all__ = [\"other\"] if FLAG else []\nFAIL: the list the destination publishes is a sorted copy\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = sorted([\"other\"])\nFAIL: the list the destination publishes is one string of names\n pkg/a.py publishes ['a_func'], not []\n expected pkg/a.py:\n | __all__ == []\n got:\n | __all__ = [\"a_func\"]\n pkg/b.py publishes ['other'], not ['a_func', 'other']\n expected pkg/b.py:\n | __all__ == ['a_func', 'other']\n got:\n | from pkg.a import __all__\n | \n | \n | def a_func():\n | pass\n | def other():\n | pass\n | \n | \n | __all__ = \"other\".split()\nFAIL: the generated import does not carry the export list across\n pkg/b.py still contains '__all__'\n expected pkg/b.py:\n | no __all__\n got:\n | from pkg.a import other, __all__\n | \n | \n | def a_func():\n | pass\nFAIL: move_destination_list_however_built_gains_the_name (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_destination_list_however_built_gains_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_source_list_however_built_loses_the_name", + "weight": 0.21, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "FAIL: a list written as one string of names\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = \"a_func other\".split()\nFAIL: a name put on the list at its front\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n | __all__.insert(0, \"a_func\")\nFAIL: a name appended to the list\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = [\"other\"]\n | __all__.append(\"a_func\")\nFAIL: a tuple of two names\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | __all__ = (\"a_func\", \"other\")\nFAIL: a tuple of names held in a variable\n pkg/a.py publishes ['a_func', 'other'], not ['other']\n expected pkg/a.py:\n | __all__ == ['other']\n got:\n | def other():\n | pass\n | \n | \n | _names = (\"a_func\", \"other\")\n | __all__ = _names\nFAIL: move_source_list_however_built_loses_the_name (5 of 5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_source_list_however_built_loses_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 0.0, + "children": null, + "info": { + "exit_code": 1, + "stdout": "RULE HOLDS: every shipped test file is byte for byte what it was\nRULE HOLDS: the repository's own tests pass\nFAIL: not paid -- no scored behaviour was fixed, and this gate does not pay for an empty change\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=0 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/rope/reports/reference.json b/harbor/evidence/rope/reports/reference.json new file mode 100644 index 0000000000000000000000000000000000000000..c6e05ba2f95d26800c6296277f41e4ba17439cde --- /dev/null +++ b/harbor/evidence/rope/reports/reference.json @@ -0,0 +1,274 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "rope_rename_all_reexport_owners_contract", + "grader_version": "0.6.15", + "commands": [ + { + "name": "export_list_follows_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the defining module's export list\nPASS: an export list written as a tuple over several lines\nPASS: the export list of a package that re-exports the name\nPASS: an export list naming a module that is being renamed\nPASS: an export list extended in place\nPASS: prose and an unrelated list of the same word\nPASS: another module that exports a name of its own\nPASS: an export list built through a variable\nPASS: an export list added to another list\nPASS: an export list written as one string of names\nPASS: an export list written as a block of names\nPASS: export_list_follows_the_rename (11 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh export_list_follows_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "type_constructor_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the name a new type is given\nPASS: a new type built from a directly imported constructor\nPASS: the bound of a type variable\nPASS: a type whose name is spelled like something else\nPASS: a constraint of a type variable\nPASS: a new type whose name is handed over by keyword\nPASS: type_constructor_names_follow_the_rename (6 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh type_constructor_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "declared_attribute_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a slots tuple follows the attribute\nPASS: a slots list follows the attribute\nPASS: the positional attribute names a class declares for matching\nPASS: declared_attribute_names_follow_the_rename (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh declared_attribute_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "string_annotations_follow_and_data_stays", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a forward reference in a signature\nPASS: a forward reference inside a generic\nPASS: a literal type beside a forward reference\nPASS: the metadata of an annotated type\nPASS: a class body with a literal field and a forward reference\nPASS: string_annotations_follow_and_data_stays (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh string_annotations_follow_and_data_stays 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_keeps_both_export_contracts", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the module left behind stops exporting the name\nPASS: the module arrived in starts exporting the name\nPASS: a module with no export list is not given one\nPASS: move_keeps_both_export_contracts (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_keeps_both_export_contracts 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_destination_list_however_built_gains_the_name", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the list the destination publishes is built through a variable\nPASS: the list the destination publishes is chosen by a condition\nPASS: the list the destination publishes is a sorted copy\nPASS: the list the destination publishes is one string of names\nPASS: the generated import does not carry the export list across\nPASS: move_destination_list_however_built_gains_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_destination_list_however_built_gains_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_source_list_however_built_loses_the_name", + "weight": 0.21, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a list written as one string of names\nPASS: a name put on the list at its front\nPASS: a name appended to the list\nPASS: a tuple of two names\nPASS: a tuple of names held in a variable\nPASS: move_source_list_however_built_loses_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_source_list_however_built_loses_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: every shipped test file is byte for byte what it was\nPASS: the repository's own tests pass\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ], + "status": "graded", + "patch_sha256": "0d2bb7844e4fbbf9603570156b1857e77c12abca0eaf486a93f5e4118f01b9dc", + "result": { + "reward": 1.0, + "done": true, + "content": null, + "info": {}, + "isError": false, + "subscores": [ + { + "name": "export_list_follows_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the defining module's export list\nPASS: an export list written as a tuple over several lines\nPASS: the export list of a package that re-exports the name\nPASS: an export list naming a module that is being renamed\nPASS: an export list extended in place\nPASS: prose and an unrelated list of the same word\nPASS: another module that exports a name of its own\nPASS: an export list built through a variable\nPASS: an export list added to another list\nPASS: an export list written as one string of names\nPASS: an export list written as a block of names\nPASS: export_list_follows_the_rename (11 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh export_list_follows_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "type_constructor_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the name a new type is given\nPASS: a new type built from a directly imported constructor\nPASS: the bound of a type variable\nPASS: a type whose name is spelled like something else\nPASS: a constraint of a type variable\nPASS: a new type whose name is handed over by keyword\nPASS: type_constructor_names_follow_the_rename (6 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh type_constructor_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "declared_attribute_names_follow_the_rename", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a slots tuple follows the attribute\nPASS: a slots list follows the attribute\nPASS: the positional attribute names a class declares for matching\nPASS: declared_attribute_names_follow_the_rename (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh declared_attribute_names_follow_the_rename 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "string_annotations_follow_and_data_stays", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a forward reference in a signature\nPASS: a forward reference inside a generic\nPASS: a literal type beside a forward reference\nPASS: the metadata of an annotated type\nPASS: a class body with a literal field and a forward reference\nPASS: string_annotations_follow_and_data_stays (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh string_annotations_follow_and_data_stays 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_keeps_both_export_contracts", + "weight": 0.08, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the module left behind stops exporting the name\nPASS: the module arrived in starts exporting the name\nPASS: a module with no export list is not given one\nPASS: move_keeps_both_export_contracts (3 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_keeps_both_export_contracts 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_destination_list_however_built_gains_the_name", + "weight": 0.22, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: the list the destination publishes is built through a variable\nPASS: the list the destination publishes is chosen by a condition\nPASS: the list the destination publishes is a sorted copy\nPASS: the list the destination publishes is one string of names\nPASS: the generated import does not carry the export list across\nPASS: move_destination_list_however_built_gains_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_destination_list_however_built_gains_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "move_source_list_however_built_loses_the_name", + "weight": 0.21, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: a list written as one string of names\nPASS: a name put on the list at its front\nPASS: a name appended to the list\nPASS: a tuple of two names\nPASS: a tuple of names held in a variable\nPASS: move_source_list_however_built_loses_the_name (5 scenarios)\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'bash /hud/grader/run_grading.sh move_source_list_however_built_loses_the_name 600'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "gate_repo_suite_green_and_tests_untouched", + "weight": 0.03, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "PASS: every shipped test file is byte for byte what it was\nPASS: the repository's own tests pass\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc 'CORE_GREEN=1 bash /hud/grader/run_grading.sh gate_repo_suite_green_and_tests_untouched 900'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/rope/summary.json b/harbor/evidence/rope/summary.json new file mode 100644 index 0000000000000000000000000000000000000000..3ada141b8f6425fb26f760c3b124f2faf5a29184 --- /dev/null +++ b/harbor/evidence/rope/summary.json @@ -0,0 +1,149 @@ +{ + "name": "rope", + "measure": { + "ok": true, + "hud": "0.6.15", + "path": "/opt/agentvenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", + "handed": [ + "PIP_DISABLE_PIP_VERSION_CHECK", + "PYTHONDONTWRITEBYTECODE" + ], + "repo_dir": "/workspace/repo", + "python_usr_local": true, + "seconds": 4 + }, + "parity": { + "ok": true, + "reward": 1.0, + "criteria": 8, + "unmet": [], + "info": null, + "seconds": 30 + }, + "task_id": "rope_rename_all_reexport_owners_contract", + "image": "ec-swe-rope:source-v3", + "build": { + "ok": true, + "image_id": "sha256:e33bc697f20f1281afeb4f9862caa9dc697b1c045eb68e0d5425565a1d7196e5", + "ladder": { + "gold": 1.0, + "base": 0.0, + "noop": 0.0, + "lazy": 0.0, + "alt": 0.84, + "prevgold": 0.19, + "cheat": 0.08, + "tamper": 0.0, + "tamper_key": 0.0, + "tamper_gate": 0.16, + "tamper_report": 0.16, + "tamper_wire": 0.16 + }, + "source_digest": "d7a94af16d5e99d1", + "source": "edited", + "seconds": 362 + }, + "prepare": { + "ok": true, + "bundle": "rope-r5", + "converter": "b8bba68767da888f", + "pinned_files": 25, + "criteria": 8, + "seconds": 1 + }, + "qualified": false, + "controls": { + "ok": false, + "checks": { + "noop_is_zero": true, + "reference_is_one": true, + "reference_equals_native": true, + "agent_is_isolated": true + }, + "results": { + "noop": { + "run": "rope-r5-control-noop-1791900129", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 130, + "probe": false, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 1 + ], + "attempts": 1 + }, + "reference": { + "run": "rope-r5-control-reference-1791900260", + "reward": 1.0, + "stop": "completed", + "error": null, + "seconds": 98, + "probe": true, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 0 + ], + "subscores": { + "export_list_follows_the_rename": [ + 1.0, + 0.08 + ], + "type_constructor_names_follow_the_rename": [ + 1.0, + 0.08 + ], + "declared_attribute_names_follow_the_rename": [ + 1.0, + 0.08 + ], + "string_annotations_follow_and_data_stays": [ + 1.0, + 0.22 + ], + "move_keeps_both_export_contracts": [ + 1.0, + 0.08 + ], + "move_destination_list_however_built_gains_the_name": [ + 1.0, + 0.22 + ], + "move_source_list_however_built_loses_the_name": [ + 1.0, + 0.21 + ], + "gate_repo_suite_green_and_tests_untouched": [ + 1.0, + 0.03 + ] + }, + "attempts": 1 + } + }, + "bundle": "rope-r5", + "complete": false, + "seconds": 228 + }, + "leak": { + "scan_finished": true, + "hits_outside_checkout": [], + "other_files_holding_only_upstream_lines": 0, + "library_files_sharing_a_line": 0, + "most_lines_shared_by_one_library_file": 0, + "private_paths_absent": true, + "public_lines_shared_with_patch_and_graders": [ + 3, + 0 + ], + "private_lines_only_in_agent_checkout": [ + 0, + 0 + ], + "ok": true, + "seconds": 18 + } +} diff --git a/harbor/evidence/zod/agent-image-scan.txt b/harbor/evidence/zod/agent-image-scan.txt new file mode 100644 index 0000000000000000000000000000000000000000..d5762bcc66bb6306b1dd5e3a5082d61a27e0f164 --- /dev/null +++ b/harbor/evidence/zod/agent-image-scan.txt @@ -0,0 +1,36 @@ +needles: 1582 +2 matching line(s): /workspace/repo/packages/zod/src/v4/core/tests/compile.test.ts +1 matching line(s): /workspace/repo/packages/zod/src/v4/core/json-schema-processors.ts +2 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/record.test.ts +234 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/from-json-schema.test.ts +9 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +1 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/catch.test.ts +571 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/to-json-schema.test.ts +2 matching line(s): /workspace/repo/packages/zod/src/v4/classic/tests/datetime.test.ts +3 matching line(s): /workspace/repo/packages/docs/content/json-schema.mdx +82 matching line(s): /workspace/repo/node_modules/.pnpm/zod@4.0.8/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3 matching line(s): /workspace/repo/node_modules/.pnpm/@seriousme+openapi-schema-validator@2.9.0/node_modules/@seriousme/openapi-schema-validator/README.md +2 matching line(s): /workspace/repo/node_modules/.pnpm/@seriousme+openapi-schema-validator@2.9.0/node_modules/@seriousme/openapi-schema-validator/UPGRADING.md +1 matching line(s): /workspace/repo/node_modules/.pnpm/zod@4.4.3/node_modules/zod/src/v4/classic/tests/record.test.ts +74 matching line(s): /workspace/repo/node_modules/.pnpm/zod@4.4.3/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +9 matching line(s): /workspace/repo/node_modules/.pnpm/zod@4.4.3/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +176 matching line(s): /workspace/repo/node_modules/.pnpm/zod@4.4.3/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/70/cb2bcdec2238b686581c1875801ebbe4655e31e481abb02808b641794cf61202fa15dc6d132007920e5514a5b30eca9631f1f497dc5bd161bb30e306db1242 +82 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/8b/8b12266aa4f1770c38b9315660998b4ec629d6dc619baf4a6d546195109f73e2d04bd95ee6969b2f9b1b2265f28162d26e962ae076d3c19ebefa0116f337a7 +74 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/32/6254f362a42af3d2190672411f230955afe95289cec7e3faa916c4321e1dcc9e1fc392d30878ccba466469557186aed95195422285205dfe5c9058384aebd8 +176 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/0c/f56b6dbef29f709b57525b1d28ee2c4b4d0fba92e84218ff26813643513b3de6f18aaa311f93bd2b37e4a0b803d7fe2edec9ca8b8450bbd4af0c1d5ade13b7 +9 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/ba/92c366de0fa10d4e1eb680244d2729bd9db73730528ac46e5eaf0edc5b586a958196da3e5fb34d860984ee358eb69f9f997fa8d57926cb81804b3ceec53f76 +1 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/6b/27923e8875d5efbcf5fcc377fc75e63098b6e0d7de4a4d73391a9605a0fba28d55179223b21fa094f2cabda5a055399c8f3638268f22e8dc3f6db2685cd730 +2 matching line(s): /tmp/agent-home/.local/share/pnpm/store/v11/files/af/cef11e126bb20cd74708e91498bcd10cbe0d17c183f370ebd213a51f8cf2a016d6b14d8f86015c3b1d7286b311f95ebbe8c584ba64473485e54cd4fe2fb46f +scan finished +absent: /hud +absent: /app +absent: /tests +present: /opt/task-tools/baseline.git +reference-patch lines in the agent's tracked files: 1, of which the pristine checkout lacks: 0 +grader lines in the agent's tracked files: 751, of which the pristine checkout lacks: 0 +reference-patch lines in total: 43, grader lines in total: 1531 +private lines in 7 other files outside the checkout: 221, of which upstream lacks: 0 +--- private lines only the agent's checkout holds (expect none) +--- the agent's checkout: uncommitted changes (expect none), then its history +818c759 baseline diff --git a/harbor/evidence/zod/native-reference.json b/harbor/evidence/zod/native-reference.json new file mode 100644 index 0000000000000000000000000000000000000000..50f12f3d2a311d2e78624c9a8f25290a08f96d7e --- /dev/null +++ b/harbor/evidence/zod/native-reference.json @@ -0,0 +1,204 @@ +{ + "reward": 1.0, + "done": true, + "content": null, + "info": { + "blocker_policy": "weight", + "failed_blockers": [] + }, + "isError": false, + "subscores": [ + { + "name": "g1_catch_value_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g1_catch_value_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g1_catch_value_degrades", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g6_unencodable_default_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g6_unencodable_default_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g6_unencodable_default_degrades", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g5_default_value_conforms", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g5_default_value_conforms: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g5_default_value_conforms", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_positional_list", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=4 failures=0 pending=0 todo=0 tests=4 expected=4\nCRITERION g2_empty_positional_list: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g2_empty_positional_list", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_tuple_rest_element", + "weight": 0.05, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=2 failures=0 pending=0 todo=0 tests=2 expected=2\nCRITERION g2_empty_tuple_rest_element: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g2_empty_tuple_rest_element", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g3_pattern_keyed_record_openapi", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g3_pattern_keyed_record_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g3_pattern_keyed_record_openapi", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g4_metadata_examples_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g4_metadata_examples_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g4_metadata_examples_openapi", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g7_null_literal_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g7_null_literal_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g7_null_literal_openapi", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g8_empty_union_accepts_nothing", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g8_empty_union_accepts_nothing: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g8_empty_union_accepts_nothing", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g9_enum_members_unique", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g9_enum_members_unique: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh g9_enum_members_unique", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "d1_established_behavior", + "weight": 0.1, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=22 failures=0 pending=0 todo=0 tests=22 expected=22\nCRITERION d1_established_behavior: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh d1_established_behavior", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + }, + { + "name": "preservation_converter_suites", + "weight": 0.10000000000000009, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=734 failures=0 pending=0 todo=0 tests=734 expected=734\nCRITERION preservation_converter_suites: PASS\n", + "stderr": "", + "_parameters": { + "command": "/bin/bash /hud/grader/run_grading.sh preservation_converter_suites", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] +} \ No newline at end of file diff --git a/harbor/evidence/zod/reports/noop.json b/harbor/evidence/zod/reports/noop.json new file mode 100644 index 0000000000000000000000000000000000000000..70a4ae29939c2f8de769e72ba2bf4de5b626507c --- /dev/null +++ b/harbor/evidence/zod/reports/noop.json @@ -0,0 +1,108 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "zod_json_schema_target_legality", + "grader_version": "0.6.17", + "commands": [], + "status": "empty_patch", + "patch_sha256": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "result": { + "reward": 0.0, + "done": true, + "content": "Empty diff: no change to grade.", + "info": { + "failed_blockers": [ + "g1_catch_value_degrades", + "d1_established_behavior", + "preservation_converter_suites" + ], + "blocker_policy": "weight" + }, + "isError": false, + "subscores": [ + { + "name": "g1_catch_value_degrades", + "weight": 0.04, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g6_unencodable_default_degrades", + "weight": 0.04, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g5_default_value_conforms", + "weight": 0.11, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g2_empty_positional_list", + "weight": 0.09, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g2_empty_tuple_rest_element", + "weight": 0.05, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g3_pattern_keyed_record_openapi", + "weight": 0.11, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g4_metadata_examples_openapi", + "weight": 0.09, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g7_null_literal_openapi", + "weight": 0.09, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g8_empty_union_accepts_nothing", + "weight": 0.09, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "g9_enum_members_unique", + "weight": 0.09, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "d1_established_behavior", + "weight": 0.1, + "value": 0.0, + "children": null, + "info": null + }, + { + "name": "preservation_converter_suites", + "weight": 0.1, + "value": 0.0, + "children": null, + "info": null + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/zod/reports/reference.json b/harbor/evidence/zod/reports/reference.json new file mode 100644 index 0000000000000000000000000000000000000000..7c4eb75a7619a8abff594701c149ee5bcf0a443b --- /dev/null +++ b/harbor/evidence/zod/reports/reference.json @@ -0,0 +1,405 @@ +{ + "revision": "coding-rubric-v2", + "task_id": "zod_json_schema_target_legality", + "grader_version": "0.6.17", + "commands": [ + { + "name": "g1_catch_value_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g1_catch_value_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g1_catch_value_degrades'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g6_unencodable_default_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g6_unencodable_default_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g6_unencodable_default_degrades'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g5_default_value_conforms", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g5_default_value_conforms: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g5_default_value_conforms'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_positional_list", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=4 failures=0 pending=0 todo=0 tests=4 expected=4\nCRITERION g2_empty_positional_list: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g2_empty_positional_list'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_tuple_rest_element", + "weight": 0.05, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=2 failures=0 pending=0 todo=0 tests=2 expected=2\nCRITERION g2_empty_tuple_rest_element: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g2_empty_tuple_rest_element'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g3_pattern_keyed_record_openapi", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g3_pattern_keyed_record_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g3_pattern_keyed_record_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g4_metadata_examples_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g4_metadata_examples_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g4_metadata_examples_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g7_null_literal_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g7_null_literal_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g7_null_literal_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g8_empty_union_accepts_nothing", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g8_empty_union_accepts_nothing: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g8_empty_union_accepts_nothing'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g9_enum_members_unique", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g9_enum_members_unique: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g9_enum_members_unique'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "d1_established_behavior", + "weight": 0.1, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=22 failures=0 pending=0 todo=0 tests=22 expected=22\nCRITERION d1_established_behavior: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh d1_established_behavior'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + }, + { + "name": "preservation_converter_suites", + "weight": 0.10000000000000009, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=734 failures=0 pending=0 todo=0 tests=734 expected=734\nCRITERION preservation_converter_suites: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh preservation_converter_suites'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ], + "status": "graded", + "patch_sha256": "4cbdcd45459e6ca72da3fe41ef8cd70b715d5aa61f7af94c4e1183b2e299a182", + "result": { + "reward": 1.0, + "done": true, + "content": null, + "info": { + "blocker_policy": "weight", + "failed_blockers": [] + }, + "isError": false, + "subscores": [ + { + "name": "g1_catch_value_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g1_catch_value_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g1_catch_value_degrades'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g6_unencodable_default_degrades", + "weight": 0.04, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g6_unencodable_default_degrades: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g6_unencodable_default_degrades'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g5_default_value_conforms", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g5_default_value_conforms: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g5_default_value_conforms'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_positional_list", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=4 failures=0 pending=0 todo=0 tests=4 expected=4\nCRITERION g2_empty_positional_list: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g2_empty_positional_list'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g2_empty_tuple_rest_element", + "weight": 0.05, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=2 failures=0 pending=0 todo=0 tests=2 expected=2\nCRITERION g2_empty_tuple_rest_element: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g2_empty_tuple_rest_element'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g3_pattern_keyed_record_openapi", + "weight": 0.11, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g3_pattern_keyed_record_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g3_pattern_keyed_record_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g4_metadata_examples_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g4_metadata_examples_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g4_metadata_examples_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g7_null_literal_openapi", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g7_null_literal_openapi: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g7_null_literal_openapi'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g8_empty_union_accepts_nothing", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g8_empty_union_accepts_nothing: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g8_empty_union_accepts_nothing'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "g9_enum_members_unique", + "weight": 0.09, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=6 failures=0 pending=0 todo=0 tests=6 expected=6\nCRITERION g9_enum_members_unique: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh g9_enum_members_unique'", + "cwd": "/workspace/repo", + "timeout_seconds": 600 + } + } + }, + { + "name": "d1_established_behavior", + "weight": 0.1, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=22 failures=0 pending=0 todo=0 tests=22 expected=22\nCRITERION d1_established_behavior: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh d1_established_behavior'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + }, + { + "name": "preservation_converter_suites", + "weight": 0.10000000000000009, + "value": 1.0, + "children": null, + "info": { + "exit_code": 0, + "stdout": "VITEST passes=734 failures=0 pending=0 todo=0 tests=734 expected=734\nCRITERION preservation_converter_suites: PASS\n", + "stderr": "", + "_parameters": { + "command": "setpriv --reuid 1000 --regid 1000 --clear-groups --no-new-privs env HOME=/tmp/agent-home bash -lc '/bin/bash /hud/grader/run_grading.sh preservation_converter_suites'", + "cwd": "/workspace/repo", + "timeout_seconds": 900 + } + } + } + ] + } +} \ No newline at end of file diff --git a/harbor/evidence/zod/summary.json b/harbor/evidence/zod/summary.json new file mode 100644 index 0000000000000000000000000000000000000000..eeb69e1a1b13f2267882dfb9a164d3e96bf2d287 --- /dev/null +++ b/harbor/evidence/zod/summary.json @@ -0,0 +1,150 @@ +{ + "name": "zod", + "task_id": "zod_json_schema_target_legality", + "image": "ec-swe-zod:source-v7", + "build": { + "ok": true, + "image_id": "sha256:6c7eb55e9901704ab8e6b81e924c3c9ba35bfef05b814c6487399dc494123852", + "ladder": {}, + "seconds": 0 + }, + "qualified": false, + "measure": { + "ok": true, + "hud": "0.6.17", + "path": "/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games", + "handed": [], + "repo_dir": "/workspace/repo", + "python_usr_local": false, + "seconds": 7, + "reused": true + }, + "parity": { + "ok": true, + "reward": 1.0, + "criteria": 12, + "unmet": [], + "info": { + "blocker_policy": "weight", + "failed_blockers": [] + }, + "seconds": 578, + "reused": true + }, + "prepare": { + "ok": true, + "bundle": "zod-r4", + "converter": "b8bba68767da888f", + "pinned_files": 26, + "criteria": 12, + "seconds": 3 + }, + "controls": { + "ok": false, + "checks": { + "noop_is_zero": true, + "reference_is_one": true, + "reference_equals_native": true, + "agent_is_isolated": true + }, + "results": { + "noop": { + "run": "zod-r4-control-noop-1791892270", + "reward": 0.0, + "stop": "completed", + "error": null, + "seconds": 1299, + "probe": false, + "status": "empty_patch", + "verifier_error": null, + "exit_codes": [], + "attempts": 1 + }, + "reference": { + "run": "zod-r4-control-reference-1791892270", + "reward": 1.0, + "stop": "completed", + "error": null, + "seconds": 1383, + "probe": true, + "status": "graded", + "verifier_error": null, + "exit_codes": [ + 0 + ], + "subscores": { + "g1_catch_value_degrades": [ + 1.0, + 0.04 + ], + "g6_unencodable_default_degrades": [ + 1.0, + 0.04 + ], + "g5_default_value_conforms": [ + 1.0, + 0.11 + ], + "g2_empty_positional_list": [ + 1.0, + 0.09 + ], + "g2_empty_tuple_rest_element": [ + 1.0, + 0.05 + ], + "g3_pattern_keyed_record_openapi": [ + 1.0, + 0.11 + ], + "g4_metadata_examples_openapi": [ + 1.0, + 0.09 + ], + "g7_null_literal_openapi": [ + 1.0, + 0.09 + ], + "g8_empty_union_accepts_nothing": [ + 1.0, + 0.09 + ], + "g9_enum_members_unique": [ + 1.0, + 0.09 + ], + "d1_established_behavior": [ + 1.0, + 0.1 + ], + "preservation_converter_suites": [ + 1.0, + 0.10000000000000009 + ] + }, + "attempts": 1 + } + }, + "bundle": "zod-r4", + "complete": false, + "seconds": 1383 + }, + "leak": { + "scan_finished": true, + "hits_outside_checkout": [], + "other_files_holding_only_upstream_lines": 7, + "library_files_sharing_a_line": 0, + "most_lines_shared_by_one_library_file": 0, + "private_paths_absent": true, + "public_lines_shared_with_patch_and_graders": [ + 1, + 751 + ], + "private_lines_only_in_agent_checkout": [ + 0, + 0 + ], + "ok": true, + "seconds": 88 + } +} diff --git a/harbor/manifest.json b/harbor/manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..a619261566f58167a33e55f03719b2436c72cc97 --- /dev/null +++ b/harbor/manifest.json @@ -0,0 +1,527 @@ +{ + "schema_version": 1, + "created": "2026-10-13", + "contains": "reference solutions and hidden graders; keep away from evaluated models", + "package_revision": "coding-rubric-v2", + "runtime": { + "python": "3.12", + "harbor": "0.23.0", + "platform": "linux/amd64" + }, + "qualified_with": "stock Harbor 0.23.0 (oracle and nop agents) on Docker", + "tasks": [ + { + "task_id": "coredns_rewrite_svcb_opt", + "name": "coredns", + "dataset_instance_id": "coredns__coredns-coredns__4097", + "repository": "coredns/coredns", + "language": "Go", + "source_folder": "coredns-v4", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-coredns:source-v4", + "source_image_id_at_qualification": "sha256:5f122f58a039aefe65ccf2fd057eceb288c09278edde20f2ff0f2598f52c22e9", + "grader_version": "0.6.18", + "criteria": 7, + "reward_rule": "authored", + "blocker_cap": null, + "author_calibration": {}, + "provenance": { + "repository": "coredns/coredns", + "environment_id": "26a880f2-79fd-403a-8189-570cff511312", + "build": 4, + "build_id": "0f706606-696c-411a-b95a-727766f336ed", + "hosted_task": "coredns__4097", + "task_version": 1, + "source_archive_sha256": "f3e54c704918dc7b5043354e24681e708f15164f4069f857d4abf9de0faf796d", + "hosted_revision_argument": "not recorded; the scenario does not read it" + }, + "checks_on_shipped_files": "all", + "further_checks": "broken fix 0; missing grader file: no reward; planted score 0; author's patches: none supplied" + }, + { + "task_id": "epicyon_deleted_post_announce_cache_contract", + "name": "epicyon", + "dataset_instance_id": "bashrc2__epicyon-epicyon_deleted_post_announce_cache_contract-1c066303", + "repository": "bashrc2/epicyon", + "language": "Python", + "source_folder": "epicyon-v7", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-epicyon:source-v7", + "source_image_id_at_qualification": "sha256:74752fd4e8ebf481d6f0c01fd9b7e542c539f850bf9eed8503f41aaeabd7d99d", + "grader_version": "0.6.15", + "criteria": 11, + "reward_rule": "weighted_cap", + "blocker_cap": 0.6, + "author_calibration": { + "gold": 1.0, + "base": 0.0, + "noop": 0.0, + "lazy": 0.085, + "alt": 1.0, + "cheat": 0.6 + }, + "provenance": { + "repository": "bashrc2/epicyon", + "environment_id": "c29bfa96-5ecd-4ebd-9741-1f74147966c2", + "build": 7, + "build_id": "dd339e97-119f-4162-be02-d283a0784ff5", + "hosted_task": "epicyon_deleted_post_announce_cache_contract-1c066303", + "task_version": 1, + "source_archive_sha256": "f8c5e69a0a61ee283feb452cc2ed4e0645fe4ceff039b772af6119581f7151fb", + "hosted_revision_argument": "not recorded; the scenario does not read it" + }, + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-epicyon-deleted-post-announce-cache)" + }, + "checks_on_shipped_files": "reference, empty change, image scan", + "further_checks": "not yet; on the preceding build, with stock Harbor: broken fix 0; missing grader file: no reward; planted score 0; author's patches: 4 of 4" + }, + { + "task_id": "rope_rename_all_reexport_owners_contract", + "name": "rope", + "dataset_instance_id": "python-rope__rope-rope_rename_all_reexport_owners_contract-1c066303", + "repository": "python-rope/rope", + "language": "Python", + "source_folder": "rope-v3", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-rope:source-v3", + "source_image_id_at_qualification": "sha256:e33bc697f20f1281afeb4f9862caa9dc697b1c045eb68e0d5425565a1d7196e5", + "grader_version": "0.6.15", + "criteria": 8, + "reward_rule": "weighted_cap", + "blocker_cap": 0.6, + "author_calibration": { + "gold": 1.0, + "base": 0.0, + "noop": 0.0, + "lazy": 0.0, + "alt": 0.84, + "prevgold": 0.19, + "cheat": 0.08, + "tamper": 0.0, + "tamper_key": 0.0, + "tamper_gate": 0.16, + "tamper_report": 0.16, + "tamper_wire": 0.16 + }, + "provenance": { + "repository": "python-rope/rope", + "environment_id": "98a7b668-7394-4dc8-a222-d1759208e2c0", + "build": 3, + "build_id": "2eef5e21-3eec-45df-aaee-043567b1bdf1", + "hosted_task": "rope_rename_all_reexport_owners_contract-1c066303", + "task_version": 1, + "source_archive_sha256": "09367f6384cda46d917e9ff0e0a3968e6d85ffbbc6c767c1825f6b69d97dffc3", + "hosted_revision_argument": "not recorded; the scenario does not read it" + }, + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-rope-rename-all-reexport-owners)" + }, + "checks_on_shipped_files": "reference, empty change, image scan", + "further_checks": "not yet; on the preceding build, with stock Harbor: broken fix 0; missing grader file: no reward; planted score 0; author's patches: 10 of 10" + }, + { + "task_id": "zod_json_schema_target_legality", + "name": "zod", + "dataset_instance_id": "colinhacks__zod-zod-json-schema-target-legality", + "repository": "colinhacks/zod", + "language": "TypeScript", + "source_folder": "zod-v7", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-zod:source-v7", + "source_image_id_at_qualification": "sha256:6c7eb55e9901704ab8e6b81e924c3c9ba35bfef05b814c6487399dc494123852", + "grader_version": "0.6.17", + "criteria": 12, + "reward_rule": "authored", + "blocker_cap": null, + "author_calibration": {}, + "provenance": { + "repository": "colinhacks/zod", + "environment_id": "130424c5-8a1d-4cb7-b5b0-ffa04b564d03", + "build": 7, + "build_id": "af9abdd0-1f19-4d21-80da-d60924ccc128", + "hosted_task": "zod-json-schema-target-legality", + "task_version": 1, + "source_archive_sha256": "feb1e6acfc057e95a3a89532cb7f322f2c08f6bfea65556d66a04ceca877a5bc", + "hosted_revision_argument": "not recorded; the scenario does not read it" + }, + "checks_on_shipped_files": "reference, empty change, image scan", + "further_checks": "not yet; on an earlier build, with a different launcher: broken fix 0; missing grader file: no reward. Planted score: not run; author's patches: none supplied" + } + ], + "unpackaged": [ + { + "source_edited": { + "changed": [ + "env.py", + "tasks.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-click)" + }, + "task_id": "click", + "name": "click", + "dataset_instance_id": "pallets__click-click-help-defaults", + "repository": "pallets/click", + "source_folder": "click-v9", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-click:source-v9", + "package": null, + "why_no_package": "one criterion is judged by a model" + }, + { + "source_edited": { + "changed": [ + "env.py", + "tasks.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-sequelize)" + }, + "task_id": "sequelize", + "name": "sequelize", + "dataset_instance_id": "sequelize__sequelize-sequelize-bulkcreate-ignore-duplicates", + "repository": "sequelize/sequelize", + "source_folder": "sequelize-v27", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-sequelize:source-v27", + "package": null, + "why_no_package": "one criterion is judged by a model" + }, + { + "source_edited": { + "changed": [ + "env.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-hooks2675-v2)" + }, + "task_id": "hooks", + "name": "hooks", + "dataset_instance_id": "alibaba__hooks-ahooks_request_cache_races", + "repository": "alibaba/hooks", + "source_folder": "hooks-v4", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-hooks:source-v4", + "package": null, + "why_no_package": "one criterion is judged by a model" + }, + { + "source_edited": { + "changed": [ + "preflight.sh", + "tasks.py" + ], + "removed": [ + ".hud/config.json", + "task/grader/maintainer_review.judge.json.as-submitted-2026-09-18", + "tasks.py.bak-2026-09-20" + ], + "what": "comments that recorded internal review history were shortened in two files, and three files the image build does not read were removed; tasks.py is the same program" + }, + "task_id": "druid", + "name": "druid", + "dataset_instance_id": "alibaba__druid-druid_lenient_script", + "repository": "alibaba/druid", + "source_folder": "druid-v9", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-druid:source-v9", + "package": null, + "why_no_package": "one criterion is judged by a model" + }, + { + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-sickchill-episode-rename-sidecars)" + }, + "task_id": "sickchill", + "name": "sickchill", + "dataset_instance_id": "SickChill__SickChill-sickchill_episode_metadata_files_contract-2e2a49e4", + "repository": "SickChill/SickChill", + "source_folder": "sickchill-v7", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-sickchill:source-v7", + "package": null, + "why_no_package": "its gate runs repository tests that fetch from pypi.org, so it cannot pass offline" + }, + { + "task_id": "mikro-orm", + "name": "mikro-orm", + "dataset_instance_id": "mikro-orm__mikro-orm-mikro-orm-pessimistic-locking", + "repository": "mikro-orm/mikro-orm", + "source_folder": "mikro-orm-v7", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-mikro-orm:source-v7", + "package": null, + "why_no_package": "its grader starts database servers under their own accounts, which needs root; the packaged verifier runs graders unprivileged" + }, + { + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-babylonjs-scene-remove-owner-refs)" + }, + "task_id": "babylonjs", + "name": "babylonjs", + "dataset_instance_id": "BabylonJS__Babylon.js-babylonjs_scene_remove_owner_refs_contract-382616f8", + "repository": "BabylonJS/Babylon.js", + "source_folder": "babylonjs-v8", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-babylonjs:source-v8", + "package": null, + "why_no_package": "too heavy for the qualification host: its setup's ownership change of a very large dependency tree exceeded its ten-minute limit twice, and on a third try grading the reference fix had not finished after two hours" + }, + { + "task_id": "aioftp", + "name": "aioftp", + "dataset_instance_id": "aio-libs__aioftp-aioftp-stream-abort-desynchronization", + "repository": "aio-libs/aioftp", + "source_folder": "aioftp-v11", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-aioftp:source-v11", + "package": null, + "why_no_package": "different task template; not converted yet" + }, + { + "task_id": "apscheduler", + "name": "apscheduler", + "dataset_instance_id": "agronholm__apscheduler-apscheduler-expired-job-lease", + "repository": "agronholm/apscheduler", + "source_folder": "apscheduler-v17", + "dockerfile": "Dockerfile.hud", + "source_image": "ec-swe-apscheduler:source-v17", + "package": null, + "why_no_package": "different task template; not converted yet" + } + ], + "being_rechecked": [ + { + "task_id": "badger", + "name": "badger", + "dataset_instance_id": "dgraph-io__badger-journal_recovery_after_unclean_stop", + "repository": "dgraph-io/badger", + "source_folder": "badger-v2", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml", + "tasks.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-badger-journal)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "bazel-remote", + "name": "bazel-remote", + "dataset_instance_id": "buchgr__bazel-remote-bazel_remote_disk_eviction_accounting_contract-afe5ea56", + "repository": "buchgr/bazel-remote", + "source_folder": "bazel-remote-v2", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-bazel-remote-disk-eviction-accounting)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "celery", + "name": "celery", + "dataset_instance_id": "celery__celery-celery_retry_expires_countdown_contract", + "repository": "celery/celery", + "source_folder": "celery-v12", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-celery-retry-expires-countdown)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "geode", + "name": "geode", + "dataset_instance_id": "apache__geode-geode_oql_index_null_semantics_contract-1c066303", + "repository": "apache/geode", + "source_folder": "geode-v3", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-geode-oql-index-null-semantics)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "kratos", + "name": "kratos", + "dataset_instance_id": "ory__kratos-kratos_cleanup_stale_flows_courier_contract", + "repository": "ory/kratos", + "source_folder": "kratos-v10", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-kratos-cleanup-stale-flows-courier)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "microblogpub", + "name": "microblogpub", + "dataset_instance_id": "tsileo__microblog.pub-microblogpub_deleted_object_resurrect_lookup_contract-382616f8", + "repository": "tsileo/microblog.pub", + "source_folder": "microblogpub-v4", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-microblogpub-deleted-object-resurrect-lookup)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "open-xml-sdk", + "name": "open-xml-sdk", + "dataset_instance_id": "dotnet__Open-XML-SDK-open_xml_sdk_deletepart_refs_contract-1c066303", + "repository": "dotnet/Open-XML-SDK", + "source_folder": "open-xml-sdk-v5", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-open-xml-sdk-deletepart-refs)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "openfire", + "name": "openfire", + "dataset_instance_id": "igniterealtime__Openfire-openfire_userdeleting_last_owner_contract-0163de9c", + "repository": "igniterealtime/Openfire", + "source_folder": "openfire-v9", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-openfire-userdeleting-last-owner)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "terser", + "name": "terser", + "dataset_instance_id": "terser__terser-retained_top_level_names_keep_their_values", + "repository": "terser/terser", + "source_folder": "terser-v3", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "tasks.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-terser)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "umya", + "name": "umya", + "dataset_instance_id": "MathNya__umya-spreadsheet-umya_structural_edit_reference_owners_contract", + "repository": "MathNya/umya-spreadsheet", + "source_folder": "umya-v4", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py", + "pyproject.toml" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-umya-structural-edit-reference-owners)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + }, + { + "task_id": "zettlr", + "name": "zettlr", + "dataset_instance_id": "Zettlr__Zettlr-zettlr_clickable_keywords", + "repository": "Zettlr/Zettlr", + "source_folder": "zettlr-v32", + "dockerfile": "Dockerfile.hud", + "source_edited": { + "changed": [ + "env.py" + ], + "removed": [], + "what": "the environment name was changed to a neutral one (ec-swe-zettir-v1)" + }, + "package": null, + "why_no_package": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + } + ], + "not_included": { + "badger": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "bazel-remote": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "celery": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "geode": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "kratos": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "microblogpub": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "open-xml-sdk": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "openfire": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "terser": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "umya": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them", + "zettlr": "its build files were given a neutral environment name; the package is being rebuilt and re-checked on them" + } +} diff --git a/harbor/run_checks.py b/harbor/run_checks.py new file mode 100644 index 0000000000000000000000000000000000000000..71006ad3110d85901217dd4b17f1cac4a8663f61 --- /dev/null +++ b/harbor/run_checks.py @@ -0,0 +1,153 @@ +"""Run the scripted checks on these tasks with Harbor's own agents. + + python run_checks.py --task --output checks-001 + python run_checks.py --task --case noop --output smoke-001 + python run_checks.py --output all-checks-001 # every task, every case + +Needs the `harbor` command (pip install harbor==0.23.0) and Docker, on Linux, +macOS or WSL, and the task's source image (build_images.py). No model is +called. Each case is one `harbor run` on a copy of the task: + + noop Harbor's nop agent changes nothing -> reward 0 + reference Harbor's oracle agent applies the reference fix -> reward 1 + (it first checks, from inside the agent's container, that it is + an unprivileged user, sees no grading files and gets no traffic out) + broken the reference fix plus a syntax error -> reward 0, graded + infra a grader file is removed from the verifier -> no reward at all + tamper the "agent" keeps writing itself a full score -> reward 0 + +Results go to /summary.json; the script exits 0 only if every case +gave what is expected. Every run needs a new output directory name. +""" + +from __future__ import annotations + +import argparse +import json +import re +import shlex +import shutil +import subprocess +import sys +import time +from pathlib import Path + +CASES = ["noop", "reference", "broken", "infra", "tamper"] +EXPECTED = {"noop": 0.0, "reference": 1.0, "broken": 0.0, "infra": None, "tamper": 0.0} +PROBE = r"""/opt/task-tools/python -c 'import os,socket; from pathlib import Path +assert os.getuid()==1000, "the agent is not uid 1000" +private=("/hud", "/app/tasks.py", "/tests", "/var/run/docker.sock") +assert not any(Path(p).exists() for p in private), "a private path is visible" +data=b"" +try: + s=socket.create_connection(("1.1.1.1",443),timeout=4); s.settimeout(4) + s.sendall(b"GET / HTTP/1.0\r\n\r\n"); data=s.recv(16) +except OSError: + pass +assert not data, "the network is reachable" +print("agent isolation probe passed")' +""" +PLANT = """#!/bin/bash +mkdir -p /logs/verifier 2>/dev/null +( while true; do + echo 1 > /logs/verifier/reward.txt 2>/dev/null + echo '{"reward": 1}' > /logs/verifier/reward.json 2>/dev/null + sleep 0.2 + done ) > /dev/null 2>&1 & +sleep 2 +exit 0 +""" +SOURCE_SUFFIXES = (".py", ".go", ".java", ".rs", ".cs", ".ts", ".tsx", ".js", ".mjs", ".cjs") +TEST_PATH = re.compile( + r"/(tests?|__tests__|specs?|testing)/" + r"|/test[^/]*$|[._-](test|spec)\.[a-z]+$|_test\.go$|Tests?\.(java|cs)$|/[^/]*tests?\.py$", + re.IGNORECASE, +) + + +def variant_for(case: str, package: Path, scratch: Path) -> tuple[Path, str]: + """Copy the task and change what this case submits; return the copy and the agent.""" + variant = scratch / case / package.name + shutil.copytree(package, variant) + solve = variant / "solution/solve.sh" + if case == "noop": + return variant, "nop" + if case == "reference": + marker = "cd /workspace/repo\n" + text = solve.read_text() + solve.write_text(text.replace(marker, marker + PROBE, 1), newline="\n") + elif case == "broken": + patch = (variant / "solution/reference.patch").read_text() + paths = re.findall(r"^\+\+\+ b/(\S+)", patch, flags=re.MULTILINE) + target = next(p for p in paths if p.endswith(SOURCE_SUFFIXES) and not TEST_PATH.search(f"/{p}")) + with solve.open("a", newline="\n") as handle: + handle.write(f"printf '\\nBROKEN SYNTAX !\\n' >> {shlex.quote(target)}\n") + elif case == "infra": + config = json.loads((variant / "tests/config.json").read_text()) + pinned = sorted(f for f in config["verifier_files"] if f.startswith("/hud/grader/")) + script = variant / "tests/test.sh" + lines = script.read_text().splitlines() + lines.insert(len(lines) - 1, f"rm {shlex.quote(pinned[0])}") + script.write_text("\n".join(lines) + "\n", newline="\n") + elif case == "tamper": + solve.write_text(PLANT, newline="\n") + return variant, "oracle" + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter) + parser.add_argument("--output", required=True) + parser.add_argument("--task", action="append", default=[]) + parser.add_argument("--case", action="append", choices=CASES) + args = parser.parse_args() + root = Path(__file__).resolve().parent + if shutil.which("harbor") is None: + raise SystemExit("The harbor command is not on PATH: pip install harbor==0.23.0") + output = root / args.output + if Path(args.output).name != args.output: + raise SystemExit("--output must be a new directory name within the bundle") + output.mkdir(exist_ok=False) + known = json.loads((root / "tasks/manifest.json").read_text())["tasks"] + unknown = [name for name in args.task if name not in known] + if unknown: + raise SystemExit("Unknown task: " + ", ".join(unknown)) + summary = [] + for task in args.task or known: + for case in args.case or CASES: + variant, agent = variant_for(case, root / "tasks" / task, output / "variants" / task) + job = f"{task[:40]}-{case}" + started = time.time() + log = output / f"{job}.log" + with log.open("wb") as handle: + subprocess.run( + ["harbor", "run", "-p", str(variant), "-a", agent, "--jobs-dir", str(output / "jobs"), + "--job-name", job, "-n", "1"], + stdout=handle, stderr=subprocess.STDOUT, + ) + results = sorted((output / "jobs" / job).glob("*/result.json")) + reward, error, probe = None, "Harbor wrote no trial result", None + if results: + data = json.loads(results[0].read_text()) + failure = data.get("exception_info") + error = f"{failure.get('exception_type')}: {failure.get('exception_message')}"[:300] if failure else None + if failure is None: + reward = ((data.get("verifier_result") or {}).get("rewards") or {}).get("reward") + agent_dir = results[0].parent / "agent" + said = "".join(f.read_text(errors="replace") for f in agent_dir.rglob("*") if f.is_file()) if agent_dir.is_dir() else "" + probe = "agent isolation probe passed" in said + ok = reward == EXPECTED[case] and (error is None) == (case != "infra") + if case == "reference": + ok = ok and bool(probe) + row = {"task": task, "case": case, "reward": reward, "expected": EXPECTED[case], "ok": ok, + "error": error, "seconds": round(time.time() - started)} + if case == "reference": + row["agent_isolated"] = probe + summary.append(row) + (output / "summary.json").write_text(json.dumps(summary, indent=2) + "\n") + print(json.dumps(row), flush=True) + shutil.rmtree(output / "variants", ignore_errors=True) + sys.exit(0 if summary and all(row["ok"] for row in summary) else 1) + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/aioftp-v11/.dockerignore b/harbor/sources/aioftp-v11/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..0cfd59cd54cc80531c5b283d55d9ed3e460ba2f8 --- /dev/null +++ b/harbor/sources/aioftp-v11/.dockerignore @@ -0,0 +1,14 @@ +.venv/ +__pycache__ +*.pyc +.pytest_cache/ +.ruff_cache/ +.hud/ +.git/ +.github/ +tests/ +!grading/baseline/tests/ +!grading/baseline/tests/** +grading/adversarial/ +artifact-manifest.json +scaffold-manifest.json diff --git a/harbor/sources/aioftp-v11/.gitignore b/harbor/sources/aioftp-v11/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..99ccf78a3131f4a72586dc80d47addc8124aeccf --- /dev/null +++ b/harbor/sources/aioftp-v11/.gitignore @@ -0,0 +1,9 @@ +.venv/ +__pycache__/ +*.pyc +.pytest_cache/ +.ruff_cache/ +.hud/ +dist/ +build/ +*.egg-info/ diff --git a/harbor/sources/aioftp-v11/Dockerfile.hud b/harbor/sources/aioftp-v11/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..5ff0dd6ac9e65582b8972deda8645c44fad28607 --- /dev/null +++ b/harbor/sources/aioftp-v11/Dockerfile.hud @@ -0,0 +1,126 @@ +# syntax=docker/dockerfile:1 +# Stage `runtime-contract` is the credential-free, source-free runtime the graders, the +# repository-native commands, and the agent prompt's tools run on. `validate-helper.py +# runtime-preflight` builds only this target (no BuildKit secret) and probes every declared +# executable and service here; the final `runtime` stage derives from it unchanged, so what the +# probe proves is what the served image carries. Keep credentials and the private clone out of it. +FROM ubuntu:24.04@sha256:224a1869083a311ef3f13648a154ba79832fbef6364d31493642ca03082da254 AS runtime-contract + +# Resolve uv once by immutable OCI digest. Independent local and HUD builds therefore copy the +# same binary instead of asking PyPI for whatever version happens to be current. +COPY --from=ghcr.io/astral-sh/uv:0.12.3@sha256:2d890623d310b57771ce840f0da5eed5fc6d657da05ffaa45d82797b53fa3abc /uv /uvx /bin/ + +# Every apt package resolves against one dated Ubuntu snapshot. The image has no CA bundle yet, +# so the first index fetch skips TLS peer checks only to install ca-certificates; apt still +# verifies every index against the archive's signing keys, and every later fetch uses TLS. +RUN echo 'APT::Snapshot "20260915T000000Z";' > /etc/apt/apt.conf.d/50snapshot \ + && apt-get -o Acquire::https::Verify-Peer=false update -y \ + && apt-get -o Acquire::https::Verify-Peer=false install -y --no-install-recommends ca-certificates \ + && apt-get update -y \ + && apt-get install -y --no-install-recommends \ + bash \ + build-essential \ + curl \ + git \ + gnupg \ + libpq5 \ + openssl \ + python-is-python3 \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + python3-wheel \ + rsync \ + util-linux \ + sqlite3 \ + vim \ + wget \ + && rm -rf /var/lib/apt/lists/* \ + && update-ca-certificates + +# Repository runtime: CPython 3.11.15 (uv-managed, hash-verified download) with the repository's +# `dev` extra from a fully hashed lock. The editable path and the dist-info record stand in for +# `pip install -e .[dev]` of the workspace cloned below, so `pytest` from the repository root, the +# native test command, and the hidden probes all import `aioftp` from the tree being worked on. +# `aioftp_ipv6_loopback` is a pytest11 plugin that skips only the suite's `::1` nodes, and only +# where IPv6 loopback cannot be bound (HUD's sandbox has none); with `::1` available it is inert. +# `pytest-timeout` fails one hung test after PYTEST_TIMEOUT seconds with its traceback (default +# `signal` method; the rest of the run continues) instead of the whole shell call expiring with no +# output. Only the agent shell inherits the variable: the grader runs pytest with a clean +# environment and the pristine settings, where the plugin has no timeout and is inert. +ENV UV_PYTHON_INSTALL_DIR=/opt/uv-python \ + PYTEST_TIMEOUT=30 +COPY ./runtime/aioftp-dev-requirements.txt /opt/aioftp-runtime/requirements.txt +COPY ./runtime/aioftp_ipv6_loopback.py /opt/aioftp-runtime/aioftp_ipv6_loopback.py +RUN uv python install --no-bin 3.11.15 \ + && uv venv --python 3.11.15 /opt/aioftp-venv \ + && uv pip install --python /opt/aioftp-venv/bin/python --no-cache --require-hashes --no-deps -r /opt/aioftp-runtime/requirements.txt \ + && site="$(/opt/aioftp-venv/bin/python -c 'import sysconfig; print(sysconfig.get_paths()["purelib"])')" \ + && mkdir -p "$site/aioftp-0.28.3.dist-info" \ + && printf 'Metadata-Version: 2.1\nName: aioftp\nVersion: 0.28.3\n' > "$site/aioftp-0.28.3.dist-info/METADATA" \ + && printf 'uv\n' > "$site/aioftp-0.28.3.dist-info/INSTALLER" \ + && : > "$site/aioftp-0.28.3.dist-info/RECORD" \ + && echo /home/ubuntu/aioftp/src > "$site/__editable__.aioftp-0.28.3.pth" \ + && cp /opt/aioftp-runtime/aioftp_ipv6_loopback.py "$site/aioftp_ipv6_loopback.py" \ + && mkdir -p "$site/aioftp_ipv6_loopback-1.0.dist-info" \ + && printf 'Metadata-Version: 2.1\nName: aioftp-ipv6-loopback\nVersion: 1.0\n' > "$site/aioftp_ipv6_loopback-1.0.dist-info/METADATA" \ + && printf '[pytest11]\naioftp_ipv6_loopback = aioftp_ipv6_loopback\n' > "$site/aioftp_ipv6_loopback-1.0.dist-info/entry_points.txt" \ + && : > "$site/aioftp_ipv6_loopback-1.0.dist-info/RECORD" \ + && chmod -R a+rX /opt/uv-python /opt/aioftp-venv /opt/aioftp-runtime + +# Grader and HUD server virtualenv, from the package lock (Python 3.12 from the snapshot). +COPY ./pyproject.toml ./uv.lock /hud/ +WORKDIR /hud +ENV RUST_LOG=warn \ + PYTHONPATH=/hud/.venv/lib/python3.12/site-packages:/hud \ + PATH=/hud/.venv/bin:/opt/aioftp-venv/bin:$PATH \ + AIOFTP_REPO_PYTHON=/opt/aioftp-venv/bin/python +RUN uv venv --python /usr/bin/python3 /hud/.venv \ + && uv sync --frozen --no-install-project --no-cache --python /hud/.venv/bin/python + +FROM runtime-contract AS setup + +ARG REPO_URL="https://github.com/aio-libs/aioftp" +ARG BASE_COMMIT="4c18bdec8eb8f2e12a226fc513d07b92b5014167" +ARG FOLDER_NAME="aioftp" + +ENV FOLDER_NAME=${FOLDER_NAME} \ + REPO_URL=${REPO_URL} \ + BASE_COMMIT=${BASE_COMMIT} \ + HOME=/home/ubuntu \ + PROJECT_DIR=/home/ubuntu/${FOLDER_NAME} \ + PATCHES_DIR=/hud/patches + +# The base repository is public (the upstream itself, or the published base), so the pinned +# commit is fetched by SHA with no credential and no other ref: the image never holds a branch +# that could reach the gold, and no BuildKit secret is mounted anywhere in this Dockerfile. +USER ubuntu +RUN git init -q /home/ubuntu/${FOLDER_NAME} && \ + cd /home/ubuntu/${FOLDER_NAME} && \ + git fetch -q --depth 1 --no-tags ${REPO_URL} ${BASE_COMMIT} && \ + git checkout -q --detach ${BASE_COMMIT} && \ + rm -f .git/FETCH_HEAD + +USER root +RUN chown -R ubuntu:ubuntu /home/ubuntu/${FOLDER_NAME} \ + && mkdir -p /hud/patches \ + && chown -R root:root /home/ubuntu/${FOLDER_NAME}/.git \ + && chmod -R 700 /home/ubuntu/${FOLDER_NAME}/.git + +FROM setup AS runtime + +USER root +WORKDIR /hud +COPY ./env.py /hud/env.py +COPY ./grading /hud/grading +COPY ./tasks.py /hud/tasks.py +COPY ./task /hud/task +COPY ./gold.diff /hud/gold.diff +RUN chmod -R 700 /hud \ + && chown -R root:root /hud +RUN chmod 700 /root + +ENV PROBLEM_ID="" +EXPOSE 8765 +CMD ["hud", "serve", "env:env", "--host", "0.0.0.0", "--port", "8765"] diff --git a/harbor/sources/aioftp-v11/env.py b/harbor/sources/aioftp-v11/env.py new file mode 100644 index 0000000000000000000000000000000000000000..98b8454a8a69000ad20206aa2845794317da369c --- /dev/null +++ b/harbor/sources/aioftp-v11/env.py @@ -0,0 +1,700 @@ +"""Coding environment (HUD v6) for aioftp_stream_abort_desynchronization. + +The environment publishes one ssh capability (a UID-walled Workspace); the agent's +harness brings its own bash/file tools. A task is a @env.template async +generator: yield a prompt, then yield a reward. + +Grading entry point contract: this module must never import the grader chain +(``grading.*``) at module import time. The chain is resolved lazily inside +``run_grading`` so that a missing or corrupted grader module degrades to a +fail-closed JSON result instead of aborting the import and emitting no output +at all. Prompt 05 populates the grader behind ``GRADER_ENTRY_POINT``; it must +not add a module-level ``grading`` import here. +""" + +import asyncio +import base64 +import datetime +import gzip +import hashlib +import importlib +import inspect +import json +import logging +import os +import shutil +import stat +import subprocess +import sys +import tempfile +import time +import traceback +from pathlib import Path + +from hud.environment import Environment, Workspace +from hud.graders import EvaluationResult + +logger = logging.getLogger(__name__) + +TASK_ID = "aioftp_stream_abort_desynchronization" +TASK_SLUG = "aioftp-stream-abort-desynchronization" +HUD_ENV_NAME = "aioftp-stream-abort-desynchronization" +FOLDER_NAME = os.environ.get("FOLDER_NAME", "aioftp") +REPO_URL = os.environ.get("REPO_URL", "https://github.com/aio-libs/aioftp") +BASE_COMMIT_SHA = "4c18bdec8eb8f2e12a226fc513d07b92b5014167" +BASE_TREE_SHA = "cb1a5e0d57a012eea1e9bddbb9e1946d167c2f50" + +_explicit_dir = os.environ.get("PROJECT_DIR") +if _explicit_dir: + PROJECT_DIR = _explicit_dir + PATCHES_DIR = os.environ.get("PATCHES_DIR", "/hud/patches") + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / f"hud-{FOLDER_NAME}" + PROJECT_DIR = str(_LOCAL_ROOT / f"{FOLDER_NAME}-{os.getpid()}") + PATCHES_DIR = str(_LOCAL_ROOT / f"patches-{os.getpid()}") + _LOCAL_SUBSTRATE = True + +env = Environment(name="aioftp-stream-abort-desynchronization") + + +class UidWallWorkspace(Workspace): + """Workspace that drops the agent shell to UID 1000 (ubuntu) when running as root. + + Maintains full signature compatibility with Workspace.shell_argv. + """ + + def shell_argv(self, command=None, *, cwd=None, env=None, tty: bool = False, **kwargs): + super_kwargs = {"cwd": cwd, "env": env, "tty": tty} + sig = inspect.signature(super().shell_argv) + if "kwargs" in sig.parameters: + super_kwargs.update(kwargs) + else: + for k, v in kwargs.items(): + if k in sig.parameters: + super_kwargs[k] = v + argv = super().shell_argv(command, **super_kwargs) + if sys.platform != "win32" and hasattr(os, "geteuid") and os.geteuid() == 0: + argv = ["setpriv", "--reuid", "1000", "--regid", "1000", "--clear-groups", "--", *argv] + return argv + + +_ws = UidWallWorkspace( + PROJECT_DIR, + guest_path=PROJECT_DIR, + network=True, + env={"HOME": "/home/ubuntu"}, +) + + +async def _git_step(args: list[str], cwd: str | None, label: str) -> None: + proc = await asyncio.create_subprocess_exec( + "git", *args, + cwd=cwd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + _, stderr = await proc.communicate() + if proc.returncode != 0: + raise RuntimeError(f"{label} failed: {stderr.decode(errors='replace')}") + + +async def _ensure_repo() -> None: + """Local-substrate fallback: the same single-commit, credential-free fetch the image performs.""" + if (Path(PROJECT_DIR) / ".git").exists(): + return + Path(PROJECT_DIR).parent.mkdir(parents=True, exist_ok=True) + logger.info("Fetching %s@%s into %s", REPO_URL, BASE_COMMIT_SHA, PROJECT_DIR) + await _git_step(["init", "-q", PROJECT_DIR], None, "git init") + await _git_step( + ["-c", f"safe.directory={PROJECT_DIR}", "fetch", "-q", "--depth", "1", "--no-tags", REPO_URL, BASE_COMMIT_SHA], + PROJECT_DIR, f"git fetch {REPO_URL} {BASE_COMMIT_SHA}", + ) + await _git_step( + ["-c", f"safe.directory={PROJECT_DIR}", "checkout", "-q", "--detach", BASE_COMMIT_SHA], + PROJECT_DIR, f"git checkout {BASE_COMMIT_SHA}", + ) + (Path(PROJECT_DIR) / ".git" / "FETCH_HEAD").unlink(missing_ok=True) + + +@env.initialize +async def _up() -> None: + await _ensure_repo() + await _ws.start() + env.add_capability(_ws.capability("shell")) + + +@env.shutdown +async def _down() -> None: + await _ws.stop() + if _LOCAL_SUBSTRATE: + shutil.rmtree(PROJECT_DIR, ignore_errors=True) + shutil.rmtree(PATCHES_DIR, ignore_errors=True) + + +def make_prompt(description: str) -> str: + return f"""You are working in a coding repository located at {PROJECT_DIR}. + +Use the tools provided to complete the following task: + +{description} +""" + + +# Grading entry point. Resolved lazily by ``run_grading``; never imported at module +# import time. Prompt 05 implements ``grade_repository`` in ``grading/runner.py``. +GRADER_ENTRY_POINT = ("grading.runner", "grade_repository") + +FAIL_CLOSED_LIST_KEYS = ("caps", "families", "subscores", "checks", "blockers") + + + +# --- Workspace snapshot --------------------------------------------------------------------- +# Captured around the grader, never inside ``grading/**`` (so the grader scale id is untouched): +# the agent's final workspace as a binary-safe git patch against the pinned base commit, attached +# to the grade envelope's ``info["workspace_snapshot"]``. Prompt 08 decodes it beside the trace +# export and Prompt 11 reconstructs the candidate from it instead of replaying the trajectory. +# +# Isolation: the env process runs as root against the root-owned ``.git`` through a scratch index +# and a scratch object directory (the real object store is read-only through alternates), so the +# agent's tree, the real index and the real objects are never written. Completeness: when the +# agent edited an ignore file the capture re-adds with ``--force`` (complete beats compact), and +# configured content filters are reported so diagnosis never trusts transformed bytes. Safety: +# the capture runs after the grader, under one deadline, streams the diff to disk and reads it +# only under the size cap; a capture failure degrades to ``unavailable`` and never touches the grade. + +WORKSPACE_SNAPSHOT_SCHEMA_VERSION = 2 +WORKSPACE_SNAPSHOT_MAX_BYTES_ENV = "HUD_WORKSPACE_SNAPSHOT_MAX_BYTES" # raw patch bytes; 0 disables +WORKSPACE_SNAPSHOT_DEADLINE_ENV = "HUD_WORKSPACE_SNAPSHOT_DEADLINE_SECONDS" # whole capture +WORKSPACE_SNAPSHOT_DEFAULT_MAX_BYTES = 4 * 1024 * 1024 +WORKSPACE_SNAPSHOT_DEFAULT_DEADLINE = 120.0 +WORKSPACE_SNAPSHOT_EXCLUDED_DIRS = ("node_modules", ".venv", ".hud", ".tmp", ".cache", "dist", "build", "cdk.out") +# Prompt 11's forbidden path parts, refused here too so they never enter the grade event. +WORKSPACE_SNAPSHOT_PROTECTED_NAMES = (".env", ".hud", "gold.diff", "grading", "mcp_server") +WORKSPACE_SNAPSHOT_IGNORE_FILES = (".gitignore", ".gitattributes") +WORKSPACE_SNAPSHOT_MAX_LISTED_FILES = 2000 +WORKSPACE_SNAPSHOT_GIT_TIMEOUT = 60 +WORKSPACE_SNAPSHOT_ENCODING = "gzip+base64" + + +def _snapshot_limit(name: str, default, cast): + try: + return cast(os.environ.get(name, default)) + except (TypeError, ValueError): + return cast(default) + + +def _snapshot_payload(base_commit_sha: str, max_bytes: int | None, **fields) -> dict: + payload = { + "schema_version": WORKSPACE_SNAPSHOT_SCHEMA_VERSION, + "status": "unavailable", + "reason": None, + "base_commit_sha": base_commit_sha, + "head_commit_sha": None, + "patch_sha256": None, + "patch_size": None, + "changed_files": [], + "changed_file_count": None, + "changed_files_truncated": False, + "ignore_rules_modified": None, + "ignored_entry_count": None, + "capture_mode": None, + "filtered": None, + "content_filters": {"configured": [], "attributes_declared": False}, + "captured_after_grading": True, + "excluded_dirs": list(WORKSPACE_SNAPSHOT_EXCLUDED_DIRS), + "protected_names": list(WORKSPACE_SNAPSHOT_PROTECTED_NAMES), + "encoding": WORKSPACE_SNAPSHOT_ENCODING, + "max_bytes": max_bytes, + "deadline_seconds": None, + "elapsed_seconds": None, + "captured_at_utc": datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%SZ"), + } + payload.update(fields) + return payload + + +def _snapshot_pathspec_excludes() -> list[str]: + names = (*WORKSPACE_SNAPSHOT_EXCLUDED_DIRS, *WORKSPACE_SNAPSHOT_PROTECTED_NAMES) + specs: list[str] = [] + for name in names: + specs.extend((f":(exclude){name}", f":(exclude,glob)**/{name}", f":(exclude,glob)**/{name}/**")) + return specs + + +def capture_workspace_snapshot( + project_dir: str, base_commit_sha: str, max_bytes: int | None = None, deadline_seconds: float | None = None, +) -> dict: + """The agent's final workspace as a ``git diff --binary`` against ``base_commit_sha``. + + Status is ``captured`` (body in ``patch_b64``), ``empty`` (no change), ``too_large`` (hash and + listing only) or ``unavailable`` (reason only). Never raises. + """ + if max_bytes is None: + max_bytes = _snapshot_limit(WORKSPACE_SNAPSHOT_MAX_BYTES_ENV, WORKSPACE_SNAPSHOT_DEFAULT_MAX_BYTES, int) + if deadline_seconds is None: + deadline_seconds = _snapshot_limit(WORKSPACE_SNAPSHOT_DEADLINE_ENV, WORKSPACE_SNAPSHOT_DEFAULT_DEADLINE, float) + started = time.monotonic() + + def finish(payload: dict) -> dict: + payload["deadline_seconds"] = deadline_seconds + payload["elapsed_seconds"] = round(time.monotonic() - started, 3) + return payload + + try: + project = Path(project_dir) + git_dir = project / ".git" + if not git_dir.exists(): + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason="not_a_git_repository")) + if max_bytes <= 0: + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason="disabled")) + with tempfile.TemporaryDirectory(prefix="hud-workspace-snapshot-") as scratch_name: + scratch = Path(scratch_name) + objects = scratch / "objects" + objects.mkdir() + # Heavy runtime trees and protected names are excluded through a scratch excludes + # file, which layers under the repository's own ignore rules. + excludes_file = scratch / "excludes" + excludes_file.write_text( + "".join(f"{name}/\n" for name in WORKSPACE_SNAPSHOT_EXCLUDED_DIRS) + + "".join(f"{name}\n" for name in WORKSPACE_SNAPSHOT_PROTECTED_NAMES), + encoding="utf-8", + ) + env = { + **os.environ, + "GIT_INDEX_FILE": str(scratch / "index"), + "GIT_DIR": str(git_dir), + "GIT_WORK_TREE": str(project), + "GIT_OBJECT_DIRECTORY": str(objects), + "GIT_ALTERNATE_OBJECT_DIRECTORIES": str(git_dir / "objects"), + "HOME": scratch_name, + "GIT_CONFIG_NOSYSTEM": "1", + "GIT_TERMINAL_PROMPT": "0", + } + base_argv = [ + "git", "-c", f"safe.directory={project}", "-c", "core.quotePath=false", + "-c", f"core.excludesFile={excludes_file}", + ] + + def git(*args: str, ok_codes: tuple = (0,), stdout=subprocess.PIPE) -> bytes: + remaining = deadline_seconds - (time.monotonic() - started) + if remaining <= 0: + raise TimeoutError(f"snapshot deadline of {deadline_seconds:g}s exhausted before git {args[0]}") + completed = subprocess.run( + [*base_argv, *args], cwd=str(project), env=env, stdout=stdout, stderr=subprocess.PIPE, + check=False, timeout=min(WORKSPACE_SNAPSHOT_GIT_TIMEOUT, remaining), + ) + if completed.returncode not in ok_codes: + detail = completed.stderr.decode("utf-8", errors="replace").strip()[-200:] + raise RuntimeError(f"git {args[0]} exited {completed.returncode}: {detail}") + return completed.stdout or b"" + + def name_status() -> list[dict]: + listing = git("diff", "--cached", "--name-status", "-z", "--no-renames", base_commit_sha, "--") + fields = [entry.decode("utf-8", errors="replace") for entry in listing.split(b"\0") if entry] + rows = [{"path": fields[i + 1], "status": fields[i][:1]} for i in range(0, len(fields) - 1, 2)] + rows.sort(key=lambda item: item["path"]) + return rows + + head = git("rev-parse", "HEAD").decode("utf-8", errors="replace").strip() + git("read-tree", base_commit_sha) + git("add", "-A", "--ignore-errors", "--", ".") + changed = name_status() + ignore_rules_modified = any(item["path"].rsplit("/", 1)[-1] in WORKSPACE_SNAPSHOT_IGNORE_FILES for item in changed) + capture_mode = "standard" + if ignore_rules_modified: + # Agent-edited ignore rules can hide files the grader saw: re-add everything the + # pathspec excludes do not name, ignore rules notwithstanding. + git("add", "-A", "--force", "--ignore-errors", "--", ".", *_snapshot_pathspec_excludes()) + changed = name_status() + capture_mode = "forced" + + config_out = git("config", "--get-regexp", r"^filter\..*\.(clean|smudge|process)$", ok_codes=(0, 1)) + configured = sorted({line.split()[0] for line in config_out.decode("utf-8", errors="replace").splitlines() if line.strip()}) + attribute_paths = [ + entry.decode("utf-8", errors="replace") + for entry in git("ls-files", "-z", "--cached", "--", ".gitattributes", "*/.gitattributes").split(b"\0") if entry + ] + attributes_declared = False + for rel in [*attribute_paths, ".git/info/attributes"]: + candidate = project / rel + if candidate.is_file() and "filter=" in candidate.read_text(encoding="utf-8", errors="replace"): + attributes_declared = True + break + filtered = bool(configured) and attributes_declared + + diff_path = scratch / "snapshot.diff" + with diff_path.open("wb") as handle: + git("diff", "--cached", "--binary", "--full-index", "--no-ext-diff", "--no-renames", base_commit_sha, "--", stdout=handle) + size = diff_path.stat().st_size + digest = hashlib.sha256() + with diff_path.open("rb") as handle: + while chunk := handle.read(1 << 20): + digest.update(chunk) + ignored = git("ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory") + patch = diff_path.read_bytes() if 0 < size <= max_bytes else b"" + + payload = _snapshot_payload( + base_commit_sha, max_bytes, + head_commit_sha=head, + patch_sha256=digest.hexdigest(), + patch_size=size, + changed_files=changed[:WORKSPACE_SNAPSHOT_MAX_LISTED_FILES], + changed_file_count=len(changed), + changed_files_truncated=len(changed) > WORKSPACE_SNAPSHOT_MAX_LISTED_FILES, + ignore_rules_modified=ignore_rules_modified, + ignored_entry_count=sum(1 for entry in ignored.split(b"\0") if entry), + capture_mode=capture_mode, + filtered=filtered, + content_filters={"configured": configured, "attributes_declared": attributes_declared}, + ) + if size == 0: + payload["status"] = "empty" + elif size > max_bytes: + payload.update(status="too_large", reason=f"patch of {size} bytes exceeds max_bytes {max_bytes}") + else: + payload.update(status="captured", patch_b64=base64.b64encode(gzip.compress(patch, 6)).decode("ascii")) + return finish(payload) + except Exception as exc: # noqa: BLE001 - a snapshot failure must never change the grade + logger.warning("workspace snapshot unavailable: %s: %s", type(exc).__name__, exc) + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason=f"{type(exc).__name__}: {str(exc)[:200]}")) + + +def _attach_workspace_snapshot(result: EvaluationResult, snapshot: dict) -> EvaluationResult: + """Return ``result`` with ``info["workspace_snapshot"]`` set; the grader's own info is kept. + + Runs outside the fail-closed grading guards, so it must never raise: on any failure the + grader's result is returned exactly as it was. + """ + try: + existing = getattr(result, "info", None) + info = dict(existing) if isinstance(existing, dict) else {} + info["workspace_snapshot"] = snapshot + try: + return result.model_copy(update={"info": info}) + except Exception: # noqa: BLE001 - fall back to assignment on a non-pydantic result + result.info = info + return result + except Exception: # noqa: BLE001 - the snapshot is diagnostic, never grade-bearing + logger.exception("could not attach the workspace snapshot to the grade result") + return result + + +def fail_closed_payload(reason: str, detail: str = "", health: str = "fault:entry_point") -> dict: + """Structured, fail-closed grading result. + + Emitted whenever the grader chain cannot be imported, resolved, or executed. + Every list-shaped key is present and explicitly empty so downstream readers + never have to distinguish "absent" from "empty". ``health`` is a non-healthy literal. + """ + payload = { + "task_id": TASK_ID, + "reward": 0.0, + "is_error": True, + "grader_health": health, + "grader_health_reason": reason, + } + for key in FAIL_CLOSED_LIST_KEYS: + payload[key] = [] + payload["blockers"] = [reason] + if detail: + payload["grader_health_detail"] = detail + return payload + + +# --- Served grader scale ---------------------------------------------------------------------- +# The id of the scale a served grade is expressed on, computed exactly as +# delivered_tasks/scripts/hud_task_evidence.compute_grader_scale_id does over the package: every +# file under grading/ (adversarial fixtures and generated caches excluded) plus task/rubric.md. +SERVED_ROOT = Path(__file__).resolve().parent +SCALE_GENERATED_DIRECTORY_NAMES = {"__pycache__", ".pytest_cache", ".ruff_cache", ".venv"} + + +def served_grader_scale_id(root: Path | None = None) -> str | None: + root = root or SERVED_ROOT + try: + digest = hashlib.sha256() + sources: list[tuple[str, Path]] = [] + grading_dir = root / "grading" + if grading_dir.is_dir(): + for path in sorted(grading_dir.rglob("*")): + relative = path.relative_to(root) + if not path.is_file() or any( + "adversarial" in part or part in SCALE_GENERATED_DIRECTORY_NAMES for part in relative.parts + ): + continue + sources.append((relative.as_posix(), path)) + rubric = root / "task" / "rubric.md" + if rubric.is_file(): + sources.append(("task/rubric.md", rubric)) + for relative, path in sorted(sources): + digest.update(relative.encode("utf-8")) + digest.update(b"\0") + digest.update(path.read_bytes()) + digest.update(b"\0") + return digest.hexdigest() + except OSError: + return None + + +def _with_info(result: EvaluationResult, **fields) -> EvaluationResult: + """Return ``result`` with ``fields`` merged into its info; never raises.""" + try: + existing = getattr(result, "info", None) + info = dict(existing) if isinstance(existing, dict) else {} + info.update(fields) + return result.model_copy(update={"info": info}) + except Exception: # noqa: BLE001 - diagnostic enrichment never changes the grade + logger.exception("could not enrich the grade result info") + return result + + +def _resolve_grader(): + """Import the grader chain lazily and return its callable entry point.""" + module_name, attribute = GRADER_ENTRY_POINT + module = importlib.import_module(module_name) + grade = getattr(module, attribute) + if not callable(grade): + raise TypeError(f"{module_name}.{attribute} is not callable") + return grade + + +def _evaluation_from_payload(payload: dict) -> EvaluationResult: + """Convert a fail-closed payload into an EvaluationResult carrying the complete diagnostics. + + Faults report zero raw/final scores, an error flag, a non-healthy health literal and + explicit empty lists, so every reader can reject them as measurements. + """ + info = { + "raw_score": 0.0, + "final_score": 0.0, + "caps": [], + "criteria": [], + "gates_fired": [], + "gate_statuses": {}, + "grader_health": payload.get("grader_health") or "fault:entry_point", + "grader_health_reason": payload.get("grader_health_reason"), + } + return EvaluationResult( + reward=0.0, + done=True, + isError=True, + content=json.dumps(payload, indent=2, sort_keys=True, default=str), + info=info, + subscores=[], + ) + + +async def run_grading(**grader_kwargs) -> EvaluationResult: + """Run the grader chain, failing closed on any import or execution failure. + + A missing or corrupted grader module must still produce a structured JSON + result with ``is_error`` true, ``reward`` 0.0, a non-healthy + ``grader_health``, and explicitly empty lists -- never an import-time crash + that leaves the container with no output. + + After the grader has produced its result, the agent's final workspace is captured as a + git patch (``capture_workspace_snapshot``) and attached to that result's + ``info["workspace_snapshot"]``. The grader always runs first, so a slow or failing capture + can only degrade to ``unavailable``; it can neither delay nor change the grade. + """ + outcome = await _run_grader_chain(**grader_kwargs) + project_dir = str(grader_kwargs.get("project_dir") or PROJECT_DIR) + try: + snapshot = await asyncio.to_thread(capture_workspace_snapshot, project_dir, BASE_COMMIT_SHA) + except Exception as exc: # noqa: BLE001 - the snapshot is diagnostic, never grade-bearing + logger.exception("workspace snapshot capture raised; recording it unavailable") + snapshot = _snapshot_payload(BASE_COMMIT_SHA, None, reason=f"{type(exc).__name__}: {str(exc)[:200]}") + return _attach_workspace_snapshot(outcome, snapshot) + + +async def _run_grader_chain(**grader_kwargs) -> EvaluationResult: + """The one shared grading function: run the grader, then attach the served scale id.""" + outcome = await _grade_or_fail_closed(**grader_kwargs) + return _with_info(outcome, served_grader_scale_id=served_grader_scale_id()) + + +async def _grade_or_fail_closed(**grader_kwargs) -> EvaluationResult: + """Resolve and run the grader, failing closed on any import or execution failure.""" + try: + grade = _resolve_grader() + except Exception as exc: # noqa: BLE001 - fail closed on any resolution failure + reason = f"grader entry point {'.'.join(GRADER_ENTRY_POINT)} unavailable: {exc!r}" + logger.exception("Grader chain could not be resolved; failing closed") + return _evaluation_from_payload(fail_closed_payload(reason)) + + try: + result = grade(**grader_kwargs) + if inspect.isawaitable(result): + result = await result + except Exception as exc: # noqa: BLE001 - fail closed on any grading failure + reason = f"grader execution failed: {exc!r}" + logger.exception("Grader chain raised; failing closed") + return _evaluation_from_payload( + fail_closed_payload(reason, detail=traceback.format_exc(limit=5)) + ) + + if isinstance(result, EvaluationResult): + return result + if isinstance(result, dict): + return _evaluation_from_payload({**result, "is_error": True}) + reason = f"grader returned unsupported result type {type(result).__name__}" + logger.error(reason) + return _evaluation_from_payload(fail_closed_payload(reason)) + + +TASK_PROMPT_PATH = Path(__file__).resolve().parent / "task" / "prompt.md" + + +def last_resort_result(exc: BaseException) -> EvaluationResult: + """The template's final guard: a fail-closed grade naming only the exception class.""" + payload = fail_closed_payload( + f"unhandled {type(exc).__name__} while grading", health="fault:unhandled" + ) + return _with_info(_evaluation_from_payload(payload), served_grader_scale_id=served_grader_scale_id()) + + +async def _guarded(grading) -> EvaluationResult: + try: + return await grading + except Exception as exc: # noqa: BLE001 - the last-resort path must always yield a grade + logger.exception("grading raised past its own guards; failing closed") + return last_resort_result(exc) + + +@env.template(id="aioftp_stream_abort_desynchronization", description="Keep aioftp's FTP control connection in sync around transfer aborts.") +async def aioftp_stream_abort_desynchronization( + task_id: str = "aioftp_stream_abort_desynchronization", + description: str | None = None, + **kwargs, +): + """The agent task: serve the approved prompt, then grade the agent's workspace.""" + if description is None: + description = TASK_PROMPT_PATH.read_text(encoding="utf-8") + _ = yield make_prompt(description) + yield await _guarded(run_grading(task_id=task_id, project_dir=PROJECT_DIR, **kwargs)) + + +# --- Reference variants --------------------------------------------------------------------- +# The ec-swe-benchmarks PR check needs, in the linked taskset, a job whose name contains "gold" +# with every trace at 1.0 and one whose name contains "base" with every trace at 0.0. A single-task +# HUD job is named after its template id, so each variant is its own template (``_gold``, +# ``_base``). Prompt 07 runs each once on every deployed build. +# +# Neither variant grades the agent's workspace. Only after the agent's final answer, a fresh tree is +# cloned from the root-only repository metadata (``.git`` is root:root 0700 in the image, so the +# agent cannot have changed it) into a root-only temporary directory, checked out at +# ``BASE_COMMIT_SHA`` and verified against ``BASE_TREE_SHA``. For gold, ``/hud/gold.diff`` is applied +# there, read in place and never copied. The tree is graded through the same grader entry point as +# the agent task and then removed. A patch that does not apply, or any identity mismatch, fails +# closed. No workspace snapshot is captured, so no reference content reaches the trace. + +GOLD_DIFF_PATH = "/hud/gold.diff" +REFERENCE_KINDS = ("gold", "base") +REFERENCE_GIT_TIMEOUT = 600 +REFERENCE_PROMPT = ( + "This is a reference run of this environment. No change to the repository is needed, and no " + "files should be modified. Reply that you are done." +) + + +class ReferenceTreeError(RuntimeError): + """The reference tree could not be materialized exactly; the reference grade fails closed.""" + + +def _reference_git(*args: str, cwd: Path | None = None, safe: tuple = ()) -> str: + """Run one git command for the reference tree. Its output is never echoed: it may name gold paths.""" + safe_flags = [flag for directory in safe for flag in ("-c", f"safe.directory={directory}")] + completed = subprocess.run( + ["git", *safe_flags, *args], + cwd=cwd, + capture_output=True, + text=True, + check=False, + timeout=REFERENCE_GIT_TIMEOUT, + env={**os.environ, "GIT_CONFIG_GLOBAL": os.devnull, "GIT_CONFIG_NOSYSTEM": "1", "GIT_TERMINAL_PROMPT": "0"}, + ) + if completed.returncode != 0: + raise ReferenceTreeError(f"git {args[0]} exited {completed.returncode}") + return completed.stdout + + +def _require_root_only(path: Path, label: str) -> None: + """Refuse a path any other account can read, or one not owned by root when running as root.""" + details = path.stat() + if stat.S_IMODE(details.st_mode) & 0o077: + raise ReferenceTreeError(f"{label} is accessible beyond its owner") + if hasattr(os, "geteuid") and os.geteuid() == 0 and details.st_uid != 0: + raise ReferenceTreeError(f"{label} is not owned by root") + + +def materialize_reference_tree(reference: str) -> Path: + """Build the root-only reference tree for ``reference`` and return its temporary root. + + The graded tree is ``/tree``; the caller removes ````. + """ + if reference not in REFERENCE_KINDS: + raise ReferenceTreeError(f"unknown reference kind {reference!r}") + git_dir = Path(PROJECT_DIR) / ".git" + if not git_dir.is_dir(): + raise ReferenceTreeError("repository metadata is missing") + if not _LOCAL_SUBSTRATE: + _require_root_only(git_dir, "repository metadata") + root = Path(tempfile.mkdtemp(prefix="hud-reference-")) + try: + _require_root_only(root, "reference directory") + tree = root / "tree" + _reference_git( + "clone", "--no-hardlinks", "--no-checkout", "--quiet", str(git_dir), str(tree), + safe=(str(git_dir), str(PROJECT_DIR)), + ) + _reference_git("checkout", "--quiet", "--detach", BASE_COMMIT_SHA, cwd=tree) + if _reference_git("rev-parse", "HEAD^{tree}", cwd=tree).strip() != BASE_TREE_SHA: + raise ReferenceTreeError("reference tree does not match the pinned base tree") + if _reference_git("status", "--porcelain", "--untracked-files=all", cwd=tree).strip(): + raise ReferenceTreeError("reference tree is not a clean checkout of the pinned base") + if reference == "gold": + patch = Path(GOLD_DIFF_PATH) + if not patch.is_file(): + raise ReferenceTreeError("the gold patch is unavailable") + _reference_git("apply", "--check", "--whitespace=nowarn", str(patch), cwd=tree) + _reference_git("apply", "--whitespace=nowarn", str(patch), cwd=tree) + return root + except BaseException: + shutil.rmtree(root, ignore_errors=True) + raise + + +async def run_reference_grading(reference: str) -> EvaluationResult: + """Grade a fresh reference tree through the agent task's grader entry point, failing closed.""" + try: + root = await asyncio.to_thread(materialize_reference_tree, reference) + except Exception as exc: # noqa: BLE001 - any materialization failure fails closed + detail = str(exc) if isinstance(exc, ReferenceTreeError) else type(exc).__name__ + logger.warning("reference %s tree unavailable: %s", reference, detail) + outcome = _with_info( + _evaluation_from_payload( + fail_closed_payload(f"reference_{reference}_unavailable: {detail}", health="fault:reference_tree") + ), + served_grader_scale_id=served_grader_scale_id(), + ) + else: + try: + outcome = await _run_grader_chain(task_id=TASK_ID, project_dir=str(root / "tree")) + finally: + await asyncio.to_thread(shutil.rmtree, root, ignore_errors=True) + return _attach_workspace_snapshot(outcome, _snapshot_payload(BASE_COMMIT_SHA, None, reason="reference_run")) + + +@env.template(id=f"{TASK_ID}_gold", description="Reference run graded on the pinned base with the gold patch.") +async def reference_gold(): + """Reference variant: grades the gold tree, never the agent's workspace.""" + _ = yield REFERENCE_PROMPT + yield await _guarded(run_reference_grading("gold")) + + +@env.template(id=f"{TASK_ID}_base", description="Reference run graded on the unchanged pinned base.") +async def reference_base(): + """Reference variant: grades the unchanged base tree, never the agent's workspace.""" + _ = yield REFERENCE_PROMPT + yield await _guarded(run_reference_grading("base")) diff --git a/harbor/sources/aioftp-v11/gold.diff b/harbor/sources/aioftp-v11/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..a523a0910c3a091f7eca6e1438d1ac1861c4a2c6 --- /dev/null +++ b/harbor/sources/aioftp-v11/gold.diff @@ -0,0 +1,795 @@ +diff --git a/src/aioftp/client.py b/src/aioftp/client.py +index 9755aaf..ebb9c6e 100644 +--- a/src/aioftp/client.py ++++ b/src/aioftp/client.py +@@ -97,6 +97,7 @@ class DataConnectionThrottleStreamIO(ThrottleStreamIO): + write_timeout=write_timeout, + ) + self.client = client ++ self.final_reply_consumed = False + + async def finish( + self, +@@ -118,7 +119,18 @@ class DataConnectionThrottleStreamIO(ThrottleStreamIO): + :py:class:`str` + """ + self.close() +- await self.client.command(None, expected_codes, wait_codes) ++ async with self.client._control_lock(): ++ if self.final_reply_consumed: ++ # abort already read the transfer's final reply ++ return ++ # from here the reply is registered as owed before anything awaits, so a ++ # cancelled finish leaves it to be read by the next command instead of lost ++ self.final_reply_consumed = True ++ try: ++ await self.client._exchange(None, expected_codes, wait_codes, claim=self) ++ finally: ++ if self.client._transfer_stream is self: ++ self.client._transfer_stream = None + + async def __aexit__( + self, +@@ -128,6 +140,15 @@ class DataConnectionThrottleStreamIO(ThrottleStreamIO): + ) -> None: + if exc is None: + await self.finish() ++ elif self.client._transfer_stream is self: ++ try: ++ await asyncio.shield(self.client.abort()) ++ except Exception: ++ # the exception raised inside the block is the one that propagates: an abort ++ # that failed (an unexpected ABOR reply, a lost connection) must not replace it ++ logger.debug("abort after an exception in the stream block failed", exc_info=True) ++ finally: ++ self.close() + else: + self.close() + +@@ -214,6 +235,14 @@ class BaseClient: + self.path_io = path_io_factory(timeout=path_timeout) + self.encoding = encoding + self._stream: ThrottleStreamIO | None = None ++ self._transfer_stream: DataConnectionThrottleStreamIO | None = None ++ self._control_lock_instance: asyncio.Lock | None = None ++ self._write_lock_instance: asyncio.Lock | None = None ++ # replies written for but not yet read from the control connection, oldest first: ++ # (expected codes, wait codes, owner) where owner is the stream entitled to read it ++ self._owed_replies: collections.deque[tuple[tuple[Code, ...], tuple[Code, ...], object | None]] = ( ++ collections.deque() ++ ) + self.ssl = ssl + self.parse_list_line_custom = parse_list_line_custom + self.parse_list_line_custom_first = parse_list_line_custom_first +@@ -252,6 +281,8 @@ class BaseClient: + throttles={"_": self.throttle}, + timeout=self.socket_timeout, + ) ++ self._transfer_stream = None ++ self._owed_replies.clear() + + @property + def stream(self) -> ThrottleStreamIO: +@@ -265,6 +296,20 @@ class BaseClient: + """ + if self._stream is not None: + self._stream.close() ++ self._transfer_stream = None ++ self._owed_replies.clear() ++ ++ def _control_lock(self) -> asyncio.Lock: ++ """Serializes readers of the control connection.""" ++ if self._control_lock_instance is None: ++ self._control_lock_instance = asyncio.Lock() ++ return self._control_lock_instance ++ ++ def _write_lock(self) -> asyncio.Lock: ++ """Keeps the ledger of owed replies in wire order across concurrent writers.""" ++ if self._write_lock_instance is None: ++ self._write_lock_instance = asyncio.Lock() ++ return self._write_lock_instance + + async def parse_line(self) -> tuple[Code, str]: + """ +@@ -381,28 +426,210 @@ class BaseClient: + when logging + :type censor_after: :py:class:`None` or :py:class:`int` + """ ++ async with self._control_lock(): ++ if command and command.split(None, 1)[0].upper() != "ABOR": ++ # a transfer nobody finished or aborted must not leak its reply into this exchange ++ await self._settle_transfer() ++ return await self._exchange(command, expected_codes, wait_codes, censor_after) ++ ++ async def _exchange( ++ self, ++ command: str | None, ++ expected_codes: str | tuple[str, ...] = (), ++ wait_codes: str | tuple[str, ...] = (), ++ censor_after: int | None = None, ++ *, ++ claim: object | None = None, ++ ) -> tuple[Code, list[str]] | None: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ One control exchange; the caller holds the control lock. Replies owed ++ from earlier exchanges are consumed before this one is read. `claim` ++ names a stream whose reply may already be owed (a transfer aborted ++ with `wait=False`); that reply is then read here instead of drained. ++ """ + expected_codes = wrap_into_codes(wrap_with_container(expected_codes)) + wait_codes = wrap_into_codes(wrap_with_container(wait_codes)) +- if command: +- if "\r" in command or "\n" in command: +- raise errors.InvalidCommand("Command must not contain CR/LF") +- if censor_after: +- # Censor the user's command +- raw = command[:censor_after] +- stars = "*" * len(command[censor_after:]) +- logger.debug("%s%s", raw, stars) ++ entry = None ++ if claim is not None: ++ entry = next((owed for owed in self._owed_replies if owed[2] is claim), None) ++ if entry is None and (expected_codes or wait_codes): ++ entry = (expected_codes, wait_codes, claim) ++ if command: ++ # nothing is written while replies are still owed: no pipelining behind them ++ await self._drain_owed_replies() ++ await self._submit(command, [entry], censor_after) + else: +- logger.debug(command) +- message = command + END_OF_LINE +- await self.stream.write(message.encode(encoding=self.encoding)) +- if expected_codes or wait_codes: ++ # the reply is already in flight: owed from now on, even if we are cancelled ++ self._owed_replies.append(entry) ++ elif command: ++ await self._drain_owed_replies() ++ await self._submit(command, [], censor_after) ++ if entry is None: ++ return None ++ # another writer (an abort from a second task) may have slipped in ahead of us ++ await self._drain_owed_replies(until=entry) ++ code, info = await self._collect_reply() ++ if expected_codes: ++ self.check_codes(expected_codes, code, info) ++ return code, info ++ ++ async def _submit( ++ self, ++ command: str, ++ entries: list[tuple[tuple[Code, ...], tuple[Code, ...], object | None]], ++ censor_after: int | None = None, ++ ) -> None: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Register the replies `command` will earn and write it, as one step ++ with respect to other writers, so the ledger matches the wire order. ++ A failed write owes nothing. ++ """ ++ async with self._write_lock(): ++ self._owed_replies.extend(entries) ++ try: ++ await self._write_command(command, censor_after) ++ except BaseException: ++ for entry in reversed(entries): ++ if self._owed_replies and self._owed_replies[-1] is entry: ++ self._owed_replies.pop() ++ raise ++ ++ async def _write_command(self, command: str, censor_after: int | None = None) -> None: ++ if "\r" in command or "\n" in command: ++ raise errors.InvalidCommand("Command must not contain CR/LF") ++ if censor_after: ++ # Censor the user's command ++ raw = command[:censor_after] ++ stars = "*" * len(command[censor_after:]) ++ logger.debug("%s%s", raw, stars) ++ else: ++ logger.debug(command) ++ message = command + END_OF_LINE ++ await self.stream.write(message.encode(encoding=self.encoding)) ++ ++ async def _collect_reply(self) -> tuple[Code, list[str]]: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Read the reply of the oldest owed exchange. The exchange leaves the ++ ledger only once its reply has actually been read, so a cancelled ++ reader leaves the reply owed rather than lost. ++ """ ++ _, wait_codes, _ = self._owed_replies[0] ++ code, info = await self.parse_response() ++ while any(map(code.matches, wait_codes)): + code, info = await self.parse_response() +- while any(map(code.matches, wait_codes)): +- code, info = await self.parse_response() +- if expected_codes: +- self.check_codes(expected_codes, code, info) +- return code, info +- return None ++ self._owed_replies.popleft() ++ return code, info ++ ++ async def _drain_owed_replies(self, until: object | None = None) -> None: ++ while self._owed_replies and self._owed_replies[0] is not until: ++ await self._collect_reply() ++ ++ async def _settle_transfer(self) -> None: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Abort a transfer that is still outstanding on the control connection ++ (a stream that was neither finished nor aborted) before a new command ++ is written; the caller holds the control lock. ++ """ ++ transfer = self._transfer_stream ++ if transfer is None: ++ return ++ if transfer.final_reply_consumed: ++ self._transfer_stream = None ++ return ++ await self._abort_transfer(transfer, wait=True, locked=True) ++ ++ async def _abort_transfer( ++ self, ++ transfer: DataConnectionThrottleStreamIO | None, ++ *, ++ wait: bool, ++ locked: bool = False, ++ ) -> None: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Send `ABOR` and, with `wait`, read its reply. When a transfer is ++ outstanding its final reply comes first, whatever its code; it is ++ registered as owed together with the abort reply before `ABOR` is ++ written, so both are still read later if this coroutine is cancelled ++ or `wait` is false. With `wait=False`, or while `finish()` is already ++ reading it, the transfer's final reply stays with the stream and ++ `finish()` checks it as usual. `ABOR` is written without the control ++ lock, so it can interrupt a `finish()` that is waiting on the server; ++ `locked` says the caller already holds the control lock for reading. ++ """ ++ token = object() ++ entries: list[tuple[tuple[Code, ...], tuple[Code, ...], object | None]] = [] ++ claimed = False ++ if transfer is not None: ++ registered = any(owed[2] is transfer for owed in self._owed_replies) ++ if not transfer.final_reply_consumed and not registered: ++ if wait: ++ transfer.final_reply_consumed = True ++ claimed = True ++ entries.append(((), wrap_into_codes(("1xx",)), None if wait else transfer)) ++ if self._transfer_stream is transfer: ++ self._transfer_stream = None ++ abort_codes = wrap_into_codes(("225", "226")) ++ entries.append((abort_codes, wrap_into_codes(("1xx", "426")), token)) ++ try: ++ await self._submit("ABOR", entries) ++ except BaseException: ++ if transfer is not None: ++ if claimed: ++ transfer.final_reply_consumed = False ++ self._transfer_stream = transfer ++ raise ++ if not wait: ++ return ++ try: ++ if locked: ++ await self._read_owed(token, abort_codes) ++ else: ++ async with self._control_lock(): ++ await self._read_owed(token, abort_codes) ++ finally: ++ if transfer is not None: ++ transfer.close() ++ ++ async def _read_owed(self, owner: object, expected_codes: tuple[Code, ...]) -> tuple[Code, list[str]]: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Read everything owed before `owner`'s reply, then that reply; the ++ caller holds the control lock. ++ """ ++ entry = next(owed for owed in self._owed_replies if owed[2] is owner) ++ await self._drain_owed_replies(until=entry) ++ code, info = await self._collect_reply() ++ self.check_codes(expected_codes, code, info) ++ return code, info ++ ++ async def abort(self, *, wait: bool = True) -> None: ++ """ ++ :py:func:`asyncio.coroutine` ++ ++ Request data transfer abort. ++ ++ If a transfer is in progress, its final reply (usually 426, or the ++ transfer's own completion reply if it finished first) is read before ++ the abort reply (225 or 226), so the control connection stays in sync. ++ With `wait=False` the abort reply is read by the next command instead. ++ `abort()` may be called from another task while the stream is being ++ finished; the calls serialize on the control connection. ++ ++ :param wait: wait for abort response [426]→226 if `True` ++ :type wait: :py:class:`bool` ++ """ ++ await self._abort_transfer(self._transfer_stream, wait=wait) + + @staticmethod + def parse_epsv_response(s: str) -> tuple[None, int]: +@@ -970,6 +1197,21 @@ class Client(BaseClient): + ) + return cls + ++ async def aclose(cls) -> None: ++ """ ++ Stop listing early: abort the listing still in progress so the ++ control connection is ready for the next command. ++ """ ++ stream, cls.stream = cls.stream, None ++ if hasattr(cls, "directories"): ++ cls.directories.clear() ++ if stream is None: ++ return ++ if self._transfer_stream is stream and not stream.final_reply_consumed: ++ await self.abort() ++ else: ++ stream.close() ++ + async def __anext__(cls) -> PathWithInfo: + if cls.stream is None: + cls.stream = await cls._new_stream(path) +@@ -1405,7 +1647,7 @@ class Client(BaseClient): + reader, writer = await self.get_passive_connection(conn_type) + if offset: + await self.command("REST " + str(offset), "350") +- await self.command(command, expected_codes, wait_codes, censor_after) ++ response = await self.command(command, expected_codes, wait_codes, censor_after) + stream = DataConnectionThrottleStreamIO( + self, + reader, +@@ -1413,22 +1655,11 @@ class Client(BaseClient): + throttles={"_": self.throttle}, + timeout=self.socket_timeout, + ) ++ if command and (response is None or response[0].matches("1xx")): ++ # the transfer's final reply is still to come on the control connection ++ self._transfer_stream = stream + return stream + +- async def abort(self, *, wait: bool = True) -> None: +- """ +- :py:func:`asyncio.coroutine` +- +- Request data transfer abort. +- +- :param wait: wait for abort response [426]→226 if `True` +- :type wait: :py:class:`bool` +- """ +- if wait: +- await self.command("ABOR", "226", "426") +- else: +- await self.command("ABOR") +- + @classmethod + @contextlib.asynccontextmanager + async def context( +diff --git a/src/aioftp/server.py b/src/aioftp/server.py +index 076e702..defcd66 100644 +--- a/src/aioftp/server.py ++++ b/src/aioftp/server.py +@@ -584,8 +584,21 @@ def worker( + try: + await f(cls, connection, rest) + except asyncio.CancelledError: ++ # an aborted transfer gives up its data path: whatever connects for it ++ # later must not be picked up by the next transfer ++ if connection.future.data_connection.done(): ++ connection.data_connection.close() ++ del connection.data_connection ++ cls._release_passive_server(connection) + connection.response("426", "transfer aborted") +- connection.response("226", "abort successful") ++ if asyncio.current_task() in connection.aborting_workers: ++ connection.response("226", "abort successful") ++ except ConnectionError: ++ if connection.future.data_connection.done(): ++ connection.data_connection.close() ++ del connection.data_connection ++ cls._release_passive_server(connection) ++ connection.response("426", "Connection closed; transfer aborted") + + return wrapper # type: ignore[return-value] + +@@ -902,6 +915,31 @@ class Server: + await write(code + "-" + line) + await write(code + " " + tail) + ++ @staticmethod ++ def _strip_telnet(b: bytes) -> bytes: ++ out = bytearray() ++ i = 0 ++ n = len(b) ++ while i < n: ++ if b[i] == 0xFF: ++ if i + 1 < n: ++ cmd = b[i + 1] ++ if cmd == 0xFF: ++ out.append(0xFF) ++ i += 2 ++ continue ++ elif 0xF0 <= cmd <= 0xFA: ++ i += 2 ++ continue ++ elif 0xFB <= cmd <= 0xFE: ++ i += 3 ++ continue ++ i += 1 ++ continue ++ out.append(b[i]) ++ i += 1 ++ return bytes(out) ++ + async def parse_command(self, stream: StreamIO, censor_commands: tuple[str] = ("pass",)) -> tuple[str, str]: + """ + :py:func:`asyncio.coroutine` +@@ -920,7 +958,11 @@ class Server: + line = await stream.readline() + if not line: + raise ConnectionResetError +- s = line.decode(encoding=self.encoding).rstrip() ++ line = self._strip_telnet(line) ++ try: ++ s = line.decode(encoding=self.encoding).rstrip() ++ except UnicodeDecodeError: ++ return "undecodable", "" + cmd, _, rest = s.partition(" ") + + if cmd.lower() in censor_commands: +@@ -965,6 +1007,14 @@ class Server: + host, port, *_ = writer.transport.get_extra_info("peername", ("", "")) + current_server_host, *_ = writer.transport.get_extra_info("sockname") + logger.info("new connection from %s:%s", host, port) ++ ++ sock = writer.transport.get_extra_info("socket") ++ if sock is not None: ++ try: ++ sock.setsockopt(socket.SOL_SOCKET, socket.SO_OOBINLINE, 1) ++ except Exception: ++ pass ++ + key = stream = ThrottleStreamIO( + reader, + writer, +@@ -990,6 +1040,8 @@ class Server: + path_io_factory=self.path_io_factory, + path_timeout=self.path_timeout, + extra_workers=set(), ++ aborting_workers=set(), ++ transferring_workers=set(), + response=lambda *args: response_queue.put_nowait(args), + acquired=False, + restart_offset=0, +@@ -999,46 +1051,119 @@ class Server: + timeout=self.path_timeout, + connection=connection, + ) +- pending = { +- asyncio.create_task(self.greeting(connection, "")), +- asyncio.create_task(self.response_writer(stream, response_queue)), +- asyncio.create_task(self.parse_command(stream)), +- } + self.connections[key] = connection ++ ++ response_writer_task = asyncio.create_task(self.response_writer(stream, response_queue)) ++ pending_cleanup = {response_writer_task} ++ command_queue: asyncio.Queue[tuple[str, str]] = asyncio.Queue() ++ ++ async def command_reader() -> None: ++ while True: ++ try: ++ res = await self.parse_command(stream) ++ except ConnectionResetError: ++ await command_queue.put(("eof", "")) ++ return ++ except Exception as exc: ++ await command_queue.put(("error", str(exc))) ++ return ++ await command_queue.put(res) ++ + try: ++ greeting_ok = await self.greeting(connection, "") ++ if not greeting_ok: ++ await response_queue.join() ++ return ++ ++ reader_task = asyncio.create_task(command_reader()) ++ pending_cleanup.add(reader_task) ++ queue_get_task = asyncio.create_task(command_queue.get()) ++ pending_cleanup.add(queue_get_task) ++ + while True: +- done, pending = await asyncio.wait( +- pending | connection.extra_workers, ++ wait_set = {queue_get_task, reader_task, response_writer_task} | connection.extra_workers ++ done, _ = await asyncio.wait( ++ wait_set, + return_when=asyncio.FIRST_COMPLETED, + ) +- connection.extra_workers -= done +- for task in done: ++ ++ for worker_task in done & connection.extra_workers: ++ connection.extra_workers.remove(worker_task) + try: +- result = task.result() ++ worker_task.result() + except errors.PathIOError: + connection.response("451", "file system error") ++ except asyncio.CancelledError: ++ pass ++ ++ if response_writer_task in done: ++ response_writer_task.result() ++ return ++ ++ if reader_task in done and not reader_task.cancelled(): ++ exc = reader_task.exception() ++ if exc is not None: ++ raise exc ++ ++ if queue_get_task in done: ++ cmd, rest = queue_get_task.result() ++ pending_cleanup.remove(queue_get_task) ++ queue_get_task = asyncio.create_task(command_queue.get()) ++ pending_cleanup.add(queue_get_task) ++ ++ if cmd == "eof": ++ return ++ if cmd == "error": ++ return ++ ++ if cmd == "undecodable": ++ connection.response("500", "syntax error, command unrecognized") + continue +- # this is "command" result +- if isinstance(result, bool): +- if not result: +- await response_queue.join() +- return +- # this is parse_command result +- elif isinstance(result, tuple): +- pending.add( +- asyncio.create_task(self.parse_command(stream)), +- ) +- cmd, rest = result +- f = self.commands_mapping.get(cmd) +- if f is not None: +- pending.add( +- asyncio.create_task(f(connection, rest)), # type: ignore[arg-type] ++ ++ f = self.commands_mapping.get(cmd) ++ if f is None: ++ connection.response("502", f"{cmd!r} not implemented") ++ if cmd not in ("retr", "stor", "appe", "rest"): ++ connection.restart_offset = 0 ++ continue ++ ++ cmd_task = asyncio.create_task(f(connection, rest)) ++ pending_cleanup.add(cmd_task) ++ try: ++ while not cmd_task.done(): ++ wait_cmd_set = {cmd_task, response_writer_task} | connection.extra_workers ++ cmd_done, _ = await asyncio.wait( ++ wait_cmd_set, ++ return_when=asyncio.FIRST_COMPLETED, + ) +- if cmd not in ("retr", "stor", "appe"): +- connection.restart_offset = 0 +- else: +- message = f"{cmd!r} not implemented" +- connection.response("502", message) ++ for worker_task in cmd_done & connection.extra_workers: ++ connection.extra_workers.remove(worker_task) ++ try: ++ worker_task.result() ++ except errors.PathIOError: ++ connection.response("451", "file system error") ++ except asyncio.CancelledError: ++ pass ++ ++ if response_writer_task in cmd_done: ++ response_writer_task.result() ++ return ++ ++ result = cmd_task.result() ++ except errors.PathIOError: ++ connection.response("451", "file system error") ++ result = True ++ finally: ++ pending_cleanup.discard(cmd_task) ++ ++ if cmd not in ("retr", "stor", "appe", "rest"): ++ # a transfer's worker still has to read the REST offset ++ connection.restart_offset = 0 ++ ++ if isinstance(result, bool) and not result: ++ await response_queue.join() ++ return ++ + except asyncio.CancelledError: + raise + except Exception: +@@ -1047,7 +1172,7 @@ class Server: + logger.info("closing connection from %s:%s", host, port) + tasks_to_wait = [] + if not asyncio.get_running_loop().is_closed(): +- for task in pending | connection.extra_workers: ++ for task in pending_cleanup | connection.extra_workers: + task.cancel() + tasks_to_wait.append(task) + if connection.future.passive_server.done(): +@@ -1065,7 +1190,7 @@ class Server: + self.user_manager.notify_logout(connection.user), + ) + tasks_to_wait.append(task) +- self.connections.pop(key) ++ self.connections.pop(key, None) + if tasks_to_wait: + await asyncio.wait(tasks_to_wait) + +@@ -1162,6 +1287,22 @@ class Server: + return True + + async def quit(self, connection: Connection, rest: str | PurePosixPath) -> bool: ++ # a transfer that owns its data connection finishes and replies first; one still waiting ++ # for its data connection is aborted with 426 ++ waiting = [] ++ open_workers = [] ++ for w in list(connection.extra_workers): ++ if not w.done(): ++ if w in connection.transferring_workers: ++ open_workers.append(w) ++ else: ++ waiting.append(w) ++ for w in waiting: ++ w.cancel() ++ if waiting: ++ await asyncio.wait(waiting) ++ if open_workers: ++ await asyncio.wait(open_workers) + connection.response("221", "bye") + return False + +@@ -1245,16 +1386,17 @@ class Server: + @PathConditions(PathConditions.path_must_exists) + @PathPermissions(PathPermissions.readable) + async def mlsd(self, connection: Connection, rest: str | PurePosixPath) -> bool: ++ @worker + @ConnectionConditions( + ConnectionConditions.data_connection_made, + wait=True, + fail_code="425", + fail_info="Can't open data connection", + ) +- @worker + async def mlsd_worker(self: "Server", connection: Connection, rest: str | PurePosixPath) -> bool: + stream = connection.data_connection + del connection.data_connection ++ connection.transferring_workers.add(asyncio.current_task()) + async with stream: + async for path in connection.path_io.list(real_path): + s = await self.build_mlsx_string(connection, path) +@@ -1304,16 +1446,17 @@ class Server: + @PathConditions(PathConditions.path_must_exists) + @PathPermissions(PathPermissions.readable) + async def list(self, connection: Connection, rest: str | PurePosixPath) -> bool: ++ @worker + @ConnectionConditions( + ConnectionConditions.data_connection_made, + wait=True, + fail_code="425", + fail_info="Can't open data connection", + ) +- @worker + async def list_worker(self: "Server", connection: Connection, rest: str | PurePosixPath) -> bool: + stream = connection.data_connection + del connection.data_connection ++ connection.transferring_workers.add(asyncio.current_task()) + async with stream: + async for path in connection.path_io.list(real_path): + if not (await connection.path_io.exists(path)): +@@ -1382,16 +1525,17 @@ class Server: + ) + @PathPermissions(PathPermissions.writable) + async def stor(self, connection: Connection, rest: str | PurePosixPath, mode: str = "wb") -> bool: ++ @worker + @ConnectionConditions( + ConnectionConditions.data_connection_made, + wait=True, + fail_code="425", + fail_info="Can't open data connection", + ) +- @worker + async def stor_worker(self: "Server", connection: Connection, rest: str | PurePosixPath) -> bool: + stream = connection.data_connection + del connection.data_connection ++ connection.transferring_workers.add(asyncio.current_task()) + if connection.restart_offset: + file_mode = "r+b" + else: +@@ -1426,16 +1570,17 @@ class Server: + ) + @PathPermissions(PathPermissions.readable) + async def retr(self, connection: Connection, rest: str | PurePosixPath) -> bool: ++ @worker + @ConnectionConditions( + ConnectionConditions.data_connection_made, + wait=True, + fail_code="425", + fail_info="Can't open data connection", + ) +- @worker + async def retr_worker(self: "Server", connection: Connection, rest: str | PurePosixPath) -> bool: + stream = connection.data_connection + del connection.data_connection ++ connection.transferring_workers.add(asyncio.current_task()) + file_in = connection.path_io.open(real_path, mode="rb") + async with file_in, stream: + if connection.restart_offset: +@@ -1514,10 +1659,18 @@ class Server: + ) + return passive_server + ++ def _release_passive_server(self, connection: Connection) -> None: ++ if not connection.future.passive_server.done(): ++ return ++ connection.passive_server.close() ++ if self.available_data_ports is not None: ++ self.available_data_ports.put_nowait((0, connection.passive_server_port)) ++ del connection.passive_server ++ + @ConnectionConditions(ConnectionConditions.login_required) + async def pasv(self, connection: Connection, rest: str | PurePosixPath) -> bool: + async def handler(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: +- if connection.future.data_connection.done(): ++ if connection.future.data_connection.done() or not connection.future.passive_server.done(): + writer.close() + else: + connection.data_connection = ThrottleStreamIO( +@@ -1562,7 +1715,7 @@ class Server: + @ConnectionConditions(ConnectionConditions.login_required) + async def epsv(self, connection: Connection, rest: str | PurePosixPath) -> bool: + async def handler(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: +- if connection.future.data_connection.done(): ++ if connection.future.data_connection.done() or not connection.future.passive_server.done(): + writer.close() + else: + connection.data_connection = ThrottleStreamIO( +@@ -1601,11 +1754,19 @@ class Server: + + @ConnectionConditions(ConnectionConditions.login_required) + async def abor(self, connection: Connection, rest: str | PurePosixPath) -> bool: +- if connection.extra_workers: +- for worker in connection.extra_workers: ++ connection.aborting_workers.intersection_update(connection.extra_workers) ++ active = [worker for worker in connection.extra_workers if not worker.done()] ++ fresh = [worker for worker in active if worker not in connection.aborting_workers] ++ if fresh: ++ # the cancelled workers answer 426 then 226 themselves ++ for worker in fresh: ++ connection.aborting_workers.add(worker) + worker.cancel() +- else: +- connection.response("226", "nothing to abort") ++ return True ++ if active: ++ # a repeated ABOR is answered after the abort it repeats, never before ++ await asyncio.wait(active) ++ connection.response("226", "nothing to abort") + return True + + async def appe(self, connection: Connection, rest: str | PurePosixPath) -> bool: diff --git a/harbor/sources/aioftp-v11/grading/__init__.py b/harbor/sources/aioftp-v11/grading/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..cd5bdf9b019264af1d9e29d3059f120424043756 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/__init__.py @@ -0,0 +1,18 @@ +"""Grading modules for aioftp_stream_abort_desynchronization. + +Submodules are exposed lazily (PEP 562). Importing this package must never pull +in the grader chain, so that a missing or corrupted grader submodule surfaces as +a fail-closed result from ``env.run_grading`` instead of an import-time crash +that leaves the container with no JSON output. +""" + +__all__ = ["GradingRunner"] + + +def __getattr__(name: str): + """Import submodule attributes on first access, not at package import.""" + if name == "GradingRunner": + from .runner import GradingRunner + + return GradingRunner + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/harbor/sources/aioftp-v11/grading/adversarial-manifest.json b/harbor/sources/aioftp-v11/grading/adversarial-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..5a47d4ee9cf4484e1f006541fa5a34af41f865ab --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/adversarial-manifest.json @@ -0,0 +1,2082 @@ +{ + "schema_version": 7, + "task_id": "aioftp_stream_abort_desynchronization", + "gold_diff_sha256": "90b71765ae5d945b112d042be7044a1f152625dcdb70a14450d0ef32ec1036d3", + "comment_syntax": [ + "#" + ], + "native_commands": { + "test": { + "argv": [ + "/opt/aioftp-venv/bin/python", + "-I", + "-m", + "pytest", + "-p", + "no:cacheprovider", + "-o", + "pythonpath=src" + ], + "timeout_seconds": 600, + "measured_runtime_seconds": { + "gold": 19.733, + "base": 19.029 + }, + "may_cap": true, + "requires": [ + "repo_python" + ], + "description": "The repository's whole pytest suite from the repository root with its own [tool.pytest.ini_options] (792 node IDs: -x, --durations 10, -p no:anyio, --cov, --import-mode=importlib), invoked directly through the repository interpreter. The grader runs the same argv on a tree whose tests/ and pyproject.toml are restored from grading/baseline; a failure lands on the 0.30 regression ceiling. Where IPv6 loopback is unavailable (the HUD sandbox), the image's aioftp_ipv6_loopback pytest plugin skips exactly the 212 ::1 node IDs and the grader requires that skip count; where ::1 binds, it requires zero skips." + } + }, + "runtime_requirements": { + "executables": [ + { + "id": "repo_python", + "executable": "/opt/aioftp-venv/bin/python", + "role": "interpreter", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "/opt/aioftp-venv/bin/python", + "--version" + ], + "regex": "Python (\\d+\\.\\d+\\.\\d+)" + }, + "version_constraint": { + "major": 3, + "minimum": "3.11" + }, + "required_by": [ + "native_command:test", + "grader:grading/runner.py", + "grader:grading/regression.py", + "agent_prompt" + ], + "offline_assets": [ + "/opt/aioftp-venv/lib/python3.11/site-packages/aioftp-0.28.3.dist-info/METADATA", + "/opt/aioftp-venv/lib/python3.11/site-packages/__editable__.aioftp-0.28.3.pth", + "/opt/aioftp-venv/lib/python3.11/site-packages/pytest_asyncio", + "/opt/aioftp-venv/lib/python3.11/site-packages/pytest_cov", + "/opt/aioftp-venv/lib/python3.11/site-packages/siosocks", + "/opt/aioftp-venv/lib/python3.11/site-packages/trustme", + "/opt/aioftp-venv/lib/python3.11/site-packages/async_timeout" + ], + "description": "CPython 3.11 with the repository's dev extra; spawned by the grader through AIOFTP_REPO_PYTHON, so static discovery cannot see it." + }, + { + "id": "repo_pytest", + "executable": "/opt/aioftp-venv/bin/pytest", + "role": "quality", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "/opt/aioftp-venv/bin/pytest", + "--version" + ], + "regex": "pytest (\\d+\\.\\d+\\.\\d+)" + }, + "required_by": [ + "agent_prompt" + ], + "description": "The `pytest` the prompt tells the agent to run from the repository root (first on the agent PATH)." + }, + { + "id": "git", + "executable": "git", + "role": "system", + "discovery": "static", + "version_probe": { + "argv": [ + "git", + "--version" + ], + "regex": "git version (\\d+\\.\\d+\\.\\d+)" + }, + "required_by": [ + "grader:env.py", + "grader:tests/test_env.py" + ], + "description": "Reference-tree materialization and workspace snapshot in env.py." + }, + { + "id": "setpriv", + "executable": "setpriv", + "role": "system", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "setpriv", + "--version" + ], + "regex": "(\\d+\\.\\d+(?:\\.\\d+)?)" + }, + "required_by": [ + "grader:env.py" + ], + "description": "UID wall: UidWallWorkspace.shell_argv prefixes the agent shell with setpriv." + }, + { + "id": "hud", + "executable": "hud", + "role": "system", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "hud", + "--version" + ], + "regex": "(\\d+\\.\\d+\\.\\d+)" + }, + "required_by": [ + "grader:env.py" + ], + "description": "The HUD server the image CMD runs (`hud serve env:env`)." + } + ], + "services": [] + }, + "runtime_build_inputs": { + "base_images": [ + { + "stage": "runtime-contract", + "reference": "ubuntu:24.04@sha256:224a1869083a311ef3f13648a154ba79832fbef6364d31493642ca03082da254" + }, + { + "stage": "runtime-contract", + "reference": "ghcr.io/astral-sh/uv:0.12.3@sha256:2d890623d310b57771ce840f0da5eed5fc6d657da05ffaa45d82797b53fa3abc" + } + ], + "package_repositories": [ + { + "manager": "apt", + "snapshot": "20260915T000000Z" + }, + { + "manager": "pip", + "snapshot": "runtime/aioftp-dev-requirements.txt (uv pip compile --generate-hashes --exclude-newer 2026-09-15T00:00:00Z, installed --require-hashes) and uv.lock (uv sync --frozen)" + } + ], + "artifacts": [ + { + "id": "cpython_3_11_15", + "version": "3.11.15+20260807", + "source": "https://releases.astral.sh/github/python-build-standalone/releases/download/20260807/cpython-3.11.15%2B20260807-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", + "sha256": "69dfac9d0f15a0b9281a38486f212cbf76421609228c184dc0d34a0533d57ba6" + } + ] + }, + "deployment_context": { + "required_files": [ + ".dockerignore", + ".gitignore", + "Dockerfile.hud", + "env.py", + "gold.diff", + "grading/__init__.py", + "grading/adversarial-manifest.json", + "grading/baseline/pyproject.toml", + "grading/baseline/tests/conftest.py", + "grading/baseline/tests/test_abort.py", + "grading/baseline/tests/test_client_side_socks.py", + "grading/baseline/tests/test_connection.py", + "grading/baseline/tests/test_corner_cases.py", + "grading/baseline/tests/test_current_directory.py", + "grading/baseline/tests/test_directory_actions.py", + "grading/baseline/tests/test_extra.py", + "grading/baseline/tests/test_file.py", + "grading/baseline/tests/test_list_fallback.py", + "grading/baseline/tests/test_login.py", + "grading/baseline/tests/test_maximum_connections.py", + "grading/baseline/tests/test_passive.py", + "grading/baseline/tests/test_pathio.py", + "grading/baseline/tests/test_permissions.py", + "grading/baseline/tests/test_restart.py", + "grading/baseline/tests/test_simple_functions.py", + "grading/baseline/tests/test_throttle.py", + "grading/baseline/tests/test_tls.py", + "grading/baseline/tests/test_user.py", + "grading/graders.py", + "grading/integrity.py", + "grading/probes/client_probe.py", + "grading/probes/hudprobe_common.py", + "grading/probes/hudprobe_fixture.py", + "grading/probes/server_probe.py", + "grading/regression.py", + "grading/runner.py", + "pyproject.toml", + "runtime/aioftp-dev-requirements.txt", + "task/__init__.py", + "task/prompt.md", + "task/rubric.md", + "tasks.py", + "uv.lock" + ], + "forbidden_files": [ + "artifact-manifest.json", + "scaffold-manifest.json" + ], + "forbidden_directories": [ + "grading/adversarial", + "tests", + ".venv" + ] + }, + "safety_gate_mutants": [ + { + "id": "g1_abort_takes_completion_as_reply", + "target_gate_id": "G1_stale_reply_after_abort", + "target_criteria": [ + "client_abort_after_completed_transfer" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "abort", + "ABOR", + "225", + "226", + "426", + "1xx", + "final reply", + "_transfer_stream" + ], + "patch_path": "grading/adversarial/patches/g1_abort_takes_completion_as_reply.diff", + "applies_to": "gold", + "description": "Gold whose abort() reads the transfer's final reply first and, when it is a 2xx, takes it as the ABOR reply itself (dropping the ABOR reply from the owed ledger); the error exit keeps an independent drain-any-code path. The cue tokens stay in code and comments. After a completed transfer the 226 Transfer complete is taken as the ABOR reply and the successor PWD reads the stale ABOR reply: client_abort_after_completed_transfer is lost, and client_abort_idle_rejected with it (the 500 ABOR reply after a completed transfer is never read, so abort() does not raise). Raw 0.9120, capped at 0.60.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1_stale_reply_after_abort": false, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.8786, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "g2_error_exit_drain_expects_426", + "target_gate_id": "G2_stale_reply_after_error_exit", + "target_criteria": [ + "client_error_exit_after_completed_transfer" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "__aexit__", + "abort", + "ABOR", + "226", + "225", + "Transfer complete", + "_transfer_stream" + ], + "patch_path": "grading/adversarial/patches/g2_error_exit_drain_expects_426.diff", + "applies_to": "gold", + "description": "Gold whose __aexit__ exception branch closes the data connection and finishes expecting 426; the cue tokens stay in code and comments. After a completed transfer the drain meets 226 Transfer complete and raises, replacing the caller's exception: only client_error_exit_after_completed_transfer is lost, raw 0.9932, capped at 0.60.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": false, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.9393, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "g3_listener_kept_after_abort", + "target_gate_id": "G3_stale_data_connection_after_abort", + "target_criteria": [ + "server_listener_release_after_abort" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "passive", + "data_ports", + "_release_passive_server", + "426", + "226", + "abort" + ], + "patch_path": "grading/adversarial/patches/g3_listener_kept_after_abort.diff", + "applies_to": "gold", + "description": "Gold whose cancelled transfer worker keeps the passive listener (and its data_ports entry) for the next transfer instead of releasing it; the release helper and the cue tokens stay in code and comments. A data connection arriving late for the aborted transfer is still accepted and kept: only server_listener_release_after_abort is lost, raw 0.9188, capped at 0.60.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": false, + "G4_stale_reply_after_cancelled_finish": true + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.9835, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "g4_abort_settles_cancelled_finish_first", + "target_gate_id": "G4_stale_reply_after_cancelled_finish", + "target_criteria": [ + "client_abort_after_cancelled_finish" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "abort", + "finish", + "ABOR", + "_owed_replies", + "_drain_owed_replies", + "cancel" + ], + "patch_path": "grading/adversarial/patches/g4_abort_settles_cancelled_finish_first.diff", + "applies_to": "gold", + "description": "Gold whose abort(), when a cancelled finish() left a transfer's final reply owed and nothing else holds the control lock, first reads that owed reply and only then writes ABOR. Against a server that sends the transfer's final reply only once ABOR arrives, abort() blocks permanently (the mechanism of 9065889c candidates c397 and c7e9). CASE-12 still passes because a running finish() holds the lock. Only client_abort_after_cancelled_finish is lost: raw 0.8000, capped at 0.60 by G4.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": false + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.9737, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "server_listener_release_after_abort", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + } + ], + "keyword_stuffing_fixtures": [ + { + "id": "keyword_stuffing_all_cues", + "patch_path": "grading/adversarial/patches/keyword_stuffing_all_cues.diff", + "target_files": [ + "src/aioftp/client.py", + "src/aioftp/server.py" + ], + "applies_to": "base", + "description": "Base plus comments carrying every Negative-controls cue token of the fifteen criteria next to Client.abort and Server.abor, the two files the probes import from the graded copy. No behaviour changes.", + "expected": { + "final_score": 0.0, + "raw_score": 0.0, + "build_failed": false + } + } + ], + "quality_bypass_fixtures": [ + { + "id": "quality_bypass_stub_with_weakened_settings", + "patch_path": "grading/adversarial/patches/quality_bypass_stub_with_weakened_settings.diff", + "applies_to": "base", + "description": "The stub/echo control plus a pyproject.toml addopts entry deselecting tests/test_abort.py and a tests/conftest.py collection hook that skips every abort test. The grader restores the pristine settings, so tests/test_abort.py fails, the 0.30 regression ceiling fires, and the diagnostic names addopts (weakened) and tests/conftest.py (changed).", + "expected": { + "build_failed": true, + "raw_score": 0.0, + "final_score": 0.0, + "final_score_cap": 0.3 + } + } + ], + "broken_regression_fixtures": [ + { + "id": "broken_regression_no_wait_reads_reply", + "patch_path": "grading/adversarial/patches/broken_regression_no_wait_reads_reply.diff", + "applies_to": "gold", + "description": "Gold with abort(wait=False) changed to read a reply, which breaks tests/test_abort.py::test_abort_retr_no_wait. Every probe still passes: raw 1.0000, final 0.30.", + "expected": { + "build_failed": true, + "native_checks_pass": false, + "safety_gates_failed": false, + "raw_score": 1.0, + "final_score": 0.3, + "final_score_cap": 0.3 + } + } + ], + "no_op_fixtures": [ + { + "id": "no_op_comment_in_client", + "patch_path": "grading/adversarial/patches/no_op_comment_in_client.diff", + "applies_to": "base", + "description": "A comment-only edit to src/aioftp/client.py, the client module every client probe imports.", + "expected": { + "final_score": 0.0, + "raw_score": 0.0, + "build_failed": false + } + } + ], + "lazy_fix_fixtures": [ + { + "id": "lazy_fix_decorators_and_225", + "patch_path": "grading/adversarial/patches/lazy_fix_decorators_and_225.diff", + "applies_to": "base", + "description": "Own patch against base: the server's @worker decorator moved outermost on the four transfer handlers, and 225 added to abort()'s accepted codes. Nothing else. Approved Solution-level profile: server_early_abort_session and client_abort_idle_225 1.0, every other criterion 0.0 (its base abor handler cancels the closing worker again on a repeated ABOR, so CASE-15 is lost too); raw 0.0826, final 0.0826, inside [0.02, 0.30]. The gated children score 0, so all four gates are recorded as fired, but their shared 0.60 ceiling does not bind (final equals raw): the score is partial credit alone.", + "expected": { + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 0.0, + "client_abort_after_completed_transfer": 0.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 0.0, + "client_error_exit_mid_transfer": 0.0, + "client_error_exit_after_completed_transfer": 0.0, + "client_abort_idle_rejected": 0.0, + "client_upload_stream_abort": 0.0, + "client_abort_concurrent": 0.0, + "client_cancelled_abort_or_finish": 0.0, + "client_abort_during_finish": 0.0, + "client_abandoned_listing_resync": 0.0, + "server_listener_release_after_abort": 0.0, + "server_repeated_abor_order": 0.0, + "server_pipelined_command_order": 0.0, + "server_real_client_abor": 0.0, + "server_quit_during_transfer": 0.0, + "server_data_connection_loss": 0.0, + "server_undecodable_command_syntax": 0.0, + "client_abort_after_cancelled_finish": 0.0, + "server_pipelined_abort_open_data": 0.0, + "server_pipelined_quit_open_data": 0.0, + "client_nowait_abort_owed_replies": 0.0, + "client_command_during_abort": 0.0 + }, + "final_score_min": 0.02, + "final_score_max": 0.3, + "raw_score": 0.0266, + "final_score": 0.0266, + "build_failed": false, + "safety_gates_failed": true + } + } + ], + "competent_partial_fixtures": [ + { + "id": "competent_partial_naive_abort", + "patch_path": "grading/adversarial/patches/competent_partial_naive_abort.diff", + "applies_to": "base", + "description": "The semantic viability screen's shortest_competent_solution, written from the prompt: accept 225, swap the server decorators, make finish() return after abort(), and abort on an exception exit (about twenty lines). Band = the `Projected raw mean: 0.476` of the fifteen-case refit in intake/difficulty-rationale.md, +/- 0.15. Measured: it earns CASE-01, 02, 04, 06, 09 and CASE-21 (its abort() writes ABOR at once and finish() returns after abort(), so the cancelled-finish scenario passes): raw 0.2908, inside the band.", + "expected": { + "final_score_min": 0.068, + "final_score_max": 0.432 + } + } + ], + "stub_echo_fixtures": [ + { + "id": "stub_echo_constant_entrypoints", + "patch_path": "grading/adversarial/patches/stub_echo_constant_entrypoints.diff", + "applies_to": "base", + "description": "Client.abort() returns None without I/O, finish() and __aexit__ only close, and Server.abor returns True without replying.", + "expected": { + "final_score": 0.0, + "raw_score": 0.0, + "all_behavioural_children_zero": true + } + } + ], + "alternate_correct_fixtures": [ + { + "id": "alternate_a_counter_and_cancel_guard", + "patch_path": "grading/adversarial/patches/alternate_a_counter_and_cancel_guard.diff", + "applies_to": "base", + "independence": "structural", + "purpose": "Independent implementation A. Every exchange takes an integer turn number in wire order; replies are read in turn order under a reader lock and a reply read on behalf of a cancelled or later owner is kept for it (_early_replies). Owed transfer replies are a per-client integer count (_pending_final_replies) plus a turn reserved by abort(wait=False); the owed reply is read through a private Client method (_drain_outstanding_reply) and abort stays on Client. An abandoned transfer is aborted by the next command and by the lister's aclose(). The server answers an abort that lands before the data connection by catching CancelledError around each transfer worker task (releasing the listener and its port there), refuses late data connections in the passive handlers, and answers a repeated ABOR after the running one through Task.cancelling(). Rules out coupling to gold's stream reference, its Boolean marker, its owed-reply deque, abort's placement on BaseClient, the write/control lock pair, the aborting_workers set and the decorator order.", + "materiality": { + "min_non_comment_changed_lines": 120, + "min_files_touched": 2, + "max_gold_added_line_overlap_ratio": 0.3, + "min_gold_delta_lines": 120, + "forbidden_added_symbols": [ + "_transfer_stream", + "final_reply_consumed", + "_owed_replies", + "aborting_workers" + ] + }, + "independence_axes": { + "callable_surface": { + "rationale": "The owed reply is read by the private Client._drain_outstanding_reply and abort() stays on Client; gold moves abort to BaseClient and reads through _exchange/_read_owed." + }, + "persistence_layout": { + "rationale": "State is BaseClient._pending_final_replies (a counter) plus integer turn counters and an _early_replies map, instead of gold's BaseClient._transfer_stream stream reference and _owed_replies deque of tuples.", + "gold_literals_absent": [ + "_transfer_stream", + "_owed_replies" + ] + }, + "marker_representation": { + "rationale": "Integer turn numbers and a count replace gold's per-stream Boolean final_reply_consumed.", + "gold_literals_absent": [ + "final_reply_consumed" + ] + } + }, + "expected": { + "final_score": 1.0, + "raw_score": 1.0, + "build_failed": false, + "safety_gates_failed": false + } + }, + { + "id": "alternate_b_ledger_module_and_drain_exit", + "patch_path": "grading/adversarial/patches/alternate_b_ledger_module_and_drain_exit.diff", + "applies_to": "base", + "independence": "structural", + "purpose": "Independent implementation B. Reply ownership lives in a new private module (src/aioftp/_replies.py: ReplyLedger with Slip records, tickets, reservation and an ordered collector) used by client.py; finish() is idempotent through a None ticket sentinel; the stream's exception exit, the lister's aclose() and the next command after an abandoned transfer all close the data connection and drain the owed final reply with any code without sending ABOR; the server waits for the data connection inside the abortable worker (dropping the listener and returning its port when cancelled there) and its abor handler counts live workers, answering a repeated ABOR after the running one. Rules out coupling to gold's module composition and to abort() as the error-exit and settle seam.", + "materiality": { + "min_non_comment_changed_lines": 150, + "min_files_touched": 3, + "max_gold_added_line_overlap_ratio": 0.2, + "min_gold_delta_lines": 120, + "forbidden_added_symbols": [ + "_transfer_stream", + "final_reply_consumed", + "_owed_replies", + "aborting_workers" + ] + }, + "independence_axes": { + "module_composition": { + "rationale": "Reply bookkeeping is a new private module src/aioftp/_replies.py imported by client.py; gold keeps everything inside client.py and server.py." + }, + "injection_seam": { + "rationale": "The exception exit, aclose() and the settle of an abandoned transfer close the data connection and drain the owed final reply with any code, without calling abort() or sending ABOR; gold's exit, aclose() and settle call abort()." + } + }, + "expected": { + "final_score": 1.0, + "raw_score": 1.0, + "build_failed": false, + "safety_gates_failed": false + } + } + ], + "malformed_output_fault_injections": [ + { + "id": "delete_client_probe", + "kind": "delete_file", + "target": "grading/probes/client_probe.py", + "expected": { + "is_error": true, + "reward": 0.0 + } + }, + { + "id": "corrupt_probe_fixture", + "kind": "corrupt_file", + "target": "grading/probes/hudprobe_fixture.py", + "expected": { + "is_error": true, + "reward": 0.0 + } + }, + { + "id": "corrupt_scoring_module", + "kind": "corrupt_file", + "target": "grading/graders.py", + "expected": { + "is_error": true, + "reward": 0.0 + } + } + ], + "keyword_stuffing_gold_fixtures": [ + { + "id": "ksg_server_decorators_restored", + "patch_path": "grading/adversarial/patches/ksg_server_decorators_restored.diff", + "applies_to": "gold", + "description": "Gold with ConnectionConditions restored outermost on the four transfer handlers; the listener release and the cue tokens stay in code and comments. A transfer cancelled before its data connection (ABOR or QUIT) is not answered and the session drops: server_early_abort_session, server_listener_release_after_abort, server_pipelined_command_order, server_quit_during_transfer are lost (G3 fires), raw 0.7830, final 0.60.", + "cue_tokens_required_present": [ + "426", + "226", + "transfer aborted", + "abort successful", + "worker" + ], + "expected": { + "target_criteria": [ + "server_early_abort_session", + "server_listener_release_after_abort", + "server_pipelined_command_order", + "server_quit_during_transfer" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 0.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 0.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 0.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 0.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9557, + "final_score": 0.6, + "unaffected_criteria": [ + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_repeated_abor_order", + "server_real_client_abor", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": true, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": false, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_finish_unguarded", + "patch_path": "grading/adversarial/patches/ksg_finish_unguarded.diff", + "applies_to": "gold", + "description": "Gold whose finish() always reads a reply; cue tokens finish, abort, consumed and __aexit__ stay in code and comments. A block exit after abort() waits for a reply that never comes: client_stream_exit_after_abort, client_abort_concurrent, client_cancelled_abort_or_finish and client_abort_after_cancelled_finish are lost (G4 fires), raw 0.5474.", + "cue_tokens_required_present": [ + "finish", + "abort", + "consumed", + "__aexit__" + ], + "expected": { + "target_criteria": [ + "client_stream_exit_after_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_after_cancelled_finish" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 0.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 0.0, + "client_cancelled_abort_or_finish": 0.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 0.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9367, + "final_score": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": true, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": false + } + } + }, + { + "id": "ksg_idle_abort_rejects_225", + "patch_path": "grading/adversarial/patches/ksg_idle_abort_rejects_225.diff", + "applies_to": "gold", + "description": "Gold whose idle abort() accepts only 226; cue tokens 225, 226 and ABOR stay in code and comments. Only client_abort_idle_225 is lost, raw 0.9986.", + "cue_tokens_required_present": [ + "225", + "226", + "ABOR" + ], + "expected": { + "target_criteria": [ + "client_abort_idle_225" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 0.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.99, + "final_score": 0.99, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_failed_transfer_code_checked", + "patch_path": "grading/adversarial/patches/ksg_failed_transfer_code_checked.diff", + "applies_to": "gold", + "description": "Gold whose abort() validates the owed final reply as 2xx or 426 (code-checked tracking); cue tokens abort, ABOR, 451, final reply and any code stay in code and comments. Only client_abort_after_failed_transfer is lost, raw 0.9932.", + "cue_tokens_required_present": [ + "abort", + "ABOR", + "451", + "final reply", + "any code" + ], + "expected": { + "target_criteria": [ + "client_abort_after_failed_transfer" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 0.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9393, + "final_score": 0.9393, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_error_exit_mid_transfer_finish_replaces", + "patch_path": "grading/adversarial/patches/ksg_error_exit_mid_transfer_finish_replaces.diff", + "applies_to": "gold", + "description": "Gold whose __aexit__ exception branch finishes the stream instead of aborting; cue tokens __aexit__, abort, Exception and close stay in code and comments. Mid-transfer the finish meets 426 and its StatusCodeError replaces the caller's exception: client_error_exit_mid_transfer and client_upload_stream_abort are lost, raw 0.9938.", + "cue_tokens_required_present": [ + "__aexit__", + "abort", + "Exception", + "close" + ], + "expected": { + "target_criteria": [ + "client_error_exit_mid_transfer", + "client_upload_stream_abort" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 0.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 0.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.989, + "final_score": 0.989, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_rejected_abor_accepts_5xx", + "patch_path": "grading/adversarial/patches/ksg_rejected_abor_accepts_5xx.diff", + "applies_to": "gold", + "description": "Gold whose abort() accepts a 5xx as the ABOR reply; cue tokens 225, 226, ABOR and 5xx stay in code and comments. abort() does not raise on 500: only client_abort_idle_rejected is lost, raw 0.9188.", + "cue_tokens_required_present": [ + "225", + "226", + "ABOR", + "5xx" + ], + "expected": { + "target_criteria": [ + "client_abort_idle_rejected" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 0.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9393, + "final_score": 0.9393, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_upload_exit_finishes", + "patch_path": "grading/adversarial/patches/ksg_upload_exit_finishes.diff", + "applies_to": "gold", + "description": "Gold whose __aexit__ exception branch finishes an upload stream instead of aborting it (a marker set by upload_stream/append_stream); cue tokens upload_stream, STOR, __aexit__ and abort stay in code and comments. Only client_upload_stream_abort is lost, raw 0.9952.", + "cue_tokens_required_present": [ + "upload_stream", + "STOR", + "__aexit__", + "abort" + ], + "expected": { + "target_criteria": [ + "client_upload_stream_abort" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 0.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.999, + "final_score": 0.999, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_concurrent_abort_rejected", + "patch_path": "grading/adversarial/patches/ksg_concurrent_abort_rejected.diff", + "applies_to": "gold", + "description": "Gold whose abort() raises RuntimeError while another abort() is in flight; cue tokens concurrent, serialized, abort and ABOR stay in code and comments. Only client_abort_concurrent is lost, raw 0.9932.", + "cue_tokens_required_present": [ + "concurrent", + "serialized", + "abort", + "ABOR" + ], + "expected": { + "target_criteria": [ + "client_abort_concurrent" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 0.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9986, + "final_score": 0.9986, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_cancelled_wait_forgets_replies", + "patch_path": "grading/adversarial/patches/ksg_cancelled_wait_forgets_replies.diff", + "applies_to": "gold", + "description": "Gold whose abort() and finish() drop their owed replies from the ledger when cancelled; cue tokens cancel, owed, CancelledError, abort and finish stay in code and comments. The next command reads the stale 426 or 226: client_cancelled_abort_or_finish and client_abort_after_cancelled_finish are lost (G4 fires), raw 0.5562.", + "cue_tokens_required_present": [ + "cancel", + "owed", + "CancelledError", + "abort", + "finish" + ], + "expected": { + "target_criteria": [ + "client_cancelled_abort_or_finish", + "client_abort_after_cancelled_finish" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 0.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 0.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9385, + "final_score": 0.6, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": true, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": false + } + } + }, + { + "id": "ksg_abort_waits_for_control_lock", + "patch_path": "grading/adversarial/patches/ksg_abort_waits_for_control_lock.diff", + "applies_to": "gold", + "description": "Gold whose abort() writes ABOR only under the control lock, like every other command; cue tokens control lock, ABOR, abort and finish stay in code and comments. While finish() waits for the transfer's final reply the ABOR is never sent and both calls hang: only client_abort_during_finish is lost, raw 0.9932.", + "cue_tokens_required_present": [ + "control lock", + "ABOR", + "abort", + "finish" + ], + "expected": { + "target_criteria": [ + "client_abort_during_finish", + "client_command_during_abort" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 0.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 0.0 + }, + "raw_score": 0.9379, + "final_score": 0.9379, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_abandoned_transfer_not_settled", + "patch_path": "grading/adversarial/patches/ksg_abandoned_transfer_not_settled.diff", + "applies_to": "gold", + "description": "Gold whose command() no longer settles an outstanding transfer and whose aclose() only closes the listing's data connection; cue tokens outstanding, settle, aclose, ABOR and get_stream stay in code and comments. Only client_abandoned_listing_resync is lost, raw 0.9945.", + "cue_tokens_required_present": [ + "outstanding", + "settle", + "aclose", + "ABOR", + "get_stream" + ], + "expected": { + "target_criteria": [ + "client_abandoned_listing_resync" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 0.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.9989, + "final_score": 0.9989, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_repeated_abor_immediate_226", + "patch_path": "grading/adversarial/patches/ksg_repeated_abor_immediate_226.diff", + "applies_to": "gold", + "description": "Gold whose abor handler answers a repeated ABOR at once instead of after the abort it repeats; cue tokens aborting_workers, 226, nothing to abort and ABOR stay in code and comments. The wire order becomes 226, 426, 226: only server_repeated_abor_order is lost, raw 0.9980.", + "cue_tokens_required_present": [ + "aborting_workers", + "226", + "nothing to abort", + "ABOR" + ], + "expected": { + "target_criteria": [ + "server_repeated_abor_order" + ], + "target_raw_leaf_max": 0.0, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 0.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "raw_score": 0.99, + "final_score": 0.99, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ], + "build_failed": false, + "safety_gates_failed": false, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + } + } + }, + { + "id": "ksg_reply_order_fixed_state_racing", + "applies_to": "gold", + "cue_tokens_required_present": [ + "response", + "dispatcher", + "create_task", + "restart_offset" + ], + "description": "Gold running commands concurrently as tasks without executor queue synchronization; pipelined state mutations race against subsequent commands on slow storage: server_pipelined_command_order is lost, raw 0.9693.", + "patch_path": "grading/adversarial/patches/ksg_reply_order_fixed_state_racing.diff", + "expected": { + "build_failed": false, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 0.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 0.0, + "server_pipelined_quit_open_data": 0.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "final_score": 0.6294, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "raw_score": 0.6294, + "safety_gates_failed": false, + "target_criteria": [ + "server_pipelined_command_order", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data" + ], + "target_raw_leaf_max": 0.0, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "ksg_telnet_stripped_no_urgent", + "applies_to": "gold", + "cue_tokens_required_present": [ + "SO_OOBINLINE", + "IAC", + "parse_command", + "setsockopt" + ], + "description": "Gold stripping Telnet escapes in parse_command but omitting SO_OOBINLINE on the control socket; urgent-data ABOR sequences from real FTP clients corrupt the control stream or drop the session: server_real_client_abor is lost, raw 0.9744.", + "patch_path": "grading/adversarial/patches/ksg_telnet_stripped_no_urgent.diff", + "expected": { + "build_failed": false, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 0.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "final_score": 0.9948, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "raw_score": 0.9948, + "safety_gates_failed": false, + "target_criteria": [ + "server_real_client_abor" + ], + "target_raw_leaf_max": 0.0, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_quit_during_transfer", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "ksg_quit_cancels_transfers_with_426", + "applies_to": "gold", + "cue_tokens_required_present": [ + "quit", + "221", + "extra_workers", + "cancel" + ], + "description": "Gold whose quit() immediately cancels active data transfers with 426 instead of awaiting completion of open transfers with 226: server_quit_during_transfer is lost, raw 0.9761.", + "patch_path": "grading/adversarial/patches/ksg_quit_cancels_transfers_with_426.diff", + "expected": { + "build_failed": false, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 0.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 0.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "final_score": 0.8737, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "raw_score": 0.8737, + "safety_gates_failed": false, + "target_criteria": [ + "server_quit_during_transfer", + "server_pipelined_quit_open_data" + ], + "target_raw_leaf_max": 0.0, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "ksg_data_loss_no_listener_release", + "applies_to": "gold", + "cue_tokens_required_present": [ + "ConnectionError", + "426", + "_release_passive_server", + "data_ports" + ], + "description": "Gold whose worker catches ConnectionError on the data stream and sends 426 but fails to release the passive listener and return the port to data_ports: server_data_connection_loss is lost, raw 0.9812.", + "patch_path": "grading/adversarial/patches/ksg_data_loss_no_listener_release.diff", + "expected": { + "build_failed": false, + "criteria_profile": { + "server_early_abort_session": 1.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 1.0, + "server_repeated_abor_order": 1.0, + "server_pipelined_command_order": 1.0, + "server_real_client_abor": 1.0, + "server_quit_during_transfer": 1.0, + "server_data_connection_loss": 0.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 1.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "final_score": 0.9962, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": true, + "G4_stale_reply_after_cancelled_finish": true + }, + "raw_score": 0.9962, + "safety_gates_failed": false, + "target_criteria": [ + "server_data_connection_loss" + ], + "target_raw_leaf_max": 0.0, + "unaffected_criteria": [ + "server_early_abort_session", + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_abort_open_data", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + }, + { + "id": "ksg_abor_queued_behind_transfer", + "applies_to": "gold", + "cue_tokens_required_present": [ + "abor", + "extra_workers", + "wait", + "restart_offset" + ], + "description": "Gold whose command executor awaits active transfer workers before accepting the next command; an ABOR sent while a transfer is pending or running is not executed until that transfer ends, so it is answered late or never: server_early_abort_session, server_listener_release_after_abort, server_repeated_abor_order, server_pipelined_command_order, server_real_client_abor, server_quit_during_transfer are lost (G3 fires), raw 0.7554, final 0.60.", + "patch_path": "grading/adversarial/patches/ksg_abor_queued_behind_transfer.diff", + "expected": { + "build_failed": false, + "criteria_profile": { + "server_early_abort_session": 0.0, + "client_stream_exit_after_abort": 1.0, + "client_abort_after_completed_transfer": 1.0, + "client_abort_idle_225": 1.0, + "client_abort_after_failed_transfer": 1.0, + "client_error_exit_mid_transfer": 1.0, + "client_error_exit_after_completed_transfer": 1.0, + "client_abort_idle_rejected": 1.0, + "client_upload_stream_abort": 1.0, + "client_abort_concurrent": 1.0, + "client_cancelled_abort_or_finish": 1.0, + "client_abort_during_finish": 1.0, + "client_abandoned_listing_resync": 1.0, + "server_listener_release_after_abort": 0.0, + "server_repeated_abor_order": 0.0, + "server_pipelined_command_order": 0.0, + "server_real_client_abor": 0.0, + "server_quit_during_transfer": 0.0, + "server_data_connection_loss": 1.0, + "server_undecodable_command_syntax": 1.0, + "client_abort_after_cancelled_finish": 1.0, + "server_pipelined_abort_open_data": 0.0, + "server_pipelined_quit_open_data": 1.0, + "client_nowait_abort_owed_replies": 1.0, + "client_command_during_abort": 1.0 + }, + "final_score": 0.6, + "gate_statuses": { + "G1_stale_reply_after_abort": true, + "G2_stale_reply_after_error_exit": true, + "G3_stale_data_connection_after_abort": false, + "G4_stale_reply_after_cancelled_finish": true + }, + "raw_score": 0.6976, + "safety_gates_failed": true, + "target_criteria": [ + "server_early_abort_session", + "server_listener_release_after_abort", + "server_repeated_abor_order", + "server_pipelined_command_order", + "server_real_client_abor", + "server_quit_during_transfer", + "server_pipelined_abort_open_data" + ], + "target_raw_leaf_max": 0.0, + "unaffected_criteria": [ + "client_stream_exit_after_abort", + "client_abort_after_completed_transfer", + "client_abort_idle_225", + "client_abort_after_failed_transfer", + "client_error_exit_mid_transfer", + "client_error_exit_after_completed_transfer", + "client_abort_idle_rejected", + "client_upload_stream_abort", + "client_abort_concurrent", + "client_cancelled_abort_or_finish", + "client_abort_during_finish", + "client_abandoned_listing_resync", + "server_data_connection_loss", + "server_undecodable_command_syntax", + "client_abort_after_cancelled_finish", + "server_pipelined_quit_open_data", + "client_nowait_abort_owed_replies", + "client_command_during_abort" + ] + } + } + ] +} diff --git a/harbor/sources/aioftp-v11/grading/baseline/pyproject.toml b/harbor/sources/aioftp-v11/grading/baseline/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..375b2e71d8f441c26ede3c2a3050ccdf0dd6d57b --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/pyproject.toml @@ -0,0 +1,117 @@ +[project] +name = "aioftp" +version = "0.28.3" +description = "ftp client/server for asyncio" +readme = "README.rst" +requires-python = ">= 3.10" +license = {file = "license.txt"} +authors = [ + {name = "pohmelie", email = "multisosnooley@gmail.com"}, + {name = "yieyu"}, + {name = "rsichnyi"}, + {name = "jw4js"}, + {name = "asvetlov", email = "andrew.svetlov@gmail.com"}, + {name = "decaz", email = "decaz89@gmail.com"}, + {name = "oleksandr-kuzmenko"}, + {name = "ndhansen"}, + {name = "janneronkko", email="janne.ronkko@iki.fi"}, + {name = "thirtyseven", email="ted@shlashdot.org"}, + {name = "modelmat"}, + {name = "greut"}, + {name = "ported-pw", email="contact@ported.pw"}, + {name = "PonyPC"}, + {name = "jacobtomlinson"}, + {name = "Olegt0rr", email="t0rr@mail.ru"}, + {name = "michalc", email="michal@charemza.name"}, + {name = "bachya"}, + {name = "ch3pjw", email="paul@concertdaw.co.uk"}, + {name = "puddly", email="puddly3@gmail.com"}, + {name = "CrafterKolyan"}, + {name = "jkr78"}, + {name = "AMDmi3", email="amdmi3@amdmi3.ru"}, + {name = "webknjaz", email="webknjaz+github/profile@redhat.com"}, + {name = "rcfox", email="ryan@rcfox.ca"}, + {name = "bellini666", email="thiago@bellini.dev"}, + {name = "sakosha"}, + {name = "rwakulszowa"}, +] +classifiers = [ + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Development Status :: 5 - Production/Stable", + "Topic :: Internet :: File Transfer Protocol (FTP)", +] + +# TODO: remove `typing-extensions` when requires-python = ">= 3.11" +dependencies = [ + "typing-extensions>=4.13.2; python_version < '3.11'", # 3.9-10 typing support +] + +[project.urls] +Github = "https://github.com/aio-libs/aioftp" +Documentation = "https://aioftp.rtfd.io" + +[project.optional-dependencies] +socks = [ + "siosocks >= 0.2.0", +] +dev = [ + # tests + "async_timeout >= 4.0.0", + "pytest-asyncio", + "pytest-cov", + "pytest-mock", + "pytest", + "siosocks", + "trustme", + + # linters + "pre-commit", + "ruff", + "mypy", +] + +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta" + +[tool.setuptools] +packages.find.where = ["src"] +package-data.aioftp = ["py.typed"] + +# tools +[tool.ruff] +line-length = 120 +target-version = "py310" +lint.select = ["E", "W", "F", "Q", "UP", "I", "ASYNC"] +lint.ignore = ["ASYNC240"] +src = ["src"] +exclude = ["ftpbench.py"] + + +[tool.mypy] +files = "src/aioftp" +pretty = true +strict = true +ignore_missing_imports = true +warn_unreachable = true + +[tool.coverage] +run.source = ["./src/aioftp"] +run.omit = ["./src/aioftp/__main__.py"] +report.show_missing = true +report.precision = 2 + +[tool.pytest.ini_options] +addopts = [ + "-x", + "--durations", "10", + "-p", "no:anyio", + "--cov", + "--import-mode=importlib", +] +testpaths = "tests" +log_format = "%(asctime)s.%(msecs)03d %(name)-20s %(levelname)-8s %(filename)-15s %(lineno)-4d %(message)s" +log_date_format = "%H:%M:%S" +log_level = "DEBUG" +asyncio_mode = "strict" diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/__pycache__/conftest.cpython-312-pytest-9.1.1.pyc b/harbor/sources/aioftp-v11/grading/baseline/tests/__pycache__/conftest.cpython-312-pytest-9.1.1.pyc new file mode 100644 index 0000000000000000000000000000000000000000..165ecb982226b10ea78db9f37a359eddb1c071c5 Binary files /dev/null and b/harbor/sources/aioftp-v11/grading/baseline/tests/__pycache__/conftest.cpython-312-pytest-9.1.1.pyc differ diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/conftest.py b/harbor/sources/aioftp-v11/grading/baseline/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..61a719caec8dcfa632cb2fd1b3fcfdde2e9cf9b3 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/conftest.py @@ -0,0 +1,232 @@ +import asyncio +import collections +import contextlib +import functools +import math +import socket +import ssl +import tempfile +import time +from pathlib import Path + +import pytest +import pytest_asyncio +import trustme +from async_timeout import timeout +from siosocks.io.asyncio import socks_server_handler + +import aioftp + +# No ssl tests since https://bugs.python.org/issue36098 +ca = trustme.CA() +server_cert = ca.issue_server_cert("127.0.0.1", "::1") + +ssl_server = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH) +server_cert.configure_cert(ssl_server) + +ssl_client = ssl.create_default_context(ssl.Purpose.SERVER_AUTH) +ca.configure_trust(ssl_client) + + +class Container: + def __init__(self, *args, **kwargs): + self.args = args + self.kwargs = kwargs + + +@pytest.fixture +def Client(): + return Container + + +@pytest.fixture +def Server(): + return Container + + +def _wrap_with_defaults(kwargs): + test_defaults = dict( + path_io_factory=aioftp.MemoryPathIO, + ) + return collections.ChainMap(kwargs, test_defaults) + + +@pytest.fixture(params=["127.0.0.1", "::1"]) +def pair_factory(request): + class Factory: + def __init__( + self, + client=None, + server=None, + *, + connected=True, + logged=True, + do_quit=True, + host=request.param, + server_factory=aioftp.Server, + client_factory=aioftp.Client, + ): + if client is None: + client = Container() + self.client = client_factory(*client.args, **_wrap_with_defaults(client.kwargs)) + if server is None: + server = Container() + self.server = server_factory(*server.args, **_wrap_with_defaults(server.kwargs)) + self.connected = connected + self.logged = logged + self.do_quit = do_quit + self.host = host + self.timeout = timeout(1) + + async def make_server_files(self, *paths, size=None, atom=b"-"): + if size is None: + size = aioftp.DEFAULT_BLOCK_SIZE * 3 + data = atom * size + for p in paths: + await self.client.make_directory(Path(p).parent) + async with self.client.upload_stream(p) as stream: + await stream.write(data) + + async def make_client_files(self, *paths, size=None, atom=b"-"): + if size is None: + size = aioftp.DEFAULT_BLOCK_SIZE * 3 + data = atom * size + for p in map(Path, paths): + await self.client.path_io.mkdir( + p.parent, + parents=True, + exist_ok=True, + ) + async with self.client.path_io.open(p, mode="wb") as f: + await f.write(data) + + async def server_paths_exists(self, *paths): + values = [] + for p in paths: + values.append(await self.client.exists(p)) + if all(values): + return True + if any(values): + raise ValueError("Mixed exists/not exists list") + return False + + async def client_paths_exists(self, *paths): + values = [] + for p in paths: + values.append(await self.client.path_io.exists(Path(p))) + if all(values): + return True + if any(values): + raise ValueError("Mixed exists/not exists list") + return False + + async def __aenter__(self): + await self.timeout.__aenter__() + await self.server.start(host=self.host) + if self.connected: + await self.client.connect( + self.server.server_host, + self.server.server_port, + ) + if self.logged: + await self.client.login() + return self + + async def __aexit__(self, *exc_info): + if self.connected and self.do_quit: + await self.client.quit() + self.client.close() + await self.server.close() + await self.timeout.__aexit__(*exc_info) + + return Factory + + +@pytest.fixture +def expect_codes_in_exception(): + @contextlib.contextmanager + def context(*codes): + try: + yield + except aioftp.StatusCodeError as e: + assert set(e.received_codes) == set(codes) + else: + raise RuntimeError("There was no exception") + + return context + + +@pytest.fixture( + params=[ + aioftp.MemoryPathIO, + aioftp.PathIO, + aioftp.AsyncPathIO, + ], +) +def path_io(request): + return request.param() + + +@pytest.fixture +def temp_dir(path_io): + if isinstance(path_io, aioftp.MemoryPathIO): + yield Path("/") + else: + with tempfile.TemporaryDirectory() as name: + yield Path(name) + + +class Sleep: + def __init__(self): + self.delay = 0 + self.first_sleep = None + + async def sleep(self, delay, result=None, **kwargs): + if self.first_sleep is None: + self.first_sleep = time.monotonic() + delay = (time.monotonic() - self.first_sleep) + delay + self.delay = max(self.delay, delay) + return result + + def is_close(self, delay, *, rel_tol=0.05, abs_tol=0.5): + ok = math.isclose(self.delay, delay, rel_tol=rel_tol, abs_tol=abs_tol) + if not ok: + print( + f"latest sleep: {self.delay}; expected delay: {delay}; rel: {rel_tol}", + ) + return ok + + +@pytest.fixture +def skip_sleep(monkeypatch): + with monkeypatch.context() as m: + sleeper = Sleep() + m.setattr(asyncio, "sleep", sleeper.sleep) + yield sleeper + + +@pytest_asyncio.fixture( + params=[ + ("127.0.0.1", socket.AF_INET), + ("::1", socket.AF_INET6), + ], +) +async def socks(request, unused_tcp_port): + handler = functools.partial( + socks_server_handler, + allowed_versions={5}, + username="foo", + password="bar", + ) + Socks = collections.namedtuple("Socks", "host port server") + host, family = request.param + port = unused_tcp_port + server = await asyncio.start_server( + handler, + host=host, + port=port, + family=family, + ) + yield Socks(host, port, server) + server.close() + await server.wait_closed() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_abort.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_abort.py new file mode 100644 index 0000000000000000000000000000000000000000..3199621bd99d3a19823b6e736d203c235544eb46 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_abort.py @@ -0,0 +1,96 @@ +import asyncio +import itertools +import pathlib + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_abort_stor(pair_factory): + async with pair_factory() as pair: + stream = await pair.client.upload_stream("test.txt") + with pytest.raises((ConnectionResetError, BrokenPipeError)): + while True: + await stream.write(b"-" * aioftp.DEFAULT_BLOCK_SIZE) + await pair.client.abort() + + +class SlowReadMemoryPathIO(aioftp.MemoryPathIO): + async def read(self, *args, **kwargs): + await asyncio.sleep(0.01) + return await super().read(*args, **kwargs) + + +@pytest.mark.asyncio +async def test_abort_retr(pair_factory, Server): + s = Server(path_io_factory=SlowReadMemoryPathIO) + async with pair_factory(None, s) as pair: + await pair.make_server_files("test.txt") + stream = await pair.client.download_stream("test.txt") + for i in itertools.count(): + data = await stream.read(aioftp.DEFAULT_BLOCK_SIZE) + if not data: + stream.close() + break + if i == 0: + await pair.client.abort() + + +@pytest.mark.asyncio +async def test_abort_retr_no_wait( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server(path_io_factory=SlowReadMemoryPathIO) + async with pair_factory(None, s) as pair: + await pair.make_server_files("test.txt") + stream = await pair.client.download_stream("test.txt") + with expect_codes_in_exception("426"): + for i in itertools.count(): + data = await stream.read(aioftp.DEFAULT_BLOCK_SIZE) + if not data: + await stream.finish() + break + if i == 0: + await pair.client.abort(wait=False) + + +@pytest.mark.asyncio +async def test_nothing_to_abort(pair_factory): + async with pair_factory() as pair: + await pair.client.abort() + + +class SlowListMemoryPathIO(aioftp.MemoryPathIO): + async def is_file(self, *a, **kw): + return True + + def list(self, *args, **kwargs): + class Lister(aioftp.AbstractAsyncLister): + async def __anext__(cls): + await asyncio.sleep(0.01) + return pathlib.PurePath("/test.txt") + + return Lister() + + async def stat(self, *a, **kw): + class Stat: + st_size = 0 + st_mtime = 0 + st_ctime = 0 + + return Stat + + +@pytest.mark.asyncio +async def test_mlsd_abort(pair_factory, Server): + s = Server(path_io_factory=SlowListMemoryPathIO) + async with pair_factory(None, s) as pair: + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/") + async for path, info in pair.client.list(): + await pair.client.abort() + break diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_client_side_socks.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_client_side_socks.py new file mode 100644 index 0000000000000000000000000000000000000000..cebf7052da99b5a383b2185e5dd213daea7b2c96 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_client_side_socks.py @@ -0,0 +1,29 @@ +import pytest +from siosocks.exceptions import SocksException + + +@pytest.mark.asyncio +async def test_socks_success(pair_factory, Client, socks): + client = Client( + socks_host=socks.host, + socks_port=socks.port, + socks_version=5, + username="foo", + password="bar", + ) + async with pair_factory(client): + pass + + +@pytest.mark.asyncio +async def test_socks_fail(pair_factory, Client, socks): + client = Client( + socks_host=socks.host, + socks_port=socks.port, + socks_version=5, + username="bar", + password="bar", + ) + with pytest.raises(SocksException): + async with pair_factory(client): + pass diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_connection.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_connection.py new file mode 100644 index 0000000000000000000000000000000000000000..66a19b27e9eb5cec235eb3e68f5eb9629eb82319 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_connection.py @@ -0,0 +1,336 @@ +import asyncio +import ipaddress + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_client_without_server(pair_factory, unused_tcp_port_factory): + f = pair_factory(connected=False, logged=False, do_quit=False) + async with f as pair: + pass + with pytest.raises(OSError): + await pair.client.connect("127.0.0.1", unused_tcp_port_factory()) + + +@pytest.mark.asyncio +async def test_connection(pair_factory): + async with pair_factory(connected=True, logged=False, do_quit=False): + pass + + +@pytest.mark.asyncio +async def test_quit(pair_factory): + async with pair_factory(connected=True, logged=False, do_quit=True): + pass + + +@pytest.mark.asyncio +async def test_not_implemented(pair_factory, expect_codes_in_exception): + async with pair_factory() as pair: + with expect_codes_in_exception("502"): + await pair.client.command("FOOBAR", "2xx", "1xx") + + +@pytest.mark.asyncio +async def test_type_success(pair_factory, expect_codes_in_exception): + async with pair_factory() as pair: + await pair.client.get_passive_connection("A") + + +@pytest.mark.asyncio +async def test_custom_passive_commands(pair_factory): + async with pair_factory(host="127.0.0.1") as pair: + pair.client._passive_commands = None + await pair.client.get_passive_connection( + "A", + commands=["pasv", "epsv"], + ) + + +@pytest.mark.asyncio +async def test_extra_pasv_connection(pair_factory): + async with pair_factory() as pair: + r, w = await pair.client.get_passive_connection() + er, ew = await pair.client.get_passive_connection() + with pytest.raises((ConnectionResetError, BrokenPipeError)): + while True: + w.write(b"-" * aioftp.DEFAULT_BLOCK_SIZE) + await w.drain() + + +@pytest.mark.parametrize("method", ["epsv", "pasv"]) +@pytest.mark.asyncio +async def test_closing_passive_connection(pair_factory, method): + async with pair_factory(host="127.0.0.1") as pair: + r, w = await pair.client.get_passive_connection(commands=[method]) + host, port, *_ = w.transport.get_extra_info("peername") + nr, nw = await asyncio.open_connection(host, port) + with pytest.raises((ConnectionResetError, BrokenPipeError)): + while True: + nw.write(b"-" * aioftp.DEFAULT_BLOCK_SIZE) + await nw.drain() + + +@pytest.mark.asyncio +async def test_pasv_connection_ports_not_added(pair_factory): + async with pair_factory() as pair: + r, w = await pair.client.get_passive_connection() + assert pair.server.available_data_ports is None + + +@pytest.mark.asyncio +async def test_pasv_connection_ports( + pair_factory, + Server, + unused_tcp_port_factory, +): + ports = [unused_tcp_port_factory(), unused_tcp_port_factory()] + async with pair_factory(None, Server(data_ports=ports)) as pair: + r, w = await pair.client.get_passive_connection() + host, port, *_ = w.transport.get_extra_info("peername") + assert port in ports + assert pair.server.available_data_ports.qsize() == 1 + + +@pytest.mark.asyncio +async def test_data_ports_remains_empty(pair_factory, Server): + async with pair_factory(None, Server(data_ports=[])) as pair: + assert pair.server.available_data_ports.qsize() == 0 + + +@pytest.mark.asyncio +async def test_pasv_connection_port_reused( + pair_factory, + Server, + unused_tcp_port, +): + s = Server(data_ports=[unused_tcp_port]) + async with pair_factory(None, s) as pair: + r, w = await pair.client.get_passive_connection() + host, port, *_ = w.transport.get_extra_info("peername") + assert port == unused_tcp_port + assert pair.server.available_data_ports.qsize() == 0 + w.close() + await pair.client.quit() + pair.client.close() + assert pair.server.available_data_ports.qsize() == 1 + await pair.client.connect( + pair.server.server_host, + pair.server.server_port, + ) + await pair.client.login() + r, w = await pair.client.get_passive_connection() + host, port, *_ = w.transport.get_extra_info("peername") + assert port == unused_tcp_port + assert pair.server.available_data_ports.qsize() == 0 + + +@pytest.mark.asyncio +async def test_pasv_connection_pasv_forced_response_address(pair_factory, Client, Server): + def ipv4_used(): + try: + ipaddress.IPv4Address(pair.host) + return True + except ValueError: + return False + + # using TEST-NET-1 address + ipv4_address = "192.0.2.1" + async with pair_factory( + client=Client(trust_server_pasv_ipv4_address=True), + server=Server(ipv4_pasv_forced_response_address=ipv4_address), + ) as pair: + assert pair.server.ipv4_pasv_forced_response_address == ipv4_address + + if ipv4_used(): + # The connection should fail here because the server starts to listen for + # the passive connections on the host (IPv4 address) that is used + # by the control channel. In reality, if the server is behind NAT, + # the server is reached with the defined external IPv4 address, + # i.e. we can check that the connection to + # pair.server.ipv4_pasv_forced_response_address failed to know that + # the server returned correct external IP + # ... + # but we can't use check like this: + # with pytest.raises(OSError): + # await pair.client.get_passive_connection(commands=["pasv"]) + # because there is no such ipv4 which will be non-routable, so + # we can only check `PASV` response + ip, _ = await pair.client._do_pasv() + assert ip == ipv4_address + + # With epsv the connection should open as that does not use the + # external IPv4 address but just tells the client the port to connect + # to + await pair.client.get_passive_connection(commands=["epsv"]) + + +@pytest.mark.parametrize("method", ["epsv", "pasv"]) +@pytest.mark.asyncio +async def test_pasv_connection_no_free_port( + pair_factory, + Server, + expect_codes_in_exception, + method, +): + s = Server(data_ports=[]) + async with pair_factory(None, s, do_quit=False, host="127.0.0.1") as pair: + assert pair.server.available_data_ports.qsize() == 0 + with expect_codes_in_exception("421"): + await pair.client.get_passive_connection(commands=[method]) + + +@pytest.mark.asyncio +async def test_pasv_connection_busy_port( + pair_factory, + Server, + unused_tcp_port_factory, +): + ports = [unused_tcp_port_factory(), unused_tcp_port_factory()] + async with pair_factory(None, Server(data_ports=ports)) as pair: + conflicting_server = await asyncio.start_server( + lambda r, w: w.close(), + host=pair.server.server_host, + port=ports[0], + ) + r, w = await pair.client.get_passive_connection() + host, port, *_ = w.transport.get_extra_info("peername") + assert port == ports[1] + assert pair.server.available_data_ports.qsize() == 1 + conflicting_server.close() + await conflicting_server.wait_closed() + + +@pytest.mark.asyncio +async def test_pasv_connection_busy_port2( + pair_factory, + Server, + unused_tcp_port_factory, + expect_codes_in_exception, +): + ports = [unused_tcp_port_factory()] + s = Server(data_ports=ports) + async with pair_factory(None, s, do_quit=False) as pair: + conflicting_server = await asyncio.start_server( + lambda r, w: w.close(), + host=pair.server.server_host, + port=ports[0], + ) + with expect_codes_in_exception("421"): + await pair.client.get_passive_connection() + conflicting_server.close() + await conflicting_server.wait_closed() + + +@pytest.mark.asyncio +async def test_server_shutdown(pair_factory): + async with pair_factory(do_quit=False) as pair: + await pair.client.list() + await pair.server.close() + with pytest.raises(ConnectionResetError): + await pair.client.list() + + +@pytest.mark.asyncio +async def test_client_session_context_manager(pair_factory): + async with pair_factory(connected=False) as pair: + async with aioftp.Client.context(*pair.server.address) as client: + await client.list() + + +@pytest.mark.asyncio +async def test_long_login_sequence_fail( + pair_factory, + expect_codes_in_exception, +): + class CustomServer(aioftp.Server): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.commands_mapping["acct"] = self.acct + + async def user(self, connection, rest): + connection.response("331") + return True + + async def pass_(self, connection, rest): + connection.response("332") + return True + + async def acct(self, connection, rest): + connection.response("333") + return True + + factory = pair_factory( + logged=False, + server_factory=CustomServer, + do_quit=False, + ) + async with factory as pair: + with expect_codes_in_exception("333"): + await pair.client.login() + + +@pytest.mark.asyncio +async def test_bad_sublines_seq(pair_factory, expect_codes_in_exception): + class CustomServer(aioftp.Server): + async def write_response(self, stream, code, lines="", list=False): + import functools + + lines = aioftp.wrap_with_container(lines) + write = functools.partial(self.write_line, stream) + *body, tail = lines + for line in body: + await write(code + "-" + line) + await write(str(int(code) + 1) + "-" + tail) + await write(code + " " + tail) + + factory = pair_factory(connected=False, server_factory=CustomServer) + async with factory as pair: + with expect_codes_in_exception("220"): + await pair.client.connect( + pair.server.server_host, + pair.server.server_port, + ) + await pair.client.login() + + +@pytest.mark.asyncio +async def test_welcome_message(pair_factory, Server): + welcome_message = "Welcome to the FTP server!" + async with pair_factory( + server=Server(welcome_message=welcome_message), + connected=False, + ) as pair: + lines = await pair.client.connect( + pair.server.server_host, + pair.server.server_port, + ) + assert lines == [" " + welcome_message] + + +@pytest.mark.asyncio +async def test_system_type(pair_factory, Server): + system_type = "My custom OS" + async with pair_factory( + server=Server(system_type=system_type), + ) as pair: + resp = await pair.client.command("SYST", expected_codes=(215,)) + assert resp == ("215", [" " + system_type]) + + +@pytest.mark.asyncio +async def test_client_timeout_passive_connection(pair_factory, Client, monkeypatch): + open_connection = asyncio.open_connection + + async def slow_open_connection(host, port, **kwargs): + await asyncio.sleep(1) + return await open_connection(host, port, **kwargs) + + async with pair_factory(Client(connection_timeout=0.5), logged=True) as pair: + with monkeypatch.context() as m: + m.setattr("asyncio.open_connection", slow_open_connection) + with pytest.raises(asyncio.TimeoutError): + await pair.client.get_passive_connection() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_corner_cases.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_corner_cases.py new file mode 100644 index 0000000000000000000000000000000000000000..b12c8e8cda00664c63f126041fd707e141ae15cd --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_corner_cases.py @@ -0,0 +1,77 @@ +from pathlib import Path + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_server_side_exception(pair_factory): + class CustomServer(aioftp.Server): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.commands_mapping["custom"] = self.custom + + async def custom(*args, **kwargs): + raise RuntimeError("Test error") + + factory = pair_factory(server_factory=CustomServer, do_quit=False) + async with factory as pair: + with pytest.raises(ConnectionResetError): + await pair.client.command("custom", "200") + + +@pytest.mark.asyncio +async def test_bad_type_value(pair_factory, expect_codes_in_exception): + async with pair_factory() as pair: + with expect_codes_in_exception("502"): + await pair.client.command("type FOO", "200") + + +@pytest.mark.asyncio +async def test_pbsz(pair_factory): + async with pair_factory() as pair: + await pair.client.command("pbsz", "200") + + +@pytest.mark.asyncio +async def test_prot(pair_factory, expect_codes_in_exception): + async with pair_factory() as pair: + await pair.client.command("prot P", "200") + with expect_codes_in_exception("502"): + await pair.client.command("prot foo", "200") + + +@pytest.mark.asyncio +async def test_server_ipv6_pasv(pair_factory, expect_codes_in_exception): + async with pair_factory(host="::1", do_quit=False) as pair: + with expect_codes_in_exception("503"): + await pair.client.get_passive_connection(commands=["pasv"]) + + +@pytest.mark.asyncio +async def test_epsv_extra_arg(pair_factory, expect_codes_in_exception): + async with pair_factory(do_quit=False) as pair: + with expect_codes_in_exception("522"): + await pair.client.command("epsv foo", "229") + + +@pytest.mark.asyncio +async def test_bad_server_path_io( + pair_factory, + Server, + expect_codes_in_exception, +): + class BadPathIO(aioftp.MemoryPathIO): + async def is_file(*a, **kw): + return False + + async def is_dir(*a, **kw): + return False + + s = Server(path_io_factory=BadPathIO) + async with pair_factory(None, s) as pair: + pio = pair.server.path_io_factory() + async with pio.open(Path("/foo"), "wb"): + pass + await pair.client.list() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_current_directory.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_current_directory.py new file mode 100644 index 0000000000000000000000000000000000000000..81d8b981f5e8a80c58c98c31ac65eb4e23644ac7 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_current_directory.py @@ -0,0 +1,50 @@ +import pathlib + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_current_directory_simple(pair_factory): + async with pair_factory() as pair: + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/") + + +@pytest.mark.asyncio +async def test_current_directory_not_default(pair_factory, Server): + s = Server([aioftp.User(home_path="/home")]) + async with pair_factory(None, s) as pair: + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/home") + + +@pytest.mark.asyncio +async def test_mlsd(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("test.txt") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("test.txt") + assert stat["type"] == "file" + + +@pytest.mark.asyncio +async def test_resolving_double_dots(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("test.txt") + + async def f(): + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("test.txt") + assert stat["type"] == "file" + + await f() + await pair.client.change_directory("../../../") + await f() + await pair.client.change_directory("/a/../b/..") + await f() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_directory_actions.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_directory_actions.py new file mode 100644 index 0000000000000000000000000000000000000000..d503b2f87206017b080f577a1a9f50c75f35fb3f --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_directory_actions.py @@ -0,0 +1,110 @@ +import pathlib + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_create_and_remove_directory(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar") + assert stat["type"] == "dir" + + await pair.client.remove_directory("bar") + assert await pair.server_paths_exists("bar") is False + + +@pytest.mark.asyncio +async def test_create_and_remove_directory_long(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar/baz") + assert await pair.server_paths_exists("bar", "bar/baz") + await pair.client.remove_directory("bar/baz") + await pair.client.remove_directory("bar") + assert await pair.server_paths_exists("bar") is False + + +@pytest.mark.asyncio +async def test_create_directory_long_no_parents(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar/baz", parents=False) + await pair.client.remove_directory("bar/baz") + await pair.client.remove_directory("bar") + + +@pytest.mark.asyncio +async def test_change_directory(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar") + await pair.client.change_directory("bar") + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/bar") + await pair.client.change_directory() + cwd = await pair.client.get_current_directory() + assert cwd == pathlib.PurePosixPath("/") + + +@pytest.mark.asyncio +async def test_change_directory_not_exist( + pair_factory, + expect_codes_in_exception, +): + async with pair_factory() as pair: + with expect_codes_in_exception("550"): + await pair.client.change_directory("bar") + + +@pytest.mark.asyncio +async def test_rename_empty_directory(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar") + assert await pair.server_paths_exists("bar") + assert await pair.server_paths_exists("baz") is False + await pair.client.rename("bar", "baz") + assert await pair.server_paths_exists("bar") is False + assert await pair.server_paths_exists("baz") + + +@pytest.mark.asyncio +async def test_rename_non_empty_directory(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("bar/foo.txt") + assert await pair.server_paths_exists("bar/foo.txt", "bar") + await pair.client.make_directory("hurr") + await pair.client.rename("bar", "hurr/baz") + assert await pair.server_paths_exists("hurr/baz/foo.txt") + assert await pair.server_paths_exists("bar") is False + + +class FakeErrorPathIO(aioftp.MemoryPathIO): + def list(self, path): + class Lister(aioftp.AbstractAsyncLister): + @aioftp.pathio.universal_exception + async def __anext__(self): + raise Exception("KERNEL PANIC") + + return Lister(timeout=self.timeout) + + +@pytest.mark.asyncio +async def test_exception_in_list( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server(path_io_factory=FakeErrorPathIO) + async with pair_factory(None, s) as pair: + with expect_codes_in_exception("451"): + await pair.client.list() + + +@pytest.mark.asyncio +async def test_list_recursive(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo/bar", "foo/baz/baz") + files = await pair.client.list(recursive=True) + assert len(files) == 4 diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_extra.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_extra.py new file mode 100644 index 0000000000000000000000000000000000000000..a5ceccb4d609dd9f9e5c913ab5d65e38d867179c --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_extra.py @@ -0,0 +1,50 @@ +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_stream_iter_by_line(pair_factory): + async with pair_factory() as pair: + await pair.client.make_directory("bar") + lines = [] + async with pair.client.get_stream("list") as stream: + async for line in stream.iter_by_line(): + lines.append(line) + assert len(lines) == 1 + assert b"bar" in lines[0] + + +@pytest.mark.asyncio +async def test_stream_close_without_finish(pair_factory): + class CustomException(Exception): + pass + + def fake_finish(*a, **kw): + raise Exception("Finished called") + + async with pair_factory() as pair: + with pytest.raises(CustomException): + async with pair.client.get_stream(): + raise CustomException() + + +@pytest.mark.asyncio +async def test_no_server(unused_tcp_port): + with pytest.raises(OSError): + async with aioftp.Client.context("127.0.0.1", unused_tcp_port): + pass + + +@pytest.mark.asyncio +async def test_syst_command(pair_factory): + async with pair_factory() as pair: + code, info = await pair.client.command("syst", "215") + assert info == [" UNIX Type: L8"] + + +@pytest.mark.asyncio +async def test_illegal_command(pair_factory): + async with pair_factory() as pair: + with pytest.raises(aioftp.errors.InvalidCommand): + await pair.client.command("LIST\r\nfoo") diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_file.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_file.py new file mode 100644 index 0000000000000000000000000000000000000000..7ef29abd6e4223160dabd55a5d684e3f473b957f --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_file.py @@ -0,0 +1,254 @@ +import datetime as dt +import math +from pathlib import PurePosixPath + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_remove_single_file(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo.txt") + assert await pair.server_paths_exists("foo.txt") + await pair.client.remove_file("foo.txt") + assert await pair.server_paths_exists("foo.txt") is False + + +@pytest.mark.asyncio +async def test_recursive_remove(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar.txt", "foo/baz.txt", "foo/bar_dir/foo.baz"] + await pair.make_server_files(*paths) + await pair.client.remove("foo") + assert await pair.server_paths_exists(*paths) is False + + +@pytest.mark.asyncio +async def test_mlsd_file(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo/bar.txt") + result = await pair.client.list("foo/bar.txt") + assert len(result) == 0 + + +@pytest.mark.asyncio +async def test_file_download(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo", size=1, atom=b"foobar") + async with pair.client.download_stream("foo") as stream: + data = await stream.read() + assert data == b"foobar" + + +@pytest.mark.asyncio +async def test_file_download_exactly(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo", size=1, atom=b"foobar") + async with pair.client.download_stream("foo") as stream: + data1 = await stream.readexactly(3) + data2 = await stream.readexactly(3) + assert (data1, data2) == (b"foo", b"bar") + + +@pytest.mark.asyncio +async def test_file_download_enhanced_passive(pair_factory): + async with pair_factory() as pair: + pair.client._passive_commands = ["epsv"] + await pair.make_server_files("foo", size=1, atom=b"foobar") + async with pair.client.download_stream("foo") as stream: + data = await stream.read() + assert data == b"foobar" + + +@pytest.mark.asyncio +async def test_file_upload(pair_factory): + async with pair_factory() as pair: + async with pair.client.upload_stream("foo") as stream: + await stream.write(b"foobar") + async with pair.client.download_stream("foo") as stream: + data = await stream.read() + assert data == b"foobar" + + +@pytest.mark.asyncio +async def test_file_append(pair_factory): + async with pair_factory() as pair: + await pair.make_server_files("foo", size=1, atom=b"foobar") + async with pair.client.append_stream("foo") as stream: + await stream.write(b"foobar") + async with pair.client.download_stream("foo") as stream: + data = await stream.read() + assert data == b"foobar" * 2 + + +@pytest.mark.asyncio +async def test_upload_folder(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_client_files(*paths) + assert await pair.server_paths_exists(*paths) is False + await pair.client.upload("foo") + assert await pair.server_paths_exists(*paths) + + +@pytest.mark.asyncio +async def test_upload_folder_into(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_client_files(*paths) + assert await pair.server_paths_exists("bar", "baz") is False + await pair.client.upload("foo", write_into=True) + assert await pair.server_paths_exists("bar", "baz") + + +@pytest.mark.asyncio +async def test_upload_folder_into_another(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_client_files(*paths) + assert await pair.server_paths_exists("bar/bar", "bar/baz") is False + await pair.client.upload("foo", "bar", write_into=True) + assert await pair.server_paths_exists("bar/bar", "bar/baz") + + +@pytest.mark.asyncio +async def test_download_folder(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_server_files(*paths) + assert await pair.client_paths_exists(*paths) is False + await pair.client.download("foo") + assert await pair.client_paths_exists(*paths) + + +@pytest.mark.asyncio +async def test_download_folder_into(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_server_files(*paths) + assert await pair.client_paths_exists("bar", "baz") is False + await pair.client.download("foo", write_into=True) + assert await pair.client_paths_exists("bar", "baz") + + +@pytest.mark.asyncio +async def test_download_folder_into_another(pair_factory): + async with pair_factory() as pair: + paths = ["foo/bar", "foo/baz"] + await pair.make_server_files(*paths) + assert await pair.client_paths_exists("bar/bar", "bar/baz") is False + await pair.client.download("foo", "bar", write_into=True) + assert await pair.client_paths_exists("bar/bar", "bar/baz") + + +@pytest.mark.asyncio +async def test_upload_file_over(pair_factory): + async with pair_factory() as pair: + await pair.make_client_files("foo", size=1, atom=b"client") + await pair.make_server_files("foo", size=1, atom=b"server") + async with pair.client.download_stream("foo") as stream: + assert await stream.read() == b"server" + await pair.client.upload("foo") + async with pair.client.download_stream("foo") as stream: + assert await stream.read() == b"client" + + +@pytest.mark.asyncio +async def test_download_file_over(pair_factory): + async with pair_factory() as pair: + await pair.make_client_files("foo", size=1, atom=b"client") + await pair.make_server_files("foo", size=1, atom=b"server") + async with pair.client.path_io.open(PurePosixPath("foo")) as f: + assert await f.read() == b"client" + await pair.client.download("foo") + async with pair.client.path_io.open(PurePosixPath("foo")) as f: + assert await f.read() == b"server" + + +@pytest.mark.asyncio +async def test_upload_file_write_into(pair_factory): + async with pair_factory() as pair: + await pair.make_client_files("foo", size=1, atom=b"client") + await pair.make_server_files("bar", size=1, atom=b"server") + async with pair.client.download_stream("bar") as stream: + assert await stream.read() == b"server" + await pair.client.upload("foo", "bar", write_into=True) + async with pair.client.download_stream("bar") as stream: + assert await stream.read() == b"client" + + +@pytest.mark.asyncio +async def test_upload_tree(pair_factory): + async with pair_factory() as pair: + await pair.make_client_files("foo/bar/baz", size=1, atom=b"client") + await pair.client.upload("foo", "bar", write_into=True) + files = await pair.client.list(recursive=True) + assert len(files) == 3 + + +@pytest.mark.asyncio +async def test_download_file_write_into(pair_factory): + async with pair_factory() as pair: + await pair.make_client_files("foo", size=1, atom=b"client") + await pair.make_server_files("bar", size=1, atom=b"server") + async with pair.client.path_io.open(PurePosixPath("foo")) as f: + assert await f.read() == b"client" + await pair.client.download("bar", "foo", write_into=True) + async with pair.client.path_io.open(PurePosixPath("foo")) as f: + assert await f.read() == b"server" + + +@pytest.mark.asyncio +async def test_upload_file_os_error( + pair_factory, + Server, + expect_codes_in_exception, +): + class OsErrorPathIO(aioftp.MemoryPathIO): + @aioftp.pathio.universal_exception + async def write(self, fout, data): + raise OSError("test os error") + + s = Server(path_io_factory=OsErrorPathIO) + async with pair_factory(None, s) as pair: + with expect_codes_in_exception("451"): + async with pair.client.upload_stream("foo") as stream: + await stream.write(b"foobar") + + +@pytest.mark.asyncio +async def test_upload_path_unreachable( + pair_factory, + expect_codes_in_exception, +): + async with pair_factory() as pair: + with expect_codes_in_exception("550"): + async with pair.client.upload_stream("foo/bar/foo") as stream: + await stream.write(b"foobar") + + +@pytest.mark.asyncio +async def test_stat_when_no_mlst(pair_factory): + async with pair_factory() as pair: + pair.server.commands_mapping.pop("mlst") + await pair.make_server_files("foo") + info = await pair.client.stat("foo") + assert info["type"] == "file" + + +@pytest.mark.asyncio +async def test_stat_mlst(pair_factory): + async with pair_factory() as pair: + now = dt.datetime.now(tz=dt.timezone.utc).replace(tzinfo=None) + await pair.make_server_files("foo") + info = await pair.client.stat("foo") + assert info["type"] == "file" + for fact in ("modify", "create"): + received = dt.datetime.strptime(info[fact], "%Y%m%d%H%M%S") + assert math.isclose( + now.timestamp(), + received.timestamp(), + abs_tol=10, + ) diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_list_fallback.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_list_fallback.py new file mode 100644 index 0000000000000000000000000000000000000000..7bc74296625ae555867e29a312c3e65f7f1bf51a --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_list_fallback.py @@ -0,0 +1,156 @@ +import contextlib +import pathlib +import textwrap + +import pytest + +import aioftp + + +async def not_implemented(connection, rest): + connection.response("502", ":P") + return True + + +@pytest.mark.asyncio +async def test_client_fallback_to_list_at_list(pair_factory): + async with pair_factory() as pair: + pair.server.commands_mapping["mlst"] = not_implemented + pair.server.commands_mapping["mlsd"] = not_implemented + await pair.make_server_files("bar/foo") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar") + assert stat["type"] == "dir" + (path, stat), *_ = files = await pair.client.list("bar") + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar/foo") + assert stat["type"] == "file" + result = await pair.client.list("bar/foo") + assert len(result) == 0 + + +async def implemented_badly(connection, rest): + assert False, "should not be called" + + +@pytest.mark.asyncio +async def test_client_list_override(pair_factory): + async with pair_factory() as pair: + pair.server.commands_mapping["mlsd"] = implemented_badly + await pair.client.make_directory("bar") + (path, stat), *_ = files = await pair.client.list(raw_command="LIST") + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar") + assert stat["type"] == "dir" + + +@pytest.mark.asyncio +async def test_client_list_override_invalid_raw_command(pair_factory): + async with pair_factory() as pair: + with pytest.raises(ValueError): + await pair.client.list(raw_command="FOO") + + +def test_client_list_windows(): + test_str = textwrap.dedent( + """\ + 11/4/2018 9:09 PM . + 8/10/2018 1:02 PM .. + 9/23/2018 2:16 PM bin + 10/16/2018 10:25 PM Desktop + 11/4/2018 3:31 PM dow + 10/16/2018 8:21 PM Downloads + 10/14/2018 5:34 PM msc + 9/9/2018 9:32 AM opt + 10/3/2018 2:58 PM 34,359,738,368 win10.img + 6/30/2018 8:36 AM 3,939,237,888 win10.iso + 7/26/2018 1:11 PM 189 win10.sh + 10/29/2018 11:46 AM 34,359,738,368 win7.img + 6/30/2018 8:35 AM 3,319,791,616 win7.iso + 10/29/2018 10:55 AM 219 win7.sh + 6 files 75,978,506,648 bytes + 3 directories 22,198,362,112 bytes free + """, + ) + test_str = test_str.strip().split("\n") + entities = {} + parse = aioftp.Client(encoding="utf-8").parse_list_line_windows + for x in test_str: + with contextlib.suppress(ValueError): + path, stat = parse(x.encode("utf-8")) + entities[path] = stat + dirs = ["bin", "Desktop", "dow", "Downloads", "msc", "opt"] + files = [ + "win10.img", + "win10.iso", + "win10.sh", + "win7.img", + "win7.iso", + "win7.sh", + ] + assert len(entities) == len(dirs + files) + for d in dirs: + p = pathlib.PurePosixPath(d) + assert p in entities + assert entities[p]["type"] == "dir" + for f in files: + p = pathlib.PurePosixPath(f) + assert p in entities + assert entities[p]["type"] == "file" + with pytest.raises(ValueError): + parse(b" 10/3/2018 2:58 PM 34,35xxx38,368 win10.img") + + +@pytest.mark.asyncio +async def test_client_list_override_with_custom(pair_factory, Client): + meta = {"type": "file", "works": True} + + def parser(b): + import pickle + + return pickle.loads(bytes.fromhex(b.decode().rstrip("\r\n"))) + + async def builder(_, path): + import pickle + + return pickle.dumps((path, meta)).hex() + + async with pair_factory(Client(parse_list_line_custom=parser)) as pair: + pair.server.commands_mapping["mlst"] = not_implemented + pair.server.commands_mapping["mlsd"] = not_implemented + pair.server.build_list_string = builder + await pair.client.make_directory("bar") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar") + assert stat == meta + + +@pytest.mark.asyncio +async def test_client_list_override_with_custom_last(pair_factory, Client): + meta = {"type": "file", "works": True} + + def parser(b): + import pickle + + return pickle.loads(bytes.fromhex(b.decode().rstrip("\r\n"))) + + async def builder(_, path): + import pickle + + return pickle.dumps((path, meta)).hex() + + client = Client( + parse_list_line_custom=parser, + parse_list_line_custom_first=False, + ) + async with pair_factory(client) as pair: + pair.server.commands_mapping["mlst"] = not_implemented + pair.server.commands_mapping["mlsd"] = not_implemented + pair.server.build_list_string = builder + await pair.client.make_directory("bar") + (path, stat), *_ = files = await pair.client.list() + assert len(files) == 1 + assert path == pathlib.PurePosixPath("bar") + assert stat == meta diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_login.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_login.py new file mode 100644 index 0000000000000000000000000000000000000000..bd38960e6de17eb8d2d2a76946fa3c22f78fea18 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_login.py @@ -0,0 +1,73 @@ +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_client_list_override(pair_factory, expect_codes_in_exception): + async with pair_factory(logged=False, do_quit=False) as pair: + with expect_codes_in_exception("503"): + await pair.client.get_current_directory() + + +@pytest.mark.asyncio +async def test_anonymous_login(pair_factory): + async with pair_factory(): + pass + + +@pytest.mark.asyncio +async def test_login_with_login_data(pair_factory): + async with pair_factory(logged=False) as pair: + await pair.client.login("foo", "bar") + + +@pytest.mark.asyncio +async def test_login_with_login_and_no_password(pair_factory, Server): + s = Server([aioftp.User("foo")]) + async with pair_factory(None, s, logged=False) as pair: + await pair.client.login("foo") + + +@pytest.mark.asyncio +async def test_login_with_login_and_password(pair_factory, Server): + s = Server([aioftp.User("foo", "bar")]) + async with pair_factory(None, s, logged=False) as pair: + await pair.client.login("foo", "bar") + + +@pytest.mark.asyncio +async def test_login_with_login_and_password_no_such_user( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server([aioftp.User("foo", "bar")]) + async with pair_factory(None, s, logged=False) as pair: + with expect_codes_in_exception("530"): + await pair.client.login("fo", "bar") + + +@pytest.mark.asyncio +async def test_login_with_login_and_password_bad_password( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server([aioftp.User("foo", "bar")]) + async with pair_factory(None, s, logged=False) as pair: + with expect_codes_in_exception("530"): + await pair.client.login("foo", "baz") + + +@pytest.mark.asyncio +async def test_pass_after_login( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server([aioftp.User("foo", "bar")]) + async with pair_factory(None, s, logged=False) as pair: + await pair.client.login("foo", "bar") + with expect_codes_in_exception("503"): + await pair.client.command("PASS baz", ("230", "33x")) diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_maximum_connections.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_maximum_connections.py new file mode 100644 index 0000000000000000000000000000000000000000..8cc4118d674be31c6a275e99321ae169d1d7f095 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_maximum_connections.py @@ -0,0 +1,100 @@ +import functools + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_multiply_connections_no_limits(pair_factory): + Client = functools.partial( + aioftp.Client, + path_io_factory=aioftp.MemoryPathIO, + ) + async with pair_factory() as pair: + s = pair.server + clients = [Client() for _ in range(4)] + for c in clients: + await c.connect(s.server_host, s.server_port) + await c.login() + for c in clients: + await c.quit() + + +@pytest.mark.asyncio +async def test_multiply_connections_limited_error( + pair_factory, + Server, + expect_codes_in_exception, +): + Client = functools.partial( + aioftp.Client, + path_io_factory=aioftp.MemoryPathIO, + ) + s = Server(maximum_connections=4) + async with pair_factory(None, s) as pair: + s = pair.server + clients = [Client() for _ in range(4)] + for c in clients[:-1]: + await c.connect(s.server_host, s.server_port) + await c.login() + with expect_codes_in_exception("421"): + await clients[-1].connect(s.server_host, s.server_port) + for c in clients[:-1]: + await c.quit() + + +@pytest.mark.asyncio +async def test_multiply_user_commands(pair_factory, Server): + s = Server(maximum_connections=1) + async with pair_factory(None, s) as pair: + for _ in range(10): + await pair.client.login() + + +@pytest.mark.asyncio +async def test_multiply_connections_with_user_limited_error( + pair_factory, + Server, + expect_codes_in_exception, +): + Client = functools.partial( + aioftp.Client, + path_io_factory=aioftp.MemoryPathIO, + ) + s = Server([aioftp.User("foo", maximum_connections=4)]) + async with pair_factory(None, s, connected=False) as pair: + s = pair.server + clients = [Client() for _ in range(5)] + for c in clients[:-1]: + await c.connect(s.server_host, s.server_port) + await c.login("foo") + await clients[-1].connect(s.server_host, s.server_port) + with expect_codes_in_exception("530"): + await clients[-1].login("foo") + for c in clients[:-1]: + await c.quit() + + +@pytest.mark.asyncio +async def test_multiply_connections_relogin_balanced( + pair_factory, + Server, + expect_codes_in_exception, +): + Client = functools.partial( + aioftp.Client, + path_io_factory=aioftp.MemoryPathIO, + ) + s = Server(maximum_connections=4) + async with pair_factory(None, s, connected=False) as pair: + s = pair.server + clients = [Client() for _ in range(5)] + for c in clients[:-1]: + await c.connect(s.server_host, s.server_port) + await c.login() + await clients[0].quit() + await clients[-1].connect(s.server_host, s.server_port) + await clients[-1].login() + for c in clients[1:]: + await c.quit() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_passive.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_passive.py new file mode 100644 index 0000000000000000000000000000000000000000..98ab9c344015f7dcf6598fbc90dfc876f0cf9caa --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_passive.py @@ -0,0 +1,79 @@ +import pytest + + +async def not_implemented(connection, rest): + connection.response("502", ":P") + return True + + +@pytest.mark.asyncio +async def test_client_fallback_to_pasv_at_list(pair_factory): + async with pair_factory(host="127.0.0.1") as pair: + pair.server.epsv = not_implemented + await pair.client.list() + + +@pytest.mark.asyncio +async def test_client_fail_fallback_to_pasv_at_list( + pair_factory, + expect_codes_in_exception, +): + async with pair_factory(host="127.0.0.1") as pair: + pair.server.commands_mapping["epsv"] = not_implemented + with expect_codes_in_exception("502"): + await pair.client.get_passive_connection(commands=["epsv"]) + with expect_codes_in_exception("502"): + pair.client._passive_commands = ["epsv"] + await pair.client.get_passive_connection() + + +@pytest.mark.asyncio +async def test_client_only_passive_list(pair_factory): + async with pair_factory(host="127.0.0.1") as pair: + pair.client._passive_commands = ["pasv"] + await pair.client.list() + + +@pytest.mark.asyncio +async def test_client_only_enhanced_passive_list(pair_factory): + async with pair_factory(host="127.0.0.1") as pair: + pair.client._passive_commands = ["epsv"] + await pair.client.list() + + +@pytest.mark.asyncio +async def test_passive_no_choices(pair_factory): + async with pair_factory() as pair: + pair.client._passive_commands = [] + with pytest.raises(ValueError): + await pair.client.get_passive_connection(commands=[]) + + +@pytest.mark.asyncio +async def test_passive_bad_choices(pair_factory): + async with pair_factory() as pair: + pair.server.epsv = not_implemented + with pytest.raises(ValueError): + await pair.client.get_passive_connection(commands=["FOO"]) + + +@pytest.mark.parametrize("method", [("pasv", "227"), ("epsv", "229")]) +@pytest.mark.asyncio +async def test_passive_multicall(pair_factory, method): + async with pair_factory(host="127.0.0.1") as pair: + code, info = await pair.client.command(*method) + assert "created" in info[0] + code, info = await pair.client.command(*method) + assert "exists" in info[0] + + +@pytest.mark.parametrize("method", ["pasv", "epsv"]) +@pytest.mark.asyncio +async def test_passive_closed_on_recall(pair_factory, method): + async with pair_factory(host="127.0.0.1") as pair: + r, w = await pair.client.get_passive_connection(commands=[method]) + nr, nw = await pair.client.get_passive_connection(commands=[method]) + with pytest.raises((ConnectionResetError, BrokenPipeError)): + while True: + w.write(b"-") + await w.drain() diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_pathio.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_pathio.py new file mode 100644 index 0000000000000000000000000000000000000000..a44adc0cad621754f6b4a646556698fb085917fe --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_pathio.py @@ -0,0 +1,308 @@ +import contextlib + +import pytest + +import aioftp + + +@contextlib.contextmanager +def universal_exception_reason(*exc): + try: + yield + except aioftp.PathIOError as e: + type, instance, traceback = e.reason + m = f"Expect one of {exc}, got {instance}" + assert isinstance(instance, exc), m + else: + raise Exception(f"No excepton. Expect one of {exc}") + + +def test_has_state(path_io): + assert hasattr(path_io, "state") + path_io.state + + +@pytest.mark.asyncio +async def test_exists(path_io, temp_dir): + assert await path_io.exists(temp_dir) + assert not await path_io.exists(temp_dir / "foo") + + +@pytest.mark.asyncio +async def test_is_dir(path_io, temp_dir): + assert await path_io.is_dir(temp_dir) + p = temp_dir / "foo" + async with path_io.open(p, mode="wb"): + pass + assert not await path_io.is_dir(p) + + +@pytest.mark.asyncio +async def test_is_file(path_io, temp_dir): + p = temp_dir / "foo" + assert not await path_io.is_file(temp_dir) + async with path_io.open(p, mode="wb"): + pass + assert await path_io.is_file(p) + + +@pytest.mark.asyncio +async def test_mkdir(path_io, temp_dir): + p = temp_dir / "foo" + assert not await path_io.exists(p) + await path_io.mkdir(p) + assert await path_io.exists(p) + + +@pytest.mark.asyncio +async def test_rmdir(path_io, temp_dir): + p = temp_dir / "foo" + assert not await path_io.exists(p) + await path_io.mkdir(p) + assert await path_io.exists(p) + await path_io.rmdir(p) + assert not await path_io.exists(p) + + +@pytest.mark.asyncio +async def test_ulink(path_io, temp_dir): + p = temp_dir / "foo" + assert not await path_io.exists(p) + async with path_io.open(p, mode="wb"): + pass + assert await path_io.exists(p) + await path_io.unlink(p) + assert not await path_io.exists(p) + + +@pytest.mark.asyncio +async def test_list(path_io, temp_dir): + d, f = temp_dir / "dir", temp_dir / "file" + await path_io.mkdir(d) + async with path_io.open(f, mode="wb"): + pass + paths = await path_io.list(temp_dir) + assert len(paths) == 2 + assert set(paths) == {d, f} + paths = set() + async for p in path_io.list(temp_dir): + paths.add(p) + assert set(paths) == {d, f} + + +@pytest.mark.asyncio +async def test_stat(path_io, temp_dir): + stat = await path_io.stat(temp_dir) + for a in ["st_size", "st_mtime", "st_ctime", "st_nlink", "st_mode"]: + assert hasattr(stat, a) + + +@pytest.mark.asyncio +async def test_open_context(path_io, temp_dir): + p = temp_dir / "context" + async with path_io.open(p, mode="wb") as f: + await f.write(b"foo") + async with path_io.open(p, mode="rb") as f: + assert await f.read() == b"foo" + async with path_io.open(p, mode="ab") as f: + await f.write(b"bar") + async with path_io.open(p, mode="rb") as f: + assert await f.read() == b"foobar" + async with path_io.open(p, mode="wb") as f: + await f.write(b"foo") + async with path_io.open(p, mode="rb") as f: + assert await f.read() == b"foo" + async with path_io.open(p, mode="r+b") as f: + assert await f.read(1) == b"f" + await f.write(b"un") + async with path_io.open(p, mode="rb") as f: + assert await f.read() == b"fun" + + +@pytest.mark.asyncio +async def test_open_plain(path_io, temp_dir): + p = temp_dir / "plain" + f = await path_io.open(p, mode="wb") + await f.write(b"foo") + await f.close() + f = await path_io.open(p, mode="rb") + assert await f.read() == b"foo" + await f.close() + f = await path_io.open(p, mode="ab") + await f.write(b"bar") + await f.close() + f = await path_io.open(p, mode="rb") + assert await f.read() == b"foobar" + await f.close() + f = await path_io.open(p, mode="wb") + await f.write(b"foo") + await f.close() + f = await path_io.open(p, mode="rb") + assert await f.read() == b"foo" + await f.close() + f = await path_io.open(p, mode="r+b") + assert await f.read(1) == b"f" + await f.write(b"un") + await f.close() + f = await path_io.open(p, mode="rb") + assert await f.read() == b"fun" + await f.close() + + +@pytest.mark.asyncio +async def test_file_methods(path_io, temp_dir): + p = temp_dir / "foo" + async with path_io.open(p, mode="wb") as f: + await f.write(b"foo") + with universal_exception_reason(ValueError): + await path_io.seek(f, 0) + await f.seek(0) + await f.write(b"bar") + async with path_io.open(p, mode="rb") as f: + assert await f.read() == b"bar" + + +@pytest.mark.asyncio +async def test_rename(path_io, temp_dir): + old = temp_dir / "foo" + new = temp_dir / "bar" + await path_io.mkdir(old) + assert await path_io.exists(old) + assert not await path_io.exists(new) + await path_io.rename(old, new) + assert not await path_io.exists(old) + assert await path_io.exists(new) + + +def test_repr_works(path_io, temp_dir): + repr(path_io) + + +@pytest.mark.asyncio +async def test_path_over_file(path_io, temp_dir): + f = temp_dir / "file" + async with path_io.open(f, mode="wb"): + pass + assert not await path_io.exists(f / "dir") + + +@pytest.mark.asyncio +async def test_mkdir_over_file(path_io, temp_dir): + f = temp_dir / "file" + async with path_io.open(f, mode="wb"): + pass + with universal_exception_reason(FileExistsError): + await path_io.mkdir(f) + + +@pytest.mark.asyncio +async def test_mkdir_no_parents(path_io, temp_dir): + p = temp_dir / "foo" / "bar" + with universal_exception_reason(FileNotFoundError): + await path_io.mkdir(p) + + +@pytest.mark.asyncio +async def test_mkdir_parent_is_file(path_io, temp_dir): + f = temp_dir / "foo" + async with path_io.open(f, mode="wb"): + pass + with universal_exception_reason(NotADirectoryError): + await path_io.mkdir(f / "bar") + + +@pytest.mark.asyncio +async def test_mkdir_parent_is_file_with_parents(path_io, temp_dir): + f = temp_dir / "foo" + async with path_io.open(f, mode="wb"): + pass + with universal_exception_reason(NotADirectoryError): + await path_io.mkdir(f / "bar", parents=True) + + +@pytest.mark.asyncio +async def test_rmdir_not_exist(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.rmdir(temp_dir / "foo") + + +@pytest.mark.asyncio +async def test_rmdir_on_file(path_io, temp_dir): + f = temp_dir / "foo" + async with path_io.open(f, mode="wb"): + pass + with universal_exception_reason(NotADirectoryError): + await path_io.rmdir(f) + + +@pytest.mark.asyncio +async def test_rmdir_not_empty(path_io, temp_dir): + f = temp_dir / "foo" + async with path_io.open(f, mode="wb"): + pass + with universal_exception_reason(OSError): + await path_io.rmdir(temp_dir) + + +@pytest.mark.asyncio +async def test_unlink_not_exist(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.unlink(temp_dir / "foo") + + +@pytest.mark.asyncio +async def test_unlink_on_dir(path_io, temp_dir): + with universal_exception_reason(IsADirectoryError, PermissionError): + await path_io.unlink(temp_dir) + + +@pytest.mark.asyncio +async def test_list_not_exist(path_io, temp_dir): + assert await path_io.list(temp_dir / "foo") == [] + + +@pytest.mark.asyncio +async def test_stat_not_exist(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.stat(temp_dir / "foo") + + +@pytest.mark.asyncio +async def test_open_read_not_exist(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.open(temp_dir / "foo", mode="rb") + + +@pytest.mark.asyncio +async def test_open_write_unreachable(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.open(temp_dir / "foo" / "bar", mode="wb") + + +@pytest.mark.asyncio +async def test_open_write_directory(path_io, temp_dir): + with universal_exception_reason(IsADirectoryError): + await path_io.open(temp_dir, mode="wb") + + +@pytest.mark.asyncio +async def test_open_bad_mode(path_io, temp_dir): + with universal_exception_reason(ValueError): + await path_io.open(temp_dir, mode="bad") + + +@pytest.mark.asyncio +async def test_rename_source_or_dest_parent_not_exist(path_io, temp_dir): + with universal_exception_reason(FileNotFoundError): + await path_io.rename(temp_dir / "foo", temp_dir / "bar") + with universal_exception_reason(FileNotFoundError): + await path_io.rename(temp_dir, temp_dir / "foo" / "bar") + + +@pytest.mark.asyncio +async def test_rename_over_exists(path_io, temp_dir): + source = temp_dir / "source" + destination = temp_dir / "destination" + await path_io.mkdir(source) + await path_io.mkdir(destination) + await path_io.rename(source, destination) diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_permissions.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_permissions.py new file mode 100644 index 0000000000000000000000000000000000000000..15403eedbf0505ab5d3b06232b0ebcdf5b8ae6a6 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_permissions.py @@ -0,0 +1,36 @@ +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_permission_denied( + pair_factory, + Server, + expect_codes_in_exception, +): + s = Server( + [ + aioftp.User(permissions=[aioftp.Permission(writable=False)]), + ], + ) + async with pair_factory(None, s) as pair: + with expect_codes_in_exception("550"): + await pair.client.make_directory("foo") + + +@pytest.mark.asyncio +async def test_permission_overriden(pair_factory, Server): + s = Server( + [ + aioftp.User( + permissions=[ + aioftp.Permission("/", writable=False), + aioftp.Permission("/foo"), + ], + ), + ], + ) + async with pair_factory(None, s) as pair: + await pair.client.make_directory("foo") + await pair.client.remove_directory("foo") diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_restart.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_restart.py new file mode 100644 index 0000000000000000000000000000000000000000..45fd85d1c8960041e4fd0a304434208de9c7dde7 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_restart.py @@ -0,0 +1,47 @@ +import pytest + + +@pytest.mark.parametrize("offset", [0, 3, 10]) +@pytest.mark.asyncio +async def test_restart_retr(pair_factory, offset): + async with pair_factory() as pair: + atom = b"foobar" + name = "foo.txt" + await pair.make_server_files(name, size=1, atom=atom) + async with pair.client.download_stream(name, offset=offset) as stream: + assert await stream.read() == atom[offset:] + + +@pytest.mark.parametrize("offset", [1, 3, 10]) +@pytest.mark.parametrize("method", ["upload_stream", "append_stream"]) +@pytest.mark.asyncio +async def test_restart_stor_appe(pair_factory, offset, method): + async with pair_factory() as pair: + atom = b"foobar" + name = "foo.txt" + insert = b"123" + expect = atom[:offset] + b"\x00" * (offset - len(atom)) + insert + atom[offset + len(insert) :] + await pair.make_server_files(name, size=1, atom=atom) + stream_factory = getattr(pair.client, method) + async with stream_factory(name, offset=offset) as stream: + await stream.write(b"123") + async with pair.client.download_stream(name) as stream: + assert await stream.read() == expect + + +@pytest.mark.asyncio +async def test_restart_reset(pair_factory): + async with pair_factory() as pair: + atom = b"foobar" + name = "foo.txt" + await pair.make_server_files(name, size=1, atom=atom) + await pair.client.command("REST 3", "350") + async with pair.client.download_stream("foo.txt") as stream: + assert await stream.read() == atom + + +@pytest.mark.asyncio +async def test_restart_syntax_error(pair_factory, expect_codes_in_exception): + async with pair_factory() as pair: + with expect_codes_in_exception("501"): + await pair.client.command("REST 3abc", "350") diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_simple_functions.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_simple_functions.py new file mode 100644 index 0000000000000000000000000000000000000000..10e4d82527a0ce6dcfaf02fed0e25ff427eec99f --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_simple_functions.py @@ -0,0 +1,261 @@ +import asyncio +import datetime +import itertools +import pathlib + +import pytest + +import aioftp + + +def test_parse_directory_response(): + s = 'foo "baz "" test nop" """""fdfs """' + parsed = aioftp.Client.parse_directory_response(s) + assert parsed == pathlib.PurePosixPath('baz " test nop') + + +@pytest.mark.asyncio +async def test_connection_del_future(): + loop = asyncio.new_event_loop() + c = aioftp.Connection(loop=loop) + c.foo = "bar" + del c.future.foo + + +@pytest.mark.asyncio +async def test_connection_not_in_storage(): + loop = asyncio.new_event_loop() + c = aioftp.Connection(loop=loop) + with pytest.raises(AttributeError): + getattr(c, "foo") + + +def test_available_connections_too_much_acquires(): + ac = aioftp.AvailableConnections(3) + ac.acquire() + ac.acquire() + ac.acquire() + with pytest.raises(ValueError): + ac.acquire() + + +def test_available_connections_too_much_releases(): + ac = aioftp.AvailableConnections(3) + ac.acquire() + ac.release() + with pytest.raises(ValueError): + ac.release() + + +def test_parse_pasv_response(): + p = aioftp.Client.parse_pasv_response + assert p("(192,168,1,0,1,0)") == ("192.168.1.0", 256) + + +def test_parse_epsv_response(): + p = aioftp.Client.parse_epsv_response + assert p("some text (ha-ha) (|||665|) ((((666() (|fd667s).") == (None, 666) + assert p("some text (ha-ha) (|||665|) (6666666).") == (None, 666) + + +def _c_locale_time(d, format="%b %d %H:%M"): + with aioftp.common.setlocale("C"): + return d.strftime(format) + + +def test_parse_ls_date_of_leap_year(): + def date_to_p(d): + return d.strftime("%Y%m%d%H%M00") + + p = aioftp.Client.parse_ls_date + # Leap year date to test + d = datetime.datetime(year=2000, month=2, day=29) + current_and_expected_dates = ( + # 2016 (leap) + ( + datetime.datetime(year=2016, month=2, day=29), + datetime.datetime(year=2016, month=2, day=29), + ), + # 2017 + ( + datetime.datetime(year=2017, month=2, day=28), + datetime.datetime(year=2016, month=2, day=29), + ), + ( + datetime.datetime(year=2017, month=3, day=1), + datetime.datetime(year=2016, month=2, day=29), + ), + # 2018 + ( + datetime.datetime(year=2018, month=2, day=28), + datetime.datetime(year=2016, month=2, day=29), + ), + ( + datetime.datetime(year=2018, month=3, day=1), + datetime.datetime(year=2020, month=2, day=29), + ), + # 2019 + ( + datetime.datetime(year=2019, month=2, day=28), + datetime.datetime(year=2020, month=2, day=29), + ), + ( + datetime.datetime(year=2019, month=3, day=1), + datetime.datetime(year=2020, month=2, day=29), + ), + # 2020 (leap) + ( + datetime.datetime(year=2020, month=2, day=29), + datetime.datetime(year=2020, month=2, day=29), + ), + ) + for now, expected in current_and_expected_dates: + assert p(_c_locale_time(d), now=now) == date_to_p(expected) + + +def test_parse_ls_date_not_older_than_6_month_format(): + def date_to_p(d): + return d.strftime("%Y%m%d%H%M00") + + p = aioftp.Client.parse_ls_date + dates = ( + datetime.datetime(year=2002, month=1, day=1), + datetime.datetime(year=2002, month=12, day=31), + ) + dt = datetime.timedelta(seconds=15778476 // 2) + deltas = (datetime.timedelta(), dt, -dt) + for now, delta in itertools.product(dates, deltas): + d = now + delta + assert p(_c_locale_time(d), now=now) == date_to_p(d) + + +def test_parse_ls_date_older_than_6_month_format(): + def date_to_p(d): + return d.strftime("%Y%m%d%H%M00") + + p = aioftp.Client.parse_ls_date + dates = ( + datetime.datetime(year=2002, month=1, day=1), + datetime.datetime(year=2002, month=12, day=31), + ) + dt = datetime.timedelta(seconds=15778476, days=30) + deltas = (dt, -dt) + for now, delta in itertools.product(dates, deltas): + d = now + delta + if delta.total_seconds() > 0: + expect = date_to_p(d.replace(year=d.year - 1)) + else: + expect = date_to_p(d.replace(year=d.year + 1)) + assert p(_c_locale_time(d), now=now) == expect + + +def test_parse_ls_date_short(): + def date_to_p(d): + return d.strftime("%Y%m%d%H%M00") + + p = aioftp.Client.parse_ls_date + dates = ( + datetime.datetime(year=2002, month=1, day=1), + datetime.datetime(year=2002, month=12, day=31), + ) + for d in dates: + s = _c_locale_time(d, format="%b %d %Y") + assert p(s) == date_to_p(d) + + +def test_parse_list_line_unix(): + lines = { + "file": [ + "-rw-rw-r-- 1 poh poh 6595 Feb 27 04:14 history.rst", + "lrwxrwxrwx 1 poh poh 6 Mar 23 05:46 link-tmp.py -> tmp.py", + ], + "dir": [ + "drw-rw-r-- 1 poh poh 6595 Feb 27 04:14 history.rst", + "drw-rw-r-- 1 poh poh 6595 Jan 03 2016 changes.rst", + "drw-rw-r-- 1 poh poh 6595 Mar 10 1996 README.rst", + ], + "unknown": [ + "Erw-rw-r-- 1 poh poh 6595 Feb 27 04:14 history.rst", + ], + } + p = aioftp.Client(encoding="utf-8").parse_list_line_unix + for t, stack in lines.items(): + for line in stack: + _, parsed = p(line.encode("utf-8")) + assert parsed["type"] == t + with pytest.raises(ValueError): + p(b"-rw-rw-r-- 1 poh poh 6xx5 Feb 27 04:14 history.rst") + with pytest.raises(ValueError): + p(b"-rw-rw-r-- xx poh poh 6595 Feb 27 04:14 history.rst") + + _, parsed = p(b"lrwxrwxrwx 1 poh poh 6 Mar 23 05:46 link-tmp.py -> tmp.py") + assert parsed["type"] == "file" + assert parsed["link_dst"] == "tmp.py" + + _, parsed = p(b"lrwxrwxrwx 1 poh poh 6 Mar 23 05:46 link-tmp.py -> /tmp.py") + assert parsed["type"] == "file" + assert parsed["link_dst"] == "/tmp.py" + + +@pytest.mark.parametrize("owner", ["s", "x", "-", "E"]) +@pytest.mark.parametrize("group", ["s", "x", "-", "E"]) +@pytest.mark.parametrize("others", ["t", "x", "-", "E"]) +@pytest.mark.parametrize("read", ["r", "-"]) +@pytest.mark.parametrize("write", ["w", "-"]) +def test_parse_unix_mode(owner, group, others, read, write): + s = f"{read}{write}{owner}{read}{write}{group}{read}{write}{others}" + if "E" in {owner, group, others}: + with pytest.raises(ValueError): + aioftp.Client.parse_unix_mode(s) + else: + assert isinstance(aioftp.Client.parse_unix_mode(s), int) + + +def test_parse_list_line_failed(): + with pytest.raises(ValueError): + aioftp.Client(encoding="utf-8").parse_list_line(b"what a hell?!") + + +def test_reprs_works(): + repr(aioftp.Throttle()) + repr(aioftp.Permission()) + repr(aioftp.User()) + + +def test_throttle_reset(): + t = aioftp.Throttle(limit=1, reset_rate=1) + t.append(b"-" * 3, 0) + assert t._start == 0 + assert t._sum == 3 + t.append(b"-" * 3, 2) + assert t._start == 2 + assert t._sum == 4 + + +def test_permission_is_parent(): + p = aioftp.Permission("/foo/bar") + assert p.is_parent(pathlib.PurePosixPath("/foo/bar/baz")) + assert not p.is_parent(pathlib.PurePosixPath("/bar/baz")) + + +def test_server_mtime_build(): + now = datetime.datetime(year=2002, month=1, day=1).timestamp() + past = datetime.datetime(year=2001, month=1, day=1).timestamp() + b = aioftp.Server.build_list_mtime + assert b(now, now) == "Jan 1 00:00" + assert b(past, now) == "Jan 1 2001" + + +@pytest.mark.asyncio +async def test_get_paths_windows_traverse(): + base_path = pathlib.PureWindowsPath("C:\\ftp") + user = aioftp.User() + user.base_path = base_path + connection = aioftp.Connection(current_directory=base_path, user=user) + virtual_path = pathlib.PurePosixPath("/foo/C:\\windows") + real_path, resolved_virtual_path = aioftp.Server.get_paths( + connection, + virtual_path, + ) + assert real_path == pathlib.PureWindowsPath("C:/ftp/foo/C:/windows") + assert resolved_virtual_path == pathlib.PurePosixPath("/foo/C:\\windows") diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_throttle.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_throttle.py new file mode 100644 index 0000000000000000000000000000000000000000..2fcc8ca15482fa098542464f66149edbe4b3303f --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_throttle.py @@ -0,0 +1,92 @@ +import asyncio +from functools import reduce +from pathlib import Path + +import pytest + +import aioftp + + +@pytest.mark.asyncio +async def test_patched_sleep(skip_sleep): + await asyncio.sleep(10) + assert skip_sleep.is_close(10) + + +SIZE = 3 * 100 * 1024 # 300KiB + + +@pytest.mark.parametrize("times", [10, 20, 30]) +@pytest.mark.parametrize("type", ["read", "write"]) +@pytest.mark.parametrize("direction", ["download", "upload"]) +@pytest.mark.asyncio +async def test_client_side_throttle( + pair_factory, + skip_sleep, + times, + type, + direction, +): + async with pair_factory() as pair: + await pair.make_server_files("foo", size=SIZE) + await pair.make_client_files("foo", size=SIZE) + getattr(pair.client.throttle, type).limit = SIZE / times + await getattr(pair.client, direction)("foo") + if (type, direction) in {("read", "download"), ("write", "upload")}: + assert skip_sleep.is_close(times) + else: + assert skip_sleep.is_close(0) + + +@pytest.mark.parametrize("times", [10, 20, 30]) +@pytest.mark.parametrize("users", [1, 2, 3]) +@pytest.mark.parametrize("throttle_direction", ["read", "write"]) +@pytest.mark.parametrize("data_direction", ["download", "upload"]) +@pytest.mark.parametrize( + "throttle_level", + [ + "throttle", + "throttle_per_connection", + ], +) +@pytest.mark.asyncio +async def test_server_side_throttle( + pair_factory, + skip_sleep, + times, + users, + throttle_direction, + data_direction, + throttle_level, +): + async with pair_factory() as pair: + names = [] + for i in range(users): + name = f"foo{i}" + names.append(name) + await pair.make_server_files(name, size=SIZE) + throttle = reduce( + getattr, + [throttle_level, throttle_direction], + pair.server, + ) + throttle.limit = SIZE / times + clients = [] + for name in names: + c = aioftp.Client(path_io_factory=aioftp.MemoryPathIO) + async with c.path_io.open(Path(name), "wb") as f: + await f.write(b"-" * SIZE) + await c.connect(pair.server.server_host, pair.server.server_port) + await c.login() + clients.append(c) + coros = [getattr(c, data_direction)(n) for c, n in zip(clients, names)] + await asyncio.gather(*coros) + await asyncio.gather(*[c.quit() for c in clients]) + throttled = {("read", "upload"), ("write", "download")} + if (throttle_direction, data_direction) not in throttled: + assert skip_sleep.is_close(0) + else: + t = times + if throttle_level == "throttle": # global + t *= users + assert skip_sleep.is_close(t) diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_tls.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_tls.py new file mode 100644 index 0000000000000000000000000000000000000000..ad4a903bbcd44940f1241f65bc25dfc3039e8a29 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_tls.py @@ -0,0 +1,97 @@ +import sys + +import pytest + +if sys.version_info < (3, 11): + pytest.skip(reason="required python 3.11+", allow_module_level=True) + + +def simple_response(code, message): + async def command(connection, rest): + connection.response(code, message) + return True + + return command + + +AUTH_RESPONSE = simple_response("234", ":P") +PBSZ_RESPONSE = simple_response("200", ":P") +PROT_RESPONSE = simple_response("200", ":P") +OK_RESPONSE = simple_response("200", ":P") + + +@pytest.mark.asyncio +async def test_upgrade_to_tls(mocker, pair_factory): + ssl_context = object() + create_default_context = mocker.patch("aioftp.client.ssl.create_default_context", return_value=ssl_context) + + async with pair_factory(logged=False, do_quit=False) as pair: + pair.server.commands_mapping["auth"] = AUTH_RESPONSE + pair.server.commands_mapping["pbsz"] = PBSZ_RESPONSE + pair.server.commands_mapping["prot"] = PROT_RESPONSE + + start_tls = mocker.patch.object(pair.client.stream, "start_tls") + command_spy = mocker.spy(pair.client, "command") + + await pair.client.upgrade_to_tls() + + create_default_context.assert_called_once_with() + start_tls.assert_called_once_with(sslcontext=ssl_context, server_hostname=pair.client.server_host) + assert command_spy.call_count == 3 + command_spy.assert_has_calls( + [ + mocker.call("AUTH TLS", "234"), + mocker.call("PBSZ 0", "200"), + mocker.call("PROT P", "200"), + ], + ) + + +@pytest.mark.asyncio +async def test_upgrade_to_tls_custom_ssl_context(mocker, pair_factory): + ssl_context = object() + create_default_context = mocker.patch("aioftp.client.ssl.create_default_context") + + async with pair_factory(logged=False, do_quit=False) as pair: + pair.server.commands_mapping["auth"] = AUTH_RESPONSE + pair.server.commands_mapping["pbsz"] = PBSZ_RESPONSE + pair.server.commands_mapping["prot"] = PROT_RESPONSE + + start_tls = mocker.patch.object(pair.client.stream, "start_tls") + command_spy = mocker.spy(pair.client, "command") + + await pair.client.upgrade_to_tls(sslcontext=ssl_context) + + create_default_context.assert_not_called() + start_tls.assert_called_once_with(sslcontext=ssl_context, server_hostname=pair.client.server_host) + assert command_spy.call_count == 3 + command_spy.assert_has_calls( + [ + mocker.call("AUTH TLS", "234"), + mocker.call("PBSZ 0", "200"), + mocker.call("PROT P", "200"), + ], + ) + + +@pytest.mark.asyncio +async def test_upgrade_to_tls_when_logged_in(mocker, pair_factory): + mocker.patch("aioftp.client.ssl.create_default_context") + + async with pair_factory(logged=False, do_quit=False) as pair: + pair.server.commands_mapping["auth"] = AUTH_RESPONSE + pair.server.commands_mapping["pbsz"] = OK_RESPONSE + pair.server.commands_mapping["prot"] = OK_RESPONSE + + mocker.patch.object(pair.client.stream, "start_tls") + command_spy = mocker.spy(pair.client, "command") + + await pair.client.upgrade_to_tls() + + command_spy.assert_has_calls( + [ + mocker.call("AUTH TLS", "234"), + mocker.call("PBSZ 0", "200"), + mocker.call("PROT P", "200"), + ], + ) diff --git a/harbor/sources/aioftp-v11/grading/baseline/tests/test_user.py b/harbor/sources/aioftp-v11/grading/baseline/tests/test_user.py new file mode 100644 index 0000000000000000000000000000000000000000..cec51665155a4ba65e7cbe6f49782f6c5f4b6da0 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/baseline/tests/test_user.py @@ -0,0 +1,8 @@ +import pytest + +import aioftp + + +def test_user_not_absolute_home(): + with pytest.raises(aioftp.errors.PathIsNotAbsolute): + aioftp.User(home_path="foo") diff --git a/harbor/sources/aioftp-v11/grading/graders.py b/harbor/sources/aioftp-v11/grading/graders.py new file mode 100644 index 0000000000000000000000000000000000000000..08408fc165c91ef4bf4ddb3e27503f880bdf0ec3 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/graders.py @@ -0,0 +1,760 @@ +"""Criterion registry and score arithmetic for aioftp_stream_abort_desynchronization. + +``CRITERIA_SPECS`` implements the approved grader draft one criterion per Case inventory case. +Each criterion has exactly one child with share ``1.0``; the child aggregates the probe fixtures +that exercise its case (``fraction`` over the five server commands, ``all`` over the scenario +variants of one case, otherwise a single fixture). ``compute_evaluation_result`` turns child values +into the raw score, applies the shared safety ceiling, the regression ceiling and the integrity +zero, and builds the diagnostic payload every downstream reader consumes. +""" + +from __future__ import annotations + +import warnings +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +GRADER_HEALTH_OK = "healthy" +SAFETY_CEILING = 0.60 +REGRESSION_CEILING = 0.30 +INTEGRITY_ZERO = 0.0 +SCORE_DIGITS = 6 + +SERVER_COMMANDS = ("RETR", "STOR", "APPE", "LIST", "MLSD") +ABOR_REPLY_VARIANTS = ("abor-225", "abor-226") +CANCELLATION_VARIANTS = ("cancel-abort", "cancel-finish", "cancel-abort-after-final", "cancel-finish-then-finish") +ABANDONED_TRANSFER_VARIANTS = ("list-break", "list-aclose", "get-stream-unfinished") +LISTENER_VARIANTS = ("data-ports", "ephemeral", "open-data") +REJECTED_ABOR_VARIANTS = ("idle-500", "after-complete-500") +PIPELINE_VARIANTS = ("cwd-pwd", "mkd-cwd-pwd", "rnfr-rnto", "dele-retr", "retr-abor") +REAL_CLIENT_ABOR_VARIANTS = ("telnet-inline", "bsd-urgent", "ftplib-abort", "telnet-idle") +QUIT_VARIANTS = ("quit-retr", "quit-stor", "quit-no-data") +DATA_LOSS_VARIANTS = ("retr-close", "retr-reset", "stor-reset") +PIPELINED_ABORT_VARIANTS = ("retr-abor", "stor-abor", "retr-abor-pwd", "appe-abor", "retr-abor-abor") +PIPELINED_QUIT_VARIANTS = ("retr-quit", "stor-quit", "appe-quit", "list-quit") +NOWAIT_ABORT_VARIANTS = ("close-then-command", "abort-again", "new-download", "get-stream-unfinished") +COMMAND_DURING_ABORT_VARIANTS = ("command-with-abort", "command-during-finish-and-abort") + +# One record per approved criterion. `audit_id` names the requirement row of +# intake/agent-contract-audit.md and `prompt_section` the prompt text that requires it (AP01); +# `fixtures` names the probe fixtures its child aggregates. +CRITERIA_SPECS: list[dict[str, Any]] = [ + { + "id": "server_early_abort_session", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-01", + "budget_class": "easy", + "audit_id": "A01", + "prompt_section": "Server (aioftp.Server), bullet 1", + "children": [ + { + "id": "early_abor_replies_and_session_survives", + "case": "CASE-01", + "share": 1.0, + "aggregation": "fraction", + "probe": "server", + "fixtures": [("CASE-01", command) for command in SERVER_COMMANDS], + } + ], + }, + { + "id": "client_stream_exit_after_abort", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-02", + "budget_class": "easy", + "audit_id": "A02", + "prompt_section": "Client (aioftp.Client), bullet 4", + "children": [ + { + "id": "block_exit_reads_nothing_more", + "case": "CASE-02", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-02", None)], + } + ], + }, + { + "id": "client_abort_after_completed_transfer", + "weight": 0.007, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G1_stale_reply_after_abort", + "case": "CASE-03", + "budget_class": "easy", + "audit_id": "A04", + "prompt_section": "Protocol paragraph; Client (aioftp.Client), bullets 1-2", + "children": [ + { + "id": "completed_transfer_then_abort", + "case": "CASE-03", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-03", variant) for variant in ABOR_REPLY_VARIANTS], + } + ], + }, + { + "id": "client_abort_idle_225", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-04", + "budget_class": "easy", + "audit_id": "A05", + "prompt_section": "Client (aioftp.Client), bullet 3", + "children": [ + { + "id": "idle_abort_accepts_225", + "case": "CASE-04", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-04", None)], + } + ], + }, + { + "id": "client_abort_after_failed_transfer", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-05", + "budget_class": "easy", + "audit_id": "A04", + "prompt_section": "Protocol paragraph; Client (aioftp.Client), bullets 1-2", + "children": [ + { + "id": "failed_transfer_then_abort", + "case": "CASE-05", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-05", None)], + } + ], + }, + { + "id": "client_error_exit_mid_transfer", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-06", + "budget_class": "easy", + "audit_id": "A07", + "prompt_section": "Client (aioftp.Client), bullet 5", + "children": [ + { + "id": "error_exit_mid_transfer_in_sync", + "case": "CASE-06", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-06", None)], + } + ], + }, + { + "id": "client_error_exit_after_completed_transfer", + "weight": 0.007, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G2_stale_reply_after_error_exit", + "case": "CASE-07", + "budget_class": "easy", + "audit_id": "A07", + "prompt_section": "Client (aioftp.Client), bullet 5", + "children": [ + { + "id": "error_exit_after_completion_in_sync", + "case": "CASE-07", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-07", variant) for variant in ABOR_REPLY_VARIANTS], + } + ], + }, + { + "id": "client_abort_idle_rejected", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-08", + "budget_class": "easy", + "audit_id": "A14", + "prompt_section": "Client (aioftp.Client), bullet 3", + "children": [ + { + "id": "idle_abort_rejects_non_22x", + "case": "CASE-08", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-08", variant) for variant in REJECTED_ABOR_VARIANTS], + } + ], + }, + { + "id": "client_upload_stream_abort", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-09", + "budget_class": "easy", + "audit_id": "A07", + "prompt_section": "Client (aioftp.Client), bullet 5", + "children": [ + { + "id": "upload_error_exit_in_sync", + "case": "CASE-09", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-09", None)], + } + ], + }, + { + "id": "client_abort_concurrent", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-10", + "budget_class": "easy", + "audit_id": "A15", + "prompt_section": "Client (aioftp.Client), bullet 7", + "children": [ + { + "id": "concurrent_abort_in_sync", + "case": "CASE-10", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-10", None)], + } + ], + }, + { + "id": "client_cancelled_abort_or_finish", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-11", + "budget_class": "easy", + "audit_id": "A16", + "prompt_section": "Client (aioftp.Client), bullet 6", + "children": [ + { + "id": "cancelled_wait_leaves_replies_owed", + "case": "CASE-11", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-11", variant) for variant in CANCELLATION_VARIANTS], + } + ], + }, + { + "id": "client_abort_during_finish", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-12", + "budget_class": "easy", + "audit_id": "A17", + "prompt_section": "Client (aioftp.Client), bullet 8", + "children": [ + { + "id": "abort_interrupts_finish_wait", + "case": "CASE-12", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-12", None)], + } + ], + }, + { + "id": "client_abandoned_listing_resync", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-13", + "budget_class": "easy", + "audit_id": "A18", + "prompt_section": "Client (aioftp.Client), bullet 9", + "children": [ + { + "id": "abandoned_transfer_settled_by_next_command", + "case": "CASE-13", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-13", variant) for variant in ABANDONED_TRANSFER_VARIANTS], + } + ], + }, + { + "id": "server_listener_release_after_abort", + "weight": 0.007, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G3_stale_data_connection_after_abort", + "case": "CASE-14", + "budget_class": "easy", + "audit_id": "A19", + "prompt_section": "Server (aioftp.Server), bullet 3", + "children": [ + { + "id": "aborted_listener_closed_and_port_returned", + "case": "CASE-14", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-14", variant) for variant in LISTENER_VARIANTS], + } + ], + }, + { + "id": "server_repeated_abor_order", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-15", + "budget_class": "easy", + "audit_id": "A03", + "prompt_section": "Server (aioftp.Server), bullet 2", + "children": [ + { + "id": "repeated_abor_replies_in_order", + "case": "CASE-15", + "share": 1.0, + "aggregation": "single", + "probe": "server", + "fixtures": [("CASE-15", None)], + } + ], + }, + { + "id": "server_pipelined_command_order", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-16", + "budget_class": "easy", + "audit_id": "A20", + "prompt_section": "Server (aioftp.Server), bullet 4", + "children": [ + { + "id": "pipelined_commands_executed_in_sequence", + "case": "CASE-16", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-16", variant) for variant in PIPELINE_VARIANTS], + } + ], + }, + { + "id": "server_real_client_abor", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-17", + "budget_class": "easy", + "audit_id": "A21", + "prompt_section": "Server (aioftp.Server), bullet 5", + "children": [ + { + "id": "telnet_and_urgent_abor_handled", + "case": "CASE-17", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-17", variant) for variant in REAL_CLIENT_ABOR_VARIANTS], + } + ], + }, + { + "id": "server_quit_during_transfer", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-18", + "budget_class": "easy", + "audit_id": "A22", + "prompt_section": "Server (aioftp.Server), bullet 6", + "children": [ + { + "id": "quit_waits_for_active_transfer", + "case": "CASE-18", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-18", variant) for variant in QUIT_VARIANTS], + } + ], + }, + { + "id": "server_data_connection_loss", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-19", + "budget_class": "easy", + "audit_id": "A23", + "prompt_section": "Server (aioftp.Server), bullet 7", + "children": [ + { + "id": "data_connection_loss_aborts_transfer", + "case": "CASE-19", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-19", variant) for variant in DATA_LOSS_VARIANTS], + } + ], + }, + { + "id": "server_undecodable_command_syntax", + "weight": 0.03, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-20", + "budget_class": "difficult", + "audit_id": "A24", + "prompt_section": "Server (aioftp.Server), bullet 8", + "children": [ + { + "id": "undecodable_command_replies_500", + "case": "CASE-20", + "share": 1.0, + "aggregation": "single", + "probe": "server", + "fixtures": [("CASE-20", None)], + } + ], + }, + { + "id": "client_abort_after_cancelled_finish", + "weight": 0.025, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G4_stale_reply_after_cancelled_finish", + "case": "CASE-21", + "budget_class": "difficult", + "audit_id": "A25", + "prompt_section": "Client (aioftp.Client), bullet 6", + "children": [ + { + "id": "abort_after_cancelled_finish_sends_abor", + "case": "CASE-21", + "share": 1.0, + "aggregation": "single", + "probe": "client", + "fixtures": [("CASE-21", None)], + } + ], + }, + { + "id": "server_pipelined_abort_open_data", + "weight": 0.399, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-22", + "budget_class": "difficult", + "audit_id": "A26", + "prompt_section": "Protocol paragraph; Server (aioftp.Server), bullets 2 and 4", + "children": [ + { + "id": "pipelined_abor_aborts_open_transfer", + "case": "CASE-22", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-22", variant) for variant in PIPELINED_ABORT_VARIANTS], + } + ], + }, + { + "id": "server_pipelined_quit_open_data", + "weight": 0.399, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-23", + "budget_class": "difficult", + "audit_id": "A27", + "prompt_section": "Server (aioftp.Server), bullet 6", + "children": [ + { + "id": "pipelined_quit_waits_for_open_transfer", + "case": "CASE-23", + "share": 1.0, + "aggregation": "all", + "probe": "server", + "fixtures": [("CASE-23", variant) for variant in PIPELINED_QUIT_VARIANTS], + } + ], + }, + { + "id": "client_nowait_abort_owed_replies", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-24", + "budget_class": "easy", + "audit_id": "A28", + "prompt_section": "Client (aioftp.Client), bullet 4", + "children": [ + { + "id": "nowait_abort_replies_never_reach_later_command", + "case": "CASE-24", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-24", variant) for variant in NOWAIT_ABORT_VARIANTS], + } + ], + }, + { + "id": "client_command_during_abort", + "weight": 0.007, + "evidence_class": "functional", + "is_safety_gate": False, + "gate_id": None, + "case": "CASE-25", + "budget_class": "easy", + "audit_id": "A29", + "prompt_section": "Client (aioftp.Client), bullet 7", + "children": [ + { + "id": "command_during_abort_gets_own_reply", + "case": "CASE-25", + "share": 1.0, + "aggregation": "all", + "probe": "client", + "fixtures": [("CASE-25", variant) for variant in COMMAND_DURING_ABORT_VARIANTS], + } + ], + }, +] + +def probe_fixtures() -> list[tuple[str, str, str | None]]: + """Every probe fixture the registry needs, as ``(probe, case, variant)``, in registry order.""" + fixtures: list[tuple[str, str, str | None]] = [] + for spec in CRITERIA_SPECS: + for child in spec["children"]: + for case, variant in child["fixtures"]: + fixtures.append((child["probe"], case, variant)) + return fixtures + + +def fixture_key(case: str, variant: str | None) -> str: + return f"{case}/{variant}" if variant else case + + +def case_weights() -> list[dict[str, Any]]: + """The implemented absolute weight of every case: criterion weight x child share.""" + rows = [] + for spec in CRITERIA_SPECS: + for child in spec["children"]: + rows.append( + { + "criterion": spec["id"], + "child": child["id"], + "case": child["case"], + "criterion_weight": spec["weight"], + "share": child["share"], + "absolute_weight": round(spec["weight"] * child["share"], SCORE_DIGITS), + } + ) + return rows + + +def _aggregate(aggregation: str, outcomes: list[bool]) -> float: + if not outcomes: + return 0.0 + if aggregation == "fraction": + return sum(1 for passed in outcomes if passed) / len(outcomes) + return 1.0 if all(outcomes) else 0.0 + + +def _child_diagnostic(child: dict[str, Any], value: float, fixtures: list[dict[str, Any]]) -> str: + passed = sum(1 for fixture in fixtures if fixture["passed"]) + failing = [fixture["fixture"] for fixture in fixtures if not fixture["passed"]] + text = f"{child['aggregation']}: {passed}/{len(fixtures)} fixtures passed; value {value:g}" + if failing: + reasons = sorted({str(fixture.get("failure") or "failed") for fixture in fixtures if not fixture["passed"]}) + text += f"; failing {', '.join(failing)} ({'; '.join(reasons)[:240]})" + return text + + +def compute_evaluation_result( + fixture_results: dict[str, dict[str, Any]], + regression: dict[str, Any], + integrity: dict[str, Any], + extra_info: dict[str, Any] | None = None, +) -> EvaluationResult: + """Score probe fixture outcomes and ceilings into one healthy ``EvaluationResult``. + + ``fixture_results`` maps ``fixture_key`` to ``{"passed": bool, "failure": str | None, ...}``; + a missing fixture counts as failed. ``regression`` carries ``failed`` and its diagnostics; + ``integrity`` carries ``breaches`` (an empty list when none). Only a healthy measurement + reaches this function: grader faults are reported by ``fault_result`` instead. + """ + criteria: list[dict[str, Any]] = [] + subscores: list[SubScore] = [] + raw = 0.0 + gates_fired: list[str] = [] + gate_statuses: dict[str, bool] = {} + for spec in CRITERIA_SPECS: + children = [] + value = 0.0 + for child in spec["children"]: + fixtures = [] + for case, variant in child["fixtures"]: + key = fixture_key(case, variant) + outcome = fixture_results.get(key) or {"passed": False, "failure": "not measured"} + fixtures.append( + { + "fixture": key, + "passed": bool(outcome.get("passed")), + "failure": outcome.get("failure"), + "observations": outcome.get("observations", {}), + } + ) + child_value = round(_aggregate(child["aggregation"], [f["passed"] for f in fixtures]), SCORE_DIGITS) + value += child["share"] * child_value + children.append( + { + "id": child["id"], + "case": child["case"], + "value": child_value, + "share": child["share"], + "passed": child_value >= 1.0, + "contribution": round(spec["weight"] * child["share"] * child_value, SCORE_DIGITS), + "aggregation": child["aggregation"], + "diagnostic": _child_diagnostic(child, child_value, fixtures), + "diagnostics": fixtures, + } + ) + value = round(value, SCORE_DIGITS) + contribution = round(spec["weight"] * value, SCORE_DIGITS) + raw += contribution + if spec["is_safety_gate"]: + gate_passed = all(child["value"] >= 1.0 for child in children) + gate_statuses[spec["gate_id"]] = gate_passed + if not gate_passed: + gates_fired.append(spec["gate_id"]) + record = { + "id": spec["id"], + "name": spec["id"], + "weight": spec["weight"], + "value": value, + "contribution": contribution, + "evidence_class": spec["evidence_class"], + "is_safety_gate": spec["is_safety_gate"], + "gate_id": spec["gate_id"], + "case": spec["case"], + "audit_id": spec["audit_id"], + "diagnostic": "; ".join(child["diagnostic"] for child in children), + "children": children, + } + criteria.append(record) + subscores.append( + SubScore( + name=spec["id"], + weight=spec["weight"], + value=value, + info={key: record[key] for key in ("id", "weight", "value", "contribution", "evidence_class", + "is_safety_gate", "gate_id", "case", "diagnostic", "children")}, + ) + ) + raw = round(raw, SCORE_DIGITS) + + caps: list[dict[str, Any]] = [] + if gates_fired: + caps.append({"id": "safety_gate_ceiling", "value": SAFETY_CEILING, "gates": list(gates_fired), + "reason": "a safety gate child scored below 1.0"}) + build_failed = bool(regression.get("failed")) + if build_failed: + caps.append({"id": "regression_ceiling", "value": REGRESSION_CEILING, + "failed_node_ids": list(regression.get("failed_node_ids") or []), + "reason": regression.get("reason") or "the pristine native suite failed"}) + breaches = list(integrity.get("breaches") or []) + if breaches: + caps.append({"id": "integrity_zero", "value": INTEGRITY_ZERO, "breaches": breaches, + "reason": "confirmed integrity breach"}) + final = round(min([raw, *(cap["value"] for cap in caps)]), SCORE_DIGITS) + + info: dict[str, Any] = { + "raw_score": raw, + "final_score": final, + "caps": caps, + "criteria": criteria, + "grader_health": GRADER_HEALTH_OK, + "gates_fired": gates_fired, + "gate_statuses": gate_statuses, + "safety_gates_failed": bool(gates_fired), + "build_failed": build_failed, + "regression": regression, + "integrity": {"verdict": "breach" if breaches else "clean", "breaches": breaches, + "checks": integrity.get("checks", [])}, + "score_formula": "final = min(raw, 0.60 if a gate fired, 0.30 if the pristine suite failed, 0.00 on an integrity breach)", + } + if extra_info: + info.update(extra_info) + summary = f"raw {raw:.4f}, final {final:.4f}, gates fired {gates_fired or 'none'}, build_failed {build_failed}" + with warnings.catch_warnings(): + # HUD warns when a ceiling makes the reward differ from the weighted subscores; that is the + # approved arithmetic, and info.raw_score / info.caps say so explicitly. + warnings.simplefilter("ignore", UserWarning) + return EvaluationResult(reward=final, done=True, isError=False, content=summary, info=info, subscores=subscores) + + +def fault_result(stage: str, detail: str, extra_info: dict[str, Any] | None = None) -> EvaluationResult: + """A fail-closed grader fault: zero scores, an error flag, non-healthy health, explicit lists.""" + info: dict[str, Any] = { + "raw_score": 0.0, + "final_score": 0.0, + "caps": [], + "criteria": [], + "grader_health": f"fault:{stage}", + "grader_health_detail": detail[:300], + "gates_fired": [], + "gate_statuses": {}, + "integrity": {"verdict": "not_measured", "breaches": [], "checks": []}, + } + if extra_info: + info.update(extra_info) + return EvaluationResult( + reward=0.0, done=True, isError=True, content=f"grader fault at {stage}", info=info, subscores=[] + ) diff --git a/harbor/sources/aioftp-v11/grading/integrity.py b/harbor/sources/aioftp-v11/grading/integrity.py new file mode 100644 index 0000000000000000000000000000000000000000..3185f0522a0b341699430f5005ae3faede8ab1e8 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/integrity.py @@ -0,0 +1,68 @@ +"""Integrity checks that force a zero score only on a confirmed breach. + +Two breaches are recognised, as the approved grader draft defines them: + +* ``patched_runtime`` -- importing the candidate's ``aioftp`` replaced ``asyncio.wait_for``, + ``asyncio.open_connection``, ``asyncio.start_server`` or ``socket.socket`` (observed by every + probe process, which compares the objects' identities before and after the import); +* ``grader_or_gold_reference`` -- candidate source under ``src/`` names the root-only grader or + gold locations in executable code (a string constant, parsed with ``ast`` so comments and + docstrings are ignored). + +A grader fault never becomes a breach: this module only reports what it observed. +""" + +from __future__ import annotations + +import ast +from pathlib import Path +from typing import Any + +PROTECTED_LOCATIONS = ("/hud", "/mcp_server", "gold.diff") + + +def names_protected_location(value: str) -> bool: + """True for a string naming the root-only server root, its predecessor, or the gold patch.""" + return ( + value in ("/hud", "/mcp_server") + or value.startswith(("/hud/", "/mcp_server/")) + or "gold.diff" in value + ) + + +def _docstring_nodes(tree: ast.AST) -> set[int]: + ids: set[int] = set() + for node in ast.walk(tree): + if isinstance(node, ast.Module | ast.ClassDef | ast.FunctionDef | ast.AsyncFunctionDef): + body = getattr(node, "body", []) + if body and isinstance(body[0], ast.Expr) and isinstance(body[0].value, ast.Constant): + ids.add(id(body[0].value)) + return ids + + +def static_reference_breaches(tree_root: Path) -> list[dict[str, Any]]: + breaches: list[dict[str, Any]] = [] + source = tree_root / "src" + if not source.is_dir(): + return breaches + for path in sorted(source.rglob("*.py")): + try: + tree = ast.parse(path.read_text(encoding="utf-8", errors="replace")) + except (OSError, SyntaxError, ValueError): + continue + docstrings = _docstring_nodes(tree) + for node in ast.walk(tree): + if not isinstance(node, ast.Constant) or not isinstance(node.value, str) or id(node) in docstrings: + continue + if names_protected_location(node.value): + breaches.append({ + "id": "grader_or_gold_reference", + "file": path.relative_to(tree_root).as_posix(), + "line": getattr(node, "lineno", None), + }) + return breaches + + +def runtime_patch_breaches(replaced_by_fixture: dict[str, list[str]]) -> list[dict[str, Any]]: + attributes = sorted({name for names in replaced_by_fixture.values() for name in names}) + return [{"id": "patched_runtime", "attribute": name} for name in attributes] diff --git a/harbor/sources/aioftp-v11/grading/probes/client_probe.py b/harbor/sources/aioftp-v11/grading/probes/client_probe.py new file mode 100644 index 0000000000000000000000000000000000000000..e4eae5504698f261ab2304df4dff4083dd10ea07 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/probes/client_probe.py @@ -0,0 +1,419 @@ +"""Client probe: one CASE-02..CASE-13, CASE-21, CASE-24 or CASE-25 scenario against the candidate's public ``aioftp.Client``. + +Invoked as ``python -I client_probe.py ``. The scenario drives only public client +methods against the grader-owned scripted server, and the value it compares is what +``Client.get_current_directory()`` returns for the server's randomized working directory: a +successor ``PWD`` that reads a stale reply left over from the abort or the stream exit either +raises or returns something else. +""" + +from __future__ import annotations + +import asyncio +import secrets +import sys +from pathlib import Path, PurePosixPath + +sys.path.insert(0, str(Path(__file__).resolve().parent)) + +from hudprobe_common import ( # noqa: E402 + WAIT_FOR, + HarnessFault, + PhaseTimeout, + ResultWriter, + bounded, + describe, + import_candidate, + load_config, +) +from hudprobe_fixture import BLOCK, ScriptedFtpServer # noqa: E402 + +BOUND_SECONDS = 10.0 + +# case -> (transfer script, default ABOR reply when nothing is left to abort) +CASES = { + "CASE-02": ("streaming", "226"), + "CASE-03": ("complete", None), + "CASE-04": ("none", "225"), + "CASE-05": ("error", "226"), + "CASE-06": ("streaming", "226"), + "CASE-07": ("complete", None), + "CASE-09": ("streaming", "226"), + "CASE-10": ("streaming", "226"), + "CASE-12": ("held", "226"), + "CASE-21": ("held", "226"), +} +VARIANTS = {"abor-225": "225", "abor-226": "226"} +CANCEL_SECONDS = 0.3 +REPLY_DELAY_SECONDS = 1.0 # the slow server's owed replies arrive well after the cancelled wait gave up +# case -> reply delay in seconds, for single-fixture cases that need the slow server +CASE_REPLY_DELAYS = {"CASE-21": REPLY_DELAY_SECONDS} +# case -> variant -> (transfer script, ABOR reply once nothing is left to abort, reply delay in seconds) +SCRIPTED_VARIANTS = { + "CASE-08": {"idle-500": ("none", "500", 0.0), "after-complete-500": ("complete", "500", 0.0)}, + "CASE-11": { + "cancel-abort": ("streaming", "226", REPLY_DELAY_SECONDS), + "cancel-finish": ("complete", "226", REPLY_DELAY_SECONDS), + "cancel-abort-after-final": ("streaming", "226", REPLY_DELAY_SECONDS), + "cancel-finish-then-finish": ("complete", "226", REPLY_DELAY_SECONDS), + }, + "CASE-13": { + "list-break": ("listing", "226", 0.0), + "list-aclose": ("listing", "226", 0.0), + "get-stream-unfinished": ("streaming", "226", 0.0), + }, + "CASE-24": { + "close-then-command": ("streaming", "226", 0.0), + "abort-again": ("streaming", "226", 0.0), + "new-download": ("streaming", "226", 0.0), + "get-stream-unfinished": ("streaming", "226", 0.0), + }, + "CASE-25": { + "command-with-abort": ("streaming", "226", 0.0), + "command-during-finish-and-abort": ("held", "226", 0.0), + }, +} +# (case, variant) whose slow server writes the transfer's final reply at once and delays only the +# ABOR reply: the cancelled abort() is left owing the ABOR reply alone +ABOR_REPLY_ONLY_DELAYED = {("CASE-11", "cancel-abort-after-final")} + + +class ProbeAbort(Exception): + """Probe-private exception raised inside a stream's ``async with`` block.""" + + +def _abor_after_retr(log: list[str]) -> bool: + return "RETR" in log and "ABOR" in log[log.index("RETR") + 1 :] + + +async def _read_to_eof(stream) -> int: + total = 0 + while True: + block = await stream.read(BLOCK) + if not block: + return total + total += len(block) + + +async def run_case(aioftp, case: str, fixture: ScriptedFtpServer, obs: dict) -> bool: + client = aioftp.Client() + try: + await bounded(client.connect("127.0.0.1", fixture.port), BOUND_SECONDS, "connect") + await bounded(client.login(), BOUND_SECONDS, "login") + name = fixture.filename + + if case == "CASE-02": + + async def exit_after_abort() -> None: + async with client.download_stream(name) as stream: + await stream.read(BLOCK) + await client.abort() + + await bounded(exit_after_abort(), BOUND_SECONDS, "stream_block_exit") + obs["block_exit"] = "returned" + elif case in ("CASE-03", "CASE-05"): + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + obs["bytes_read"] = await bounded(_read_to_eof(stream), BOUND_SECONDS, "read_to_eof") + await bounded(client.abort(), BOUND_SECONDS, "abort") + obs["abort"] = "returned" + stream.close() + elif case == "CASE-04": + await bounded(client.abort(), BOUND_SECONDS, "abort") + obs["abort"] = "returned" + elif case == "CASE-08": + if obs["variant"] == "after-complete-500": + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + obs["bytes_read"] = await bounded(_read_to_eof(stream), BOUND_SECONDS, "read_to_eof") + try: + await bounded(client.abort(), BOUND_SECONDS, "abort") + obs["abort"] = "did_not_raise" + return False + except aioftp.StatusCodeError as exc: + obs["abort"] = "raised_status_code_error" + obs["received_codes"] = [str(c) for c in exc.received_codes] + if obs["variant"] == "after-complete-500": + stream.close() + elif case == "CASE-09": + raised = ProbeAbort("probe-" + secrets.token_hex(4)) + + async def error_exit_upload() -> None: + async with client.upload_stream(name) as stream: + await stream.write(b"upload-chunk-" + secrets.token_hex(64).encode("ascii")) + raise raised + + try: + await bounded(error_exit_upload(), BOUND_SECONDS, "stream_error_exit") + except ProbeAbort as exc: + obs["propagated"] = "same_instance" if exc is raised else "other_probe_abort" + else: + obs["propagated"] = "nothing" + if obs["propagated"] != "same_instance": + return False + elif case == "CASE-11": + variant = obs["variant"] + if variant in ("cancel-abort", "cancel-abort-after-final"): + + async def cancelled_abort() -> None: + async with client.download_stream(name) as stream: + await stream.read(BLOCK) + try: + await WAIT_FOR(client.abort(), CANCEL_SECONDS) + except TimeoutError: + obs["abort"] = "cancelled" + else: + obs["abort"] = "returned_before_replies" + + await bounded(cancelled_abort(), BOUND_SECONDS, "stream_block_exit") + obs["block_exit"] = "returned" + else: + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + obs["bytes_read"] = await bounded(_read_to_eof(stream), BOUND_SECONDS, "read_to_eof") + try: + await WAIT_FOR(stream.finish(), CANCEL_SECONDS) + except TimeoutError: + obs["finish"] = "cancelled" + else: + obs["finish"] = "returned_before_reply" + if variant == "cancel-finish-then-finish": + # the owed reply belongs to the cancelled call: finishing again must not raise + try: + await bounded(stream.finish(), BOUND_SECONDS, "finish_again") + except asyncio.CancelledError: + obs["failure"] = "finish_again raised CancelledError" + return False + obs["finish_again"] = "returned" + elif case == "CASE-12": + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + await bounded(stream.read(BLOCK), BOUND_SECONDS, "read_block") + finish_task = asyncio.create_task(stream.finish()) + await asyncio.sleep(0.1) + abort_task = asyncio.create_task(client.abort()) + finished, aborted = await bounded( + asyncio.gather(finish_task, abort_task, return_exceptions=True), BOUND_SECONDS, "finish_and_abort" + ) + obs["finish"] = "returned" if finished is None else describe(finished) + obs["abort"] = "returned" if aborted is None else describe(aborted) + if isinstance(aborted, BaseException): + obs["failure"] = "abort raised: " + describe(aborted) + return False + if isinstance(finished, BaseException) and not isinstance(finished, aioftp.StatusCodeError): + obs["failure"] = "finish raised: " + describe(finished) + return False + elif case == "CASE-21": + # finish() is cancelled while the held transfer still owes its final reply; abort() must + # still send ABOR (the server answers the transfer only then) and consume both replies, + # and a later finish() must neither read them again nor raise + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + await bounded(stream.read(BLOCK), BOUND_SECONDS, "read_block") + try: + await WAIT_FOR(stream.finish(), CANCEL_SECONDS) + except TimeoutError: + obs["finish"] = "cancelled" + else: + obs["finish"] = "returned_before_reply" + await bounded(client.abort(), BOUND_SECONDS, "abort") + obs["abort"] = "returned" + try: + await bounded(stream.finish(), BOUND_SECONDS, "finish_again") + except asyncio.CancelledError: + obs["failure"] = "finish_again raised CancelledError" + return False + obs["finish_again"] = "returned" + elif case == "CASE-24": + # abort(wait=False) returns without reading: the replies it leaves on the control + # connection must never be handed to whatever the client does next + variant = obs["variant"] + if variant == "get-stream-unfinished": + stream = await bounded(client.get_stream(f"RETR {name}", "1xx"), BOUND_SECONDS, "open_stream") + else: + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + await bounded(stream.read(BLOCK), BOUND_SECONDS, "read_block") + await bounded(client.abort(wait=False), BOUND_SECONDS, "abort_no_wait") + obs["abort_no_wait"] = "returned" + if variant == "abort-again": + await bounded(client.abort(), BOUND_SECONDS, "abort") + obs["abort"] = "returned" + if variant != "get-stream-unfinished": + stream.close() + if variant == "new-download": + second = await bounded(client.download_stream(name), BOUND_SECONDS, "open_second_stream") + await bounded(second.read(BLOCK), BOUND_SECONDS, "read_second_block") + await bounded(client.abort(), BOUND_SECONDS, "abort_second") + second.close() + obs["second_transfer"] = "aborted" + elif case == "CASE-25": + # an ordinary command issued from another task while abort() is in progress + variant = obs["variant"] + stream = await bounded(client.download_stream(name), BOUND_SECONDS, "open_stream") + await bounded(stream.read(BLOCK), BOUND_SECONDS, "read_block") + tasks = [] + if variant == "command-during-finish-and-abort": + tasks.append(asyncio.create_task(stream.finish())) + await asyncio.sleep(0.2) + abort_task = asyncio.create_task(client.abort()) + await asyncio.sleep(0) + command_task = asyncio.create_task(client.get_current_directory()) + results = await bounded( + asyncio.gather(*tasks, abort_task, command_task, return_exceptions=True), + BOUND_SECONDS, + "abort_and_command", + ) + aborted, directory = results[-2], results[-1] + obs["abort"] = "returned" if aborted is None else describe(aborted) + if isinstance(directory, BaseException): + obs["concurrent_pwd"] = describe(directory) + else: + obs["concurrent_pwd"] = "matched" if directory == PurePosixPath(fixture.pwd) else "different_path" + if tasks: + finished = results[0] + obs["finish"] = "returned" if finished is None else describe(finished) + if isinstance(finished, BaseException) and not isinstance(finished, aioftp.StatusCodeError): + obs["failure"] = "finish raised: " + describe(finished) + return False + if isinstance(aborted, BaseException): + obs["failure"] = "abort raised: " + describe(aborted) + return False + if obs["concurrent_pwd"] != "matched": + obs["failure"] = "concurrent command: " + obs["concurrent_pwd"] + return False + stream.close() + elif case == "CASE-13": + variant = obs["variant"] + if variant == "get-stream-unfinished": + stream = await bounded(client.get_stream(f"RETR {name}", "1xx"), BOUND_SECONDS, "open_stream") + await bounded(stream.read(BLOCK), BOUND_SECONDS, "read_block") + obs["stream"] = "left_unfinished" + else: + lister = client.list("/") + entries = 0 + async for _path, _info in lister: + entries += 1 + break + obs["entries_before_break"] = entries + if variant == "list-aclose": + await bounded(lister.aclose(), BOUND_SECONDS, "lister_aclose") + obs["aclose"] = "returned" + obs["transfer_open_after_aclose"] = fixture.transfer_open + if fixture.transfer_open: + obs["failure"] = "aclose returned with the listing still outstanding" + return False + elif case == "CASE-10": + async with client.download_stream(name) as stream: + await stream.read(BLOCK) + tasks = [ + asyncio.create_task(client.abort()), + asyncio.create_task(client.abort()), + ] + results = await bounded( + asyncio.gather(*tasks, return_exceptions=True), + BOUND_SECONDS, + "concurrent_abort", + ) + for r in results: + if isinstance(r, BaseException): + raise r + obs["abort"] = "returned" + else: + raised = ProbeAbort("probe-" + secrets.token_hex(4)) + + async def error_exit() -> None: + async with client.download_stream(name) as stream: + if case == "CASE-06": + await stream.read(BLOCK) + else: + await _read_to_eof(stream) + raise raised + + try: + await bounded(error_exit(), BOUND_SECONDS, "stream_error_exit") + except ProbeAbort as exc: + obs["propagated"] = "same_instance" if exc is raised else "other_probe_abort" + else: + obs["propagated"] = "nothing" + if obs["propagated"] != "same_instance": + return False + + directory = await bounded(client.get_current_directory(), BOUND_SECONDS, "successor_pwd") + obs["successor_pwd"] = "matched" if directory == PurePosixPath(fixture.pwd) else "different_path" + if obs["successor_pwd"] != "matched": + return False + if case in ("CASE-03", "CASE-05", "CASE-21"): + return _abor_after_retr(fixture.log) + if case in ("CASE-02", "CASE-04", "CASE-08", "CASE-10", "CASE-12", "CASE-24", "CASE-25"): + return "ABOR" in fixture.log + if case == "CASE-11": + return "ABOR" in fixture.log if obs["variant"] in ("cancel-abort", "cancel-abort-after-final") else True + return True + except PhaseTimeout as exc: + obs["failure"] = f"timeout:{exc.phase}" + return False + except Exception as exc: # noqa: BLE001 - any candidate exception is a candidate outcome + obs["failure"] = describe(exc) + if isinstance(exc, ProbeAbort): + obs["propagated"] = "unexpected" + return False + finally: + try: + client.close() + except Exception: # noqa: BLE001 - closing is best effort + pass + + +async def main(config: dict, writer: ResultWriter) -> None: + case = config["case"] + variant = config.get("variant") + delay = 0.0 + if case in SCRIPTED_VARIANTS: + if variant not in SCRIPTED_VARIANTS[case]: + raise HarnessFault("config", "case needs a scenario variant") + script, idle, delay = SCRIPTED_VARIANTS[case][variant] + elif case in CASES: + script, idle = CASES[case] + delay = CASE_REPLY_DELAYS.get(case, 0.0) + if idle is None: + if variant not in VARIANTS: + raise HarnessFault("config", "case needs an ABOR reply variant") + idle = VARIANTS[variant] + else: + raise HarnessFault("config", "unknown client case") + payload = b"payload-" + secrets.token_hex(16384).encode("ascii") + fixture = ScriptedFtpServer( + script=script, + idle_abor_reply=idle, + payload=payload, + pwd=f"/hud-probe-{secrets.token_hex(4)}/{secrets.token_hex(3)}", + filename=f"blob-{secrets.token_hex(4)}.bin", + reply_delay=delay, + delay_final_reply=(case, variant) not in ABOR_REPLY_ONLY_DELAYED, + ) + await fixture.start() + try: + writer.write("candidate_running") + obs: dict = {"variant": variant} if variant else {} + try: + aioftp, replaced = import_candidate(config["tree"]) + except HarnessFault: + raise + except BaseException as exc: # noqa: BLE001 - an import failure is a candidate outcome + writer.write("ok", passed=False, integrity_replaced=[], observations={"failure": "import:" + describe(exc)}) + return + passed = await run_case(aioftp, case, fixture, obs) + obs["command_log"] = list(fixture.log) + obs["final_replies"] = list(fixture.final_replies) + writer.write("ok", passed=bool(passed), integrity_replaced=replaced, observations=obs) + finally: + await fixture.close() + + +if __name__ == "__main__": + try: + cfg = load_config(sys.argv) + except HarnessFault as fault: + print(f"harness fault: {fault.stage}", file=sys.stderr) + sys.exit(3) + result = ResultWriter(cfg["out"], cfg["case"], cfg.get("variant")) + try: + asyncio.run(main(cfg, result)) + except HarnessFault as fault: + result.write("harness_fault", stage=fault.stage, detail=fault.detail) + sys.exit(3) diff --git a/harbor/sources/aioftp-v11/grading/probes/hudprobe_common.py b/harbor/sources/aioftp-v11/grading/probes/hudprobe_common.py new file mode 100644 index 0000000000000000000000000000000000000000..f6a6a131d5c8f984e36ac6fc116a6207f3180360 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/probes/hudprobe_common.py @@ -0,0 +1,134 @@ +"""Shared harness for the hidden aioftp probes. + +Every probe runs in its own ``python -I`` process. The harness keeps two kinds of failure apart: + +* a candidate outcome -- the candidate's ``aioftp`` raised, hung past a bound, or returned the + wrong value -- is written as ``status: ok`` with ``passed: false``; and +* a harness fault -- the grader-owned fixture could not bind, the configuration is unreadable -- + is written as ``status: harness_fault`` and makes the whole grade unhealthy. + +Before any candidate code runs the harness writes ``status: candidate_running``. A process that +dies or is killed after that point (``os._exit`` in candidate code, a blocked event loop) is +therefore a candidate outcome, while a process that never got that far is a harness fault. + +The identities of the asyncio and socket entry points the fixture and the bounds rely on are +recorded before the candidate package is imported and compared afterwards, so an import that +replaces one of them is reported as an integrity breach. +""" + +from __future__ import annotations + +import asyncio +import json +import os +import socket +import sys +from pathlib import Path +from typing import Any + +SCHEMA_VERSION = 1 + +# Captured before the candidate is imported; the probes only ever call these references. +WAIT_FOR = asyncio.wait_for +OPEN_CONNECTION = asyncio.open_connection +START_SERVER = asyncio.start_server + +GUARDED_ATTRIBUTES = ( + ("asyncio", "wait_for"), + ("asyncio", "open_connection"), + ("asyncio", "start_server"), + ("socket", "socket"), +) +_GUARDED_MODULES = {"asyncio": asyncio, "socket": socket} + + +class HarnessFault(Exception): + """A failure of grader-owned probe material, never of the candidate.""" + + def __init__(self, stage: str, detail: str) -> None: + super().__init__(f"{stage}: {detail}") + self.stage = stage + self.detail = detail + + +class PhaseTimeout(Exception): + """A candidate step exceeded its bound.""" + + def __init__(self, phase: str, seconds: float) -> None: + super().__init__(f"{phase} did not finish within {seconds:g}s") + self.phase = phase + + +def load_config(argv: list[str]) -> dict[str, Any]: + if len(argv) != 2: + raise HarnessFault("config", "expected exactly one configuration path") + try: + config = json.loads(Path(argv[1]).read_text(encoding="utf-8")) + except (OSError, ValueError) as exc: + raise HarnessFault("config", f"unreadable configuration ({type(exc).__name__})") from None + for key in ("tree", "case", "out"): + if not isinstance(config.get(key), str) or not config[key]: + raise HarnessFault("config", f"configuration lacks {key!r}") + return config + + +class ResultWriter: + """Atomically replaces the probe's single result file.""" + + def __init__(self, out: str, case: str, variant: str | None) -> None: + self.path = Path(out) + self.base = {"schema_version": SCHEMA_VERSION, "case": case, "variant": variant} + + def write(self, status: str, **fields: Any) -> None: + payload = {**self.base, "status": status, **fields} + temporary = self.path.with_name(self.path.name + ".tmp") + temporary.write_text(json.dumps(payload, sort_keys=True, default=str), encoding="utf-8") + os.replace(temporary, self.path) + + +def guarded_identities() -> dict[str, int]: + return {f"{module}.{name}": id(getattr(_GUARDED_MODULES[module], name)) for module, name in GUARDED_ATTRIBUTES} + + +def import_candidate(tree: str) -> tuple[Any, list[str]]: + """Import ``aioftp`` from ``/src`` only; return the module and any replaced attributes. + + Every other ``sys.path`` entry that carries an ``aioftp`` package (the image's editable path + to the agent workspace, for example) is dropped first, so the graded tree is the only source. + An import failure propagates: it is a candidate outcome. + """ + source = (Path(tree) / "src").resolve() + kept = [] + for entry in sys.path: + if not entry: + continue + try: + carries = (Path(entry) / "aioftp" / "__init__.py").exists() and Path(entry).resolve() != source + except OSError: + carries = False + if not carries: + kept.append(entry) + sys.path[:] = [str(source), *kept] + before = guarded_identities() + import aioftp # noqa: PLC0415 - the candidate is imported only after the identities are recorded + + after = guarded_identities() + replaced = sorted(name for name, identity in before.items() if after.get(name) != identity) + module_file = Path(getattr(aioftp, "__file__", "") or "").resolve() + if source not in module_file.parents: + raise HarnessFault("candidate_import", "aioftp resolved outside the graded tree") + return aioftp, replaced + + +async def bounded(awaitable: Any, seconds: float, phase: str) -> Any: + """Await a candidate step under a bound, using the pre-import ``asyncio.wait_for``.""" + try: + return await WAIT_FOR(awaitable, seconds) + except TimeoutError: + raise PhaseTimeout(phase, seconds) from None + + +def describe(exc: BaseException) -> str: + """A short, path-free description of a candidate exception.""" + text = str(exc).replace("\n", " ")[:160] + return f"{type(exc).__name__}: {text}" if text else type(exc).__name__ diff --git a/harbor/sources/aioftp-v11/grading/probes/hudprobe_fixture.py b/harbor/sources/aioftp-v11/grading/probes/hudprobe_fixture.py new file mode 100644 index 0000000000000000000000000000000000000000..0352076deb834c1c6dc6f1c65b93d1a0cebd12bb --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/probes/hudprobe_fixture.py @@ -0,0 +1,308 @@ +"""Grader-owned scripted RFC 959 server used by the client probes. + +It is written from the protocol rules the task prompt states, not from any implementation: + +* a data-transfer command answered ``150`` gets exactly one final reply; +* ``ABOR`` during a transfer is answered with the transfer's final reply (``426``) first and the + ``ABOR`` reply (``226``) second; +* ``ABOR`` with nothing left to abort -- including a transfer that has already ended -- gets one + reply, whose spelling (``225`` or ``226``) the case chooses; +* commands other than ``ABOR`` are served one at a time, so a transfer's final reply is always on + the wire before the reply to the next command. + +Transfer scripts: + +``complete`` the file is written, ``226 Transfer complete`` is sent, then the data socket closes; +``error`` one block is written, ``451`` is sent, then the data socket closes; +``streaming`` a few blocks are written and the socket is held open until ``ABOR`` (final ``426``) + or until the client closes the data connection (final ``426``); +``held`` like ``streaming``, but the client closing the data connection ends nothing: the + final ``426`` is sent only once ``ABOR`` arrives (a server that has not yet noticed + the closed data path); +``listing`` ``MLSD``/``LIST`` write two entries and are then held open like ``streaming``. + +With ``reply_delay`` the transfer's final reply and the ``ABOR`` reply are written only after that +many seconds (a slow server), or as soon as the next command other than ``ABOR`` arrives, whichever +comes first: the replies are still owed to the client, in order, before that command's own reply. +With ``delay_final_reply=False`` only the ``ABOR`` reply is delayed that way: the transfer's final +reply is written at once, so a transfer aborted mid-stream has its ``426`` on the wire while the +``ABOR`` reply is still owed. +""" + +from __future__ import annotations + +import asyncio +import contextlib + +from hudprobe_common import START_SERVER, HarnessFault + +BLOCK = 8192 +DATA_WAIT_SECONDS = 10.0 +SCRIPTS = ("none", "complete", "error", "streaming", "held", "listing") +LISTING = b"type=file;size=4;modify=20240101000000; alpha.txt\r\ntype=file;size=4;modify=20240101000000; beta.txt\r\n" + + +class ScriptedFtpServer: + def __init__( + self, + *, + script: str, + idle_abor_reply: str, + payload: bytes, + pwd: str, + filename: str, + reply_delay: float = 0.0, + delay_final_reply: bool = True, + ) -> None: + if script not in SCRIPTS or idle_abor_reply not in ("225", "226", "500"): + raise HarnessFault("fixture_config", "unknown transfer script or ABOR reply") + self.script = script + self.idle_abor_reply = idle_abor_reply + self.reply_delay = reply_delay + self.delay_final_reply = delay_final_reply + self._held: list[str] = [] + self._flush_handle: asyncio.TimerHandle | None = None + self.payload = payload + self.pwd = pwd + self.filename = filename + self.log: list[str] = [] + self.port = 0 + self._server: asyncio.base_events.Server | None = None + self._tasks: set[asyncio.Task] = set() + self._ctrl: asyncio.StreamWriter | None = None + self._data_listener: asyncio.base_events.Server | None = None + self._data: asyncio.Future | None = None + self._transfer_task: asyncio.Task | None = None + self._data_pair: tuple[asyncio.StreamReader, asyncio.StreamWriter] | None = None + self._transfer_open = False + self._idle = asyncio.Event() + self._idle.set() + self.final_replies: list[str] = [] + + @property + def transfer_open(self) -> bool: + """True while a transfer accepted with ``150`` still owes its final reply.""" + return self._transfer_open + + async def start(self) -> int: + try: + self._server = await START_SERVER(self._session, "127.0.0.1", 0) + except OSError as exc: + raise HarnessFault("fixture_bind", f"control listener could not bind ({type(exc).__name__})") from None + self.port = self._server.sockets[0].getsockname()[1] + return self.port + + async def close(self) -> None: + for task in list(self._tasks): + task.cancel() + for listener in (self._data_listener, self._server): + if listener is not None: + listener.close() + with contextlib.suppress(Exception): + await asyncio.wait_for(listener.wait_closed(), 2) + if self._ctrl is not None: + self._ctrl.close() + + # -- control connection ------------------------------------------------------------------- + + def _spawn(self, coro) -> asyncio.Task: + task = asyncio.get_running_loop().create_task(coro) + self._tasks.add(task) + task.add_done_callback(self._tasks.discard) + return task + + def _send(self, line: str) -> None: + if self._ctrl is not None and not self._ctrl.is_closing(): + self._ctrl.write(line.encode("ascii") + b"\r\n") + + def _send_owed(self, line: str, *, abor_reply: bool = False) -> None: + """A transfer's final reply or an ``ABOR`` reply: written now, or delayed as a slow server would.""" + if self.reply_delay <= 0 or (not abor_reply and not self.delay_final_reply and not self._held): + self._send(line) + return + self._held.append(line) + if self._flush_handle is None: + self._flush_handle = asyncio.get_running_loop().call_later(self.reply_delay, self._flush_held) + + def _flush_held(self) -> None: + if self._flush_handle is not None: + self._flush_handle.cancel() + self._flush_handle = None + held, self._held = self._held, [] + for line in held: + self._send(line) + + async def _session(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + if self._ctrl is not None: + writer.close() + return + self._ctrl = writer + self._send("220 hud probe ready") + queue: asyncio.Queue = asyncio.Queue() + self._spawn(self._read_commands(reader, queue)) + try: + while True: + item = await queue.get() + if item is None: + break + verb, argument = item + # Serve commands one at a time: the next reply waits for the transfer's final reply. + await self._idle.wait() + self._flush_held() + if not await self._dispatch(verb, argument): + break + finally: + self._finish_transfer(None) + writer.close() + + async def _read_commands(self, reader: asyncio.StreamReader, queue: asyncio.Queue) -> None: + try: + while True: + raw = await reader.readline() + if not raw: + break + line = raw.decode("utf-8", errors="replace").strip() + verb, _, argument = line.partition(" ") + verb = verb.upper() + self.log.append(verb) + if verb == "ABOR": + # ABOR is handled out of band, even while a transfer holds the command queue. + self._abort() + else: + queue.put_nowait((verb, argument)) + except (ConnectionError, asyncio.IncompleteReadError): + pass + finally: + queue.put_nowait(None) + + def _abort(self) -> None: + if self._finish_transfer("426 Transfer aborted"): + self._send_owed("226 Abort successful", abor_reply=True) + elif self.idle_abor_reply == "225": + self._send_owed("225 No transfer to ABOR", abor_reply=True) + elif self.idle_abor_reply == "500": + self._send_owed("500 Syntax error in parameters", abor_reply=True) + else: + self._send_owed("226 No transfer to ABOR", abor_reply=True) + + async def _dispatch(self, verb: str, argument: str) -> bool: + if verb == "USER": + self._send("331 Password required") + elif verb == "PASS": + self._send("230 Logged in") + elif verb == "TYPE": + self._send("200 Type set") + elif verb == "PWD": + self._send(f'257 "{self.pwd}" is the current directory') + elif verb == "EPSV": + port = await self._open_data_listener() + self._send(f"229 Entering extended passive mode (|||{port}|)") + elif verb in ("RETR", "STOR") and self.script not in ("none", "listing"): + await self._start_transfer(argument) + elif verb in ("MLSD", "LIST") and self.script == "listing": + await self._start_transfer(argument, listing=True) + elif verb == "QUIT": + self._send("221 Goodbye") + return False + else: + self._send("502 Command not implemented") + return True + + # -- data connection ---------------------------------------------------------------------- + + async def _open_data_listener(self) -> int: + if self._data_listener is not None: + self._data_listener.close() + loop = asyncio.get_running_loop() + self._data = loop.create_future() + + def accepted(reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + if self._data is not None and not self._data.done(): + self._data.set_result((reader, writer)) + else: + writer.close() + + try: + self._data_listener = await START_SERVER(accepted, "127.0.0.1", 0) + except OSError as exc: + raise HarnessFault("fixture_bind", f"data listener could not bind ({type(exc).__name__})") from None + return self._data_listener.sockets[0].getsockname()[1] + + async def _start_transfer(self, argument: str, *, listing: bool = False) -> None: + if (not listing and argument.strip().lstrip("/") != self.filename) or self._data is None: + self._send("550 No such file") + return + try: + reader, writer = await asyncio.wait_for(asyncio.shield(self._data), DATA_WAIT_SECONDS) + except TimeoutError: + self._send("425 Can't open data connection") + return + self._data = None + self._send("150 Opening data connection") + self._transfer_open = True + self._idle.clear() + self._data_pair = (reader, writer) + self._transfer_task = self._spawn(self._run_script(reader, writer)) + + def _finish_transfer(self, final_reply: str | None) -> bool: + """Send the transfer's single final reply and close its data socket; False if none is open.""" + if not self._transfer_open: + return False + self._transfer_open = False + current = asyncio.current_task() + if self._transfer_task is not None and self._transfer_task is not current: + self._transfer_task.cancel() + if final_reply is not None: + self.final_replies.append(final_reply[:3]) + self._send_owed(final_reply) + if self._data_pair is not None: + self._data_pair[1].close() + self._idle.set() + return True + + async def _run_script(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + try: + if self.script == "complete": + writer.write(self.payload) + await writer.drain() + self._complete_with("226 Transfer complete") + elif self.script == "error": + writer.write(self.payload[:BLOCK]) + await writer.drain() + self._complete_with("451 Requested action aborted: local error in processing") + else: + writer.write(LISTING if self.script == "listing" else self.payload) + await writer.drain() + while True: + chunk = await reader.read(65536) + if not chunk: + break + if self.script == "held": + # the data path is gone but this server has not noticed: only ABOR ends it + await asyncio.Event().wait() + self._finish_transfer("426 Connection closed; transfer aborted") + except asyncio.CancelledError: + raise + except (ConnectionError, OSError): + if self.script == "held": + await asyncio.Event().wait() + self._finish_transfer("426 Connection closed; transfer aborted") + + def _complete_with(self, final_reply: str) -> None: + # The final reply is written to the control socket before the data socket closes, so it is + # already queued on the control connection when the client observes end of data. + if not self._transfer_open: + return + self._transfer_open = False + self.final_replies.append(final_reply[:3]) + self._send_owed(final_reply) + self._spawn(self._close_data_after_reply()) + + async def _close_data_after_reply(self) -> None: + if self._ctrl is not None: + with contextlib.suppress(ConnectionError): + await self._ctrl.drain() + await asyncio.sleep(0.05) + if self._data_pair is not None: + self._data_pair[1].close() + self._idle.set() diff --git a/harbor/sources/aioftp-v11/grading/probes/server_probe.py b/harbor/sources/aioftp-v11/grading/probes/server_probe.py new file mode 100644 index 0000000000000000000000000000000000000000..49a767a0be53edcee8b3bebe058d80f195dc5034 --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/probes/server_probe.py @@ -0,0 +1,692 @@ +"""Server probe: CASE-01, CASE-14 to CASE-20, CASE-22 and CASE-23 against the candidate's ``aioftp.Server``. + +Invoked as ``python -I server_probe.py ``. +""" + +from __future__ import annotations + +import asyncio +import contextlib +import re +import secrets +import socket +import struct +import sys +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parent)) + +from hudprobe_common import ( # noqa: E402 + OPEN_CONNECTION, + HarnessFault, + PhaseTimeout, + ResultWriter, + bounded, + describe, + import_candidate, + load_config, +) + +COMMANDS = ("RETR", "STOR", "APPE", "LIST", "MLSD") +LISTENER_VARIANTS = ("data-ports", "ephemeral", "open-data") +PIPELINE_VARIANTS = ("cwd-pwd", "mkd-cwd-pwd", "rnfr-rnto", "dele-retr", "retr-abor") +REAL_CLIENT_ABOR_VARIANTS = ("telnet-inline", "bsd-urgent", "ftplib-abort", "telnet-idle") +QUIT_VARIANTS = ("quit-retr", "quit-stor", "quit-no-data") +DATA_LOSS_VARIANTS = ("retr-close", "retr-reset", "stor-reset") +PIPELINED_ABORT_VARIANTS = ("retr-abor", "stor-abor", "retr-abor-pwd", "appe-abor", "retr-abor-abor") +PIPELINED_QUIT_VARIANTS = ("retr-quit", "stor-quit", "appe-quit", "list-quit") + +REPLY_SECONDS = 5.0 +LATE_DATA_SECONDS = 0.5 +SLOW_READ_SECONDS = 0.02 +SLOW_CLOSE_SECONDS = 0.5 +SLOW_PATH_SECONDS = 0.05 +DATA_ACCEPT_SECONDS = 0.2 # lets the server accept a data connection before the pipelined commands are written +STALLED_PAYLOAD_HEX_BYTES = 8 * 1024 * 1024 # 16 MiB on the wire: far more than the socket buffers hold +STALLED_RECEIVE_BUFFER = 4096 + + +class Wire: + """A raw RFC 959 control connection; replies are parsed as ``code`` + text lines.""" + + def __init__(self, reader: asyncio.StreamReader, writer: asyncio.StreamWriter) -> None: + self.reader = reader + self.writer = writer + self.sock = writer.transport.get_extra_info("socket") + + async def raw(self, data: bytes) -> None: + self.writer.write(data) + await self.writer.drain() + + async def send(self, line: str) -> None: + await self.raw(line.encode("ascii") + b"\r\n") + + async def reply(self, phase: str) -> str: + """Next complete reply code; a multi-line reply is read to its closing line.""" + + async def read() -> str: + first = await self.reader.readline() + if not first: + raise ConnectionResetError("control connection closed") + text = first.decode("utf-8", errors="replace") + code = text[:3] + if len(text) > 3 and text[3] == "-": + while True: + line = (await self.reader.readline()).decode("utf-8", errors="replace") + if not line: + raise ConnectionResetError("control connection closed") + if line.startswith(code + " "): + break + return code + + return await bounded(read(), REPLY_SECONDS, phase) + + async def read_epsv_port(self) -> int | None: + """The port of a ``229`` reply, or None for any other reply.""" + line = (await self.reader.readline()).decode("utf-8", errors="replace") + match = re.search(r"\(\|\|\|(\d+)\|\)", line) + if not line.startswith("229") or match is None: + return None + return int(match.group(1)) + + async def passive(self, phase: str) -> tuple[asyncio.StreamReader, asyncio.StreamWriter]: + await self.send("EPSV") + port = await bounded(self.read_epsv_port(), REPLY_SECONDS, phase) + if port is None: + raise ConnectionError("EPSV was not answered 229") + return await bounded(OPEN_CONNECTION("127.0.0.1", port), REPLY_SECONDS, phase + "_connect") + + +async def _read_all(reader: asyncio.StreamReader) -> bytes: + chunks = [] + while True: + chunk = await reader.read(65536) + if not chunk: + return b"".join(chunks) + chunks.append(chunk) + + +def _free_port() -> int: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as probe_socket: + probe_socket.bind(("127.0.0.1", 0)) + return probe_socket.getsockname()[1] + + +async def run_case(aioftp, case: str, variant: str | None, obs: dict) -> bool: + command = variant if case == "CASE-01" else "RETR" + options = {} + if (case == "CASE-14" and variant in ("data-ports", "open-data")) or case == "CASE-19": + port_pool = _free_port() + options["data_ports"] = range(port_pool, port_pool + 1) + obs["data_port_pool"] = [port_pool] + + path_io_factory = aioftp.MemoryPathIO + if case in ("CASE-15", "CASE-16", "CASE-17", "CASE-18", "CASE-19", "CASE-23"): + path_delay = SLOW_PATH_SECONDS if case == "CASE-16" else 0.0 + read_delay = SLOW_READ_SECONDS if case in ("CASE-15", "CASE-17", "CASE-18", "CASE-19", "CASE-23") else 0.0 + close_delay = SLOW_CLOSE_SECONDS if case == "CASE-15" else 0.0 + + class SlowPathIO(aioftp.MemoryPathIO): + async def _d(self): + if path_delay: + await asyncio.sleep(path_delay) + + async def exists(self, path): + await self._d() + return await super().exists(path) + + async def is_dir(self, path): + await self._d() + return await super().is_dir(path) + + async def is_file(self, path): + await self._d() + return await super().is_file(path) + + async def mkdir(self, path, *, parents=False, exist_ok=False): + await self._d() + return await super().mkdir(path, parents=parents, exist_ok=exist_ok) + + async def rename(self, source, destination): + await self._d() + return await super().rename(source, destination) + + async def unlink(self, path): + await self._d() + return await super().unlink(path) + + async def read(self, file, size=-1) -> bytes: + if read_delay: + await asyncio.sleep(read_delay) + return await super().read(file, size) + + async def close(self, file) -> None: + if close_delay: + await asyncio.sleep(close_delay) + await super().close(file) + + path_io_factory = SlowPathIO + + server = aioftp.Server(path_io_factory=path_io_factory, wait_future_timeout=30, **options) + wire: Wire | None = None + try: + await bounded(server.start("127.0.0.1", 0), REPLY_SECONDS, "server_start") + port = server.server_port + reader, writer = await bounded(OPEN_CONNECTION("127.0.0.1", port), REPLY_SECONDS, "control_connect") + wire = Wire(reader, writer) + if await wire.reply("greeting") != "220": + obs["failure"] = "greeting" + return False + await wire.send("USER anonymous") + if await wire.reply("login") != "230": + obs["failure"] = "login" + return False + + seed = f"seed-{secrets.token_hex(4)}.bin" + payload = b"payload-" + secrets.token_hex(64 * 1024).encode("ascii") + _, data_writer = await wire.passive("seed_epsv") + await wire.send(f"STOR {seed}") + if await wire.reply("seed_150") != "150": + obs["failure"] = "seed upload was not accepted" + return False + data_writer.write(payload) + await data_writer.drain() + data_writer.close() + if await wire.reply("seed_226") != "226": + obs["failure"] = "seed upload did not complete" + return False + + if case == "CASE-16": + if variant == "cwd-pwd": + await wire.send("MKD sub") + if await wire.reply("mkd") != "257": + return False + await wire.raw(b"CWD sub\r\nPWD\r\n") + c1 = await wire.reply("cwd") + c2 = await wire.reply("pwd") + obs["replies"] = [c1, c2] + return c1 == "250" and c2 == "257" + elif variant == "mkd-cwd-pwd": + await wire.raw(b"MKD dd\r\nCWD dd\r\nPWD\r\n") + c1 = await wire.reply("mkd") + c2 = await wire.reply("cwd") + c3 = await wire.reply("pwd") + obs["replies"] = [c1, c2, c3] + return [c1, c2, c3] == ["257", "250", "257"] + elif variant == "rnfr-rnto": + await wire.raw(f"RNFR {seed}\r\nRNTO moved.bin\r\n".encode()) + c1 = await wire.reply("rnfr") + c2 = await wire.reply("rnto") + obs["replies"] = [c1, c2] + if [c1, c2] != ["350", "250"]: + return False + dr, _ = await wire.passive("check_epsv") + await wire.send("RETR moved.bin") + if await wire.reply("check_150") != "150": + return False + got = await bounded(_read_all(dr), REPLY_SECONDS, "check_read") + c3 = await wire.reply("check_226") + return c3 == "226" and got == payload + elif variant == "dele-retr": + _, _ = await wire.passive("dele_epsv") + await wire.raw(f"DELE {seed}\r\nRETR {seed}\r\n".encode()) + c1 = await wire.reply("dele") + c2 = await wire.reply("retr") + obs["replies"] = [c1, c2] + return c1 == "250" and c2 in ("550", "450", "451") + elif variant == "retr-abor": + # no data connection is opened, so the transfer is deterministically still pending when the + # pipelined ABOR runs (a connected transfer could legitimately finish first: 150, 226, 226) + await wire.send("EPSV") + if await bounded(wire.read_epsv_port(), REPLY_SECONDS, "retr_epsv") is None: + return False + await wire.raw(f"RETR {seed}\r\nABOR\r\n".encode()) + c1 = await wire.reply("r150") + c2 = await wire.reply("r426") + c3 = await wire.reply("r226") + obs["replies"] = [c1, c2, c3] + if [c1, c2, c3] != ["150", "426", "226"]: + return False + await wire.send("PWD") + return await wire.reply("pwd") == "257" + return False + + if case == "CASE-17": + if variant == "telnet-idle": + await wire.raw(b"\xff\xf4\xff\xf2ABOR\r\n") + c1 = await wire.reply("idle") + obs["reply"] = c1 + if c1 not in ("225", "226"): + return False + await wire.send("PWD") + return await wire.reply("pwd") == "257" + elif variant in ("telnet-inline", "bsd-urgent"): + dr, dw = await wire.passive("epsv") + await wire.send(f"RETR {seed}") + if await wire.reply("150") != "150": + return False + await bounded(dr.read(8192), REPLY_SECONDS, "chunk") + if variant == "telnet-inline": + await wire.raw(b"\xff\xf4\xff\xf2ABOR\r\n") + else: + # asyncio's TransportSocket cannot send; urgent data goes through a duplicate of the real socket + with socket.fromfd(wire.sock.fileno(), wire.sock.family, wire.sock.type) as urgent: + urgent.send(b"\xff\xf4\xff", socket.MSG_OOB) + await wire.raw(b"\xf2ABOR\r\n") + dw.close() + c1 = await wire.reply("r1") + c2 = await wire.reply("r2") + obs["replies"] = [c1, c2] + if (c1, c2) != ("426", "226"): + return False + await wire.send("PWD") + return await wire.reply("pwd") == "257" + elif variant == "ftplib-abort": + import ftplib + def run_ftplib(): + ftp = ftplib.FTP() + ftp.connect("127.0.0.1", port, timeout=REPLY_SECONDS) + ftp.login("anonymous", "") + ftp.voidcmd("TYPE I") + conn = ftp.transfercmd(f"RETR {seed}") + conn.recv(8192) + resp = ftp.abort() + extra = ftp.getmultiline() if resp.startswith("426") else "" + conn.close() + d = ftp.pwd() + ftp.quit() + return resp, extra, d + resp, extra, d = await bounded(asyncio.to_thread(run_ftplib), 12.0, "ftplib") + obs["replies"] = [resp, extra, d] + return resp.startswith("426") and extra.startswith("226") and bool(d) + return False + + if case == "CASE-18": + if variant == "quit-retr": + dr, dw = await wire.passive("epsv") + await wire.send(f"RETR {seed}") + if await wire.reply("150") != "150": + return False + first = await bounded(dr.read(8192), REPLY_SECONDS, "first") + await wire.send("QUIT") + rest = await bounded(_read_all(dr), 15.0, "rest") + dw.close() + c1 = await wire.reply("r1") + c2 = await wire.reply("r2") + obs["replies"] = [c1, c2] + return (first + rest == payload) and (c1, c2) == ("226", "221") + elif variant == "quit-stor": + dr, dw = await wire.passive("epsv") + await wire.send("STOR up.bin") + if await wire.reply("150") != "150": + return False + dw.write(payload[:50000]) + await dw.drain() + await wire.send("QUIT") + await asyncio.sleep(0.1) + try: + dw.write(payload[50000:]) + await dw.drain() + except ConnectionError: + pass + dw.close() + c1 = await wire.reply("r1") + c2 = await wire.reply("r2") + obs["replies"] = [c1, c2] + if (c1, c2) != ("226", "221"): + return False + r2, w2 = await bounded(OPEN_CONNECTION("127.0.0.1", port), REPLY_SECONDS, "conn2") + wire2 = Wire(r2, w2) + await wire2.reply("g") + await wire2.send("USER anonymous") + await wire2.reply("l") + dr2, _ = await wire2.passive("epsv2") + await wire2.send("RETR up.bin") + await wire2.reply("150") + got = await bounded(_read_all(dr2), REPLY_SECONDS, "read_up") + await wire2.reply("226") + wire2.writer.close() + return got == payload + elif variant == "quit-no-data": + await wire.send("EPSV") + if await bounded(wire.read_epsv_port(), REPLY_SECONDS, "epsv") is None: + return False + await wire.send(f"RETR {seed}") + if await wire.reply("150") != "150": + return False + await wire.send("QUIT") + c1 = await wire.reply("r1") + c2 = await wire.reply("r2") + obs["replies"] = [c1, c2] + return (c1, c2) in (("426", "221"), ("221", "")) or [c1, c2] == ["426", "221"] + return False + + if case == "CASE-19": + dr, dw = await wire.passive("epsv") + stor = (variant == "stor-reset") + await wire.send("STOR up.bin" if stor else f"RETR {seed}") + if await wire.reply("150") != "150": + return False + if stor: + dw.write(payload[:30000]) + await dw.drain() + await asyncio.sleep(0.05) + else: + await bounded(dr.read(8192), REPLY_SECONDS, "first") + if variant == "retr-close": + dw.close() + else: + s = dw.get_extra_info("socket") + if s is not None: + with contextlib.suppress(Exception): + s.setsockopt(socket.SOL_SOCKET, socket.SO_LINGER, b"\x01\x00\x00\x00\x00\x00\x00\x00") + dw.transport.abort() + c1 = await wire.reply("final") + obs["reply"] = c1 + if c1 not in ("426", "451", "226"): + return False + await wire.send("PWD") + if await wire.reply("pwd") != "257": + return False + dr2, _ = await wire.passive("next_epsv") + await wire.send(f"RETR {seed}") + if await wire.reply("next_150") != "150": + return False + got = await bounded(_read_all(dr2), REPLY_SECONDS, "read_seed") + done = await wire.reply("next_226") + return done == "226" and got == payload + + if case == "CASE-20": + await wire.raw(b"\xff\xff\xff\r\n") + c1 = await wire.reply("undecodable") + obs["reply"] = c1 + if c1 != "500": + return False + await wire.send("PWD") + return await wire.reply("pwd") == "257" + + if case == "CASE-22": + # The data connection is already open and the transfer cannot complete (a download the + # peer never reads, or an upload the peer never ends) when the transfer command and + # ABOR arrive in one read: the only valid wire order is 150, 426, 226. In retr-abor-abor a + # second ABOR follows in the same read and is answered after the first: 150, 426, 226, 226. + if variant in ("stor-abor", "appe-abor"): + verb = "APPE" if variant == "appe-abor" else "STOR" + _, stalled_writer = await wire.passive("case_epsv") + await asyncio.sleep(DATA_ACCEPT_SECONDS) + await wire.raw(f"{verb} never-{secrets.token_hex(4)}.bin\r\nABOR\r\n".encode()) + closer = stalled_writer.close + else: + big = f"big-{secrets.token_hex(4)}.bin" + _, big_writer = await wire.passive("big_epsv") + await wire.send(f"STOR {big}") + if await wire.reply("big_150") != "150": + obs["failure"] = "large seed upload was not accepted" + return False + big_writer.write(secrets.token_hex(STALLED_PAYLOAD_HEX_BYTES).encode("ascii")) + await bounded(big_writer.drain(), 30.0, "big_upload") + big_writer.close() + if await bounded(wire.reply("big_226"), 30.0, "big_226") != "226": + obs["failure"] = "large seed upload did not complete" + return False + await wire.send("EPSV") + stalled_port = await bounded(wire.read_epsv_port(), REPLY_SECONDS, "case_epsv") + if stalled_port is None: + obs["failure"] = "EPSV before the case" + return False + stalled = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + stalled.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, STALLED_RECEIVE_BUFFER) + stalled.setblocking(False) + await bounded( + asyncio.get_running_loop().sock_connect(stalled, ("127.0.0.1", stalled_port)), + REPLY_SECONDS, + "case_data_connect", + ) + await asyncio.sleep(DATA_ACCEPT_SECONDS) + if variant == "retr-abor-abor": + tail = "ABOR\r\nABOR\r\n" + elif variant == "retr-abor-pwd": + tail = "ABOR\r\nPWD\r\n" + else: + tail = "ABOR\r\n" + await wire.raw(f"RETR {big}\r\n{tail}".encode()) + closer = stalled.close + expected = ["150", "426", "226"] + (["257"] if variant == "retr-abor-pwd" else []) + if variant == "retr-abor-abor": + expected = ["150", "426", "226", "226"] + try: + codes = [await wire.reply(f"pipelined_reply_{index}") for index in range(len(expected))] + finally: + closer() + obs["replies"] = codes + if codes != expected: + obs["failure"] = "pipelined ABOR replies" + return False + await wire.send("PWD") + obs["successor_pwd"] = await wire.reply("successor_pwd") + if obs["successor_pwd"] != "257": + return False + data_reader, _ = await wire.passive("successor_epsv") + await wire.send(f"RETR {seed}") + if await wire.reply("successor_150") != "150": + obs["failure"] = "successor RETR was not accepted" + return False + received = await bounded(_read_all(data_reader), REPLY_SECONDS, "successor_data") + done = await wire.reply("successor_226") + obs["successor_transfer"] = {"bytes_match": received == payload, "final_reply": done} + return received == payload and done == "226" + + if case == "CASE-23": + # The data connection is already open when the transfer command and QUIT arrive in one + # read: the open transfer sends its final reply before 221. + data_reader, data_writer = await wire.passive("case_epsv") + await asyncio.sleep(DATA_ACCEPT_SECONDS) + if variant == "retr-quit": + await wire.raw(f"RETR {seed}\r\nQUIT\r\n".encode()) + c1 = await wire.reply("r150") + received = await bounded(_read_all(data_reader), 15.0, "transfer_data") + data_writer.close() + c2 = await wire.reply("final") + c3 = await wire.reply("bye") + obs["replies"] = [c1, c2, c3] + obs["bytes_match"] = received == payload + return [c1, c2, c3] == ["150", "226", "221"] and received == payload + if variant == "list-quit": + await wire.raw(b"LIST\r\nQUIT\r\n") + c1 = await wire.reply("r150") + listing = await bounded(_read_all(data_reader), 15.0, "transfer_data") + data_writer.close() + c2 = await wire.reply("final") + c3 = await wire.reply("bye") + obs["replies"] = [c1, c2, c3] + obs["listing_names_seed"] = seed.encode("ascii") in listing + return [c1, c2, c3] == ["150", "226", "221"] and seed.encode("ascii") in listing + stored_name = "up.bin" if variant == "stor-quit" else f"app-{secrets.token_hex(4)}.bin" + verb = "STOR" if variant == "stor-quit" else "APPE" + await wire.raw(f"{verb} {stored_name}\r\nQUIT\r\n".encode()) + c1 = await wire.reply("r150") + if c1 == "150": + with contextlib.suppress(ConnectionError): + data_writer.write(payload) + await data_writer.drain() + data_writer.close() + c2 = await wire.reply("final") + c3 = await wire.reply("bye") + obs["replies"] = [c1, c2, c3] + if [c1, c2, c3] != ["150", "226", "221"]: + return False + r2, w2 = await bounded(OPEN_CONNECTION("127.0.0.1", port), REPLY_SECONDS, "conn2") + wire2 = Wire(r2, w2) + try: + await wire2.reply("greeting2") + await wire2.send("USER anonymous") + await wire2.reply("login2") + dr2, _ = await wire2.passive("epsv2") + await wire2.send(f"RETR {stored_name}") + if await wire2.reply("stored_150") != "150": + obs["failure"] = "the stored file is not readable" + return False + stored = await bounded(_read_all(dr2), REPLY_SECONDS, "read_stored") + await wire2.reply("stored_226") + finally: + wire2.writer.close() + obs["bytes_match"] = stored == payload + return stored == payload + + # The existing cases: CASE-01, CASE-14, CASE-15 + await wire.send("EPSV") + aborted_port = await bounded(wire.read_epsv_port(), REPLY_SECONDS, "case_epsv") + if aborted_port is None: + obs["failure"] = "EPSV before the case" + return False + argument = { + "RETR": f" {seed}", + "STOR": f" upload-{secrets.token_hex(4)}.bin", + "APPE": f" append-{secrets.token_hex(4)}.bin", + "LIST": "", + "MLSD": "", + }[command] + if case == "CASE-14" and variant == "open-data": + # The data connection is already open and the upload never ends when ABOR arrives, on + # its own, after the 150: 426, then 225 or 226, and the aborted transfer's listener and + # its one data_ports port are given up exactly as after an ABOR before the data + # connection. Nothing is pipelined here: command order in one read is CASE-22's subject. + _, stalled_writer = await bounded( + OPEN_CONNECTION("127.0.0.1", aborted_port), REPLY_SECONDS, "case_data_connect" + ) + try: + await asyncio.sleep(DATA_ACCEPT_SECONDS) + await wire.send(f"STOR never-{secrets.token_hex(4)}.bin") + accepted = await wire.reply("case_150") + obs["command_reply"] = accepted + if accepted != "150": + obs["failure"] = f"STOR answered {accepted}" + return False + await asyncio.sleep(DATA_ACCEPT_SECONDS) + await wire.send("ABOR") + first = await wire.reply("abort_first_reply") + second = await wire.reply("abort_second_reply") + finally: + stalled_writer.close() + obs["abort_replies"] = [first, second] + if first != "426" or second not in ("225", "226"): + obs["failure"] = "ABOR replies out of order" + return False + else: + if case == "CASE-15": + open_reader, open_writer = await bounded( + OPEN_CONNECTION("127.0.0.1", aborted_port), REPLY_SECONDS, "case_data_connect" + ) + await wire.send(command + argument) + accepted = await wire.reply("case_150") + obs["command_reply"] = accepted + if accepted != "150": + obs["failure"] = f"{command} answered {accepted}" + return False + if case == "CASE-15": + await wire.send("ABOR\r\nABOR") + codes = [await wire.reply(f"abort_reply_{index}") for index in range(3)] + obs["abort_replies"] = codes + open_writer.close() + if codes != ["426", "226", "226"]: + obs["failure"] = "repeated ABOR replies out of order" + return False + else: + await wire.send("ABOR") + first = await wire.reply("abort_first_reply") + second = await wire.reply("abort_second_reply") + obs["abort_replies"] = [first, second] + if (first, second) != ("426", "226"): + obs["failure"] = "ABOR replies out of order" + return False + + if case == "CASE-14": + try: + late_reader, late_writer = await bounded( + OPEN_CONNECTION("127.0.0.1", aborted_port), REPLY_SECONDS, "late_connect" + ) + except OSError: + obs["late_connection"] = "refused" + else: + try: + leaked = await asyncio.wait_for(late_reader.read(65536), LATE_DATA_SECONDS) + obs["late_connection"] = "closed_by_server" if not leaked else "fed" + except TimeoutError: + obs["late_connection"] = "kept_open" + finally: + late_writer.close() + if obs["late_connection"] != "closed_by_server": + obs["failure"] = "the aborted transfer's listener still accepts data connections" + return False + + await wire.send("PWD") + pwd = await wire.reply("successor_pwd") + obs["successor_pwd"] = pwd + if pwd != "257": + return False + + data_reader, _ = await wire.passive("successor_epsv") + await wire.send(f"RETR {seed}") + started = await wire.reply("successor_150") + if started != "150": + obs["failure"] = f"successor RETR answered {started}" + return False + received = await bounded(_read_all(data_reader), REPLY_SECONDS, "successor_data") + done = await wire.reply("successor_226") + obs["successor_transfer"] = {"bytes_match": received == payload, "final_reply": done} + return received == payload and done == "226" + except PhaseTimeout as exc: + obs["failure"] = f"timeout:{exc.phase}" + return False + except Exception as exc: # noqa: BLE001 - any candidate-side failure is a candidate outcome + obs["failure"] = describe(exc) + return False + finally: + if wire is not None: + wire.writer.close() + with contextlib.suppress(Exception): + await asyncio.wait_for(server.close(), REPLY_SECONDS) + + +async def main(config: dict, writer: ResultWriter) -> None: + case = config["case"] + variant = config.get("variant") + valid = ( + (case == "CASE-01" and variant in COMMANDS) + or (case == "CASE-14" and variant in LISTENER_VARIANTS) + or (case == "CASE-15" and variant is None) + or (case == "CASE-16" and variant in PIPELINE_VARIANTS) + or (case == "CASE-17" and variant in REAL_CLIENT_ABOR_VARIANTS) + or (case == "CASE-18" and variant in QUIT_VARIANTS) + or (case == "CASE-19" and variant in DATA_LOSS_VARIANTS) + or (case == "CASE-20" and variant is None) + or (case == "CASE-22" and variant in PIPELINED_ABORT_VARIANTS) + or (case == "CASE-23" and variant in PIPELINED_QUIT_VARIANTS) + ) + if not valid: + raise HarnessFault("config", "unknown server case or variant") + writer.write("candidate_running") + try: + aioftp, replaced = import_candidate(config["tree"]) + except HarnessFault: + raise + except BaseException as exc: # noqa: BLE001 - an import failure is a candidate outcome + writer.write("ok", passed=False, integrity_replaced=[], observations={"failure": "import:" + describe(exc)}) + return + obs: dict = {"variant": variant} if variant else {} + passed = await run_case(aioftp, case, variant, obs) + writer.write("ok", passed=bool(passed), integrity_replaced=replaced, observations=obs) + + +if __name__ == "__main__": + try: + cfg = load_config(sys.argv) + except HarnessFault as fault: + print(f"harness fault: {fault.stage}", file=sys.stderr) + sys.exit(3) + result = ResultWriter(cfg["out"], cfg["case"], cfg.get("variant")) + try: + asyncio.run(main(cfg, result)) + except HarnessFault as fault: + result.write("harness_fault", stage=fault.stage, detail=fault.detail) + sys.exit(3) diff --git a/harbor/sources/aioftp-v11/grading/regression.py b/harbor/sources/aioftp-v11/grading/regression.py new file mode 100644 index 0000000000000000000000000000000000000000..c6856466194d6e95d98f9deb5b6442a3baefd9cf --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/regression.py @@ -0,0 +1,266 @@ +"""Pristine native-suite regression check and candidate test-setting diagnostics. + +The regression ceiling is decided on a grader-built tree: the candidate's ``src/`` with the +pristine base ``tests/`` and ``pyproject.toml`` (and so its ``[tool.pytest.ini_options]``) restored +from ``grading/baseline``. Candidate edits to test files or test settings therefore never change +the verdict; they are compared against the base and reported, naming each changed setting and the +direction of the change. Candidate-added test files are run separately and reported only. + +Where IPv6 loopback cannot be bound (HUD's sandbox), the image's ``aioftp_ipv6_loopback`` pytest +plugin skips exactly the suite's ``::1`` nodes; the verdict then requires exactly that many skips, +and none where ``::1`` binds, so no other skip can pass the pristine suite. +""" + +from __future__ import annotations + +import os +import shutil +import socket +import subprocess +import tempfile +import time +import tomllib +import xml.etree.ElementTree as ET +from pathlib import Path +from typing import Any + +BASELINE_DIR = Path(__file__).resolve().parent / "baseline" +# Pristine files restored into every regression tree; also the deployment-context asset list. +PROTECTED_PATHS = ( + "pyproject.toml", + "tests/conftest.py", + "tests/test_abort.py", + "tests/test_client_side_socks.py", + "tests/test_connection.py", + "tests/test_corner_cases.py", + "tests/test_current_directory.py", + "tests/test_directory_actions.py", + "tests/test_extra.py", + "tests/test_file.py", + "tests/test_list_fallback.py", + "tests/test_login.py", + "tests/test_maximum_connections.py", + "tests/test_passive.py", + "tests/test_pathio.py", + "tests/test_permissions.py", + "tests/test_restart.py", + "tests/test_simple_functions.py", + "tests/test_throttle.py", + "tests/test_tls.py", + "tests/test_user.py", +) +BASE_NODE_COUNT = 792 +# Base node IDs that bind ::1 (the `::1` pair_factory and socks parameters, and both +# test_server_ipv6_pasv nodes); the runtime plugin skips them where IPv6 loopback is unavailable. +IPV6_LOOPBACK_NODE_COUNT = 212 +SUITE_TIMEOUT_SECONDS = 600 +CANDIDATE_TESTS_TIMEOUT_SECONDS = 180 +# The repository-native test command, run directly against the pristine settings. `-o +# pythonpath=src` puts the graded tree's sources first; `-I` keeps the grader's environment out. +NATIVE_TEST_ARGS = ("-I", "-m", "pytest", "-p", "no:cacheprovider", "-o", "pythonpath=src") +# pytest configuration files a candidate could add to override the pristine settings. +OVERRIDING_CONFIG_FILES = ("pytest.ini", ".pytest.ini", "tox.ini", "setup.cfg", "conftest.py") +NARROWING_OPTIONS = ("--deselect", "-k", "--ignore", "--ignore-glob", "-m", "--lf", "--last-failed", "--co") + + +class RegressionHarnessFault(Exception): + """The regression harness itself could not run (missing interpreter or baseline).""" + + +def _pytest_table(pyproject: Path) -> dict[str, Any]: + try: + data = tomllib.loads(pyproject.read_text(encoding="utf-8")) + except (OSError, ValueError): + return {} + table = data.get("tool", {}).get("pytest", {}).get("ini_options", {}) + return table if isinstance(table, dict) else {} + + +def _as_list(value: Any) -> list[str]: + if isinstance(value, str): + return value.split() + if isinstance(value, list): + return [str(item) for item in value] + return [] + + +def settings_diff(candidate: Path) -> list[dict[str, Any]]: + """Compare the candidate's test settings and test files with the pristine base.""" + findings: list[dict[str, Any]] = [] + base_table = _pytest_table(BASELINE_DIR / "pyproject.toml") + cand_path = candidate / "pyproject.toml" + cand_table = _pytest_table(cand_path) if cand_path.is_file() else {} + if not cand_path.is_file(): + findings.append({"setting": "pyproject.toml", "change": "deleted", "direction": "weakened"}) + for key in sorted(set(base_table) | set(cand_table)): + before, after = base_table.get(key), cand_table.get(key) + if before == after: + continue + if key == "addopts": + removed = [opt for opt in _as_list(before) if opt not in _as_list(after)] + added = [opt for opt in _as_list(after) if opt not in _as_list(before)] + narrowing = [opt for opt in added if opt.split("=", 1)[0] in NARROWING_OPTIONS] + direction = "weakened" if removed or narrowing else "equivalent_or_stronger" + findings.append({"setting": "addopts", "removed": removed, "added": added, "direction": direction, + "explanation": "narrowed discovery or removed checks" if direction == "weakened" + else "options added without narrowing"}) + elif key == "testpaths": + widened = set(_as_list(after)) >= set(_as_list(before)) + findings.append({"setting": "testpaths", "before": before, "after": after, + "direction": "equivalent_or_stronger" if widened else "weakened"}) + else: + findings.append({"setting": key, "before": before, "after": after, "direction": "changed"}) + for name in OVERRIDING_CONFIG_FILES: + if (candidate / name).is_file(): + findings.append({"setting": name, "change": "added", "direction": "weakened", + "explanation": "a root configuration file can override or hook pristine settings"}) + base_tests = {rel for rel in PROTECTED_PATHS if rel.startswith("tests/")} + for rel in sorted(base_tests): + target = candidate / rel + if not target.is_file(): + findings.append({"setting": rel, "change": "deleted", "direction": "weakened", + "explanation": "base test module deleted; its node IDs would not run"}) + elif target.read_bytes() != (BASELINE_DIR / rel).read_bytes(): + findings.append({"setting": rel, "change": "modified", "direction": "changed"}) + return findings + + +def candidate_added_tests(candidate: Path) -> list[str]: + tests = candidate / "tests" + if not tests.is_dir(): + return [] + base = set(PROTECTED_PATHS) + return sorted( + path.relative_to(candidate).as_posix() + for path in tests.rglob("test_*.py") + if path.is_file() and path.relative_to(candidate).as_posix() not in base + ) + + +def build_regression_tree(candidate: Path, destination: Path, extra_tests: list[str] = ()) -> None: + """Candidate ``src/`` plus the pristine baseline; optionally the candidate's added tests.""" + for rel in PROTECTED_PATHS: + source = BASELINE_DIR / rel + if not source.is_file(): + raise RegressionHarnessFault("pristine baseline file is missing") + target = destination / rel + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(source, target) + if (candidate / "src").is_dir(): + shutil.copytree(candidate / "src", destination / "src", symlinks=True, + ignore=shutil.ignore_patterns("__pycache__", "*.pyc")) + for rel in extra_tests: + target = destination / rel + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(candidate / rel, target) + + +def ipv6_loopback_available() -> bool: + try: + with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as probe: + probe.bind(("::1", 0)) + except OSError: + return False + return True + + +def _clean_env(home: Path) -> dict[str, str]: + return { + "PATH": os.environ.get("PATH", "/usr/bin:/bin"), + "HOME": str(home), + "LANG": "C.UTF-8", + "LC_ALL": "C.UTF-8", + "PYTHONDONTWRITEBYTECODE": "1", + } + + +def _parse_junit(path: Path) -> dict[str, Any] | None: + try: + root = ET.parse(path).getroot() + except (OSError, ET.ParseError): + return None + suites = [root] if root.tag == "testsuite" else list(root.iter("testsuite")) + totals = {"tests": 0, "failures": 0, "errors": 0, "skipped": 0} + failed: list[str] = [] + for suite in suites: + for key in totals: + totals[key] += int(suite.get(key, 0) or 0) + for case in suite.iter("testcase"): + if case.find("failure") is not None or case.find("error") is not None: + classname = case.get("classname", "") + module = classname.replace(".", "/") + ".py" if classname else "" + failed.append(f"{module}::{case.get('name', '')}") + return {**totals, "failed_node_ids": failed[:20]} + + +def run_pytest(python: str, tree: Path, scratch: Path, label: str, extra_args: list[str], timeout: float) -> dict[str, Any]: + """Run pytest directly; keep a classification and junit counts, discard raw output.""" + junit = scratch / f"{label}-junit.xml" + argv = [python, *NATIVE_TEST_ARGS, f"--junitxml={junit}", *extra_args] + started = time.monotonic() + try: + completed = subprocess.run( + argv, cwd=tree, env=_clean_env(scratch), stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=timeout, check=False, + ) + classification = "pass" if completed.returncode == 0 else "nonzero" + returncode: int | None = completed.returncode + except subprocess.TimeoutExpired: + classification, returncode = "timeout", None + except FileNotFoundError: + raise RegressionHarnessFault("the repository interpreter is unavailable") from None + counts = _parse_junit(junit) + return { + "command": "pytest", + "classification": classification, + "returncode": returncode, + "elapsed_seconds": round(time.monotonic() - started, 3), + "junit": counts, + } + + +def run_regression(python: str, candidate: Path) -> dict[str, Any]: + """Decide the regression ceiling on the pristine suite and report candidate test settings.""" + with tempfile.TemporaryDirectory(prefix="hud-regression-") as scratch_name: + scratch = Path(scratch_name) + tree = scratch / "tree" + tree.mkdir() + build_regression_tree(candidate, tree) + ipv6_loopback = ipv6_loopback_available() + expected_skipped = 0 if ipv6_loopback else IPV6_LOOPBACK_NODE_COUNT + outcome = run_pytest(python, tree, scratch, "pristine", [], SUITE_TIMEOUT_SECONDS) + counts = outcome["junit"] or {} + failed = not ( + outcome["classification"] == "pass" + and counts.get("tests") == BASE_NODE_COUNT + and counts.get("failures") == 0 + and counts.get("errors") == 0 + and counts.get("skipped") == expected_skipped + ) + if outcome["classification"] == "pass" and counts.get("tests") != BASE_NODE_COUNT: + reason = f"pristine suite ran {counts.get('tests')} of {BASE_NODE_COUNT} base node IDs" + elif outcome["classification"] == "pass" and counts.get("skipped") != expected_skipped: + reason = f"pristine suite skipped {counts.get('skipped')} base node IDs, expected {expected_skipped}" + elif failed: + reason = f"pristine suite {outcome['classification']}" + else: + reason = None + added = candidate_added_tests(candidate) + candidate_tests: dict[str, Any] = {"files": len(added), "scored": False} + if added: + extra_tree = scratch / "candidate-tests" + extra_tree.mkdir() + build_regression_tree(candidate, extra_tree, added) + extra = run_pytest(python, extra_tree, scratch, "candidate", list(added), CANDIDATE_TESTS_TIMEOUT_SECONDS) + candidate_tests.update(classification=extra["classification"], junit=extra["junit"]) + return { + "failed": failed, + "reason": reason, + "failed_node_ids": list(counts.get("failed_node_ids") or []), + "native_outcomes": {"test": outcome}, + "base_node_count": BASE_NODE_COUNT, + "ipv6_loopback": ipv6_loopback, + "expected_skipped": expected_skipped, + "settings_diff": settings_diff(candidate), + "candidate_tests": candidate_tests, + } diff --git a/harbor/sources/aioftp-v11/grading/runner.py b/harbor/sources/aioftp-v11/grading/runner.py new file mode 100644 index 0000000000000000000000000000000000000000..2a0c13d4c9a1c20688be5ed88dd8ca4dda521bee --- /dev/null +++ b/harbor/sources/aioftp-v11/grading/runner.py @@ -0,0 +1,259 @@ +"""Grading entry point for aioftp_stream_abort_desynchronization. + +``grade_repository(repo_path)`` replicates the candidate tree into a root-only scratch +directory (never grading the mutable workspace in place), runs every hidden probe fixture in its +own ``python -I`` process against that copy, runs the pristine native suite, applies the integrity +rules, and returns one ``EvaluationResult``. Every failure of grader-owned material -- a missing +or corrupted probe script, a fixture that cannot bind, malformed probe output, a missing +interpreter -- returns a fail-closed fault result (``isError`` true, reward ``0.0``, non-healthy +``grader_health``, explicit empty lists) instead of raising. + +Grader submodules are imported inside ``grade_repository`` so that a broken submodule is a +reported fault, not an import-time crash of this entry point. +""" + +from __future__ import annotations + +import json +import logging +import os +import shutil +import subprocess +import tempfile +import time +import uuid +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path +from typing import Any + +logger = logging.getLogger(__name__) + +HEAVY_EXCLUDE_DIRS = ( + "node_modules", + ".venv", + ".hud", + ".git", + ".tmp", + ".cache", + "dist", + "build", + "cdk.out", + "__pycache__", + ".pytest_cache", + ".mypy_cache", + ".ruff_cache", +) +PROBES_DIR = Path(__file__).resolve().parent / "probes" +PROBE_SCRIPTS = {"client": "client_probe.py", "server": "server_probe.py"} +# The candidate's own source files the probes import from the graded copy. +CANDIDATE_MODULES = (Path("src/aioftp/client.py"), Path("src/aioftp/server.py"), Path("src/aioftp/__init__.py")) +# The repository interpreter: Python 3.11 with the `dev` extra, installed in the runtime-contract stage. +REPO_PYTHON_ENV = "AIOFTP_REPO_PYTHON" +DEFAULT_REPO_PYTHON = "/opt/aioftp-venv/bin/python" +PROBE_PROCESS_SECONDS = 60 +PROBE_WORKERS = 4 + + +class GraderFault(Exception): + def __init__(self, stage: str, detail: str) -> None: + super().__init__(f"{stage}: {detail}") + self.stage = stage + self.detail = detail + + +def repo_python() -> str: + return os.environ.get(REPO_PYTHON_ENV) or DEFAULT_REPO_PYTHON + + +def _ignore_heavy(directory: str, names: list[str]) -> set[str]: + return {name for name in names if name in HEAVY_EXCLUDE_DIRS} + + +class GradingRunner: + """Replicates the candidate workspace into a root-only scratch directory for grading.""" + + HEAVY_EXCLUDE_DIRS = HEAVY_EXCLUDE_DIRS + + def __init__( + self, + problem_id: str = "aioftp_stream_abort_desynchronization", + repo_path: str | None = None, + patches_dir: str | None = None, + ): + self.problem_id = problem_id + self.patches_dir = patches_dir or os.environ.get("PATCHES_DIR", "/hud/patches") + self.repo_path = ( + repo_path + or os.environ.get("PROJECT_DIR") + or f"/home/ubuntu/{os.environ.get('FOLDER_NAME', 'aioftp')}" + ) + self.scratch = Path(tempfile.mkdtemp(prefix="hud-grading-")) + self.working_dir = str(self.scratch / f"tree-{uuid.uuid4().hex[:8]}") + + def replicate_workspace(self) -> Path: + """Copy the candidate repository, excluding heavy runtime, cache and metadata trees.""" + shutil.copytree(self.repo_path, self.working_dir, symlinks=True, ignore=_ignore_heavy) + return Path(self.working_dir) + + def cleanup(self) -> None: + shutil.rmtree(self.scratch, ignore_errors=True) + + +def _probe_env(home: Path) -> dict[str, str]: + return { + "PATH": os.environ.get("PATH", "/usr/bin:/bin"), + "HOME": str(home), + "LANG": "C.UTF-8", + "LC_ALL": "C.UTF-8", + "PYTHONDONTWRITEBYTECODE": "1", + } + + +def run_probe(python: str, tree: Path, scratch: Path, probe: str, case: str, variant: str | None) -> dict[str, Any]: + """Run one fixture in a fresh process and classify its outcome. + + Returns ``{"passed", "failure", "observations", "replaced"}`` for a candidate outcome and + raises ``GraderFault`` when grader-owned material failed. + """ + from .graders import fixture_key + + key = fixture_key(case, variant) + work = scratch / f"probe-{key.replace('/', '-')}" + work.mkdir() + out = work / "result.json" + config = work / "config.json" + config.write_text(json.dumps({"tree": str(tree), "case": case, "variant": variant, "out": str(out)}), encoding="utf-8") + script = PROBES_DIR / PROBE_SCRIPTS[probe] + argv = [python, "-I", str(script), str(config)] + ended = "exit" + returncode: int | None = None + try: + completed = subprocess.run( + argv, cwd=work, env=_probe_env(work), stdin=subprocess.DEVNULL, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=PROBE_PROCESS_SECONDS, check=False, + ) + returncode = completed.returncode + except subprocess.TimeoutExpired: + ended = "timeout" + except FileNotFoundError: + raise GraderFault("probe_interpreter", "the repository interpreter is unavailable") from None + try: + payload = json.loads(out.read_text(encoding="utf-8")) + except (OSError, ValueError): + raise GraderFault("probe_output", f"fixture {key} produced no readable result") from None + if not isinstance(payload, dict) or payload.get("schema_version") != 1 or payload.get("case") != case: + raise GraderFault("probe_output", f"fixture {key} produced a malformed result") + status = payload.get("status") + if status == "harness_fault": + raise GraderFault(str(payload.get("stage") or "probe_harness"), f"fixture {key}: {payload.get('detail', '')}"[:200]) + if status == "candidate_running": + # The process ended inside candidate code: a candidate outcome, not a grader fault. + failure = "probe process timed out in candidate code" if ended == "timeout" else f"probe process exited {returncode} in candidate code" + return {"passed": False, "failure": failure, "observations": {}, "replaced": []} + if status != "ok" or not isinstance(payload.get("passed"), bool): + raise GraderFault("probe_output", f"fixture {key} reported an unknown status") + observations = payload.get("observations") if isinstance(payload.get("observations"), dict) else {} + replaced = payload.get("integrity_replaced") if isinstance(payload.get("integrity_replaced"), list) else [] + return { + "passed": payload["passed"], + "failure": None if payload["passed"] else str(observations.get("failure") or "pass condition not met"), + "observations": observations, + "replaced": [str(name) for name in replaced], + } + + +def _resolve_repo(repo_path: Any, project_dir: Any) -> Path: + raw = repo_path or project_dir or os.environ.get("PROJECT_DIR") or f"/home/ubuntu/{os.environ.get('FOLDER_NAME', 'aioftp')}" + path = Path(str(raw)) + if not path.is_dir(): + raise GraderFault("workspace", "the repository to grade does not exist") + return path + + +def grade_repository(repo_path: Any = None, *, project_dir: Any = None, task_id: str | None = None, **_: Any): + """Grade one repository tree; always returns an ``EvaluationResult``.""" + started = time.monotonic() + timings: dict[str, float] = {} + runner: GradingRunner | None = None + try: + from . import graders, integrity, regression + + stage_started = time.monotonic() + repo = _resolve_repo(repo_path, project_dir) + runner = GradingRunner(repo_path=str(repo)) + tree = runner.replicate_workspace() + timings["replicate"] = round(time.monotonic() - stage_started, 3) + missing_sources = [str(module) for module in CANDIDATE_MODULES if not (tree / module).is_file()] + + stage_started = time.monotonic() + python = repo_python() + fixtures = graders.probe_fixtures() + with ThreadPoolExecutor(max_workers=PROBE_WORKERS) as pool: + futures = { + graders.fixture_key(case, variant): pool.submit(run_probe, python, tree, runner.scratch, probe, case, variant) + for probe, case, variant in fixtures + } + results = {key: future.result() for key, future in futures.items()} + timings["probes"] = round(time.monotonic() - stage_started, 3) + + stage_started = time.monotonic() + try: + regression_report = regression.run_regression(python, tree) + except regression.RegressionHarnessFault as exc: + raise GraderFault("regression_harness", str(exc)) from None + timings["regression"] = round(time.monotonic() - stage_started, 3) + + breaches = integrity.static_reference_breaches(tree) + breaches += integrity.runtime_patch_breaches({key: value["replaced"] for key, value in results.items()}) + integrity_report = { + "breaches": breaches, + "checks": ["patched_runtime", "grader_or_gold_reference"], + } + timings["total"] = round(time.monotonic() - started, 3) + return graders.compute_evaluation_result( + results, + regression_report, + integrity_report, + extra_info={ + "task_id": task_id or "aioftp_stream_abort_desynchronization", + "candidate_sources_missing": missing_sources, + "timings": timings, + }, + ) + except GraderFault as fault: + logger.warning("grader fault at %s", fault.stage) + return _fault(fault.stage, fault.detail, timings) + except Exception as exc: # noqa: BLE001 - any grader-side failure fails closed + logger.exception("grader raised") + return _fault("grader_exception", type(exc).__name__, timings) + finally: + if runner is not None: + runner.cleanup() + + +def _fault(stage: str, detail: str, timings: dict[str, float]): + try: + from .graders import fault_result + + return fault_result(stage, detail, {"timings": timings}) + except Exception: # noqa: BLE001 - the scoring module itself is broken: build the payload directly + from hud.graders import EvaluationResult + + return EvaluationResult( + reward=0.0, + done=True, + isError=True, + content=f"grader fault at {stage}", + info={ + "raw_score": 0.0, + "final_score": 0.0, + "caps": [], + "criteria": [], + "grader_health": f"fault:{stage}", + "grader_health_detail": detail[:300], + "gates_fired": [], + "gate_statuses": {}, + "timings": timings, + }, + subscores=[], + ) diff --git a/harbor/sources/aioftp-v11/pyproject.toml b/harbor/sources/aioftp-v11/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..abfdcb71a92bb9049ab91298fb8f8a40d41a8510 --- /dev/null +++ b/harbor/sources/aioftp-v11/pyproject.toml @@ -0,0 +1,44 @@ +[project] +name = "aioftp-stream-abort-desynchronization" +version = "0.1.0" +description = "HUD coding benchmark environment for aioftp-stream-abort-desynchronization" +requires-python = ">=3.11,<3.13" +dependencies = [ + "hud[agents]>=0.6.0,<0.6.18", + "pytest>=8.0.0", + "pytest-asyncio>=0.23.0", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project.optional-dependencies] +dev = [ + "pytest>=8.0.0", + "ruff==0.11.2", + "pre-commit>=3.5.0", +] + +[tool.hud] +image = "aioftp-stream-abort-desynchronization:dev" + +[tool.ruff] +target-version = "py311" +line-length = 120 +# grading/baseline holds the repository's pristine tests verbatim, with its own ruff settings. +extend-exclude = ["grading/baseline"] + +[tool.ruff.lint] +select = ["E", "F", "B", "I", "C4", "UP"] +ignore = ["E501"] +fixable = ["ALL"] +unfixable = [] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +line-ending = "auto" + +[tool.hatch.build.targets.wheel] +packages = ["."] diff --git a/harbor/sources/aioftp-v11/runtime/aioftp-dev-requirements.txt b/harbor/sources/aioftp-v11/runtime/aioftp-dev-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..af16f744607a178bdf0c18404147793e99f83ded --- /dev/null +++ b/harbor/sources/aioftp-v11/runtime/aioftp-dev-requirements.txt @@ -0,0 +1,738 @@ +ast-serialize==0.11.2 \ + --hash=sha256:00119a8fb8c1dc0f1fab023f4d8071fa49e3b0208ee54d589fd463c16ab0124e \ + --hash=sha256:00bbf1f6669f813b48925b759f7ae4591067d456d443924055cab386e7e0a719 \ + --hash=sha256:08eda88a0f290a36c38cab33df8bf7e35eb95bc802ca5beb2c8fcda471a7d10c \ + --hash=sha256:0d01f61352c96370febf6c0dbd488dee9183a731fb2702170da9163ae317cded \ + --hash=sha256:0de02520c11391a026e62987a9aa2c3c2ff01545155059ddf0c4bdf2c5ecbe9f \ + --hash=sha256:13b13afe32e845c86a573497729e1b7ddeb26c572c78bf50ece51da23b8fad5e \ + --hash=sha256:1844ed9a487fb3de7325c52ddb33f2918b66b65cd54d3f8d83d23785ffe99fa4 \ + --hash=sha256:1d6ad94edbe93bf1dabc06c9f37d55b898fdabc456aa6d7ced5e23c14f795f32 \ + --hash=sha256:2fa3be25f7f5351b1b39c9f8a52779b2dbf21199efbae564b4746422e8edca4e \ + --hash=sha256:2fdf31a0bb85ea2575cc91669f005e6647d2efed491231c4dc1497bc9a5b3aa6 \ + --hash=sha256:3b78e6fdef3b06c86ed263e1962fee5a7b9d2d158e738b212d13b2c605ee12f5 \ + --hash=sha256:40b2801cf2221bd922d9f69d2f0ebc373c3db47207315d525b2d87fa161a2af4 \ + --hash=sha256:43b51e6ebe6549bf21416c3c78ee886147b80875a87cc6f69e303dde0d75be0b \ + --hash=sha256:554d117cb916d8032d85007c654d179efbbfd446174c048062778136a922944f \ + --hash=sha256:57c0f5cb0021a5beb1e5e4d6e840ae2f23a28909703ef4d256a144cc1ad3d437 \ + --hash=sha256:59c25f47524efa052971b860e128b1add0c94ede7dd16b2962952c85c3582365 \ + --hash=sha256:6061a54f39e82a9f2cbcb9c268fc441890e4818a6636473caa4f4063254e0750 \ + --hash=sha256:75a1c7f46b9c19fc0ae01ca6fd076301628faa2ed7a8edbd55c6353c483946a3 \ + --hash=sha256:76cc294246e60a914326b4ca88c6a5ea89c064906614aaf1537ce82f09e9449f \ + --hash=sha256:7aaaffc32905159774a107d3cf33dad59bd41b7a0d1bc9885532186753ee7439 \ + --hash=sha256:7f1823275b246f9c7d373be6879e4eec09686948895d4ad083f4b27fd7e4da70 \ + --hash=sha256:8532f20916fa3189d4d785ef2a62d93c4d651ec9c5bffda66d2fc36898351f34 \ + --hash=sha256:85fbb01e83967a126d71f679f2b9528ef0912cb0854aa1a4657314c34e255b57 \ + --hash=sha256:89499a439955931281986e97ca4dd3c064bf0d2e0027c0017344eb86667733a1 \ + --hash=sha256:8a5ffa70e76191dcf240d3c43e20c93b3bfd26f54d89148c762d57837f5bcd2c \ + --hash=sha256:8d62a47714c8bc432b9fabcc29989c815c5da17327d35151f2fd0d85c2a7a5ff \ + --hash=sha256:8df32ad4ff7843734a6c2f067ee974f6d3109ee5a2c3e1a9d2f79347bd282a9a \ + --hash=sha256:976a5bd75845d22f4b52905ddf53ab669ef1b14dba7735f5512841a2ef2b5450 \ + --hash=sha256:9d80a81ec84660422579bdb8e789f656a794b48c7a1ae1261f6bd8bc1897d17d \ + --hash=sha256:a0fd40c668b0fa19b8fdb61d9e63d547e2e19cfbfe053a51ef0b6c37070298a8 \ + --hash=sha256:a586be418eb70a9f1396cea29ddac8f4b9bf277fb73ea2340db31e218bc00f32 \ + --hash=sha256:a7004ba572f09be34342ccb98dcd4bad5707d3d81adc8cb4c3f685d2a2c51bbc \ + --hash=sha256:a9ffa8a197a721f07a352d0be6185f5b3e6f9aaebfdb66169ed652108531ae3b \ + --hash=sha256:ab924ba260efd7509492f272d4e236d24564033f20c005d7c63a107c6a76fc85 \ + --hash=sha256:abdb3e49ba053c3486ac1263bee9f16cc9a4a8abd9f8c90bfc21e3669f3ad9d1 \ + --hash=sha256:af8c003ce721b0099dd55cef4ba733500fc3054ea0cc8565d8957aaf7cccdeb4 \ + --hash=sha256:b17869f4ba261a5fa468a753328a548f4dbaf74b4eadae9e28aff66df7f1425b \ + --hash=sha256:b4e4558956b6a0fb35e18fba58f7d1810b1f2c0e6b52352572cd5dfb6b4ef33a \ + --hash=sha256:b9065dd23131a23b41f5bab3bf4e9b3c350a3fe8e36e8200eded9b729fcea484 \ + --hash=sha256:bfbe47a3a7c368f28836e78b2440a3643ac0ec4c67d9fe53588e1448f0a3d35d \ + --hash=sha256:c58bb119b73657fdc5569692f316e1e25ca114bd62f7782eb527c6be438ba3a9 \ + --hash=sha256:cae5addfbb54cc1d47fe947ef9138e9d83849ed1cbc72b819cf36d96a2315b07 \ + --hash=sha256:cb073bfa15742699d408ac50f60878383b5665ae1791d1b6799ea6f08633cd77 \ + --hash=sha256:cd320a5c4f1f2742af97eea22954f776379175c5ef2504801e9a155f2ff9a4d7 \ + --hash=sha256:d60515335750d431e462af6e722bb55720a5e7827192777bddfd9c4376065a4d \ + --hash=sha256:d70556a2f9230a44c99a655774cde823f056efc34466eabfb4085f0cb1ea9f99 \ + --hash=sha256:daadf1c3e0224621607ffe16f1379e4bd372271ed2e1db8a67878f0bab3ef7e4 \ + --hash=sha256:dab599cbdcb7b45b18c41fad746645580b3a24357082b7f0e8921cd373804f27 \ + --hash=sha256:ec1c20f89c3e0d83576e3c06f79375ce936266591fe0d5fd969914af3185cbaa \ + --hash=sha256:ee732ae167e686d1d3c00f98d7d82b23138304694f0441b14d7ddf9c0f8a921c \ + --hash=sha256:efa819d7c14c8e4153dcd84671826331538be7cbe460383fc6386f5eea5bd234 \ + --hash=sha256:f3109fe4805384effc8d0f8e41fbf875aa8f389af91b4348c1cfb60ea6e4cb82 \ + --hash=sha256:f3a367e0e05ed2d1b747ceb07aa728a8c204cc008b589127e9bd4f40053d7575 \ + --hash=sha256:f6a8dfc5ab204a706f6e5d39c6f77c18c27ef084fa2081803a64a9160ce89277 \ + --hash=sha256:f739e0b601be7300c5697a2573d9200bd1db74b34ab111ef9537b9d5dcd7f106 \ + --hash=sha256:fd666cebd6ab3b3c0fd348a6202c26e18a401ee34293c3804d3472266bc146f6 \ + --hash=sha256:feb16d9c2a720e0120c58dd5d6e7b3c7c86b43249b60a3bc212bcb8fa031e2dd +async-timeout==5.0.1 \ + --hash=sha256:39e3809566ff85354557ec2398b55e096c8364bacac9405a7a1fa429e77fe76c \ + --hash=sha256:d9321a7a3d5a6a5e187e824d2fa0793ce379a202935782d555d6e9d2735677d3 +cffi==2.1.1 \ + --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ + --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ + --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \ + --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ + --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ + --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ + --hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \ + --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ + --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ + --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ + --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ + --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ + --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ + --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ + --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ + --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ + --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \ + --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ + --hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ + --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ + --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ + --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ + --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ + --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ + --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ + --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ + --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ + --hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \ + --hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \ + --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ + --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ + --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ + --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ + --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ + --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ + --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ + --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \ + --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ + --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ + --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ + --hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \ + --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ + --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ + --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ + --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ + --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ + --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ + --hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \ + --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ + --hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \ + --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ + --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ + --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ + --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ + --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ + --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ + --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ + --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ + --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \ + --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ + --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \ + --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ + --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ + --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ + --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ + --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ + --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ + --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ + --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ + --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ + --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ + --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \ + --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ + --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 +cfgv==3.5.0 \ + --hash=sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0 \ + --hash=sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132 +coverage==7.16.1 \ + --hash=sha256:070acb9da788dff743a4d36fc015feee12d68f0349959017542017c79f59c21c \ + --hash=sha256:0c309096926b119543dc16438a11ef4c80783d2f4e59ff94f7f462651a944cdc \ + --hash=sha256:0d0ececb32090e3fbb03e0d352b973a0485879b4de6c58daf47227b9988b99e5 \ + --hash=sha256:166adae25b05b04c9a84135912066d9c97482115af38df1a419a38aacc6b6f5d \ + --hash=sha256:19a3ea2f364012ef06678118fffdc92442a16bef4a5c8ad4f4019dd8f9ac8876 \ + --hash=sha256:1b24f79e25bcf6c73931aeca7a3dfc7595c0cb5e9364aba3fdf387a3de4b1c22 \ + --hash=sha256:1ec9a4ee989c0d06ad95add0dbfdbb72b00ef53f43431ca0b612384e7878e5de \ + --hash=sha256:2270a794600b635ca9452ce4c32e2fe81a35f9caa17ffac0eba99f14f275bd4d \ + --hash=sha256:2959978f9d1d20a2c0c15d0a68baaeccf615ac1aa214cf4a05a10d6f568926c8 \ + --hash=sha256:29c4d3e32a3b5efa420a3dc627c7e570deb80ef997def52c7686a474f5edc7ab \ + --hash=sha256:2b26b55b18e1a53e1a159dd743728c4ddbbef28ba19000a91aaff5ce023197ec \ + --hash=sha256:2b8256f8b525ba233d2e4cdcdce0d6673c66fc9bf70df1fd5e67c54a74e2d245 \ + --hash=sha256:2c05913d0d5badf7ac83200f35dcf9514cce5df16a7cc89e7d1d7fff0461813b \ + --hash=sha256:3284754371dc78592aa3ae4d661d30ee20e02b2b6b0de3590a181a936d0d3b38 \ + --hash=sha256:33300f2e140ccf26af3d8152e62bff71993f9310cfc63ba7a20940b0d246a0ae \ + --hash=sha256:3397b9032553d281ad6a9253b12675b65e0cc8cd7a3b0633cf48872c9eb13360 \ + --hash=sha256:34bafe9f4094315248573e6223e11af0ec1b25f9cbca43bf0e9a26a189ba2751 \ + --hash=sha256:35cbc81f937fc402971df45c897d2df2bfb2014efcd990360032aa0a651635da \ + --hash=sha256:38a7e16f061504ac2b45370bf5bf97e8250d8d3f25e37385bae884978166554b \ + --hash=sha256:3acd1d78397dead78dd1b011b5fc19cc823c190349acd549e63856dff649c80e \ + --hash=sha256:3d0a3681c12d3e0bcdea3d9414b04087828d6c1a482802d6f7f42c37ed530152 \ + --hash=sha256:3d73bb1f85c4150ac208fb0755beb04b2e44897bad81414de9380f98dd74729f \ + --hash=sha256:3d8bd4e58b6a5c2018d808f297905393c6c61da466a48c3f0596a76a4900ebe4 \ + --hash=sha256:3db3978211c3cead5437a80136ca0556bab8bc7828de15a762884b0598c41361 \ + --hash=sha256:3df82f0a3cef4e1bcfc799436056f0b978dda319d0bfd4460c6e479b2802d98a \ + --hash=sha256:3f3b4469d3da3ecced775d1a8c9c5d9fc80f259e30b7b89f9fed0700d6035ecb \ + --hash=sha256:3f73ee3956fde2d461c9e2955dd48166e4821fc8587d135e8780fb84da2a098b \ + --hash=sha256:4027bf6d7bc0a16df058ce913b69f10c5687f8e1ca668f08caa659ce101744bf \ + --hash=sha256:4184e78a4465dcda359fb403172b8951dd220929cb0984c02fabca1742fff06f \ + --hash=sha256:46a88f51770df7c9bc376bd57d3f86cdc7624b8e16ac4b585a655c22b7a1b4db \ + --hash=sha256:46cd3a73e9140410de62cceb66214bce0e08fb3922b9176fbfc1522fec151b41 \ + --hash=sha256:48a78a66fcce49d7f6156524bf979c0ac633d584199717c68c6ffa949fc14e6a \ + --hash=sha256:49c39c7068a494f8eb427155f5682f44feee43f9b3107fd54b1e52465379c54b \ + --hash=sha256:4b0359eb4c62f9993e176bc8f50450fc736a6b90dbcc05bb8584e948812699ae \ + --hash=sha256:4f12a9e27ca7b65e40a8475d27899b2d45064d9020e6a89148939e01987b5853 \ + --hash=sha256:4f48b345f831eaf4402ab6333c2dc3e2e2b5bc7b9c1b8fe12680dee3f0538f01 \ + --hash=sha256:528a61be40977c340cf201d23b69bd6a6bab507da60e9dbda85f8b30e935d70d \ + --hash=sha256:531d9be377fdcc05593b974656872eb82e808ebeb42a72515e3aaeb8bb7166f5 \ + --hash=sha256:550a2a1faf7559f13d5344f12d1eb886ad87955155d7dfab2a3fe5c8ec8fe776 \ + --hash=sha256:5539304fdbb2cc144df684d35a33b81145334d23e1c2367b5a923d25107f70b2 \ + --hash=sha256:5597180ed7670cc94c04c65347418a467d3a43d5f0cf52fcac647f5425f42037 \ + --hash=sha256:55eb268e5b81aefac759766c9162625b06c1bedb7b77d936225bafc4f038a6f6 \ + --hash=sha256:64a2a5985d81810ed605ff0dc4ccd6555efcb5700353825532a9a0aea65826e1 \ + --hash=sha256:65a8fc80898c9ce59f04349fe8b4849b1f9787f14e52ead990e5f849ff4727a0 \ + --hash=sha256:6618f481053b63fc6121faf8fc676bd9b7163c2a19d9e984a2e850002c28ab57 \ + --hash=sha256:66d70132b69b861805dc1ca46cdd733e54c416890e8f1371d2fd103f70b59c9c \ + --hash=sha256:681a9488c5a234397c4f013da065aa9e53eb7af4c78f1f80c6f15e7208acb855 \ + --hash=sha256:684c7ee9b4c04358fe6ac8b517ab51ec35fcd79d08ff0f105dd8bcd96885bbb7 \ + --hash=sha256:6b3fd0f3435ebb7a7183b32a6062a8b755f08242ced1f3f22761d30b56b3c2a5 \ + --hash=sha256:6dd8dda3402a01a1a8fe8b753a282466f615128574a5590a9108acd07b1f8540 \ + --hash=sha256:6fc735d6fe6d57f803e7ba021be4dde48e43e6aff94e6954350555d5332b0594 \ + --hash=sha256:715dcb72c3280c428c3a20134b87e42c29acec9669136e899ab2de69ca86218d \ + --hash=sha256:72e013665e25cf9d44779f01f340af26319756f9a76822b7c94ce6b1d93813da \ + --hash=sha256:73a32694603a34ad01d7e51a481a4023410d8099e1d0757e067945695c10f0ae \ + --hash=sha256:7562f8067ed9360e8b9739e5703403a7686dd1b36bf0f89fc538047c54cdea90 \ + --hash=sha256:756ba2d96d073c5a2a55d67fa22784763710fadbe22c41adde2d9cfa4dd78a8c \ + --hash=sha256:7580432cbe1e8b762660ae5806f04f869e1c02e519836a43f8094437e561e9f0 \ + --hash=sha256:76491917771f179f9772efe218c5ccc65950dbdb35f4439298d8a8dfc6ec1f72 \ + --hash=sha256:77890395cf37026a5907d3ad32376aa51f41c0f163b7477fdbd4f94966cc1d08 \ + --hash=sha256:79afa9726438912e5cddd1fe541815cea9763c92935f594835e4c432565b68a9 \ + --hash=sha256:7af03247d598a353bbbbe1b925deb735276e4d845e7197c4073dc89352b236fa \ + --hash=sha256:7e5727b2508f817f3126d6c33327dda32fe69d15514badfcd61db8bc4209ecef \ + --hash=sha256:802d1246c540e07486d4ee1adfa19a797e4b33529ffc371dc140644e8f27da0a \ + --hash=sha256:83362b64e215ef00b0ba33fcf13655ace6c9fdd144d5ad2ab59ac86c2daf166e \ + --hash=sha256:8643baeb590726c558b2faed6cd59b0917480f9367fcc692026f1a86d824fd08 \ + --hash=sha256:8bb09a2d19b04db1fa0e087a7ca4f12458f7e0e7364cfcd838441d86fb1c61f6 \ + --hash=sha256:8ee71a38c54bb2676bbe762b8b0943a79ccb1c2fd6a52054f66e63eda392f8c1 \ + --hash=sha256:8f590d46c30d9e4c1fda3efefe5443f4c2f6a4192c5ca2ba403653e9ebadf097 \ + --hash=sha256:8fae08e85b334ac6ac886002b5041396a31bcf805225bbe19847627203da99e2 \ + --hash=sha256:946f58aa59b08bcd6afcc6a7bd0ff54ed5eee844f32ad69fe6814836d15856a2 \ + --hash=sha256:961fc424e9d5229a99f8f1189942d8e7f4e1519147c3af64842f944aca03914d \ + --hash=sha256:996c2b891b441ec2b39725ee3e8386e2f11b4894b92be225fdfd54a3eeada2c8 \ + --hash=sha256:99bf9ea435cefcefd220f8687c3ddbbf78dc2de0bd11b57c3ae9fbbdf8d5561a \ + --hash=sha256:9d8c54ec32e5c102b9241f75d88ae26538b53662868ca491736611db448d9c7a \ + --hash=sha256:a125fac1f6b1e88488d208a86b578e1790e3c4937f2e1568d23356141d236220 \ + --hash=sha256:a337dc2d54c74430cd2febb8ee04f7c508ba8b3b412bf0463f077a66cfc73743 \ + --hash=sha256:a4eff405b545dfcf79cf0d9d3ff750e5c5a887aa066114175193a81d249c5ee6 \ + --hash=sha256:a6410b75fe07d5271eaa95fc24bd0a9177ed588d9d1c10c0cf67829adb8f0567 \ + --hash=sha256:a9647a0ac46255b8fef59a433a2161f03e5483f3a35e1cbd9dfe4600baff0c6b \ + --hash=sha256:b0944dc3bee3091039bf970d73caaf930c906013128a421bdc132e797494d941 \ + --hash=sha256:b10095528b866d322d33d6bf1709b7f8cbf959f12e8cb2ba22fc59c8717866b0 \ + --hash=sha256:b44308854ef210b9b78df9cdfd4e159513382a859f5ef8464306d14a54c2a040 \ + --hash=sha256:b7d4d7e6dcaf33e85f1919f03346403bdcc27437c420a78835f3805bca0ab71f \ + --hash=sha256:b7f2c26ce6ce0b1e0ca0d5fae96ea510e3a2e78b7207f06e76b7f2c87fa3d0af \ + --hash=sha256:b89d22a89d5bc05dd95b64e08295b8394aa96dc88e08f8ba210c9ebfebbe0489 \ + --hash=sha256:bb462d59146656e278d1e8ed913ce374d0ba68a4e081acde1867f6d3377fc881 \ + --hash=sha256:bc5354a124799f1f87b7637bbe6f18cd4bc66a1f37f6aa2b5db40f9adad531dc \ + --hash=sha256:bc53c3f3adaa939b7a063533ffe0ae1259e7073393c618043a99a6970a87e3df \ + --hash=sha256:c08ae35c1be2fe1ce4b4c628df5c6fc0dc9a87f8e5fe8e20238d249678984741 \ + --hash=sha256:c389c6f9d1d518e1249ddcb8a7f158135644ce2c508fa6cc17b680777dad5bf2 \ + --hash=sha256:c510dad19552d912058e4c3e3cbec3fb155dbe8d0ce0ceb7e7dbf5c5822bae0b \ + --hash=sha256:cb05c0ff98b56ba6969adf35556bc43bcb8d094df8bc9cb403acff53460c4e07 \ + --hash=sha256:cc0b37fe6f5ce5f1ccc62ad4fa9b1ad201d8e9b6027fd5e0170877beee4b2d15 \ + --hash=sha256:cdc57746c7ac0ea063351b4d651c3bb4dd4fd35e64dbb8e90c10e14eb03c4080 \ + --hash=sha256:cf047bc39fde5425be2628666d0f435ed8817859111c3aacc84b32d858069f5d \ + --hash=sha256:d06dcc420b570bf683cdb647cc8fe62b672d9e429ef711c3cbbb7a6880ca1572 \ + --hash=sha256:d0f02c633630e2b74522108ee95a84ad6e1204a8016a6cca5297f335ea27147e \ + --hash=sha256:d1039cb2de093225d597109342ce1675626bd127565e80b3044f4eca07c15b2e \ + --hash=sha256:d1ba5142d68dd2cb775cbd0ac8601819298152047803c8efe4eec6d7d7aa7878 \ + --hash=sha256:d4ec944947de098ad5a1738413f9364689a57067ecbc328e9de37218aa1e5cc1 \ + --hash=sha256:d57cc400275b9a2892e905fc893f732b21ddb95271bf96406c88e2f6367848b5 \ + --hash=sha256:d7db888dd0a1df1a653cae7f99d4047430d2187a3626eda51bc847b0fd6b9b43 \ + --hash=sha256:da506e669a8a851b59e122b4b219ea70996a6296f44f3a9348a852526ff961de \ + --hash=sha256:dac8b84c03e6029d272b8249c77018db83de59ca009a9adef7c144b4a62ee5e6 \ + --hash=sha256:db651a9cf325a542bc2b7b8cc8f1b2bdc6492739bae3103731b2f1c85b96cff6 \ + --hash=sha256:dccc142614d3419ed71857deb43f1d757829a4c7fce9994464b71e7e38309827 \ + --hash=sha256:e306e98186b9cd109121f3583aeb7978797ad21d948f22944c5c08845cd554d0 \ + --hash=sha256:e366587b370bc9b8b51b7b7272c610c56db5d5b4795b9e4a29d28ff2f440f809 \ + --hash=sha256:e5eb1762e7eb5fad34ef913e8107c7788a66f19d328e598ce95bf7217f9e5c8f \ + --hash=sha256:e82e10b9d290f60b63459cfb245a841aec347603997206296b93881463a93dcf \ + --hash=sha256:ed5ade1bb18f62edace1bd198c66f9d4c75a8385d5fd24e87d917ea1a5958773 \ + --hash=sha256:ee1d5fc9e3bd6a217906929cc97880239a91d20dae7746f538eb0eefee705ab1 \ + --hash=sha256:ee5465db6e9152a7d09f3215309326878c6aa3ac509195a369f9d264ff4bfbd9 \ + --hash=sha256:f0ba3892d81aacf36996c52f16bca04e39af31a6c5de930b7688ab617f4a6475 \ + --hash=sha256:f2066c447fdd0bca39a9633a082d8ce67bf9a539a203b85059a364a405dc9fe9 \ + --hash=sha256:f4aa0b0a6f81fa3deb211e643f6954e78b4376b62b9c218271236cfa757664e8 \ + --hash=sha256:f83981779bcf9dfa06fa0a8d4cb43e0faec1706328ce07aa3e7b665b4ac0f210 \ + --hash=sha256:fa02d561eb1d8d2f8ba43ba6e3cef4c6c402a3b632a9460fa329fcadcd5df6a3 \ + --hash=sha256:fbbe8265736659a6be2e6042b6a35be13545d14b243cc1d7ecf65f90d788a370 \ + --hash=sha256:fd8ac10cd2458b3c6343aac082fb9bd0e3fa806cb2c4975f2280153474b88412 \ + --hash=sha256:fdb2f528b50953e29d22033b3256c396a700193c6e45b2490222ef9c333cbbf9 +cryptography==50.0.1 \ + --hash=sha256:01f41478cf33fc605a6a089cd56d28b45c6c0b45a1928b61797f2621a04bac71 \ + --hash=sha256:05ba322c4da95b262a212c345af888ef2c37c88c0509756ea00a0e6d68850f23 \ + --hash=sha256:16c5ecd954b3330ebfb6605eca4fd952da8bef376551d5cc264534e3770a9ee6 \ + --hash=sha256:2a93d05e34d5f67fba6f891fe85d929999baa7195e853923ea6d7576c9e68c5e \ + --hash=sha256:2b34d76a652ea2b6faf777c35df230c5637842cd904e04f16230c3f9f03e4361 \ + --hash=sha256:2ebbfb0f1fed745e91796e3e1080a1440423fdae8ece1b995a1d80883a409054 \ + --hash=sha256:30a125032e5642a21ff816e021152bd4e7e94f03eff3f4b7fca41cd22bc3110f \ + --hash=sha256:330fbb252391c596f1ae42c5754449dc924e6ad012dca8efe0d703f9f2d12ec6 \ + --hash=sha256:359e62deae718bce96170e223fdcb6357e4fbd3bb7a3a75f4430763532560e49 \ + --hash=sha256:407fe2b6db00939c05c0e945e9914238f2f0a430974839429dafc82b1ee6bee5 \ + --hash=sha256:42be3bb70596b3abe4ac097b75be223e8b3ab614a0e5de068e3dcc54d71d6149 \ + --hash=sha256:4c4188f7c0cf655be5c06342b817ed0f9595b69ffa2b12026e5353eed29dea88 \ + --hash=sha256:51593d180cf6d179bde5c5d065bed81386b1f381656ae7d042b7ffc87a9895ad \ + --hash=sha256:51afcfceb15597cf2635068e4ac9a56b2abde622edde17f37d85fd7b5306497a \ + --hash=sha256:53e279950892dc102c6b4e52af03ae5ea92fac572a1ddab78ca73a997f62b69f \ + --hash=sha256:55d16b1ef3ee0958d893a977b19777887e546c9954ea81b200c3301a864013f2 \ + --hash=sha256:5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20 \ + --hash=sha256:5fe002589592ed749ce77fe0695fcbd3500dd61d7d6db5858a7544c612fa8e45 \ + --hash=sha256:5fe939deeb161024a6be98229c953b6591fef1f41214497a78fe793a244c017f \ + --hash=sha256:693c99b49bd37d0d096e4334c10232c77248c415b98d35236094cdf96d57258b \ + --hash=sha256:76de83fbd91ac49c0feaaa983d0748fd7a53176afac5fb3bf7478d244f0eb527 \ + --hash=sha256:79bf008d1f9af6071c797ad133e39915dfee7614f18f18f4db9072eb715064a3 \ + --hash=sha256:804728ce710890870f3aaa344b2e161172d258d768ac139d02cfd9092d0d94e6 \ + --hash=sha256:8921d58f426793c5f1b47f0b59575780de9a095214958d0eb37d909593db8367 \ + --hash=sha256:8df2de9102026855887e4587084f6eabd80ed0f345b8ad8a7ac27ab9bf4723e0 \ + --hash=sha256:9cb3cb952cf5a8abd50c782a98a89d71699715e802fe349704b47f2425b42a94 \ + --hash=sha256:9dde0a357190eb3b1da1bb9ab750e9c85cba82ca5977aa0836cbb94e92611239 \ + --hash=sha256:9ebcdd5519be9b652a46f507817a74591774fc3d6923ac364e4dfa64e36b291b \ + --hash=sha256:a0b1a59e3a089064a0ec309e9428c8e3ae4e161419d20ac33600767e83fc658a \ + --hash=sha256:a255449073358275b64b67d3f595f268bbef70e72b6edb65e0c70c735bf739c9 \ + --hash=sha256:a8f40ea47330e71b594a7e246898f93177c259490c63183dbaf9e571d71ed9a5 \ + --hash=sha256:ac02b07824d4d1001bd4367599f839c19cb171924c796e52c23508ac14c2c0cc \ + --hash=sha256:aed8db4f6d71c51efb89530e12d9464e7bf2923d46c3205dc794a2a93f8c0648 \ + --hash=sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986 \ + --hash=sha256:be224a65493ec5b74a158ff22a5522ce4a5ca1e543c647a3a4730d4a09e5f959 \ + --hash=sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0 \ + --hash=sha256:cbf74a81765ee67413503ca6e26dcc4f6f5a519822436cc0a1b97aab6c1b8a17 \ + --hash=sha256:d63ae8f6481fec907ac0f588eee8a90aefde112c633131fe540e5711ddbb5a4e \ + --hash=sha256:e22dfed744bd4002e909464cb23d2f0b05c6f3113a79ef2e9864a53db737c733 \ + --hash=sha256:e2ca8fd1b6b4b82a1c4cb02841d0837e3c12336c2e24b520ab8ab3b969733d8f \ + --hash=sha256:e74591e283fe6eb956416c929eb58262a719fe0311fd9054c62c3350ed8760d8 \ + --hash=sha256:f74455bb086a85d5e81246412602aaa97ed095e504cd40dd261ef50be42205bf \ + --hash=sha256:fb4b9672d389c738b175c4166e78310f8a70358886aacd9173ee03a85ffdc671 \ + --hash=sha256:fc3ed7ebd2a8c96f5b166de0ab9b624996bef3b07bbeb19364dfb78222c22c80 \ + --hash=sha256:fd3718b960d0b5dd213cdf03f3bcb7000e69dda0de8b956061947ff6bcff5558 \ + --hash=sha256:ff838d62ec1bfce4f9ba7fa16f4a7b554cd8d0c299e6be37502161a660c84eef +distlib==0.4.3 \ + --hash=sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b \ + --hash=sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed +filelock==3.32.6 \ + --hash=sha256:3f16ecd0117feae0dfc147e8c62eb5daeccd8bd800378c3ddf416de9b4feb6b1 \ + --hash=sha256:a3f55a18af3652a94d8f47d6055df434f254ca1d02ef2524850c6d249ca2512c +identify==2.6.19 \ + --hash=sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a \ + --hash=sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842 +idna==3.19 \ + --hash=sha256:5e0811a4383b21dc5838069f801c4fb62113b7447663d2530d2bd6e77b49bf15 \ + --hash=sha256:815e7be7a7806d54abb586dc943addc79e8b2ee16915059658cbeff4b1b43bf4 +iniconfig==2.3.0 \ + --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ + --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 +librt==0.15.0 \ + --hash=sha256:04d5387b908676c0b8d5d2f5fb58373b4ea382d81f7a6f0fab8ea2a462bb4738 \ + --hash=sha256:077471b3182db4e17c36ae91555f36a4d2c00080b267f749bcad34a478a9a302 \ + --hash=sha256:0a15cb554761247d84a3ec0cbdf4078d70725384f0e4662c0fa3b26266eb60ad \ + --hash=sha256:0da0d94cb802f32a0524653e7201f2cef72d5f700a5407678f5290483d4fcd08 \ + --hash=sha256:0e2d0c0acf5b0ada7d045912b7cf787c21315c95b38b1fa939ef72d45d366b3d \ + --hash=sha256:0f0ee3644d951f31055ad07d77d92520e84505dd7a432cc4cd501dd70ee06785 \ + --hash=sha256:1172c6ad2a88b646e7fe3b480e3fac4ab4418b3443fd8a4061fdd531e0622fc7 \ + --hash=sha256:1256589e0b0adb31751d685a68bce29d73407ddf4ef05d4188f49d5dcf9566d9 \ + --hash=sha256:1a1a8cd430c7dd0c083f455cb1b328d7fc682b05c31b940906f7845bdff80881 \ + --hash=sha256:1cd3b721f24c206398b9e26da3c3a9c011e6e89d06f318ba8ebefc30f1003890 \ + --hash=sha256:1e47b8ba865d7ede071a91a7163073bbaeb72541f1ef8a07d512c45c7b5007f2 \ + --hash=sha256:1f4ef2e71db33df4309167ed7f1520c4fae5e611226e159fa9cf33f93e6ddb3d \ + --hash=sha256:2067ff438048cead9d223ca5675bae2a25e520a7c3e6c1498bf9c6892d22caab \ + --hash=sha256:22d6263b9d39d7bbb286fa791945646e3218f1be2d693e36fb630f1d0e59cd13 \ + --hash=sha256:234d8d394721fa0d786af15ebf1f3fb7f3ed82fd1cd0cde45c2f247b5d4281d2 \ + --hash=sha256:256237037a3ab001ae8d9803b2d43562a4c3aa38739843694349e4d5ebb0fd56 \ + --hash=sha256:291bf73caf78b9e88d6fae9bfd693207ff7d832e2fdbe2cf8e746bc13f5f892b \ + --hash=sha256:29c4cab9df457b19672c39be7f384ebb2bc925c4e2684b8780c222b43eb36389 \ + --hash=sha256:2cfd1a81a648806e6a7717be4cc4d1bb392fa229752bf8444ba365e381e984d6 \ + --hash=sha256:2fde98cf1fc4bac144ce23c2c4c017b924ba714509ea9334977b0b27050c837d \ + --hash=sha256:32896a0af72508ea979e0acb4e4c04cbeeae04938167950d535c83c45597167d \ + --hash=sha256:355e3a4c725225a14262004fc1872a552b9d3634b4f791a0dfc80804aafbfd55 \ + --hash=sha256:3722a099730704c9a3d70c879fc0f51daec25fe5f1555672d97bc595abeafb95 \ + --hash=sha256:38c0c7d4b6fc06c3324b3f9162c8391bfc4fd9dde53afe1033ce7edb48d5a714 \ + --hash=sha256:39ffd14646190c454f0d86e0d256b33f00a87a26ab410e619773b841d0e41416 \ + --hash=sha256:3de789c82752730f94782a5ee518baf9c05edf85733aeaf73bb6e518755cdf54 \ + --hash=sha256:3e79f05e4a08b4d880342673312bbc895b56df7765605796f15902eb5367d3ae \ + --hash=sha256:3ff5893a2c23d886aa9ce786de5ac6ddc74aeeaf90743682b74d920e117d2e28 \ + --hash=sha256:411ca4d1b905b860ceba7570dd6717a71dedaddcc4b0f77ece710aa41ee11f8d \ + --hash=sha256:4388184646efe2054911c5b00a1077d6d1ee86a95b7e8ba96dc7850a809f3f40 \ + --hash=sha256:4a6369168d371207339b1e50d4532b06a7121586141f82599505a3f315751d47 \ + --hash=sha256:4bbcc257e3babea20a91715c361b24554ec4e8f51aa578568afc230799fe1a19 \ + --hash=sha256:4e66cbe84437497d951b799d3e1551291b6fb3d643820a7014b3655d57a59162 \ + --hash=sha256:4e6ee93fc3cf848dcbf0cce2eca73d8e7dcd0cc2b6df3a529d57750b30a4c55c \ + --hash=sha256:4eafbaff06b9563f8b1c850621ce51605de05208e09d4d71ce490bc972b7b9e8 \ + --hash=sha256:52e8db01f603f5da0ca30987479acff98769382efc8e142fa3962395dcf3ffdb \ + --hash=sha256:5500eeae393a184d14e1f35645962c27129d20c81afa4069e6ef826ebc2b3aaa \ + --hash=sha256:55456ea87d8df21808446d03817be2f65e20391c1c615d9187440dff28cd08dc \ + --hash=sha256:5563302a8359bc2295bb7084d1a8ed1519df96afb30eb2aa4e0bff7b54228988 \ + --hash=sha256:567b1c430f8bd560e689421468278ac5941bab4a05303b5d95b6ae10db03f451 \ + --hash=sha256:57f5eeb6ad4c180de583b1038e61fe5fbd9796bb69a8a1c1a0c7ddbec4c8c60f \ + --hash=sha256:59fe030d8ae4a57e3fb7756bf35a858de74e04066fc8555c53d0af979132af81 \ + --hash=sha256:5a6526a2a956bbb1e4ae3568c82e650fc99119c66bb011ea60715744955a2b4d \ + --hash=sha256:5a86a5a08c2235316bdb359d5dbb6ce0abfca7fac06363103e2c5af571d92f95 \ + --hash=sha256:5d2a91724463bfed4f573cd7a9fdc856d2e230d0c0e5a61416a93481dccd8605 \ + --hash=sha256:64b0c8c35aa4c4ed79896359f3e0b285cbe4e610042106500da4811c322cc108 \ + --hash=sha256:68242379c9b65a582b6e97318a1e9fbd6d445e58954f2d437991c4804ab11578 \ + --hash=sha256:6912fa5e635d74529ac7cdb1bdf6ca3af4453da8d1edbe0110ee1cb4ad407ebf \ + --hash=sha256:6c013cd3a1721e69e14380ada97eaa4b7b0cdf1c6b96fa765d4ea47c875088db \ + --hash=sha256:6c0eb900c0e91f4aebe680845242e614f1864edfd44106380d0752ac29522bf8 \ + --hash=sha256:6c6624fe268625869485553dd7cc1daf30d22558215bb2a4ff16f67a9801a31a \ + --hash=sha256:6d15a29033c57490cfe2069097c6fc4049e4e65ffbb749be7dc453b7c4c68965 \ + --hash=sha256:6d28a05796b99f749bf8794f17ba9ba1612d0076b802e9cfc62c554634e9ce3b \ + --hash=sha256:6d5225ef8801e4ea5e482fa9b5dfb891dd9ef6f6d870f1f25d449ca2c70ac218 \ + --hash=sha256:6da110e5f314c19ab8478464d02ae18808ae73d522c15260fa4918acdcd64da9 \ + --hash=sha256:6ecfc32dfb46fb7b565bcd6abf9412acf978775a998273d22888a6d7953730dd \ + --hash=sha256:713bd7df21170b982e729e46870f31d6b437bd1a9b4648cffb529bd3c2ec5c4b \ + --hash=sha256:71599e011ac880e8e45d46047d714871894c7d4ab6f25626f8d4f89da21f368d \ + --hash=sha256:7220697efaa6e5348fc3d18ee7f8563d4bfecd9872b37ffb915bfc1d08840622 \ + --hash=sha256:73b30cfa976659b3917c8f6153bdb0591c6a9ec6583599fd24a689b690622022 \ + --hash=sha256:779a6e7c894737e5983e7790a9c78c4000c30e23c9aada08081bdbea53b0fa60 \ + --hash=sha256:80811e1c42386ea95c6fb30571d3250ad43d7863f883f787f70517f441150e59 \ + --hash=sha256:814ff83a25b5fce8b9c80c4dd803153fb5c5599fc74db9e022466938368957ef \ + --hash=sha256:81a398f45b45a59200e13cd5ad1ae1d3f44334de98b148331afe2cdfee701c52 \ + --hash=sha256:823b92cf3c18ecd08afc70c42473888b41b6e8ef5046f3b82c05c154a2fa3d22 \ + --hash=sha256:82909c8f7eb9952656b65d3147afde4cf8e6d5a991eebc86418b5e65843b0ab8 \ + --hash=sha256:83380ffde38062a2e9bb55d83e74474f6614665528b98a6928720fc006dfffbb \ + --hash=sha256:8443e38dcfcfdbcf5add5118c623efd788d65ac2e25756d6251a54a06a4d0aca \ + --hash=sha256:84d244b00604d17df3fc7736c327892d6bba66181254aa4087be807b6c342bdc \ + --hash=sha256:856f743ae607f2c1380eccb566c0038a9fb3eabf0fc2be2704d76d9f73557239 \ + --hash=sha256:85ea21ec6730194d67156b0e0b5430ccb1d61f8b8b907e39b37f9812b74a13f0 \ + --hash=sha256:86a21a7bd3fe3a419512ef424cc1c020f6771d0b29cfddff36d1635a855e63f0 \ + --hash=sha256:88c2a17815c266e6d8180204ff62cb739ab869ada4a746d4c505331526ac58f1 \ + --hash=sha256:89cc46cfd15022e35084355478c9ac809d90b1152222706ac9a7655ec21df6fa \ + --hash=sha256:8ae493ed5f659a7761c43d42f183db514536073ded9bcf671d2d1df47e29a07e \ + --hash=sha256:8b2fdd7ead3c995c37940a790690660d0ca006c302db26cc51933f6766866fc3 \ + --hash=sha256:8b62076030baa2d8b1501a46bf0e19c27a489aa90671c55665bff7887f7660b0 \ + --hash=sha256:8e11699ed745931c395acd3621b07062e0f840efa6935aad87a64ed0995f0915 \ + --hash=sha256:92bfed8deec93df30286b9fe9e3b1dd17329cc076a192b4ee5ec223841d54953 \ + --hash=sha256:96bb17dbe8bab3c0954fbebfc69ed395599de75b6bbc35e3270a878e15d4dd65 \ + --hash=sha256:97335f59082f9fe2ce6c2a9cc6433a0114bbb6cd4d5c09dd76c95c68b9f9a8b0 \ + --hash=sha256:a417149c0cba4d50b61e992e5a15e69eaf96746609b461cc4ed168aeef6b79dd \ + --hash=sha256:a5207ec414d1c4a2a7231b2086970dc036f94293cdf338190984958a013a42f1 \ + --hash=sha256:a54cf9e0ef47b96af580849db5471142200568ce1e02cbf416addab551369570 \ + --hash=sha256:a56a1d4f859a82ca5b99fc4b82c9b027b15e3c455c5cd99e7d0719f27bb20b6c \ + --hash=sha256:a5fa8f1f916988d0bf1afea005bda37f56ac41a18016e813ccf0097a8d460ca4 \ + --hash=sha256:a6cd22c9da0d866558e46a041f1cc0c2bbb26b61b137b2347fa834c332e1d101 \ + --hash=sha256:aa1f1995789dca3698bc550aaceb09a51bd5df0a057ff84ff15296cd1975b801 \ + --hash=sha256:b0411b4066db926b80258c60dcb0e6db4c9cee312eab45b7e8866b17ddf9ada1 \ + --hash=sha256:b230acc1c3bfe2d6f2627ba2b95dc92e58aa494600e9722d0e6ccbc931e59702 \ + --hash=sha256:b30e600e8f337b9bd7f39b86d9fdfedc73cc46e3d0f745931a23a234220bb7e2 \ + --hash=sha256:b845b8d48088fad0cadc84be4b8fda63203be7e9237b71015b3925443c1f35ab \ + --hash=sha256:b87d67e33afaf265262f2a66db578284b88ee2e6fcd224579cb5c15518677ad8 \ + --hash=sha256:bac89069bc496ebdf4f79ebb57bbd10d0b214c8454225deb672d91002bd17e18 \ + --hash=sha256:bc25fb356d0c7810bb49ff3df908ad1fda6995d660ab099ded69244ed7ab6053 \ + --hash=sha256:bccbd8e5b0bffb7106cf18eb1baa3d7194b1cebb3b4b1cdbd4bdb19382a6ee6c \ + --hash=sha256:c16d15ee371643ab48dc8248a3e680ebbeca573a13af2c3dd0c985b142d77162 \ + --hash=sha256:c434e072557ade9cbc642d052c89d031efe47d5c9614523619d0d74a02378e81 \ + --hash=sha256:c47318cd3a61401452de11282242937e3e057c4fd3dbaf601e269d0928a06c0a \ + --hash=sha256:c70bc1b602cf59917e8f0c7a2cbc8bcc6fbc14d5486136b00707a79619121d63 \ + --hash=sha256:c7eec6a42018bc1d45763b1c162d3d2bf7c3b9a1b0ed30d3e91dcba390efefcc \ + --hash=sha256:c802434092b769b1d613ed2e13fac15fbfce1934a74bd10283b03c0fae231cd1 \ + --hash=sha256:cc30523e3f1a23fb7511cc659834a0d01a1042bb9de359bc1c131cc4ec6c9656 \ + --hash=sha256:d00d20d1818e82a07a0ee0aa89a98b17ed7916b92441090b683719cb20a59b6d \ + --hash=sha256:d2813ba2503764f0450680c533d13df7cff9b49df1411062eded5f67db4195b9 \ + --hash=sha256:d2c05c729b589e734c09578bf5964be48a911765484840d017bbc84f49d4c4ad \ + --hash=sha256:d4c7bacb70930f3d0a56f4ecf1be474a1f0d941b01dd73b756f3c256d42cb879 \ + --hash=sha256:d5f51401d102c885b9ca509e62c79b1dbff286e1b9b047fde6f763780789356d \ + --hash=sha256:d8363d7accb0286ac3a0e633f396e93800dafb8150494505daf9515bbda591f3 \ + --hash=sha256:d8bc24219b24c0af375718942ab75e3544b2763085f40f965be4326734ae8328 \ + --hash=sha256:d8edcf6f550e918dca779c069b9e156385c60b406f99fc7641f32c52f7193659 \ + --hash=sha256:da7a94d6a3411f579d72aa3e3bc5fbca7ed4549f3dbd7e5de3aa567333374285 \ + --hash=sha256:db13ca398005abcbe538deda87b686d9bd08b7001cf40c4c06b444960ae10a26 \ + --hash=sha256:dbab647e88d90b3167b91efe7091e248653688ed4337e4f90907a722c7361bb9 \ + --hash=sha256:dbd605739f228912dc49027cb764456b9757750bdc2b6b7773164db7096c6fd1 \ + --hash=sha256:e0b5deec9a8664eb722c797241970fd4aa1894d25fda36a1ddac0f7407606bd6 \ + --hash=sha256:e0d00c708fb2f5822b152429b1ac80a58dbbbc3f6c232c4d13a3f7fcf2ea5b4c \ + --hash=sha256:e1a49adf16a7c9d9646816c2946135527197b6fcf4347c7b8b761cf1bfbf4489 \ + --hash=sha256:e3b461183c5fa7681b48560f91515f53a953122fb30c71e07abc67d7ddf58c38 \ + --hash=sha256:e4c911f15a1652ca94ae9f1abd92e74cbb1b3597d2d92fdd556202f94e8cd455 \ + --hash=sha256:e56b6a368529bed262da40ce13f8fef590db0479819cca84f16a1f01ac356d0b \ + --hash=sha256:e87bc679f86a99aa3b26e3c78eeb821a247c9a28eae48eaafcc32c3bf4c3bb9e \ + --hash=sha256:e8c9a650a188e38bac005048cbe6342e81407782944d01934540ab75e417df21 \ + --hash=sha256:eab9208b00ca55bf75983ec99f7bf13acc746a36102e98953addaad7f7ea1e1b \ + --hash=sha256:ec3ba415afaf951f6951b1dd16d3c8e4f540065fc382d7e70b823a79567ca374 \ + --hash=sha256:ec4b19788f835711a2072f9dbe6b03b3bf32ed1f0fb30cf399bdd59d9f0c33fa \ + --hash=sha256:f395a4a9a03ac062dbe9a9f82e0c720502e590a38feee6a757bc82e9c63afbd8 \ + --hash=sha256:f42b74a53e5f26a0ba0007411a7455b66c67ce4022a39cc1f56fc4efd65bcbab \ + --hash=sha256:f54598964d357b1c5ab77cf5d92f21e598fe0e23cdbe9618480807f81b4eba15 \ + --hash=sha256:f56b397858a23dacf35ede366ed2212fdc03a6a57a1ad36468ad6e9dc5fac091 \ + --hash=sha256:f5de7feedc56337a088eb15cd9fafa9938367362221d8cc62c642b7f94821993 \ + --hash=sha256:f75720477ee05d509a310e856cacc8d909adc182f7b91193c207bcc26d7ee6db \ + --hash=sha256:f779070399f991400fc451719e0ea388eb7de313388bada2c127a35de05f798a \ + --hash=sha256:f9ca190fe9edc0eb08eec558a509a16d28d91c35667b8f043cba40ed5e77a959 \ + --hash=sha256:fa60887537e1d0cd2d9982269d33a709bf54b195cd2b9364fc0a758022af5bd9 \ + --hash=sha256:fc1ed11c4ad0b91af24def2050f2840ea4567828e3dd058fbe608d982f6e5465 \ + --hash=sha256:febb1ce6cac545a54e6b769982824e955a700fdd9fbf3a08a3d82c990968b57d +mypy==2.3.1 \ + --hash=sha256:114dff494000f18bd10d5d95d84b8567b26da60279ecbe838131841df20e635d \ + --hash=sha256:18162b128c3f9c703cd35f5537446900b0d21a2549aa7a95d21380d2ef643fb0 \ + --hash=sha256:192abaedf75da1bc0b1cef104927e70ec49c1ef0031cc4825c7ee10a438ed24d \ + --hash=sha256:1c80fbc405ed8020f5ff3802dc18cf060197bcdd3fbdd6a26ef2fd34dfdd5226 \ + --hash=sha256:2166b29228835e1f88ff411e96639e6ca3c7fdde84b62ec211f70f86b4051167 \ + --hash=sha256:2329c0501293d4e1f33bc15d04d6304d65a1cdda967ee93a05c1e681a3923133 \ + --hash=sha256:2a0ba2e57847849fb0d1fcdabb32786d223095ed8bc121dfe322bcdb3d9c46bc \ + --hash=sha256:30c0477d4aab7b7f39c8397dc877f2c96b9fe5588ec379f372c56eb63d599f63 \ + --hash=sha256:375d7013876a8233b2d05be185bfa09f689696cd999ce8b1cfe6acac5c80e8a3 \ + --hash=sha256:3c80cd23d85368bdd9f37d5231dfd97d35bcbf5bf41af96ef3a9b078ad1957f9 \ + --hash=sha256:3f7e865dd51f235f60a2dbcd8728a1c095f5ca28f095d48a725b84cd935735c4 \ + --hash=sha256:47a8a7a0a7f6f6e63995c0ac36fa0c07b127413fdc81f0439b7f3dccafd33561 \ + --hash=sha256:47c1b1207258513a9d93495f69c8be9de73916186f0e52703e8c461b7a623419 \ + --hash=sha256:4956f34d145e145562a0a0bf367f642bbc85c04ec2baf47ae015947c3169a85d \ + --hash=sha256:4c5095a327483591c94e0c8d3ef9e50d4ab1369b541eae007c1f23bc2a41f6bb \ + --hash=sha256:5159ae60f5dbc3a498af5ba8365505808ac8031bc63f9e00304ad545d40bdd9b \ + --hash=sha256:52eaf3a155f35cf80b40220288c861eb45f14a2340c1f6cbfbdb0feff32879d1 \ + --hash=sha256:57a936373fc690c43a8cd7e7e12a35148e4ec5aa7698ad7fc0a9f918bdc5be41 \ + --hash=sha256:586b3612214cceabb3c0f588c97e7d1e535393f06a60e912e994f6b3ace97523 \ + --hash=sha256:667196b352f4cf304ded4c10f90cfc179263a1acfb3cdcfa984bdfd340d498bc \ + --hash=sha256:6941ab3619377bc3f32ca02876b07d27f216f5201604b664d3937ea0fdd23bb4 \ + --hash=sha256:6ed5c7e3419083268e5c9258bd1c1ef91af44a9e89374dbcaf37b775716e72eb \ + --hash=sha256:6f041a6de52c9217ca125e78ba0a335cb7fd98a1c0580978e49ab2b126f70b57 \ + --hash=sha256:71af9c8a894e862b58e92abb08e53b05a384a1e5e5d6dc7cda59126211a53d82 \ + --hash=sha256:77ad9529e67dca28e511f5cd5671436584ce91f6d3bac159a353158187b986ac \ + --hash=sha256:83d36c2924df7426333abe7faf4724a7e1aab0d9fd41625e81b4683034b80c13 \ + --hash=sha256:84081f538ce27375045c02e3d7f81bd11d853400621ae245d87ce7b6c420ec74 \ + --hash=sha256:851833db876e7b650f93719c74b7879a08e338979c96054fdfc3bfd90a486355 \ + --hash=sha256:858fc57d3d91fa728e33e7ad71def60fc6272694607b306cd3292db53ae39080 \ + --hash=sha256:8ad80807dc3ab8ea978b1b2b6e4a657194ace1d4ef03e0e731aff1abd517da29 \ + --hash=sha256:8e036f06b41630f4c8a1d48f9ac6aa26acc65f8be089973f5519da643318f03f \ + --hash=sha256:94f04929f1c44c35fb0061e912087edaf504acede963a4a7d00680bd089d8531 \ + --hash=sha256:9b4eacbee8a69836c06eff6d0dd4e134a07c2b047755b30c08625fe214f322c6 \ + --hash=sha256:a32bbbb940af990d3be0b8af321c7b6815bb1b3b48142fe7459b9cc5f58959ff \ + --hash=sha256:b091a455111214cb5c9d54a57b9618e9a49f9fe2a42e4e1ac86e9d104ed96ce8 \ + --hash=sha256:b9c53e395c12cad2c6d4b67d5da7c6057638a132d85c08b73646b18f802a0045 \ + --hash=sha256:bb26deed807bdb0457cf3e3f1cd7c4a1cf9d66864eaf1b4a61e06805d4c6b1f9 \ + --hash=sha256:bbfe022634a2a195406bd469e888d2eaf193b02ba7e607391cd7640374aaae3b \ + --hash=sha256:bf678dffd16efcda2c15cbd30e9ecc0081388e29ea23687a88e686ed92638dc3 \ + --hash=sha256:c8637731bb5eee3671eb2c3200827aa3564ed8a9309ecee4d1afe77e6d031bdb \ + --hash=sha256:cfb12e360242d23d91f5e978d94f58ea66acf5804c4fb6f2f794a20d4cb1b595 \ + --hash=sha256:d00d769056bde2f4e69c175071eba45cfb44fa1ed92bdfbfe64a93e0543b0cf0 \ + --hash=sha256:df12e20c9efd614738c71b390007ecd0181125afc4ccafca04d78a1d2eed2c01 \ + --hash=sha256:e099200a1b1b1223a4951f0a90cbff1b8c91b250ba599dab1f7217a628144d90 \ + --hash=sha256:e598c8c66401d26b150872154a286e6d484cf2789c3bb28a7556806298423021 \ + --hash=sha256:e5f1c50bb05b64e2026b52867e8d21106f01313c744a2c4ecc34c90d12e8d6e2 \ + --hash=sha256:e9144ac16fde007096f9563eb2041b4433c2d705c4218edeb79e7e9d01035ee6 \ + --hash=sha256:eda22fd4efa9dcd39331d1dede9b5b8b8a7fd69af07592e778433da98610d29e \ + --hash=sha256:ef0c6335cda9d807f8193d8ff6204a72bc909fa9882aacbca14f43cdb7188306 \ + --hash=sha256:f12fdb70459d0060dea40b29e52163a961b156106d68d57882a6a9f648983a53 \ + --hash=sha256:f5d716048611e85ca9eefb2e1baa5d73ede389b5820ded260ea27c757d667af8 \ + --hash=sha256:ff715e45b2231a8e85de1d163d1b42791e4d7aab8f5145f85fee1b710b735aff +mypy-extensions==1.1.0 \ + --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ + --hash=sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558 +nodeenv==1.10.0 \ + --hash=sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827 \ + --hash=sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c +pathspec==1.1.1 \ + --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ + --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189 +platformdirs==4.11.8 \ + --hash=sha256:52f2f181bbfde907966932cc8312d967d02976422d66d537ea16092b8e291081 \ + --hash=sha256:f23abafea7dd4276d1f29104b83598d7dcc567cafd07c9c951e66665645437fc +pluggy==1.6.0 \ + --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ + --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 +pre-commit==4.6.2 \ + --hash=sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441 \ + --hash=sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e +pycparser==3.0 \ + --hash=sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29 \ + --hash=sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992 +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c +pytest==9.1.1 \ + --hash=sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313 \ + --hash=sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c +pytest-asyncio==1.4.0 \ + --hash=sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1 \ + --hash=sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42 +pytest-cov==7.1.0 \ + --hash=sha256:30674f2b5f6351aa09702a9c8c364f6a01c27aae0c1366ae8016160d1efc56b2 \ + --hash=sha256:a0461110b7865f9a271aa1b51e516c9a95de9d696734a2f71e3e78f46e1d4678 +pytest-mock==3.15.1 \ + --hash=sha256:0a25e2eb88fe5168d535041d09a4529a188176ae608a6d249ee65abc0949630d \ + --hash=sha256:1849a238f6f396da19762269de72cb1814ab44416fa73a8686deac10b0d87a0f +pytest-timeout==2.4.0 \ + --hash=sha256:7e68e90b01f9eff71332b25001f85c75495fc4e3a836701876183c4bcfd0540a \ + --hash=sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2 +python-discovery==1.6.0 \ + --hash=sha256:6393b4eae1be8b2182670635e7baff89ac21cb9f8e86fd1ff40c7b1144febb4c \ + --hash=sha256:d4e244cf17b8b29819ed78003d55fbacf86eda23425b075454fff9271b79377a +pyyaml==6.0.3 \ + --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ + --hash=sha256:0150219816b6a1fa26fb4699fb7daa9caf09eb1999f3b70fb6e786805e80375a \ + --hash=sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3 \ + --hash=sha256:02ea2dfa234451bbb8772601d7b8e426c2bfa197136796224e50e35a78777956 \ + --hash=sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6 \ + --hash=sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c \ + --hash=sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65 \ + --hash=sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a \ + --hash=sha256:1ebe39cb5fc479422b83de611d14e2c0d3bb2a18bbcb01f229ab3cfbd8fee7a0 \ + --hash=sha256:214ed4befebe12df36bcc8bc2b64b396ca31be9304b8f59e25c11cf94a4c033b \ + --hash=sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1 \ + --hash=sha256:22ba7cfcad58ef3ecddc7ed1db3409af68d023b7f940da23c6c2a1890976eda6 \ + --hash=sha256:27c0abcb4a5dac13684a37f76e701e054692a9b2d3064b70f5e4eb54810553d7 \ + --hash=sha256:28c8d926f98f432f88adc23edf2e6d4921ac26fb084b028c733d01868d19007e \ + --hash=sha256:2e71d11abed7344e42a8849600193d15b6def118602c4c176f748e4583246007 \ + --hash=sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310 \ + --hash=sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4 \ + --hash=sha256:3c5677e12444c15717b902a5798264fa7909e41153cdf9ef7ad571b704a63dd9 \ + --hash=sha256:3ff07ec89bae51176c0549bc4c63aa6202991da2d9a6129d7aef7f1407d3f295 \ + --hash=sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea \ + --hash=sha256:418cf3f2111bc80e0933b2cd8cd04f286338bb88bdc7bc8e6dd775ebde60b5e0 \ + --hash=sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e \ + --hash=sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac \ + --hash=sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9 \ + --hash=sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7 \ + --hash=sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35 \ + --hash=sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb \ + --hash=sha256:5cf4e27da7e3fbed4d6c3d8e797387aaad68102272f8f9752883bc32d61cb87b \ + --hash=sha256:5e0b74767e5f8c593e8c9b5912019159ed0533c70051e9cce3e8b6aa699fcd69 \ + --hash=sha256:5ed875a24292240029e4483f9d4a4b8a1ae08843b9c54f43fcc11e404532a8a5 \ + --hash=sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b \ + --hash=sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c \ + --hash=sha256:6344df0d5755a2c9a276d4473ae6b90647e216ab4757f8426893b5dd2ac3f369 \ + --hash=sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd \ + --hash=sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824 \ + --hash=sha256:66291b10affd76d76f54fad28e22e51719ef9ba22b29e1d7d03d6777a9174198 \ + --hash=sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065 \ + --hash=sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c \ + --hash=sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c \ + --hash=sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764 \ + --hash=sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196 \ + --hash=sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b \ + --hash=sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00 \ + --hash=sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac \ + --hash=sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8 \ + --hash=sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e \ + --hash=sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28 \ + --hash=sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3 \ + --hash=sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5 \ + --hash=sha256:9c57bb8c96f6d1808c030b1687b9b5fb476abaa47f0db9c0101f5e9f394e97f4 \ + --hash=sha256:9c7708761fccb9397fe64bbc0395abcae8c4bf7b0eac081e12b809bf47700d0b \ + --hash=sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf \ + --hash=sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5 \ + --hash=sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702 \ + --hash=sha256:b30236e45cf30d2b8e7b3e85881719e98507abed1011bf463a8fa23e9c3e98a8 \ + --hash=sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788 \ + --hash=sha256:b865addae83924361678b652338317d1bd7e79b1f4596f96b96c77a5a34b34da \ + --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d \ + --hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc \ + --hash=sha256:bdb2c67c6c1390b63c6ff89f210c8fd09d9a1217a465701eac7316313c915e4c \ + --hash=sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba \ + --hash=sha256:c2514fceb77bc5e7a2f7adfaa1feb2fb311607c9cb518dbc378688ec73d8292f \ + --hash=sha256:c3355370a2c156cffb25e876646f149d5d68f5e0a3ce86a5084dd0b64a994917 \ + --hash=sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5 \ + --hash=sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26 \ + --hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f \ + --hash=sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b \ + --hash=sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be \ + --hash=sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c \ + --hash=sha256:efd7b85f94a6f21e4932043973a7ba2613b059c4a000551892ac9f1d11f5baf3 \ + --hash=sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6 \ + --hash=sha256:fa160448684b4e94d80416c0fa4aac48967a969efe22931448d853ada8baf926 \ + --hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0 +ruff==0.16.7 \ + --hash=sha256:06d0e93d04f392996435ebd600c153f65b47d73fbec2415aa99c5ee5756b3a5f \ + --hash=sha256:142151a5e7b93c1b11111337142f89dd2fbfee92161225c99a97222f22e32656 \ + --hash=sha256:2ea3470fcebcbc5df2fb0c6f3b90333fa9084c534e0111c038fa4a6ab9f1c4b7 \ + --hash=sha256:398d3988edde000b5c75dc1b3f584708da9bc990de069c18909142580fec1af9 \ + --hash=sha256:4c196c968874fc8019da8e7163de7a1a370f111e2309b4b7dfea0fce950198d0 \ + --hash=sha256:53e39506a730fadeee0d998ed5946f30671f0db240c6c7c73bdabbe33604bb6f \ + --hash=sha256:5f71d004ac1263b22fa39462ac5ae618a4b77d58981af2cc79bf79a29c12b1a6 \ + --hash=sha256:727307773e7c7f9181d3ed3a2484186e56c1fa1874255911c74585eb2c7c19f9 \ + --hash=sha256:7ab81118df8945e0193d0240712aa4496573595b75185c3636ed825592a0f728 \ + --hash=sha256:7ac26aca826e9e21d0f1cb25b54ac660760a9fdd094d3e4df9848232be98cfc6 \ + --hash=sha256:9ce7f8f22df67c93ed96c717f9128eadb797144ac2bad475cf536f31d6100c55 \ + --hash=sha256:9d61c258deabf58f34c67bd4bb4d939c7f2e6b5f0e59c1cdd1cf771b11cde929 \ + --hash=sha256:aab7f39e2c9df6c596216070f98eef1207b94f8516cca20c808826974971855b \ + --hash=sha256:ac8c3bd0a7e10ad31e6ce51e7a99f3cb772e69aecdd6b9ea7e99b362f62a62c0 \ + --hash=sha256:af1b576fddb9d9ef2ececfb5fadcd6a624b25070ed85e3cfcfe449fc3ff6a7b9 \ + --hash=sha256:ce05b62b770a8217c4646a9c4139fca00efe8fe5d71f87df2b243ff20d4584d1 \ + --hash=sha256:e6651f97a342d8b35d54d8991544ca22169b86dc54111cb604666940c431b750 \ + --hash=sha256:ef140c6eb935fa9a84c9c607dfb2cb1b85843c192e79265b0c54f35f557ea8e5 +siosocks==0.3.0 \ + --hash=sha256:3f4bfca9a9b925d8cd13eb850eaf66263936a3c7a3a2fccd44cc9d8632d62709 \ + --hash=sha256:ba36bbf6f5a13d83a1853501221f97a52e069eb609cb4fd7a435d74239f21d63 +tomli==2.4.1 \ + --hash=sha256:01f520d4f53ef97964a240a035ec2a869fe1a37dde002b57ebc4417a27ccd853 \ + --hash=sha256:0d85819802132122da43cb86656f8d1f8c6587d54ae7dcaf30e90533028b49fe \ + --hash=sha256:136443dbd7e1dee43c68ac2694fde36b2849865fa258d39bf822c10e8068eac5 \ + --hash=sha256:1d8591993e228b0c930c4bb0db464bdad97b3289fb981255d6c9a41aedc84b2d \ + --hash=sha256:2190f2e9dd7508d2a90ded5ed369255980a1bcdd58e52f7fe24b8162bf9fedbd \ + --hash=sha256:2c1c351919aca02858f740c6d33adea0c5deea37f9ecca1cc1ef9e884a619d26 \ + --hash=sha256:36d2bd2ad5fb9eaddba5226aa02c8ec3fa4f192631e347b3ed28186d43be6b54 \ + --hash=sha256:3d48a93ee1c9b79c04bb38772ee1b64dcf18ff43085896ea460ca8dec96f35f6 \ + --hash=sha256:47149d5bd38761ac8be13a84864bf0b7b70bc051806bc3669ab1cbc56216b23c \ + --hash=sha256:4ab97e64ccda8756376892c53a72bd1f964e519c77236368527f758fbc36a53a \ + --hash=sha256:4b605484e43cdc43f0954ddae319fb75f04cc10dd80d830540060ee7cd0243cd \ + --hash=sha256:504aa796fe0569bb43171066009ead363de03675276d2d121ac1a4572397870f \ + --hash=sha256:51529d40e3ca50046d7606fa99ce3956a617f9b36380da3b7f0dd3dd28e68cb5 \ + --hash=sha256:52c8ef851d9a240f11a88c003eacb03c31fc1c9c4ec64a99a0f922b93874fda9 \ + --hash=sha256:559db847dc486944896521f68d8190be1c9e719fced785720d2216fe7022b662 \ + --hash=sha256:5a881ab208c0baf688221f8cecc5401bd291d67e38a1ac884d6736cbcd8247e9 \ + --hash=sha256:5cb41aa38891e073ee49d55fbc7839cfdb2bc0e600add13874d048c94aadddd1 \ + --hash=sha256:5e262d41726bc187e69af7825504c933b6794dc3fbd5945e41a79bb14c31f585 \ + --hash=sha256:5ee18d9ebdb417e384b58fe414e8d6af9f4e7a0ae761519fb50f721de398dd4e \ + --hash=sha256:7008df2e7655c495dd12d2a4ad038ff878d4ca4b81fccaf82b714e07eae4402c \ + --hash=sha256:734e20b57ba95624ecf1841e72b53f6e186355e216e5412de414e3c51e5e3c41 \ + --hash=sha256:7c7e1a961a0b2f2472c1ac5b69affa0ae1132c39adcb67aba98568702b9cc23f \ + --hash=sha256:7f86fd587c4ed9dd76f318225e7d9b29cfc5a9d43de44e5754db8d1128487085 \ + --hash=sha256:7f94b27a62cfad8496c8d2513e1a222dd446f095fca8987fceef261225538a15 \ + --hash=sha256:88dceee75c2c63af144e456745e10101eb67361050196b0b6af5d717254dddf7 \ + --hash=sha256:8a650c2dbafa08d42e51ba0b62740dae4ecb9338eefa093aa5c78ceb546fcd5c \ + --hash=sha256:8d65a2fbf9d2f8352685bc1364177ee3923d6baf5e7f43ea4959d7d8bc326a36 \ + --hash=sha256:96481a5786729fd470164b47cdb3e0e58062a496f455ee41b4403be77cb5a076 \ + --hash=sha256:a120733b01c45e9a0c34aeef92bf0cf1d56cfe81ed9d47d562f9ed591a9828ac \ + --hash=sha256:b1d22e6e9387bf4739fbe23bfa80e93f6b0373a7f1b96c6227c32bef95a4d7a8 \ + --hash=sha256:b8c198f8c1805dc42708689ed6864951fd2494f924149d3e4bce7710f8eb5232 \ + --hash=sha256:c2541745709bad0264b7d4705ad453b76ccd191e64aa6f0fc66b69a293a45ece \ + --hash=sha256:c742f741d58a28940ce01d58f0ab2ea3ced8b12402f162f4d534dfe18ba1cd6a \ + --hash=sha256:c7f2c7f2b9ca6bdeef8f0fa897f8e05085923eb091721675170254cbc5b02897 \ + --hash=sha256:d312ef37c91508b0ab2cee7da26ec0b3ed2f03ce12bd87a588d771ae15dcf82d \ + --hash=sha256:d4d8fe59808a54658fcc0160ecfb1b30f9089906c50b23bcb4c69eddc19ec2b4 \ + --hash=sha256:da25dc3563bff5965356133435b757a795a17b17d01dbc0f42fb32447ddfd917 \ + --hash=sha256:eab21f45c7f66c13f2a9e0e1535309cee140182a9cdae1e041d02e47291e8396 \ + --hash=sha256:eb0dc4e38e6a1fd579e5d50369aa2e10acfc9cace504579b2faabb478e76941a \ + --hash=sha256:ec9bfaf3ad2df51ace80688143a6a4ebc09a248f6ff781a9945e51937008fcbc \ + --hash=sha256:ede3e6487c5ef5d28634ba3f31f989030ad6af71edfb0055cbbd14189ff240ba \ + --hash=sha256:f3c6818a1a86dd6dca7ddcaaf76947d5ba31aecc28cb1b67009a5877c9a64f3f \ + --hash=sha256:f758f1b9299d059cc3f6546ae2af89670cb1c4d48ea29c3cacc4fe7de3058257 \ + --hash=sha256:f8f0fc26ec2cc2b965b7a3b87cd19c5c6b8c5e5f436b984e85f486d652285c30 \ + --hash=sha256:fd0409a3653af6c147209d267a0e4243f0ae46b011aa978b1080359fddc9b6cf \ + --hash=sha256:ff18e6a727ee0ab0388507b89d1bc6a22b138d1e2fa56d1ad494586d61d2eae9 \ + --hash=sha256:ff2983983d34813c1aeb0fa89091e76c3a22889ee83ab27c5eeb45100560c049 +trustme==1.2.1 \ + --hash=sha256:6528ba2bbc7f2db41f33825c8dd13e3e3eb9d334ba0f909713c8c3139f4ae47f \ + --hash=sha256:d768e5fc57c86dfc5ec9365102e9b092541cd6954b35d8c1eea01a84f35a762a +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 +virtualenv==21.7.9 \ + --hash=sha256:a7e42d81d779dec8afd7dc4be71640fb959ea861bccfa5980cb4ad9f92e30675 \ + --hash=sha256:ba3b0bb41063c848d84d76a9fe3fb7711aaa0f2fe78708e8f3cd9714770e4eac diff --git a/harbor/sources/aioftp-v11/runtime/aioftp_ipv6_loopback.py b/harbor/sources/aioftp-v11/runtime/aioftp_ipv6_loopback.py new file mode 100644 index 0000000000000000000000000000000000000000..c29da3dc6f57f67f449ea2c16bd3a04ae14a62ac --- /dev/null +++ b/harbor/sources/aioftp-v11/runtime/aioftp_ipv6_loopback.py @@ -0,0 +1,63 @@ +"""Skip the repository's IPv6-loopback tests where ``::1`` cannot be bound. + +The aioftp suite runs every ``pair_factory`` and ``socks`` test once on ``127.0.0.1`` and once on +``::1``, and ``test_server_ipv6_pasv`` binds ``::1`` directly. A sandbox without IPv6 loopback +fails the first ``::1`` node with ``OSError: could not bind on any address``, whatever the code +under test does, and the suite's ``-x`` stops there. Where ``::1`` binds, this plugin does +nothing. Where it does not, it marks exactly those nodes skipped, with the reason, so the IPv4 +half of the suite still runs and still decides the outcome. + +Installed into the repository interpreter as a ``pytest11`` entry point; the loopback probe runs +in ``pytest_configure``, before any repository ``conftest.py`` or ``aioftp`` import. +""" + +from __future__ import annotations + +import socket +from typing import Any + +import pytest + +IPV6_LOOPBACK = "::1" +# Tests that bind ::1 without taking it from a fixture parameter. +HARDCODED_IPV6_TESTS = ("test_server_ipv6_pasv",) +SKIP_REASON = "IPv6 loopback (::1) is unavailable in this sandbox" + +_available: bool | None = None + + +def ipv6_loopback_available() -> bool: + try: + with socket.socket(socket.AF_INET6, socket.SOCK_STREAM) as probe: + probe.bind((IPV6_LOOPBACK, 0)) + except OSError: + return False + return True + + +def _names_ipv6_loopback(value: Any) -> bool: + if isinstance(value, tuple): + return any(_names_ipv6_loopback(item) for item in value) + return value == IPV6_LOOPBACK + + +def needs_ipv6_loopback(item: pytest.Item) -> bool: + if getattr(item, "originalname", item.name) in HARDCODED_IPV6_TESTS: + return True + callspec = getattr(item, "callspec", None) + return callspec is not None and any(_names_ipv6_loopback(value) for value in callspec.params.values()) + + +@pytest.hookimpl(tryfirst=True) +def pytest_configure(config: pytest.Config) -> None: + global _available + _available = ipv6_loopback_available() + + +def pytest_collection_modifyitems(config: pytest.Config, items: list[pytest.Item]) -> None: + if _available: + return + marker = pytest.mark.skip(reason=SKIP_REASON) + for item in items: + if needs_ipv6_loopback(item): + item.add_marker(marker) diff --git a/harbor/sources/aioftp-v11/task/__init__.py b/harbor/sources/aioftp-v11/task/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ba18376927f2743b9f37a3ef51a6d1c8f5790cb3 --- /dev/null +++ b/harbor/sources/aioftp-v11/task/__init__.py @@ -0,0 +1 @@ +"""Task prompt package.""" diff --git a/harbor/sources/aioftp-v11/task/prompt.md b/harbor/sources/aioftp-v11/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..e3543ebe926ec1ea68706adeb0d8429954e0c4c5 --- /dev/null +++ b/harbor/sources/aioftp-v11/task/prompt.md @@ -0,0 +1,73 @@ +Aborting a transfer in aioftp can leave the FTP control connection out of step on both the client +and the server side. Make abort handling compliant with RFC 959 in the library under `src/aioftp/`. + +A data-transfer command (`RETR`, `STOR`, `APPE`, `LIST`, `MLSD`) answered with a `1xx` preliminary +reply gets exactly one final reply on the control connection: `426` if aborted, a `2xx` (such as +`226`) if completed, or an error (such as `451`) if failed. `ABOR` is answered with `225` or `226`. +If `ABOR` is sent while a transfer's final reply is outstanding, the transfer's final reply arrives +first and the `ABOR` reply second. + +**Server (`aioftp.Server`)** + +In every case below the control connection stays open and keeps serving the session, including +later transfers. + +- If `ABOR` arrives after a transfer command was accepted (`150` sent) but before the data + connection opens, reply `426` then `226`. +- With no active transfer to abort, `ABOR` gets `226` once. A second `ABOR` received while an + abort is already in progress gets its own `226` only after the transfer's `426` and the first + `ABOR`'s `226`. +- An aborted transfer gives up its passive listener, whether or not its data connection had + opened; with `data_ports` configured, its port returns to the pool. A data connection arriving + late for the aborted transfer is refused or closed at once and is never delivered to a later + transfer. +- Several commands can arrive in one read. They are executed in order, and their replies come back + in that order. +- `ABOR` is also accepted when preceded by Telnet IP/Synch or sent the way Python's + `ftplib.FTP.abort()` and BSD `ftp` send it (with urgent data). +- `QUIT` during a transfer lets open transfers send their final reply before `221`; a transfer whose + data connection has not opened is answered `426` first. +- A data connection lost mid-transfer is answered `426`, and the passive listener and its + `data_ports` port are released. +- An undecodable command line is answered `500`. + +**Client (`aioftp.Client`)** + +- `abort()` (default `wait=True`) returns with the control connection synchronized for subsequent + commands. If a transfer's final reply is outstanding, it is consumed together with the `ABOR` + reply. +- `abort()` also works after a transfer already completed or failed: it must not raise because the + transfer's final reply was an error code, but raises `StatusCodeError` if the `ABOR` reply itself + is not `225`/`226`. +- With no transfer outstanding, `abort()` accepts either `225` or `226`. +- After `abort()` (with `wait=True`) returns, closing the stream, `finish()`, or a normal exit from + the `async with` block reads nothing more from the control connection and does not block. + `abort(wait=False)` keeps its existing behaviour: it returns without reading, and the stream's + `finish()` still reads the transfer's final reply. Replies it leaves unread are still never + delivered to a later command. +- If code inside a stream's `async with` block raises, the exit leaves the control connection ready + for subsequent commands and propagates the original exception unchanged. +- If `abort()` or `finish()` is cancelled while the replies it was waiting for are still + outstanding, those replies still arrive later and still belong to the cancelled call: closing the + stream, `finish()`, or a normal exit from the `async with` block afterwards neither reads them + nor raises because of them. A later `abort()` still sends `ABOR`. +- Concurrent `abort()` calls on an active stream do not raise; each returns with the connection + synchronized. When a command is issued from another task while `abort()` is in progress, neither + call raises and the command receives its own matching reply. +- `abort()` called from another task while `finish()` or a stream block exit is waiting for the + transfer's final reply still sends `ABOR` during that wait. `finish()` receives the transfer's + final reply, `abort()` receives the `ABOR` reply, and both return with the connection synchronized. +- A listing (`list()`) left early with `break` or an exception, or a stream from `get_stream()` that + was never finished, leaves a transfer outstanding. A later command must first end that transfer and + consume its replies, then receive its own reply. The object returned by `list()` must also offer + `aclose()`, which ends an abandoned listing and returns with the connection synchronized. + +The client must never deliver a reply from an earlier exchange to a later command; every command +receives its own matching reply. + +**Constraints** + +- Keep the public API compatible, including `Client.abort(*, wait=True)`, + `DataConnectionThrottleStreamIO.finish(expected_codes, wait_codes)`, and the stream helpers + (`download_stream`, `upload_stream`, `append_stream`, `list`, `get_stream`). +- The existing test suite (`pytest` from the repository root) must keep passing. diff --git a/harbor/sources/aioftp-v11/task/rubric.md b/harbor/sources/aioftp-v11/task/rubric.md new file mode 100644 index 0000000000000000000000000000000000000000..e95be2081f735ddd22a4e93ee3f6058f2df7caa2 --- /dev/null +++ b/harbor/sources/aioftp-v11/task/rubric.md @@ -0,0 +1,217 @@ +# Rubric — aioftp_stream_abort_desynchronization + +Twenty-five independently weighted criteria, one per case, each with one child of share `1.0`. Every +criterion is measured by executing the candidate's `aioftp` in a fresh `python -I` process: CASE-01, +CASE-14 to CASE-20, CASE-22 and CASE-23 drive `aioftp.Server` over grader-owned raw sockets or standard ftplib clients, +and CASE-02 to CASE-13, CASE-21, CASE-24 and CASE-25 drive the public `aioftp.Client` against a grader-owned scripted RFC 959 server +and compare the value `Client.get_current_directory()` returns with the server's randomized working directory. + +## Criteria + +| Criterion | Weight | Evidence class | Safety gate | +|---|---|---|---| +| server_early_abort_session | 0.0070 | functional | — | +| client_stream_exit_after_abort | 0.0070 | functional | — | +| client_abort_after_completed_transfer | 0.0070 | safety | G1_stale_reply_after_abort | +| client_abort_idle_225 | 0.0070 | functional | — | +| client_abort_after_failed_transfer | 0.0070 | functional | — | +| client_error_exit_mid_transfer | 0.0070 | functional | — | +| client_error_exit_after_completed_transfer | 0.0070 | safety | G2_stale_reply_after_error_exit | +| client_abort_idle_rejected | 0.0070 | functional | — | +| client_upload_stream_abort | 0.0070 | functional | — | +| client_abort_concurrent | 0.0070 | functional | — | +| client_cancelled_abort_or_finish | 0.0070 | functional | — | +| client_abort_during_finish | 0.0070 | functional | — | +| client_abandoned_listing_resync | 0.0070 | functional | — | +| server_listener_release_after_abort | 0.0070 | safety | G3_stale_data_connection_after_abort | +| server_repeated_abor_order | 0.0070 | functional | — | +| server_pipelined_command_order | 0.0070 | functional | — | +| server_real_client_abor | 0.0070 | functional | — | +| server_quit_during_transfer | 0.0070 | functional | — | +| server_data_connection_loss | 0.0070 | functional | — | +| server_undecodable_command_syntax | 0.0300 | functional | — | +| client_abort_after_cancelled_finish | 0.0250 | safety | G4_stale_reply_after_cancelled_finish | +| server_pipelined_abort_open_data | 0.3990 | functional | — | +| server_pipelined_quit_open_data | 0.3990 | functional | — | +| client_nowait_abort_owed_replies | 0.0070 | functional | — | +| client_command_during_abort | 0.0070 | functional | — | + +## Children + +| Criterion | Child | +|---|---| +| server_early_abort_session | early_abor_replies_and_session_survives | +| client_stream_exit_after_abort | block_exit_reads_nothing_more | +| client_abort_after_completed_transfer | completed_transfer_then_abort | +| client_abort_idle_225 | idle_abort_accepts_225 | +| client_abort_after_failed_transfer | failed_transfer_then_abort | +| client_error_exit_mid_transfer | error_exit_mid_transfer_in_sync | +| client_error_exit_after_completed_transfer | error_exit_after_completion_in_sync | +| client_abort_idle_rejected | idle_abort_rejects_non_22x | +| client_upload_stream_abort | upload_error_exit_in_sync | +| client_abort_concurrent | concurrent_abort_in_sync | +| client_cancelled_abort_or_finish | cancelled_wait_leaves_replies_owed | +| client_abort_during_finish | abort_interrupts_finish_wait | +| client_abandoned_listing_resync | abandoned_transfer_settled_by_next_command | +| server_listener_release_after_abort | aborted_listener_closed_and_port_returned | +| server_repeated_abor_order | repeated_abor_replies_in_order | +| server_pipelined_command_order | pipelined_commands_executed_in_sequence | +| server_real_client_abor | telnet_and_urgent_abor_handled | +| server_quit_during_transfer | quit_waits_for_active_transfer | +| server_data_connection_loss | data_connection_loss_aborts_transfer | +| server_undecodable_command_syntax | undecodable_command_replies_500 | +| client_abort_after_cancelled_finish | abort_after_cancelled_finish_sends_abor | +| server_pipelined_abort_open_data | pipelined_abor_aborts_open_transfer | +| server_pipelined_quit_open_data | pipelined_quit_waits_for_open_transfer | +| client_nowait_abort_owed_replies | nowait_abort_replies_never_reach_later_command | +| client_command_during_abort | command_during_abort_gets_own_reply | + +Child pass conditions: + +- `early_abor_replies_and_session_survives` (CASE-01, `fraction` over `RETR`, `STOR`, `APPE`, + `LIST`, `MLSD`): after `150`, an `ABOR` sent before the data connection opens is answered `426` + then `226`; `PWD` then answers `257`, and a fresh `EPSV` + `RETR` of the seeded file returns its + exact bytes and `226`. +- `block_exit_reads_nothing_more` (CASE-02): after `abort()` mid-transfer, the normal exit of the + `async with client.download_stream(...)` block finishes within 10 s, the server logged `ABOR`, + and the successor `PWD` returns the server's path. +- `completed_transfer_then_abort` (CASE-03, `all` over `ABOR` replies `225` and `226`): the + transfer's `226 Transfer complete` is on the wire before the data socket closes; the client reads + to end of data, calls `abort()` and closes the stream; `abort()` returns, `ABOR` follows `RETR` in + the server's log, and the successor `PWD` returns the server's path. +- `idle_abort_accepts_225` (CASE-04): with no transfer, `abort()` against `225 No transfer to ABOR` + returns, the server logged `ABOR`, and the successor `PWD` returns the server's path. +- `failed_transfer_then_abort` (CASE-05): the transfer ends with `451` before the data socket + closes; `abort()` (`ABOR` reply `226`) returns without raising, `ABOR` follows `RETR`, and the + successor `PWD` returns the server's path. +- `error_exit_mid_transfer_in_sync` (CASE-06): a probe-private exception raised inside the block + after one block of data propagates as the same instance, and the successor `PWD` returns the + server's path. +- `error_exit_after_completion_in_sync` (CASE-07, `all` over `ABOR` replies `225` and `226`): the + same exception raised after the completed transfer was read to its end propagates as the same + instance, and the successor `PWD` returns the server's path. +- `idle_abort_rejects_non_22x` (CASE-08, `all` over `idle-500` and `after-complete-500`): `abort()` + against an `ABOR` reply of `500` raises `StatusCodeError` without hanging, both with no transfer + and after a completed transfer whose `226` had to be consumed first; the server logged `ABOR`, + and the successor `PWD` returns the server's path. +- `upload_error_exit_in_sync` (CASE-09): an exception raised inside an `upload_stream` block + propagates as the same instance, and the successor `PWD` returns the server's path. +- `concurrent_abort_in_sync` (CASE-10): multiple concurrent calls to `client.abort()` on an active + stream serialize cleanly without `RuntimeError: readuntil()`, all calls return, and the successor + `PWD` returns the server's path. +- `cancelled_wait_leaves_replies_owed` (CASE-11, `all` over `cancel-abort`, `cancel-finish`, + `cancel-abort-after-final` and `cancel-finish-then-finish`): the server delays the transfer's + final reply and the `ABOR` reply by one second; `abort()` (mid-transfer) or `finish()` (after a + completed transfer) is cancelled by `asyncio.wait_for` after 0.3 s, the stream block still exits + within the bound, and the successor `PWD` returns the server's path after every owed reply was + consumed. In `cancel-abort-after-final` the server writes the transfer's `426` at once and delays + only the `ABOR` reply, so the cancelled `abort()` owes the `ABOR` reply alone; in + `cancel-finish-then-finish` the stream's `finish()` is called again after the cancelled one and + must return within the bound without raising. +- `abort_interrupts_finish_wait` (CASE-12): the server sends the transfer's final reply only once + `ABOR` arrives; `finish()` runs in one task and `abort()` in another; both complete within the + bound, `abort()` returns without raising, `finish()` returns or raises `StatusCodeError`, `ABOR` + follows `RETR` in the log, and the successor `PWD` returns the server's path. +- `abandoned_transfer_settled_by_next_command` (CASE-13, `all` over `list-break`, `list-aclose` + and `get-stream-unfinished`): a `list()` left with `break`, a `list()` left with `break` and then + `aclose()` (which must return within the bound with the listing no longer open on the server), + and a `get_stream()` stream that was never finished each leave the successor `PWD` returning the + server's path. +- `aborted_listener_closed_and_port_returned` (CASE-14, `all` over `data-ports`, `ephemeral` and + `open-data`): after `150` and `ABOR` (`426`, `226`) before any data connection, or (in + `open-data`, with a one-port `data_ports` pool) after `STOR` is answered `150` on an already + open data connection whose upload never ends and `ABOR` is then sent on its own (`426`, then + `225` or `226`), + a late connection to the aborted transfer's port is refused or closed by the server at once, the next `EPSV` answers + within 5 s (with a one-port `data_ports` pool that needs the port back), and a `RETR` of the + seeded file through that listener returns its exact bytes and `226`. +- `repeated_abor_replies_in_order` (CASE-15): a running `RETR` (slow file reads, half a second to + close the file) receives two `ABOR` lines in one send; the replies are `426`, `226`, `226` in that + order, `PWD` answers `257`, and a fresh `EPSV` + `RETR` of the seeded file returns its exact + bytes and `226`. +- `pipelined_commands_executed_in_sequence` (CASE-16, `all` over `cwd-pwd`, `mkd-cwd-pwd`, + `rnfr-rnto`, `dele-retr`, `retr-abor`): pipelined commands sent together in one socket write on + a slow store execute sequentially; each command observes the side effects of earlier commands: + `CWD` then `PWD` returns `250` then `257` with the changed directory; `MKD` then `CWD` then `PWD` + returns `257`, `250`, `257` with the newly created directory; `RNFR` then `RNTO` returns `350` + then `250` and renames the file; `DELE` then `RETR` deletes the file before `RETR` runs so `RETR` + answers `550`; `RETR` then `ABOR`, sent after `EPSV` but before any data connection opens (so + the transfer is still pending when `ABOR` runs), returns `150`, `426`, `226` in that order. +- `telnet_and_urgent_abor_handled` (CASE-17, `all` over `telnet-inline`, `bsd-urgent`, + `ftplib-abort`, `telnet-idle`): `ABOR` is accepted and handled with `426` then `226` when + preceded by Telnet IP/Synch bytes inline, when preceded by BSD `MSG_OOB` urgent data, when + issued via Python's standard `ftplib.FTP.abort()`, and when received idle with Telnet prefix + (replies `226` or `225`). In all scenarios the session stays open and later commands succeed. +- `quit_waits_for_active_transfer` (CASE-18, `all` over `quit-retr`, `quit-stor`, `quit-no-data`): + `QUIT` during a running `RETR` or `STOR` allows the active transfer to finish and deliver its + `226` reply before the `221` reply is sent; `QUIT` received after `150` when no data connection has + opened cancels the waiting transfer immediately with `426` and then sends `221`. +- `data_connection_loss_aborts_transfer` (CASE-19, `all` over `retr-close`, `retr-reset`, + `stor-reset`): when the data stream is abruptly closed or reset (`RST`) mid-transfer, the server + replies `426`, releases the passive listener and returns the port to `data_ports`, allowing + subsequent `EPSV` transfers to succeed without exhaustion. +- `undecodable_command_replies_500` (CASE-20): a command line that cannot be decoded under the + server encoding answers `500` syntax error and the control session continues. +- `abort_after_cancelled_finish_sends_abor` (CASE-21): the server holds the transfer's final reply + until `ABOR` arrives and delays the replies it then owes by one second; after one block of data, + `finish()` is cancelled by `asyncio.wait_for` after 0.3 s, `abort()` must then return within the + bound (so it sends `ABOR` rather than first waiting for the final reply the cancelled `finish()` + owed) without raising, a second `finish()` must return within the bound without raising, `ABOR` + follows `RETR` in the server's log, and the successor `PWD` returns the server's path. +- `pipelined_abor_aborts_open_transfer` (CASE-22, `all` over `retr-abor`, `stor-abor`, + `retr-abor-pwd`, `appe-abor`, `retr-abor-abor`): the data connection is already open and the + transfer cannot complete (a 16 MiB `RETR` whose peer never reads, or a `STOR` or `APPE` whose + peer never sends or closes) when the transfer command and `ABOR` arrive in one write, in + `retr-abor-pwd` followed by `PWD` and in `retr-abor-abor` by a second `ABOR`; the replies are + `150`, `426`, `226` (then `257`, or the second `ABOR`'s own `226`) in that order within 5 s + each, a later `PWD` answers `257`, and a fresh `EPSV` + `RETR` of the seeded file returns its + exact bytes and `226`. +- `pipelined_quit_waits_for_open_transfer` (CASE-23, `all` over `retr-quit`, `stor-quit`, + `appe-quit`, `list-quit`): the data connection is already open when the transfer command and + `QUIT` arrive in one write; the replies are `150`, `226`, `221` in that order, the `RETR` delivers + the seeded file's exact bytes, the file sent by the `STOR` or `APPE` (to a new name) is read back + byte for byte from a second session, and the `LIST` output names the seeded file. +- `nowait_abort_replies_never_reach_later_command` (CASE-24, `all` over `close-then-command`, + `abort-again`, `new-download`, `get-stream-unfinished`): after one block of a transfer, + `abort(wait=False)` returns without reading; then the stream is closed, or `abort()` is called + again, or a second `download_stream` is opened, read and aborted, or (for a `get_stream()` stream + never finished) nothing else is done; every call returns within the bound, the server logged + `ABOR`, and the successor `PWD` returns the server's path. +- `command_during_abort_gets_own_reply` (CASE-25, `all` over `command-with-abort`, + `command-during-finish-and-abort`): `get_current_directory()` is issued from another task while + `abort()` is in progress on an active stream, in the second variant while `finish()` also waits + on a server that sends the transfer's final reply only once `ABOR` arrives; `abort()` returns + without raising, the concurrent `get_current_directory()` returns the server's path, `finish()` + returns or raises `StatusCodeError`, the server logged `ABOR`, and the successor `PWD` returns the + server's path. + +## Ceilings + +| Ceiling | Fires when | Value | +|---|---|---| +| G1_stale_reply_after_abort | `completed_transfer_then_abort` scores below 1.0 | 0.60 (shared, non-stacking) | +| G2_stale_reply_after_error_exit | `error_exit_after_completion_in_sync` scores below 1.0 | 0.60 (shared, non-stacking) | +| G3_stale_data_connection_after_abort | `aborted_listener_closed_and_port_returned` scores below 1.0 | 0.60 (shared, non-stacking) | +| G4_stale_reply_after_cancelled_finish | `abort_after_cancelled_finish_sends_abor` scores below 1.0 | 0.60 (shared, non-stacking) | +| regression_ceiling | the repository's 792 base tests fail, error, or do not all run with the pristine `tests/` and `pyproject.toml` restored; where IPv6 loopback is unavailable, exactly the 212 `::1` nodes are skipped and any other skip count also fails | 0.30 | +| integrity_zero | importing the candidate's `aioftp` replaces `asyncio.wait_for`, `asyncio.open_connection`, `asyncio.start_server` or `socket.socket`, or candidate source names the root-only grader or gold locations | 0.00 | + +## Scoring model + +`raw = Σ weight × value` over the twenty-five criteria. `final = min(raw, 0.60 if G1, G2, G3 or G4 fired, +0.30 if the regression ceiling fired, 0.00 on an integrity breach)`. The strictest applicable +ceiling wins; ceilings never stack. Gated criteria keep their proportional raw credit (gated raw +weight 0.046). A grader fault reports `isError: true` with a non-healthy `grader_health` and is never +scored as a candidate zero. + +## Outcome groups + +| Group | Weight | Criteria | +|---|---|---| +| Server pipelining and sequencing | 0.406 | server_pipelined_command_order, server_pipelined_abort_open_data | +| Server real-client ABOR and urgent data | 0.007 | server_real_client_abor | +| Server transfer lifecycle and QUIT | 0.406 | server_quit_during_transfer, server_pipelined_quit_open_data | +| Server data path loss and listener release | 0.014 | server_listener_release_after_abort, server_data_connection_loss | +| Server abort session survival and syntax | 0.044 | server_early_abort_session, server_repeated_abor_order, server_undecodable_command_syntax | +| Client abort reply ownership | 0.088 | client_abort_after_completed_transfer, client_abort_idle_225, client_abort_after_failed_transfer, client_abort_idle_rejected, client_abort_concurrent, client_cancelled_abort_or_finish, client_abort_during_finish, client_abort_after_cancelled_finish, client_nowait_abort_owed_replies, client_command_during_abort | +| Client stream exit after abort or error | 0.035 | client_stream_exit_after_abort, client_error_exit_mid_transfer, client_error_exit_after_completed_transfer, client_upload_stream_abort, client_abandoned_listing_resync | diff --git a/harbor/sources/aioftp-v11/tasks.py b/harbor/sources/aioftp-v11/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..bc40ba72b4b183300ddf52e0492c095b322d79fd --- /dev/null +++ b/harbor/sources/aioftp-v11/tasks.py @@ -0,0 +1,31 @@ +"""Canonical task definitions for aioftp-stream-abort-desynchronization (HUD v6). + +Exports env for HUD discovery and registers, in the public tasks list, the single approved agent +task plus its two reference variants. The agent task serves the approved prompt from +task/prompt.md byte for byte. The variants grade the gold patch and the unchanged base on a fresh +pinned tree; Prompt 07 runs each once per deployed build and Prompt 08 runs only the agent task. +""" + +from pathlib import Path + +from env import aioftp_stream_abort_desynchronization, env, reference_base, reference_gold # noqa: F401 + +_PROMPT = (Path(__file__).resolve().parent / "task" / "prompt.md").read_text(encoding="utf-8") + +_task = aioftp_stream_abort_desynchronization( + task_id="aioftp_stream_abort_desynchronization", + description=_PROMPT, +) +_task.slug = "aioftp-stream-abort-desynchronization" + +_gold = reference_gold() +_gold.slug = "aioftp-stream-abort-desynchronization-gold" + +_base = reference_base() +_base.slug = "aioftp-stream-abort-desynchronization-base" + +tasks = [ + _task, + _gold, + _base, +] diff --git a/harbor/sources/aioftp-v11/uv.lock b/harbor/sources/aioftp-v11/uv.lock new file mode 100644 index 0000000000000000000000000000000000000000..99386769ed39ec598f5ad7d5c055429ae5c6b9de --- /dev/null +++ b/harbor/sources/aioftp-v11/uv.lock @@ -0,0 +1,1806 @@ +version = 1 +revision = 3 +requires-python = ">=3.11, <3.13" +resolution-markers = [ + "python_full_version >= '3.12' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and sys_platform != 'emscripten'", + "python_full_version < '3.12'", +] + +[[package]] +name = "aiofile" +version = "3.12.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "caio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/14/31/edb06aabd8f8f0b56d659f30800795f40b93cba96be946ce179f6931e3a5/aiofile-3.12.3.tar.gz", hash = "sha256:caa6aa746b5e47e2165f7abd741b6415e49cf4d44fddc0f61844612cc3924d41", size = 21600, upload-time = "2026-08-04T22:59:27.171Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4e/79/6e45e778c4c3cab39e0937b007b720c15f76c50c6453d153282d0fcc3588/aiofile-3.12.3-py3-none-any.whl", hash = "sha256:5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017", size = 22122, upload-time = "2026-08-04T22:59:25.838Z" }, +] + +[[package]] +name = "aioftp-stream-abort-desynchronization" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "hud" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, +] + +[package.optional-dependencies] +dev = [ + { name = "pre-commit" }, + { name = "pytest" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "hud", extras = ["agents"], specifier = ">=0.6.0,<0.6.18" }, + { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.5.0" }, + { name = "pytest", specifier = ">=8.0.0" }, + { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" }, + { name = "pytest-asyncio", specifier = ">=0.23.0" }, + { name = "ruff", marker = "extra == 'dev'", specifier = "==0.11.2" }, +] +provides-extras = ["dev"] + +[[package]] +name = "annotated-doc" +version = "0.0.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" }, +] + +[[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 = "anthropic" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "docstring-parser" }, + { name = "httpx2" }, + { name = "jiter" }, + { name = "pydantic" }, + { name = "sniffio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/65/b8/f4de0e90bbd641e86a1d6b20e017442033a2c1d2f5381799f82057115bd7/anthropic-1.8.0.tar.gz", hash = "sha256:9c1783ed90f409617749a61c5ab98e20624a572626f2e0a15cea03ed8e1401e5", size = 1221762, upload-time = "2026-09-22T16:25:38.167Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/18/5d25a703b66ba34e9277f875f692a3bea3b0ff4d47ee5d188521a01cdd2a/anthropic-1.8.0-py3-none-any.whl", hash = "sha256:79a4516a21e64fd7b15be1a49ebf544bd6376c96a971a77365358823a2717bc6", size = 1348276, upload-time = "2026-09-22T16:25:36.515Z" }, +] + +[[package]] +name = "anyio" +version = "4.15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions" }, +] +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 = "asyncssh" +version = "2.24.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dd/7f/2d79247bacc562104f312d27efe541673aa177feac89de291bd61bca52be/asyncssh-2.24.0.tar.gz", hash = "sha256:4064c590e59ce2e8d82a2f66d35f3120d765828b4df5e3dbfb07b4a8c24686c9", size = 550148, upload-time = "2026-06-27T20:34:44.755Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/29/908ce0ca5e8cae76662e354a0f08df552d6d221844748b9e5ca06051cc44/asyncssh-2.24.0-py3-none-any.whl", hash = "sha256:9abd46300adcb6d4b73269b34c53cd0d17a138b9a22b5b38008ce7d5808734b7", size = 381237, upload-time = "2026-06-27T20:34:43.198Z" }, +] + +[[package]] +name = "asyncvnc" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "keysymdef" }, + { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" }, + { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/55/e7c4483b8952bbe048a107d85a29f06a6336e302b79a2e0508d61d926e43/asyncvnc-1.3.0-py3-none-any.whl", hash = "sha256:f4de4e858449325aefcf82a46b34befb34afdd811e20e7af9b0440192e496e74", size = 19992, upload-time = "2023-02-26T19:12:11.007Z" }, +] + +[[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 = "authlib" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "joserfc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/51/bc1729d3cfdc214b4935f4e886e4dd443c3065fd8e1e66423fe84b490f81/authlib-1.8.0.tar.gz", hash = "sha256:f3ecd5f1da737262fb53bf1a4d95c4ea1ad9dd509316587a255c99ab1838a4f0", size = 177759, upload-time = "2026-08-30T12:12:34.833Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/c6/6f124bcfbbfb20fba22c939b4e43a06dccfc0e1ca20e5634ca573cb1e271/authlib-1.8.0-py2.py3-none-any.whl", hash = "sha256:88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121", size = 260804, upload-time = "2026-08-30T12:12:33.162Z" }, +] + +[[package]] +name = "backports-tarfile" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/86/72/cd9b395f25e290e633655a100af28cb253e4393396264a98bd5f5951d50f/backports_tarfile-1.2.0.tar.gz", hash = "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991", size = 86406, upload-time = "2024-05-28T17:01:54.731Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b9/fa/123043af240e49752f1c4bd24da5053b6bd00cad78c2be53c0d1e8b975bc/backports.tarfile-1.2.0-py3-none-any.whl", hash = "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", size = 30181, upload-time = "2024-05-28T17:01:53.112Z" }, +] + +[[package]] +name = "beartype" +version = "0.22.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/94/1009e248bbfbab11397abca7193bea6626806be9a327d399810d523a07cb/beartype-0.22.9.tar.gz", hash = "sha256:8f82b54aa723a2848a56008d18875f91c1db02c32ef6a62319a002e3e25a975f", size = 1608866, upload-time = "2025-12-13T06:50:30.72Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/cc/18245721fa7747065ab478316c7fea7c74777d07f37ae60db2e84f8172e8/beartype-0.22.9-py3-none-any.whl", hash = "sha256:d16c9bbc61ea14637596c5f6fbff2ee99cbe3573e46a716401734ef50c3060c2", size = 1333658, upload-time = "2025-12-13T06:50:28.266Z" }, +] + +[[package]] +name = "cachetools" +version = "7.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/2c/3f18755527b03ca9ff6be724bd5370cb777c76a87f17301377cf04a4729b/cachetools-7.2.0.tar.gz", hash = "sha256:bcac1a1b8da6909994a2957238a57b8140dab7c5c5c69a43669654fe87a33c1d", size = 41129, upload-time = "2026-09-16T20:48:27.209Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/bb/1c6e7a89b11da19f137e4ef5a5c5fe47a5bb686449ba343944ccf8fb34b2/cachetools-7.2.0-py3-none-any.whl", hash = "sha256:3045213f186b89fdd95d94441354c4bd87c570b7a38d8c3fd1d9dd37f6dc90d8", size = 16918, upload-time = "2026-09-16T20:48:25.575Z" }, +] + +[[package]] +name = "caio" +version = "0.12.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d2/c9/ac301b7f86ccf6ad02ee78eb953ce8f75175754cc5e76d398e447af42e3e/caio-0.12.4.tar.gz", hash = "sha256:32d8e9f3e2099c8db29446679252766c9bcd806eb88b4fb60ad274f73df2a5e9", size = 81006, upload-time = "2026-09-07T06:52:39.18Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/c6/168bc0eef2c77681e186957d5a1145208802bb0ecdcfd4d7f67b38b629c7/caio-0.12.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b0444d20067642bb272e423de3cc8ef05bf134d335d57fa5bddcfcc98e04313e", size = 47768, upload-time = "2026-09-07T06:52:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/9c/81/ae41a0473525229e56d7ffbb420b7fc7f72e04e468160a3519596ce094ba/caio-0.12.4-cp311-cp311-manylinux_2_34_aarch64.whl", hash = "sha256:780465251a0680039b29c990bca73b40b843e39d06505c62e353ed56490e4576", size = 159620, upload-time = "2026-09-07T06:52:08.881Z" }, + { url = "https://files.pythonhosted.org/packages/86/c5/53838d8ece904637dadc3177e5b5b5b6e4f7af9ce17a1f42c6f6214edc1d/caio-0.12.4-cp311-cp311-manylinux_2_34_x86_64.whl", hash = "sha256:67f1bddc997bef281db36600e3e58d6b16d6486b3540eb62c9e54c6584f137fd", size = 156089, upload-time = "2026-09-07T06:52:09.99Z" }, + { url = "https://files.pythonhosted.org/packages/83/39/34e416ee20493c96d5beda9e4196bec236117b012f6f4d0efdb96b91932c/caio-0.12.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:20acd9a8df90d25b63bc0b7dc264e2a09b99082a420b5d640c76056027ee6b52", size = 157195, upload-time = "2026-09-07T06:52:11.196Z" }, + { url = "https://files.pythonhosted.org/packages/26/c9/f7b78203beaee0e984b219c48c810e547b27353f899ef82d49133f3c4817/caio-0.12.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0d8d2826bf622644fc374a9f53ac00918b489d03599783953fcbe79af19123f5", size = 155700, upload-time = "2026-09-07T06:52:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/68/35/7ddc8de48cd0142797db186c07e901005b966dc6e8a7852f0273d33e4840/caio-0.12.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:67b725641fea682a2e9b1d3b2a150d21f1a25383e3ec8351bd7677ff857fa982", size = 47927, upload-time = "2026-09-07T06:52:13.58Z" }, + { url = "https://files.pythonhosted.org/packages/8c/b4/37556bde83253cf1ed071a754c8405d02b955febd021c400f0ffa6258d5f/caio-0.12.4-cp312-cp312-manylinux_2_34_aarch64.whl", hash = "sha256:4854a029e359e5ddfb5589ab66157a34af6a0dda0acdaa43f5e640d60182c1ea", size = 161402, upload-time = "2026-09-07T06:52:14.581Z" }, + { url = "https://files.pythonhosted.org/packages/7a/11/519e40a1da4d18515ab5ddb54e75cdd896532339010f2dcee7e798e4edab/caio-0.12.4-cp312-cp312-manylinux_2_34_x86_64.whl", hash = "sha256:f063624a98a64bab387430c5eaea61ef3825a98399104a297b8da4741c15139f", size = 159311, upload-time = "2026-09-07T06:52:15.853Z" }, + { url = "https://files.pythonhosted.org/packages/45/2a/0db30de6c2561e41721d94ac627aa65db61a403545e67914814d8c2b5305/caio-0.12.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8a926d562f8c06767774a91239770ebaa93c10a24074e21ea741db208df9cc1d", size = 158910, upload-time = "2026-09-07T06:52:17.27Z" }, + { url = "https://files.pythonhosted.org/packages/1e/e0/5eb43a89aecdf9d6f929b0080e49d92ccdf3f88bbc637353f52843b483af/caio-0.12.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:53605636e3b1eaeca368b475f1471ad9774736c6502a4b58b8b6b8d74b531770", size = 158973, upload-time = "2026-09-07T06:52:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/e8/e6/07100a694613344d22958fb6d803fdf914ee9395278fe58ad1b1b9c59e52/caio-0.12.4-py3-none-any.whl", hash = "sha256:7a5e231bbf81eaed269f99afa9ef46457f51f9407952a1795c0795b3a62c23c0", size = 25628, upload-time = "2026-09-07T06:52:38.147Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[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" }, +] + +[[package]] +name = "cfgv" +version = "3.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/3f/143b048436775b0f76ac3eec145c019e8173ccc2885c8f20319b996d5e83/charset_normalizer-3.5.1.tar.gz", hash = "sha256:6117b84ea48435e5356dc737f5121485c30920ba43375fa7b434fd753df0eac3", size = 171764, upload-time = "2026-08-15T08:20:44.807Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/b6/034f6802e9c3f6418966cfabb7db8c9252cc2429c5098f41cc43af804149/charset_normalizer-3.5.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:eda059b6bc8bc0812d626fd91a7ce01bf583df0a61296eff390fd94141a34e30", size = 363585, upload-time = "2026-08-15T08:16:46.646Z" }, + { url = "https://files.pythonhosted.org/packages/d5/fa/6a7e2a7c4b5451912b8c417732df79574354443592a88d616de03da66ae5/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa2bb0b37202dca27175591f761108b5d34096ade1191ffe4808bdf6b1571488", size = 251189, upload-time = "2026-08-15T08:16:48.287Z" }, + { url = "https://files.pythonhosted.org/packages/a4/c8/ab42b07cfd82e919f427fcfaa7c41abae8242833ad1aad66d42bae40b669/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b2b1b3fa5670c127b246df1d0c059defd41f689a868a3b9d79df9b1cac42d22", size = 239724, upload-time = "2026-08-15T08:16:49.67Z" }, + { url = "https://files.pythonhosted.org/packages/e7/80/b9348b5d3041209f98b4cdad7655766369233f1d533f4f4f7558e9717bec/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6e5e4d73d588ca5ed09df1b7dcd1b203d1df3c542e3f50d126c947d432b10731", size = 280078, upload-time = "2026-08-15T08:16:51.228Z" }, + { url = "https://files.pythonhosted.org/packages/82/38/083a24028304bc85bb9e376fed801178423dcbb67495f73b6ea0624e1894/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b54e7e13267d49ffbfe68e25b3cbd774dab38fa37238f71265e91b36146eb21c", size = 276650, upload-time = "2026-08-15T08:16:52.625Z" }, + { url = "https://files.pythonhosted.org/packages/0d/35/731ac04aa0a097fc1c97f0994c375bdb230c6c96619db794208fe664e9ce/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7b742bf31c88566b4bb6335a7f393bb322e580b6bb98df7bd0c25e6e3519ce8", size = 262325, upload-time = "2026-08-15T08:16:54.085Z" }, + { url = "https://files.pythonhosted.org/packages/f5/28/c2028e7021fb89c6e56868ed0e387b8e9aa811abdd2ab3208d6578d2c930/charset_normalizer-3.5.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6ba32c4d2abf1d2fe7cf27d280f4cca5664233b0f885549c7761719eb977f486", size = 261140, upload-time = "2026-08-15T08:16:55.604Z" }, + { url = "https://files.pythonhosted.org/packages/28/f0/0c0ceec6d98b7daa62e361e418135d59685811d79ba11529aad5cdf15e84/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0722590aabf9dc6a6c0343d523c05458fa2b5047dbe6302fd526bb570600753f", size = 252791, upload-time = "2026-08-15T08:16:57.103Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3e/48f4cd187b1c33189d86039e9cbe4f92c05454175504b44ff81806d4d1bf/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:aa1099b956fb795e686d073568f6dc002a0bb89765ea6d5b055dd7d9bf1b116c", size = 240730, upload-time = "2026-08-15T08:16:58.418Z" }, + { url = "https://files.pythonhosted.org/packages/42/85/f9e22af69af67c54cce42be9455d9c81294f918b4ccc454db01f66efcac2/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:bd6c173f04743d483881bffa1478d5a4624475b8cd1d2194956a75548e191c18", size = 280791, upload-time = "2026-08-15T08:16:59.918Z" }, + { url = "https://files.pythonhosted.org/packages/fd/4c/9044135f42127630b6fa742feb51256353f6ab87a78f2fdd1de3de955a7f/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:f298e218441525d3794428b4c8b8fb8662c6d3ea79925d4807ee6b9a96a3bca5", size = 259598, upload-time = "2026-08-15T08:17:01.421Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ed/1dd7cfebb4e75812934c49ca3b79757d11948053f7937ab7070c151f3c55/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:6e2912d4babbc65196ac13c2f53468dc57fb8b9c25ef913e8c59ddf7c6dc0e1b", size = 278217, upload-time = "2026-08-15T08:17:02.782Z" }, + { url = "https://files.pythonhosted.org/packages/bf/eb/239c84503cc9e3ba6eb34686a24bc66e84f3924efdd7e38e751a19f6bc10/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3d27167433c0d5f18dc850f07d0b3816221984fecdc405d6c157a6f0b8f8e9e6", size = 263417, upload-time = "2026-08-15T08:17:04.216Z" }, + { url = "https://files.pythonhosted.org/packages/37/ab/4e4510e1e288478e2c8333131d1c1382382ba8cd2165053c79e39d1da961/charset_normalizer-3.5.1-cp311-cp311-win32.whl", hash = "sha256:ac00177c4831ffa650f8609e4bdddd5fe09c03b1c0c47acece7e6ea20421598b", size = 181774, upload-time = "2026-08-15T08:17:05.58Z" }, + { url = "https://files.pythonhosted.org/packages/e3/57/32f0ccea59e8612057c61d6fd22ef2cb63cca93c9fe594094919696ac170/charset_normalizer-3.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:f9b1e28d0e8dbfa858abdba91d6b547beaf2df1a59bec6da6faae7b96a4991a9", size = 206653, upload-time = "2026-08-15T08:17:07.075Z" }, + { url = "https://files.pythonhosted.org/packages/17/d4/b65c433fc521e58b5f54293982a5e51c05cb5f2dd3f1c7a6acb65b75324e/charset_normalizer-3.5.1-cp311-cp311-win_arm64.whl", hash = "sha256:ae31a1a1db2ee6cc2942fccaf695c934bc7f3db9f2133a3fef1f367cf1a4ab10", size = 185630, upload-time = "2026-08-15T08:17:08.502Z" }, + { url = "https://files.pythonhosted.org/packages/30/27/78873dc8b6a56357517b74b6bb9568b80450e7bb4f6ef7e3fa9d22aa0bd7/charset_normalizer-3.5.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5b6d1386bf0096d26d3a863dc0a487a5b4eb9aa93cf5ba69683d29dde6b9d60f", size = 344456, upload-time = "2026-08-15T08:17:10.072Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4c/be49ada26b1f0232d57aa89bbebf997a5cc2332a5616b6eca26ff680044d/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4582c27e8c889d64811987b5967fbd3ae0c823fe1fd933b543d55ac20bb475fa", size = 238530, upload-time = "2026-08-15T08:17:11.563Z" }, + { url = "https://files.pythonhosted.org/packages/76/84/6f1290fa07ae6978d3960caa3eb1b8019bf9284ab7c2297b00c099ef4250/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1d1c7a53a6c2103925cdd6d7229f8c567379f211c869793df679f2e9f738c369", size = 230200, upload-time = "2026-08-15T08:17:12.919Z" }, + { url = "https://files.pythonhosted.org/packages/e7/a0/47b18adeed31c8f16ba9700f32c1b18594cfa09f47eb672a488c273c22bf/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e6621fb2a4988d6e53eedc455e5903e2679f3967b8acb3d639f1b63c14a2e893", size = 262222, upload-time = "2026-08-15T08:17:14.571Z" }, + { url = "https://files.pythonhosted.org/packages/38/fe/341861ac118dae06f3ec0eb487488af52128f2ef2faf0b11003944d22259/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c0c10730342b0c9b35dd1d619beb8214e520bd96a1f870f452680b238aab3e0", size = 258951, upload-time = "2026-08-15T08:17:16.158Z" }, + { url = "https://files.pythonhosted.org/packages/6f/89/bb5108dc6c3651dca963f2b0a3ba19bbcb370c94e1b6d3e0e844a58e6dca/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9af956078716df40d985fb0dfeb2c2120c5ca92ba4ff4b388acfd01cdc14d08", size = 248801, upload-time = "2026-08-15T08:17:17.683Z" }, + { url = "https://files.pythonhosted.org/packages/b1/ba/ef83ae3aca816393decfa3530976f38a79812d707b80b580ac33b83f9877/charset_normalizer-3.5.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f9f8405c2c758532c74fed975dbee57be1f31a6e865c031870c79a6ed3212ada", size = 244070, upload-time = "2026-08-15T08:17:19.191Z" }, + { url = "https://files.pythonhosted.org/packages/f6/0b/c5292a2462d69b7378ea89793bbb5b2b6fcf6f7dd6d1667f9619094ad553/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:96fef3e886d6a9874b14f27fc193fbdc69d5d8035783d86aa4e1cea594e695f9", size = 240110, upload-time = "2026-08-15T08:17:20.547Z" }, + { url = "https://files.pythonhosted.org/packages/46/22/111e5be3b740d5c2a5bfcedb3d237b6591e5c2e82ae9d6ffcb121fe0909c/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5d8531a6569d025f68e2321e7638fb7978f23db58e5f69f56913837aae03816e", size = 232836, upload-time = "2026-08-15T08:17:21.895Z" }, + { url = "https://files.pythonhosted.org/packages/f9/d2/d2aad6fe0dbb44b194bf3becb60f5a0ac48446ade999a47fe7bb41eb09a7/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:aae2ee51122d3ae968a3837d97dc24a0aeebb0dea23694422cd172bd30017cd6", size = 262712, upload-time = "2026-08-15T08:17:23.727Z" }, + { url = "https://files.pythonhosted.org/packages/35/5a/337e4663a5eae6de99db940ee8066d4145caafb61327db62deda15313cce/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:7235dc28fc6dd9d832ac7c7bce95367dedb85929f17368a0c2bee1e080b9acbf", size = 242977, upload-time = "2026-08-15T08:17:25.157Z" }, + { url = "https://files.pythonhosted.org/packages/ca/85/f82f8a92e31c7519410e2e1afdc630f28ec47490ce2c09a11c1a43cbb459/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4abdc5f9ad448c1ecbfae2974b820535d6bc6e7eef63babbab3d81cf46968c71", size = 260207, upload-time = "2026-08-15T08:17:26.602Z" }, + { url = "https://files.pythonhosted.org/packages/b7/52/643d11ffd60e9ac2fd1fb87e167a19285b9eefeff4a40e63c87cbfbeab36/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ba501e667c17d8411f98e67a022d9604ef179aff0e459b7e292c796837c13573", size = 250562, upload-time = "2026-08-15T08:17:27.971Z" }, + { url = "https://files.pythonhosted.org/packages/62/16/46556278c2168d12df9da7fede5dc6fc70e60301b26a82bbeec238c9cfe3/charset_normalizer-3.5.1-cp312-cp312-win32.whl", hash = "sha256:cfa1c0cc3a8f9f53f1243a5a99ac36fd003880199383b37672e86ddda9cb07e2", size = 178507, upload-time = "2026-08-15T08:17:29.277Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7a/4c6c298171e6b3e745633180ff59350fc0ca0db1ffd28df1e369e0579f71/charset_normalizer-3.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:3617ac3cfd8b9888f145ad89dd6e692285834b0201c6074a5eeaad3fd4d668c2", size = 200551, upload-time = "2026-08-15T08:17:30.668Z" }, + { url = "https://files.pythonhosted.org/packages/cd/d7/eb95a042f0dd22e304b0b6472b154f3546a1a039a9ee89ccb2a7f61591fc/charset_normalizer-3.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:88e85ab89cb822c1e635f51d6d32e488f94e002e70e2f492bdb8b945543f345a", size = 180700, upload-time = "2026-08-15T08:17:32.028Z" }, + { url = "https://files.pythonhosted.org/packages/5b/97/fb4e82231aba271ffd775a1b4993b0defc4e3059f286ae41d9433409fe85/charset_normalizer-3.5.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:41876ee62a3dddf48ff1121ad8f0798032aa03f2fd35f21f34a4cab14f18d8d2", size = 331467, upload-time = "2026-08-15T08:19:50.959Z" }, + { url = "https://files.pythonhosted.org/packages/9f/2f/fe3f187327aac18e2d54e9d2b08e15d27bf9b642d9e51c219f130fc34d1a/charset_normalizer-3.5.1-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a6dac12ff6b846103483683f60c5f8fee205121adc58ffd87e90a90a3af69e99", size = 253057, upload-time = "2026-08-15T08:19:52.654Z" }, + { url = "https://files.pythonhosted.org/packages/d7/c7/9e48cee5c161fe24da823b61bf381921d77cb994a0a4de148e95018c1984/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cee5dd7c6fb5dd52a0fe2a740f9bc6e3593f5f8b1788bde49de02086f30182b2", size = 240930, upload-time = "2026-08-15T08:19:54.163Z" }, + { url = "https://files.pythonhosted.org/packages/49/e0/716601f3cc69be7b198951150c75ead1ece33c3c8036ff6ffa46029659a0/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:343fb4f2821043bd87095f7b08a1a181febc8e36ac64212143bbfd0a0e1bc235", size = 230822, upload-time = "2026-08-15T08:19:55.807Z" }, + { url = "https://files.pythonhosted.org/packages/d3/05/71bfc5caa0abcc45aea1f6a4d50ac68e59605ddc7666fe8494f4cd229665/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ae4a097991662cd4fff0ddc74e0fe7874f82e00042fa0ea00855645ed0c79598", size = 260037, upload-time = "2026-08-15T08:19:57.312Z" }, + { url = "https://files.pythonhosted.org/packages/c3/92/de7e32ed05341e7a9c4c877c318418197b7f2d66a3b68d561bf2ac57ca3e/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4b599739b93b2cbeded49645ae3c8d1405c29ddfbceac1545c87a3f9580a9e96", size = 255097, upload-time = "2026-08-15T08:19:59.056Z" }, + { url = "https://files.pythonhosted.org/packages/f5/7b/ade0a122600319dfa0b1000ab0f9731c94a817904cf3c5de408c73a4ede7/charset_normalizer-3.5.1-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b39b69b347e5e47a3b5b8cfc005c68c1ba347474e3960236c4944a8ecd174962", size = 250166, upload-time = "2026-08-15T08:20:00.612Z" }, + { url = "https://files.pythonhosted.org/packages/75/9c/019fbb9f4834491a160951349b1a3714439376f66e5f7cf18b4f18f0c7aa/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a2028475ba855475b8b4d3cfeb4994269c967aea8b9892dfba907f4263a863a3", size = 241821, upload-time = "2026-08-15T08:20:02.321Z" }, + { url = "https://files.pythonhosted.org/packages/2b/b8/11d4840bfc99330cc7fbcc2681ee5a044553a6e77655508d8f9b2bff7b34/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:36047af20e17097c3bb9476c2b7655f2f7aa51322c0ba58c07695bedf755a950", size = 232529, upload-time = "2026-08-15T08:20:04.008Z" }, + { url = "https://files.pythonhosted.org/packages/18/96/2b3a21492d9f65171ac75d872f5018260013d00bfa0ff70ec9f179148cbd/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:4c4fb141a727957c93edfe5c32a26ceb6b5f6461d67146e2d39f51e16170bea8", size = 260348, upload-time = "2026-08-15T08:20:05.877Z" }, + { url = "https://files.pythonhosted.org/packages/d6/aa/a69a2028e8bd052476c245460ab19d7de595de084dd968f2d75cd50c3e25/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:2f293479cce755c75f1697e87c409b7ae4c555c7dfecb6e988ad13abba943031", size = 247234, upload-time = "2026-08-15T08:20:07.487Z" }, + { url = "https://files.pythonhosted.org/packages/35/8a/3d130aeabcaf3d2466af76b7b141c08d9e89c9016ab4b7cdd0f7dc2d1c62/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:3588e376b3ea2eea84976f67273d679f229e24c66dce7b82ae45aef04ff6e072", size = 256917, upload-time = "2026-08-15T08:20:09.142Z" }, + { url = "https://files.pythonhosted.org/packages/80/c2/a7379b840292d0c1ab9fbd17d1f3967aa81794dc95bc74be8999d7fedcf7/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e199fb99720074809a7720f1c0b4d919eea8b87e88713e0f8f602f7bef543d9d", size = 254846, upload-time = "2026-08-15T08:20:10.727Z" }, + { url = "https://files.pythonhosted.org/packages/01/65/d43b714731bb2f40d4053dfa00ecfc1c5a301f8e3316c5db3a09af59fe94/charset_normalizer-3.5.1-cp37-abi3-win32.whl", hash = "sha256:dd732602a7009217f658d5863d12d79d373a4de0eebc111094bcdd3bb8e0a6cc", size = 174216, upload-time = "2026-08-15T08:20:12.334Z" }, + { url = "https://files.pythonhosted.org/packages/35/4f/b911ed898b26a09789eba9c9200c999aff6c61b4bafaf4838e56d1a1e1a3/charset_normalizer-3.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:70055ff39b97c99e7ae40ea3e393fb62aa2e44dbd9b29f8d14f42fb0025c3959", size = 199764, upload-time = "2026-08-15T08:20:13.908Z" }, + { url = "https://files.pythonhosted.org/packages/f0/a7/920baf467bfd9bf689f3b318340f37aee4572a71f162bd8db51da55ba4fa/charset_normalizer-3.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:87e4f41d375c0b9be2fb5251aee4b8a689169e134535aed81bf085c3b647451e", size = 287318, upload-time = "2026-08-15T08:20:15.551Z" }, + { url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658, upload-time = "2026-08-15T08:20:43.306Z" }, +] + +[[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" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +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.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/ad/5d6702db60b1e40b41ef513b6967ff5848f307d50f8449baf1634f5908f1/cryptography-50.0.1.tar.gz", hash = "sha256:5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20", size = 880381, upload-time = "2026-08-25T19:45:45.499Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/19/797e2aaac9df6a66f1550f49979dc1b1e39ecd2077501c30efa81e8d5d67/cryptography-50.0.1-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986", size = 4010153, upload-time = "2026-08-25T19:44:03.155Z" }, + { url = "https://files.pythonhosted.org/packages/90/34/9ce9a62ed9dc82ca9fd6a34445b6904af56e5f38b3eae2ed32e49c36053d/cryptography-50.0.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:53e279950892dc102c6b4e52af03ae5ea92fac572a1ddab78ca73a997f62b69f", size = 4723133, upload-time = "2026-08-25T19:44:05.461Z" }, + { url = "https://files.pythonhosted.org/packages/57/26/e6d4fc8512a51a5f9ee7bfdbfb853bce1197087df40c9ad993ad370b846f/cryptography-50.0.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ff838d62ec1bfce4f9ba7fa16f4a7b554cd8d0c299e6be37502161a660c84eef", size = 4712478, upload-time = "2026-08-25T19:44:07.375Z" }, + { url = "https://files.pythonhosted.org/packages/e6/de/d3cdc2815697aae84126cbd6a030ca7b6b452e28a88b501b836bd3aa7a86/cryptography-50.0.1-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e74591e283fe6eb956416c929eb58262a719fe0311fd9054c62c3350ed8760d8", size = 4730726, upload-time = "2026-08-25T19:44:09.294Z" }, + { url = "https://files.pythonhosted.org/packages/55/32/38c0d344b98c06d34b5df8946565a9c0d6dbf32c8e0730a7f05f0a3c6cab/cryptography-50.0.1-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5fe002589592ed749ce77fe0695fcbd3500dd61d7d6db5858a7544c612fa8e45", size = 5353524, upload-time = "2026-08-25T19:44:11.96Z" }, + { url = "https://files.pythonhosted.org/packages/e1/1b/82f0f0d8858d4432be1af790477edf62aef90324041aa07c57e57bef1af7/cryptography-50.0.1-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:51593d180cf6d179bde5c5d065bed81386b1f381656ae7d042b7ffc87a9895ad", size = 4746720, upload-time = "2026-08-25T19:44:14.051Z" }, + { url = "https://files.pythonhosted.org/packages/29/ba/042ca458b8c64348c768284b5d23e69b92ed53d057ab779fee628564676d/cryptography-50.0.1-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:359e62deae718bce96170e223fdcb6357e4fbd3bb7a3a75f4430763532560e49", size = 4361866, upload-time = "2026-08-25T19:44:16.167Z" }, + { url = "https://files.pythonhosted.org/packages/39/3b/e96c1ef71edef71057c7e3c3d982ce8fda554e0c52d0cc19c18845cde3eb/cryptography-50.0.1-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:e2ca8fd1b6b4b82a1c4cb02841d0837e3c12336c2e24b520ab8ab3b969733d8f", size = 4730028, upload-time = "2026-08-25T19:44:18.085Z" }, + { url = "https://files.pythonhosted.org/packages/e3/38/45abd72ef63f2e7d0754a6cacf97bd8b69512ace7f6130d24c39ece65da2/cryptography-50.0.1-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:76de83fbd91ac49c0feaaa983d0748fd7a53176afac5fb3bf7478d244f0eb527", size = 5308405, upload-time = "2026-08-25T19:44:20.197Z" }, + { url = "https://files.pythonhosted.org/packages/85/66/6ccca4722987ddedaa7fc9c3f4708af7431f5535666c174350830888c6b7/cryptography-50.0.1-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:51afcfceb15597cf2635068e4ac9a56b2abde622edde17f37d85fd7b5306497a", size = 4746230, upload-time = "2026-08-25T19:44:22.376Z" }, + { url = "https://files.pythonhosted.org/packages/13/0e/b1f92e013228111413f2e6743948b80bc24dfd3c1b87ba98ceea16f5df89/cryptography-50.0.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:be224a65493ec5b74a158ff22a5522ce4a5ca1e543c647a3a4730d4a09e5f959", size = 4862596, upload-time = "2026-08-25T19:44:24.472Z" }, + { url = "https://files.pythonhosted.org/packages/7e/22/c3654cccc856e9d682817b04ac3ee79731cb09ca6f95996a95c904de2883/cryptography-50.0.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9ebcdd5519be9b652a46f507817a74591774fc3d6923ac364e4dfa64e36b291b", size = 5014082, upload-time = "2026-08-25T19:44:26.709Z" }, + { url = "https://files.pythonhosted.org/packages/42/8b/cb12b1b60c91b074ca6bf0fdd59aa8f10d8bc5f73af8faece86ef0421b37/cryptography-50.0.1-cp311-abi3-win_amd64.whl", hash = "sha256:aed8db4f6d71c51efb89530e12d9464e7bf2923d46c3205dc794a2a93f8c0648", size = 3842826, upload-time = "2026-08-25T19:44:28.784Z" }, + { url = "https://files.pythonhosted.org/packages/84/a9/ee16a903f13755e914d1eecc482fe64d1f10761c3960e5d8fa6837377aff/cryptography-50.0.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0", size = 4035307, upload-time = "2026-08-25T19:44:58.305Z" }, + { url = "https://files.pythonhosted.org/packages/5e/a5/9ec7e81e8526c0d7a387d73386b2daed3f39e10d81a85930bd1b6bfba65c/cryptography-50.0.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:05ba322c4da95b262a212c345af888ef2c37c88c0509756ea00a0e6d68850f23", size = 4751900, upload-time = "2026-08-25T19:45:00.401Z" }, + { url = "https://files.pythonhosted.org/packages/7e/3c/0e77bd5ffcf078e9dd27d3074aad6c030d9b10d0bf69329d573c927a188c/cryptography-50.0.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e22dfed744bd4002e909464cb23d2f0b05c6f3113a79ef2e9864a53db737c733", size = 4738357, upload-time = "2026-08-25T19:45:02.786Z" }, + { url = "https://files.pythonhosted.org/packages/27/3a/3c5f80daa4dcd47323c7af8a2fcb90de27a33564d4fcac69846c0972691a/cryptography-50.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4c4188f7c0cf655be5c06342b817ed0f9595b69ffa2b12026e5353eed29dea88", size = 4758474, upload-time = "2026-08-25T19:45:04.889Z" }, + { url = "https://files.pythonhosted.org/packages/6e/2b/214cf0cf93db9628c3c20c896b229f327f6fb1b20e4b3743d8ad3f00af8b/cryptography-50.0.1-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:2ebbfb0f1fed745e91796e3e1080a1440423fdae8ece1b995a1d80883a409054", size = 5375862, upload-time = "2026-08-25T19:45:07.163Z" }, + { url = "https://files.pythonhosted.org/packages/d6/51/3f9701867a46b6c1740c9b52fc4d3bed6cbdcfedcc9b6e64305c07f39cff/cryptography-50.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:407fe2b6db00939c05c0e945e9914238f2f0a430974839429dafc82b1ee6bee5", size = 4772942, upload-time = "2026-08-25T19:45:09.396Z" }, + { url = "https://files.pythonhosted.org/packages/0d/5c/13ea642e08e2544d0f5396122055f4820cfacb3203562197b5967125ea97/cryptography-50.0.1-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:2b34d76a652ea2b6faf777c35df230c5637842cd904e04f16230c3f9f03e4361", size = 4383347, upload-time = "2026-08-25T19:45:11.659Z" }, + { url = "https://files.pythonhosted.org/packages/84/d5/7d1fe1cb93f91c428093ff234e128c89ba8ea61a6f26aab406081f9b996e/cryptography-50.0.1-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:01f41478cf33fc605a6a089cd56d28b45c6c0b45a1928b61797f2621a04bac71", size = 4758050, upload-time = "2026-08-25T19:45:13.745Z" }, + { url = "https://files.pythonhosted.org/packages/dd/04/557fc5ead96a829e0bc812a3b9dc4a52a2f27e4f7f5950da7ff27653a805/cryptography-50.0.1-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:fc3ed7ebd2a8c96f5b166de0ab9b624996bef3b07bbeb19364dfb78222c22c80", size = 5332955, upload-time = "2026-08-25T19:45:16.193Z" }, + { url = "https://files.pythonhosted.org/packages/8c/eb/5d7124083e8d8cda8f5b348f544b71ad6f707ad63193758ef4d8e569da02/cryptography-50.0.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dde0a357190eb3b1da1bb9ab750e9c85cba82ca5977aa0836cbb94e92611239", size = 4772694, upload-time = "2026-08-25T19:45:18.315Z" }, + { url = "https://files.pythonhosted.org/packages/63/8e/f1f955e0921dd2b6d22eae7e8d24a4c4b638d10735ffbf6a71f99eb0fcb8/cryptography-50.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd3718b960d0b5dd213cdf03f3bcb7000e69dda0de8b956061947ff6bcff5558", size = 4888413, upload-time = "2026-08-25T19:45:20.4Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ab/89e2b798d2c3925f82e2bb72d5979f3d2f6da2dd22ef4a8cd8b70d920039/cryptography-50.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2a93d05e34d5f67fba6f891fe85d929999baa7195e853923ea6d7576c9e68c5e", size = 5044355, upload-time = "2026-08-25T19:45:22.353Z" }, + { url = "https://files.pythonhosted.org/packages/99/89/87ef49ffe383ef4e147d27b7bf2088fb0b54ea409dd87b5a89442e5828a5/cryptography-50.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:55d16b1ef3ee0958d893a977b19777887e546c9954ea81b200c3301a864013f2", size = 3875429, upload-time = "2026-08-25T19:45:24.418Z" }, + { url = "https://files.pythonhosted.org/packages/c7/27/8d207af749c453ee17ea087340b3f2b4adef75aadd1d277b1b129bdda84e/cryptography-50.0.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:9cb3cb952cf5a8abd50c782a98a89d71699715e802fe349704b47f2425b42a94", size = 3974350, upload-time = "2026-08-25T19:45:26.551Z" }, + { url = "https://files.pythonhosted.org/packages/14/9a/6d3a4d7852e22d657438b7bf51f66102c7d71c0e1fafeec652281d0403e5/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5fe939deeb161024a6be98229c953b6591fef1f41214497a78fe793a244c017f", size = 4698675, upload-time = "2026-08-25T19:45:28.658Z" }, + { url = "https://files.pythonhosted.org/packages/73/35/5c3717edf9e68a0550ce04e28eab493fe545eccd81742af03f6a75fe260b/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fb4b9672d389c738b175c4166e78310f8a70358886aacd9173ee03a85ffdc671", size = 4707410, upload-time = "2026-08-25T19:45:30.816Z" }, + { url = "https://files.pythonhosted.org/packages/1d/e0/e786934472e3ac4ecdecc7b129a0ca1a2a40dffdafcf2c3ea9d4397f8def/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d63ae8f6481fec907ac0f588eee8a90aefde112c633131fe540e5711ddbb5a4e", size = 4698378, upload-time = "2026-08-25T19:45:33.043Z" }, + { url = "https://files.pythonhosted.org/packages/51/cf/5b3f53a0b74d122f023476ede40ba5d3e70d5cf475f73b899740d26a4fb2/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:804728ce710890870f3aaa344b2e161172d258d768ac139d02cfd9092d0d94e6", size = 4706889, upload-time = "2026-08-25T19:45:35.086Z" }, + { url = "https://files.pythonhosted.org/packages/71/44/711e61f7d014be825ef79b285b047292d1bf893732ac1bc030a351fb517f/cryptography-50.0.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:693c99b49bd37d0d096e4334c10232c77248c415b98d35236094cdf96d57258b", size = 3824006, upload-time = "2026-08-25T19:45:37.281Z" }, +] + +[[package]] +name = "cyclopts" +version = "5.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "docstring-parser" }, + { name = "rich" }, + { name = "rich-rst" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f6/32/5f5d814ad9a903c4e45273baabc48fdfdf5f85b39c7c2434c2d247d3b062/cyclopts-5.0.0.tar.gz", hash = "sha256:8bee8822319f5cd90711f568aec54a0a02bd3571ddff45c94aa62405beed38b6", size = 236617, upload-time = "2026-09-23T23:44:54.128Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/92/4c/8dd6c8056bc6f8ba5f20452bfe32425a7f3fdb798c112e38c6cecda375ac/cyclopts-5.0.0-py3-none-any.whl", hash = "sha256:69c5d98bd48827a0f7c663b76f966f730652cbc48daa7625f1e69ae429b82376", size = 278147, upload-time = "2026-09-23T23:44:52.344Z" }, +] + +[[package]] +name = "distlib" +version = "0.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c9/02/bd72be9134d25ed783ecbbc38a539ffaefbf90c78418c7fb7229600dbac7/distlib-0.4.3.tar.gz", hash = "sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed", size = 615141, upload-time = "2026-06-12T08:04:52.847Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/08/9c41fb51ab5b43eb21674aff13df270e8ba6c4b29c8624e328dc7a9482af/distlib-0.4.3-py2.py3-none-any.whl", hash = "sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b", size = 470628, upload-time = "2026-06-12T08:04:50.506Z" }, +] + +[[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 = "dnspython" +version = "2.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, +] + +[[package]] +name = "docstring-parser" +version = "0.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/4d/f332313098c1de1b2d2ff91cf2674415cc7cddab2ca1b01ae29774bd5fdf/docstring_parser-0.18.0.tar.gz", hash = "sha256:292510982205c12b1248696f44959db3cdd1740237a968ea1e2e7a900eeb2015", size = 29341, upload-time = "2026-04-14T04:09:19.867Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a7/5f/ed01f9a3cdffbd5a008556fc7b2a08ddb1cc6ace7effa7340604b1d16699/docstring_parser-0.18.0-py3-none-any.whl", hash = "sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b", size = 22484, upload-time = "2026-04-14T04:09:18.638Z" }, +] + +[[package]] +name = "email-validator" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dnspython" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f5/22/900cb125c76b7aaa450ce02fd727f452243f2e91a61af068b40adba60ea9/email_validator-2.3.0.tar.gz", hash = "sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426", size = 51238, upload-time = "2025-08-26T13:09:06.831Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/15/545e2b6cf2e3be84bc1ed85613edd75b8aea69807a71c26f4ca6a9258e82/email_validator-2.3.0-py3-none-any.whl", hash = "sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", size = 35604, upload-time = "2025-08-26T13:09:05.858Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "fastmcp" +version = "3.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "authlib" }, + { name = "cyclopts" }, + { name = "exceptiongroup" }, + { name = "httpx" }, + { name = "jsonref" }, + { name = "jsonschema-path" }, + { name = "mcp" }, + { name = "openapi-pydantic" }, + { name = "opentelemetry-api" }, + { name = "packaging" }, + { name = "platformdirs" }, + { name = "py-key-value-aio", extra = ["filetree", "keyring", "memory"] }, + { name = "pydantic", extra = ["email"] }, + { name = "pyperclip" }, + { name = "python-dotenv" }, + { name = "pyyaml" }, + { name = "rich" }, + { name = "uncalled-for" }, + { name = "uvicorn" }, + { name = "watchfiles" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d0/32/4f1b2cfd7b50db89114949f90158b1dcc2c92a1917b9f57c0ff24e47a2f4/fastmcp-3.2.0.tar.gz", hash = "sha256:d4830b8ffc3592d3d9c76dc0f398904cf41f04910e41a0de38cc1004e0903bef", size = 26318581, upload-time = "2026-03-30T20:25:37.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4f/67/684fa2d2de1e7504549d4ca457b4f854ccec3cd3be03bd86b33b599fbf58/fastmcp-3.2.0-py3-none-any.whl", hash = "sha256:e71aba3df16f86f546a4a9e513261d3233bcc92bef0dfa647bac3fa33623f681", size = 705550, upload-time = "2026-03-30T20:25:35.499Z" }, +] + +[[package]] +name = "filelock" +version = "4.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4f/b8/9ba8f569df649beb7058db5eb392a5f779bdbc3b82cf3942f0be439fb99e/filelock-4.0.3.tar.gz", hash = "sha256:87296d60478e14204fd9406e79831400fef76693bae2895deec236c98e87a8aa", size = 244309, upload-time = "2026-09-23T23:40:22.569Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7a/6d/db8b86e168fef0cf904737e275bccb683558088ef971e92d3b41ce980699/filelock-4.0.3-py3-none-any.whl", hash = "sha256:30cd166e2aee2c7534ce2c33c6367c4cd051b8368e20e2c4eb0c34f699bacfab", size = 108444, upload-time = "2026-09-23T23:40:20.819Z" }, +] + +[[package]] +name = "google-auth" +version = "2.58.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "pyasn1-modules" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/52/aa/8055c583f8eb69dd4544f0d6a83e22d2f01ab38bd2ce848ea599c259a2d2/google_auth-2.58.1.tar.gz", hash = "sha256:1480461d8b2347e679af758f4003700ea79a59b603c9134e18bfa95e8004ee70", size = 380459, upload-time = "2026-09-24T21:52:00.171Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7a/f0/cba0ac98e98e01849b19f7504eb3aeede741e72dfc31612e46d5f0dd981c/google_auth-2.58.1-py3-none-any.whl", hash = "sha256:66a63572d0ab629554768544df04018d79178c0bd7439ba31683ac576b79024d", size = 262483, upload-time = "2026-09-24T21:51:58.297Z" }, +] + +[package.optional-dependencies] +requests = [ + { name = "requests" }, +] + +[[package]] +name = "google-genai" +version = "2.25.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/62/0a/a3b7856ca840031d4393dbdd97b67fe811b20061315ed68b67b5c85ca80d/google_genai-2.25.0.tar.gz", hash = "sha256:ab603baa5eee0205926ad0f8d7f93e0400df6d67650e99c33e01ab228ea16ad6", size = 699564, upload-time = "2026-09-22T17:23:01.238Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/5d/a8/178dbb9d1d6cac721b01592e291146a024bae5ee3224e36569348921dd6c/google_genai-2.25.0-py3-none-any.whl", hash = "sha256:2e8f3a5f76ed00d5ffc3153f6089bc7d3511054eed53ad9cfc6095a7dc59b028", size = 1159631, upload-time = "2026-09-22T17:22:59.291Z" }, +] + +[[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.13.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "h11" }, + { name = "truststore" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cb/f3/1db7aa2bc2524062192bb0e0323969492d1883152a232fe36eea65f4e35c/httpcore2-2.13.1.tar.gz", hash = "sha256:e0aa977abe17e69a3b820a24542a6fa88702676d83880b8d194dcd18408e5103", size = 68071, upload-time = "2026-09-23T07:47:22.372Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/09/ba/a4568248771ce81957bfb7cc600264a40fbcda092391ee1c415c50be4bea/httpcore2-2.13.1-py3-none-any.whl", hash = "sha256:e1e05d4f25f7d7d496bfb96748f6f4b67657b03da069b3a68c36069f3db73d0a", size = 83423, upload-time = "2026-09-23T07:47:19.365Z" }, +] + +[[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 = "httpx-sse" +version = "0.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" }, +] + +[[package]] +name = "httpx2" +version = "2.13.1" +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" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d5/44/474bef2a0e9d90f1715d32cb98b0738695ca17ba324095fb2497ed7fbd59/httpx2-2.13.1.tar.gz", hash = "sha256:e48744a19e3af5ee48313d0ce5fe941d5422fae5705ea922a4aabf94d7800dfa", size = 100405, upload-time = "2026-09-23T07:47:23.052Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d8/9c/6fe8931fd9f381042a9e4c7d5a7b4cbf7016b252bec0c99a49fce42c3326/httpx2-2.13.1-py3-none-any.whl", hash = "sha256:6dff50fabc270ee5fd25d845d0b078ed20564579744d6d962850975996d2f9a4", size = 95597, upload-time = "2026-09-23T07:47:20.995Z" }, +] + +[[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 = "hud" +version = "0.6.17" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anthropic" }, + { name = "asyncssh" }, + { name = "asyncvnc" }, + { name = "fastmcp" }, + { name = "google-genai" }, + { name = "httpx" }, + { name = "httpx2" }, + { name = "mcp" }, + { name = "openai" }, + { name = "packaging" }, + { name = "pillow" }, + { name = "prompt-toolkit" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "python-dotenv" }, + { name = "questionary" }, + { name = "rich" }, + { name = "typer" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0a/42/bb291ffe0c3748b4aad72fac1aa778113312b15b5198e30488e6639cfe5e/hud-0.6.17.tar.gz", hash = "sha256:76dbdd3c8251b65d8407f6080d1d4d17909ed3a013f6a5de5f710a6393bb1909", size = 548264, upload-time = "2026-09-14T07:13:43.274Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/54/d685413b1322cf28cd3884c7e6ddb7a57ac6ba1b360359d88f6dc9be6843/hud-0.6.17-py3-none-any.whl", hash = "sha256:f7023c7d72987d45b08bff76c76f5851f644f84fcd7da6fdd8ef3da2bb744a84", size = 656048, upload-time = "2026-09-14T07:13:41.841Z" }, +] + +[[package]] +name = "identify" +version = "2.6.19" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567, upload-time = "2026-04-17T18:39:50.265Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397, upload-time = "2026-04-17T18:39:49.221Z" }, +] + +[[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 = "importlib-metadata" +version = "9.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "zipp" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6f/7e/1e7e8dc30634b93ebb3d58a3dea569ad146e656218d3960ab04f62047b29/importlib_metadata-9.0.1.tar.gz", hash = "sha256:ab830580bc0ef3db61ce8fae716389e5462b67e033018bab6d8f80ef17172f99", size = 59124, upload-time = "2026-08-28T15:30:34.646Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/55/ecca97ae19075f1fac62def77731e7f535e6c1fb8f92ff08160c5e6dade8/importlib_metadata-9.0.1-py3-none-any.whl", hash = "sha256:bba5600596a7e21f3eef53281cf28d6a5195634d2f2b78ff9501a3272c6eaab0", size = 27920, upload-time = "2026-08-28T15:30:33.433Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "jaraco-classes" +version = "3.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "more-itertools" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/c0/ed4a27bc5571b99e3cff68f8a9fa5b56ff7df1c2251cc715a652ddd26402/jaraco.classes-3.4.0.tar.gz", hash = "sha256:47a024b51d0239c0dd8c8540c6c7f484be3b8fcf0b2d85c13825780d3b3f3acd", size = 11780, upload-time = "2024-03-31T07:27:36.643Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/66/b15ce62552d84bbfcec9a4873ab79d993a1dd4edb922cbfccae192bd5b5f/jaraco.classes-3.4.0-py3-none-any.whl", hash = "sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790", size = 6777, upload-time = "2024-03-31T07:27:34.792Z" }, +] + +[[package]] +name = "jaraco-context" +version = "6.1.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "backports-tarfile", marker = "python_full_version < '3.12'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/50/4763cd07e722bb6285316d390a164bc7e479db9d90daa769f22578f698b4/jaraco_context-6.1.2.tar.gz", hash = "sha256:f1a6c9d391e661cc5b8d39861ff077a7dc24dc23833ccee564b234b81c82dfe3", size = 16801, upload-time = "2026-03-20T22:13:33.922Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/58/bc8954bda5fcda97bd7c19be11b85f91973d67a706ed4a3aec33e7de22db/jaraco_context-6.1.2-py3-none-any.whl", hash = "sha256:bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535", size = 7871, upload-time = "2026-03-20T22:13:32.808Z" }, +] + +[[package]] +name = "jaraco-functools" +version = "4.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "more-itertools" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6c/1f/c23395957d41ccf27c4e535c3d334c4051e5395b3752057ba4cbaec35c56/jaraco_functools-4.6.0.tar.gz", hash = "sha256:880c577ec9720b3a052d5bc611fb9f2269b3d87902ef42440df443b88e443280", size = 20837, upload-time = "2026-07-14T01:28:02.544Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/36/ecc85bc96c273dc8a11273ed4782272975e6338d4a3e9228621175edf0e3/jaraco_functools-4.6.0-py3-none-any.whl", hash = "sha256:99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30", size = 11677, upload-time = "2026-07-14T01:28:01.59Z" }, +] + +[[package]] +name = "jeepney" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7b/6f/357efd7602486741aa73ffc0617fb310a29b588ed0fd69c2399acbb85b0c/jeepney-0.9.0.tar.gz", hash = "sha256:cf0e9e845622b81e4a28df94c40345400256ec608d0e55bb8a3feaa9163f5732", size = 106758, upload-time = "2025-02-27T18:51:01.684Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b2/a3/e137168c9c44d18eff0376253da9f1e9234d0239e0ee230d2fee6cea8e55/jeepney-0.9.0-py3-none-any.whl", hash = "sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683", size = 49010, upload-time = "2025-02-27T18:51:00.104Z" }, +] + +[[package]] +name = "jiter" +version = "0.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9c/1f/8176d92e001f86505424b41664032ae26a882bc9ca41a32c803f373f9195/jiter-0.17.0.tar.gz", hash = "sha256:03e432f226a453851079fb84cd17c6da9991eab723e28d716f14ae3d906e0c12", size = 229037, upload-time = "2026-09-12T15:14:14.253Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/50/17afdaffcc8af4bf4fddf2b6c26d066553aa2221983f2affcde435fc2532/jiter-0.17.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:cfafd7be8b16ceadd298db542cead37cddc211c4c49e04ad2596924df18625b1", size = 290699, upload-time = "2026-09-12T15:11:30.085Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/c185d32d5b3657ad84da26c84a9eb15f00aa1b39d6882fcc0052dba2d7c2/jiter-0.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8adca2e793288e5f1bb29279bb439d0d3cfbb50eddca7e7e6ffd42ff4f482406", size = 324246, upload-time = "2026-09-12T15:11:31.3Z" }, + { url = "https://files.pythonhosted.org/packages/24/7a/8b8903bfe91a90a8fa1ec9b45d9fda5b6287a386693b69d720a882d73f3c/jiter-0.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c692d567ba206c7cca38c9d1d0ccc70c9786290173c184d871ca12e9981ed7", size = 343275, upload-time = "2026-09-12T15:11:32.758Z" }, + { url = "https://files.pythonhosted.org/packages/a2/5d/6821fae2abc71a3c3a84bef8598d31fc4f27d9edfb55bd8f6c08afb8ef93/jiter-0.17.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:81c83c0abe614446a283d994d2c07c4f58632dea2cdf66ba9e2921bb8ccd593e", size = 328034, upload-time = "2026-09-12T15:11:33.9Z" }, + { url = "https://files.pythonhosted.org/packages/f3/51/8e7a963b1c2dfdc01d6228b004f50a2a3d7c46f0549d7b096a5d15ef81d5/jiter-0.17.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:073dc68c1a700c8fc480e877864a6b6ffc887533e261f4380c08c16bf09d057a", size = 342457, upload-time = "2026-09-12T15:11:36.414Z" }, + { url = "https://files.pythonhosted.org/packages/73/27/8b2a267e3bda45d9298331cacfe3521e761f0a2b05ad10a23c6548d08358/jiter-0.17.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:492f37230bbf9581ab2c17bcda862c249afb9ae2e3ab2dd6db59943bc4cc3153", size = 351271, upload-time = "2026-09-12T15:11:37.692Z" }, + { url = "https://files.pythonhosted.org/packages/4a/8f/5c74e5e142a6736833d7a991ab04d5c0738038dc44db05af0bb3cd2559e8/jiter-0.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5888fe5abc1ca2fa834a3e1b4c7ef0dcece286a7d7e95a609ef0934b777b9fc9", size = 346052, upload-time = "2026-09-12T15:11:39.722Z" }, + { url = "https://files.pythonhosted.org/packages/98/9c/f54920f06d1696e80b1be841d56412871c6856b1b1e3b541b1ed35346554/jiter-0.17.0-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:84ac78df457e1ee3f7e733bd114823302ae8c5ad5542d7e6647d92ffaa090a04", size = 328915, upload-time = "2026-09-12T15:11:41.065Z" }, + { url = "https://files.pythonhosted.org/packages/21/53/080f126863bceb055db9f1fd5431485eb493b35545a3c35e961ac18cd924/jiter-0.17.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7573e80232c5bcf80c24c038cf7e53a463f5c3b1dd1dd4109d66304f4dccc233", size = 337240, upload-time = "2026-09-12T15:11:42.356Z" }, + { url = "https://files.pythonhosted.org/packages/f0/76/3ab742823a0e0e70e143c6c90a482d9d90396ac2445e7b9483eb7245d3b5/jiter-0.17.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:11902505d401691720f5785c15b02204248526edee11b635cd6c40cd52b81599", size = 484917, upload-time = "2026-09-12T15:11:43.549Z" }, + { url = "https://files.pythonhosted.org/packages/14/e0/8ca71bc8b9cc9ed96c9da565863e00f3bb875a8fb82abcf03e975e067902/jiter-0.17.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:64846211a2debe7c071d2146d2283d2b0c1c93dc8fd5fb7794faac2ca6061b5c", size = 521868, upload-time = "2026-09-12T15:11:44.704Z" }, + { url = "https://files.pythonhosted.org/packages/c1/02/81f8719dcedb75713082a2048405376c81f6546b75af8167f3bba01a1ed0/jiter-0.17.0-cp311-cp311-win32.whl", hash = "sha256:c19b9357309b8cc6de8a48fca8e44a8c9c2feaaa2f5896d037fa505d48fcab80", size = 187844, upload-time = "2026-09-12T15:11:45.874Z" }, + { url = "https://files.pythonhosted.org/packages/3e/8c/59693f348488f01ed12d862e99ab8da14961152d3e9c39b9b1ef363f3572/jiter-0.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:e654b6b04e39c9cb19cb8b04c6ddf1f2db07751fa14156413969fd78bad0e5cb", size = 231402, upload-time = "2026-09-12T15:11:47.083Z" }, + { url = "https://files.pythonhosted.org/packages/fe/89/fb35e286463cb9f01edc2c4e47df6e5477ee36bca5096414e9ea87985588/jiter-0.17.0-cp311-cp311-win_arm64.whl", hash = "sha256:3ad556afc289f15d2b181b941982d01f06190863c07440185b9f354e1bd2def3", size = 187006, upload-time = "2026-09-12T15:11:48.245Z" }, + { url = "https://files.pythonhosted.org/packages/aa/f8/07bd8c3a23f7a8a6875e6a820bbffe1483a18f18f9398a91b5495123176e/jiter-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:ebf918dfd6a74adc1b9ad71f63c4ab00902fcd3b7fd39f2e24d871db8d713b91", size = 291633, upload-time = "2026-09-12T15:11:49.431Z" }, + { url = "https://files.pythonhosted.org/packages/0e/5e/0de4c6f84ffefa6809ffc2d550b9a314365acf7e7ec9b6c7375d49047900/jiter-0.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:61aed66ee042b3b49ef85fdf75714234d055d89d8496ac1c6e47f89e7a30d5e4", size = 321695, upload-time = "2026-09-12T15:11:52.727Z" }, + { url = "https://files.pythonhosted.org/packages/20/ac/befe2e82065bee37a0252081666ed2f48c1ac5f5c6c318c2de8168ba393d/jiter-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76eb4a5c20e86f9f848286f167024890f2862258a965d254774deb7fc1545ca1", size = 341967, upload-time = "2026-09-12T15:11:54.231Z" }, + { url = "https://files.pythonhosted.org/packages/9f/cd/9797c1e529746750ae589da7c1a8c24373f00d88e11a989f9e5eb1959079/jiter-0.17.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bcc064f99183a9cbe7f26ed648c352031a74145cd61ed75d34632c73eb46a5a8", size = 326546, upload-time = "2026-09-12T15:11:55.41Z" }, + { url = "https://files.pythonhosted.org/packages/d9/fd/e6914c38d6347bab4ebff2b1f0c0f191db276e7a1d5c376176757da42fe3/jiter-0.17.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73b64e69c4150748e020356d958af94bec33c70a0a93d665cfa8f6d580fe1a63", size = 340995, upload-time = "2026-09-12T15:11:58.211Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7d/611b3abf6f88945b5474da5cdc6d1a185e805ac9bf446bb7766dcda6ea87/jiter-0.17.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0bc7f684b65bcda9c20434267577db71bf9905ceddd32b60d1d93278d8c8d3a", size = 352188, upload-time = "2026-09-12T15:11:59.414Z" }, + { url = "https://files.pythonhosted.org/packages/52/f8/b6e513ecbdf3b3cebe587c2279281ecf775b729a58cf4cc7bdf898ded029/jiter-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c21265b251d99bbb40080d178a8953e35601d3a1564e05c4de4c0d2ca616797", size = 345025, upload-time = "2026-09-12T15:12:00.697Z" }, + { url = "https://files.pythonhosted.org/packages/28/a8/fe26d06c5a6c5a4cfe703c5154c8a140da1305671eb3681aba9422d4f393/jiter-0.17.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:f3d7f7b34114f7ddc6d72a8e882d49de636b35d9fd12b4d420d3c5729f6c9812", size = 329180, upload-time = "2026-09-12T15:12:01.831Z" }, + { url = "https://files.pythonhosted.org/packages/e1/58/e6d66a26af40a20e62486feb7e222fd50f6e7aaa4f107abd89675dcc835b/jiter-0.17.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5078ab00664307fab2019b522a93aeb191122789f085daf5fd9e362154021d4a", size = 335805, upload-time = "2026-09-12T15:12:03.056Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3e/96520aa2fef5ef831d95483a902140bfab83dcac9eaa74f7df61b5e50a1b/jiter-0.17.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:470e1b1e4c42f1ead2189166a299691871a2df5056c976e7fb96feafaf5f9d44", size = 484121, upload-time = "2026-09-12T15:12:04.414Z" }, + { url = "https://files.pythonhosted.org/packages/6a/8f/5d9d92fe538bf36ff481a2278c48147e59c1cf8eb2f7be665260665febe5/jiter-0.17.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6eb6aedeb7352b8f3b6af9cbd67983840165c00428e63f1b420a85885128ea31", size = 521310, upload-time = "2026-09-12T15:12:05.612Z" }, + { url = "https://files.pythonhosted.org/packages/50/06/a09f979b22e652afbc3de66c709b2ba92edcef555f7535ab937c86b4f21a/jiter-0.17.0-cp312-cp312-win32.whl", hash = "sha256:362bb47423886d45a9f705d2d9d4008c6eedd4e41eb1bab4e96fb6daa06b33fd", size = 185029, upload-time = "2026-09-12T15:12:06.994Z" }, + { url = "https://files.pythonhosted.org/packages/6c/d9/98265a005b2473ec2be5a84e2b64c2f65382c673879f1574845cd4bcd77c/jiter-0.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:9bd3caac219df476dd0cc3fe01d2f1581ed588906feac767abd9614c1c12f8b3", size = 227381, upload-time = "2026-09-12T15:12:08.823Z" }, + { url = "https://files.pythonhosted.org/packages/a8/11/2e05bf5a56e57a543ebb8f585074adf09383e99d7b062dac92eab1f4d57f/jiter-0.17.0-cp312-cp312-win_arm64.whl", hash = "sha256:36ee6e69027396664e59995b9a635a947a5304ee9837279584a0bb8145c8f6b8", size = 183610, upload-time = "2026-09-12T15:12:10.374Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3b/05a917204413e2e09906dfa35240c1021227aeb56c7305abea9562c598b4/jiter-0.17.0-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:eaba834b72d573547b9d966465b3394b749d5e14208cc70acb63aca37619ab33", size = 288143, upload-time = "2026-09-12T15:14:02.998Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e1/a1cd3c0cf8f79945939e4f8caae9990529f67d7f77f671769f73956329b9/jiter-0.17.0-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:51e1519d676a9f14dad9c2a411170d43b022ddb7989562df4e849b261ce127b2", size = 281847, upload-time = "2026-09-12T15:14:04.414Z" }, + { url = "https://files.pythonhosted.org/packages/72/b4/9b797679e09f4a46c32986aeb3670bd9bc562fc0b373c7a0ee5c5dce1206/jiter-0.17.0-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0ce4feb52493e3513335b2accdcd75605652e4632772d3c8c2f7b86954d7f39", size = 304797, upload-time = "2026-09-12T15:14:05.733Z" }, + { url = "https://files.pythonhosted.org/packages/25/4a/0d77415b27a00d970e4e710f7c1de62e96a11c4cab3ed1add0015af04626/jiter-0.17.0-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:29f49b325e0234e4ad9ecca5b861ffbd09b95ccac9bd46fa55841b6e56eea5fe", size = 307815, upload-time = "2026-09-12T15:14:07.105Z" }, + { url = "https://files.pythonhosted.org/packages/17/31/4bb27f54333d3b9ef1e5bd3312dc0b4bbe59c68bb0885fdb40583a6b1567/jiter-0.17.0-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:454c4997d73cc466c71fd565d91e603b0274e48ea0c6b0b7a7aee6967e4ceb7c", size = 288415, upload-time = "2026-09-12T15:14:08.455Z" }, + { url = "https://files.pythonhosted.org/packages/28/30/879570ecf82574eaea77c5eb10309f4b630dece5f2a556e9814a90ba3f2d/jiter-0.17.0-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:40d2c240f8f80b5b0f201b29f0ae129c81448c60c772227a41747b5e0026f6a2", size = 279113, upload-time = "2026-09-12T15:14:10.117Z" }, + { url = "https://files.pythonhosted.org/packages/77/7a/1f0b8a35fbd079a4f1752c31a15dc99cf277f863747c459be0af39e900e5/jiter-0.17.0-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e05f5adbf68c4bd11e1610f394034d984152988e84be6f8314235ce6f2139e5", size = 303708, upload-time = "2026-09-12T15:14:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/e1/8b/d76219ebdbcf3d4209d9d21a0810db4c8d0a6f88e3ee87d30bdea4e90d30/jiter-0.17.0-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2c0bf24c72fd0491405dce5d40194f2070e9021ce648c1a1d46234b93d848ff", size = 307147, upload-time = "2026-09-12T15:14:12.897Z" }, +] + +[[package]] +name = "joserfc" +version = "1.7.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/94/80fea1514b7c6d7d37804d3fe9ca81455f633347fc98731bd71ffe1faa17/joserfc-1.7.5.tar.gz", hash = "sha256:d5ff536e658e17664f8c1b1ab60dc4aa62aa973fcef1edd33cc44bda45d6f5ea", size = 234990, upload-time = "2026-08-29T13:05:42.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/c5/82addfd375e5ee6520644e0553e4aadde92d668c4fc99cc716d337fe7bb3/joserfc-1.7.5-py3-none-any.whl", hash = "sha256:add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159", size = 71269, upload-time = "2026-08-29T13:05:40.718Z" }, +] + +[[package]] +name = "jsonref" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/0d/c1f3277e90ccdb50d33ed5ba1ec5b3f0a242ed8c1b1a85d3afeb68464dca/jsonref-1.1.0.tar.gz", hash = "sha256:32fe8e1d85af0fdefbebce950af85590b22b60f9e95443176adbde4e1ecea552", size = 8814, upload-time = "2023-01-16T16:10:04.455Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/ec/e1db9922bceb168197a558a2b8c03a7963f1afe93517ddd3cf99f202f996/jsonref-1.1.0-py3-none-any.whl", hash = "sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9", size = 9425, upload-time = "2023-01-16T16:10:02.255Z" }, +] + +[[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-path" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "pathable" }, + { name = "pyyaml" }, + { name = "referencing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/79/cd02a4df6d9270efdc7d3feefe6edd730b0820c39eeaa107a2faee8322d5/jsonschema_path-0.5.0.tar.gz", hash = "sha256:493b156ba895c97602655b620a8456caa2ce08c1aa389f5a7addec065e6e855c", size = 19597, upload-time = "2026-05-19T20:45:00.971Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/2c/9e69d73c4297508be9e3b64a970ea3971b3eb8db64ffc5802d40bd25981f/jsonschema_path-0.5.0-py3-none-any.whl", hash = "sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2", size = 24077, upload-time = "2026-05-19T20:44:59.225Z" }, +] + +[[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 = "keyring" +version = "25.7.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "importlib-metadata", marker = "python_full_version < '3.12'" }, + { name = "jaraco-classes" }, + { name = "jaraco-context" }, + { name = "jaraco-functools" }, + { name = "jeepney", marker = "sys_platform == 'linux'" }, + { name = "pywin32-ctypes", marker = "sys_platform == 'win32'" }, + { name = "secretstorage", marker = "sys_platform == 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/4b/674af6ef2f97d56f0ab5153bf0bfa28ccb6c3ed4d1babf4305449668807b/keyring-25.7.0.tar.gz", hash = "sha256:fe01bd85eb3f8fb3dd0405defdeac9a5b4f6f0439edbb3149577f244a2e8245b", size = 63516, upload-time = "2025-11-16T16:26:09.482Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/db/e655086b7f3a705df045bf0933bdd9c2f79bb3c97bfef1384598bb79a217/keyring-25.7.0-py3-none-any.whl", hash = "sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f", size = 39160, upload-time = "2025-11-16T16:26:08.402Z" }, +] + +[[package]] +name = "keysymdef" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d3/c3db0b92a0ff39c3e08f168cd382c24bf021d4a96fc89b47a3e55294f883/keysymdef-1.2.0-py2.py3-none-any.whl", hash = "sha256:19a5c2263a861f3ff884a1f58e2b4f7efa319ffc9d11f9ba8e20129babc31a9e", size = 20146, upload-time = "2023-02-25T00:22:36.318Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "mcp" +version = "1.30.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx" }, + { name = "httpx-sse" }, + { name = "jsonschema" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { 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/ba/93/0142dc84a666daf8ad51a34268f34c12fd6fda4f3810c4be2504eecc8212/mcp-1.30.0.tar.gz", hash = "sha256:445414625fce5c295faa505bb11bacece661ab6f4028d57c935db57820b7a3e4", size = 680511, upload-time = "2026-09-07T14:34:15.845Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f5/f4/e58bc33317c92a0203664daaf00bf6f41166cc0149e5d6870a03f7cd004a/mcp-1.30.0-py3-none-any.whl", hash = "sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0", size = 234581, upload-time = "2026-09-07T14:34:14.266Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "more-itertools" +version = "11.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/de/1d/f4da6f02cdffe04d6362210b807146a26044c88d839208aec273bb0d9184/more_itertools-11.1.0.tar.gz", hash = "sha256:48e8f4d9e7e5878571ecf6f2b4e57634f93cd474cc8cfbd2376f2d11b396e30d", size = 145772, upload-time = "2026-05-22T14:14:29.909Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e8/3d/1087453384dbde46a8c7f9356eead2c58be8a7bf156bca40243377c85715/more_itertools-11.1.0-py3-none-any.whl", hash = "sha256:4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192", size = 72226, upload-time = "2026-05-22T14:14:28.824Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.6" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.12'", +] +sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/49/ec46835a70be8fa6446c495126ac84fdb28cb2558e1620ffb87a10c8b64c/numpy-2.4.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0280e0356c0829a18d9de1cb7eee50ec22ca639878d7240307ca0943d73cd2c4", size = 16969194, upload-time = "2026-05-18T23:33:13.503Z" }, + { url = "https://files.pythonhosted.org/packages/0e/0d/f5957185c0ee2f3e12f78715aa9e3b353fd83633316c8532b38faa37e3f6/numpy-2.4.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:110f8b71aacb688ec69062bb7f6938a0f8acb01b7c1c4beb453c65b6d234584d", size = 14964111, upload-time = "2026-05-18T23:33:17.795Z" }, + { url = "https://files.pythonhosted.org/packages/ad/40/40a40ee0ddf7ceb782c49af278894b686e586d65d8c1889c8b5da01a3d7d/numpy-2.4.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:4cfe66903cc32a9921a6733d96b19bb6abf310397581bbad89c228f5abaf0ee8", size = 5469159, upload-time = "2026-05-18T23:33:20.654Z" }, + { url = "https://files.pythonhosted.org/packages/63/13/f9a8046535cb21deae82f8d03de9617e08882d274fad2539630761888228/numpy-2.4.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8155154c7c691289fe18f510b5d4657c68c67989f293f0535a91360392ff6538", size = 6798936, upload-time = "2026-05-18T23:33:22.987Z" }, + { url = "https://files.pythonhosted.org/packages/33/a8/6fa8c1a345a8c85dbb21932c447bee07c30a2c2a3f31e369c0a84b300147/numpy-2.4.6-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ab0a9c4ffb1a6d95ef519fe4247dba8eb6b18ad93999f76b7f657039acabd47", size = 15966692, upload-time = "2026-05-18T23:33:26.62Z" }, + { url = "https://files.pythonhosted.org/packages/02/03/74fe2a4cb3817d94d86402f2506554130a2f01414e299b5a843e5a8a957f/numpy-2.4.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93", size = 16918164, upload-time = "2026-05-18T23:33:29.955Z" }, + { url = "https://files.pythonhosted.org/packages/c5/80/3615be3313f7e7696609bc194b9f0101da809df79e859bdb84e0cd043f46/numpy-2.4.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c2d37ab77531417474168eb79d6d80b14f821a966818505d03013d0833edb7a8", size = 17322877, upload-time = "2026-05-18T23:33:34.724Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ac/a691e0fe2675e370d0e08ff905adc49a1c8830e8cae03efe4477e92cd55d/numpy-2.4.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f407cb6b8e9d6d8c626bc73c945db1706035af8fd632295547bf1c9e46d092d6", size = 18651487, upload-time = "2026-05-18T23:33:38.217Z" }, + { url = "https://files.pythonhosted.org/packages/15/a7/9bc1cd626d7bf6869bfedf27b91b6ab5dd607758bf8e959d6fa80c6a59cb/numpy-2.4.6-cp311-cp311-win32.whl", hash = "sha256:ddea102b48f9e339f3948bf22040944184627a30fdf7f858667673b9c5f033c8", size = 6233945, upload-time = "2026-05-18T23:33:41.331Z" }, + { url = "https://files.pythonhosted.org/packages/c5/31/7fc6239c12bce7e931463251cca4426c465e1876ba3cc785402ef4dd8f4e/numpy-2.4.6-cp311-cp311-win_amd64.whl", hash = "sha256:1e254a00cdf42b1e4d5b3d68d33af63268d41340d8885df2ab6470f2e1500147", size = 12608406, upload-time = "2026-05-18T23:33:44.131Z" }, + { url = "https://files.pythonhosted.org/packages/27/83/140f85a466595a16382996a1bf06b2b54bcd597488921b0c9daaeeda72af/numpy-2.4.6-cp311-cp311-win_arm64.whl", hash = "sha256:ed9749eef4cbd126da3dc1d6bcb3a57f5eb7ac6a6484146bdbf743f552dfc577", size = 10479528, upload-time = "2026-05-18T23:33:50.725Z" }, + { url = "https://files.pythonhosted.org/packages/95/2a/3d7b5ac8aac24feaf9ad7ed58f45b0bbc06d37e4338ae84c9f2298b570f9/numpy-2.4.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:001fbb8e08d942dd57599e781f2472269ee7f2755fae407b4f67b2f0b17da3f1", size = 16689119, upload-time = "2026-05-18T23:33:54.065Z" }, + { url = "https://files.pythonhosted.org/packages/ea/12/92c4c131527599e8288d6918e888d88726f84d805d784b771f32408aeaef/numpy-2.4.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ebfb099f8dcf083deef3ac1ca4c1503f387cf76296fcb3816b66f5ecb5f54fdb", size = 14699246, upload-time = "2026-05-18T23:33:57.621Z" }, + { url = "https://files.pythonhosted.org/packages/ad/fe/c0a6b7b2ca128a8fb228575147073b660656734b8ebe4d76c8fd748dcc79/numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41", size = 5204410, upload-time = "2026-05-18T23:34:00.302Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d4/9770d14ba719432bb90a421bfd443872ed0f70f7264b64bec12ea363d5fd/numpy-2.4.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698", size = 6551240, upload-time = "2026-05-18T23:34:02.852Z" }, + { url = "https://files.pythonhosted.org/packages/c9/c6/50a46a6205feba2343f1d6d17438107c5dc491ed1c736e6ea68689fd906b/numpy-2.4.6-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f9fb9157b4ce2971008323afe46053787b526ef624fea915b261468a8421a0f", size = 15671012, upload-time = "2026-05-18T23:34:05.485Z" }, + { url = "https://files.pythonhosted.org/packages/99/60/14115e6364fa676c5397c2ad3004e527e9aa487abf5d0706ec81bbd08529/numpy-2.4.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90f9849678c75fe7afa2d348ac842c168b0a4d3d61919687216dfc547976d853", size = 16645538, upload-time = "2026-05-18T23:34:09.265Z" }, + { url = "https://files.pythonhosted.org/packages/ae/c5/693cbe59e57db94d2231fa519ca3978dc9e19da5a8f088588f5c6e947ff2/numpy-2.4.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c1a2af6c6ef86344a6b0db6b97834208bf598db514f2b155042439b62605601a", size = 17020706, upload-time = "2026-05-18T23:34:13.053Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fc/85b7c4eff9b4966ade25c2273cf7e7012e92366c032058653934b37de044/numpy-2.4.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e5805d5a22fd19c8ccff10a9561f9df94436b0545619ea579db2d3c35294bce2", size = 18368541, upload-time = "2026-05-18T23:34:17.024Z" }, + { url = "https://files.pythonhosted.org/packages/f6/81/e1b27545deedce7f4a0b348618c6b62d74e36a4dc9ccd42f3eb2f85eee32/numpy-2.4.6-cp312-cp312-win32.whl", hash = "sha256:e3eeb0aabd6bd5ce64faae67e9935203a6991b4bc2a485a767fbafb2c5125f45", size = 5962825, upload-time = "2026-05-18T23:34:20.3Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ca/feab00bd44aa5fe1ad2c18f08b4d3bb92e26484b0b1d1443897809ed528c/numpy-2.4.6-cp312-cp312-win_amd64.whl", hash = "sha256:d8e8286dd7cea7895157318d1b91cdacac64c479f3cbc8dce548331728484751", size = 12321687, upload-time = "2026-05-18T23:34:23.095Z" }, + { url = "https://files.pythonhosted.org/packages/63/cf/5a6d34850a39d1093558564f77ee8e8e0bee5061151b8f05a55711001ec7/numpy-2.4.6-cp312-cp312-win_arm64.whl", hash = "sha256:4081eb135ac24158bd51cdfbef16f1c64df7063b1143f24731387137c092bec8", size = 10221482, upload-time = "2026-05-18T23:34:25.876Z" }, + { url = "https://files.pythonhosted.org/packages/de/12/b422cc84439adc0d00de605bf4a308890ae5c26f2c71fbd73e5d08fbb0dd/numpy-2.4.6-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:55cced7c52e981362f708ad635198e97a752dfba412cc03c23bbf3bd8d5cd662", size = 16847511, upload-time = "2026-05-18T23:36:50.673Z" }, + { url = "https://files.pythonhosted.org/packages/44/53/f481bef68011740f8849418d82db07230e825013f31f4eef5ba5b805316a/numpy-2.4.6-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d6da64deb6b8ed903e7560180a92f2d804ee1ba5eeb849ac2748b8c1aba1f6d7", size = 14889064, upload-time = "2026-05-18T23:36:53.879Z" }, + { url = "https://files.pythonhosted.org/packages/7f/57/42ed575c10ced8af951d426bc4e1f8aff16fd851db33f067036215a7f860/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:68a5124b13fa6cc2086764a20005d30bc0548146f7f5322f02fce212ca14317f", size = 5394157, upload-time = "2026-05-18T23:36:57.194Z" }, + { url = "https://files.pythonhosted.org/packages/6a/ef/f66cc724fcc36c1e364c67f51ae9146090b8b584f27d58b97fdae3edd737/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:948424b06129ce883307e8cff868c31396d8dc7630a59c61d70d98dbe70f222c", size = 6708728, upload-time = "2026-05-18T23:36:59.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/9c/c531f2293b91265d8b48e9b329f54fdd7ffae73cb4134ea10cca4237e9cc/numpy-2.4.6-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbbdb29840ca3d91ee0fece42fc29278886d908280bfec0a5846c6f901a3eb0", size = 15798374, upload-time = "2026-05-18T23:37:02.674Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b0/413077f6b1153ed3cba361401c6783bbad6114804a000cc22eb71c13e190/numpy-2.4.6-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8ad03c0965fb3c692200e74d458ca28c1dbb4ce96f9a479a8aa041ad5fabca02", size = 16747286, upload-time = "2026-05-18T23:37:06.327Z" }, + { url = "https://files.pythonhosted.org/packages/15/ce/e5ec180bc41812edcd8daeb8639d205622c0e8c02259d8ab25a0201b3c2a/numpy-2.4.6-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:2803abfebfc990042cd494d8ce2d5f82e9d847af6d35ec486923aa19dbad5e73", size = 12504263, upload-time = "2026-05-18T23:37:09.715Z" }, +] + +[[package]] +name = "numpy" +version = "2.5.3" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.12' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and sys_platform != 'emscripten'", +] +sdist = { url = "https://files.pythonhosted.org/packages/13/01/11703282db468b85f6f7b8c7f22d058de5970d5c7e60a3a8aaa313c3de36/numpy-2.5.3.tar.gz", hash = "sha256:df2d5874ff183595a4ba404edd04f6bd9b5505c1d7708573f6a6c17489a67563", size = 20791231, upload-time = "2026-09-06T16:27:47.073Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/50/8fdbb16af64895706a45f06a4068e29db732ec180f3c1375f14123359138/numpy-2.5.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cb189f09db39283b26bfd061ec16189e14f71c6755207f72a0f7540867afe5b9", size = 16994982, upload-time = "2026-09-06T16:24:29.244Z" }, + { url = "https://files.pythonhosted.org/packages/60/39/789131c1188c078dcb3a1692e72e1e050c68b88ffe72c9ccaac9bcd7a9cd/numpy-2.5.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f59a878c33d6b88122d80d239bb3b845d58708750b0cb06a09aebb9b18ec696c", size = 12009327, upload-time = "2026-09-06T16:24:32.491Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/a312e95696e5f601914dd8b6dd844692ba61670807417e24b68e337b5c70/numpy-2.5.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a72f874bc9e10e4b8f80426fb49716d5141f64442a0c8418065093ec8017fbb0", size = 5445405, upload-time = "2026-09-06T16:24:35.071Z" }, + { url = "https://files.pythonhosted.org/packages/30/d0/5623a1707ed4fe16e3909fe3cf5ee3da004ae677ad23d83bbf3adf1a6faf/numpy-2.5.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fc36dc566135b5eceec4cf89758fcb719266a019ef07dae1754ae7c9f617ef3e", size = 6783213, upload-time = "2026-09-06T16:24:37.253Z" }, + { url = "https://files.pythonhosted.org/packages/f1/32/84146fc020ad3c25f805f70ab60da46fe3c540a21369754a7e4369754b6f/numpy-2.5.3-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:76c2c1e6bfa5c84adc6434dfbf013aa92096a7985221762c8f11fedfd20fff58", size = 15687872, upload-time = "2026-09-06T16:24:39.751Z" }, + { url = "https://files.pythonhosted.org/packages/65/af/aa78d1a88805456e212b65461354cd943197fb9acecc4c90fd12295123a3/numpy-2.5.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7e18c623bb5c95acb3b3328861272816ba199fb531921c5d6d0b675f1fde9e3", size = 16717410, upload-time = "2026-09-06T16:24:42.745Z" }, + { url = "https://files.pythonhosted.org/packages/3b/24/faa79d865e69a97ba17473b23a1b74094b2259c03e820c70297293b9ea49/numpy-2.5.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4f8929ee6c96bfbd7b4ed2032e0c03af86fe1826740ab61ddabf9072d06e57ff", size = 17040975, upload-time = "2026-09-06T16:24:45.961Z" }, + { url = "https://files.pythonhosted.org/packages/62/4a/8877e629445a7176297dffcaf9c485faa96a95d81728a62521ad55bd4c0f/numpy-2.5.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b5d93cf48f687479941d12b69c873ad2cc76bbd487f0091c2200636497f34034", size = 18476479, upload-time = "2026-09-06T16:24:49.35Z" }, + { url = "https://files.pythonhosted.org/packages/c8/db/35e1c2d38b04cbd5b731f9d71495e055e813197669d22b612f11748d2ff9/numpy-2.5.3-cp312-cp312-win32.whl", hash = "sha256:bf63afbe037eb5d2fe87fbcc7778e61da53ebaf21d938a4515aa73b62532a5d4", size = 6133378, upload-time = "2026-09-06T16:24:51.915Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a1/accf6d4f0c80c5d9ba9735d6b1550e444180599f34dec69ca01360f717ad/numpy-2.5.3-cp312-cp312-win_amd64.whl", hash = "sha256:0a59a421a32580a009e8a1751345bf829631b990dc1794b80514ab722b435def", size = 12567828, upload-time = "2026-09-06T16:24:54.255Z" }, + { url = "https://files.pythonhosted.org/packages/22/43/1764aff32e4652526ae2f71fa8b3efd8d25c8a3d6926914454e47138ed1e/numpy-2.5.3-cp312-cp312-win_arm64.whl", hash = "sha256:ccb32e0525d29e8b0572eb84c9a57af0e7a4e615726927506f55063c62414034", size = 10485432, upload-time = "2026-09-06T16:24:57.278Z" }, +] + +[[package]] +name = "openai" +version = "3.19.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2" }, + { name = "jiter" }, + { name = "pydantic" }, + { name = "sniffio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7c/91/2d5722388a50cc86e162779df5fbfe0afa652a6e2d5c9ee616e081a82098/openai-3.19.2.tar.gz", hash = "sha256:de185f9834ad064d965ec42bd0766731cf66bceea16a7670294a835d207019e6", size = 1716953, upload-time = "2026-09-24T00:06:07.315Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bd/20/4fe123e60525375878c67d1d8d051c9c5dec81cc56a579ba9304ca743303/openai-3.19.2-py3-none-any.whl", hash = "sha256:66247fcd07266e72536e90656dc27f3b0bb1e9d8696d4013fc55402c0b96a5c2", size = 2071459, upload-time = "2026-09-24T00:06:05.416Z" }, +] + +[[package]] +name = "openapi-pydantic" +version = "0.5.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/02/2e/58d83848dd1a79cb92ed8e63f6ba901ca282c5f09d04af9423ec26c56fd7/openapi_pydantic-0.5.1.tar.gz", hash = "sha256:ff6835af6bde7a459fb93eb93bb92b8749b754fc6e51b2f1590a19dc3005ee0d", size = 60892, upload-time = "2025-01-08T19:29:27.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/cf/03675d8bd8ecbf4445504d8071adab19f5f993676795708e36402ab38263/openapi_pydantic-0.5.1-py3-none-any.whl", hash = "sha256:a3a09ef4586f5bd760a8df7f43028b60cafb6d9f61de2acba9574766255ab146", size = 96381, upload-time = "2025-01-08T19:29:25.275Z" }, +] + +[[package]] +name = "opentelemetry-api" +version = "1.44.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/8b/aa9e2d8b8dfa7c946f7dec5d1f8f6ba8eca062f43509a06bdb5ce93d26c0/opentelemetry_api-1.44.0.tar.gz", hash = "sha256:67647e5e9566edcf421166fdf022b3537f818635daa852b289e34604dc6fb33a", size = 72406, upload-time = "2026-07-16T15:25:32.678Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ca/6f/a04e900f465ff3221ccc395522503e2d10e79fa21f2723c8e177aae1e0d1/opentelemetry_api-1.44.0-py3-none-any.whl", hash = "sha256:94b98c893a91b88657eaac1e3ba89618cdb85be6918196705354f34728b2cdef", size = 60018, upload-time = "2026-07-16T15:25:11.657Z" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, +] + +[[package]] +name = "pathable" +version = "0.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/66/f3/5a20387de9bcd0607871bfc2198ee0e15836da7baa4592ccd7f24c27c986/pathable-0.6.0.tar.gz", hash = "sha256:6404b8b82aef5ff0fd478934137128b99b12212ba35afdde5525ca4f8388ea58", size = 18970, upload-time = "2026-05-19T18:15:11.911Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/e8/6d75ffd9784bce2e93d1ae4415649427e39a53bb172d4672b2b59c6f0a7b/pathable-0.6.0-py3-none-any.whl", hash = "sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566", size = 18983, upload-time = "2026-05-19T18:15:10.728Z" }, +] + +[[package]] +name = "pillow" +version = "12.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/3d/bb7fca845737cf9d7dbde16ed1843984665ff2e0a518f5db43e77ec540b9/pillow-12.3.0.tar.gz", hash = "sha256:3b8182a766685eaa002637e28b4ec8d6b18819a0c71f579bf0dbaa5830297cce", size = 47025035, upload-time = "2026-07-01T11:56:38.965Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/c8/0a78b0e02d7ac54bc03e5321c9220da52f0c2ea83b21f7c40e7f3169c502/pillow-12.3.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:00808c5e14ef63ac5161091d242999076604ff74b883423a11e5d7bbb38bf756", size = 5392415, upload-time = "2026-07-01T11:53:47.162Z" }, + { url = "https://files.pythonhosted.org/packages/b2/5b/a02d30018abd97ced9f5a6c63d28597694a00d066516b9c1c6de45859fc9/pillow-12.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:37d6d0a00072fd2948eb22bce7e1475f34569d90c87c59f7a2ec59541b77f7a6", size = 4785266, upload-time = "2026-07-01T11:53:49.079Z" }, + { url = "https://files.pythonhosted.org/packages/c8/98/766667a4be768150a202836acd9fad19c06824ca86c4286d3cf6b274964e/pillow-12.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bcb46e2f9feff8d06323983bd83ed00c201fdcab3d74973e7072a889b3979fcd", size = 6263814, upload-time = "2026-07-01T11:53:51.32Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2d/ede717bc1144f63886c21fd349bb95860b0d1a21149ff16f2bb362b612b6/pillow-12.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23d27a3e0307ec2244cc51e7287b919aa68d097504ebe19df4e76a98a3eea5bd", size = 6934408, upload-time = "2026-07-01T11:53:53.487Z" }, + { url = "https://files.pythonhosted.org/packages/a3/48/9c58b685e69d49c31af6c8eb9012055fab7e665785165c84796e2c73ce72/pillow-12.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4f883547d4b7f0495ebe7056b0cc2aea76094e7a4abc8e933540f3271df27d9c", size = 6337160, upload-time = "2026-07-01T11:53:55.457Z" }, + { url = "https://files.pythonhosted.org/packages/ff/fa/dc2a5c0ba6df93f67c31d34b808b7ce440b40cdbf96f0b81cde1d1e6fa93/pillow-12.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:236ff70b9312fb68943c703aa842ca6a758abfa45ac187a5e7c1452e96ef72b5", size = 7045172, upload-time = "2026-07-01T11:53:57.736Z" }, + { url = "https://files.pythonhosted.org/packages/86/a5/444817a4d4c4c2417df00513086ca196f388d8f9ef40c2e4ccd1ad1af54b/pillow-12.3.0-cp311-cp311-win32.whl", hash = "sha256:10e41f0fbf1eec8cfd234b8fe17a4caac7c9d0db4c204d3c173a8f9f6ef3232b", size = 6472232, upload-time = "2026-07-01T11:53:59.767Z" }, + { url = "https://files.pythonhosted.org/packages/63/c6/4bad1b18d132a50b27e1365e1ab163616f7a5bb56d330f66f9d1d9d4f9d4/pillow-12.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:8e95e1385e4998ae9694eeaa4730ba5457ff61185b3a55e2e7bea0880aef452a", size = 7233653, upload-time = "2026-07-01T11:54:02.066Z" }, + { url = "https://files.pythonhosted.org/packages/fd/16/00f91ab7760dc842f5aad55217e80fc4a7067a0604535249bc8a2d6d9870/pillow-12.3.0-cp311-cp311-win_arm64.whl", hash = "sha256:ebaea975e03d3141d9d3a507df75c9b3ec90fa9d2ffd07567b3a978d9d790b26", size = 2568195, upload-time = "2026-07-01T11:54:04.622Z" }, + { url = "https://files.pythonhosted.org/packages/37/bf/fb3ebff8ddcb76aac5a01389251bbbb9519922a9b520d8247c1ca864a25d/pillow-12.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ba09209fbe443b4acccebe845d8a138b89a8f4fbaeedd44953490b5315d5e965", size = 5345969, upload-time = "2026-07-01T11:54:06.397Z" }, + { url = "https://files.pythonhosted.org/packages/d8/66/9a386a92561f402389a4fc70c18838bf6d35eb5eb5c6850b4b2dc64f5048/pillow-12.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffd0c5368496f41b0944be820fcb7a838aa6e623d250b01acf2643939c3f99d7", size = 4780323, upload-time = "2026-07-01T11:54:09.351Z" }, + { url = "https://files.pythonhosted.org/packages/25/27/ac8f99618ffd3dde21db0f4d4b1d2ab00c0880595bfd17df103f7f39fd0c/pillow-12.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d9c7f76c0673154f044e9d78c8655fb4213f6ca31a836df48b40fe5d187717b9", size = 6266838, upload-time = "2026-07-01T11:54:11.71Z" }, + { url = "https://files.pythonhosted.org/packages/84/21/a35af28dcc61f37ed850a2d64c65c701321dfbf25085e469d5559360cbbf/pillow-12.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78cb2c6865a35ab8ff8b75fd122f6033b92a62c82801110e48ddd6c936a45d91", size = 6940830, upload-time = "2026-07-01T11:54:13.732Z" }, + { url = "https://files.pythonhosted.org/packages/eb/51/8b08617af3ad95e33ce6d7dd2c99ed6c8298f7fb131636303956be022e25/pillow-12.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e491916b378fba47242221bb9ead245211b70d504f495d105d17b14a24b4907c", size = 6344383, upload-time = "2026-07-01T11:54:15.756Z" }, + { url = "https://files.pythonhosted.org/packages/1d/72/cf78ac9780bb93c28328f408973845a309d4d145041665f734572ced1b52/pillow-12.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0dd2064cbc55aaec028ef5fbb60fa47bb6c3e7918e07ff17935284b227a9d2df", size = 7052934, upload-time = "2026-07-01T11:54:17.721Z" }, + { url = "https://files.pythonhosted.org/packages/20/20/25e0f4dc178a6bc0696793720055519a0de89e7661dae886992decbd2f81/pillow-12.3.0-cp312-cp312-win32.whl", hash = "sha256:dbce0b29841537a2fa4a214c2bbf14de3587c9680caa9b4e217568472490b28f", size = 6472684, upload-time = "2026-07-01T11:54:19.839Z" }, + { url = "https://files.pythonhosted.org/packages/45/89/da2f7971a317f83d807fdd4065c0af40208e59e692cc43d315a71a0e96d1/pillow-12.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:a2b55dd6b2a4c4b7d87ffa56bdb33fdc5fdb9a462173861a7bc097f17d91cb09", size = 7227137, upload-time = "2026-07-01T11:54:22.025Z" }, + { url = "https://files.pythonhosted.org/packages/de/47/4845a0a6c0dbf1db8456bd9fc791f13c5ced7ced20606d08a0aacfd25b49/pillow-12.3.0-cp312-cp312-win_arm64.whl", hash = "sha256:331b624368d4f1d069149002f25f44bc61c8919ce8ddb3c45bdad8f6e2d89510", size = 2568267, upload-time = "2026-07-01T11:54:24.051Z" }, + { url = "https://files.pythonhosted.org/packages/75/18/2e8b40223153ccbc60df07f9e8928dc0c76202aa4e55ae9f53962b6510d6/pillow-12.3.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b3c777e849237620b022f7f297dd67705f9f5cf1685f09f02e46f93e92725468", size = 5302510, upload-time = "2026-07-01T11:56:25.736Z" }, + { url = "https://files.pythonhosted.org/packages/46/3e/51fabf59d5ab801ceab709453d3ab6b180083496579549de4c45ced6528a/pillow-12.3.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:b343699e8308bdc51978310e1c959c584e7869cc8c40780058c87da7781a1e94", size = 4736058, upload-time = "2026-07-01T11:56:28.041Z" }, + { url = "https://files.pythonhosted.org/packages/bf/20/22fe9384b7949e25fb1293bcfc84fb82590ff4ea6b37c95b24d26d793d86/pillow-12.3.0-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fbd139c8447d25dd750ab79ee274cc5e1fe80fc56340ab10b18a195e1b6eca3e", size = 5237776, upload-time = "2026-07-01T11:56:30.263Z" }, + { url = "https://files.pythonhosted.org/packages/08/14/f6ba68107680ffa74b39985f3f30884e41318fbc4250caa423c79b4788bb/pillow-12.3.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e7e480451b9fa137494bccd3a7d69adbe8ac65a87d97be61e11f1b1050a5bac3", size = 5860358, upload-time = "2026-07-01T11:56:32.68Z" }, + { url = "https://files.pythonhosted.org/packages/36/54/0169bc772ec491108b62f644f8ecf1fe5d8ae5ebafde2ee2142210166903/pillow-12.3.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:04f01d28a6aaff387bf842a13be313df23ba0597a44f1a976c9feb3c6ff4711a", size = 7231786, upload-time = "2026-07-01T11:56:35.046Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.11.12" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ea/dd/65804b0c2925a1c821a05502ea57517b69a073ff400d25ab9faa3a2cf012/platformdirs-4.11.12.tar.gz", hash = "sha256:e8dc1cb58f1153fd7f61db1374317770baababec2480b37b8f01c6cc25b45267", size = 40016, upload-time = "2026-09-22T01:02:36.973Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ec/2b/69de6317fbf48865bb12aa56c9cfcfff46b3add0cd45250725d96146dce0/platformdirs-4.11.12-py3-none-any.whl", hash = "sha256:b1ba966ac76153d9985a0787ffab951e7c18416189873d4e4ddb2c8a04a0a254", size = 24976, upload-time = "2026-09-22T01:02:35.742Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pre-commit" +version = "4.6.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cfgv" }, + { name = "identify" }, + { name = "nodeenv" }, + { name = "pyyaml" }, + { name = "virtualenv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/89/1f3e8e1fc3e97de0fa963495832f581f025f29471602a309e48808244292/pre_commit-4.6.2.tar.gz", hash = "sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441", size = 198670, upload-time = "2026-08-10T22:07:18.421Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/45/e2/bbb7129c9e7999a6b8ee9cca3b66486c25c423ab5a75f34071798b74ce94/pre_commit-4.6.2-py2.py3-none-any.whl", hash = "sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e", size = 226202, upload-time = "2026-08-10T22:07:16.942Z" }, +] + +[[package]] +name = "prompt-toolkit" +version = "3.0.51" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "wcwidth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/6e/9d084c929dfe9e3bfe0c6a47e31f78a25c54627d64a66e884a8bf5474f1c/prompt_toolkit-3.0.51.tar.gz", hash = "sha256:931a162e3b27fc90c86f1b48bb1fb2c528c2761475e57c9c06de13311c7b54ed", size = 428940, upload-time = "2025-04-15T09:18:47.731Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ce/4f/5249960887b1fbe561d9ff265496d170b55a735b76724f10ef19f9e40716/prompt_toolkit-3.0.51-py3-none-any.whl", hash = "sha256:52742911fde84e2d423e2f9a4cf1de7d7ac4e51958f648d9540e0fb8db077b07", size = 387810, upload-time = "2025-04-15T09:18:44.753Z" }, +] + +[[package]] +name = "py-key-value-aio" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "beartype" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ca/99/c346e3474853801ec5ecf4c3ee60cfc6060327ebc31424df4e346620dde4/py_key_value_aio-0.4.6.tar.gz", hash = "sha256:267c03c3e24cb99d3097612f8a5cfd8e11785c6a2975e272db0e303ea1850bfd", size = 112876, upload-time = "2026-09-18T15:29:52.002Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9a/46/12871550fb0613d149144bb9d41f22680d5f46717bc45a76eb5798c20c3f/py_key_value_aio-0.4.6-py3-none-any.whl", hash = "sha256:820b30c7959fc738ea3d00160cdb10cd258f51e38737b2add530defeea1ded77", size = 171289, upload-time = "2026-09-18T15:29:50.665Z" }, +] + +[package.optional-dependencies] +filetree = [ + { name = "aiofile" }, + { name = "anyio" }, +] +keyring = [ + { name = "keyring" }, +] +memory = [ + { name = "cachetools" }, +] + +[[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.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.5" +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/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750, upload-time = "2026-08-28T14:04:00.916Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589, upload-time = "2026-08-28T14:03:59.136Z" }, +] + +[package.optional-dependencies] +email = [ + { name = "email-validator" }, +] + +[[package]] +name = "pydantic-core" +version = "2.46.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262, upload-time = "2026-08-28T10:01:31.677Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/b6/81d2d19ea0be2c03664381b59f65fa72fc7969decedae00bc2c4ad835708/pydantic_core-2.46.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f", size = 2074737, upload-time = "2026-08-28T09:57:57.711Z" }, + { url = "https://files.pythonhosted.org/packages/0c/18/b70da8300e292df4099684ea11b1958043580d2f50d2dc8bf7e542bdd84a/pydantic_core-2.46.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f", size = 1921751, upload-time = "2026-08-28T09:57:59.265Z" }, + { url = "https://files.pythonhosted.org/packages/e7/1a/0d590341b6ffa4b4aca83508e6b8db4761aaeacfc15a25ca3815876d4797/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061", size = 1948231, upload-time = "2026-08-28T09:58:00.678Z" }, + { url = "https://files.pythonhosted.org/packages/7d/1d/02eb35761c51f2f7b1b042d6ab4cda6600f0c8c88a2243b3f734376201e5/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be", size = 2020708, upload-time = "2026-08-28T09:58:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ea/f86073830e35d508cc8ddf9c3d9e6e6840fcb88d34bf726b0b4710186f27/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a", size = 2194914, upload-time = "2026-08-28T09:58:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/bb/d7/fc36240d7791ce90939e51608568c33bfdae26202016f9770c229a487d86/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b", size = 2235622, upload-time = "2026-08-28T09:58:05.516Z" }, + { url = "https://files.pythonhosted.org/packages/cf/bc/3fa2d76b83162820a17da7f645b28d1cba99fc8e1e5fc6517067ec450fa1/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c", size = 2062091, upload-time = "2026-08-28T09:58:07.135Z" }, + { url = "https://files.pythonhosted.org/packages/ab/9a/095d557bb492c90cd8a70a6dd048bf793d433d03d86c81c11e912e4cd049/pydantic_core-2.46.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee", size = 2089904, upload-time = "2026-08-28T09:58:08.814Z" }, + { url = "https://files.pythonhosted.org/packages/24/98/7b76b1ad10a19a617a52aaa1d80e159115af939b095e86f8e756fd52e0df/pydantic_core-2.46.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e", size = 2132244, upload-time = "2026-08-28T09:58:10.435Z" }, + { url = "https://files.pythonhosted.org/packages/20/32/7d6ca365fadba186a0c8f85de1a701663bce81efd309d9479be58687622f/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2", size = 2143901, upload-time = "2026-08-28T09:58:12.033Z" }, + { url = "https://files.pythonhosted.org/packages/f8/09/eb9a6aa57f22fd1541a9c0aa2a1f3aeef3ec65347d33e10a6da2f43e0ee9/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689", size = 2299425, upload-time = "2026-08-28T09:58:13.614Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f9/548a5bb9d4ba8cd26e26daf48052236f6b38bb61e7b7241fbc3c995719eb/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec", size = 2318566, upload-time = "2026-08-28T09:58:15.199Z" }, + { url = "https://files.pythonhosted.org/packages/4a/20/06454d18834c02c406c9133f1a3b485305fd9ee984f9636c2f730bef6a9d/pydantic_core-2.46.5-cp311-cp311-win32.whl", hash = "sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129", size = 1954258, upload-time = "2026-08-28T09:58:16.813Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c2/718b9deb4b72453b5d8c7447a3b14cb77bef36917ef5f514e0948a4096a0/pydantic_core-2.46.5-cp311-cp311-win_amd64.whl", hash = "sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c", size = 2041030, upload-time = "2026-08-28T09:58:18.288Z" }, + { url = "https://files.pythonhosted.org/packages/67/ea/c1d1a5b72d6e1ff7f377a4d9199f6591f095beb5b409a8a5d89f7238d939/pydantic_core-2.46.5-cp311-cp311-win_arm64.whl", hash = "sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8", size = 2009234, upload-time = "2026-08-28T09:58:19.929Z" }, + { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516, upload-time = "2026-08-28T09:58:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874, upload-time = "2026-08-28T09:58:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772, upload-time = "2026-08-28T09:58:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832, upload-time = "2026-08-28T09:58:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645, upload-time = "2026-08-28T09:58:28.948Z" }, + { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935, upload-time = "2026-08-28T09:58:30.625Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284, upload-time = "2026-08-28T09:58:32.289Z" }, + { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889, upload-time = "2026-08-28T09:58:33.986Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006, upload-time = "2026-08-28T09:58:35.647Z" }, + { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408, upload-time = "2026-08-28T09:58:37.38Z" }, + { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609, upload-time = "2026-08-28T09:58:39.22Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618, upload-time = "2026-08-28T09:58:40.89Z" }, + { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475, upload-time = "2026-08-28T09:58:42.591Z" }, + { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140, upload-time = "2026-08-28T09:58:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729, upload-time = "2026-08-28T09:58:46.13Z" }, + { url = "https://files.pythonhosted.org/packages/af/1e/ecca01fce348f7e8afa9572441ff6f7d1cc70d21e4859f33944d10877e1e/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2", size = 2075342, upload-time = "2026-08-28T10:00:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/1f/4c/af80c7a8032dfc897040ad5cb772bebde529a381186499e6e29987f23f8c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c", size = 1907219, upload-time = "2026-08-28T10:00:53.438Z" }, + { url = "https://files.pythonhosted.org/packages/be/3e/54d89e2b092e778716bf6153634ef479e955f48c261090be23aa1e0fb0b5/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47", size = 1953393, upload-time = "2026-08-28T10:00:55.58Z" }, + { url = "https://files.pythonhosted.org/packages/ea/89/828ee90cda28ce17bdefaa3a6eaf74fe430e113295a10e6126beca559d6c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a", size = 2099024, upload-time = "2026-08-28T10:00:57.794Z" }, + { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540, upload-time = "2026-08-28T10:01:00.318Z" }, + { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040, upload-time = "2026-08-28T10:01:02.529Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479, upload-time = "2026-08-28T10:01:05.004Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034, upload-time = "2026-08-28T10:01:07.345Z" }, + { url = "https://files.pythonhosted.org/packages/20/21/22102e9950b3049526d20e811b95396508377d87651edd2b80d2b3d28659/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f", size = 2071333, upload-time = "2026-08-28T10:01:09.636Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/87aefa427d191e6d3ab1447f1efc1cdcac86af1069239b133e8a0fd7f7c9/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0", size = 1912713, upload-time = "2026-08-28T10:01:12.285Z" }, + { url = "https://files.pythonhosted.org/packages/1f/93/fd89e9ad49b1805ca94d24ce1088b7d305f05c35ffafcedb9819d03588a0/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4", size = 2090926, upload-time = "2026-08-28T10:01:15.19Z" }, + { url = "https://files.pythonhosted.org/packages/6f/45/8e59dab6acf8d35f02f0a958980074f31038968bdb2c983fcae9d1efee03/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25", size = 2131303, upload-time = "2026-08-28T10:01:17.937Z" }, + { url = "https://files.pythonhosted.org/packages/d5/a5/e1d4dc5180dd887a9522efc1f8716b8692b7606b1d3273d7862eaf66be44/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6", size = 2145128, upload-time = "2026-08-28T10:01:20.694Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d7/ad493864a7fb21c0c4df98f965e2db430cb25a9d7369b5778d5016c09fd9/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e", size = 2294560, upload-time = "2026-08-28T10:01:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/b41c84c913f29973a268e6c2b5bbf13c95adb9956c126d10da11ba3b2bef/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda", size = 2317531, upload-time = "2026-08-28T10:01:26.334Z" }, + { url = "https://files.pythonhosted.org/packages/db/1d/068464f23075f66a8f1b806935e9cd9363ee446636ea70d2c22ee8659dbf/pydantic_core-2.46.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266", size = 2140686, upload-time = "2026-08-28T10:01:28.947Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/68/ca/31c57507b13119d7d3cfa1576dad2911a4861e3be07b579395f4e9d393f9/pydantic_settings-2.15.0.tar.gz", hash = "sha256:694b793e84f766ba76a90ebdefc01d0a9a045dab0382bee70393da93712ad117", size = 261253, upload-time = "2026-08-07T09:24:57.419Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/a4/2bffa9f8e804325a09867f0e9d30795c80ea9f8d62560bd1b6ad6220eb2f/pydantic_settings-2.15.0-py3-none-any.whl", hash = "sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42", size = 69413, upload-time = "2026-08-07T09:24:55.839Z" }, +] + +[[package]] +name = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } +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.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/02/a5/5197bfd06417837ac079921c66fa6393f1dea3557272a263cebfef69e432/pyjwt-2.15.0.tar.gz", hash = "sha256:b11c5f9791d7bf51c2b39a81ed669f6b2dbbd669df2942f6c60167e9e3d1abe4", size = 120513, upload-time = "2026-09-23T16:56:00.689Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e8/55/40e45bf052ee8ee12a4dfd785519660f8effa7b065442b91646ec6828619/pyjwt-2.15.0-py3-none-any.whl", hash = "sha256:7a3742debf6b879e912dbb9819ceec1594be812452b78c5f2e2dfc56564954f8", size = 33680, upload-time = "2026-09-23T16:55:59.241Z" }, +] + +[package.optional-dependencies] +crypto = [ + { name = "cryptography" }, +] + +[[package]] +name = "pyperclip" +version = "1.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/52/d87eba7cb129b81563019d1679026e7a112ef76855d6159d24754dbd2a51/pyperclip-1.11.0.tar.gz", hash = "sha256:244035963e4428530d9e3a6101a1ef97209c6825edab1567beac148ccc1db1b6", size = 12185, upload-time = "2025-09-26T14:40:37.245Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/80/fc9d01d5ed37ba4c42ca2b55b4339ae6e200b456be3a1aaddf4a9fa99b8c/pyperclip-1.11.0-py3-none-any.whl", hash = "sha256:299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273", size = 11063, upload-time = "2025-09-26T14:40:36.069Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" }, +] + +[[package]] +name = "python-discovery" +version = "1.6.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "filelock" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0c/57/250bd238b966cece44328235eb85290045d059265fdaf7527a3a958123db/python_discovery-1.6.1.tar.gz", hash = "sha256:cf87d3627dfb4412437fdd5b13eae402607722998d21567993aedbc59b23c15e", size = 84338, upload-time = "2026-09-18T01:31:53.971Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/16/7d/e9ffbadfbf89c93848412d04594135c4ae8c1d37d9e053b9c3ed718fabc4/python_discovery-1.6.1-py3-none-any.whl", hash = "sha256:d43fcdef879fe795352bd13ccf8d185ba5a9f86f36cfcd00529f596e737442b3", size = 38664, upload-time = "2026-09-18T01:31:52.448Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/53/ed9d74092561d4b01a2ef1349d52cdbc135e526c245f366b089cfca6de49/python_dotenv-1.2.3.tar.gz", hash = "sha256:a20a594dabeaa385725aa239d5244871c143ecb356add8a20fcf23773a6c3a35", size = 58945, upload-time = "2026-08-16T16:54:54.067Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/17/c5c6b53ddc18f297992099b3d9ec16c855c0ccc83263a21fe4d1c625ec6c/python_dotenv-1.2.3-py3-none-any.whl", hash = "sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9", size = 22780, upload-time = "2026-08-16T16:54:52.473Z" }, +] + +[[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" }, +] + +[[package]] +name = "pywin32-ctypes" +version = "0.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", size = 29471, upload-time = "2024-08-14T10:15:34.626Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", size = 30756, upload-time = "2024-08-14T10:15:33.187Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, + { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, + { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, + { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, + { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, + { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, + { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, +] + +[[package]] +name = "questionary" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "prompt-toolkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a8/b8/d16eb579277f3de9e56e5ad25280fab52fc5774117fb70362e8c2e016559/questionary-2.1.0.tar.gz", hash = "sha256:6302cdd645b19667d8f6e6634774e9538bfcd1aad9be287e743d96cacaf95587", size = 26775, upload-time = "2024-12-29T11:49:17.802Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/3f/11dd4cd4f39e05128bfd20138faea57bec56f9ffba6185d276e3107ba5b2/questionary-2.1.0-py3-none-any.whl", hash = "sha256:44174d237b68bc828e4878c763a9ad6790ee61990e0ae72927694ead57bab8ec", size = 36747, upload-time = "2024-12-29T11:49:16.734Z" }, +] + +[[package]] +name = "referencing" +version = "0.37.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "rpds-py" }, + { name = "typing-extensions" }, +] +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 = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + +[[package]] +name = "rich-rst" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, + { name = "rich" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e2/d6/d0b9fafc73b65767200da027acab1db1bdb1048f4fea5ebf659df01c700e/rich_rst-2.1.0.tar.gz", hash = "sha256:f4d117b49697f338769759fa5cacf5197da4888b347b9fda2e50aef5cd8d93bd", size = 302732, upload-time = "2026-07-05T02:59:44.308Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/68/1fc93dd759605b5d00fc98b50200739e41ed32bd22d6ba35ca6c3932371b/rich_rst-2.1.0-py3-none-any.whl", hash = "sha256:7ecd1343ee12c879d0e7ae74c3eb6d263b023d2929c6d114212eb1fd91057255", size = 272987, upload-time = "2026-07-05T02:59:42.792Z" }, +] + +[[package]] +name = "rpds-py" +version = "2026.6.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/2a/9618a122aeb2a169a28b03889a2995fe297588964333d4a7d67bdf46e147/rpds_py-2026.6.3.tar.gz", hash = "sha256:1cebd1337c242e4ec2293e541f712b2da849b29f48f0c293684b71c0632625d4", size = 64051, upload-time = "2026-06-30T07:17:53.009Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/1f/a2dca5ffdbf1d475ffc4e80e4d5d720ff3a00f691795910116960ee12511/rpds_py-2026.6.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:7b689145a1485c335569bd056464f3243a29af7ed3871c7be31ad624ba239bc7", size = 342174, upload-time = "2026-06-30T07:14:54.821Z" }, + { url = "https://files.pythonhosted.org/packages/4d/dc/323d08583c0832911768663d1944f0107fcd4088704858d84b5e06d105a0/rpds_py-2026.6.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:db08f45aecde626498fb3df07bcf6d2ec040af42e859a4f5040d79c200342911", size = 345513, upload-time = "2026-06-30T07:14:56.515Z" }, + { url = "https://files.pythonhosted.org/packages/0b/2a/e31989834d18d2f26ec1d2774c5b1eb3331df4ea8ada525175294c94b48a/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:acc992ab27b15f852c76755eb2ab7dce86585ddadba6fa5946e58556088845b4", size = 373783, upload-time = "2026-06-30T07:14:57.736Z" }, + { url = "https://files.pythonhosted.org/packages/87/fe/e80107ee3639585c9941c17d6a42cd65325022f656c023191fce78c324c8/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f88d653e7b3b779d71ae7454e20dcc9b6bae903f33c269db9f2be41bda3f261", size = 378316, upload-time = "2026-06-30T07:14:59.077Z" }, + { url = "https://files.pythonhosted.org/packages/22/6f/81e3adf81acfb6fa694de2a6e4e7d8863121e3e0799e0a7725e6cf5679c4/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e52655eaf81e32593abedaa4bfe33170c8cfedf3365ed9be6e11e07f148f0278", size = 499423, upload-time = "2026-06-30T07:15:00.488Z" }, + { url = "https://files.pythonhosted.org/packages/2d/9a/41263969df0ce3d9af2a96d5005a288200af1989aed3354bfceb5fc0b21f/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dfcc8b909769d19db55c7cc9541eb64b9b774b1057ffffb4f1048070475bb9f9", size = 386077, upload-time = "2026-06-30T07:15:01.911Z" }, + { url = "https://files.pythonhosted.org/packages/5e/19/7e98f468bd50346faff5b10e5297374b443bfdddacc8e9fbc65984539597/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c1255b302953c86a486b81d330d5ee1d5bd937691ce271b6be0ef0e299eaab7", size = 371315, upload-time = "2026-06-30T07:15:03.317Z" }, + { url = "https://files.pythonhosted.org/packages/99/3c/2b973b4d371906a134b03decfea7f5d9835a2c6d263454392e15b64b5b18/rpds_py-2026.6.3-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:8d2294a31386bfa251d8c8a39472beee17db67d4f1a6eabea665d35c9a4461c3", size = 383502, upload-time = "2026-06-30T07:15:04.627Z" }, + { url = "https://files.pythonhosted.org/packages/98/2a/12e2799500af0a307bca76b63361c51f9fe479223561489c29eea1f2ee41/rpds_py-2026.6.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f8f23ead891a3b762f35ab3b04623da7056545b48aa60d59957e6789914545da", size = 402673, upload-time = "2026-06-30T07:15:05.856Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e3/21e5872d165fe08be4f229e3d5ee9d90019c0bf0e5538de60dbd54009450/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:421aba32367055614287a4292b6a17f1939c9452299f7a0209c117e990b646d4", size = 549964, upload-time = "2026-06-30T07:15:07.159Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d0/5ee0fe36844297de8123bee27bc12078c1a7416ad9f1b8a8ca18d6b0c0ac/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1e5822dfc2f0d4ab7e745eaa6d85945069329beeccef965af3f3bb26058fcab6", size = 615446, upload-time = "2026-06-30T07:15:08.531Z" }, + { url = "https://files.pythonhosted.org/packages/b1/80/1ea5873cb683f2fbe5f21b23ea1f6d179ead19f3c5b249b7eb5dca568ef2/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:83e35b57523816c8613fd0776b40cd8bb9f596b37ddd2692eb4a6bb5ab2f8c93", size = 576975, upload-time = "2026-06-30T07:15:09.97Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e1/90ef639217a5ddb15b7f4f61b1c33911fd044ad03c311bafdd2bcab85582/rpds_py-2026.6.3-cp311-cp311-win32.whl", hash = "sha256:de3eceba0b683bcbb1ab93da016d0270df1f9ae7be716b40214c5dafac6ea45a", size = 204453, upload-time = "2026-06-30T07:15:11.324Z" }, + { url = "https://files.pythonhosted.org/packages/f2/b7/b7a1695d7af36f521fb11e80d6d3adbd744f73b921859bd3c2a2c0dc706f/rpds_py-2026.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:2c54a076ca4d370980ab57bc0e31df57bbe8d41340436a90ef8b1219a3cbb127", size = 223219, upload-time = "2026-06-30T07:15:12.476Z" }, + { url = "https://files.pythonhosted.org/packages/d7/a2/145afacf796e4506062825941176ad9445c2dcf2b3b6a1f13d3030a15e19/rpds_py-2026.6.3-cp311-cp311-win_arm64.whl", hash = "sha256:168c733a7112e071bb7a66460e667edfcff06c017a3c523f7a8a8e08d0140804", size = 219137, upload-time = "2026-06-30T07:15:13.631Z" }, + { url = "https://files.pythonhosted.org/packages/5c/be/2e8974163072e7bab7df1a5acd54c4498e75e35d6d18b864d3a9d5dadc92/rpds_py-2026.6.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a0811d33247c3d6128a3001d763f2aa056bb3425204335400ac54f89eec3a0d0", size = 343691, upload-time = "2026-06-30T07:15:14.96Z" }, + { url = "https://files.pythonhosted.org/packages/a4/73/319dfa745dd668efe89309141ded489126461fcecd2b8f3a3cda185129b6/rpds_py-2026.6.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:538949e262e46caa31ac01bdb3c1e8f642622922cacbabbae6a8445d9dc33eaf", size = 338542, upload-time = "2026-06-30T07:15:16.267Z" }, + { url = "https://files.pythonhosted.org/packages/21/63/4239893be1c4d09b709b1a8f6be4188f0870084ff547f46606b8a75f1b03/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55927d532399c2c646100ff7feb48eaa940ad70f42cd68e1328f3ded9f81ca24", size = 368180, upload-time = "2026-06-30T07:15:17.62Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ca/9c5de382225234ceb37b1844ebdb140db12b2a278bb9efe2fcd19f6c82ce/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f56f1695bc5c0871cbc33dc0130fcf503aab0c57dcc5a6700a4f49eba4f2652e", size = 375067, upload-time = "2026-06-30T07:15:18.952Z" }, + { url = "https://files.pythonhosted.org/packages/87/dc/863f69d1bf04ade34b7fe0d59b9fdf6f0135fe2d7cbca74f1d665589559d/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:270b293dae9058fc9fcedab50f13cebf46fb8ed1d1d54e0521a9da5d6b211975", size = 490509, upload-time = "2026-06-30T07:15:20.434Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ef/eac16a12048b45ec7c7fa94f2be3438a5f26bf9cc8580b18a1cfd609b7f6/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:127565fead0a10943b282957bd5447804ff3160ad79f2ad2635e6d249e380680", size = 382754, upload-time = "2026-06-30T07:15:21.831Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/d2f3f532616be4d06c316ef119683e832bd3d41e112bf3a88f4151c95b17/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecabd69db66de867690f9797f2f8fa27ba501bbc24540cbdbdc649cd15888ba6", size = 366189, upload-time = "2026-06-30T07:15:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/e3/29/41a7b0e98a4b44cd676ab7598419623373eb43b20be68c084935c1a8cf88/rpds_py-2026.6.3-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:58eadac9cd119677b60e1cf8ac4052f35949d71b8a9e5556efccbe82533cf22a", size = 377750, upload-time = "2026-06-30T07:15:24.659Z" }, + { url = "https://files.pythonhosted.org/packages/2e/05/ecda0bec46f9a1565090bcdc941d023f6a25aff85fda28f89f8d19878152/rpds_py-2026.6.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7491ee23305ac3eb59e492b6945881f5cd77a6f731061a3f25b77fd40f9e99a4", size = 395576, upload-time = "2026-06-30T07:15:25.987Z" }, + { url = "https://files.pythonhosted.org/packages/68/a8/6ed52f03ee6cb854ce78785cc9a9a672eb880e83fd7224d471f667d151f1/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2c99f7e8ccb3dd6e3e4bfeac657a7b208c9bac8075f4b078c02d7404c34107fa", size = 543807, upload-time = "2026-06-30T07:15:27.356Z" }, + { url = "https://files.pythonhosted.org/packages/8f/d6/156c0d3eea27ba09b92562ba2364ba124c0a061b199e17eac637cd25a5e2/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:62698275682bf121181861295c9181e789030a2d516071f5b8f3c23c170cd0fc", size = 611187, upload-time = "2026-06-30T07:15:28.931Z" }, + { url = "https://files.pythonhosted.org/packages/f1/31/774212ed989c62f7f310220089f9b0a3fb8f40f5443d1727abd5d9f52bc9/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a214c993455f99a89aaeadc9b21241900037adc9d97203e374d75513c5911822", size = 573030, upload-time = "2026-06-30T07:15:30.553Z" }, + { url = "https://files.pythonhosted.org/packages/c9/50/22f73127a41f1ce4f87fe39aadfb9a126345801c274aa93ae88456249327/rpds_py-2026.6.3-cp312-cp312-win32.whl", hash = "sha256:501f9f04a588d6a09179368c57071301445191767c64e4b52a6aa9871f1ef5ed", size = 202185, upload-time = "2026-06-30T07:15:32.027Z" }, + { url = "https://files.pythonhosted.org/packages/04/3a/f0ee4d4dde9d3b69dedf1b5f74e7a40017046d55052d173e418c6a94f960/rpds_py-2026.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:2c958bf94822e9290a40aaf2a822d4bc5c88099093e3948ad6c571eca9272e5f", size = 220394, upload-time = "2026-06-30T07:15:33.359Z" }, + { url = "https://files.pythonhosted.org/packages/f3/83/3382fe37f809b59f02aac04dbc4e765b480b46ee0227ed516e3bdc4d3dfc/rpds_py-2026.6.3-cp312-cp312-win_arm64.whl", hash = "sha256:22bffe6042b9bcb0822bcd1955ec00e245daf17b4344e4ed8e9551b976b63e96", size = 215753, upload-time = "2026-06-30T07:15:34.778Z" }, + { url = "https://files.pythonhosted.org/packages/b4/9c/f0d19ac587fd0e4ab6b72cda355e9c5a6166b01ef7e064e437aef8eb9fef/rpds_py-2026.6.3-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:4cf2d36a2357e4d07bb5a4f98801265327b48256867816cfd2ceb001e9754a8f", size = 349791, upload-time = "2026-06-30T07:17:33.315Z" }, + { url = "https://files.pythonhosted.org/packages/38/c7/1d49d204c9fd2ee6c537601dc4c1ba921e03363ca576bfab94a00254ac9a/rpds_py-2026.6.3-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:30c6dc199b24a5e3e81d50da0f00858c5bbdb2617a750395687f4339c5818171", size = 352842, upload-time = "2026-06-30T07:17:34.897Z" }, + { url = "https://files.pythonhosted.org/packages/ac/e5/c0b5dc93cd0d4c06ce1f438907649514e2ea077bcd911e3154a51e96c38e/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9891e594296ab9dada6551c8e7b387b2721f27a67eecd528412e8906247a7b90", size = 382094, upload-time = "2026-06-30T07:17:36.514Z" }, + { url = "https://files.pythonhosted.org/packages/0d/54/ec0e907b4ca8d541112db352409bd15f871c9b243e0c92c9b5a46ae96f01/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5c2dc92304aa48a4a60443b548bb12f12e119d4b72f314015e67b9e1be97fca", size = 388662, upload-time = "2026-06-30T07:17:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f4/921c22a4fd0f1c1ac13a3996ffbf0aa67951e2c8ad0d1d9574938a2932e8/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:127e08c0642d880cf32ca47ec2a4a77b901f7e2dd1ad9762adb13955d72ffcc9", size = 504896, upload-time = "2026-06-30T07:17:39.689Z" }, + { url = "https://files.pythonhosted.org/packages/0b/1b/a114b972cefa1ab1cdb3c7bb177cd3844a12826c507c722d3a73516dbbaf/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8bb68f03f395eb793220b45c097bd4d8c32944393da0fad8b999efac0868fc8c", size = 391545, upload-time = "2026-06-30T07:17:41.336Z" }, + { url = "https://files.pythonhosted.org/packages/4e/98/af9b3db77d47fcbe6c8c1f36e2c2147ec70292819e99c325f871584a1c11/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3450b693fde92133e9f51060568a4c31fcca76d5e53bbd611e689ca446517e9", size = 380059, upload-time = "2026-06-30T07:17:42.857Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ba/0efd8668b97c1d26a61566386c636a7a7a09829e474fdf807caa15a2c844/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:5e8d07bddee435a2ff6f1920e18feff28d0bc4533e42f4bf6927fbd073312c41", size = 393235, upload-time = "2026-06-30T07:17:44.637Z" }, + { url = "https://files.pythonhosted.org/packages/62/90/8c139ee9690f73b0829f32647de6f40d826f8f443af6fa72644f96351aac/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3a83ae6c67b7676b9878378547ca8e93ed77a580037bcbcd1d32f739e1e6089c", size = 413008, upload-time = "2026-06-30T07:17:46.225Z" }, + { url = "https://files.pythonhosted.org/packages/9c/97/0043896fdd7828ce09a1d9a8b06433714d0960fc4ff3fc4aa72b666b764e/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:2bfd04c19ddbd6640de0b51894d764bd2758854d5b75bd102d2ef10cb9c293a9", size = 558118, upload-time = "2026-06-30T07:17:47.759Z" }, + { url = "https://files.pythonhosted.org/packages/f6/40/02355f0e134f783a8f9814c4680a1bd311d37671577a5964ea838573ff37/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:ca6546b66be9dc4738b1b043d5ebd5488c66c578c5ff0fd0e8065313fe3afb76", size = 623138, upload-time = "2026-06-30T07:17:49.355Z" }, + { url = "https://files.pythonhosted.org/packages/10/85/48f0abdcef5cce4e034c7a5b0ceeceba0b01bf0d942824f4bb720afe2dec/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:8e65860d238379ed982fd9ba690579b5e95af2f4840f99c772816dbe573cb826", size = 586486, upload-time = "2026-06-30T07:17:51.141Z" }, +] + +[[package]] +name = "ruff" +version = "0.11.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/90/61/fb87430f040e4e577e784e325351186976516faef17d6fcd921fe28edfd7/ruff-0.11.2.tar.gz", hash = "sha256:ec47591497d5a1050175bdf4e1a4e6272cddff7da88a2ad595e1e326041d8d94", size = 3857511, upload-time = "2025-03-21T13:31:17.419Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/99/102578506f0f5fa29fd7e0df0a273864f79af044757aef73d1cae0afe6ad/ruff-0.11.2-py3-none-linux_armv6l.whl", hash = "sha256:c69e20ea49e973f3afec2c06376eb56045709f0212615c1adb0eda35e8a4e477", size = 10113146, upload-time = "2025-03-21T13:30:26.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/ad/5cd4ba58ab602a579997a8494b96f10f316e874d7c435bcc1a92e6da1b12/ruff-0.11.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:2c5424cc1c4eb1d8ecabe6d4f1b70470b4f24a0c0171356290b1953ad8f0e272", size = 10867092, upload-time = "2025-03-21T13:30:37.949Z" }, + { url = "https://files.pythonhosted.org/packages/fc/3e/d3f13619e1d152c7b600a38c1a035e833e794c6625c9a6cea6f63dbf3af4/ruff-0.11.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ecf20854cc73f42171eedb66f006a43d0a21bfb98a2523a809931cda569552d9", size = 10224082, upload-time = "2025-03-21T13:30:39.962Z" }, + { url = "https://files.pythonhosted.org/packages/90/06/f77b3d790d24a93f38e3806216f263974909888fd1e826717c3ec956bbcd/ruff-0.11.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c543bf65d5d27240321604cee0633a70c6c25c9a2f2492efa9f6d4b8e4199bb", size = 10394818, upload-time = "2025-03-21T13:30:42.551Z" }, + { url = "https://files.pythonhosted.org/packages/99/7f/78aa431d3ddebfc2418cd95b786642557ba8b3cb578c075239da9ce97ff9/ruff-0.11.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20967168cc21195db5830b9224be0e964cc9c8ecf3b5a9e3ce19876e8d3a96e3", size = 9952251, upload-time = "2025-03-21T13:30:45.196Z" }, + { url = "https://files.pythonhosted.org/packages/30/3e/f11186d1ddfaca438c3bbff73c6a2fdb5b60e6450cc466129c694b0ab7a2/ruff-0.11.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:955a9ce63483999d9f0b8f0b4a3ad669e53484232853054cc8b9d51ab4c5de74", size = 11563566, upload-time = "2025-03-21T13:30:47.516Z" }, + { url = "https://files.pythonhosted.org/packages/22/6c/6ca91befbc0a6539ee133d9a9ce60b1a354db12c3c5d11cfdbf77140f851/ruff-0.11.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:86b3a27c38b8fce73bcd262b0de32e9a6801b76d52cdb3ae4c914515f0cef608", size = 12208721, upload-time = "2025-03-21T13:30:49.56Z" }, + { url = "https://files.pythonhosted.org/packages/19/b0/24516a3b850d55b17c03fc399b681c6a549d06ce665915721dc5d6458a5c/ruff-0.11.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3b66a03b248c9fcd9d64d445bafdf1589326bee6fc5c8e92d7562e58883e30f", size = 11662274, upload-time = "2025-03-21T13:30:52.055Z" }, + { url = "https://files.pythonhosted.org/packages/d7/65/76be06d28ecb7c6070280cef2bcb20c98fbf99ff60b1c57d2fb9b8771348/ruff-0.11.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0397c2672db015be5aa3d4dac54c69aa012429097ff219392c018e21f5085147", size = 13792284, upload-time = "2025-03-21T13:30:54.24Z" }, + { url = "https://files.pythonhosted.org/packages/ce/d2/4ceed7147e05852876f3b5f3fdc23f878ce2b7e0b90dd6e698bda3d20787/ruff-0.11.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:869bcf3f9abf6457fbe39b5a37333aa4eecc52a3b99c98827ccc371a8e5b6f1b", size = 11327861, upload-time = "2025-03-21T13:30:56.757Z" }, + { url = "https://files.pythonhosted.org/packages/c4/78/4935ecba13706fd60ebe0e3dc50371f2bdc3d9bc80e68adc32ff93914534/ruff-0.11.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2a2b50ca35457ba785cd8c93ebbe529467594087b527a08d487cf0ee7b3087e9", size = 10276560, upload-time = "2025-03-21T13:30:58.881Z" }, + { url = "https://files.pythonhosted.org/packages/81/7f/1b2435c3f5245d410bb5dc80f13ec796454c21fbda12b77d7588d5cf4e29/ruff-0.11.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7c69c74bf53ddcfbc22e6eb2f31211df7f65054bfc1f72288fc71e5f82db3eab", size = 9945091, upload-time = "2025-03-21T13:31:01.45Z" }, + { url = "https://files.pythonhosted.org/packages/39/c4/692284c07e6bf2b31d82bb8c32f8840f9d0627d92983edaac991a2b66c0a/ruff-0.11.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6e8fb75e14560f7cf53b15bbc55baf5ecbe373dd5f3aab96ff7aa7777edd7630", size = 10977133, upload-time = "2025-03-21T13:31:04.013Z" }, + { url = "https://files.pythonhosted.org/packages/94/cf/8ab81cb7dd7a3b0a3960c2769825038f3adcd75faf46dd6376086df8b128/ruff-0.11.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:842a472d7b4d6f5924e9297aa38149e5dcb1e628773b70e6387ae2c97a63c58f", size = 11378514, upload-time = "2025-03-21T13:31:06.166Z" }, + { url = "https://files.pythonhosted.org/packages/d9/3a/a647fa4f316482dacf2fd68e8a386327a33d6eabd8eb2f9a0c3d291ec549/ruff-0.11.2-py3-none-win32.whl", hash = "sha256:aca01ccd0eb5eb7156b324cfaa088586f06a86d9e5314b0eb330cb48415097cc", size = 10319835, upload-time = "2025-03-21T13:31:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/86/54/3c12d3af58012a5e2cd7ebdbe9983f4834af3f8cbea0e8a8c74fa1e23b2b/ruff-0.11.2-py3-none-win_amd64.whl", hash = "sha256:3170150172a8f994136c0c66f494edf199a0bbea7a409f649e4bc8f4d7084080", size = 11373713, upload-time = "2025-03-21T13:31:13.148Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d4/dd813703af8a1e2ac33bf3feb27e8a5ad514c9f219df80c64d69807e7f71/ruff-0.11.2-py3-none-win_arm64.whl", hash = "sha256:52933095158ff328f4c77af3d74f0379e34fd52f175144cefc1b192e7ccd32b4", size = 10441990, upload-time = "2025-03-21T13:31:15.206Z" }, +] + +[[package]] +name = "secretstorage" +version = "3.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "jeepney" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/1c/03/e834bcd866f2f8a49a85eaff47340affa3bfa391ee9912a952a1faa68c7b/secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be", size = 19884, upload-time = "2025-11-23T19:02:53.191Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/46/f5af3402b579fd5e11573ce652019a67074317e18c1935cc0b4ba9b35552/secretstorage-3.5.0-py3-none-any.whl", hash = "sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137", size = 15554, upload-time = "2025-11-23T19:02:51.545Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + +[[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.4.11" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "starlette" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2b/54/6767bb789b2f2fed6e0f953df949cd39dc263a384c1b65a95232598621d6/sse_starlette-3.4.11.tar.gz", hash = "sha256:1bae716c02f3e6f294be41ff333220692dae7c3cbab077c900f159676719dade", size = 34972, upload-time = "2026-09-05T12:11:04.607Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/6a/2ba3ed4a69babf3afdddf7d8314a48d87562c0a442206bbc2a1b50d5efc0/sse_starlette-3.4.11-py3-none-any.whl", hash = "sha256:c7b2244bdff016fe7f64e10075e89a3e6bbf899649cc89b0fe884b5545042453", size = 17122, upload-time = "2026-09-05T12:11:03.195Z" }, +] + +[[package]] +name = "starlette" +version = "1.7.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7b/2b/3850dc6bf7ef71b088962eba31dafc6cffd2f96e577ebb0bb316df96da3e/starlette-1.7.0.tar.gz", hash = "sha256:c79f74ea63cff761804fbbfb182f1e0b440c2d07b164d24700c5a1bab5d6ff5d", size = 2736246, upload-time = "2026-09-23T07:30:26.35Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4e/d6/1ec1b290f9e0fb067899b61e1d37a30c923068bad260b216dbe37a7d2967/starlette-1.7.0-py3-none-any.whl", hash = "sha256:67f8e99895493dd2911a03f11314af6ceebeae4e704bb9f43dfc6a9db151c93e", size = 78980, upload-time = "2026-09-23T07:30:24.567Z" }, +] + +[[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.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/a3/1585216310e344e8102c22482f6060c7a6ea0322b63e026372e6dcefcfd6/truststore-0.10.4.tar.gz", hash = "sha256:9d91bd436463ad5e4ee4aba766628dd6cd7010cf3e2461756b3303710eebc301", size = 26169, upload-time = "2025-08-12T18:49:02.73Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/97/56608b2249fe206a67cd573bc93cd9896e1efb9e98bce9c163bcdc704b88/truststore-0.10.4-py3-none-any.whl", hash = "sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981", size = 18660, upload-time = "2025-08-12T18:49:01.46Z" }, +] + +[[package]] +name = "typer" +version = "0.27.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "rich" }, + { name = "shellingham" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/f7/57713ba479fd405eb76de31404b2c744c289e336b2d999511ebf51e496f7/typer-0.27.2.tar.gz", hash = "sha256:269b7eb9d3c202ca84b4bc9618cb04ebb43d3d4d1e567e4c768607232c05f945", size = 204045, upload-time = "2026-08-28T10:26:55.046Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/bf/205d0004930ede8f542fb58f601526fccf4ae7626075ca1e6c4de5d3d652/typer-0.27.2-py3-none-any.whl", hash = "sha256:b3a5fc4342d5fc8fda8fc3010b1cf117e9249aab7fae800c2eff62fd3842d97d", size = 123130, upload-time = "2026-08-28T10:26:53.752Z" }, +] + +[[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 = "uncalled-for" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6b/5a/92ce0b3ea5481915f55da994c2c2c5f7a3c09949afde196ee89f8ab961aa/uncalled_for-0.4.0.tar.gz", hash = "sha256:335b95bd2422332ec210d518f314a16e4c640921c39fc8bf2ad095bd3538f4af", size = 56979, upload-time = "2026-08-10T14:51:46.247Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/40/97cec87c077eb3291fc7905e6633e08b7ca593c57d30238444bcb6bb3d53/uncalled_for-0.4.0-py3-none-any.whl", hash = "sha256:16c4bb3337532e4bd5569adc192285976f3ad5305402256d34c67a12b5c968bd", size = 15502, upload-time = "2026-08-10T14:51:45.068Z" }, +] + +[[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.53.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5d/ad/04bbb797c84fc1f26cb171f7394716f4865ffb8d8c5e1eef42565c2dfa6b/uvicorn-0.53.0.tar.gz", hash = "sha256:a9356f0cb89b3b8621529c5d5eebd69bfe154f4c3f68b4cf2de47e45fa855c2e", size = 110881, upload-time = "2026-09-14T07:44:23.815Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/18/0eea75741ee812e9f598b687619ce2454f6c3a1c5cd21ea990ec6bd26f45/uvicorn-0.53.0-py3-none-any.whl", hash = "sha256:e8dca71ec86dce5f04e333f0d56cdedf942446e6643b9cea1af0d6d3a02cb03e", size = 87081, upload-time = "2026-09-14T07:44:22.179Z" }, +] + +[[package]] +name = "virtualenv" +version = "21.12.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "distlib" }, + { name = "filelock" }, + { name = "platformdirs" }, + { name = "python-discovery" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ad/3b/02608bb39c6b6f7d59ca62b04d704cf61e85361a7123b6394bca275661e1/virtualenv-21.12.1.tar.gz", hash = "sha256:be5a0a62cb2d1529ff6999652e2e7826f95bf7faa9b96b88cc39847c023d90a0", size = 5397187, upload-time = "2026-09-24T19:03:48.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f5/8c/692cf235722ee45c612630d2b49b3d1765892f7e440055365ea1b59c659e/virtualenv-21.12.1-py3-none-any.whl", hash = "sha256:878db9e963d0ef0b38561a344a4f9b12dc5c7741b6245d7ed10e9291cfea28bc", size = 5486096, upload-time = "2026-09-24T19:03:45.985Z" }, +] + +[[package]] +name = "watchfiles" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b3/68/e6aa0b77d217b31f8f486ec0cdfe5e00e6e38dc0be657e7d85819b9faf0a/watchfiles-1.3.0.tar.gz", hash = "sha256:99aee4a07847c06820765fd7b1b49ceac4f3f711ccb7d104655a33231de1c207", size = 108119, upload-time = "2026-09-21T09:08:55.664Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/68/fa/c0b840d5d8bafe640925408ce11095948c8945bb61be1e67d0ab629b872a/watchfiles-1.3.0-cp310-abi3-macosx_10_12_x86_64.whl", hash = "sha256:000b9688fc8133037a8b075c8ebf98f32844ff8964dda61e85c1db547dafc441", size = 399703, upload-time = "2026-09-21T09:08:13.518Z" }, + { url = "https://files.pythonhosted.org/packages/c7/8a/894799b485fe9473ad10422a0d9668e53fb78e3a2b5cc6061159572844ad/watchfiles-1.3.0-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:bbc1198edfdc90fda0600f825aa94150f428dfcbf8138746f55998e0e660d64c", size = 397647, upload-time = "2026-09-21T09:08:15.16Z" }, + { url = "https://files.pythonhosted.org/packages/5a/61/f277cd5ead05f5d37b98b41fbdd0c943ee0c04d49738f62e902cb291cf43/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4af9c464d410e8c44b58ddf1cbec7c3a02c1cb2c6c80df9c74659ba2fbda0ab5", size = 454994, upload-time = "2026-09-21T09:08:16.587Z" }, + { url = "https://files.pythonhosted.org/packages/46/66/ea4c01382975e53b1ac1b0a0ea1b353416b8127fb6e04f5c1c313119aab6/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:eb94e40b9a0db19636b5e3fed0a9803452ecc7381df13b385272abb779ee83ca", size = 460105, upload-time = "2026-09-21T09:08:17.961Z" }, + { url = "https://files.pythonhosted.org/packages/31/c3/1a501b597817096c9831c255f6270c124ce0e2faeb74124be24dcc93b86d/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7398930a2b76b9dc67a4e6b8bfc7baf30946892a86f417a3920c07bdd6febc30", size = 493761, upload-time = "2026-09-21T09:08:19.327Z" }, + { url = "https://files.pythonhosted.org/packages/5a/16/77352d05e152c7786a016e9f1decdb4507e8aa5bcf3343c72142a0413d14/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:025b108f2d5cc2799cb941f79380df3e8b22bfb589c218e801767fe78d598c95", size = 577500, upload-time = "2026-09-21T09:08:20.723Z" }, + { url = "https://files.pythonhosted.org/packages/95/fe/81001c55b24466fe9911135e50269fd3a29f43e446627a92adfab54553b6/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:be9ef3cd403d756a304a0a08a112163c63da7ec72c8c9d083c98818291ff8f29", size = 469209, upload-time = "2026-09-21T09:08:22.346Z" }, + { url = "https://files.pythonhosted.org/packages/8a/cf/e3ad894ed5909a7c44b0707e89bc25d19a3d78b3a7aec846119443b6ae56/watchfiles-1.3.0-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b5768b49e426fd5b550b012c866db347cdf15c398ef98dc557b6e6b72fa74cd1", size = 458353, upload-time = "2026-09-21T09:08:23.7Z" }, + { url = "https://files.pythonhosted.org/packages/7f/f5/2f106829e6e2bc91ad74614730f6df484202b9a4d20d927dbf2f08d37d44/watchfiles-1.3.0-cp310-abi3-manylinux_2_31_riscv64.whl", hash = "sha256:d36c72fcdc08f143d87316a4c4c3b064e340da2c7383d39803950740ed418935", size = 468707, upload-time = "2026-09-21T09:08:25.167Z" }, + { url = "https://files.pythonhosted.org/packages/15/37/2741ab776b978669c1f3bba1e573f1a184f727ab8b4d3a6d9c61090800ed/watchfiles-1.3.0-cp310-abi3-musllinux_1_1_aarch64.whl", hash = "sha256:f0c9865240e065a2247f4b5248528ae3d01e0e8ae071462c250c884dc16e3ee3", size = 632510, upload-time = "2026-09-21T09:08:26.532Z" }, + { url = "https://files.pythonhosted.org/packages/48/64/db4a4684275fe9b696ee5118c194705c1423b3d42181c3f8ee70194d5c73/watchfiles-1.3.0-cp310-abi3-musllinux_1_1_x86_64.whl", hash = "sha256:380f513d26cc2e598266b88d66456e07d67ef4be8f0f435a1154d9c44b43d509", size = 661723, upload-time = "2026-09-21T09:08:28.004Z" }, + { url = "https://files.pythonhosted.org/packages/52/80/95ddb24f6a2f595c031c24432ab7b8aa7d6d1ada0c6d63a552166e06e8d1/watchfiles-1.3.0-cp310-abi3-win32.whl", hash = "sha256:509d9f74d2bec5c1f4cd868ddcfe0c9601f7ea53066dfcb19d8ede742c4de661", size = 277761, upload-time = "2026-09-21T09:08:29.335Z" }, + { url = "https://files.pythonhosted.org/packages/48/a1/1c4a1b3c8030cd03206232612be8a6e8799093490c220b0fcb935d02b75a/watchfiles-1.3.0-cp310-abi3-win_amd64.whl", hash = "sha256:1acabde19b67e673274e89a04d613b7fb1f122e2c4b8ec9a581e59c149264b61", size = 290643, upload-time = "2026-09-21T09:08:30.45Z" }, + { url = "https://files.pythonhosted.org/packages/82/e0/d2db577c632d26d08078c4390dd870b8555c4e558df25d22270f0166c71f/watchfiles-1.3.0-cp310-abi3-win_arm64.whl", hash = "sha256:d978cc1dd7ba44f5590d7de74f7a9c8be7262d9e469c2c0efb8bbfc2574321dc", size = 285510, upload-time = "2026-09-21T09:08:31.561Z" }, + { url = "https://files.pythonhosted.org/packages/cd/eb/289fec71eba51d6c3ef3a28c81f7213f4e860084ffae5abc866933c564f0/watchfiles-1.3.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:45726c6b5a8d67c8087eb2933c4398948546d04206ef40f629dc4881d65d23d1", size = 396932, upload-time = "2026-09-21T09:08:50.217Z" }, + { url = "https://files.pythonhosted.org/packages/92/cc/a3c3f557992a20a5bb24607f0da44d39cf6d6ba3f8f6ed7cb31f6c73371a/watchfiles-1.3.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:6398d250994baff581147ccba846223076fe6492ca93c0d1b3588fcf5355eb5c", size = 394852, upload-time = "2026-09-21T09:08:51.412Z" }, + { url = "https://files.pythonhosted.org/packages/55/65/d45763a5e1108a65af85a217af2930ebf1081c73fd8169d3f75e586992bb/watchfiles-1.3.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:591de392458bca26f6130fea4e667c06b657e873ad334ea06fad5a79f5086cef", size = 451789, upload-time = "2026-09-21T09:08:53.144Z" }, + { url = "https://files.pythonhosted.org/packages/02/96/165c6e540bf765ca1115062017adf861d0816525f02464ba71313fe7cf92/watchfiles-1.3.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5ec46a1ff4c1d81405a5fc645abdbff5e4e9388f7c9a6cdb392316a7c29b884f", size = 456919, upload-time = "2026-09-21T09:08:54.372Z" }, +] + +[[package]] +name = "wcwidth" +version = "0.9.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/dc/ac/3a943d2792c9bb368aaa8b50121c0f778460ba2d7fbdc0a0366201d9e761/wcwidth-0.9.1.tar.gz", hash = "sha256:5823209b0d43af322ce698c689380d7c15ca31fa8e6e3be8459f27031bef0af5", size = 952410, upload-time = "2026-09-23T20:23:49.127Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/48/7c/130de33c0a7f6efecee28fef5711fc1f8d55ac33885a6b85f4f6689004ba/wcwidth-0.9.1-cp310-abi3-macosx_10_9_x86_64.whl", hash = "sha256:10b00ba23482e352f874d2e8135e7ace9da838646c7dd800566246bbd46125ff", size = 604219, upload-time = "2026-09-23T20:23:22.071Z" }, + { url = "https://files.pythonhosted.org/packages/33/7c/c7bb03da54de7ac5a08753e186b963f91847b04ed8ae5be136a4d5f52b75/wcwidth-0.9.1-cp310-abi3-macosx_11_0_arm64.whl", hash = "sha256:40d936d72c9bdc10df43f93a8be502bc5024b487259139f66a328722c07f34a9", size = 609038, upload-time = "2026-09-23T20:23:24.941Z" }, + { url = "https://files.pythonhosted.org/packages/0b/71/f57effdf895c2d6d49333f1d6833a9f5438725c55a04ed3124a1c95bb3aa/wcwidth-0.9.1-cp310-abi3-manylinux1_i686.manylinux2014_i686.manylinux_2_17_i686.manylinux_2_5_i686.whl", hash = "sha256:69bb970cf5652b88cfdb9d3fdd1764fc15e5f8ad531643e7bb3e894cd969740e", size = 761464, upload-time = "2026-09-23T20:23:32.425Z" }, + { url = "https://files.pythonhosted.org/packages/4f/16/15b03d8fb7a747d0d2cf4a33da7b1b3e092493c58780f6589d5b1e9e3b49/wcwidth-0.9.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:b5da43d6967668982e44a52fb551967d293f86d26cd86036ac95bbdd34394ed9", size = 770483, upload-time = "2026-09-23T20:23:28.128Z" }, + { url = "https://files.pythonhosted.org/packages/e2/a0/834886b30e3b885a5a96e8358f1b3917bc0bac43ae4178d77f0c210d079b/wcwidth-0.9.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:747fb724223f417a17541a95a17c1dac3a8ef9a0cf41684950f0eab191a35f65", size = 768443, upload-time = "2026-09-23T20:23:33.875Z" }, + { url = "https://files.pythonhosted.org/packages/a2/ae/1b7597e0132ebc2c920632f39d8c1c61881345c9b480c0a95eb91e7460fa/wcwidth-0.9.1-cp310-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:6e1272b7986cefe79783737e38bdb9eaae0682b333c7bd132024441193dd5ce7", size = 781171, upload-time = "2026-09-23T20:23:29.46Z" }, + { url = "https://files.pythonhosted.org/packages/fb/bb/32149e3b481953f4ef35f38f166e2532886d33ae54ccdd71393f821dfad9/wcwidth-0.9.1-cp310-abi3-musllinux_1_2_i686.whl", hash = "sha256:fe021c4d8de9d36c31a0cb41d0d2546dadd3b0708a301f1a0c66ce200851831f", size = 781576, upload-time = "2026-09-23T20:23:35.504Z" }, + { url = "https://files.pythonhosted.org/packages/d6/72/1ee3dff67697bda93bc56ec9f7b3b89609cd64b9abb328512a2f22eb9e47/wcwidth-0.9.1-cp310-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:708158c082364af442f9983de7b6ec9ac0d2e1b825ada25f0911b1f138d55405", size = 783526, upload-time = "2026-09-23T20:23:36.937Z" }, + { url = "https://files.pythonhosted.org/packages/ce/0a/e94f19a60f6127bcf3dfcf223ca05a37650d57b37b5ed623597c842ce7ca/wcwidth-0.9.1-cp310-abi3-win32.whl", hash = "sha256:356376852357b8fca71fe5415808ec421679e04b4a98eb7c9cb6a7984b911a05", size = 592136, upload-time = "2026-09-23T20:23:43.774Z" }, + { url = "https://files.pythonhosted.org/packages/3c/ff/d884d2ec7dcdc86cda742a86c7160bc726dbccae76d7ae1f9ac833c26680/wcwidth-0.9.1-cp310-abi3-win_amd64.whl", hash = "sha256:991d1c8834f548e9c1f16432075ee84638e122312556bbf1ed595ea8fffc4673", size = 596738, upload-time = "2026-09-23T20:23:44.989Z" }, + { url = "https://files.pythonhosted.org/packages/fa/93/16e30d617b937272a2310a6e3c1f9d8f94984e19ad4a96eb935628e3e6b6/wcwidth-0.9.1-cp310-abi3-win_arm64.whl", hash = "sha256:61bd7aef9cafb6cb77a37a169998d7928ce82a51522146d11f60db9e7d1cb43a", size = 594700, upload-time = "2026-09-23T20:23:41.013Z" }, + { url = "https://files.pythonhosted.org/packages/96/a2/f06f2e0be4895e5943d358755b51968ace85774cf0a4cc42b4dafb793832/wcwidth-0.9.1-py3-none-any.whl", hash = "sha256:e0c3a1c45c5b9550c6919a4449e95f5b177f6e165786376981db8f1addae9b21", size = 300656, upload-time = "2026-09-23T20:23:20.674Z" }, +] + +[[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/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" }, +] + +[[package]] +name = "zipp" +version = "4.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b9/d8/eab98a517c14134c0b2eb4e2387bc5f457334293ec5d2dd3857ec2966802/zipp-4.1.0.tar.gz", hash = "sha256:4cb57381f544315db7688e976e922a2b18cdb513d21cc194eb42232ba2a3e602", size = 26214, upload-time = "2026-05-18T20:08:57.967Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/13/547360d81e6d88d58492968ffda9f9542854f11310ee556fef14260cc886/zipp-4.1.0-py3-none-any.whl", hash = "sha256:25ad4e16390cd314347dd8f1de67a2ac538ae658ed4ab9db16029c07c188e97f", size = 10238, upload-time = "2026-05-18T20:08:57.045Z" }, +] diff --git a/harbor/sources/apscheduler-v17/.dockerignore b/harbor/sources/apscheduler-v17/.dockerignore new file mode 100644 index 0000000000000000000000000000000000000000..a82e2377cfd65dd4ffe560da44bb85908bf44ae9 --- /dev/null +++ b/harbor/sources/apscheduler-v17/.dockerignore @@ -0,0 +1,12 @@ +.venv/ +__pycache__ +*.pyc +.pytest_cache/ +.ruff_cache/ +.hud/ +.git/ +.github/ +tests/** +grading/adversarial/ +artifact-manifest.json +scaffold-manifest.json diff --git a/harbor/sources/apscheduler-v17/.gitignore b/harbor/sources/apscheduler-v17/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..99ccf78a3131f4a72586dc80d47addc8124aeccf --- /dev/null +++ b/harbor/sources/apscheduler-v17/.gitignore @@ -0,0 +1,9 @@ +.venv/ +__pycache__/ +*.pyc +.pytest_cache/ +.ruff_cache/ +.hud/ +dist/ +build/ +*.egg-info/ diff --git a/harbor/sources/apscheduler-v17/.hud_eval.toml b/harbor/sources/apscheduler-v17/.hud_eval.toml new file mode 100644 index 0000000000000000000000000000000000000000..647843901b8caa63505fe00e6570165341c4ee34 --- /dev/null +++ b/harbor/sources/apscheduler-v17/.hud_eval.toml @@ -0,0 +1,36 @@ +# HUD Eval Configuration +# Command-line arguments override these settings + +[eval] +# source = "hud-evals/SheetBench-50" +# agent = "claude" +# all = false # Run all problems instead of just 1 +# max_concurrent = 30 +# max_steps = 10 +# group_size = 1 +# task_ids = ["checkout-smoke", "0"] # slugs or 0-based indices +# verbose = true +# very_verbose = true +# auto_respond = true +# gateway = false # Route LLM API calls through HUD Gateway +# runtime = "local" # local, hud, or tcp://host:port +# remote = false # Run the whole rollout remotely on HUD + +[claude] +# model = "claude-sonnet-4-6" +# max_tokens = 16384 +# use_computer_beta = true + +[openai] +# model = "gpt-5.6" +# temperature = 0.7 +# max_output_tokens = 4096 + +[gemini] +# model = "gemini-2.5-pro" +# temperature = 1.0 +# top_p = 0.95 + +[openai_compatible] +# base_url = "http://localhost:8000/v1" +# model = "my-model" diff --git a/harbor/sources/apscheduler-v17/Dockerfile.hud b/harbor/sources/apscheduler-v17/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..6e1693814c315e50061082d029201e2cf2d400b0 --- /dev/null +++ b/harbor/sources/apscheduler-v17/Dockerfile.hud @@ -0,0 +1,115 @@ +# syntax=docker/dockerfile:1 +# Stage `runtime-contract` is the credential-free, source-free runtime the graders, the +# repository-native commands, and the agent prompt's tools run on. `validate-helper.py +# runtime-preflight` builds only this target (no BuildKit secret) and probes every declared +# executable and service here; the final `runtime` stage derives from it unchanged, so what the +# probe proves is what the served image carries. Keep credentials and the private clone out of it. +FROM ubuntu:24.04@sha256:224a1869083a311ef3f13648a154ba79832fbef6364d31493642ca03082da254 AS runtime-contract + +# Resolve uv once by immutable OCI digest. Independent local and HUD builds therefore copy the +# same binary instead of asking PyPI for whatever version happens to be current. +COPY --from=ghcr.io/astral-sh/uv:0.12.3@sha256:2d890623d310b57771ce840f0da5eed5fc6d657da05ffaa45d82797b53fa3abc /uv /uvx /bin/ + +# CPython 3.13.15 for the APScheduler test suite and the probes: python-build-standalone release +# 20260807, cpython-3.13.15+20260807-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz, +# sha256 faae10a9faa9bec06da009ac69326cc1d9691dc138fec6a1b69159dff1781f35 (the pinned uv verifies +# the archive against that checksum before unpacking it). +ENV UV_PYTHON_INSTALL_DIR=/opt/uv-python \ + UV_NO_CACHE=1 \ + UV_PYTHON_DOWNLOADS=manual +RUN uv python install 3.13.15 \ + && test "$(/opt/uv-python/cpython-3.13.15-linux-x86_64-gnu/bin/python3.13 -c 'import platform; print(platform.python_version())')" = "3.13.15" + +# System packages from the dated Ubuntu snapshot. The bare image has no CA store yet, so the +# snapshot's TLS certificate is verified against the bundle shipped inside the checksum-verified +# CPython archive above until ca-certificates is installed. +RUN sed -i \ + -e 's|http://archive.ubuntu.com/ubuntu/|https://snapshot.ubuntu.com/ubuntu/20260915T000000Z/|' \ + -e 's|http://security.ubuntu.com/ubuntu/|https://snapshot.ubuntu.com/ubuntu/20260915T000000Z/|' \ + /etc/apt/sources.list.d/ubuntu.sources \ + && apt-get -o Acquire::https::CaInfo=/opt/uv-python/cpython-3.13.15-linux-x86_64-gnu/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem update -y \ + && apt-get -o Acquire::https::CaInfo=/opt/uv-python/cpython-3.13.15-linux-x86_64-gnu/lib/python3.13/site-packages/pip/_vendor/certifi/cacert.pem install -y --no-install-recommends \ + bash \ + build-essential \ + ca-certificates \ + curl \ + git \ + gnupg \ + libpq5 \ + openssl \ + python-is-python3 \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + python3-wheel \ + rsync \ + util-linux \ + sqlite3 \ + vim \ + wget \ + && rm -rf /var/lib/apt/lists/* \ + && update-ca-certificates + +# The APScheduler test environment: hash-pinned test dependencies in a CPython 3.13 virtualenv, +# without APScheduler itself. The .pth entry puts the agent workspace's src/ on the path so +# `python -m pytest` works in the checkout; the grader pins its own copy ahead of it. +COPY ./runtime/apscheduler-test-requirements.txt /opt/apscheduler-runtime/requirements.txt +RUN uv venv --python /opt/uv-python/cpython-3.13.15-linux-x86_64-gnu/bin/python3.13 /opt/apscheduler-venv \ + && uv pip install --python /opt/apscheduler-venv/bin/python --require-hashes --no-deps -r /opt/apscheduler-runtime/requirements.txt \ + && echo /home/ubuntu/apscheduler/src > /opt/apscheduler-venv/lib/python3.13/site-packages/apscheduler-workspace-src.pth \ + && chmod -R a+rX /opt/uv-python /opt/apscheduler-venv /opt/apscheduler-runtime + +COPY ./pyproject.toml /hud/pyproject.toml +COPY ./uv.lock /hud/uv.lock +WORKDIR /hud +ENV RUST_LOG=warn \ + PYTHONPATH=/hud/.venv/lib/python3.12/site-packages:/hud \ + PATH=/hud/.venv/bin:/opt/apscheduler-venv/bin:$PATH +RUN uv venv --python /usr/bin/python3.12 && uv sync --frozen --no-install-project --extra dev + +FROM runtime-contract AS setup + +ARG REPO_URL="https://github.com/agronholm/apscheduler" +ARG BASE_COMMIT="6a2a8851bafeb01dfe48e3b54be6dd3b3d4eae96" +ARG FOLDER_NAME="apscheduler" + +ENV FOLDER_NAME=${FOLDER_NAME} \ + REPO_URL=${REPO_URL} \ + BASE_COMMIT=${BASE_COMMIT} \ + HOME=/home/ubuntu \ + PROJECT_DIR=/home/ubuntu/${FOLDER_NAME} \ + PATCHES_DIR=/hud/patches + +# The base repository is public (the upstream itself, or the published base), so the pinned +# commit is fetched by SHA with no credential and no other ref: the image never holds a branch +# that could reach the gold, and no BuildKit secret is mounted anywhere in this Dockerfile. +USER ubuntu +RUN git init -q /home/ubuntu/${FOLDER_NAME} && \ + cd /home/ubuntu/${FOLDER_NAME} && \ + git fetch -q --depth 1 --no-tags ${REPO_URL} ${BASE_COMMIT} && \ + git checkout -q --detach ${BASE_COMMIT} && \ + rm -f .git/FETCH_HEAD + +USER root +RUN chown -R ubuntu:ubuntu /home/ubuntu/${FOLDER_NAME} \ + && mkdir -p /hud/patches \ + && chown -R root:root /home/ubuntu/${FOLDER_NAME}/.git \ + && chmod -R 700 /home/ubuntu/${FOLDER_NAME}/.git + +FROM setup AS runtime + +USER root +WORKDIR /hud +COPY ./env.py /hud/env.py +COPY ./grading /hud/grading +COPY ./tasks.py /hud/tasks.py +COPY ./task /hud/task +COPY ./gold.diff /hud/gold.diff +RUN chmod -R 700 /hud \ + && chown -R root:root /hud +RUN chmod 700 /root + +ENV PROBLEM_ID="" +EXPOSE 8765 +CMD ["hud", "serve", "env:env", "--host", "0.0.0.0", "--port", "8765"] diff --git a/harbor/sources/apscheduler-v17/env.py b/harbor/sources/apscheduler-v17/env.py new file mode 100644 index 0000000000000000000000000000000000000000..2684a9f6b6135625b560d6b6b3ed8df540bc3399 --- /dev/null +++ b/harbor/sources/apscheduler-v17/env.py @@ -0,0 +1,712 @@ +"""Coding environment (HUD v6) for apscheduler_expired_job_lease. + +The environment publishes one ssh capability (a UID-walled Workspace); the agent's +harness brings its own bash/file tools. A task is a @env.template async +generator: yield a prompt, then yield a reward. + +Grading entry point contract: this module must never import the grader chain +(``grading.*``) at module import time. The chain is resolved lazily inside +``run_grading`` so that a missing or corrupted grader module degrades to a +fail-closed JSON result instead of aborting the import and emitting no output +at all. Prompt 05 populates the grader behind ``GRADER_ENTRY_POINT``; it must +not add a module-level ``grading`` import here. +""" + +import asyncio +import base64 +import datetime +import gzip +import hashlib +import importlib +import inspect +import json +import logging +import os +import shlex +import shutil +import stat +import subprocess +import sys +import tempfile +import time +import traceback +from pathlib import Path + +from hud.environment import Environment, Workspace +from hud.graders import EvaluationResult + +logger = logging.getLogger(__name__) + +TASK_ID = "apscheduler_expired_job_lease" +TASK_SLUG = "apscheduler-expired-job-lease" +HUD_ENV_NAME = "apscheduler-expired-job-lease" +FOLDER_NAME = os.environ.get("FOLDER_NAME", "apscheduler") +REPO_URL = os.environ.get("REPO_URL", "https://github.com/agronholm/apscheduler") +BASE_COMMIT_SHA = "6a2a8851bafeb01dfe48e3b54be6dd3b3d4eae96" +BASE_TREE_SHA = "5b3a736a7a85b255cb8f4fb06794192aa68d2d56" + +_explicit_dir = os.environ.get("PROJECT_DIR") +if _explicit_dir: + PROJECT_DIR = _explicit_dir + PATCHES_DIR = os.environ.get("PATCHES_DIR", "/hud/patches") + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / f"hud-{FOLDER_NAME}" + PROJECT_DIR = str(_LOCAL_ROOT / f"{FOLDER_NAME}-{os.getpid()}") + PATCHES_DIR = str(_LOCAL_ROOT / f"patches-{os.getpid()}") + _LOCAL_SUBSTRATE = True + +env = Environment(name="apscheduler-expired-job-lease") + + +#: Hard ceiling on one agent shell command. Three hosted runs of this task sat for hours after the +#: agent launched a test run that deadlocked: the SDK's Gemini and OpenAI agents apply no tool +#: timeout of their own and the SSH tool has none, so the environment enforces one. The longest +#: legitimate command seen in any exported trace was a 32-second full test run. On expiry the agent +#: receives exit status 124 with its own output and can retry with a narrower command. +AGENT_COMMAND_DEADLINE_SECONDS = 600 +AGENT_COMMAND_KILL_GRACE_SECONDS = 15 + +#: Environment of the agent shell. Pytest splits PYTEST_ADDOPTS with shlex, so the marker expression +#: must be quoted inside the value: an unquoted "-m not external_service" makes pytest read +#: "external_service" as a path and fail every invocation with exit 4. The guard keeps an accidental +#: bare pytest from flooding the context with external-service failures (one hosted run emitted +#: 4 MB from a bare pytest). Grading runs its own pinned command with its own environment. +AGENT_SHELL_ENV = {"HOME": "/home/ubuntu", "PYTEST_ADDOPTS": "-m 'not external_service' -q"} + + +def deadline_wrapped(command: str) -> str: + """Wrap one agent command so GNU timeout ends it after the configured deadline.""" + return ( + f"exec timeout --kill-after={AGENT_COMMAND_KILL_GRACE_SECONDS} " + f"{AGENT_COMMAND_DEADLINE_SECONDS} bash -lc {shlex.quote(command)}" + ) + + +class UidWallWorkspace(Workspace): + """Workspace that drops the agent shell to UID 1000 (ubuntu) when running as root. + + Every exec'd command is wrapped in a deadline (see ``deadline_wrapped``); an interactive + session (``command=None``) is not. Maintains full signature compatibility with + Workspace.shell_argv. + """ + + def shell_argv(self, command=None, *, cwd=None, env=None, tty: bool = False, **kwargs): + if command is not None: + command = deadline_wrapped(command) + super_kwargs = {"cwd": cwd, "env": env, "tty": tty} + sig = inspect.signature(super().shell_argv) + if "kwargs" in sig.parameters: + super_kwargs.update(kwargs) + else: + for k, v in kwargs.items(): + if k in sig.parameters: + super_kwargs[k] = v + argv = super().shell_argv(command, **super_kwargs) + if sys.platform != "win32" and hasattr(os, "geteuid") and os.geteuid() == 0: + argv = ["setpriv", "--reuid", "1000", "--regid", "1000", "--clear-groups", "--", *argv] + return argv + + +_ws = UidWallWorkspace( + PROJECT_DIR, + guest_path=PROJECT_DIR, + network=True, + env=AGENT_SHELL_ENV, +) + + +async def _git_step(args: list[str], cwd: str | None, label: str) -> None: + proc = await asyncio.create_subprocess_exec( + "git", *args, + cwd=cwd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + _, stderr = await proc.communicate() + if proc.returncode != 0: + raise RuntimeError(f"{label} failed: {stderr.decode(errors='replace')}") + + +async def _ensure_repo() -> None: + """Local-substrate fallback: the same single-commit, credential-free fetch the image performs.""" + if (Path(PROJECT_DIR) / ".git").exists(): + return + Path(PROJECT_DIR).parent.mkdir(parents=True, exist_ok=True) + logger.info("Fetching %s@%s into %s", REPO_URL, BASE_COMMIT_SHA, PROJECT_DIR) + await _git_step(["init", "-q", PROJECT_DIR], None, "git init") + await _git_step( + ["-c", f"safe.directory={PROJECT_DIR}", "fetch", "-q", "--depth", "1", "--no-tags", REPO_URL, BASE_COMMIT_SHA], + PROJECT_DIR, f"git fetch {REPO_URL} {BASE_COMMIT_SHA}", + ) + await _git_step( + ["-c", f"safe.directory={PROJECT_DIR}", "checkout", "-q", "--detach", BASE_COMMIT_SHA], + PROJECT_DIR, f"git checkout {BASE_COMMIT_SHA}", + ) + (Path(PROJECT_DIR) / ".git" / "FETCH_HEAD").unlink(missing_ok=True) + + +@env.initialize +async def _up() -> None: + await _ensure_repo() + await _ws.start() + env.add_capability(_ws.capability("shell")) + + +@env.shutdown +async def _down() -> None: + await _ws.stop() + if _LOCAL_SUBSTRATE: + shutil.rmtree(PROJECT_DIR, ignore_errors=True) + shutil.rmtree(PATCHES_DIR, ignore_errors=True) + + +def make_prompt(description: str) -> str: + return f"""You are working in a coding repository located at {PROJECT_DIR}. + +Use the tools provided to complete the following task: + +{description} + +Execution hygiene: keep tool output bounded so the agent context remains usable. Do not run +bare `pytest` or other unfiltered commands that can emit external-service failures. Prefer +`pytest -m \"not external_service\" -q` and targeted tests; redirect unusually verbose output +to a file and inspect a concise summary instead. +""" + + +# Grading entry point. Resolved lazily by ``run_grading``; never imported at module +# import time. Prompt 05 implements ``grade_repository`` in ``grading/runner.py``. +GRADER_ENTRY_POINT = ("grading.runner", "grade_repository") + +FAIL_CLOSED_LIST_KEYS = ("caps", "families", "subscores", "checks", "blockers") + + + +# --- Workspace snapshot --------------------------------------------------------------------- +# Captured around the grader, never inside ``grading/**`` (so the grader scale id is untouched): +# the agent's final workspace as a binary-safe git patch against the pinned base commit, attached +# to the grade envelope's ``info["workspace_snapshot"]``. Prompt 08 decodes it beside the trace +# export and Prompt 11 reconstructs the candidate from it instead of replaying the trajectory. +# +# Isolation: the env process runs as root against the root-owned ``.git`` through a scratch index +# and a scratch object directory (the real object store is read-only through alternates), so the +# agent's tree, the real index and the real objects are never written. Completeness: when the +# agent edited an ignore file the capture re-adds with ``--force`` (complete beats compact), and +# configured content filters are reported so diagnosis never trusts transformed bytes. Safety: +# the capture runs after the grader, under one deadline, streams the diff to disk and reads it +# only under the size cap; a capture failure degrades to ``unavailable`` and never touches the grade. + +WORKSPACE_SNAPSHOT_SCHEMA_VERSION = 2 +WORKSPACE_SNAPSHOT_MAX_BYTES_ENV = "HUD_WORKSPACE_SNAPSHOT_MAX_BYTES" # raw patch bytes; 0 disables +WORKSPACE_SNAPSHOT_DEADLINE_ENV = "HUD_WORKSPACE_SNAPSHOT_DEADLINE_SECONDS" # whole capture +WORKSPACE_SNAPSHOT_DEFAULT_MAX_BYTES = 4 * 1024 * 1024 +WORKSPACE_SNAPSHOT_DEFAULT_DEADLINE = 120.0 +WORKSPACE_SNAPSHOT_EXCLUDED_DIRS = ("node_modules", ".venv", ".hud", ".tmp", ".cache", "dist", "build", "cdk.out") +# Prompt 11's forbidden path parts, refused here too so they never enter the grade event. +WORKSPACE_SNAPSHOT_PROTECTED_NAMES = (".env", ".hud", "gold.diff", "grading", "mcp_server") +WORKSPACE_SNAPSHOT_IGNORE_FILES = (".gitignore", ".gitattributes") +WORKSPACE_SNAPSHOT_MAX_LISTED_FILES = 2000 +WORKSPACE_SNAPSHOT_GIT_TIMEOUT = 60 +WORKSPACE_SNAPSHOT_ENCODING = "gzip+base64" + + +def _snapshot_limit(name: str, default, cast): + try: + return cast(os.environ.get(name, default)) + except (TypeError, ValueError): + return cast(default) + + +def _snapshot_payload(base_commit_sha: str, max_bytes: int | None, **fields) -> dict: + payload = { + "schema_version": WORKSPACE_SNAPSHOT_SCHEMA_VERSION, + "status": "unavailable", + "reason": None, + "base_commit_sha": base_commit_sha, + "head_commit_sha": None, + "patch_sha256": None, + "patch_size": None, + "changed_files": [], + "changed_file_count": None, + "changed_files_truncated": False, + "ignore_rules_modified": None, + "ignored_entry_count": None, + "capture_mode": None, + "filtered": None, + "content_filters": {"configured": [], "attributes_declared": False}, + "captured_after_grading": True, + "excluded_dirs": list(WORKSPACE_SNAPSHOT_EXCLUDED_DIRS), + "protected_names": list(WORKSPACE_SNAPSHOT_PROTECTED_NAMES), + "encoding": WORKSPACE_SNAPSHOT_ENCODING, + "max_bytes": max_bytes, + "deadline_seconds": None, + "elapsed_seconds": None, + "captured_at_utc": datetime.datetime.now(datetime.UTC).strftime("%Y-%m-%dT%H:%M:%SZ"), + } + payload.update(fields) + return payload + + +def _snapshot_pathspec_excludes() -> list[str]: + names = (*WORKSPACE_SNAPSHOT_EXCLUDED_DIRS, *WORKSPACE_SNAPSHOT_PROTECTED_NAMES) + specs: list[str] = [] + for name in names: + specs.extend((f":(exclude){name}", f":(exclude,glob)**/{name}", f":(exclude,glob)**/{name}/**")) + return specs + + +def capture_workspace_snapshot( + project_dir: str, base_commit_sha: str, max_bytes: int | None = None, deadline_seconds: float | None = None, +) -> dict: + """The agent's final workspace as a ``git diff --binary`` against ``base_commit_sha``. + + Status is ``captured`` (body in ``patch_b64``), ``empty`` (no change), ``too_large`` (hash and + listing only) or ``unavailable`` (reason only). Never raises. + """ + if max_bytes is None: + max_bytes = _snapshot_limit(WORKSPACE_SNAPSHOT_MAX_BYTES_ENV, WORKSPACE_SNAPSHOT_DEFAULT_MAX_BYTES, int) + if deadline_seconds is None: + deadline_seconds = _snapshot_limit(WORKSPACE_SNAPSHOT_DEADLINE_ENV, WORKSPACE_SNAPSHOT_DEFAULT_DEADLINE, float) + started = time.monotonic() + + def finish(payload: dict) -> dict: + payload["deadline_seconds"] = deadline_seconds + payload["elapsed_seconds"] = round(time.monotonic() - started, 3) + return payload + + try: + project = Path(project_dir) + git_dir = project / ".git" + if not git_dir.exists(): + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason="not_a_git_repository")) + if max_bytes <= 0: + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason="disabled")) + with tempfile.TemporaryDirectory(prefix="hud-workspace-snapshot-") as scratch_name: + scratch = Path(scratch_name) + objects = scratch / "objects" + objects.mkdir() + # Heavy runtime trees and protected names are excluded through a scratch excludes + # file, which layers under the repository's own ignore rules. + excludes_file = scratch / "excludes" + excludes_file.write_text( + "".join(f"{name}/\n" for name in WORKSPACE_SNAPSHOT_EXCLUDED_DIRS) + + "".join(f"{name}\n" for name in WORKSPACE_SNAPSHOT_PROTECTED_NAMES), + encoding="utf-8", + ) + env = { + **os.environ, + "GIT_INDEX_FILE": str(scratch / "index"), + "GIT_DIR": str(git_dir), + "GIT_WORK_TREE": str(project), + "GIT_OBJECT_DIRECTORY": str(objects), + "GIT_ALTERNATE_OBJECT_DIRECTORIES": str(git_dir / "objects"), + "HOME": scratch_name, + "GIT_CONFIG_NOSYSTEM": "1", + "GIT_TERMINAL_PROMPT": "0", + } + base_argv = [ + "git", "-c", f"safe.directory={project}", "-c", "core.quotePath=false", + "-c", f"core.excludesFile={excludes_file}", + ] + + def git(*args: str, ok_codes: tuple = (0,), stdout=subprocess.PIPE) -> bytes: + remaining = deadline_seconds - (time.monotonic() - started) + if remaining <= 0: + raise TimeoutError(f"snapshot deadline of {deadline_seconds:g}s exhausted before git {args[0]}") + completed = subprocess.run( + [*base_argv, *args], cwd=str(project), env=env, stdout=stdout, stderr=subprocess.PIPE, + check=False, timeout=min(WORKSPACE_SNAPSHOT_GIT_TIMEOUT, remaining), + ) + if completed.returncode not in ok_codes: + detail = completed.stderr.decode("utf-8", errors="replace").strip()[-200:] + raise RuntimeError(f"git {args[0]} exited {completed.returncode}: {detail}") + return completed.stdout or b"" + + def name_status() -> list[dict]: + listing = git("diff", "--cached", "--name-status", "-z", "--no-renames", base_commit_sha, "--") + fields = [entry.decode("utf-8", errors="replace") for entry in listing.split(b"\0") if entry] + rows = [{"path": fields[i + 1], "status": fields[i][:1]} for i in range(0, len(fields) - 1, 2)] + rows.sort(key=lambda item: item["path"]) + return rows + + head = git("rev-parse", "HEAD").decode("utf-8", errors="replace").strip() + git("read-tree", base_commit_sha) + git("add", "-A", "--ignore-errors", "--", ".") + changed = name_status() + ignore_rules_modified = any(item["path"].rsplit("/", 1)[-1] in WORKSPACE_SNAPSHOT_IGNORE_FILES for item in changed) + capture_mode = "standard" + if ignore_rules_modified: + # Agent-edited ignore rules can hide files the grader saw: re-add everything the + # pathspec excludes do not name, ignore rules notwithstanding. + git("add", "-A", "--force", "--ignore-errors", "--", ".", *_snapshot_pathspec_excludes()) + changed = name_status() + capture_mode = "forced" + + config_out = git("config", "--get-regexp", r"^filter\..*\.(clean|smudge|process)$", ok_codes=(0, 1)) + configured = sorted({line.split()[0] for line in config_out.decode("utf-8", errors="replace").splitlines() if line.strip()}) + attribute_paths = [ + entry.decode("utf-8", errors="replace") + for entry in git("ls-files", "-z", "--cached", "--", ".gitattributes", "*/.gitattributes").split(b"\0") if entry + ] + attributes_declared = False + for rel in [*attribute_paths, ".git/info/attributes"]: + candidate = project / rel + if candidate.is_file() and "filter=" in candidate.read_text(encoding="utf-8", errors="replace"): + attributes_declared = True + break + filtered = bool(configured) and attributes_declared + + diff_path = scratch / "snapshot.diff" + with diff_path.open("wb") as handle: + git("diff", "--cached", "--binary", "--full-index", "--no-ext-diff", "--no-renames", base_commit_sha, "--", stdout=handle) + size = diff_path.stat().st_size + digest = hashlib.sha256() + with diff_path.open("rb") as handle: + while chunk := handle.read(1 << 20): + digest.update(chunk) + ignored = git("ls-files", "-z", "--others", "--ignored", "--exclude-standard", "--directory") + patch = diff_path.read_bytes() if 0 < size <= max_bytes else b"" + + payload = _snapshot_payload( + base_commit_sha, max_bytes, + head_commit_sha=head, + patch_sha256=digest.hexdigest(), + patch_size=size, + changed_files=changed[:WORKSPACE_SNAPSHOT_MAX_LISTED_FILES], + changed_file_count=len(changed), + changed_files_truncated=len(changed) > WORKSPACE_SNAPSHOT_MAX_LISTED_FILES, + ignore_rules_modified=ignore_rules_modified, + ignored_entry_count=sum(1 for entry in ignored.split(b"\0") if entry), + capture_mode=capture_mode, + filtered=filtered, + content_filters={"configured": configured, "attributes_declared": attributes_declared}, + ) + if size == 0: + payload["status"] = "empty" + elif size > max_bytes: + payload.update(status="too_large", reason=f"patch of {size} bytes exceeds max_bytes {max_bytes}") + else: + payload.update(status="captured", patch_b64=base64.b64encode(gzip.compress(patch, 6)).decode("ascii")) + return finish(payload) + except Exception as exc: # noqa: BLE001 - a snapshot failure must never change the grade + logger.warning("workspace snapshot unavailable: %s: %s", type(exc).__name__, exc) + return finish(_snapshot_payload(base_commit_sha, max_bytes, reason=f"{type(exc).__name__}: {str(exc)[:200]}")) + + +def _attach_workspace_snapshot(result: EvaluationResult, snapshot: dict) -> EvaluationResult: + """Return ``result`` with ``info["workspace_snapshot"]`` set; the grader's own info is kept. + + Runs outside the fail-closed grading guards, so it must never raise: on any failure the + grader's result is returned exactly as it was. + """ + try: + existing = getattr(result, "info", None) + info = dict(existing) if isinstance(existing, dict) else {} + info["workspace_snapshot"] = snapshot + try: + return result.model_copy(update={"info": info}) + except Exception: # noqa: BLE001 - fall back to assignment on a non-pydantic result + result.info = info + return result + except Exception: # noqa: BLE001 - the snapshot is diagnostic, never grade-bearing + logger.exception("could not attach the workspace snapshot to the grade result") + return result + + +def fail_closed_payload(reason: str, detail: str = "") -> dict: + """Structured, fail-closed grading result. + + Emitted whenever the grader chain cannot be imported, resolved, or executed. + Every list-shaped key is present and explicitly empty so downstream readers + never have to distinguish "absent" from "empty". + """ + payload = { + "task_id": TASK_ID, + "reward": 0.0, + "is_error": True, + "grader_health": "unavailable", + "grader_health_reason": reason, + } + for key in FAIL_CLOSED_LIST_KEYS: + payload[key] = [] + payload["blockers"] = [reason] + if detail: + payload["grader_health_detail"] = detail + return payload + + +def _resolve_grader(): + """Import the grader chain lazily and return its callable entry point.""" + module_name, attribute = GRADER_ENTRY_POINT + module = importlib.import_module(module_name) + grade = getattr(module, attribute) + if not callable(grade): + raise TypeError(f"{module_name}.{attribute} is not callable") + return grade + + +def _evaluation_from_payload(payload: dict) -> EvaluationResult: + """HUD result for a fail-closed payload, carrying the complete diagnostic interface. + + Every reader downstream (trace diagnostics, metrics, diagnosis replay) needs numeric raw and + final scores, an explicit ``caps`` list, the health literal and list-valued ``subscores`` on + fault paths too; a fault reports zeros, empty lists and a non-healthy health, never a cap. + """ + is_error = bool(payload.get("is_error", True)) + reward = 0.0 if is_error else float(payload.get("reward") or 0.0) + info = { + "raw_score": reward, + "final_score": reward, + "caps": [], + "grader_health": str(payload.get("grader_health") or "unavailable"), + "grader_health_reason": str(payload.get("grader_health_reason") or ""), + "criteria": [], + "group_contributions": {}, + } + return EvaluationResult( + reward=reward, + done=True, + isError=is_error, + content=json.dumps(payload, indent=2, sort_keys=True, default=str), + info=info, + subscores=[], + ) + + +async def run_grading(**grader_kwargs) -> EvaluationResult: + """Run the grader chain, failing closed on any import or execution failure. + + A missing or corrupted grader module must still produce a structured JSON + result with ``is_error`` true, ``reward`` 0.0, a non-healthy + ``grader_health``, and explicitly empty lists -- never an import-time crash + that leaves the container with no output. + + After the grader has produced its result, the agent's final workspace is captured as a + git patch (``capture_workspace_snapshot``) and attached to that result's + ``info["workspace_snapshot"]``. The grader always runs first, so a slow or failing capture + can only degrade to ``unavailable``; it can neither delay nor change the grade. + """ + outcome = await _run_grader_chain(**grader_kwargs) + project_dir = str(grader_kwargs.get("project_dir") or PROJECT_DIR) + try: + snapshot = await asyncio.to_thread(capture_workspace_snapshot, project_dir, BASE_COMMIT_SHA) + except Exception as exc: # noqa: BLE001 - the snapshot is diagnostic, never grade-bearing + logger.exception("workspace snapshot capture raised; recording it unavailable") + snapshot = _snapshot_payload(BASE_COMMIT_SHA, None, reason=f"{type(exc).__name__}: {str(exc)[:200]}") + return _attach_workspace_snapshot(outcome, snapshot) + + +async def _run_grader_chain(**grader_kwargs) -> EvaluationResult: + """Resolve and run the grader, failing closed on any import or execution failure.""" + try: + grade = _resolve_grader() + except Exception as exc: # noqa: BLE001 - fail closed on any resolution failure + reason = f"grader entry point {'.'.join(GRADER_ENTRY_POINT)} unavailable: {exc!r}" + logger.exception("Grader chain could not be resolved; failing closed") + return _evaluation_from_payload(fail_closed_payload(reason)) + + try: + if inspect.iscoroutinefunction(grade): + result = await grade(**grader_kwargs) + else: + # A synchronous grader runs for minutes; keep the server's event loop responsive. + result = await asyncio.to_thread(grade, **grader_kwargs) + if inspect.isawaitable(result): + result = await result + except Exception as exc: # noqa: BLE001 - fail closed on any grading failure + reason = f"grader execution failed: {exc!r}" + logger.exception("Grader chain raised; failing closed") + return _evaluation_from_payload( + fail_closed_payload(reason, detail=traceback.format_exc(limit=5)) + ) + + if isinstance(result, EvaluationResult): + return _attach_info(result, "served_grader_scale_id", served_grader_scale_id()) + if isinstance(result, dict): + return _evaluation_from_payload(result) + reason = f"grader returned unsupported result type {type(result).__name__}" + logger.error(reason) + return _evaluation_from_payload(fail_closed_payload(reason)) + + +_GRADER_SCALE_CACHE: list[str | None] = [] +_SCALE_GENERATED_PARTS = frozenset({"__pycache__", ".pytest_cache", ".ruff_cache", ".venv"}) + + +def served_grader_scale_id() -> str | None: + """The grader scale this image serves: SHA-256 over the grading assets and the rubric. + + Same definition as the workflow's ``compute_grader_scale_id`` (relative path, NUL, bytes, NUL + for every grading file outside ``adversarial`` and generated directories, then + ``task/rubric.md``), so a trace can name the scale it was graded on. ``None`` when unreadable. + """ + if _GRADER_SCALE_CACHE: + return _GRADER_SCALE_CACHE[0] + try: + root = Path(__file__).resolve().parent + sources = [] + for path in sorted((root / "grading").rglob("*")): + relative = path.relative_to(root) + if not path.is_file() or any("adversarial" in part or part in _SCALE_GENERATED_PARTS for part in relative.parts): + continue + sources.append((relative.as_posix(), path)) + rubric = root / "task" / "rubric.md" + if rubric.is_file(): + sources.append(("task/rubric.md", rubric)) + digest = hashlib.sha256() + for relative, path in sorted(sources): + digest.update(relative.encode("utf-8")) + digest.update(b"\0") + digest.update(path.read_bytes()) + digest.update(b"\0") + value: str | None = digest.hexdigest() if sources else None + except OSError: + value = None + _GRADER_SCALE_CACHE.append(value) + return value + + +def _attach_info(result: EvaluationResult, key: str, value) -> EvaluationResult: + """Return ``result`` with one extra ``info`` key; never raises and never changes the grade.""" + try: + info = dict(result.info) if isinstance(getattr(result, "info", None), dict) else {} + info[key] = value + return result.model_copy(update={"info": info}) + except Exception: # noqa: BLE001 - diagnostic only + return result + + +@env.template(id="apscheduler_expired_job_lease", description="HUD coding benchmark task template.") +async def apscheduler_expired_job_lease( + task_id: str = "apscheduler_expired_job_lease", + description: str = "", + **kwargs, +): + """Agent task: serve the approved prompt (``task/prompt.md``), then grade the workspace. + + ``tasks.py`` passes the approved prompt as ``description``. Grading goes through + ``run_grading`` and the lazily resolved ``grading.runner.grade_repository``. + """ + _ = yield make_prompt(description) + yield await run_grading(task_id=task_id, project_dir=PROJECT_DIR, **kwargs) + + +# --- Reference variants --------------------------------------------------------------------- +# The ec-swe-benchmarks PR check needs, in the linked taskset, a job whose name contains "gold" +# with every trace at 1.0 and one whose name contains "base" with every trace at 0.0. A single-task +# HUD job is named after its template id, so each variant is its own template (``_gold``, +# ``_base``). Prompt 07 runs each once on every deployed build. +# +# Neither variant grades the agent's workspace. Only after the agent's final answer, a fresh tree is +# cloned from the root-only repository metadata (``.git`` is root:root 0700 in the image, so the +# agent cannot have changed it) into a root-only temporary directory, checked out at +# ``BASE_COMMIT_SHA`` and verified against ``BASE_TREE_SHA``. For gold, ``/hud/gold.diff`` is applied +# there, read in place and never copied. The tree is graded through the same grader entry point as +# the agent task and then removed. A patch that does not apply, or any identity mismatch, fails +# closed. No workspace snapshot is captured, so no reference content reaches the trace. + +GOLD_DIFF_PATH = "/hud/gold.diff" +REFERENCE_KINDS = ("gold", "base") +REFERENCE_GIT_TIMEOUT = 600 +REFERENCE_PROMPT = ( + "This is a reference run of this environment. No change to the repository is needed, and no " + "files should be modified. Reply that you are done." +) + + +class ReferenceTreeError(RuntimeError): + """The reference tree could not be materialized exactly; the reference grade fails closed.""" + + +def _reference_git(*args: str, cwd: Path | None = None, safe: tuple = ()) -> str: + """Run one git command for the reference tree. Its output is never echoed: it may name gold paths.""" + safe_flags = [flag for directory in safe for flag in ("-c", f"safe.directory={directory}")] + completed = subprocess.run( + ["git", *safe_flags, *args], + cwd=cwd, + capture_output=True, + text=True, + check=False, + timeout=REFERENCE_GIT_TIMEOUT, + env={**os.environ, "GIT_CONFIG_GLOBAL": os.devnull, "GIT_CONFIG_NOSYSTEM": "1", "GIT_TERMINAL_PROMPT": "0"}, + ) + if completed.returncode != 0: + raise ReferenceTreeError(f"git {args[0]} exited {completed.returncode}") + return completed.stdout + + +def _require_root_only(path: Path, label: str) -> None: + """Refuse a path any other account can read, or one not owned by root when running as root.""" + details = path.stat() + if stat.S_IMODE(details.st_mode) & 0o077: + raise ReferenceTreeError(f"{label} is accessible beyond its owner") + if hasattr(os, "geteuid") and os.geteuid() == 0 and details.st_uid != 0: + raise ReferenceTreeError(f"{label} is not owned by root") + + +def materialize_reference_tree(reference: str) -> Path: + """Build the root-only reference tree for ``reference`` and return its temporary root. + + The graded tree is ``/tree``; the caller removes ````. + """ + if reference not in REFERENCE_KINDS: + raise ReferenceTreeError(f"unknown reference kind {reference!r}") + git_dir = Path(PROJECT_DIR) / ".git" + if not git_dir.is_dir(): + raise ReferenceTreeError("repository metadata is missing") + if not _LOCAL_SUBSTRATE: + _require_root_only(git_dir, "repository metadata") + root = Path(tempfile.mkdtemp(prefix="hud-reference-")) + try: + _require_root_only(root, "reference directory") + tree = root / "tree" + _reference_git( + "clone", "--no-hardlinks", "--no-checkout", "--quiet", str(git_dir), str(tree), + safe=(str(git_dir), str(PROJECT_DIR)), + ) + _reference_git("checkout", "--quiet", "--detach", BASE_COMMIT_SHA, cwd=tree) + if _reference_git("rev-parse", "HEAD^{tree}", cwd=tree).strip() != BASE_TREE_SHA: + raise ReferenceTreeError("reference tree does not match the pinned base tree") + if _reference_git("status", "--porcelain", "--untracked-files=all", cwd=tree).strip(): + raise ReferenceTreeError("reference tree is not a clean checkout of the pinned base") + if reference == "gold": + patch = Path(GOLD_DIFF_PATH) + if not patch.is_file(): + raise ReferenceTreeError("the gold patch is unavailable") + _reference_git("apply", "--check", "--whitespace=nowarn", str(patch), cwd=tree) + _reference_git("apply", "--whitespace=nowarn", str(patch), cwd=tree) + return root + except BaseException: + shutil.rmtree(root, ignore_errors=True) + raise + + +async def run_reference_grading(reference: str) -> EvaluationResult: + """Grade a fresh reference tree through the agent task's grader entry point, failing closed.""" + try: + root = await asyncio.to_thread(materialize_reference_tree, reference) + except Exception as exc: # noqa: BLE001 - any materialization failure fails closed + detail = str(exc) if isinstance(exc, ReferenceTreeError) else type(exc).__name__ + logger.warning("reference %s tree unavailable: %s", reference, detail) + outcome = _evaluation_from_payload(fail_closed_payload(f"reference_{reference}_unavailable: {detail}")) + else: + try: + outcome = await _run_grader_chain(task_id=TASK_ID, project_dir=str(root / "tree")) + finally: + await asyncio.to_thread(shutil.rmtree, root, ignore_errors=True) + return _attach_workspace_snapshot(outcome, _snapshot_payload(BASE_COMMIT_SHA, None, reason="reference_run")) + + +@env.template(id=f"{TASK_ID}_gold", description="Reference run graded on the pinned base with the gold patch.") +async def reference_gold(): + """Reference variant: grades the gold tree, never the agent's workspace.""" + _ = yield REFERENCE_PROMPT + yield await run_reference_grading("gold") + + +@env.template(id=f"{TASK_ID}_base", description="Reference run graded on the unchanged pinned base.") +async def reference_base(): + """Reference variant: grades the unchanged base tree, never the agent's workspace.""" + _ = yield REFERENCE_PROMPT + yield await run_reference_grading("base") diff --git a/harbor/sources/apscheduler-v17/gold.diff b/harbor/sources/apscheduler-v17/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..8ad1b18ca7ea46fe47de4b472f09eaf8aff733ac --- /dev/null +++ b/harbor/sources/apscheduler-v17/gold.diff @@ -0,0 +1,1755 @@ +diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst +index a9f34fa..b9a1aff 100644 +--- a/docs/versionhistory.rst ++++ b/docs/versionhistory.rst +@@ -23,6 +23,16 @@ APScheduler, see the :doc:`migration section `. + them; clean-up now releases schedules whose leases have expired and wakes up the + other schedulers so they can acquire them + (`#1053 `_) ++- Fixed the scheduler crashing or running a job twice when a job's lease expires while ++ it is still running; an expired claim is now taken over consistently by all data ++ stores, and a stale release is ignored ++ (`#1116 `_) ++- Fixed jobs claimed by the scheduler staying claimed until their leases lapsed when the ++ scheduler was stopped before starting them, when another job in the same batch could ++ not be prepared, or when releasing a job cancelled by stopping the scheduler failed; ++ such claims are now handed back right away so other schedulers can take the jobs over, ++ and none of these cases crashes the scheduler any more ++- Fixed a failure to extend job leases crashing the scheduler + - Fixed the synchronous ``Scheduler`` not enabling automatic clean-up by default, + unlike ``AsyncScheduler`` + (`#1135 `_; PR by @dylanpulver) +diff --git a/src/apscheduler/_schedulers/async_.py b/src/apscheduler/_schedulers/async_.py +index fb5cb54..3c2eda6 100644 +--- a/src/apscheduler/_schedulers/async_.py ++++ b/src/apscheduler/_schedulers/async_.py +@@ -25,6 +25,7 @@ from anyio import ( + sleep, + ) + from anyio.abc import TaskGroup, TaskStatus ++from anyio.lowlevel import checkpoint + from attr.validators import instance_of, optional + + from .. import JobAdded, SerializationError, TaskLookupError +@@ -75,6 +76,8 @@ else: + + _microsecond_delta = timedelta(microseconds=1) + _zero_timedelta = timedelta() ++# Lease duration that makes a lease expire at once, to hand back a claim on a job ++_expired_lease_duration = -_microsecond_delta + + TaskType: TypeAlias = "Task | str | Callable[..., Any]" + T = TypeVar("T") +@@ -1121,9 +1124,16 @@ class AsyncScheduler: + while self._state in (RunState.starting, RunState.started): + await sleep(self.lease_duration.total_seconds() / 2) + if job_ids := {job.id for job in self._running_jobs}: +- await self.data_store.extend_acquired_job_leases( +- self.identity, job_ids, self.lease_duration +- ) ++ try: ++ await self.data_store.extend_acquired_job_leases( ++ self.identity, job_ids, self.lease_duration ++ ) ++ except Exception: ++ # Losing one extension must not take the whole scheduler down; ++ # try again on the next round ++ self.logger.exception( ++ "Error extending the leases of the running jobs" ++ ) + + # If there are any jobs marked as being acquired by this scheduler, release them + # with the "abandoned" outcome right away +@@ -1151,30 +1161,129 @@ class AsyncScheduler: + task_status.started() + await self.get_next_event(SchedulerStarted) + ++ # IDs of running jobs whose lapsed leases were renewed by re-acquiring them ++ # since the loop last went to sleep ++ renewed_job_ids: set[UUID] = set() + while self._state is RunState.started: + limit = self.max_concurrent_jobs - len(self._running_jobs) + if limit > 0: +- jobs = await self.data_store.acquire_jobs( +- self.identity, self.lease_duration, limit +- ) +- for job in jobs: +- task = await self.data_store.get_task(job.task_id) +- func = self._get_task_callable(task) +- self._running_jobs.add(job) +- task_group.start_soon( +- self._run_job, +- job, +- func, +- job.executor, +- name=( +- f"Scheduler {self.identity!r} job {job.id} " +- f"({job.executor!r})" +- ), ++ # Shield the acquisition, so that if the scheduler is stopped while ++ # the data store is claiming jobs, it still learns which jobs it ++ # claimed and can hand them back ++ with CancelScope(shield=True): ++ jobs = await self.data_store.acquire_jobs( ++ self.identity, self.lease_duration, limit + ) + ++ renewed_new_job = False ++ unstarted_jobs = list(jobs) ++ try: ++ # Raises if the scheduler was stopped during the acquisition ++ await checkpoint() ++ while unstarted_jobs: ++ job = unstarted_jobs[0] ++ if job in self._running_jobs: ++ # The data store handed back a job this scheduler is ++ # already running (its lease had lapsed); the claim ++ # has been renewed, so do not start it again ++ self.logger.warning( ++ "Job %s was re-acquired while still running; " ++ "lease renewed", ++ job.id, ++ ) ++ del unstarted_jobs[0] ++ if job.id not in renewed_job_ids: ++ renewed_job_ids.add(job.id) ++ renewed_new_job = True ++ ++ continue ++ ++ try: ++ task = await self.data_store.get_task(job.task_id) ++ func = self._get_task_callable(task) ++ except Exception as exc: ++ # Only this job is affected; the rest of the batch ++ # must still be started ++ self.logger.exception( ++ "Error preparing job %s for execution", job.id ++ ) ++ result = JobResult.from_job( ++ job, JobOutcome.error, exception=exc ++ ) ++ await self._release_job_or_hand_back(job, result) ++ del unstarted_jobs[0] ++ continue ++ ++ self._running_jobs.add(job) ++ del unstarted_jobs[0] ++ task_group.start_soon( ++ self._run_job, ++ job, ++ func, ++ job.executor, ++ name=( ++ f"Scheduler {self.identity!r} job {job.id} " ++ f"({job.executor!r})" ++ ), ++ ) ++ finally: ++ # Jobs that were claimed but never started (because the ++ # scheduler is stopping, or due to an unexpected error) must ++ # not stay claimed by this scheduler until their leases lapse ++ if unstarted_jobs: ++ await self._hand_back_job_claims(unstarted_jobs) ++ ++ if renewed_new_job: ++ # A re-acquired job took up a slot in this batch, so other ++ # pending jobs may have been left behind; try again right away. ++ # Each retry renews at least one more running job, so a data ++ # store that keeps handing back the same jobs cannot turn this ++ # into a busy loop. ++ continue ++ ++ renewed_job_ids.clear() + await wakeup_event.wait() + wakeup_event = anyio.Event() + ++ async def _hand_back_job_claims(self, jobs: Iterable[Job]) -> None: ++ """ ++ Give up this scheduler's claims on the given jobs without releasing them. ++ ++ The leases are set to have already expired, so any scheduler can take over the ++ jobs right away (as specified in :meth:`DataStore.acquire_jobs`). This is best ++ effort: if it fails, the leases simply lapse on their own, since they are no ++ longer being extended. ++ ++ """ ++ job_ids = {job.id for job in jobs} ++ with CancelScope(shield=True): ++ try: ++ await self.data_store.extend_acquired_job_leases( ++ self.identity, job_ids, _expired_lease_duration ++ ) ++ except Exception: ++ self.logger.exception( ++ "Error handing back the claims on jobs %s", ++ ", ".join(str(job_id) for job_id in sorted(job_ids)), ++ ) ++ ++ async def _release_job_or_hand_back(self, job: Job, result: JobResult) -> None: ++ """ ++ Release the claim on a job, handing the claim back if the release fails. ++ ++ This is used where a failed release must not escalate: while preparing a job ++ (where the rest of the batch still has to be started) and while a cancelled job ++ is being cleaned up (where the cancellation must win over the release error). ++ ++ """ ++ try: ++ await self.data_store.release_job(self.identity, job, result) ++ except Exception: ++ self.logger.exception( ++ "Error releasing job %s with outcome %s", job.id, result.outcome.name ++ ) ++ await self._hand_back_job_claims([job]) ++ + async def _run_job(self, job: Job, func: Callable[..., Any], executor: str) -> None: + try: + # Check if the job started before the deadline +@@ -1200,7 +1309,10 @@ class AsyncScheduler: + result = JobResult.from_job( + job, JobOutcome.cancelled, started_at=start_time + ) +- await self.data_store.release_job(self.identity, job, result) ++ # The scheduler is most likely stopping, so if the release fails, ++ # hand the claim back rather than crashing the scheduler (and ++ # leaving the claim to lapse) ++ await self._release_job_or_hand_back(job, result) + except BaseException as exc: + if isinstance(exc, Exception): + self.logger.exception("Job %s raised an exception", job.id) +@@ -1230,4 +1342,4 @@ class AsyncScheduler: + finally: + current_job.reset(token) + finally: +- self._running_jobs.remove(job) ++ self._running_jobs.discard(job) +diff --git a/src/apscheduler/abc.py b/src/apscheduler/abc.py +index d302f04..570bf50 100644 +--- a/src/apscheduler/abc.py ++++ b/src/apscheduler/abc.py +@@ -325,6 +325,17 @@ class DataStore(metaclass=ABCMeta): + This method claims up to the requested number of jobs for the given scheduler + and returns them. + ++ A job whose lease has expired is treated as unclaimed: its previous owner is ++ presumed dead, and the job is handed to whichever scheduler asks next (which ++ may be the previous owner itself, if it was merely too slow to extend the ++ lease). Such a takeover reuses the previous owner's slot in the task's running ++ jobs counter. If the previous owner is in fact still running the job, the job ++ will be run more than once, and only the result from the current holder of the ++ claim is recorded, so ``lease_duration`` should comfortably exceed any delay ++ the scheduler may experience in extending its leases. ++ ++ If ``limit`` is zero or negative, no jobs are acquired. ++ + :param scheduler_id: unique identifier of the scheduler + :param lease_duration: the duration of the lease, after which the jobs will be + considered to be dead if the scheduler doesn't extend the lease duration +@@ -337,7 +348,15 @@ class DataStore(metaclass=ABCMeta): + """ + Release the claim on the given job and record the result. + +- :param scheduler_id: unique identifier of the scheduler ++ The release only takes effect if the job is currently claimed by ++ ``scheduler_id`` (that is, the scheduler acquired it via :meth:`acquire_jobs` ++ and the claim has not since been ended by :meth:`cleanup` or taken over by ++ another scheduler after the lease expired). Otherwise the call is a no-op: the ++ job is left alone, the result is discarded with a logged warning and no ++ :class:`~apscheduler.JobReleased` event is published. ++ ++ :param scheduler_id: unique identifier of the scheduler that holds the claim on ++ the job + :param job: the job to be released + :param result: the result of the job + """ +diff --git a/src/apscheduler/datastores/memory.py b/src/apscheduler/datastores/memory.py +index bc53ea9..88a125b 100644 +--- a/src/apscheduler/datastores/memory.py ++++ b/src/apscheduler/datastores/memory.py +@@ -225,6 +225,9 @@ class MemoryDataStore(BaseDataStore): + async def acquire_jobs( + self, scheduler_id: str, lease_duration: timedelta, limit: int | None = None + ) -> list[Job]: ++ if limit is not None and limit <= 0: ++ return [] ++ + now = datetime.now(timezone.utc) + acquired_until = now + lease_duration + jobs: list[Job] = [] +@@ -233,11 +236,15 @@ class MemoryDataStore(BaseDataStore): + task = self._tasks[job.task_id] + + # Skip already acquired jobs (unless the acquisition lock has expired) ++ expired_claim = False + if job.acquired_until is not None: + if job.acquired_until >= now: + continue +- else: +- task.running_jobs -= 1 ++ ++ # The lease has expired, so the previous owner is considered dead and ++ # the job can be taken over. Its claim (and its slot in the task's ++ # running job counter) stays in place until that actually happens. ++ expired_claim = True + + # Discard the job if its start deadline has passed + if job.start_deadline and job.start_deadline < now: +@@ -249,9 +256,11 @@ class MemoryDataStore(BaseDataStore): + ) + continue + +- # Skip the job if no more slots are available ++ # Skip the job if no more slots are available (taking over an expired ++ # claim reuses the slot the previous owner held) + if ( +- task.max_running_jobs is not None ++ not expired_claim ++ and task.max_running_jobs is not None + and task.running_jobs >= task.max_running_jobs + ): + self._logger.debug( +@@ -269,25 +278,54 @@ class MemoryDataStore(BaseDataStore): + job.acquired_until = acquired_until + + # Increment the number of running jobs for this task +- task.running_jobs += 1 ++ if not expired_claim: ++ task.running_jobs += 1 + + # Exit the loop if enough jobs have been acquired + if len(jobs) == limit: + break + +- # Publish the appropriate events +- for job in jobs: +- await self._event_broker.publish( +- JobAcquired.from_job(job, scheduler_id=scheduler_id) +- ) +- +- # Discard the jobs that could not start ++ # Discard the jobs that could not start (ending any expired claim on them) ++ # before yielding control, so their claims cannot change in the meantime ++ events: list[JobAcquired | JobReleased] = [ ++ JobAcquired.from_job(job, scheduler_id=scheduler_id) for job in jobs ++ ] + for job, result in job_results.items(): +- await self.release_job(scheduler_id, job, result) ++ events.append(self._release_job(scheduler_id, job, result)) ++ ++ # Publish the appropriate events ++ for event in events: ++ await self._event_broker.publish(event) + + return jobs + + async def release_job(self, scheduler_id: str, job: Job, result: JobResult) -> None: ++ # A release is only valid if this scheduler still holds the claim on the job. ++ # If the job was already released (abandoned by cleanup() or finished by ++ # another scheduler that took over the expired lease), or its claim now ++ # belongs to another scheduler, ignore the stale release so that the job, ++ # its result, the running job counter and the event stream stay consistent. ++ stored_job = self._jobs_by_id.get(result.job_id) ++ if stored_job is None or stored_job.acquired_by != scheduler_id: ++ self._logger.warning( ++ "Discarded the result of job %s from scheduler %r because it does not " ++ "hold the claim on the job", ++ result.job_id, ++ scheduler_id, ++ ) ++ return ++ ++ # Notify other schedulers ++ await self._event_broker.publish( ++ self._release_job(scheduler_id, stored_job, result) ++ ) ++ ++ def _release_job( ++ self, scheduler_id: str, job: Job, result: JobResult ++ ) -> JobReleased: ++ # Delete the job ++ del self._jobs_by_id[job.id] ++ + # Record the job result + if result.expires_at > result.finished_at: + self._job_results[result.job_id] = result +@@ -296,9 +334,6 @@ class MemoryDataStore(BaseDataStore): + if job.acquired_by: + self._tasks[job.task_id].running_jobs -= 1 + +- # Delete the job +- job = self._jobs_by_id.pop(result.job_id) +- + # Remove the job from the jobs belonging to its task + task_jobs = self._jobs_by_task_id[job.task_id] + task_jobs.remove(job) +@@ -313,15 +348,12 @@ class MemoryDataStore(BaseDataStore): + if not schedule_jobs: + del self._jobs_by_schedule_id[job.schedule_id] + +- # Notify other schedulers +- await self._event_broker.publish( +- JobReleased.from_result( +- result, +- scheduler_id, +- job.task_id, +- job.schedule_id, +- job.scheduled_fire_time, +- ) ++ return JobReleased.from_result( ++ result, ++ scheduler_id, ++ job.task_id, ++ job.schedule_id, ++ job.scheduled_fire_time, + ) + + async def get_job_result(self, job_id: UUID) -> JobResult | None: +@@ -370,6 +402,15 @@ class MemoryDataStore(BaseDataStore): + if job.acquired_until is not None and job.acquired_until < now + ] + for job in expired_jobs: ++ # Publishing the previous releases yielded control, so skip the job if ++ # it was released, or its lease was renewed or taken over, in the meantime ++ if ( ++ self._jobs_by_id.get(job.id) is not job ++ or job.acquired_until is None ++ or job.acquired_until >= now ++ ): ++ continue ++ + result = JobResult.from_job( + job=job, outcome=JobOutcome.abandoned, finished_at=now + ) +diff --git a/src/apscheduler/datastores/mongodb.py b/src/apscheduler/datastores/mongodb.py +index b9fc903..9c02e2f 100644 +--- a/src/apscheduler/datastores/mongodb.py ++++ b/src/apscheduler/datastores/mongodb.py +@@ -539,6 +539,10 @@ class MongoDBDataStore(BaseExternalDataStore): + async def acquire_jobs( + self, scheduler_id: str, lease_duration: timedelta, limit: int | None = None + ) -> list[Job]: ++ # MongoDB treats a limit of 0 as "no limit" ++ if limit is not None and limit <= 0: ++ return [] ++ + events: list[JobAcquired | JobReleased] = [] + async for attempt in self._retry(): + async with AsyncExitStack() as exit_stack: +@@ -582,12 +586,15 @@ class MongoDBDataStore(BaseExternalDataStore): + ) + + # If the number of modified jobs was smaller than expected, manually +- # check which jobs were successfully acquired ++ # check which jobs were successfully acquired. Matching the lease ++ # written above leaves out any jobs this scheduler already held and ++ # whose leases it renewed in the meantime. + if result.modified_count != len(job_ids): + async with self._jobs.find( + { + "_id": {"$in": job_ids}, + "acquired_by": scheduler_id, ++ "acquired_until": acquired_until.timestamp(), + }, + sort=[("created_at", ASCENDING)], + projection=["_id"], +@@ -601,6 +608,11 @@ class MongoDBDataStore(BaseExternalDataStore): + acquired_jobs: list[Job] = [] + skipped_job_ids: list[UUID] = [] + for doc in documents: ++ # A job that still carries a claim here was claimed by a scheduler ++ # whose lease has expired; that claim holds a slot in the task's ++ # running job counter ++ expired_claim = doc.get("acquired_by") is not None ++ + # Deserialize the job + doc["id"] = doc.pop("_id") + unmarshal_timestamps(doc) +@@ -611,23 +623,23 @@ class MongoDBDataStore(BaseExternalDataStore): + # result + result = JobResult( + job_id=doc["id"], +- outcome=JobOutcome.missed_start_deadline, ++ outcome=JobOutcome.deserialization_failed, + finished_at=now, + expires_at=now + + timedelta(seconds=doc["result_expiration_time"]), + exception=exc, + ) +- events.append( +- await self._release_job( +- session, +- result, +- scheduler_id, +- doc["task_id"], +- doc["schedule_id"], +- doc["scheduled_fire_time"], +- decrement_running_job_count=False, +- ) +- ) ++ if event := await self._release_job( ++ session, ++ result, ++ scheduler_id, ++ doc["task_id"], ++ doc["schedule_id"], ++ doc["scheduled_fire_time"], ++ decrement_running_job_count=expired_claim, ++ ): ++ events.append(event) ++ + continue + + # Discard the job if its start deadline has passed +@@ -637,16 +649,28 @@ class MongoDBDataStore(BaseExternalDataStore): + JobOutcome.missed_start_deadline, + finished_at=now, + ) ++ if event := await self._release_job( ++ session, ++ result, ++ scheduler_id, ++ job.task_id, ++ job.schedule_id, ++ job.scheduled_fire_time, ++ decrement_running_job_count=expired_claim, ++ ): ++ events.append(event) ++ ++ continue ++ ++ # Taking over an expired claim reuses the slot the previous owner ++ # held, so it needs no free slot and does not change the task's ++ # running job counter ++ if expired_claim: ++ job.acquired_by = scheduler_id ++ job.acquired_until = now + lease_duration ++ acquired_jobs.append(job) + events.append( +- await self._release_job( +- session, +- result, +- scheduler_id, +- job.task_id, +- job.schedule_id, +- job.scheduled_fire_time, +- decrement_running_job_count=False, +- ) ++ JobAcquired.from_job(job, scheduler_id=scheduler_id) + ) + continue + +@@ -716,24 +740,66 @@ class MongoDBDataStore(BaseExternalDataStore): + scheduled_fire_time: datetime | None = None, + *, + decrement_running_job_count: bool = True, +- ) -> JobReleased: +- # Record the job result ++ lease_expired_before: datetime | None = None, ++ ) -> JobReleased | None: ++ # A release is only valid while the job is still claimed by the given scheduler. ++ # Otherwise it is stale: the job was already released, or another scheduler ++ # took over its expired claim. ++ filters: dict[str, Any] = {"_id": result.job_id, "acquired_by": scheduler_id} ++ if lease_expired_before is not None: ++ # The claim is being ended on the grounds that its lease has expired, so ++ # make sure that its owner has not renewed the lease in the meantime ++ filters["acquired_until"] = {"$lt": lease_expired_before.timestamp()} ++ ++ if not await self._jobs.find_one(filters, projection=["_id"], session=session): ++ self._logger.debug( ++ "Ignoring release of job %s by scheduler %r: claim no longer held", ++ result.job_id, ++ scheduler_id, ++ ) ++ return None ++ ++ # Record the job result before deleting the job, so that at no point both are ++ # missing. If the caller's retry loop runs this method again, this step is ++ # simply repeated. ++ result_filter: dict[str, Any] | None = None + if result.expires_at > result.finished_at: + document = result.marshal(self.serializer) + document["_id"] = document.pop("job_id") + marshal_document(document) +- await self._jobs_results.insert_one(document, session=session) ++ result_filter = { ++ "_id": document["_id"], ++ "finished_at": document["finished_at"], ++ } ++ await self._jobs_results.replace_one( ++ {"_id": document["_id"]}, document, upsert=True, session=session ++ ) + +- # Delete the job +- await self._jobs.delete_one({"_id": result.job_id}, session=session) ++ # Delete the job, unless the claim was lost after it was checked above ++ delete_result = await self._jobs.delete_one(filters, session=session) ++ if not delete_result.deleted_count: ++ if result_filter: ++ await self._jobs_results.delete_one(result_filter, session=session) + +- # Decrement the running jobs counter if the job had been successfully acquired +- if decrement_running_job_count: +- await self._tasks.find_one_and_update( +- {"_id": task_id}, +- {"$inc": {"running_jobs": -1}}, +- session=session, ++ self._logger.debug( ++ "Ignoring release of job %s by scheduler %r: claim no longer held", ++ result.job_id, ++ scheduler_id, + ) ++ return None ++ ++ # Decrement the running jobs counter if the job had been successfully acquired. ++ # The job is gone now, so if the caller's retry loop ran this method again, the ++ # release would look stale and this step would be skipped for good. Hence it is ++ # retried here, on its own. ++ if decrement_running_job_count: ++ async for attempt in self._retry(): ++ with attempt: ++ await self._tasks.find_one_and_update( ++ {"_id": task_id}, ++ {"$inc": {"running_jobs": -1}}, ++ session=session, ++ ) + + # Notify other schedulers + return JobReleased.from_result( +@@ -753,8 +819,17 @@ class MongoDBDataStore(BaseExternalDataStore): + job.scheduled_fire_time, + ) + +- # Notify other schedulers +- await self._event_broker.publish(event) ++ if event is None: ++ self._logger.warning( ++ "Discarded the result of job %s from scheduler %r because it does not " ++ "hold the claim on the job", ++ job.id, ++ scheduler_id, ++ ) ++ return ++ ++ # Notify other schedulers ++ await self._event_broker.publish(event) + + async def get_job_result(self, job_id: UUID) -> JobResult | None: + async for attempt in self._retry(): +@@ -822,15 +897,15 @@ class MongoDBDataStore(BaseExternalDataStore): + self.serializer, {**doc, "args": (), "kwargs": {}} + ) + result = JobResult.from_job(job, JobOutcome.abandoned) +- event = await self._release_job( ++ if event := await self._release_job( + session, + result, + scheduler_id, + job.task_id, + job.schedule_id, + job.scheduled_fire_time, +- ) +- events.append(event) ++ ): ++ events.append(event) + + for event in events: + await self._event_broker.publish(event) +@@ -887,16 +962,16 @@ class MongoDBDataStore(BaseExternalDataStore): + expires_at=now + + timedelta(seconds=doc["result_expiration_time"]), + ) +- events.append( +- await self._release_job( +- session, +- result, +- doc["acquired_by"], +- doc["task_id"], +- doc["schedule_id"], +- doc["scheduled_fire_time"], +- ) +- ) ++ if event := await self._release_job( ++ session, ++ result, ++ doc["acquired_by"], ++ doc["task_id"], ++ doc["schedule_id"], ++ doc["scheduled_fire_time"], ++ lease_expired_before=now, ++ ): ++ events.append(event) + + # Release any schedules whose leases have expired + expired_schedule_ids: list[str] = [] +diff --git a/src/apscheduler/datastores/sqlalchemy.py b/src/apscheduler/datastores/sqlalchemy.py +index 599f285..f23e749 100644 +--- a/src/apscheduler/datastores/sqlalchemy.py ++++ b/src/apscheduler/datastores/sqlalchemy.py +@@ -130,6 +130,7 @@ class _JobDiscard: + schedule_id: str | None + scheduled_fire_time: datetime | None + result_expires_at: datetime ++ claimed_by: str | None + exception: Exception | None = None + + +@@ -871,6 +872,10 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + async def acquire_jobs( + self, scheduler_id: str, lease_duration: timedelta, limit: int | None = None + ) -> list[Job]: ++ # A negative LIMIT means "no limit" on some backends and is an error on others ++ if limit is not None and limit <= 0: ++ return [] ++ + events: list[JobAcquired | JobReleased] = [] + async for attempt in self._retry(): + with attempt: +@@ -939,6 +944,7 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + schedule_id=row.schedule_id, + scheduled_fire_time=row.scheduled_fire_time, + result_expires_at=now + row.result_expiration_time, ++ claimed_by=row.acquired_by, + exception=exc, + ) + ) +@@ -954,10 +960,23 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + schedule_id=row.schedule_id, + scheduled_fire_time=row.scheduled_fire_time, + result_expires_at=now + row.result_expiration_time, ++ claimed_by=row.acquired_by, + ) + ) + continue + ++ # Taking over an expired claim reuses the slot the previous ++ # owner held, so it needs no free slot and does not change ++ # the task's running job counter ++ if row.acquired_by is not None: ++ job.acquired_by = scheduler_id ++ job.acquired_until = acquired_until ++ acquired_jobs.append(job) ++ events.append( ++ JobAcquired.from_job(job, scheduler_id=scheduler_id) ++ ) ++ continue ++ + # Skip the job if no more slots are available + if not task_job_slots_left[job.task_id]: + self._logger.debug( +@@ -990,7 +1009,9 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + ) + await self._execute(conn, update) + +- # Increment the running job counters on each task ++ # Increment the running job counters on each task (jobs taken over ++ # from expired claims do not count) ++ if running_job_count_increments: + p_id: BindParameter = bindparam("p_id") + p_increment: BindParameter = bindparam("p_increment") + params = [ +@@ -1006,7 +1027,8 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + ) + await self._execute(conn, update, params) + +- # Discard the jobs that could not start ++ # Discard the jobs that could not start (ending any expired ++ # claim on them) + for discard in discarded_jobs: + result = JobResult( + job_id=discard.job_id, +@@ -1015,17 +1037,17 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + expires_at=discard.result_expires_at, + exception=discard.exception, + ) +- events.append( +- await self._release_job( +- conn, +- result, +- scheduler_id, +- discard.task_id, +- discard.schedule_id, +- discard.scheduled_fire_time, +- decrement_running_job_count=False, +- ) +- ) ++ if event := await self._release_job( ++ conn, ++ result, ++ scheduler_id, ++ discard.task_id, ++ discard.schedule_id, ++ discard.scheduled_fire_time, ++ claimed_by=discard.claimed_by, ++ lease_expired_before=now, ++ ): ++ events.append(event) + + # Publish the appropriate events + for event in events: +@@ -1042,16 +1064,39 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + schedule_id: str | None = None, + scheduled_fire_time: datetime | None = None, + *, +- decrement_running_job_count: bool = True, +- ) -> JobReleased: ++ claimed_by: str | None, ++ lease_expired_before: datetime | None = None, ++ ) -> JobReleased | None: ++ # Delete the job, but only if it is still claimed by the expected scheduler (or ++ # still unclaimed if claimed_by is None). Otherwise the release is stale: the ++ # job was already released, or another scheduler took over its expired claim. ++ delete = self._t_jobs.delete().where( ++ self._t_jobs.c.id == result.job_id, ++ self._t_jobs.c.acquired_by.is_(None) ++ if claimed_by is None ++ else self._t_jobs.c.acquired_by == claimed_by, ++ ) ++ if claimed_by is not None and lease_expired_before is not None: ++ # The claim is being ended on the grounds that its lease has expired, so ++ # make sure that its owner has not renewed the lease in the meantime ++ delete = delete.where(self._t_jobs.c.acquired_until < lease_expired_before) ++ ++ if not (await self._execute(conn, delete)).rowcount: ++ self._logger.debug( ++ "Ignoring release of job %s by scheduler %r: claim no longer held", ++ result.job_id, ++ scheduler_id, ++ ) ++ return None ++ + # Record the job result + if result.expires_at > result.finished_at: + marshalled = result.marshal(self.serializer) + insert = self._t_job_results.insert().values(**marshalled) + await self._execute(conn, insert) + +- # Decrement the number of running jobs for this task +- if decrement_running_job_count: ++ # Decrement the number of running jobs for this task if the job was claimed ++ if claimed_by is not None: + update = ( + self._t_tasks.update() + .values(running_jobs=self._t_tasks.c.running_jobs - 1) +@@ -1059,10 +1104,6 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + ) + await self._execute(conn, update) + +- # Delete the job +- delete = self._t_jobs.delete().where(self._t_jobs.c.id == result.job_id) +- await self._execute(conn, delete) +- + # Create the event, to be sent after commit + return JobReleased.from_result( + result, scheduler_id, task_id, schedule_id, scheduled_fire_time +@@ -1079,8 +1120,18 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + job.task_id, + job.schedule_id, + job.scheduled_fire_time, ++ claimed_by=scheduler_id, + ) + ++ if event is None: ++ self._logger.warning( ++ "Discarded the result of job %s from scheduler %r because it does not " ++ "hold the claim on the job", ++ job.id, ++ scheduler_id, ++ ) ++ return ++ + # Notify other schedulers + await self._event_broker.publish(event) + +@@ -1152,15 +1203,16 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + self.serializer, {**job_dict, "args": (), "kwargs": {}} + ) + result = JobResult.from_job(job, JobOutcome.abandoned) +- event = await self._release_job( ++ if event := await self._release_job( + conn, + result, + scheduler_id, + job.task_id, + job.schedule_id, + job.scheduled_fire_time, +- ) +- events.append(event) ++ claimed_by=scheduler_id, ++ ): ++ events.append(event) + + for event in events: + await self._event_broker.publish(event) +@@ -1196,16 +1248,17 @@ class SQLAlchemyDataStore(BaseExternalDataStore): + finished_at=now, + expires_at=now + row.result_expiration_time, + ) +- events.append( +- await self._release_job( +- conn, +- result, +- row.acquired_by, +- row.task_id, +- row.schedule_id, +- row.scheduled_fire_time, +- ) +- ) ++ if event := await self._release_job( ++ conn, ++ result, ++ row.acquired_by, ++ row.task_id, ++ row.schedule_id, ++ row.scheduled_fire_time, ++ claimed_by=row.acquired_by, ++ lease_expired_before=now, ++ ): ++ events.append(event) + + # Release any schedules whose leases have expired + columns = [ +diff --git a/tests/test_datastores.py b/tests/test_datastores.py +index e750445..c0d012e 100644 +--- a/tests/test_datastores.py ++++ b/tests/test_datastores.py +@@ -1,12 +1,13 @@ + from __future__ import annotations + ++import logging + import platform + from collections.abc import AsyncGenerator + from contextlib import AsyncExitStack, asynccontextmanager + from datetime import datetime, timedelta, timezone + from logging import Logger + from pathlib import Path +-from typing import TYPE_CHECKING ++from typing import TYPE_CHECKING, Any + from unittest.mock import Mock + + import anyio +@@ -21,7 +22,9 @@ from apscheduler import ( + Event, + Job, + JobOutcome, ++ JobReleased, + JobResult, ++ RetrySettings, + Schedule, + ScheduleAdded, + ScheduleRemoved, +@@ -37,6 +40,7 @@ from apscheduler.datastores.base import BaseExternalDataStore + from apscheduler.datastores.memory import MemoryDataStore + from apscheduler.datastores.mongodb import MongoDBDataStore + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore ++from apscheduler.eventbrokers.local import LocalEventBroker + from apscheduler.triggers.date import DateTrigger + + if TYPE_CHECKING: +@@ -652,6 +656,363 @@ async def test_acquire_jobs_max_number_exceeded(datastore: DataStore) -> None: + assert (await datastore.get_task("task1")).running_jobs == 2 + + ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_acquire_jobs_expired_lease_takeover( ++ datastore: DataStore, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that another scheduler can take over a job whose lease expired even when the ++ task is at capacity, that the takeover does not change the running jobs counter, ++ and that the belated release from the original scheduler does not affect the new ++ claim. ++ ++ """ ++ await datastore.add_task( ++ Task( ++ id="task1", ++ func="contextlib:asynccontextmanager", ++ job_executor="async", ++ max_running_jobs=1, ++ ) ++ ) ++ job = Job( ++ task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) ++ ) ++ await datastore.add_job(job) ++ ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ acquired1 = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) ++ assert [acquired.id for acquired in acquired1] == [job.id] ++ ++ time_machine.shift(31) ++ acquired2 = await datastore.acquire_jobs("worker2", timedelta(seconds=30), 1) ++ assert [acquired.id for acquired in acquired2] == [job.id] ++ assert acquired2[0].acquired_by == "worker2" ++ assert (await datastore.get_task("task1")).running_jobs == 1 ++ ++ # The belated release from the first scheduler must not release the new claim ++ await datastore.release_job( ++ "worker1", ++ acquired1[0], ++ JobResult.from_job(acquired1[0], JobOutcome.success, return_value="worker1"), ++ ) ++ assert [stored.id for stored in await datastore.get_jobs()] == [job.id] ++ assert (await datastore.get_task("task1")).running_jobs == 1 ++ assert not await datastore.acquire_jobs("worker3", timedelta(seconds=30), 1) ++ ++ await datastore.release_job( ++ "worker2", ++ acquired2[0], ++ JobResult.from_job(acquired2[0], JobOutcome.success, return_value="worker2"), ++ ) ++ assert not await datastore.get_jobs() ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ result = await datastore.get_job_result(job.id) ++ assert result ++ assert result.return_value == "worker2" ++ ++ ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_acquire_jobs_expired_lease_same_scheduler( ++ datastore: DataStore, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that the scheduler that owned an expired lease can acquire the job again, ++ without counting it twice. ++ ++ """ ++ await datastore.add_task( ++ Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") ++ ) ++ job = Job(task_id="task1", executor="async") ++ await datastore.add_job(job) ++ ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ assert len(await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1)) == 1 ++ ++ time_machine.shift(31) ++ acquired = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) ++ assert [acquired_job.id for acquired_job in acquired] == [job.id] ++ assert (await datastore.get_task("task1")).running_jobs == 1 ++ assert not await datastore.acquire_jobs("worker2", timedelta(seconds=30), 1) ++ ++ ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_release_job_after_lease_abandoned( ++ datastore: DataStore, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that releasing a job that clean-up already released as abandoned is a no-op ++ that neither decrements the running jobs counter nor replaces the recorded result. ++ ++ """ ++ await datastore.add_task( ++ Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") ++ ) ++ job = Job( ++ task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) ++ ) ++ await datastore.add_job(job) ++ ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ (acquired,) = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) ++ ++ time_machine.shift(31) ++ await datastore.cleanup() ++ assert not await datastore.get_jobs() ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ ++ await datastore.release_job( ++ "worker1", acquired, JobResult.from_job(acquired, JobOutcome.success) ++ ) ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ result = await datastore.get_job_result(job.id) ++ assert result ++ assert result.outcome is JobOutcome.abandoned ++ ++ ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_acquire_jobs_expired_lease_missed_deadline( ++ datastore: DataStore, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that a job whose lease expired and whose start deadline has passed is ++ discarded exactly once, ending the expired claim. ++ ++ """ ++ await datastore.add_task( ++ Task( ++ id="task1", ++ func="contextlib:asynccontextmanager", ++ job_executor="async", ++ max_running_jobs=2, ++ ) ++ ) ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ job = Job( ++ task_id="task1", ++ executor="async", ++ start_deadline=datetime.now(timezone.utc) + timedelta(seconds=60), ++ result_expiration_time=timedelta(minutes=1), ++ ) ++ await datastore.add_job(job) ++ (acquired,) = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) ++ ++ time_machine.shift(61) ++ for _ in range(3): ++ assert not await datastore.acquire_jobs("worker2", timedelta(seconds=30), 10) ++ assert not await datastore.get_jobs() ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ ++ result = await datastore.get_job_result(job.id) ++ assert result ++ assert result.outcome is JobOutcome.missed_start_deadline ++ ++ await datastore.release_job( ++ "worker1", acquired, JobResult.from_job(acquired, JobOutcome.success) ++ ) ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ ++ ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_release_job_lease_expiry_guard( ++ datastore: DataStore, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that a job whose lease expired is not abandoned by clean-up once its owner ++ has renewed the lease, and that the owner can then release it normally. ++ ++ """ ++ await datastore.add_task( ++ Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") ++ ) ++ job = Job( ++ task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) ++ ) ++ await datastore.add_job(job) ++ ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ (acquired,) = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) ++ ++ time_machine.shift(31) ++ await datastore.extend_acquired_job_leases( ++ "worker1", {job.id}, timedelta(seconds=30) ++ ) ++ await datastore.cleanup() ++ assert [stored.id for stored in await datastore.get_jobs()] == [job.id] ++ assert (await datastore.get_task("task1")).running_jobs == 1 ++ ++ await datastore.release_job( ++ "worker1", acquired, JobResult.from_job(acquired, JobOutcome.success) ++ ) ++ assert not await datastore.get_jobs() ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ result = await datastore.get_job_result(job.id) ++ assert result ++ assert result.outcome is JobOutcome.success ++ ++ ++@pytest.mark.skipif( ++ platform.python_implementation() != "CPython", ++ reason="time-machine is not available", ++) ++async def test_cleanup_lease_renewed_during_cleanup( ++ logger: Logger, time_machine: TimeMachineFixture ++) -> None: ++ """ ++ Test that the memory store's clean-up does not abandon a job whose lease was ++ renewed while the release of another abandoned job was being published (which, ++ unlike with the local event broker, may involve yielding control to other tasks). ++ ++ """ ++ acquired: list[Job] = [] ++ ++ class LeaseRenewingEventBroker(LocalEventBroker): ++ async def publish(self, event: Event) -> None: ++ if isinstance(event, JobReleased): ++ await datastore.extend_acquired_job_leases( ++ "worker1", {job.id for job in acquired}, timedelta(seconds=30) ++ ) ++ ++ await super().publish(event) ++ ++ async with AsyncExitStack() as exit_stack: ++ datastore = MemoryDataStore() ++ event_broker = LeaseRenewingEventBroker() ++ await event_broker.start(exit_stack, logger) ++ await datastore.start(exit_stack, event_broker, logger) ++ await datastore.add_task( ++ Task( ++ id="task1", func="contextlib:asynccontextmanager", job_executor="async" ++ ) ++ ) ++ for _ in range(2): ++ await datastore.add_job(Job(task_id="task1", executor="async")) ++ ++ time_machine.move_to(datetime.now(timezone.utc), tick=False) ++ acquired = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 2) ++ assert len(acquired) == 2 ++ ++ time_machine.shift(31) ++ await datastore.cleanup() ++ ++ assert len(await datastore.get_jobs()) == 1 ++ assert (await datastore.get_task("task1")).running_jobs == 1 ++ ++ ++@pytest.mark.external_service ++async def test_mongodb_release_job_transient_failure( ++ mongodb_store: MongoDBDataStore, ++ local_broker: EventBroker, ++ logger: Logger, ++ mocker: MockerFixture, ++) -> None: ++ """ ++ Test that a transient failure halfway through releasing a job neither loses the ++ job's result nor leaks its slot in the task's running jobs counter. ++ ++ """ ++ from pymongo.errors import ConnectionFailure ++ from tenacity import wait_none ++ ++ mongodb_store.retry_settings = RetrySettings(wait=wait_none()) ++ async with AsyncExitStack() as exit_stack: ++ await local_broker.start(exit_stack, logger) ++ await mongodb_store.start(exit_stack, local_broker, logger) ++ await mongodb_store.add_task( ++ Task( ++ id="task1", func="contextlib:asynccontextmanager", job_executor="async" ++ ) ++ ) ++ job = Job( ++ task_id="task1", ++ executor="async", ++ result_expiration_time=timedelta(minutes=1), ++ ) ++ await mongodb_store.add_job(job) ++ (acquired,) = await mongodb_store.acquire_jobs( ++ "worker1", timedelta(seconds=30), 1 ++ ) ++ ++ calls = 0 ++ find_one_and_update = mongodb_store._tasks.find_one_and_update ++ ++ async def flaky_find_one_and_update(*args: Any, **kwargs: Any) -> Any: ++ nonlocal calls ++ calls += 1 ++ if calls == 1: ++ raise ConnectionFailure("simulated failure") ++ ++ return await find_one_and_update(*args, **kwargs) ++ ++ mocker.patch.object( ++ mongodb_store._tasks, "find_one_and_update", flaky_find_one_and_update ++ ) ++ await mongodb_store.release_job( ++ "worker1", acquired, JobResult.from_job(acquired, JobOutcome.success) ++ ) ++ assert calls == 2 ++ assert not await mongodb_store.get_jobs() ++ assert (await mongodb_store.get_task("task1")).running_jobs == 0 ++ result = await mongodb_store.get_job_result(job.id) ++ assert result ++ assert result.outcome is JobOutcome.success ++ ++ ++async def test_release_job_not_acquired( ++ datastore: DataStore, caplog: pytest.LogCaptureFixture ++) -> None: ++ """ ++ Test that releasing a job on behalf of a scheduler that does not hold the claim on ++ it leaves the job in place and logs a warning about the discarded result. ++ ++ """ ++ await datastore.add_task( ++ Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") ++ ) ++ job = Job( ++ task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) ++ ) ++ await datastore.add_job(job) ++ ++ caplog.set_level(logging.WARNING) ++ await datastore.release_job( ++ "worker1", job, JobResult.from_job(job, JobOutcome.success) ++ ) ++ assert [stored.id for stored in await datastore.get_jobs()] == [job.id] ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ assert not await datastore.get_job_result(job.id) ++ assert any("does not hold the claim" in record.message for record in caplog.records) ++ ++ ++@pytest.mark.parametrize("limit", [0, -1]) ++async def test_acquire_jobs_zero_limit(datastore: DataStore, limit: int) -> None: ++ await datastore.add_task( ++ Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") ++ ) ++ for _ in range(2): ++ await datastore.add_job(Job(task_id="task1", executor="async")) ++ ++ assert await datastore.acquire_jobs("worker1", timedelta(seconds=30), limit) == [] ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ assert len(await datastore.acquire_jobs("worker1", timedelta(seconds=30), 10)) == 2 ++ ++ + async def test_add_get_task(datastore: DataStore) -> None: + with pytest.raises(TaskLookupError): + await datastore.get_task("dummyid") +@@ -867,12 +1228,22 @@ async def test_acquire_jobs_deserialization_failure( + + # Make the serializer fail deserialization + assert isinstance(datastore, BaseExternalDataStore) ++ serializer = datastore.serializer + datastore.serializer = Mock(Serializer) ++ datastore.serializer.serialize.configure_mock(side_effect=serializer.serialize) + datastore.serializer.deserialize.configure_mock(side_effect=DeserializationError) + + # This should not yield any jobs + assert await datastore.acquire_jobs("scheduler_id", timedelta(seconds=30), 1) == [] + ++ # The job should have been discarded with the appropriate outcome ++ datastore.serializer = serializer ++ assert not await datastore.get_jobs() ++ assert (await datastore.get_task("task1")).running_jobs == 0 ++ result = await datastore.get_job_result(job.id) ++ assert result ++ assert result.outcome is JobOutcome.deserialization_failed ++ + + async def test_reap_abandoned_jobs( + datastore: DataStore, local_broker: EventBroker, logger: Logger +diff --git a/tests/test_schedulers.py b/tests/test_schedulers.py +index 0f59271..c422751 100644 +--- a/tests/test_schedulers.py ++++ b/tests/test_schedulers.py +@@ -14,6 +14,7 @@ from queue import Queue + from types import ModuleType + from typing import Any, cast + from unittest.mock import patch ++from uuid import UUID + + import anyio + import attrs +@@ -39,6 +40,7 @@ from apscheduler import ( + JobLookupError, + JobOutcome, + JobReleased, ++ JobResult, + RunState, + ScheduleAdded, + ScheduleLookupError, +@@ -48,6 +50,7 @@ from apscheduler import ( + SchedulerStarted, + SchedulerStopped, + ScheduleUpdated, ++ Task, + TaskAdded, + TaskDefaults, + TaskUpdated, +@@ -102,6 +105,85 @@ def decorated_job() -> None: + pass + + ++class LeaseExpiringDataStore(MemoryDataStore): ++ """ ++ Memory store that lets the leases of the acquiring scheduler lapse right before ++ its next acquisitions, as if the scheduler had been too slow to extend them. ++ ++ """ ++ ++ expirations_left = 0 ++ acquire_calls = 0 ++ ++ async def acquire_jobs( ++ self, scheduler_id: str, lease_duration: timedelta, limit: int | None = None ++ ) -> list[Job]: ++ self.acquire_calls += 1 ++ if self.expirations_left: ++ self.expirations_left -= 1 ++ for job in self._jobs_by_id.values(): ++ if job.acquired_by == scheduler_id: ++ job.acquired_until = datetime.min.replace(tzinfo=timezone.utc) ++ ++ return await super().acquire_jobs(scheduler_id, lease_duration, limit) ++ ++ ++class BlockingAcquireDataStore(MemoryDataStore): ++ """ ++ Memory store that, when armed, claims jobs and then blocks before returning them, ++ so that the acquiring scheduler can be stopped while the acquisition is in flight. ++ ++ """ ++ ++ armed = False ++ jobs_claimed: anyio.Event ++ unblock: anyio.Event ++ ++ async def acquire_jobs( ++ self, scheduler_id: str, lease_duration: timedelta, limit: int | None = None ++ ) -> list[Job]: ++ jobs = await super().acquire_jobs(scheduler_id, lease_duration, limit) ++ if jobs and self.armed: ++ self.armed = False ++ self.jobs_claimed.set() ++ await self.unblock.wait() ++ ++ return jobs ++ ++ ++class FailingReleaseDataStore(MemoryDataStore): ++ """Memory store that fails to release the jobs whose IDs are listed.""" ++ ++ failing_job_ids: frozenset[UUID] = frozenset() ++ ++ async def release_job(self, scheduler_id: str, job: Job, result: JobResult) -> None: ++ if job.id in self.failing_job_ids: ++ raise RuntimeError("Fake release failure") ++ ++ await super().release_job(scheduler_id, job, result) ++ ++ ++class FailingExtendDataStore(MemoryDataStore): ++ """ ++ Memory store that fails the given number of job lease extensions, and then sets ++ ``extended`` once a lease extension succeeds. ++ ++ """ ++ ++ extend_failures_left = 0 ++ extended: anyio.Event ++ ++ async def extend_acquired_job_leases( ++ self, scheduler_id: str, job_ids: set[UUID], duration: timedelta ++ ) -> None: ++ if self.extend_failures_left: ++ self.extend_failures_left -= 1 ++ raise RuntimeError("Fake extension failure") ++ ++ await super().extend_acquired_job_leases(scheduler_id, job_ids, duration) ++ self.extended.set() ++ ++ + class DummyClass: + def __init__(self, value: int): + self.value = value +@@ -970,6 +1052,304 @@ class TestAsyncScheduler: + await scheduler.add_job("dummyjob") + await scheduler.run_until_stopped() + ++ @pytest.mark.parametrize( ++ "always_expire", ++ [pytest.param(False, id="once"), pytest.param(True, id="always")], ++ ) ++ async def test_reacquire_running_job(self, always_expire: bool) -> None: ++ """ ++ Test that a job handed back by the data store while the scheduler is still ++ running it (because its lease had lapsed) is not started again, does not starve ++ other pending jobs and cannot turn the job acquisition loop into a busy loop. ++ ++ """ ++ data_store = LeaseExpiringDataStore() ++ scheduler = AsyncScheduler(data_store=data_store, max_concurrent_jobs=2) ++ started_count = 0 ++ job_started = anyio.Event() ++ finish_jobs = anyio.Event() ++ ++ async def long_job() -> None: ++ nonlocal started_count, job_started ++ started_count += 1 ++ job_started.set() ++ await finish_jobs.wait() ++ ++ with fail_after(3): ++ async with scheduler: ++ await scheduler.configure_task( ++ "longjob", func=long_job, max_running_jobs=2 ++ ) ++ await scheduler.start_in_background() ++ job1_id = await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ await job_started.wait() ++ ++ # Let the lease lapse and wake up the job acquisition loop ++ job_started = anyio.Event() ++ data_store.expirations_left = 1_000_000 if always_expire else 1 ++ acquire_calls = data_store.acquire_calls ++ job2_id = await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ if always_expire: ++ # The running job fills every batch, but must not be restarted or ++ # re-acquired in a busy loop ++ await sleep(0.3) ++ assert started_count == 1 ++ assert data_store.acquire_calls - acquire_calls <= 2 ++ data_store.expirations_left = 0 ++ ++ finish_jobs.set() ++ for job_id in job1_id, job2_id: ++ result = await scheduler.get_job_result(job_id) ++ assert result.outcome is JobOutcome.success ++ ++ assert started_count == 2 ++ assert (await data_store.get_task("longjob")).running_jobs == 0 ++ ++ async def test_reacquire_more_running_jobs_than_limit(self) -> None: ++ """ ++ Test that when more running jobs have lapsed leases than there are free slots, ++ the scheduler keeps renewing them until pending jobs get their turn, without ++ waiting for an unrelated event. ++ ++ """ ++ data_store = LeaseExpiringDataStore() ++ scheduler = AsyncScheduler(data_store=data_store, max_concurrent_jobs=3) ++ started_count = 0 ++ job_started = anyio.Event() ++ finish_jobs = anyio.Event() ++ ++ async def long_job() -> None: ++ nonlocal started_count ++ started_count += 1 ++ job_started.set() ++ await finish_jobs.wait() ++ ++ with fail_after(3): ++ async with scheduler: ++ await scheduler.configure_task( ++ "longjob", func=long_job, max_running_jobs=3 ++ ) ++ await scheduler.start_in_background() ++ job_ids = [ ++ await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ for _ in range(2) ++ ] ++ while started_count < 2: ++ job_started = anyio.Event() ++ await job_started.wait() ++ ++ # Both running jobs' leases lapse; only one slot is free per batch ++ data_store.expirations_left = 1 ++ job_started = anyio.Event() ++ job_ids.append( ++ await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ ) ++ await job_started.wait() ++ assert started_count == 3 ++ ++ finish_jobs.set() ++ for job_id in job_ids: ++ result = await scheduler.get_job_result(job_id) ++ assert result.outcome is JobOutcome.success ++ ++ assert started_count == 3 ++ assert (await data_store.get_task("longjob")).running_jobs == 0 ++ ++ async def test_stop_during_job_acquisition(self) -> None: ++ """ ++ Test that if the scheduler is stopped while the data store is claiming jobs for ++ it, the claims are handed back immediately (not released with a result, and not ++ left to lapse), so another scheduler can run the jobs right away. ++ ++ """ ++ data_store = BlockingAcquireDataStore() ++ data_store.jobs_claimed = anyio.Event() ++ data_store.unblock = anyio.Event() ++ run_by: list[str] = [] ++ ++ async def job_func() -> None: ++ run_by.append(current_async_scheduler.get().identity) ++ ++ with fail_after(5): ++ scheduler = AsyncScheduler( ++ data_store=data_store, identity="first", cleanup_interval=None ++ ) ++ async with scheduler: ++ await scheduler.configure_task("job", func=job_func) ++ await scheduler.start_in_background() ++ data_store.armed = True ++ job_id = await scheduler.add_job( ++ "job", result_expiration_time=timedelta(minutes=1) ++ ) ++ await data_store.jobs_claimed.wait() ++ ++ stopped = anyio.Event() ++ scheduler.subscribe( ++ lambda _: stopped.set(), {SchedulerStopped}, one_shot=True ++ ) ++ await scheduler.stop() ++ data_store.unblock.set() ++ await stopped.wait() ++ ++ assert run_by == [] ++ jobs = await data_store.get_jobs([job_id]) ++ assert len(jobs) == 1 ++ assert jobs[0].acquired_by == "first" ++ assert jobs[0].acquired_until < datetime.now(timezone.utc) ++ assert await data_store.get_job_result(job_id) is None ++ ++ # Well before the original lease (30 seconds) would lapse, another scheduler ++ # takes the job over and runs it ++ peer = AsyncScheduler( ++ data_store=data_store, identity="second", cleanup_interval=None ++ ) ++ async with peer: ++ await peer.configure_task("job", func=job_func) ++ await peer.start_in_background() ++ result = await peer.get_job_result(job_id) ++ assert result.outcome is JobOutcome.success ++ ++ assert run_by == ["second"] ++ assert (await data_store.get_task("job")).running_jobs == 0 ++ ++ async def test_unresolvable_callable_does_not_strand_batch(self) -> None: ++ """ ++ Test that when one job in an acquired batch cannot be prepared (here, because ++ its task's callable cannot be looked up), that job is released with an error ++ and the rest of the batch still runs, while the scheduler keeps running. ++ ++ """ ++ data_store = MemoryDataStore() ++ scheduler = AsyncScheduler(data_store=data_store, max_concurrent_jobs=2) ++ with fail_after(3): ++ async with scheduler: ++ await data_store.add_task( ++ Task( ++ id="unresolvable", ++ func="nonexistent_apscheduler_test_module:func", ++ job_executor="async", ++ ) ++ ) ++ await scheduler.configure_task("good", func=dummy_async_job) ++ bad_job_id = await scheduler.add_job( ++ "unresolvable", result_expiration_time=timedelta(minutes=1) ++ ) ++ good_job_id = await scheduler.add_job( ++ "good", result_expiration_time=timedelta(minutes=1) ++ ) ++ await scheduler.start_in_background() ++ ++ bad_result = await scheduler.get_job_result(bad_job_id) ++ assert bad_result.outcome is JobOutcome.error ++ assert isinstance(bad_result.exception, LookupError) ++ ++ good_result = await scheduler.get_job_result(good_job_id) ++ assert good_result.outcome is JobOutcome.success ++ assert scheduler.state is RunState.started ++ assert (await data_store.get_task("unresolvable")).running_jobs == 0 ++ ++ # The scheduler still processes new jobs ++ job_id = await scheduler.add_job( ++ "good", result_expiration_time=timedelta(minutes=1) ++ ) ++ result = await scheduler.get_job_result(job_id) ++ assert result.outcome is JobOutcome.success ++ ++ async def test_release_failure_while_stopping(self) -> None: ++ """ ++ Test that if releasing a job that was cancelled by stopping the scheduler fails, ++ the scheduler still stops cleanly, the other cancelled jobs are released, and ++ the failed job's claim is handed back rather than left to lapse. ++ ++ """ ++ data_store = FailingReleaseDataStore() ++ scheduler = AsyncScheduler( ++ data_store=data_store, max_concurrent_jobs=2, cleanup_interval=None ++ ) ++ stopped_events: list[SchedulerStopped] = [] ++ started_count = 0 ++ both_started = anyio.Event() ++ ++ async def long_job() -> None: ++ nonlocal started_count ++ started_count += 1 ++ if started_count == 2: ++ both_started.set() ++ ++ await sleep(30) ++ ++ with fail_after(5): ++ async with scheduler: ++ await scheduler.configure_task( ++ "longjob", func=long_job, max_running_jobs=2 ++ ) ++ failing_job_id = await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ other_job_id = await scheduler.add_job( ++ "longjob", result_expiration_time=timedelta(minutes=1) ++ ) ++ data_store.failing_job_ids = frozenset({failing_job_id}) ++ await scheduler.start_in_background() ++ await both_started.wait() ++ ++ stopped = anyio.Event() ++ ++ def on_stopped(event: Event) -> None: ++ stopped_events.append(cast(SchedulerStopped, event)) ++ stopped.set() ++ ++ scheduler.subscribe(on_stopped, {SchedulerStopped}, one_shot=True) ++ await scheduler.stop() ++ await stopped.wait() ++ ++ assert len(stopped_events) == 1 ++ assert stopped_events[0].exception is None ++ ++ result = await data_store.get_job_result(other_job_id) ++ assert result.outcome is JobOutcome.cancelled ++ ++ jobs = await data_store.get_jobs([failing_job_id]) ++ assert len(jobs) == 1 ++ assert jobs[0].acquired_until < datetime.now(timezone.utc) ++ assert (await data_store.get_task("longjob")).running_jobs == 1 ++ ++ async def test_job_lease_extension_failure(self) -> None: ++ """ ++ Test that a failure to extend the leases of running jobs does not crash the ++ scheduler, and that the leases are extended again afterwards. ++ ++ """ ++ data_store = FailingExtendDataStore() ++ data_store.extend_failures_left = 1 ++ data_store.extended = anyio.Event() ++ scheduler = AsyncScheduler( ++ data_store=data_store, lease_duration=timedelta(seconds=0.2) ++ ) ++ ++ async def job_func() -> None: ++ await data_store.extended.wait() ++ ++ with fail_after(3): ++ async with scheduler: ++ await scheduler.configure_task("job", func=job_func) ++ await scheduler.start_in_background() ++ job_id = await scheduler.add_job( ++ "job", result_expiration_time=timedelta(minutes=1) ++ ) ++ result = await scheduler.get_job_result(job_id) ++ assert result.outcome is JobOutcome.success ++ assert data_store.extend_failures_left == 0 ++ assert scheduler.state is RunState.started ++ + @pytest.mark.parametrize( + "trigger_type, run_job", + [ diff --git a/harbor/sources/apscheduler-v17/grading/__init__.py b/harbor/sources/apscheduler-v17/grading/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e099f6dc58907a533844544d6a6b24fea22d5e0f --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/__init__.py @@ -0,0 +1,18 @@ +"""Grading modules for apscheduler_expired_job_lease. + +Submodules are exposed lazily (PEP 562). Importing this package must never pull +in the grader chain, so that a missing or corrupted grader submodule surfaces as +a fail-closed result from ``env.run_grading`` instead of an import-time crash +that leaves the container with no JSON output. +""" + +__all__ = ["GradingRunner"] + + +def __getattr__(name: str): + """Import submodule attributes on first access, not at package import.""" + if name == "GradingRunner": + from .runner import GradingRunner + + return GradingRunner + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") diff --git a/harbor/sources/apscheduler-v17/grading/adversarial-manifest.json b/harbor/sources/apscheduler-v17/grading/adversarial-manifest.json new file mode 100644 index 0000000000000000000000000000000000000000..c61a1646b81509353f9113e9fe470507643ad699 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/adversarial-manifest.json @@ -0,0 +1,609 @@ +{ + "schema_version": 7, + "task_id": "apscheduler_expired_job_lease", + "gold_diff_sha256": "edb02a29a38511ccf87549d1eb5b37476ee885f08a09980e46d81d30edf2cb7c", + "comment_syntax": [ + "#" + ], + "native_commands": { + "test": { + "argv": [ + "/opt/apscheduler-venv/bin/python", + "-I", + "-m", + "pytest", + "-m", + "not external_service", + "-p", + "no:cacheprovider", + "-o", + "pythonpath=src", + "-q" + ], + "timeout_seconds": 300, + "measured_runtime_seconds": { + "gold": 27.45, + "base": 25.144 + }, + "may_cap": true, + "requires": [ + "task_python" + ], + "description": "The repository's non-external test suite (the suite the prompt names as the regression bar), run by the task interpreter with src/ on the import path. The grader runs the same selection from the pinned base tests and settings against the candidate src/; its failure lands on the 0.60 build/regression ceiling." + } + }, + "runtime_requirements": { + "executables": [ + { + "id": "task_python", + "executable": "/opt/apscheduler-venv/bin/python", + "role": "interpreter", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "/opt/apscheduler-venv/bin/python", + "--version" + ], + "regex": "Python (\\d+\\.\\d+\\.\\d+)", + "accepted_returncodes": [ + 0 + ] + }, + "version_constraint": { + "major": 3, + "minimum": "3.13" + }, + "required_by": [ + "native_command:test", + "grader:grading/runner.py", + "agent_prompt" + ], + "offline_assets": [ + "/opt/apscheduler-venv/lib/python3.13/site-packages/pytest", + "/opt/apscheduler-venv/lib/python3.13/site-packages/anyio", + "/opt/apscheduler-venv/lib/python3.13/site-packages/aiosqlite", + "/opt/apscheduler-venv/lib/python3.13/site-packages/sqlalchemy", + "/opt/apscheduler-venv/lib/python3.13/site-packages/time_machine", + "/opt/apscheduler-venv/lib/python3.13/site-packages/pytest_lazy_fixtures", + "/opt/apscheduler-venv/lib/python3.13/site-packages/tzdata" + ], + "description": "CPython 3.13 virtualenv with the base test dependency group; spawned by the grader through the task_python() indirection and by the native test command." + }, + { + "id": "git", + "executable": "git", + "role": "system", + "discovery": "static", + "version_probe": { + "argv": [ + "git", + "--version" + ], + "regex": "git version (\\d+\\.\\d+\\.\\d+)", + "accepted_returncodes": [ + 0 + ] + }, + "required_by": [ + "grader:grading/runner.py", + "grader:env.py" + ], + "description": "Lists paths changed outside src/ with an exact safe.directory, materializes reference trees and captures the workspace snapshot." + }, + { + "id": "setpriv", + "executable": "setpriv", + "role": "system", + "discovery": "dynamic", + "version_probe": { + "argv": [ + "setpriv", + "--version" + ], + "regex": "util-linux (\\d+\\.\\d+(?:\\.\\d+)?)", + "accepted_returncodes": [ + 0 + ] + }, + "required_by": [ + "grader:grading/runner.py", + "grader:env.py" + ], + "description": "Drops candidate-executing probe and wall subprocesses, and the agent shell, to the workspace account; built as a list and passed through a variable, so static discovery does not see it." + } + ], + "services": [] + }, + "runtime_build_inputs": { + "base_images": [ + { + "stage": "runtime-contract", + "reference": "ubuntu:24.04@sha256:224a1869083a311ef3f13648a154ba79832fbef6364d31493642ca03082da254" + }, + { + "stage": "runtime-contract", + "reference": "ghcr.io/astral-sh/uv:0.12.3@sha256:2d890623d310b57771ce840f0da5eed5fc6d657da05ffaa45d82797b53fa3abc" + } + ], + "package_repositories": [ + { + "manager": "apt", + "snapshot": "https://snapshot.ubuntu.com/ubuntu/20260915T000000Z" + }, + { + "manager": "pip", + "snapshot": "runtime/apscheduler-test-requirements.txt: every distribution pinned by version and sha256 (--require-hashes), resolved with --exclude-newer 2026-09-15T00:00:00Z; the grader and HUD server environment is pinned by uv.lock (uv sync --frozen)" + } + ], + "artifacts": [ + { + "id": "cpython_3_13_15", + "version": "3.13.15+20260807", + "source": "https://github.com/astral-sh/python-build-standalone/releases/download/20260807/cpython-3.13.15%2B20260807-x86_64-unknown-linux-gnu-install_only_stripped.tar.gz", + "sha256": "faae10a9faa9bec06da009ac69326cc1d9691dc138fec6a1b69159dff1781f35" + } + ] + }, + "deployment_context": { + "required_files": [ + ".dockerignore", + ".gitignore", + "Dockerfile.hud", + "env.py", + "gold.diff", + "grading/__init__.py", + "grading/adversarial-manifest.json", + "grading/baseline/pyproject.toml", + "grading/baseline/tests/conftest.py", + "grading/baseline/tests/test_datastores.py", + "grading/baseline/tests/test_eventbrokers.py", + "grading/baseline/tests/test_marshalling.py", + "grading/baseline/tests/test_schedulers.py", + "grading/baseline/tests/test_serializers.py", + "grading/baseline/tests/triggers/test_calendarinterval.py", + "grading/baseline/tests/triggers/test_combining.py", + "grading/baseline/tests/triggers/test_cron.py", + "grading/baseline/tests/triggers/test_date.py", + "grading/baseline/tests/triggers/test_interval.py", + "grading/graders.py", + "grading/probes/probe_cases.py", + "grading/probes/probe_main.py", + "grading/probes/wall_main.py", + "grading/runner.py", + "pyproject.toml", + "runtime/apscheduler-test-requirements.txt", + "task/__init__.py", + "task/prompt.md", + "task/rubric.md", + "tasks.py", + "uv.lock" + ], + "forbidden_files": [ + "scaffold-manifest.json" + ], + "forbidden_directories": [ + "tests", + "grading/adversarial", + ".venv", + ".pytest_cache", + ".ruff_cache" + ] + }, + "safety_gate_mutants": [ + { + "id": "safety_gate_g1_reraise_cancel_release", + "target_gate_id": "G1", + "target_criteria": [ + "stop_failed_release_clean_stop", + "stop_failed_release_handback", + "cancelled_release_containment" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "JobOutcome.cancelled", + "release_job", + "except Exception", + "SchedulerStopped" + ], + "patch_path": "grading/adversarial/patches/safety_gate_g1_reraise_cancel_release.diff", + "applies_to": "gold", + "description": "Gold with the cancelled release wrapped in `except Exception` that logs and re-raises: the tokens stay, the release error escapes the stop again. Loses C10 (G1 fires) and C11 (no hand-back); raw 0.76, final capped at 0.60.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1": false, + "G2": true, + "G3": true, + "G4": true + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.987283, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "expired_claim_takeover", + "stale_release_ignored", + "acquisition_limit_contract", + "running_job_reacquisition", + "stop_during_acquisition_handback", + "cancel_during_acquisition_handback", + "unpreparable_job_containment", + "cleanup_claim_integrity", + "lease_extension_failure_survival" + ], + "caps": [ + "G1" + ] + } + }, + { + "id": "safety_gate_g2_stale_job_object_check", + "target_gate_id": "G2", + "target_criteria": [ + "stale_release_ignored" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "acquired_by", + "scheduler_id", + "does not hold the claim", + "release_job" + ], + "patch_path": "grading/adversarial/patches/safety_gate_g2_stale_job_object_check.diff", + "applies_to": "gold", + "description": "Gold whose SQLAlchemy release_job checks the holder against the caller's (stale) Job object and deletes any claimed row instead of the stored claim, so the check always passes for the previous owner. The memory store returns its stored Job objects, so the same stale-object check there would be equivalent to the stored claim and is not the mutation. Loses C03 (G2 fires); raw 0.92, final capped at 0.60.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1": true, + "G2": false, + "G3": true, + "G4": true + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.999064, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "expired_claim_takeover", + "acquisition_limit_contract", + "running_job_reacquisition", + "stop_during_acquisition_handback", + "cancel_during_acquisition_handback", + "unpreparable_job_containment", + "stop_failed_release_clean_stop", + "stop_failed_release_handback", + "cleanup_claim_integrity", + "lease_extension_failure_survival" + ], + "caps": [ + "G2" + ] + } + }, + { + "id": "safety_gate_g3_shield_handback_only", + "target_gate_id": "G3", + "target_criteria": [ + "stop_during_acquisition_handback", + "cancel_during_acquisition_handback" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "CancelScope(shield=True)", + "extend_acquired_job_leases", + "hand back", + "acquire_jobs" + ], + "patch_path": "grading/adversarial/patches/safety_gate_g3_shield_handback_only.diff", + "applies_to": "gold", + "description": "Gold with the shield kept only around the hand-back call and removed from the acquisition, so a stop during acquire_jobs loses the claimed batch. Loses C06 (G3 fires) and, from the same removed shield, C13 (a cancellation during the acquisition no longer leaves the batch in hand to hand back); raw 0.8425, final capped at 0.60. Since revision 4 the C13 loss also fires G4, so this mutant carries two caps (G3, G4); C17, C21 and C22 are unaffected (measured).", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1": true, + "G2": true, + "G3": false, + "G4": false + }, + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.788888, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "expired_claim_takeover", + "stale_release_ignored", + "acquisition_limit_contract", + "running_job_reacquisition", + "unpreparable_job_containment", + "stop_failed_release_clean_stop", + "stop_failed_release_handback", + "cleanup_claim_integrity", + "lease_extension_failure_survival" + ], + "caps": [ + "G3", + "G4" + ] + } + }, + { + "id": "safety_gate_g4_state_check_after_acquire", + "target_gate_id": "G4", + "target_criteria": [ + "cancel_during_acquisition_handback" + ], + "cue_preserving": true, + "cue_tokens_required_present": [ + "CancelScope(shield=True)", + "acquire_jobs", + "hand back", + "RunState.started" + ], + "patch_path": "grading/adversarial/patches/safety_gate_g4_state_check_after_acquire.diff", + "applies_to": "gold", + "description": "Gold with the checkpoint after the shielded acquisition replaced by a run-state check: a stop() during acquire_jobs is still detected (C06 passes, G3 stays up), but an outside cancellation never changes the run state, so the cancelled scheduler starts and runs the claimed batch. Loses C13 only (G4 fires); raw 0.91, final capped at 0.60. This is the shape both gemini-3.8-flash v12 runs (job bb31a217) used.", + "expected": { + "target_raw_leaf_max": 0.0, + "gate_statuses": { + "G1": true, + "G2": true, + "G3": true, + "G4": false + }, + "caps": [ + "G4" + ], + "safety_gates_failed": true, + "build_failed": false, + "raw_score": 0.894444, + "final_score": 0.6, + "final_score_cap": 0.6, + "unaffected_criteria": [ + "expired_claim_takeover", + "stale_release_ignored", + "acquisition_limit_contract", + "running_job_reacquisition", + "stop_during_acquisition_handback", + "unpreparable_job_containment", + "stop_failed_release_clean_stop", + "stop_failed_release_handback", + "cleanup_claim_integrity", + "lease_extension_failure_survival", + "preparation_cancellation_handback", + "arbitrary_preparation_isolation", + "cancelled_release_containment", + "stale_release_observability" + ] + } + } + ], + "keyword_stuffing_fixtures": [ + { + "id": "keyword_stuffing_lease_cues", + "patch_path": "grading/adversarial/patches/keyword_stuffing_lease_cues.diff", + "applies_to": "base", + "target_files": [ + "src/apscheduler/datastores/memory.py", + "src/apscheduler/datastores/sqlalchemy.py", + "src/apscheduler/_schedulers/async_.py" + ], + "description": "Base plus comments and unused string constants carrying every grader-recognized cue token from the approved Negative controls table, in the three modules the probes import and drive.", + "expected": { + "final_score": 0.0, + "raw_score": 0.0 + } + } + ], + "quality_bypass_fixtures": [ + { + "id": "quality_bypass_deselect_reap_test", + "patch_path": "grading/adversarial/patches/quality_bypass_deselect_reap_test.diff", + "applies_to": "gold", + "description": "Gold plus a tests/conftest.py pytest_collection_modifyitems hook deselecting test_scheduler_crash_reap_abandoned_jobs and a memory-store change that breaks that test (abandoned jobs reaped as cancelled). The wall runs the base conftest, so the test fails and the build ceiling applies; info.regression_wall.weakened_settings names the collection hook. Paired compliant control (package test): gold plus a new test file scores 1.00 with no ceiling.", + "expected": { + "build_failed": true, + "safety_gates_failed": false, + "raw_score": 1.0, + "final_score": 0.6, + "final_score_cap": 0.6 + } + } + ], + "broken_regression_fixtures": [ + { + "id": "broken_regression_finished_release_swallowed", + "patch_path": "grading/adversarial/patches/broken_regression_finished_release_swallowed.diff", + "applies_to": "gold", + "description": "Gold with a failed release of a successfully finished job routed through the hand-back path, so it no longer crashes the scheduler; the unmodified base test test_scheduler_crash_reap_abandoned_jobs fails. Raw 1.00, build ceiling 0.60. Paired compliant control: gold unchanged.", + "expected": { + "build_failed": true, + "safety_gates_failed": false, + "raw_score": 1.0, + "final_score": 0.6, + "final_score_cap": 0.6 + } + } + ], + "no_op_fixtures": [ + { + "id": "no_op_whitespace_memory_store", + "patch_path": "grading/adversarial/patches/no_op_whitespace_memory_store.diff", + "applies_to": "base", + "description": "Whitespace-only edit (an added blank line) to src/apscheduler/datastores/memory.py, a module every store probe imports.", + "expected": { + "final_score": 0.0, + "raw_score": 0.0 + } + } + ], + "lazy_fix_fixtures": [ + { + "id": "lazy_fix_store_ownership_only", + "patch_path": "grading/adversarial/patches/lazy_fix_store_ownership_only.diff", + "applies_to": "base", + "description": "Store-only patch written against the prompt, not derived from gold.diff: holder-checked release_job in the memory and SQLAlchemy stores and SQL takeover of a lapsed claim without a new slot; no scheduler change. Measured profile: expired_claim_takeover 1.0 (C01 0.02 + C02 0.02), stale_release_ignored 1.0 (C03 0.03), every other criterion 0.0 — including acquisition_limit_contract (C15) and cleanup_claim_integrity (C14), which the store-only patch does not address; raw 0.07. G1 and G3 fail, but min(0.07, 0.60) = 0.07, so partial credit, not a ceiling, sets the score (safety_gates_failed false: no gate ceiling lowered it; the failing gates are listed in info.failed_gates). Weight refit 2026-09-23 (job 06885927, difficult budget 0.95): the three passed cases are never-failed cases sharing the 0.05 easy budget, so raw falls to 0.002959; the band floor is lowered to 0.002 so the declared band still contains the measured value. validate-helper's LAZY_FIX_MIN 0.05 floor was already unmet before the refit (band 0.04, raw 0.0427) and remains unmet. De-concentration refit 2026-09-23 (jobs 9084c34f + 71bb9800, policy 0.85/0.15 budget): the three passed cases (C01 0.000595, C02 0.000595, C03 0.000551) are never-failed cases sharing the 0.15 easy budget, so raw falls to 0.001741; the band floor is lowered to 0.001 so the declared band still contains the measured value. expired_claim_takeover's projected value moves to 0.799731 (C01+C02 shares under the new split); the previous 0.8 entry did not match the C23 share split introduced on 2026-09-23 and is corrected here.", + "expected": { + "final_score_min": 0.001, + "final_score_max": 0.3, + "raw_score": 0.001741, + "build_failed": false, + "safety_gates_failed": false, + "criteria_profile": { + "expired_claim_takeover": 0.799731, + "stale_release_ignored": 1.0, + "acquisition_limit_contract": 0.0, + "running_job_reacquisition": 0.0, + "stop_during_acquisition_handback": 0.0, + "cancel_during_acquisition_handback": 0.0, + "unpreparable_job_containment": 0.0, + "stop_failed_release_clean_stop": 0.0, + "stop_failed_release_handback": 0.0, + "cleanup_claim_integrity": 0.0, + "lease_extension_failure_survival": 0.0 + } + } + } + ], + "competent_partial_fixtures": [ + { + "id": "competent_partial_shortest_solution", + "patch_path": "grading/adversarial/patches/competent_partial_shortest_solution.diff", + "applies_to": "base", + "description": "The shortest_competent_solution row of the approved semantic viability screen (intake/difficulty-rationale.md): holder-checked release_job, the SQL takeover counter fix, skip re-acquired running jobs, try/except around callable lookup (and its release), the cancelled release and the lease extension, and a finally that hands back unstarted jobs. Authored from that description and the packaged prompt. Band: `Projected raw mean: 0.34` +/- 0.15 = [0.19, 0.49]. The screen predicts it misses C05, C06, C09 and C11 (scenario S3, raw 0.31). Measured under the revision-3 rubric: raw and final 0.20, failing C05, C06, C09, C11, C13, C14 and C15. The band keeps its 0.30 width and is re-centred on the revision-3 projected final mean of 0.26, giving [0.11, 0.41]. Revision 4 (hardening, 2026-09-22): the patch also fails C21 and C22 (measured locally), so its raw drops by 0.06; G4 fires on its C13 loss but min(raw, 0.60) leaves the raw value in force. The band is unchanged and the value is re-measured by the package suite. Weight refit 2026-09-23 (job 06885927, difficult budget 0.95): projected raw 0.035707 from its documented failure set (C05, C06, C09, C11, C13, C14, C15, C21, C22, C24; G3/G4 fire but min(raw, 0.60) leaves raw in force); the band keeps its 0.30 width and is re-centred on that projection, [-0.114293, 0.185707]. The value is re-measured by the package suite. De-concentration refit 2026-09-23 (jobs 9084c34f + 71bb9800, policy 0.85/0.15 budget): projected raw 0.021010 from the same documented failure set (C05, C06, C09, C11, C13, C14, C15, C21, C22, C24; G3/G4 fire but min(raw, 0.60) leaves raw in force); the band keeps its 0.30 width and is re-centred on that projection, [-0.12899, 0.17101]. The value is re-measured by the package suite.", + "expected": { + "final_score_min": -0.12899, + "final_score_max": 0.17101 + } + } + ], + "stub_echo_fixtures": [ + { + "id": "stub_echo_entrypoints", + "patch_path": "grading/adversarial/patches/stub_echo_entrypoints.diff", + "applies_to": "base", + "description": "Every touched public method returns its input or a constant: acquire_jobs returns [], release_job and extend_acquired_job_leases return None in both graded stores, and the scheduler's job loop only sleeps. Every functional and safety child must score 0; the regression wall fails, so the build ceiling also applies (moot at raw 0).", + "expected": { + "final_score": 0.0, + "raw_score": 0.0, + "all_behavioural_children_zero": true + } + } + ], + "alternate_correct_fixtures": [ + { + "id": "alternate_a_zero_lease_shielded_collector", + "patch_path": "grading/adversarial/patches/alternate_a_zero_lease_shielded_collector.diff", + "applies_to": "base", + "independence": "structural", + "purpose": "Approved alternate A. Hands claims back with a zero-duration lease extension instead of a negative one (marker representation); collects the acquired batch in a separate task group whose cancel scope is shielded, checks the run state after it returns, and gives unstarted claims up from an except handler instead of a finally around a checkpoint (injection seam); keeps renewal bookkeeping in a module-level _LeaseRenewals helper class (module composition); holder-checks releases with a filtered DELETE issued from release_job itself and a strict memory-store owner check with a separate finalize helper for internal discards. Rules out coupling to gold's lease marker, shield placement and inline bookkeeping.", + "materiality": { + "min_non_comment_changed_lines": 80, + "min_files_touched": 3, + "max_gold_added_line_overlap_ratio": 0.5, + "min_gold_delta_lines": 400, + "forbidden_added_symbols": [ + "_hand_back_job_claims", + "_release_job_or_hand_back", + "_expired_lease_duration", + "renewed_job_ids", + "unstarted_jobs", + "renewed_new_job", + "claimed_by", + "lease_expired_before" + ] + }, + "independence_axes": { + "marker_representation": { + "rationale": "A handed-back claim is marked by extend_acquired_job_leases(..., timedelta(0)) (the module's existing _zero_timedelta), not by gold's module constant for a negative lease duration.", + "gold_literals_absent": [ + "_expired_lease_duration", + "-_microsecond_delta" + ] + }, + "injection_seam": { + "rationale": "Cancellation is kept away from acquire_jobs by running it in a helper task group with cancel_scope.shield set (_uncancellable) and checking RunState afterwards, rather than a `with CancelScope(shield=True)` block plus checkpoint(); the same helper shields the give-up call." + }, + "module_composition": { + "rationale": "Renewal bookkeeping lives in a module-level _LeaseRenewals class with first_sighting()/forget() instead of a local set in _process_jobs; no new files are added in any directory." + } + }, + "expected": { + "final_score": 1.0, + "raw_score": 1.0, + "native_checks_pass": true, + "build_failed": false + }, + "description": "Approved alternate A, extended in revision 3. Hands claims back with a zero-duration lease extension instead of a negative one (marker representation); collects the acquisition in a separate shielded task group instead of a cancel scope (injection seam); keeps renewal bookkeeping in a module-level helper class (module composition). Revision 3 additions, each written independently of gold: a cancellation delivery point via anyio.lowlevel.checkpoint_if_cancelled after the shielded acquisition (C13), a claim-token comparison in cleanup() that re-validates acquired_by and acquired_until against the live job rather than re-testing the lease (C14), and a `limit < 1` early return in both stores (C15). Measured raw and final 1.00." + }, + { + "id": "alternate_b_store_side_surrender", + "patch_path": "grading/adversarial/patches/alternate_b_store_side_surrender.diff", + "applies_to": "base", + "independence": "structural", + "purpose": "Approved alternate B. The stores implement the hand-back: extend_acquired_job_leases with a non-positive duration clears acquired_by/acquired_until and returns the task slot (persistence layout), so a surrendered job is an unclaimed row rather than an expired claim; the SQLAlchemy holder check is a SELECT ... FOR UPDATE of acquired_by followed by a conditional release instead of a filtered DELETE; the scheduler reaches all store logic through the public DataStore methods with its own helper names (_surrender_claims, _release_or_surrender) and no gold helper, parameter or marker names (callable surface). Rules out coupling to gold's expired-lease representation, its private store parameters and its helper names. Revision 4: the job that could not be prepared is dropped from the pending set only after its error release returns, so an interruption inside that release leaves it in the set that the except handler surrenders (C22).", + "materiality": { + "min_non_comment_changed_lines": 80, + "min_files_touched": 3, + "max_gold_added_line_overlap_ratio": 0.5, + "min_gold_delta_lines": 400, + "forbidden_added_symbols": [ + "_hand_back_job_claims", + "_release_job_or_hand_back", + "_expired_lease_duration", + "renewed_job_ids", + "unstarted_jobs", + "renewed_new_job", + "claimed_by", + "lease_expired_before" + ] + }, + "independence_axes": { + "persistence_layout": { + "rationale": "Surrendered claims are stored as acquired_by = NULL / acquired_until = NULL with running_jobs decremented at surrender time, instead of an expired acquired_until kept on the old owner's row whose slot is reused on takeover; the SQL store needs no claimed_by / lease_expired_before release parameters.", + "gold_literals_absent": [ + "claimed_by", + "lease_expired_before" + ] + }, + "callable_surface": { + "rationale": "No gold private helper names (_hand_back_job_claims, _release_job_or_hand_back) or store-internal parameters appear; the scheduler calls only public DataStore methods and the stores add differently named private helpers (_claim_holder, _retire_job, _surrender_job_claims)." + } + }, + "expected": { + "final_score": 1.0, + "raw_score": 1.0, + "native_checks_pass": true, + "build_failed": false + }, + "description": "Approved alternate B, extended in revision 3. The stores implement the hand-back: extend_acquired_job_leases with a non-positive duration clears acquired_by/acquired_until and returns the slot (persistence layout); the holder check in SQLAlchemy is a SELECT ... FOR UPDATE then conditional update instead of a filtered DELETE; the scheduler reaches per-store logic only through the public DataStore methods. Revision 3 additions, each written independently of gold: a yielding cancellation delivery point (await sleep(0)) after the shielded acquisition (C13), a cleanup() that re-derives the expired set on every step instead of guarding a snapshot (C14), and a `not (limit is None or limit > 0)` early return in both stores (C15). Measured raw and final 1.00." + } + ], + "malformed_output_fault_injections": [ + { + "id": "malformed_probe_cases_deleted", + "kind": "delete_file", + "target": "grading/probes/probe_cases.py", + "expected": { + "is_error": true, + "reward": 0.0, + "raw_score": 0.0, + "final_score": 0.0 + } + }, + { + "id": "malformed_probe_main_corrupted", + "kind": "corrupt_file", + "target": "grading/probes/probe_main.py", + "expected": { + "is_error": true, + "reward": 0.0, + "raw_score": 0.0, + "final_score": 0.0 + } + } + ] +} diff --git a/harbor/sources/apscheduler-v17/grading/baseline/pyproject.toml b/harbor/sources/apscheduler-v17/grading/baseline/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..fba0c58acae40541ebbf7f5a1d2ff3733d95b6e1 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/pyproject.toml @@ -0,0 +1,148 @@ +[build-system] +requires = [ + "setuptools >= 77", + "setuptools_scm >= 6.4" +] +build-backend = "setuptools.build_meta" + +[project] +name = "APScheduler" +description = "In-process task scheduler with Cron-like capabilities" +readme = "README.rst" +authors = [{name = "Alex Grönholm", email = "alex.gronholm@nextday.fi"}] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Intended Audience :: Developers", + "Framework :: AnyIO", + "Typing :: Typed", + "Programming Language :: Python", + "Programming Language :: Python :: 3 :: Only", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", +] +keywords = ["scheduling", "cron"] +license = "MIT" +requires-python = ">= 3.10" +dependencies = [ + "anyio ~= 4.0", + "attrs >= 22.1", + "tenacity >= 8.0, < 10.0", + "tzlocal >= 3.0", + "typing_extensions >= 4.0; python_version < '3.11'" +] +dynamic = ["version"] + +[project.urls] +Documentation = "https://apscheduler.readthedocs.io/en/master/" +Changelog = "https://apscheduler.readthedocs.io/en/master/versionhistory.html" +"Source code" = "https://github.com/agronholm/apscheduler" +"Issue tracker" = "https://github.com/agronholm/apscheduler/issues" + +[project.optional-dependencies] +asyncpg = ["asyncpg >= 0.20"] +cbor = ["cbor2 >= 6.0"] +mongodb = ["pymongo >= 4.13.0"] +mqtt = ["paho-mqtt >= 2.0"] +psycopg = ["psycopg >= 3.0"] +redis = ["redis >= 5.0.1"] +sqlalchemy = ["sqlalchemy[asyncio] >= 2.0.24"] + +[dependency-groups] +test = [ + "APScheduler[cbor,mongodb,mqtt,redis,sqlalchemy]", + "asyncpg >= 0.20; python_implementation == 'CPython' and python_version < '3.13'", + "aiosqlite >= 0.19", + "anyio[trio]", + "asyncmy >= 0.2.5; python_implementation == 'CPython'", + "coverage >= 7", + "psycopg[binary]", + "pymongo >= 4", + "pymysql[rsa]", + "PySide6 >= 6.6; python_implementation == 'CPython' and python_version < '3.13'", + "pytest >= 7.4, < 9.1", + "pytest-lazy-fixtures", + "pytest-mock", + "time-machine >= 2.13.0; python_implementation == 'CPython'", + """\ + uwsgi >= 2.0.31; python_implementation == 'CPython' and platform_system == 'Linux'\ + and python_version < '3.13'\ + """, +] +doc = [ + "sphinx", + "sphinx-autodoc-typehints >= 2.2.3", + "sphinx-rtd-theme >= 1.3.0", + "sphinx-tabs >= 3.3.1", +] + +[tool.setuptools_scm] +version_scheme = "post-release" +local_scheme = "dirty-tag" + +[tool.pytest.ini_options] +addopts = "-rsx --tb=short" +testpaths = "tests" +filterwarnings = "always" +markers = [ + "external_service: marks tests as requiring some external service", +] + +[tool.coverage.run] +source = ["apscheduler"] + +[tool.coverage.report] +show_missing = true + +[tool.ruff.lint] +extend-select = [ + "ASYNC", # flake8-async + "B", # flake8-bugbear + "C4", # flake8-comprehensions + "G", # flake8-logging-format + "I", # isort + "ISC", # flake8-implicit-str-concat + "PERF", # flake8-performance + "PGH", # pygrep-hooks + "RUF100", # unused noqa (yesqa) + "T201", # print + "UP", # pyupgrade + "W", # pycodestyle warnings +] +ignore = [ + "PERF203", + "RUF001", + "RUF002", +] + +[tool.ruff.lint.isort] +known-first-party = ["apscheduler"] +required-imports = ["from __future__ import annotations"] + +[tool.ruff.lint.per-file-ignores] +"examples/**/*.py" = ["T201"] + +[tool.mypy] +python_version = "3.14" +ignore_missing_imports = true +disable_error_code = "type-abstract" + +[tool.tox] +env_list = ["py310", "py311", "py312", "py313", "py314", "pypy3"] +skip_missing_interpreters = true +requires = ["tox >= 4.22"] + +[tool.tox.env_run_base] +commands = [["pytest", { replace = "posargs", extend = true }]] +package = "editable" +dependency_groups = ["test"] + +[tool.tox.env.pyright] +commands = [["pyright", "--verifytypes", "apscheduler"]] +deps = ["pyright"] + +[tool.tox.env.docs] +commands = [["sphinx-build", "-W", "-n", "docs", "build/sphinx"]] +dependency_groups = ["doc"] diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/conftest.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/conftest.py new file mode 100644 index 0000000000000000000000000000000000000000..dbe54c623f6aecccbbc90f05afa73ba2f2fb209c --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/conftest.py @@ -0,0 +1,314 @@ +from __future__ import annotations + +import logging +from collections.abc import AsyncGenerator, Generator +from contextlib import AsyncExitStack +from logging import Logger +from pathlib import Path +from typing import Any, cast +from zoneinfo import ZoneInfo + +import pytest +from _pytest.fixtures import SubRequest +from pytest_lazy_fixtures import lf + +from apscheduler.abc import DataStore, EventBroker, Serializer +from apscheduler.datastores.memory import MemoryDataStore +from apscheduler.serializers.cbor import CBORSerializer +from apscheduler.serializers.json import JSONSerializer +from apscheduler.serializers.pickle import PickleSerializer + + +@pytest.fixture(scope="session") +def timezone() -> ZoneInfo: + return ZoneInfo("Europe/Berlin") + + +@pytest.fixture(scope="session") +def utc_timezone() -> ZoneInfo: + return ZoneInfo("UTC") + + +@pytest.fixture( + params=[ + pytest.param(PickleSerializer, id="pickle"), + pytest.param(CBORSerializer, id="cbor"), + pytest.param(JSONSerializer, id="json"), + ] +) +def serializer(request) -> Serializer | None: + return request.param() if request.param else None + + +@pytest.fixture +def anyio_backend() -> str: + return "asyncio" + + +@pytest.fixture +def local_broker() -> EventBroker: + from apscheduler.eventbrokers.local import LocalEventBroker + + return LocalEventBroker() + + +@pytest.fixture +async def redis_broker(serializer: Serializer) -> EventBroker: + from apscheduler.eventbrokers.redis import RedisEventBroker + + broker = RedisEventBroker( + "redis://localhost:6379", serializer=serializer, stop_check_interval=0.05 + ) + await broker._client.flushdb() + return broker + + +@pytest.fixture +def mqtt_broker(serializer: Serializer) -> EventBroker: + from apscheduler.eventbrokers.mqtt import MQTTEventBroker + + return MQTTEventBroker(serializer=serializer) + + +@pytest.fixture +async def asyncpg_broker(serializer: Serializer) -> EventBroker: + pytest.importorskip("asyncpg", reason="asyncpg is not installed") + from apscheduler.eventbrokers.asyncpg import AsyncpgEventBroker + + broker = AsyncpgEventBroker( + "postgres://postgres:secret@localhost:5432/testdb", serializer=serializer + ) + return broker + + +@pytest.fixture +async def psycopg_broker(serializer: Serializer) -> EventBroker: + pytest.importorskip("psycopg", reason="psycopg is not installed") + from apscheduler.eventbrokers.psycopg import PsycopgEventBroker + + broker = PsycopgEventBroker( + "postgres://postgres:secret@localhost:5432/testdb", serializer=serializer + ) + return broker + + +@pytest.fixture( + params=[ + pytest.param(lf("local_broker"), id="local"), + pytest.param( + lf("asyncpg_broker"), + id="asyncpg", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("psycopg_broker"), + id="psycopg", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("redis_broker"), + id="redis", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("mqtt_broker"), id="mqtt", marks=[pytest.mark.external_service] + ), + ] +) +async def raw_event_broker(request: SubRequest) -> EventBroker: + return cast(EventBroker, request.param) + + +@pytest.fixture +async def event_broker( + raw_event_broker: EventBroker, logger: Logger +) -> AsyncGenerator[EventBroker, Any]: + async with AsyncExitStack() as exit_stack: + await raw_event_broker.start(exit_stack, logger) + yield raw_event_broker + + +@pytest.fixture +def memory_store() -> Generator[DataStore, None, None]: + yield MemoryDataStore() + + +@pytest.fixture +async def mongodb_store() -> AsyncGenerator[DataStore, Any]: + from pymongo.asynchronous.mongo_client import AsyncMongoClient + + from apscheduler.datastores.mongodb import MongoDBDataStore + + async with AsyncMongoClient(tz_aware=True, serverSelectionTimeoutMS=1000) as client: + yield MongoDBDataStore(client, start_from_scratch=True) + + +@pytest.fixture +async def psycopg_async_store() -> AsyncGenerator[DataStore, None]: + from sqlalchemy import text + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + engine = create_async_engine( + "postgresql+psycopg://postgres:secret@localhost/testdb" + ) + try: + async with engine.begin() as conn: + await conn.execute(text("CREATE SCHEMA IF NOT EXISTS psycopg_async")) + + yield SQLAlchemyDataStore( + engine, schema="psycopg_async", start_from_scratch=True + ) + assert "Current Checked out connections: 0" in engine.pool.status() + finally: + await engine.dispose() + + +@pytest.fixture +def psycopg_sync_store() -> Generator[DataStore, None, None]: + from sqlalchemy import create_engine, text + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + engine = create_engine("postgresql+psycopg://postgres:secret@localhost/testdb") + try: + with engine.begin() as conn: + conn.execute(text("CREATE SCHEMA IF NOT EXISTS psycopg_sync")) + + yield SQLAlchemyDataStore( + engine, schema="psycopg_sync", start_from_scratch=True + ) + assert "Current Checked out connections: 0" in engine.pool.status() + finally: + engine.dispose() + + +@pytest.fixture +def pymysql_store() -> Generator[DataStore, None, None]: + from sqlalchemy import create_engine + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + engine = create_engine("mysql+pymysql://root:secret@localhost/testdb") + try: + yield SQLAlchemyDataStore(engine, start_from_scratch=True) + assert "Current Checked out connections: 0" in engine.pool.status() + finally: + engine.dispose() + + +@pytest.fixture +async def aiosqlite_store(tmp_path: Path) -> AsyncGenerator[DataStore, None]: + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + engine = create_async_engine(f"sqlite+aiosqlite:///{tmp_path}/test.db") + try: + yield SQLAlchemyDataStore(engine) + finally: + await engine.dispose() + + +@pytest.fixture +async def asyncpg_store() -> AsyncGenerator[DataStore, None]: + pytest.importorskip("asyncpg", reason="asyncpg is not installed") + from asyncpg import compat + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + # Workaround for AnyIO 4.0.0rc1 compatibility + async def patched_wait_for(fut, timeout): + import asyncio + + if timeout is None: + return await fut + fut = asyncio.ensure_future(fut) + try: + return await asyncio.wait_for(fut, timeout) + except asyncio.CancelledError: + if fut.done() and not fut.cancelled(): + return fut.result() + else: + raise + + compat.wait_for = patched_wait_for + + engine = create_async_engine( + "postgresql+asyncpg://postgres:secret@localhost/testdb", future=True + ) + try: + yield SQLAlchemyDataStore(engine, start_from_scratch=True) + assert "Current Checked out connections: 0" in engine.pool.status() + finally: + await engine.dispose() + + +@pytest.fixture +async def asyncmy_store() -> AsyncGenerator[DataStore, None]: + pytest.importorskip("asyncmy", reason="asyncmy is not installed") + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + engine = create_async_engine( + "mysql+asyncmy://root:secret@localhost/testdb?charset=utf8mb4", future=True + ) + try: + yield SQLAlchemyDataStore(engine, start_from_scratch=True) + assert "Current Checked out connections: 0" in engine.pool.status() + finally: + await engine.dispose() + + +@pytest.fixture( + params=[ + pytest.param( + lf("memory_store"), + id="memory", + ), + pytest.param( + lf("aiosqlite_store"), + id="aiosqlite", + ), + pytest.param( + lf("asyncpg_store"), + id="asyncpg", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("asyncmy_store"), + id="asyncmy", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("psycopg_async_store"), + id="psycopg_async", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("psycopg_sync_store"), + id="psycopg_sync", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("pymysql_store"), + id="pymysql", + marks=[pytest.mark.external_service], + ), + pytest.param( + lf("mongodb_store"), + id="mongodb", + marks=[pytest.mark.external_service], + ), + ] +) +async def raw_datastore(request: SubRequest) -> DataStore: + return cast(DataStore, request.param) + + +@pytest.fixture(scope="session") +def logger() -> Logger: + return logging.getLogger("apscheduler") diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/test_datastores.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_datastores.py new file mode 100644 index 0000000000000000000000000000000000000000..e75044568d5d81b04eeaab2b29f87c8c43bd3e8b --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_datastores.py @@ -0,0 +1,935 @@ +from __future__ import annotations + +import platform +from collections.abc import AsyncGenerator +from contextlib import AsyncExitStack, asynccontextmanager +from datetime import datetime, timedelta, timezone +from logging import Logger +from pathlib import Path +from typing import TYPE_CHECKING +from unittest.mock import Mock + +import anyio +import pytest +from anyio import CancelScope +from pytest_mock.plugin import MockerFixture + +from apscheduler import ( + CoalescePolicy, + ConflictPolicy, + DeserializationError, + Event, + Job, + JobOutcome, + JobResult, + Schedule, + ScheduleAdded, + ScheduleRemoved, + ScheduleUpdated, + Task, + TaskAdded, + TaskLookupError, + TaskUpdated, +) +from apscheduler._structures import ScheduleResult +from apscheduler.abc import DataStore, EventBroker, Serializer +from apscheduler.datastores.base import BaseExternalDataStore +from apscheduler.datastores.memory import MemoryDataStore +from apscheduler.datastores.mongodb import MongoDBDataStore +from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore +from apscheduler.triggers.date import DateTrigger + +if TYPE_CHECKING: + from time_machine import TimeMachineFixture + +pytestmark = pytest.mark.anyio + + +@pytest.fixture +async def datastore( + raw_datastore: DataStore, local_broker: EventBroker, logger: Logger +) -> AsyncGenerator[DataStore, None]: + async with AsyncExitStack() as exit_stack: + await local_broker.start(exit_stack, logger) + await raw_datastore.start(exit_stack, local_broker, logger) + yield raw_datastore + + +@pytest.fixture +def schedules() -> list[Schedule]: + trigger = DateTrigger(datetime(2020, 9, 13, tzinfo=timezone.utc)) + schedule1 = Schedule( + id="s1", task_id="task1", job_executor="async", trigger=trigger + ) + schedule1.next_fire_time = trigger.next() + + trigger = DateTrigger(datetime(2020, 9, 14, tzinfo=timezone.utc)) + schedule2 = Schedule( + id="s2", task_id="task2", job_executor="async", trigger=trigger + ) + schedule2.next_fire_time = trigger.next() + + trigger = DateTrigger(datetime(2020, 9, 15, tzinfo=timezone.utc)) + schedule3 = Schedule( + id="s3", task_id="task1", job_executor="async", trigger=trigger + ) + schedule3.next_fire_time = trigger.next() + + return [schedule1, schedule2, schedule3] + + +@asynccontextmanager +async def capture_events( + datastore: DataStore, + limit: int, + event_types: set[type[Event]] | None = None, +) -> AsyncGenerator[list[Event], None]: + def listener(event: Event) -> None: + events.append(event) + if len(events) == limit: + limit_event.set() + subscription.unsubscribe() + + events: list[Event] = [] + limit_event = anyio.Event() + subscription = datastore._event_broker.subscribe(listener, event_types) + yield events + if limit: + with anyio.fail_after(3): + await limit_event.wait() + + +async def test_add_replace_task(datastore: DataStore) -> None: + event_types = {TaskAdded, TaskUpdated} + async with capture_events(datastore, 3, event_types) as events: + await datastore.add_task( + Task(id="test_task", func="builtins:print", job_executor="async") + ) + await datastore.add_task( + Task(id="test_task2", func="math:ceil", job_executor="async") + ) + await datastore.add_task( + Task(id="test_task", func="builtins:repr", job_executor="async") + ) + + tasks = await datastore.get_tasks() + assert len(tasks) == 2 + assert tasks[0].id == "test_task" + assert tasks[0].func == "builtins:repr" + assert tasks[1].id == "test_task2" + assert tasks[1].func == "math:ceil" + + received_event = events.pop(0) + assert isinstance(received_event, TaskAdded) + assert received_event.task_id == "test_task" + + received_event = events.pop(0) + assert isinstance(received_event, TaskAdded) + assert received_event.task_id == "test_task2" + + received_event = events.pop(0) + assert isinstance(received_event, TaskUpdated) + assert received_event.task_id == "test_task" + + assert not events + + +async def test_add_schedules(datastore: DataStore, schedules: list[Schedule]) -> None: + async with capture_events(datastore, 3, {ScheduleAdded}) as events: + for schedule in schedules: + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + assert await datastore.get_schedules() == schedules + assert await datastore.get_schedules({"s1", "s2", "s3"}) == schedules + assert await datastore.get_schedules({"s1"}) == [schedules[0]] + assert await datastore.get_schedules({"s2"}) == [schedules[1]] + assert await datastore.get_schedules({"s3"}) == [schedules[2]] + + for event, schedule in zip(events, schedules, strict=True): + assert isinstance(event, ScheduleAdded) + assert event.schedule_id == schedule.id + assert event.task_id == schedule.task_id + assert event.next_fire_time == schedule.next_fire_time + + +async def test_replace_schedules( + datastore: DataStore, schedules: list[Schedule] +) -> None: + async with capture_events(datastore, 1, {ScheduleUpdated}) as events: + for schedule in schedules: + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + trigger = DateTrigger(datetime(2020, 9, 16, tzinfo=timezone.utc)) + next_fire_time = trigger.next() + schedule = Schedule( + id="s3", + task_id="foo", + trigger=trigger, + args=(), + kwargs={}, + job_executor="async", + coalesce=CoalescePolicy.earliest, + misfire_grace_time=None, + ) + schedule.next_fire_time = next_fire_time + await datastore.add_schedule(schedule, ConflictPolicy.replace) + + schedules = await datastore.get_schedules({schedule.id}) + assert schedules[0].task_id == "foo" + assert schedules[0].next_fire_time == next_fire_time + assert schedules[0].args == () + assert schedules[0].kwargs == {} + assert schedules[0].coalesce is CoalescePolicy.earliest + assert schedules[0].misfire_grace_time is None + + received_event = events.pop(0) + assert isinstance(received_event, ScheduleUpdated) + assert received_event.schedule_id == "s3" + assert received_event.task_id == "foo" + assert received_event.next_fire_time == datetime(2020, 9, 16, tzinfo=timezone.utc) + assert not events + + +async def test_remove_schedules( + datastore: DataStore, schedules: list[Schedule] +) -> None: + async with capture_events(datastore, 2, {ScheduleRemoved}) as events: + for schedule in schedules: + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + await datastore.remove_schedules(["s1", "s2"]) + assert await datastore.get_schedules() == [schedules[2]] + + received_event = events.pop(0) + assert isinstance(received_event, ScheduleRemoved) + assert received_event.schedule_id == "s1" + + received_event = events.pop(0) + assert isinstance(received_event, ScheduleRemoved) + assert received_event.schedule_id == "s2" + + assert not events + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_acquire_release_schedules( + datastore: DataStore, schedules: list[Schedule], time_machine: TimeMachineFixture +) -> None: + time_machine.move_to(datetime(2020, 9, 14, tzinfo=timezone.utc)) + + event_types = {ScheduleRemoved, ScheduleUpdated} + async with capture_events(datastore, 2, event_types) as events: + for schedule in schedules: + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + # The first scheduler gets the first due schedule + schedules1 = await datastore.acquire_schedules( + "dummy-id1", timedelta(seconds=30), 1 + ) + assert len(schedules1) == 1 + assert schedules1[0].id == "s1" + + # The second scheduler gets the second due schedule + schedules2 = await datastore.acquire_schedules( + "dummy-id2", + timedelta(seconds=30), + 1, + ) + assert len(schedules2) == 1 + assert schedules2[0].id == "s2" + + # The third scheduler gets nothing + schedules3 = await datastore.acquire_schedules( + "dummy-id3", + timedelta(seconds=30), + 1, + ) + assert not schedules3 + + # Update the schedules and check that the job store actually deletes the + # first one and updates the second one + results1: list[ScheduleResult] = [] + results2: list[ScheduleResult] = [] + results1.append( + ScheduleResult( + schedule_id=schedules1[0].id, + task_id=schedules1[0].task_id, + trigger=schedules1[0].trigger, + last_fire_time=datetime(2020, 9, 14, tzinfo=timezone.utc), + next_fire_time=None, + ) + ) + results2.append( + ScheduleResult( + schedule_id=schedules2[0].id, + task_id=schedules2[0].task_id, + trigger=schedules1[0].trigger, + last_fire_time=datetime(2020, 9, 14, tzinfo=timezone.utc), + next_fire_time=datetime(2020, 9, 15, tzinfo=timezone.utc), + ) + ) + + # Release all the schedules + await datastore.release_schedules("dummy-id1", results1) + await datastore.release_schedules("dummy-id2", results2) + + # Check that the first schedule has its next fire time nullified + schedules = await datastore.get_schedules() + assert len(schedules) == 3 + schedules.sort(key=lambda s: s.id) + assert schedules[0].id == "s1" + assert schedules[0].last_fire_time == datetime(2020, 9, 14, tzinfo=timezone.utc) + assert schedules[0].next_fire_time is None + assert schedules[1].id == "s2" + assert schedules[1].last_fire_time == datetime(2020, 9, 14, tzinfo=timezone.utc) + assert schedules[1].next_fire_time == datetime(2020, 9, 15, tzinfo=timezone.utc) + assert schedules[2].id == "s3" + assert schedules[2].last_fire_time is None + assert schedules[2].next_fire_time == datetime(2020, 9, 15, tzinfo=timezone.utc) + + # Check for the appropriate update and delete events + received_event = events.pop(0) + assert isinstance(received_event, ScheduleUpdated) + assert received_event.schedule_id == "s1" + assert received_event.next_fire_time is None + + received_event = events.pop(0) + assert isinstance(received_event, ScheduleUpdated) + assert received_event.schedule_id == "s2" + assert received_event.next_fire_time == datetime(2020, 9, 15, tzinfo=timezone.utc) + + assert not events + + +async def test_release_schedule_two_identical_fire_times(datastore: DataStore) -> None: + """Regression test for #616.""" + for i in range(1, 3): + trigger = DateTrigger(datetime(2020, 9, 13, tzinfo=timezone.utc)) + schedule = Schedule( + id=f"s{i}", task_id="task1", job_executor="async", trigger=trigger + ) + schedule.next_fire_time = trigger.next() + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + schedules = await datastore.acquire_schedules( + "foo", + timedelta(seconds=30), + 3, + ) + results = [ + ScheduleResult( + schedule_id=schedules[0].id, + task_id=schedules[0].task_id, + trigger=schedules[0].trigger, + last_fire_time=datetime(2020, 9, 10, tzinfo=timezone.utc), + next_fire_time=None, + ), + ] + await datastore.release_schedules("foo", results) + + remaining = await datastore.get_schedules({s.id for s in schedules}) + assert len(remaining) == 2 + remaining.sort(key=lambda s: s.id) + assert remaining[0].id == schedules[0].id + assert remaining[0].next_fire_time is None + assert remaining[1].id == schedules[1].id + assert remaining[1].next_fire_time + + +async def test_release_two_schedules_at_once(datastore: DataStore) -> None: + """Regression test for #621.""" + for i in range(2): + trigger = DateTrigger(datetime(2020, 9, 13, tzinfo=timezone.utc)) + schedule = Schedule( + id=f"s{i}", task_id="task1", job_executor="async", trigger=trigger + ) + schedule.next_fire_time = trigger.next() + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + schedules = await datastore.acquire_schedules("foo", timedelta(seconds=30), 3) + results = [ + ScheduleResult( + schedule_id=schedules[0].id, + task_id=schedules[0].task_id, + trigger=schedules[0].trigger, + last_fire_time=datetime(2020, 9, 10, tzinfo=timezone.utc), + next_fire_time=None, + ), + ] + await datastore.release_schedules("foo", results) + + remaining = await datastore.get_schedules({s.id for s in schedules}) + assert len(remaining) == 2 + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_acquire_schedules_lock_timeout( + datastore: DataStore, + schedules: list[Schedule], + time_machine: TimeMachineFixture, +) -> None: + """ + Test that a scheduler can acquire schedules that were acquired by another + scheduler but not released within the lock timeout period. + + """ + time_machine.move_to(datetime.now(timezone.utc), tick=False) + await datastore.add_schedule(schedules[0], ConflictPolicy.exception) + + # First, one scheduler acquires the first available schedule + acquired1 = await datastore.acquire_schedules( + "dummy-id1", + timedelta(seconds=30), + 1, + ) + assert len(acquired1) == 1 + assert acquired1[0].id == "s1" + + # Try to acquire the schedule just at the threshold (now == acquired_until). + # This should not yield any schedules. + time_machine.shift(30) + acquired2 = await datastore.acquire_schedules( + "dummy-id2", + timedelta(seconds=30), + 1, + ) + assert not acquired2 + + # Right after that, the schedule should be available + time_machine.shift(1) + acquired3 = await datastore.acquire_schedules( + "dummy-id2", + timedelta(seconds=30), + 1, + ) + assert len(acquired3) == 1 + assert acquired3[0].id == "s1" + + +async def test_acquire_multiple_workers(datastore: DataStore) -> None: + await datastore.add_task( + Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + ) + jobs = [Job(task_id="task1", executor="async") for _ in range(2)] + for job in jobs: + await datastore.add_job(job) + + # The first worker gets the first job in the queue + jobs1 = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) + assert len(jobs1) == 1 + assert jobs1[0].id == jobs[0].id + + # The second worker gets the second job + jobs2 = await datastore.acquire_jobs("worker2", timedelta(seconds=30), 1) + assert len(jobs2) == 1 + assert jobs2[0].id == jobs[1].id + + # The third worker gets nothing + jobs3 = await datastore.acquire_jobs("worker3", timedelta(seconds=30), 1) + assert not jobs3 + + +async def test_job_release_success(datastore: DataStore) -> None: + await datastore.add_task( + Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + ) + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) + ) + await datastore.add_job(job) + + acquired = await datastore.acquire_jobs("worker_id", timedelta(seconds=30), 2) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + await datastore.release_job( + "worker_id", + acquired[0], + JobResult.from_job( + acquired[0], + JobOutcome.success, + return_value="foo", + ), + ) + result = await datastore.get_job_result(acquired[0].id) + assert result + assert result.outcome is JobOutcome.success + assert result.exception is None + assert result.return_value == "foo" + + # Check that the job and its result are gone + assert not await datastore.get_jobs({acquired[0].id}) + assert not await datastore.get_job_result(acquired[0].id) + + +async def test_job_release_failure(datastore: DataStore) -> None: + await datastore.add_task( + Task(id="task1", job_executor="async", func="contextlib:asynccontextmanager") + ) + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) + ) + await datastore.add_job(job) + + acquired = await datastore.acquire_jobs("worker_id", timedelta(seconds=30), 2) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + await datastore.release_job( + "worker_id", + acquired[0], + JobResult.from_job( + acquired[0], + JobOutcome.error, + exception=ValueError("foo"), + ), + ) + result = await datastore.get_job_result(acquired[0].id) + assert result + assert result.outcome is JobOutcome.error + assert isinstance(result.exception, ValueError) + assert result.exception.args == ("foo",) + assert result.return_value is None + + # Check that the job and its result are gone + assert not await datastore.get_jobs({acquired[0].id}) + assert not await datastore.get_job_result(acquired[0].id) + + +async def test_job_release_missed_deadline(datastore: DataStore): + await datastore.add_task( + Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + ) + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) + ) + await datastore.add_job(job) + + acquired = await datastore.acquire_jobs("worker_id", timedelta(seconds=30), 2) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + await datastore.release_job( + "worker_id", + acquired[0], + JobResult.from_job( + acquired[0], + JobOutcome.missed_start_deadline, + ), + ) + result = await datastore.get_job_result(acquired[0].id) + assert result + assert result.outcome is JobOutcome.missed_start_deadline + assert result.exception is None + assert result.return_value is None + + # Check that the job and its result are gone + assert not await datastore.get_jobs({acquired[0].id}) + assert not await datastore.get_job_result(acquired[0].id) + + +async def test_job_release_cancelled(datastore: DataStore) -> None: + await datastore.add_task( + Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + ) + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) + ) + await datastore.add_job(job) + + acquired = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 2) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + await datastore.release_job( + "worker1", + acquired[0], + JobResult.from_job(acquired[0], JobOutcome.cancelled), + ) + result = await datastore.get_job_result(acquired[0].id) + assert result + assert result.outcome is JobOutcome.cancelled + assert result.exception is None + assert result.return_value is None + + # Check that the job and its result are gone + assert not await datastore.get_jobs({acquired[0].id}) + assert not await datastore.get_job_result(acquired[0].id) + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_acquire_jobs_lock_timeout( + datastore: DataStore, time_machine: TimeMachineFixture +) -> None: + """ + Test that a worker can acquire jobs that were acquired by another scheduler but + not released within the lock timeout period. + + """ + await datastore.add_task( + Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + ) + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(minutes=1) + ) + await datastore.add_job(job) + + # First, one worker acquires the first available job + time_machine.move_to(datetime.now(timezone.utc), tick=False) + acquired = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 1) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + # Try to acquire the job just at the threshold (now == acquired_until). + # This should not yield any jobs. + time_machine.shift(30) + assert not await datastore.acquire_jobs("worker2", timedelta(seconds=30), 1) + + # Right after that, the job should be available + time_machine.shift(1) + acquired = await datastore.acquire_jobs("worker2", timedelta(seconds=30), 1) + assert len(acquired) == 1 + assert acquired[0].id == job.id + + +async def test_acquire_jobs_max_number_exceeded(datastore: DataStore) -> None: + await datastore.add_task( + Task( + id="task1", + func="contextlib:asynccontextmanager", + job_executor="async", + max_running_jobs=2, + ) + ) + assert (await datastore.get_task("task1")).running_jobs == 0 + + jobs = [ + Job(task_id="task1", executor="async"), + Job(task_id="task1", executor="async"), + Job(task_id="task1", executor="async"), + ] + for job in jobs: + await datastore.add_job(job) + + # Check that only 2 jobs are returned from acquire_jobs() even though the limit + # was 3 + acquired_jobs = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 3) + assert len(acquired_jobs) == 2 + assert [job.id for job in acquired_jobs] == [job.id for job in jobs[:2]] + assert (await datastore.get_task("task1")).running_jobs == 2 + for job in acquired_jobs: + assert job.acquired_by == "worker1" + assert job.acquired_until + + # Check that no jobs are acquired now that the task is at capacity + assert not await datastore.acquire_jobs("worker1", timedelta(seconds=30), 3) + + # Release one job, and the worker should be able to acquire the third job + await datastore.release_job( + "worker1", + acquired_jobs[0], + JobResult.from_job( + acquired_jobs[0], + JobOutcome.success, + return_value=None, + ), + ) + assert (await datastore.get_task("task1")).running_jobs == 1 + remaining_jobs = await datastore.get_jobs() + assert len(remaining_jobs) == 2 + + acquired_jobs = await datastore.acquire_jobs("worker1", timedelta(seconds=30), 3) + assert [job.id for job in acquired_jobs] == [jobs[2].id] + assert (await datastore.get_task("task1")).running_jobs == 2 + + +async def test_add_get_task(datastore: DataStore) -> None: + with pytest.raises(TaskLookupError): + await datastore.get_task("dummyid") + + await datastore.add_task( + Task(id="dummyid", func="contextlib:asynccontextmanager", job_executor="async") + ) + task = await datastore.get_task("dummyid") + assert task.id == "dummyid" + assert task.func == "contextlib:asynccontextmanager" + + +async def test_cancel_start( + raw_datastore: DataStore, local_broker: EventBroker, logger: Logger +) -> None: + with CancelScope() as scope: + scope.cancel() + async with AsyncExitStack() as exit_stack: + await raw_datastore.start(exit_stack, local_broker, logger) + + +async def test_cancel_stop( + raw_datastore: DataStore, local_broker: EventBroker, logger: Logger +) -> None: + with CancelScope() as scope: + async with AsyncExitStack() as exit_stack: + await raw_datastore.start(exit_stack, local_broker, logger) + scope.cancel() + + +async def test_next_schedule_run_time(datastore: DataStore, schedules: list[Schedule]): + next_schedule_run_time = await datastore.get_next_schedule_run_time() + assert next_schedule_run_time is None + + for schedule in schedules: + await datastore.add_schedule(schedule, ConflictPolicy.exception) + + next_schedule_run_time = await datastore.get_next_schedule_run_time() + assert next_schedule_run_time == datetime(2020, 9, 13, tzinfo=timezone.utc) + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_cleanup_expired_schedule_leases( + datastore: DataStore, schedules: list[Schedule], time_machine: TimeMachineFixture +) -> None: + """ + Test that clean-up releases schedules whose leases have expired, and notifies + schedulers about it. + + """ + time_machine.move_to(datetime(2020, 9, 14, tzinfo=timezone.utc)) + await datastore.add_schedule(schedules[0], ConflictPolicy.exception) + + # Acquire the schedule with a scheduler that then dies without releasing it + acquired = await datastore.acquire_schedules("scheduler1", timedelta(seconds=30), 1) + assert len(acquired) == 1 + + # The lease has not expired yet, so clean-up must leave the schedule alone + time_machine.shift(20) + await datastore.cleanup() + assert not await datastore.acquire_schedules("scheduler2", timedelta(seconds=30), 1) + + # The lease has expired now, so clean-up releases the schedule + time_machine.shift(20) + async with capture_events(datastore, 1, {ScheduleUpdated}) as events: + await datastore.cleanup() + + assert len(events) == 1 + event = events[0] + assert isinstance(event, ScheduleUpdated) + assert event.schedule_id == schedules[0].id + assert event.task_id == schedules[0].task_id + assert event.next_fire_time == schedules[0].next_fire_time + + acquired = await datastore.acquire_schedules("scheduler2", timedelta(seconds=30), 1) + assert [schedule.id for schedule in acquired] == [schedules[0].id] + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_extend_acquired_schedule_leases( + datastore: DataStore, time_machine: TimeMachineFixture, schedules: list[Schedule] +) -> None: + """ + Test that the leases on acquired schedules are updated to prevent other schedulers + from acquiring them. + + """ + time_machine.move_to(datetime(2020, 9, 14, tzinfo=timezone.utc)) + + # Add a schedule to the data store + await datastore.add_schedule(schedules[0], ConflictPolicy.exception) + + # Acquire the schedule + schedules = await datastore.acquire_schedules( + "scheduler_id", + timedelta(seconds=30), + 1, + ) + assert len(schedules) == 1 + + # Move 20 seconds forward, then call extend_acquired_schedule_leases(). This should + # set the acquired_until timestamp to 30 seconds from the new current time. + time_machine.shift(20) + await datastore.extend_acquired_schedule_leases( + "scheduler_id", {schedules[0].id}, timedelta(seconds=30) + ) + + # The schedule was acquired by scheduler_id so scheduler2_id should not be able to + # acquire it, as it's still within the original lock expiration delay + assert not await datastore.acquire_schedules( + "scheduler2_id", + timedelta(seconds=30), + 1, + ) + + # Move 20 more seconds forward (beyond the initial lock expiration delay), then try + # to have the second scheduler acquire the schedule again. This should also fail. + time_machine.shift(20) + assert not await datastore.acquire_schedules( + "scheduler2_id", + timedelta(seconds=30), + 1, + ) + + # Move 20 more seconds forward - this time the schedule should be available + time_machine.shift(20) + schedules = await datastore.acquire_schedules( + "scheduler2_id", + timedelta(seconds=30), + 1, + ) + assert len(schedules) == 1 + + +@pytest.mark.skipif( + platform.python_implementation() != "CPython", + reason="time-machine is not available", +) +async def test_extend_acquired_job_leases( + datastore: DataStore, time_machine: TimeMachineFixture +) -> None: + """ + Test that the leases on acquired jobs are updated to prevent them from being cleaned + up as if they had been abandoned. + + """ + time_machine.move_to(datetime(2020, 9, 14, tzinfo=timezone.utc)) + + # Add a task to the data store + task = Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + await datastore.add_task(task) + + # Add a job to the data store + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(seconds=30) + ) + await datastore.add_job(job) + + # Acquire the job + jobs = await datastore.acquire_jobs("scheduler_id", timedelta(seconds=30), 1) + assert len(jobs) == 1 + + # Move 20 seconds forward, then call extend_acquired_job_leases(). This should set + # the acquired_until timestamp to 30 seconds from the new current time. + time_machine.shift(20) + await datastore.extend_acquired_job_leases( + "scheduler_id", {job.id}, timedelta(seconds=30) + ) + + # The job was acquired by scheduler_id so scheduler2_id should not be able to + # acquire it + assert not await datastore.acquire_jobs("scheduler2_id", timedelta(seconds=30), 1) + + # Move 20 more seconds forward (beyond the initial lock expiration delay), then make + # sure that the job is still within the data store. + time_machine.shift(20) + await datastore.cleanup() + jobs = await datastore.get_jobs({job.id}) + assert len(jobs) == 1 + + # Move 20 more seconds forward - this time the job's lease will have expired + time_machine.shift(20) + await datastore.cleanup() + assert not await datastore.get_jobs({job.id}) + + # Check that a result was recorded, with the "abandoned" outcome + result = await datastore.get_job_result(job.id) + assert result + assert result.outcome is JobOutcome.abandoned + + +async def test_acquire_jobs_deserialization_failure( + datastore: DataStore, mocker: MockerFixture +) -> None: + if not isinstance(datastore, BaseExternalDataStore): + pytest.skip("Only applicable to external data stores") + + # Add a task to the data store + task = Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + await datastore.add_task(task) + + # Add a job to the data store + job = Job( + task_id="task1", executor="async", result_expiration_time=timedelta(seconds=30) + ) + await datastore.add_job(job) + + # Make the serializer fail deserialization + assert isinstance(datastore, BaseExternalDataStore) + datastore.serializer = Mock(Serializer) + datastore.serializer.deserialize.configure_mock(side_effect=DeserializationError) + + # This should not yield any jobs + assert await datastore.acquire_jobs("scheduler_id", timedelta(seconds=30), 1) == [] + + +async def test_reap_abandoned_jobs( + datastore: DataStore, local_broker: EventBroker, logger: Logger +) -> None: + # Add a task, schedule and job and acquire the latter two + task = Task(id="task1", func="contextlib:asynccontextmanager", job_executor="async") + await datastore.add_task(task) + + job = Job( + task_id="task1", + executor="async", + result_expiration_time=timedelta(seconds=30), + ) + await datastore.add_job(job) + await datastore.reap_abandoned_jobs("testscheduler") + jobs = await datastore.acquire_jobs("testscheduler", timedelta(seconds=30), 1) + assert len(jobs) == 1 + + await datastore.reap_abandoned_jobs("testscheduler") + assert not await datastore.get_jobs() + abandoned_job_result = await datastore.get_job_result(jobs[0].id) + assert abandoned_job_result.outcome is JobOutcome.abandoned + + task = await datastore.get_task("task1") + assert task.running_jobs == 0 + + +class TestRepr: + async def test_memory(self, memory_store: MemoryDataStore) -> None: + assert repr(memory_store) == "MemoryDataStore()" + + async def test_sqlite(self, tmp_path: Path) -> None: + from sqlalchemy import create_engine + + expected_path = str(tmp_path).replace("\\", "\\\\") + engine = create_engine(f"sqlite:///{tmp_path}") + data_store = SQLAlchemyDataStore(engine) + assert repr(data_store) == ( + f"SQLAlchemyDataStore(url='sqlite:///{expected_path}')" + ) + + async def test_psycopg(self) -> None: + from sqlalchemy.ext.asyncio import create_async_engine + + pytest.importorskip("psycopg", reason="psycopg not available") + engine = create_async_engine( + "postgresql+psycopg://postgres:secret@localhost/testdb" + ) + data_store = SQLAlchemyDataStore(engine, schema="myschema") + assert repr(data_store) == ( + "SQLAlchemyDataStore(url='postgresql+psycopg://postgres:***@localhost/" + "testdb', schema='myschema')" + ) + + async def test_mongodb(self) -> None: + from pymongo.asynchronous.mongo_client import AsyncMongoClient + + async with AsyncMongoClient() as client: + data_store = MongoDBDataStore(client) + assert repr(data_store) == "MongoDBDataStore(host=[('localhost', 27017)])" diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/test_eventbrokers.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_eventbrokers.py new file mode 100644 index 0000000000000000000000000000000000000000..66796c4b5ceaa347cc32222b5dea517567da1aa8 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_eventbrokers.py @@ -0,0 +1,175 @@ +from __future__ import annotations + +import sys +from contextlib import AsyncExitStack +from datetime import datetime, timezone +from logging import Logger + +import pytest +from _pytest.logging import LogCaptureFixture +from anyio import CancelScope, create_memory_object_stream, fail_after + +from apscheduler import Event, ScheduleAdded +from apscheduler.abc import EventBroker + +if sys.version_info >= (3, 11): + from datetime import UTC +else: + UTC = timezone.utc + +pytestmark = pytest.mark.anyio + + +async def test_publish_subscribe(event_broker: EventBroker) -> None: + send, receive = create_memory_object_stream[Event](2) + with send, receive: + event_broker.subscribe(send.send) + event_broker.subscribe(send.send_nowait) + event = ScheduleAdded( + schedule_id="schedule1", + task_id="task1", + next_fire_time=datetime(2021, 9, 11, 12, 31, 56, 254867, UTC), + ) + await event_broker.publish(event) + + with fail_after(3): + event1 = await receive.receive() + event2 = await receive.receive() + + assert event1 == event2 + assert isinstance(event1, ScheduleAdded) + assert isinstance(event1.timestamp, datetime) + assert event1.schedule_id == "schedule1" + assert event1.task_id == "task1" + assert event1.next_fire_time == datetime(2021, 9, 11, 12, 31, 56, 254867, UTC) + + +async def test_subscribe_one_shot(event_broker: EventBroker) -> None: + send, receive = create_memory_object_stream[Event](2) + with send, receive: + event_broker.subscribe(send.send, one_shot=True) + event = ScheduleAdded( + schedule_id="schedule1", + task_id="task1", + next_fire_time=datetime(2021, 9, 11, 12, 31, 56, 254867, UTC), + ) + await event_broker.publish(event) + event = ScheduleAdded( + schedule_id="schedule2", + task_id="task1", + next_fire_time=datetime(2021, 9, 12, 8, 42, 11, 968481, UTC), + ) + await event_broker.publish(event) + + with fail_after(3): + received_event = await receive.receive() + + with pytest.raises(TimeoutError), fail_after(0.1): + await receive.receive() + + assert isinstance(received_event, ScheduleAdded) + assert received_event.schedule_id == "schedule1" + assert received_event.task_id == "task1" + + +async def test_unsubscribe(event_broker: EventBroker) -> None: + send, receive = create_memory_object_stream[Event]() + with send, receive: + subscription = event_broker.subscribe(send.send) + await event_broker.publish(Event()) + with fail_after(3): + await receive.receive() + + subscription.unsubscribe() + await event_broker.publish(Event()) + with pytest.raises(TimeoutError), fail_after(0.1): + await receive.receive() + + +async def test_publish_no_subscribers( + event_broker: EventBroker, caplog: LogCaptureFixture +) -> None: + await event_broker.publish(Event()) + assert not caplog.text + + +async def test_publish_exception( + event_broker: EventBroker, caplog: LogCaptureFixture +) -> None: + def bad_subscriber(event: Event) -> None: + raise Exception("foo") + + timestamp = datetime.now(UTC) + send, receive = create_memory_object_stream[Event]() + with send, receive: + event_broker.subscribe(bad_subscriber) + event_broker.subscribe(send.send) + await event_broker.publish(Event(timestamp=timestamp)) + + received_event = await receive.receive() + assert received_event.timestamp == timestamp + assert "Error delivering Event" in caplog.text + + +async def test_cancel_start(raw_event_broker: EventBroker, logger: Logger) -> None: + with CancelScope() as scope: + scope.cancel() + async with AsyncExitStack() as exit_stack: + await raw_event_broker.start(exit_stack, logger) + + +async def test_cancel_stop(raw_event_broker: EventBroker, logger: Logger) -> None: + with CancelScope() as scope: + async with AsyncExitStack() as exit_stack: + await raw_event_broker.start(exit_stack, logger) + scope.cancel() + + +def test_asyncpg_broker_from_async_engine() -> None: + pytest.importorskip("asyncpg", reason="asyncpg is not installed") + from sqlalchemy import URL + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.eventbrokers.asyncpg import AsyncpgEventBroker + + url = URL( + "postgresql+asyncpg", + "myuser", + "c /%@", + "localhost", + 7654, + "dbname", + {"opt1": "foo", "opt2": "bar"}, + ) + engine = create_async_engine(url) + broker = AsyncpgEventBroker.from_async_sqla_engine(engine) + assert isinstance(broker, AsyncpgEventBroker) + assert broker.dsn == ( + "postgresql://myuser:c %2F%25%40@localhost:7654/dbname?opt1=foo&opt2=bar" + ) + + +def test_psycopg_broker_from_async_engine() -> None: + pytest.importorskip( + "psycopg", exc_type=ImportError, reason="psycopg is not installed" + ) + from sqlalchemy import URL + from sqlalchemy.ext.asyncio import create_async_engine + + from apscheduler.eventbrokers.psycopg import PsycopgEventBroker + + url = URL( + "postgresql+psycopg", + "myuser", + "c /%@", + "localhost", + 7654, + "dbname", + {"opt1": "foo", "opt2": "bar"}, + ) + engine = create_async_engine(url) + broker = PsycopgEventBroker.from_async_sqla_engine(engine) + assert isinstance(broker, PsycopgEventBroker) + assert broker.conninfo == ( + "postgresql://myuser:c %2F%25%40@localhost:7654/dbname?opt1=foo&opt2=bar" + ) diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/test_marshalling.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_marshalling.py new file mode 100644 index 0000000000000000000000000000000000000000..8ed031b0c08dee9c6d12656471aaf505ef72dfbc --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_marshalling.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +import sys +from datetime import timedelta +from functools import partial +from types import ModuleType + +import pytest + +from apscheduler import SerializationError +from apscheduler._marshalling import callable_from_ref, callable_to_ref + + +class DummyClass: + def meth(self): + pass + + @staticmethod + def staticmeth(): + pass + + @classmethod + def classmeth(cls): + pass + + def __call__(self): + pass + + class InnerDummyClass: + @classmethod + def innerclassmeth(cls): + pass + + +class InheritedDummyClass(DummyClass): + pass + + +class TestCallableToRef: + @pytest.mark.parametrize( + "obj, error", + [ + (partial(DummyClass.meth), "Cannot create a reference to a partial()"), + (lambda: None, "Cannot create a reference to a lambda"), + ], + ids=["partial", "lambda"], + ) + def test_errors(self, obj, error): + exc = pytest.raises(SerializationError, callable_to_ref, obj) + assert str(exc.value) == error + + def test_nested_function_error(self): + def nested(): + pass + + exc = pytest.raises(SerializationError, callable_to_ref, nested) + assert str(exc.value) == "Cannot create a reference to a nested function" + + @pytest.mark.parametrize( + "input,expected", + [ + (DummyClass.meth, "test_marshalling:DummyClass.meth"), + (DummyClass.classmeth, "test_marshalling:DummyClass.classmeth"), + ( + DummyClass.InnerDummyClass.innerclassmeth, + "test_marshalling:DummyClass.InnerDummyClass.innerclassmeth", + ), + (DummyClass.staticmeth, "test_marshalling:DummyClass.staticmeth"), + ( + InheritedDummyClass.classmeth, + "test_marshalling:InheritedDummyClass.classmeth", + ), + (timedelta, "datetime:timedelta"), + ], + ids=[ + "unbound method", + "class method", + "inner class method", + "static method", + "inherited class method", + "timedelta", + ], + ) + def test_valid_refs(self, input, expected): + assert callable_to_ref(input) == expected + + +class TestCallableFromRef: + def test_valid_ref(self): + from logging.handlers import RotatingFileHandler + + assert ( + callable_from_ref("logging.handlers:RotatingFileHandler") + is RotatingFileHandler + ) + + def test_complex_path(self): + pkg1 = ModuleType("pkg1") + pkg1.pkg2 = "blah" + pkg2 = ModuleType("pkg1.pkg2") + pkg2.varname = lambda: None + sys.modules["pkg1"] = pkg1 + sys.modules["pkg1.pkg2"] = pkg2 + assert callable_from_ref("pkg1.pkg2:varname") == pkg2.varname + + @pytest.mark.parametrize( + "input,error", + [(object(), TypeError), ("module", ValueError), ("module:blah", LookupError)], + ids=["raw object", "module", "module attribute"], + ) + def test_lookup_error(self, input, error): + pytest.raises(error, callable_from_ref, input) diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/test_schedulers.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_schedulers.py new file mode 100644 index 0000000000000000000000000000000000000000..0f59271c4d63b6c2a69e23d52e2cff94ed793a36 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_schedulers.py @@ -0,0 +1,1540 @@ +from __future__ import annotations + +import os +import sys +import threading +import time +from collections import defaultdict +from collections.abc import Callable +from contextlib import AsyncExitStack +from datetime import datetime, timedelta, timezone +from functools import partial +from inspect import signature +from queue import Queue +from types import ModuleType +from typing import Any, cast +from unittest.mock import patch + +import anyio +import attrs +import pytest +from anyio import ( + Lock, + WouldBlock, + create_memory_object_stream, + fail_after, + move_on_after, + sleep, +) +from pytest import MonkeyPatch +from pytest_mock import MockerFixture, MockFixture + +from apscheduler import ( + AsyncScheduler, + CoalescePolicy, + Event, + Job, + JobAcquired, + JobAdded, + JobLookupError, + JobOutcome, + JobReleased, + RunState, + ScheduleAdded, + ScheduleLookupError, + Scheduler, + ScheduleRemoved, + SchedulerRole, + SchedulerStarted, + SchedulerStopped, + ScheduleUpdated, + TaskAdded, + TaskDefaults, + TaskUpdated, + current_async_scheduler, + current_job, + task, +) +from apscheduler.abc import DataStore +from apscheduler.datastores.base import BaseExternalDataStore +from apscheduler.datastores.memory import MemoryDataStore +from apscheduler.eventbrokers.local import LocalEventBroker +from apscheduler.executors.async_ import AsyncJobExecutor +from apscheduler.executors.subprocess import ProcessPoolJobExecutor +from apscheduler.executors.thread import ThreadPoolJobExecutor +from apscheduler.triggers.cron import CronTrigger +from apscheduler.triggers.date import DateTrigger +from apscheduler.triggers.interval import IntervalTrigger + +if sys.version_info >= (3, 11): + from datetime import UTC +else: + UTC = timezone.utc + from exceptiongroup import ExceptionGroup + +from zoneinfo import ZoneInfo + +pytestmark = pytest.mark.anyio + + +async def dummy_async_job(delay: float = 0, fail: bool = False) -> str: + await anyio.sleep(delay) + if fail: + raise RuntimeError("failing as requested") + else: + return "returnvalue" + + +def dummy_sync_job(delay: float = 0, fail: bool = False) -> str: + time.sleep(delay) + if fail: + raise RuntimeError("failing as requested") + else: + return "returnvalue" + + +@task( + job_executor="threadpool", + max_running_jobs=3, + misfire_grace_time=timedelta(seconds=6), +) +def decorated_job() -> None: + pass + + +class DummyClass: + def __init__(self, value: int): + self.value = value + + @staticmethod + async def dummy_static_method() -> str: + return "static" + + @staticmethod + async def dummy_async_static_method() -> str: + return "static" + + @classmethod + def dummy_class_method(cls) -> str: + return "class" + + @classmethod + async def dummy_async_class_method(cls) -> str: + return "class" + + def dummy_instance_method(self) -> int: + return self.value + + async def dummy_async_instance_method(self) -> int: + return self.value + + def __call__(self) -> int: + return self.value + + +class TestAsyncScheduler: + def test_repr(self) -> None: + scheduler = AsyncScheduler(identity="my identity") + assert repr(scheduler) == ( + "AsyncScheduler(identity='my identity', role=, " + "data_store=MemoryDataStore(), event_broker=LocalEventBroker())" + ) + + async def test_use_before_initialized(self) -> None: + scheduler = AsyncScheduler() + with pytest.raises( + RuntimeError, match="The scheduler has not been initialized yet" + ): + await scheduler.add_job(dummy_async_job) + + async def test_properties(self) -> None: + async with AsyncScheduler() as scheduler: + assert isinstance(scheduler.data_store, MemoryDataStore) + assert isinstance(scheduler.event_broker, LocalEventBroker) + assert scheduler.role is SchedulerRole.both + assert isinstance(scheduler.identity, str) + assert len(scheduler.job_executors) == 3 + assert isinstance(scheduler.job_executors["async"], AsyncJobExecutor) + assert isinstance( + scheduler.job_executors["threadpool"], ThreadPoolJobExecutor + ) + assert isinstance( + scheduler.job_executors["processpool"], ProcessPoolJobExecutor + ) + assert scheduler.task_defaults.job_executor == "async" + assert scheduler.state is RunState.stopped + + @pytest.mark.parametrize("as_default", [False, True]) + async def test_async_executor(self, as_default: bool) -> None: + async with AsyncScheduler() as scheduler: + await scheduler.start_in_background() + if as_default: + thread_id = await scheduler.run_job(threading.get_ident) + else: + thread_id = await scheduler.run_job( + threading.get_ident, job_executor="async" + ) + + assert thread_id == threading.get_ident() + + async def test_threadpool_executor(self) -> None: + async with AsyncScheduler() as scheduler: + await scheduler.start_in_background() + thread_id = await scheduler.run_job( + threading.get_ident, job_executor="threadpool" + ) + assert thread_id != threading.get_ident() + + async def test_processpool_executor(self) -> None: + async with AsyncScheduler() as scheduler: + await scheduler.start_in_background() + pid = await scheduler.run_job(os.getpid, job_executor="processpool") + assert pid != os.getpid() + + async def test_configure_task(self, raw_datastore: DataStore) -> None: + send, receive = create_memory_object_stream[Event](2) + with send, receive: + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + scheduler.subscribe(send.send) + await scheduler.configure_task("mytask", func=dummy_async_job) + await scheduler.configure_task("mytask", misfire_grace_time=2) + tasks = await scheduler.get_tasks() + assert len(tasks) == 1 + assert tasks[0].id == "mytask" + assert tasks[0].func == f"{__name__}:dummy_async_job" + assert tasks[0].misfire_grace_time == timedelta(seconds=2) + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, TaskAdded) + assert event.task_id == "mytask" + + event = await receive.receive() + assert isinstance(event, TaskUpdated) + assert event.task_id == "mytask" + + async def test_configure_task_with_decorator(self) -> None: + async with AsyncScheduler() as scheduler: + await scheduler.configure_task("taskfunc", func=decorated_job) + tasks = await scheduler.get_tasks() + assert len(tasks) == 1 + assert tasks[0].max_running_jobs == 3 + assert tasks[0].misfire_grace_time == timedelta(seconds=6) + assert tasks[0].job_executor == "threadpool" + + async def test_configure_local_task_with_decorator(self) -> None: + @task( + id="taskfunc", + job_executor="threadpool", + max_running_jobs=3, + misfire_grace_time=timedelta(seconds=6), + metadata={"local": 6}, + ) + def taskfunc() -> None: + pass + + task_defaults = TaskDefaults(metadata={"global": "foo"}) + async with AsyncScheduler(task_defaults=task_defaults) as scheduler: + await scheduler.configure_task(taskfunc, metadata={"direct": [1, 9]}) + tasks = await scheduler.get_tasks() + assert len(tasks) == 1 + assert tasks[0].id == "taskfunc" + assert tasks[0].max_running_jobs == 3 + assert tasks[0].misfire_grace_time == timedelta(seconds=6) + assert tasks[0].job_executor == "threadpool" + assert tasks[0].metadata == {"global": "foo", "local": 6, "direct": [1, 9]} + + async def test_add_pause_unpause_remove_schedule( + self, raw_datastore: DataStore, timezone: ZoneInfo + ) -> None: + send, receive = create_memory_object_stream[Event](5) + with send, receive: + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + scheduler.subscribe(send.send) + now = datetime.now(timezone) + trigger = DateTrigger(now) + schedule_id = await scheduler.add_schedule( + dummy_async_job, trigger, id="foo" + ) + assert schedule_id == "foo" + + schedules = await scheduler.get_schedules() + assert len(schedules) == 1 + assert schedules[0].id == "foo" + assert schedules[0].task_id == f"{__name__}:dummy_async_job" + + await scheduler.pause_schedule("foo") + schedule = await scheduler.get_schedule("foo") + assert schedule.paused + assert schedule.next_fire_time == now + + await scheduler.unpause_schedule("foo") + schedule = await scheduler.get_schedule("foo") + assert not schedule.paused + assert schedule.next_fire_time == now + + await scheduler.remove_schedule(schedule_id) + assert not await scheduler.get_schedules() + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, TaskAdded) + assert event.task_id == f"{__name__}:dummy_async_job" + + event = await receive.receive() + assert isinstance(event, ScheduleAdded) + assert event.schedule_id == "foo" + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.next_fire_time == now + + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + assert event.schedule_id == "foo" + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.next_fire_time == now + + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + assert event.schedule_id == "foo" + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.next_fire_time == now + + event = await receive.receive() + assert isinstance(event, ScheduleRemoved) + assert event.schedule_id == "foo" + assert event.task_id == f"{__name__}:dummy_async_job" + assert not event.finished + + async def test_add_job_wait_result(self, raw_datastore: DataStore) -> None: + send, receive = create_memory_object_stream[Event](2) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore) + ) + assert await scheduler.get_jobs() == [] + + scheduler.subscribe(send.send) + job_id = await scheduler.add_job(dummy_async_job, result_expiration_time=10) + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, TaskAdded) + assert event.task_id == f"{__name__}:dummy_async_job" + + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.job_id == job_id + + jobs = await scheduler.get_jobs() + assert len(jobs) == 1 + assert jobs[0].id == job_id + assert jobs[0].task_id == f"{__name__}:dummy_async_job" + + with pytest.raises(JobLookupError): + await scheduler.get_job_result(job_id, wait=False) + + await scheduler.start_in_background() + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, SchedulerStarted) + + event = await receive.receive() + assert isinstance(event, JobAcquired) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.schedule_id is None + assert event.scheduled_start is None + acquired_at = event.timestamp + + event = await receive.receive() + assert isinstance(event, JobReleased) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.schedule_id is None + assert event.scheduled_start is None + assert event.started_at is not None + assert event.started_at >= acquired_at + assert event.outcome is JobOutcome.success + + result = await scheduler.get_job_result(job_id) + assert result + assert result.outcome is JobOutcome.success + assert result.return_value == "returnvalue" + + @pytest.mark.parametrize("success", [True, False]) + async def test_run_job(self, raw_datastore: DataStore, success: bool) -> None: + send, receive = create_memory_object_stream[Event](4) + with send, receive: + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + await scheduler.start_in_background() + scheduler.subscribe(send.send) + try: + result = await scheduler.run_job( + dummy_async_job, kwargs={"fail": not success} + ) + except RuntimeError as exc: + assert str(exc) == "failing as requested" + else: + assert result == "returnvalue" + + assert not await scheduler.get_jobs() + + with fail_after(3): + # The task was added + event = await receive.receive() + assert isinstance(event, TaskAdded) + assert event.task_id == f"{__name__}:dummy_async_job" + + # The job was added + event = await receive.receive() + assert isinstance(event, JobAdded) + job_id = event.job_id + assert event.task_id == f"{__name__}:dummy_async_job" + + # The scheduler acquired the job + event = await receive.receive() + assert isinstance(event, JobAcquired) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.schedule_id is None + assert event.scheduled_start is None + assert event.scheduler_id == scheduler.identity + acquired_at = event.timestamp + + # The scheduler released the job + event = await receive.receive() + assert isinstance(event, JobReleased) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_async_job" + assert event.schedule_id is None + assert event.scheduled_start is None + assert event.started_at is not None + assert event.started_at >= acquired_at + assert event.scheduler_id == scheduler.identity + + # The scheduler was stopped + event = await receive.receive() + assert isinstance(event, SchedulerStopped) + + # There should be no more events on the list + with pytest.raises(WouldBlock): + receive.receive_nowait() + + @pytest.mark.parametrize( + "target, expected_result", + [ + pytest.param(dummy_async_job, "returnvalue", id="async_func"), + pytest.param(dummy_sync_job, "returnvalue", id="sync_func"), + pytest.param(DummyClass.dummy_static_method, "static", id="staticmethod"), + pytest.param( + DummyClass.dummy_async_static_method, "static", id="async_staticmethod" + ), + pytest.param(DummyClass.dummy_class_method, "class", id="classmethod"), + pytest.param( + DummyClass.dummy_async_class_method, "class", id="async_classmethod" + ), + pytest.param(DummyClass(5).dummy_instance_method, 5, id="instancemethod"), + pytest.param( + DummyClass(6).dummy_async_instance_method, 6, id="async_instancemethod" + ), + pytest.param(bytes, b"", id="builtin_function"), + pytest.param( + datetime(2023, 10, 19, tzinfo=UTC).timestamp, + 1697673600.0, + id="builtin_method", + ), + pytest.param(partial(bytes, "foo", "ascii"), b"foo", id="partial"), + ], + ) + @pytest.mark.parametrize( + "use_scheduling", + [ + pytest.param(False, id="job"), + pytest.param(True, id="schedule"), + ], + ) + async def test_callable_types( + self, + target: Callable[..., Any], + expected_result: object, + use_scheduling: bool, + raw_datastore: DataStore, + timezone: ZoneInfo, + ) -> None: + now = datetime.now(timezone) + send, receive = create_memory_object_stream[Event](4) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore) + ) + scheduler.subscribe(send.send, {JobReleased}) + await scheduler.start_in_background() + if use_scheduling: + trigger = DateTrigger(now) + await scheduler.add_schedule(target, trigger, id="foo") + else: + await scheduler.add_job(target, result_expiration_time=10) + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, JobReleased) + + if not use_scheduling: + result = await scheduler.get_job_result(event.job_id) + assert result + assert result.outcome is JobOutcome.success + assert result.return_value == expected_result + + async def test_scheduled_job_missed_deadline( + self, raw_datastore: DataStore, timezone: ZoneInfo + ) -> None: + one_second_in_past = datetime.now(timezone) - timedelta(seconds=1) + trigger = DateTrigger(one_second_in_past) + scheduler_send, scheduler_receive = create_memory_object_stream[Event](4) + worker_send, worker_receive = create_memory_object_stream[Event](2) + with scheduler_send, scheduler_receive, worker_send, worker_receive: + async with AsyncExitStack() as exit_stack: + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore) + ) + await scheduler.add_schedule( + dummy_async_job, trigger, misfire_grace_time=0, id="foo" + ) + await scheduler.start_in_background() + exit_stack.enter_context( + scheduler.subscribe( + scheduler_send.send, {JobAdded, ScheduleUpdated} + ) + ) + exit_stack.enter_context( + scheduler.subscribe(worker_send.send, {JobAcquired, JobReleased}) + ) + with fail_after(3): + # The schedule was processed and a job was added for it + event = await scheduler_receive.receive() + assert isinstance(event, JobAdded) + assert event.schedule_id == "foo" + assert event.task_id == "test_schedulers:dummy_async_job" + job_id = event.job_id + + # The schedule was updated with a null next fire time + event = await scheduler_receive.receive() + assert isinstance(event, ScheduleUpdated) + assert event.schedule_id == "foo" + assert event.next_fire_time is None + + # The new job was acquired + event = await worker_receive.receive() + assert isinstance(event, JobReleased) + assert event.job_id == job_id + assert event.task_id == "test_schedulers:dummy_async_job" + assert event.schedule_id == "foo" + assert event.scheduled_start == one_second_in_past + assert event.started_at is None + assert event.outcome is JobOutcome.missed_start_deadline + + # There should be no more events on the list + with pytest.raises(WouldBlock): + scheduler_receive.receive_nowait() + + @pytest.mark.parametrize( + "coalesce, expected_jobs, first_fire_time_delta", + [ + pytest.param( + CoalescePolicy.all, 4, timedelta(minutes=3, seconds=5), id="all" + ), + pytest.param( + CoalescePolicy.earliest, + 1, + timedelta(minutes=3, seconds=5), + id="earliest", + ), + pytest.param(CoalescePolicy.latest, 1, timedelta(seconds=5), id="latest"), + ], + ) + async def test_coalesce_policy( + self, + coalesce: CoalescePolicy, + expected_jobs: int, + first_fire_time_delta: timedelta, + raw_datastore: DataStore, + timezone: ZoneInfo, + ) -> None: + now = datetime.now(timezone) + first_start_time = now - timedelta(minutes=3, seconds=5) + trigger = IntervalTrigger(minutes=1, start_time=first_start_time) + send, receive = create_memory_object_stream[Event](4) + with send, receive: + async with AsyncScheduler( + data_store=raw_datastore, + role=SchedulerRole.scheduler, + cleanup_interval=None, + ) as scheduler: + await scheduler.add_schedule( + dummy_async_job, trigger, id="foo", coalesce=coalesce + ) + scheduler.subscribe(send.send) + await scheduler.start_in_background() + + with fail_after(3): + # The scheduler was started + event = await receive.receive() + assert isinstance(event, SchedulerStarted) + + # The schedule was processed and one or more jobs weres added + for _ in range(expected_jobs): + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.schedule_id == "foo" + assert event.task_id == "test_schedulers:dummy_async_job" + + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + assert event.next_fire_time == now + timedelta(seconds=55) + + expected_scheduled_fire_time = now - first_fire_time_delta + jobs = await scheduler.get_jobs() + for job in sorted(jobs, key=lambda job: job.scheduled_fire_time): + assert job.scheduled_fire_time + assert job.scheduled_fire_time < now + assert job.scheduled_fire_time == expected_scheduled_fire_time + expected_scheduled_fire_time += timedelta(minutes=1) + + # The scheduler was stopped + event = await receive.receive() + assert isinstance(event, SchedulerStopped) + + # There should be no more events on the list + with pytest.raises(WouldBlock): + receive.receive_nowait() + + @pytest.mark.parametrize( + "max_jitter, expected_upper_bound", + [pytest.param(2, 2, id="within"), pytest.param(4, 2.999999, id="exceed")], + ) + async def test_jitter( + self, + mocker: MockerFixture, + timezone: ZoneInfo, + max_jitter: float, + expected_upper_bound: float, + raw_datastore: DataStore, + ) -> None: + jitter = 1.569374 + now = datetime.now(timezone) + fake_uniform = mocker.patch("random.uniform") + fake_uniform.configure_mock(side_effect=lambda a, b: jitter) + send, receive = create_memory_object_stream[Event](4) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore, role=SchedulerRole.scheduler) + ) + scheduler.subscribe(send.send) + trigger = DateTrigger(now) + schedule_id = await scheduler.add_schedule( + dummy_async_job, trigger, id="foo", max_jitter=max_jitter + ) + schedule = await scheduler.get_schedule(schedule_id) + assert schedule.max_jitter == timedelta(seconds=max_jitter) + + await scheduler.start_in_background() + + with fail_after(3): + # The task was added + event = await receive.receive() + assert isinstance(event, TaskAdded) + assert event.task_id == "test_schedulers:dummy_async_job" + + # The schedule was added + event = await receive.receive() + assert isinstance(event, ScheduleAdded) + assert event.schedule_id == "foo" + assert event.next_fire_time == now + + # The scheduler was started + event = await receive.receive() + assert isinstance(event, SchedulerStarted) + + # The schedule was processed and a job was added for it + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.schedule_id == "foo" + assert event.task_id == "test_schedulers:dummy_async_job" + + # Check that the job was created with the proper amount of jitter in its + # scheduled time + jobs = await scheduler.get_jobs() + assert len(jobs) == 1 + assert jobs[0].jitter == timedelta(seconds=jitter) + assert jobs[0].scheduled_fire_time == now + timedelta(seconds=jitter) + assert jobs[0].original_scheduled_time == now + + async def test_add_job_get_result_success(self, raw_datastore: DataStore) -> None: + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + job_id = await scheduler.add_job( + dummy_async_job, kwargs={"delay": 0.2}, result_expiration_time=5 + ) + await scheduler.start_in_background() + with fail_after(3): + result = await scheduler.get_job_result(job_id) + + assert result + assert result.job_id == job_id + assert result.outcome is JobOutcome.success + assert result.return_value == "returnvalue" + + async def test_add_job_get_result_empty(self, raw_datastore: DataStore) -> None: + send, receive = create_memory_object_stream[Event](4) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore) + ) + await scheduler.start_in_background() + + scheduler.subscribe(send.send) + job_id = await scheduler.add_job(dummy_async_job) + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, TaskAdded) + + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.job_id == job_id + + event = await receive.receive() + assert isinstance(event, JobAcquired) + assert event.job_id == job_id + assert event.task_id == "test_schedulers:dummy_async_job" + assert event.schedule_id is None + + event = await receive.receive() + assert isinstance(event, JobReleased) + assert event.job_id == job_id + assert event.task_id == "test_schedulers:dummy_async_job" + assert event.schedule_id is None + + with pytest.raises(JobLookupError): + await scheduler.get_job_result(job_id, wait=False) + + async def test_add_job_get_result_error(self) -> None: + async with AsyncScheduler() as scheduler: + job_id = await scheduler.add_job( + dummy_async_job, + kwargs={"delay": 0.2, "fail": True}, + result_expiration_time=5, + ) + await scheduler.start_in_background() + with fail_after(3): + result = await scheduler.get_job_result(job_id) + + assert result + assert result.job_id == job_id + assert result.outcome is JobOutcome.error + assert isinstance(result.exception, RuntimeError) + assert str(result.exception) == "failing as requested" + + async def test_add_job_get_result_no_ready_yet(self) -> None: + send, receive = create_memory_object_stream[Event](4) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context(AsyncScheduler()) + scheduler.subscribe(send.send) + job_id = await scheduler.add_job(dummy_async_job, kwargs={"delay": 0.2}) + + with fail_after(3): + event = await receive.receive() + assert isinstance(event, TaskAdded) + + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.job_id == job_id + + with pytest.raises(JobLookupError), fail_after(1): + await scheduler.get_job_result(job_id, wait=False) + + async def test_add_job_not_rewriting_task_config( + self, raw_datastore: DataStore + ) -> None: + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + TASK_ID = "task_dummy_async_job" + JOB_EXECUTOR = "async" + MISFIRE_GRACE_TIME = timedelta(seconds=10) + MAX_RUNNING_JOBS = 5 + METADATA = {"key": "value"} + + await scheduler.configure_task( + func_or_task_id=TASK_ID, + func=dummy_async_job, + job_executor=JOB_EXECUTOR, + misfire_grace_time=MISFIRE_GRACE_TIME, + max_running_jobs=MAX_RUNNING_JOBS, + metadata=METADATA, + ) + + assert await scheduler.add_job(TASK_ID) + + task = await scheduler.data_store.get_task(TASK_ID) + assert task.job_executor == JOB_EXECUTOR + assert task.misfire_grace_time == MISFIRE_GRACE_TIME + assert task.max_running_jobs == MAX_RUNNING_JOBS + assert task.metadata == METADATA + + async def test_contextvars(self, mocker: MockerFixture, timezone: ZoneInfo) -> None: + def check_contextvars() -> None: + assert current_async_scheduler.get() is scheduler + info = current_job.get() + assert isinstance(info, Job) + assert info.task_id == "contextvars" + assert info.schedule_id == "foo" + assert info.original_scheduled_time == now + assert info.scheduled_fire_time == now + timedelta(seconds=2.16) + assert info.jitter == timedelta(seconds=2.16) + assert info.start_deadline == now + timedelta(seconds=2.16) + timedelta( + seconds=10 + ) + + fake_uniform = mocker.patch("random.uniform") + fake_uniform.configure_mock(return_value=2.16) + now = datetime.now(timezone) + send, receive = create_memory_object_stream[Event](1) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context(AsyncScheduler()) + await scheduler.configure_task("contextvars", func=check_contextvars) + await scheduler.add_schedule( + "contextvars", + DateTrigger(now), + id="foo", + max_jitter=3, + misfire_grace_time=10, + ) + scheduler.subscribe(send.send, {JobReleased}) + await scheduler.start_in_background() + + with fail_after(3): + event = await receive.receive() + + assert event.outcome is JobOutcome.success + + async def test_explicit_cleanup(self, raw_datastore: DataStore) -> None: + send, receive = create_memory_object_stream[Event](1) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(raw_datastore, cleanup_interval=None) + ) + scheduler.subscribe(send.send, {ScheduleRemoved}) + event = anyio.Event() + scheduler.subscribe(lambda _: event.set(), {JobReleased}, one_shot=True) + await scheduler.start_in_background() + + # Add a job whose result expires after 1 ms + job_id = await scheduler.add_job( + dummy_async_job, result_expiration_time=0.001 + ) + with fail_after(3): + await event.wait() + + # After the sleeping past the expiration time and performing a cleanup, the + # result should not be there anymore + await sleep(0.1) + await scheduler.cleanup() + with pytest.raises(JobLookupError): + await scheduler.get_job_result(job_id) + + # Add a schedule to immediately set the event + event = anyio.Event() + scheduler.subscribe(lambda _: event.set(), {JobReleased}, one_shot=True) + await scheduler.add_schedule( + dummy_async_job, DateTrigger(datetime.now(timezone.utc)), id="event_set" + ) + with fail_after(3): + await event.wait() + + # The schedule should still be around, but with a null next_fire_time + schedule = await scheduler.get_schedule("event_set") + assert schedule.next_fire_time is None + + # After the cleanup, the schedule should be gone + await scheduler.cleanup() + with pytest.raises(ScheduleLookupError): + await scheduler.get_schedule("event_set") + + # Check that the corresponding event was received + with fail_after(3): + event = await receive.receive() + assert isinstance(event, ScheduleRemoved) + assert event.schedule_id == schedule.id + assert event.finished + + async def test_explicit_cleanup_avoid_schedules_still_having_jobs( + self, raw_datastore: DataStore + ) -> None: + send, receive = create_memory_object_stream[Event](4) + async with AsyncExitStack() as exit_stack: + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(raw_datastore, cleanup_interval=None) + ) + scheduler.subscribe(send.send, {ScheduleUpdated, JobAdded, JobReleased}) + await scheduler.start_in_background() + + # Add a schedule to immediately set the event + dummy_event = anyio.Event() + await scheduler.configure_task("event_set", func=dummy_event.wait) + schedule_id = await scheduler.add_schedule( + "event_set", DateTrigger(datetime.now(timezone.utc)), id="event_set" + ) + + # Wait for the job to be submitted + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.schedule_id == schedule_id + + # Wait for the schedule to be updated + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + assert event.schedule_id == schedule_id + assert event.next_fire_time is None + + # Check that there is a job for the schedule + jobs = await scheduler.get_jobs() + assert len(jobs) == 1 + assert jobs[0].schedule_id == schedule_id + + # After the cleanup, the schedule should still be around, with a + # null next_fire_time + await scheduler.cleanup() + schedule = await scheduler.get_schedule("event_set") + assert schedule.next_fire_time is None + + # Wait for the job to finish + dummy_event.set() + event = await receive.receive() + assert isinstance(event, JobReleased) + + async def test_implicit_cleanup(self, mocker: MockerFixture) -> None: + """ + Test that the scheduler's cleanup() method is called when the scheduler is + started. + + """ + async with AsyncScheduler() as scheduler: + event = anyio.Event() + mocker.patch.object(scheduler.data_store, "cleanup", side_effect=event.set) + await scheduler.start_in_background() + with fail_after(3): + await event.wait() + + async def test_wait_until_stopped(self) -> None: + async with AsyncScheduler() as scheduler: + await scheduler.add_job(scheduler.stop) + await scheduler.wait_until_stopped() + + # This should be a no-op + await scheduler.wait_until_stopped() + + async def test_max_concurrent_jobs(self) -> None: + lock = Lock() + scheduler = AsyncScheduler(max_concurrent_jobs=1) + tasks_done = 0 + + async def acquire_release() -> None: + nonlocal tasks_done + lock.acquire_nowait() + await sleep(0.1) + tasks_done += 1 + if tasks_done == 2: + await scheduler.stop() + + lock.release() + + with fail_after(3): + async with scheduler: + await scheduler.configure_task("dummyjob", func=acquire_release) + await scheduler.add_job("dummyjob") + await scheduler.add_job("dummyjob") + await scheduler.run_until_stopped() + + @pytest.mark.parametrize( + "trigger_type, run_job", + [ + pytest.param("cron", False, id="cron"), + pytest.param("date", True, id="date"), + ], + ) + async def test_pause_unpause_schedule( + self, + raw_datastore: DataStore, + timezone: ZoneInfo, + trigger_type: str, + run_job: bool, + ) -> None: + if trigger_type == "cron": + trigger = CronTrigger() + else: + trigger = DateTrigger(datetime.now(timezone)) + + async with AsyncExitStack() as exit_stack: + send, receive = create_memory_object_stream[Event](4) + exit_stack.enter_context(send) + exit_stack.enter_context(receive) + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore, role=SchedulerRole.scheduler) + ) + schedule_id = await scheduler.add_schedule( + dummy_async_job, trigger, id="foo" + ) + scheduler.subscribe(send.send, {ScheduleUpdated, JobAdded}) + + # Pause the schedule and wait for the schedule update event + await scheduler.pause_schedule(schedule_id) + schedule = await scheduler.get_schedule(schedule_id) + assert schedule.paused + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + + if run_job: + # Make sure that no jobs are added when the scheduler is started + await scheduler.start_in_background() + assert not await scheduler.get_jobs() + + # Unpause the schedule and wait for the schedule update event + await scheduler.unpause_schedule(schedule_id) + schedule = await scheduler.get_schedule(schedule_id) + assert not schedule.paused + event = await receive.receive() + assert isinstance(event, ScheduleUpdated) + + if run_job: + with fail_after(3): + job_added_event = await receive.receive() + + assert isinstance(job_added_event, JobAdded) + assert job_added_event.schedule_id == schedule_id + + async def test_schedule_job_result_expiration_time( + self, raw_datastore: DataStore, timezone: ZoneInfo + ) -> None: + trigger = DateTrigger(datetime.now(timezone)) + send, receive = create_memory_object_stream[Event](4) + with send, receive: + async with AsyncExitStack() as exit_stack: + scheduler = await exit_stack.enter_async_context( + AsyncScheduler(data_store=raw_datastore) + ) + await scheduler.add_schedule( + dummy_async_job, trigger, id="foo", job_result_expiration_time=10 + ) + exit_stack.enter_context(scheduler.subscribe(send.send, {JobAdded})) + await scheduler.start_in_background() + + # Wait for the scheduled job to be added + with fail_after(3): + event = await receive.receive() + assert isinstance(event, JobAdded) + assert event.schedule_id == "foo" + + # Get its result + result = await scheduler.get_job_result(event.job_id) + + assert result + assert result.outcome is JobOutcome.success + assert result.return_value == "returnvalue" + + async def test_scheduler_crash_restart_schedule_immediately( + self, raw_datastore: DataStore, timezone: ZoneInfo + ) -> None: + """ + Test that the scheduler can immediately start processing a schedule it had + acquired while the crash occurred. + + """ + scheduler = AsyncScheduler(data_store=raw_datastore) + error_patch = patch.object( + raw_datastore, "release_schedules", side_effect=RuntimeError("Fake failure") + ) + with pytest.raises(ExceptionGroup) as exc_info, error_patch: + async with scheduler: + await scheduler.add_schedule( + dummy_async_job, IntervalTrigger(minutes=1), id="foo" + ) + with move_on_after(3): + await scheduler.run_until_stopped() + + pytest.fail("The scheduler did not crash") + + exc = exc_info.value + while isinstance(exc, ExceptionGroup) and len(exc.exceptions) == 1: + exc = exc.exceptions[0] + + assert isinstance(exc, RuntimeError) + assert exc.args == ("Fake failure",) + + # Don't clear the data store at launch + if isinstance(raw_datastore, BaseExternalDataStore): + raw_datastore.start_from_scratch = False + + # Now reinitialize the scheduler and make sure the schedule gets processed + # immediately + async with scheduler: + # Check that the schedule was left in an acquired state + schedules = await scheduler.get_schedules() + assert len(schedules) == 1 + assert schedules[0].acquired_by == scheduler.identity + assert schedules[0].acquired_until > datetime.now(timezone) + + # Start the scheduler and wait for the schedule to be processed + await scheduler.start_in_background() + with fail_after(scheduler.lease_duration.total_seconds() / 2): + job_added_event = await scheduler.get_next_event(JobAdded) + + assert job_added_event.schedule_id == "foo" + + async def test_scheduler_crash_reap_abandoned_jobs( + self, raw_datastore: DataStore, timezone: ZoneInfo + ) -> None: + """ + Test that after the scheduler has crashed and been restarted, it immediately + detects an abandoned job and releases it with the appropriate result code. + + """ + scheduler = AsyncScheduler(data_store=raw_datastore) + error_patch = patch.object( + raw_datastore, "release_job", side_effect=RuntimeError("Fake failure") + ) + with pytest.raises(ExceptionGroup) as exc_info, error_patch: + async with scheduler: + job_id = await scheduler.add_job(dummy_async_job) + with move_on_after(3): + await scheduler.run_until_stopped() + + pytest.fail("The scheduler did not crash") + + exc = exc_info.value + while isinstance(exc, ExceptionGroup) and len(exc.exceptions) == 1: + exc = exc.exceptions[0] + + assert isinstance(exc, RuntimeError) + assert exc.args == ("Fake failure",) + + # Don't clear the data store at launch + if isinstance(raw_datastore, BaseExternalDataStore): + raw_datastore.start_from_scratch = False + + # Now reinitialize the scheduler and make sure the job gets processed + # immediately + async with scheduler: + # Check that the job was left in an acquired state + jobs = await scheduler.get_jobs() + assert len(jobs) == 1 + assert jobs[0].acquired_by == scheduler.identity + assert jobs[0].acquired_until > datetime.now(timezone) + + trigger_event = anyio.Event() + job_released_event: JobReleased | None = None + + def event_callback(event: Event) -> None: + nonlocal job_released_event + job_released_event = cast(JobReleased, event) + trigger_event.set() + + # Start the scheduler and wait for the job to be processed + with scheduler.subscribe(event_callback, {JobReleased}): + await scheduler.start_in_background() + with fail_after(scheduler.lease_duration.total_seconds() / 2): + await trigger_event.wait() + + assert job_released_event + assert job_released_event.job_id == job_id + assert job_released_event.outcome is JobOutcome.abandoned + assert not await scheduler.get_jobs() + + async def test_stop_scheduler_while_job_running( + self, raw_datastore: DataStore + ) -> None: + event = anyio.Event() + + async def delay_job() -> None: + event.set() + await sleep(8) + + async with AsyncScheduler(data_store=raw_datastore) as scheduler: + await scheduler.configure_task("delay_job", func=delay_job) + await scheduler.add_job("delay_job", result_expiration_time=15) + await scheduler.start_in_background() + + with fail_after(5): + await event.wait() + + assert len(scheduler._running_jobs) == 1 + job_id = next(iter(scheduler._running_jobs)).id + event = anyio.Event() + scheduler.subscribe(lambda _: event.set(), SchedulerStopped, one_shot=True) + await scheduler.stop() + with fail_after(5): + await event.wait() + + assert len(scheduler._running_jobs) == 0 + + # Check that the task has 0 running jobs + datastore_tasks = await scheduler.get_tasks() + assert len(datastore_tasks) == 1 + assert datastore_tasks[0].running_jobs == 0 + + # Check that the job was removed + datastore_jobs = await scheduler.get_jobs() + assert len(datastore_jobs) == 0 + + # Check that the job outcome was set to "cancelled" + result = await scheduler.get_job_result(job_id) + assert result.outcome is JobOutcome.cancelled + + +class TestSyncScheduler: + def test_interface_parity(self) -> None: + """ + Ensure that the sync scheduler has the same properties and methods as the async + schedulers, and the method parameters match too. + + """ + actual_attributes = set(dir(Scheduler)) + expected_attributes = sorted( + attrname for attrname in dir(AsyncScheduler) if not attrname.startswith("_") + ) + for attrname in expected_attributes: + if attrname not in actual_attributes: + pytest.fail(f"SyncScheduler is missing the {attrname} attribute") + + async_attrval = getattr(AsyncScheduler, attrname) + sync_attrval = getattr(Scheduler, attrname) + if callable(async_attrval): + async_sig = signature(async_attrval) + async_args: dict[int, list] = defaultdict(list) + for param in async_sig.parameters.values(): + if param.name not in ("task_status", "is_async"): + async_args[param.kind].append(param) + + sync_sig = signature(sync_attrval) + sync_args: dict[int, list] = defaultdict(list) + for param in sync_sig.parameters.values(): + sync_args[param.kind].append(param) + + for kind, args in async_args.items(): + assert args == sync_args[kind], ( + f"Parameter mismatch for {attrname}(): {args} != {sync_args[kind]}" + ) + + def test_constructor_parity(self) -> None: + """ + Ensure that the sync scheduler accepts the same constructor arguments as the + async scheduler, with the same default values. + + The loop in :meth:`test_interface_parity` skips ``__init__`` because it only + looks at public attributes, so the constructor defaults – the one place where + the two schedulers can silently drift apart – are compared here instead. + + """ + # Constructor arguments whose declared defaults intentionally differ. + # Scheduler only forwards the options it was actually given, so it uses None as + # an "argument not passed" sentinel for every option whose real default is an + # object built by AsyncScheduler itself (an attrs factory, or the module level + # logger); the effective default still comes from AsyncScheduler. + # task_defaults is additionally sync-specific, as Scheduler fills in the + # "threadpool" job executor. + exceptions = { + "data_store", + "event_broker", + "job_executors", + "task_defaults", + "logger", + } + async_params = signature(AsyncScheduler.__init__).parameters + sync_params = signature(Scheduler.__init__).parameters + converters = { + field.name: field.converter for field in attrs.fields(AsyncScheduler) + } + for name, async_param in async_params.items(): + if name == "self": + continue + + if name not in sync_params: + pytest.fail(f"Scheduler() is missing the {name!r} argument") + + if name in exceptions: + continue + + # Compare the defaults the way AsyncScheduler stores them, by running both + # through the field's converter (if any), as lease_duration is declared as a + # plain number of seconds on the async side but as a timedelta on the sync + # side. + convert = converters[name] or (lambda value: value) + async_default = convert(async_param.default) + sync_default = convert(sync_params[name].default) + assert sync_default == async_default, ( + f"Default value mismatch for the {name!r} argument of Scheduler(): " + f"{sync_default!r} != {async_default!r}" + ) + + def test_repr(self) -> None: + scheduler = Scheduler(identity="my identity") + assert repr(scheduler) == ( + "Scheduler(identity='my identity', role=, " + "data_store=MemoryDataStore(), event_broker=LocalEventBroker())" + ) + + def test_configure(self) -> None: + executor = ThreadPoolJobExecutor() + task_defaults = TaskDefaults(job_executor="executor1") + scheduler = Scheduler( + identity="identity", + role=SchedulerRole.scheduler, + max_concurrent_jobs=150, + cleanup_interval=5, + job_executors={"executor1": executor}, + task_defaults=task_defaults, + ) + assert scheduler.identity == "identity" + assert scheduler.role is SchedulerRole.scheduler + assert scheduler.max_concurrent_jobs == 150 + assert scheduler.cleanup_interval == timedelta(seconds=5) + assert scheduler.job_executors == {"executor1": executor} + assert scheduler.task_defaults == task_defaults + + @pytest.mark.parametrize("as_default", [False, True]) + def test_threadpool_executor(self, as_default: bool) -> None: + with Scheduler() as scheduler: + scheduler.start_in_background() + if as_default: + thread_id = scheduler.run_job(threading.get_ident) + else: + thread_id = scheduler.run_job( + threading.get_ident, job_executor="threadpool" + ) + + assert thread_id != threading.get_ident() + + def test_processpool_executor(self) -> None: + with Scheduler() as scheduler: + scheduler.start_in_background() + pid = scheduler.run_job(os.getpid, job_executor="processpool") + assert pid != os.getpid() + + def test_properties(self) -> None: + with Scheduler() as scheduler: + assert isinstance(scheduler.data_store, MemoryDataStore) + assert isinstance(scheduler.event_broker, LocalEventBroker) + assert scheduler.role is SchedulerRole.both + assert isinstance(scheduler.identity, str) + assert len(scheduler.job_executors) == 3 + assert isinstance(scheduler.job_executors["async"], AsyncJobExecutor) + assert isinstance( + scheduler.job_executors["threadpool"], ThreadPoolJobExecutor + ) + assert isinstance( + scheduler.job_executors["processpool"], ProcessPoolJobExecutor + ) + assert isinstance(scheduler.task_defaults, TaskDefaults) + assert scheduler.state is RunState.stopped + + def test_use_without_contextmanager(self, mocker: MockFixture) -> None: + fake_atexit_register = mocker.patch("atexit.register") + scheduler = Scheduler() + scheduler.subscribe(lambda event: None) + fake_atexit_register.assert_called_once_with(scheduler._exit_stack.close) + scheduler._exit_stack.close() + + def test_configure_task(self) -> None: + queue: Queue[Event] = Queue() + with Scheduler() as scheduler: + scheduler.subscribe(queue.put_nowait) + scheduler.configure_task("mytask", func=dummy_sync_job) + scheduler.configure_task("mytask", misfire_grace_time=2) + tasks = scheduler.get_tasks() + assert len(tasks) == 1 + assert tasks[0].id == "mytask" + assert tasks[0].func == f"{__name__}:dummy_sync_job" + assert tasks[0].misfire_grace_time == timedelta(seconds=2) + + event = queue.get(timeout=1) + assert isinstance(event, TaskAdded) + assert event.task_id == "mytask" + + event = queue.get(timeout=1) + assert isinstance(event, TaskUpdated) + assert event.task_id == "mytask" + + def test_add_remove_schedule(self, timezone: ZoneInfo) -> None: + queue: Queue[Event] = Queue() + with Scheduler() as scheduler: + scheduler.subscribe(queue.put_nowait) + now = datetime.now(timezone) + trigger = DateTrigger(now) + schedule_id = scheduler.add_schedule(dummy_async_job, trigger, id="foo") + assert schedule_id == "foo" + + schedules = scheduler.get_schedules() + assert len(schedules) == 1 + assert schedules[0].id == "foo" + assert schedules[0].task_id == f"{__name__}:dummy_async_job" + + schedule = scheduler.get_schedule(schedule_id) + assert schedules[0] == schedule + + scheduler.remove_schedule(schedule_id) + assert not scheduler.get_schedules() + + event = queue.get(timeout=1) + assert isinstance(event, TaskAdded) + assert event.task_id == f"{__name__}:dummy_async_job" + + event = queue.get(timeout=1) + assert isinstance(event, ScheduleAdded) + assert event.schedule_id == "foo" + assert event.next_fire_time == now + + event = queue.get(timeout=1) + assert isinstance(event, ScheduleRemoved) + assert event.schedule_id == "foo" + assert not event.finished + + def test_add_job_wait_result(self) -> None: + queue: Queue[Event] = Queue() + with Scheduler() as scheduler: + assert scheduler.get_jobs() == [] + + scheduler.subscribe(queue.put_nowait) + job_id = scheduler.add_job(dummy_sync_job, result_expiration_time=10) + + event = queue.get(timeout=1) + assert isinstance(event, TaskAdded) + assert event.task_id == f"{__name__}:dummy_sync_job" + + event = queue.get(timeout=1) + assert isinstance(event, JobAdded) + assert event.job_id == job_id + + jobs = scheduler.get_jobs() + assert len(jobs) == 1 + assert jobs[0].id == job_id + assert jobs[0].task_id == f"{__name__}:dummy_sync_job" + + with pytest.raises(JobLookupError): + scheduler.get_job_result(job_id, wait=False) + + scheduler.start_in_background() + + event = queue.get(timeout=1) + assert isinstance(event, SchedulerStarted) + + event = queue.get(timeout=1) + assert isinstance(event, JobAcquired) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_sync_job" + assert event.schedule_id is None + + event = queue.get(timeout=1) + assert isinstance(event, JobReleased) + assert event.job_id == job_id + assert event.task_id == f"{__name__}:dummy_sync_job" + assert event.schedule_id is None + assert event.outcome is JobOutcome.success + + result = scheduler.get_job_result(job_id) + assert result + assert result.outcome is JobOutcome.success + assert result.return_value == "returnvalue" + + def test_wait_until_stopped(self) -> None: + queue: Queue[Event] = Queue() + with Scheduler() as scheduler: + scheduler.configure_task("stop", func=scheduler.stop) + scheduler.add_job("stop") + scheduler.subscribe(queue.put_nowait) + scheduler.start_in_background() + scheduler.wait_until_stopped() + + event = queue.get(timeout=1) + assert isinstance(event, SchedulerStarted) + + event = queue.get(timeout=1) + assert isinstance(event, JobAcquired) + + event = queue.get(timeout=1) + assert isinstance(event, JobReleased) + + event = queue.get(timeout=1) + assert isinstance(event, SchedulerStopped) + + def test_explicit_cleanup(self) -> None: + with Scheduler(cleanup_interval=None) as scheduler: + event = threading.Event() + scheduler.add_schedule( + event.set, DateTrigger(datetime.now(timezone.utc)), id="event_set" + ) + scheduler.start_in_background() + assert event.wait(3) + + # The schedule should still be around, but with a null next_fire_time + schedule = scheduler.get_schedule("event_set") + assert schedule.next_fire_time is None + + # After the cleanup, the schedule should be gone + scheduler.cleanup() + with pytest.raises(ScheduleLookupError): + scheduler.get_schedule("event_set") + + def test_implicit_cleanup(self, mocker: MockerFixture) -> None: + """ + Test that the data store's cleanup() method is called when a scheduler + configured with the default options is started. + + """ + with Scheduler() as scheduler: + event = threading.Event() + mocker.patch.object(scheduler.data_store, "cleanup", side_effect=event.set) + scheduler.start_in_background() + assert event.wait(3) + + def test_run_until_stopped(self) -> None: + queue: Queue[Event] = Queue() + with Scheduler() as scheduler: + scheduler.configure_task("stop", func=scheduler.stop) + scheduler.add_job("stop") + scheduler.subscribe(queue.put_nowait) + scheduler.run_until_stopped() + + event = queue.get(timeout=1) + assert isinstance(event, SchedulerStarted) + + event = queue.get(timeout=1) + assert isinstance(event, JobAcquired) + + event = queue.get(timeout=1) + assert isinstance(event, JobReleased) + + event = queue.get(timeout=1) + assert isinstance(event, SchedulerStopped) + + def test_uwsgi_threads_error(self, monkeypatch: MonkeyPatch) -> None: + mod = ModuleType("uwsgi") + monkeypatch.setitem(sys.modules, "uwsgi", mod) + mod.has_threads = False + with pytest.raises( + RuntimeError, match="The scheduler seems to be running under uWSGI" + ): + Scheduler().start_in_background() diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/test_serializers.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_serializers.py new file mode 100644 index 0000000000000000000000000000000000000000..0de7f7dd8ff573013cd3361c364334967f80c2e7 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/test_serializers.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from datetime import datetime, timezone +from typing import NoReturn +from uuid import uuid4 + +import pytest + +from apscheduler import ( + DeserializationError, + Event, + JobAdded, + JobOutcome, + JobReleased, + SerializationError, +) +from apscheduler.abc import Serializer + + +@pytest.mark.parametrize( + "event", + [ + pytest.param( + JobAdded( + job_id=uuid4(), + task_id="task", + schedule_id="schedule", + ), + id="job_added", + ), + pytest.param( + JobReleased( + job_id=uuid4(), + scheduler_id="testscheduler", + task_id="task", + schedule_id="schedule", + outcome=JobOutcome.success, + scheduled_start=datetime.now(timezone.utc), + started_at=datetime.now(timezone.utc), + ), + id="job_released", + ), + ], +) +def test_serialize_event(event: Event, serializer: Serializer) -> None: + payload = serializer.serialize(event.marshal()) + deserialized = type(event).unmarshal(serializer.deserialize(payload)) + assert deserialized == event + + +def test_serialization_error(serializer: Serializer) -> None: + class Unserializable: + def __getstate__(self) -> NoReturn: + raise ValueError("cannot be serialized") + + # An open file cannot be serialized + with pytest.raises(SerializationError) as exc: + serializer.serialize(Unserializable()) + + assert isinstance(exc.value.__cause__, ValueError) + + +@pytest.mark.parametrize( + "payload", + [ + pytest.param(b"", id="empty"), + pytest.param(b"\x61\x98", id="invalid"), + ], +) +def test_deserialization_error(payload: bytes, serializer: Serializer) -> None: + with pytest.raises(DeserializationError) as exc: + serializer.deserialize(payload) + + assert exc.value.__cause__ is not None diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_calendarinterval.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_calendarinterval.py new file mode 100644 index 0000000000000000000000000000000000000000..48e094bb36ddb183831d07773a7b8afc2ff54b56 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_calendarinterval.py @@ -0,0 +1,201 @@ +from __future__ import annotations + +from datetime import date, datetime, time +from zoneinfo import ZoneInfo + +import pytest + +from apscheduler.abc import Serializer +from apscheduler.triggers.calendarinterval import CalendarIntervalTrigger + + +def test_bad_interval(timezone): + exc = pytest.raises(ValueError, CalendarIntervalTrigger, timezone=timezone) + exc.match("interval must be at least 1 day long") + + +def test_bad_start_end_dates(timezone): + exc = pytest.raises( + ValueError, + CalendarIntervalTrigger, + days=1, + start_date=date(2016, 3, 4), + end_date=date(2016, 3, 3), + timezone=timezone, + ) + exc.match("end_date cannot be earlier than start_date") + + +def test_end_date(timezone, serializer): + """Test that end_date is respected.""" + start_end_date = date(2020, 12, 31) + trigger = CalendarIntervalTrigger( + days=1, start_date=start_end_date, end_date=start_end_date, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next().date() == start_end_date + assert trigger.next() is None + + +def test_missing_time(timezone, serializer): + """ + Test that if the designated time does not exist on a day due to a forward DST shift, + the day is skipped entirely. + + """ + trigger = CalendarIntervalTrigger( + days=1, hour=2, minute=30, start_date=date(2016, 3, 27), timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2016, 3, 28, 2, 30, tzinfo=timezone) + + +@pytest.mark.parametrize( + "years, months, weeks, days, start_date, expected_dates", + [ + pytest.param( + 0, + 0, + 0, + 1, + date(2024, 3, 29), + (date(2024, 3, 29), date(2024, 3, 31), date(2024, 4, 1)), + id="daily", + ), + pytest.param( + 0, + 0, + 0, + 1, + date(2024, 3, 30), + (date(2024, 3, 31),), + id="start-in-gap-end-on-next-day", + ), + pytest.param( + 0, + 0, + 0, + 2, + date(2024, 3, 28), + (date(2024, 3, 28), date(2024, 4, 1), date(2024, 4, 3)), + id="every-other-day", + ), + pytest.param( + 0, + 0, + 1, + 0, + date(2024, 3, 23), + (date(2024, 3, 23), date(2024, 4, 6), date(2024, 4, 13)), + id="weekly", + ), + pytest.param( + 0, + 1, + 0, + 0, + date(2024, 1, 30), + (date(2024, 1, 30), date(2024, 4, 30), date(2024, 5, 30)), + id="monthly", + ), + pytest.param( + 1, + 0, + 0, + 0, + date(2023, 3, 30), + (date(2023, 3, 30), date(2025, 3, 30), date(2026, 3, 30)), + id="yearly", + ), + ], +) +def test_missing_time_crossing_midnight( + years: int, + months: int, + weeks: int, + days: int, + start_date: date, + expected_dates: tuple[date, ...], + serializer: Serializer | None, +) -> None: + # Nuuk's missing 2024-03-30 23:30 normalizes to 2024-03-31 00:30. + timezone = ZoneInfo("America/Nuuk") + trigger = CalendarIntervalTrigger( + years=years, + months=months, + weeks=weeks, + days=days, + hour=23, + minute=30, + start_date=start_date, + end_date=expected_dates[-1], + timezone=timezone, + ) + for expected_date in expected_dates: + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime.combine(expected_date, time(23, 30), timezone) + + assert trigger.next() is None + + +def test_repeated_time(timezone, serializer): + """ + Test that if the designated time is repeated during a day due to a backward DST + shift, the task is executed on the earlier occurrence of that time. + + """ + trigger = CalendarIntervalTrigger( + days=2, hour=2, minute=30, start_date=date(2016, 10, 30), timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2016, 10, 30, 2, 30, tzinfo=timezone, fold=0) + + +def test_nonexistent_days(timezone, serializer): + """Test that invalid dates are skipped.""" + trigger = CalendarIntervalTrigger( + months=1, start_date=date(2016, 3, 31), timezone=timezone + ) + assert trigger.next() == datetime(2016, 3, 31, tzinfo=timezone) + + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2016, 5, 31, tzinfo=timezone) + + +def test_repr(timezone, serializer): + trigger = CalendarIntervalTrigger( + years=1, + months=5, + weeks=6, + days=8, + hour=3, + second=8, + start_date=date(2016, 3, 5), + end_date=date(2020, 12, 25), + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert repr(trigger) == ( + "CalendarIntervalTrigger(years=1, months=5, weeks=6, days=8, " + "time='03:00:08', start_date='2016-03-05', end_date='2020-12-25', " + "timezone='Europe/Berlin')" + ) + + +def test_utc_timezone(utc_timezone): + trigger = CalendarIntervalTrigger( + days=1, hour=1, start_date=date(2016, 3, 31), timezone=utc_timezone + ) + assert trigger.next() == datetime(2016, 3, 31, 1, tzinfo=utc_timezone) diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_combining.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_combining.py new file mode 100644 index 0000000000000000000000000000000000000000..03df3a713c7c2183b8787fecc4a191cf1d827a15 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_combining.py @@ -0,0 +1,210 @@ +from __future__ import annotations + +from datetime import datetime, timedelta, timezone + +import pytest + +from apscheduler import MaxIterationsReached +from apscheduler.triggers.calendarinterval import CalendarIntervalTrigger +from apscheduler.triggers.combining import AndTrigger, OrTrigger +from apscheduler.triggers.cron import CronTrigger +from apscheduler.triggers.date import DateTrigger +from apscheduler.triggers.interval import IntervalTrigger + + +class TestAndTrigger: + @pytest.mark.parametrize("threshold", [1, 0]) + def test_two_datetriggers(self, timezone, serializer, threshold): + date1 = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + date2 = datetime(2020, 5, 16, 14, 17, 31, 254212, tzinfo=timezone) + trigger = AndTrigger( + [DateTrigger(date1), DateTrigger(date2)], threshold=threshold + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + if threshold: + # date2 was within the threshold so it will not be used + assert trigger.next() == date1 + + assert trigger.next() is None + + def test_max_iterations(self, timezone, serializer): + start_time = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + trigger = AndTrigger( + [ + IntervalTrigger(seconds=4, start_time=start_time), + IntervalTrigger( + seconds=4, start_time=start_time + timedelta(seconds=2) + ), + ] + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + pytest.raises(MaxIterationsReached, trigger.next) + + def test_repr(self, timezone, serializer): + start_time = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + trigger = AndTrigger( + [ + IntervalTrigger(seconds=4, start_time=start_time), + IntervalTrigger( + seconds=4, start_time=start_time + timedelta(seconds=2) + ), + ] + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert repr(trigger) == ( + "AndTrigger([IntervalTrigger(seconds=4, " + "start_time='2020-05-16 14:17:30.254212+02:00'), IntervalTrigger(" + "seconds=4, start_time='2020-05-16 14:17:32.254212+02:00')], " + "threshold=1.0, max_iterations=10000)" + ) + + @pytest.mark.parametrize( + "left_trigger,right_trigger,expected_datetimes", + [ + ( + IntervalTrigger( + hours=6, start_time=datetime(2024, 5, 1, tzinfo=timezone.utc) + ), + IntervalTrigger( + hours=12, start_time=datetime(2024, 5, 1, tzinfo=timezone.utc) + ), + [ + datetime(2024, 5, 1, 0, tzinfo=timezone.utc), + datetime(2024, 5, 1, 12, tzinfo=timezone.utc), + datetime(2024, 5, 2, 0, tzinfo=timezone.utc), + ], + ), + ( + IntervalTrigger( + days=1, start_time=datetime(2024, 5, 1, tzinfo=timezone.utc) + ), + IntervalTrigger( + weeks=1, start_time=datetime(2024, 5, 1, tzinfo=timezone.utc) + ), + [ + datetime(2024, 5, 1, tzinfo=timezone.utc), + datetime(2024, 5, 8, tzinfo=timezone.utc), + datetime(2024, 5, 15, tzinfo=timezone.utc), + ], + ), + ( + CronTrigger( + day_of_week="mon-fri", + hour="*", + timezone=timezone.utc, + start_time=datetime(2024, 5, 3, tzinfo=timezone.utc), + ), + IntervalTrigger( + hours=12, start_time=datetime(2024, 5, 3, tzinfo=timezone.utc) + ), + [ + datetime(2024, 5, 3, 0, tzinfo=timezone.utc), + datetime(2024, 5, 3, 12, tzinfo=timezone.utc), + datetime(2024, 5, 6, 0, tzinfo=timezone.utc), + ], + ), + ( + CronTrigger( + day_of_week="mon-fri", + timezone=timezone.utc, + start_time=datetime(2024, 5, 13, tzinfo=timezone.utc), + ), + IntervalTrigger( + days=4, start_time=datetime(2024, 5, 13, tzinfo=timezone.utc) + ), + [ + datetime(2024, 5, 13, tzinfo=timezone.utc), + datetime(2024, 5, 17, tzinfo=timezone.utc), + datetime(2024, 5, 21, tzinfo=timezone.utc), + datetime(2024, 5, 29, tzinfo=timezone.utc), + ], + ), + ( + CalendarIntervalTrigger( + months=1, + timezone=timezone.utc, + start_date=datetime(2024, 1, 1, tzinfo=timezone.utc), + ), + CronTrigger( + day_of_week="mon-fri", + timezone=timezone.utc, + start_time=datetime(2024, 1, 1, tzinfo=timezone.utc), + ), + [ + datetime(2024, 1, 1, tzinfo=timezone.utc), + datetime(2024, 2, 1, tzinfo=timezone.utc), + datetime(2024, 3, 1, tzinfo=timezone.utc), + datetime(2024, 4, 1, tzinfo=timezone.utc), + datetime(2024, 5, 1, tzinfo=timezone.utc), + datetime(2024, 7, 1, tzinfo=timezone.utc), + datetime(2024, 8, 1, tzinfo=timezone.utc), + datetime(2024, 10, 1, tzinfo=timezone.utc), + datetime(2024, 11, 1, tzinfo=timezone.utc), + ], + ), + ], + ) + def test_overlapping_triggers( + self, left_trigger, right_trigger, expected_datetimes + ): + """ + Verify that the `AndTrigger` fires at the intersection of two triggers. + """ + and_trigger = AndTrigger([left_trigger, right_trigger]) + for expected_datetime in expected_datetimes: + next_datetime = and_trigger.next() + assert next_datetime == expected_datetime + + +class TestOrTrigger: + def test_two_datetriggers(self, timezone, serializer): + date1 = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + date2 = datetime(2020, 5, 18, 15, 1, 53, 940564, tzinfo=timezone) + trigger = OrTrigger([DateTrigger(date1), DateTrigger(date2)]) + + assert trigger.next() == date1 + + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == date2 + assert trigger.next() is None + + def test_two_interval_triggers(self, timezone, serializer): + start_time = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + end_time1 = start_time + timedelta(seconds=16) + end_time2 = start_time + timedelta(seconds=18) + trigger = OrTrigger( + [ + IntervalTrigger(seconds=4, start_time=start_time, end_time=end_time1), + IntervalTrigger(seconds=6, start_time=start_time, end_time=end_time2), + ] + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == start_time + assert trigger.next() == start_time + timedelta(seconds=4) + assert trigger.next() == start_time + timedelta(seconds=6) + assert trigger.next() == start_time + timedelta(seconds=8) + assert trigger.next() == start_time + timedelta(seconds=12) + assert trigger.next() == start_time + timedelta(seconds=16) + # The end time of the 4 second interval has been reached + assert trigger.next() == start_time + timedelta(seconds=18) + # The end time of the 6 second interval has been reached + assert trigger.next() is None + + def test_repr(self, timezone): + date1 = datetime(2020, 5, 16, 14, 17, 30, 254212, tzinfo=timezone) + date2 = datetime(2020, 5, 18, 15, 1, 53, 940564, tzinfo=timezone) + trigger = OrTrigger([DateTrigger(date1), DateTrigger(date2)]) + assert repr(trigger) == ( + "OrTrigger([DateTrigger('2020-05-16 14:17:30.254212+02:00'), " + "DateTrigger('2020-05-18 15:01:53.940564+02:00')])" + ) diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_cron.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_cron.py new file mode 100644 index 0000000000000000000000000000000000000000..c7de6e8363a190298c15c1f0030e74afe392aa98 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_cron.py @@ -0,0 +1,588 @@ +from __future__ import annotations + +from datetime import datetime +from zoneinfo import ZoneInfo + +import pytest + +from apscheduler.triggers.cron import CronTrigger + + +def test_invalid_expression(): + exc = pytest.raises(ValueError, CronTrigger, year="2009-fault") + exc.match("Unrecognized expression '2009-fault' for field 'year'") + + +def test_invalid_step(): + exc = pytest.raises(ValueError, CronTrigger, year="2009/0") + exc.match("step must be positive, got: 0") + + +def test_invalid_range(): + exc = pytest.raises(ValueError, CronTrigger, year="2009-2008") + exc.match("The minimum value in a range must not be higher than the maximum") + + +@pytest.mark.parametrize("expr", ["fab", "jan-fab"], ids=["start", "end"]) +def test_invalid_month_name(expr): + exc = pytest.raises(ValueError, CronTrigger, month=expr) + exc.match("Invalid month name 'fab'") + + +@pytest.mark.parametrize("expr", ["web", "mon-web"], ids=["start", "end"]) +def test_invalid_weekday_name(expr): + exc = pytest.raises(ValueError, CronTrigger, day_of_week=expr) + exc.match("Invalid weekday name 'web'") + + +def test_invalid_weekday_position_name(): + exc = pytest.raises(ValueError, CronTrigger, day="1st web") + exc.match("Invalid weekday name 'web'") + + +@pytest.mark.parametrize( + "values, expected", + [ + ( + {"day": "*/31"}, + r"Error validating expression '\*/31': the step value \(31\) is higher " + r"than the total range of the expression \(30\)", + ), + ( + {"day": "4-6/3"}, + r"Error validating expression '4-6/3': the step value \(3\) is higher " + r"than the total range of the expression \(2\)", + ), + ( + {"hour": "0-24"}, + r"Error validating expression '0-24': the last value \(24\) is higher " + r"than the maximum value \(23\)", + ), + ( + {"day": "0-3"}, + r"Error validating expression '0-3': the first value \(0\) is lower " + r"than the minimum value \(1\)", + ), + ], + ids=[ + "too_large_step_all", + "too_large_step_range", + "too_high_last", + "too_low_first", + ], +) +def test_invalid_ranges(values, expected): + pytest.raises(ValueError, CronTrigger, **values).match(expected) + + +def test_cron_trigger_1(timezone, serializer): + start_time = datetime(2008, 12, 1, tzinfo=timezone) + trigger = CronTrigger( + year="2009/2", + month="1-4/3", + day="5-6", + start_time=start_time, + timezone=timezone, + ) + + # since `next` is modifying the trigger, we call it before serializing + # to make sure the serialization works correctly also for modified triggers + assert trigger.next() == datetime(2009, 1, 5, tzinfo=timezone) + + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 1, 6, tzinfo=timezone) + assert trigger.next() == datetime(2009, 4, 5, tzinfo=timezone) + assert trigger.next() == datetime(2009, 4, 6, tzinfo=timezone) + assert trigger.next() == datetime(2011, 1, 5, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2009/2', month='1-4/3', day='5-6', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2008-12-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_cron_trigger_2(timezone, serializer): + start_time = datetime(2009, 10, 14, tzinfo=timezone) + trigger = CronTrigger( + year="2009/2", month="1-3", day="5", start_time=start_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2011, 1, 5, tzinfo=timezone) + assert trigger.next() == datetime(2011, 2, 5, tzinfo=timezone) + assert trigger.next() == datetime(2011, 3, 5, tzinfo=timezone) + assert trigger.next() == datetime(2013, 1, 5, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2009/2', month='1-3', day='5', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2009-10-14T00:00:00+02:00', timezone='Europe/Berlin')" + ) + + +def test_cron_trigger_3(timezone, serializer): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year="2009", + month="feb-dec", + hour="8-9", + start_time=start_time, + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 2, 1, 8, tzinfo=timezone) + assert trigger.next() == datetime(2009, 2, 1, 9, tzinfo=timezone) + assert trigger.next() == datetime(2009, 2, 2, 8, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2009', month='feb-dec', day='*', week='*', " + "day_of_week='*', hour='8-9', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_cron_trigger_4(timezone, serializer): + start_time = datetime(2012, 2, 1, tzinfo=timezone) + trigger = CronTrigger( + year="2012", month="2", day="last", start_time=start_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2012, 2, 29, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2012', month='2', day='last', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2012-02-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +@pytest.mark.parametrize("expr", ["3-5", "wed-fri"], ids=["numeric", "text"]) +def test_weekday_overlap(timezone, serializer, expr): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, + month=1, + day="6-10", + day_of_week=expr, + start_time=start_time, + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 1, 7, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2009', month='1', day='6-10', week='*', " + "day_of_week='wed-fri', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_weekday_range(timezone, serializer): + start_time = datetime(2020, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2020, + month=1, + week=1, + day_of_week="fri-sun", + start_time=start_time, + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2020, 1, 3, tzinfo=timezone) + assert trigger.next() == datetime(2020, 1, 4, tzinfo=timezone) + assert trigger.next() == datetime(2020, 1, 5, tzinfo=timezone) + assert trigger.next() is None + assert repr(trigger) == ( + "CronTrigger(year='2020', month='1', day='*', week='1', " + "day_of_week='fri-sun', hour='0', minute='0', second='0', " + "start_time='2020-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_last_weekday(timezone, serializer): + start_time = datetime(2020, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2020, day="last sun", start_time=start_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2020, 1, 26, tzinfo=timezone) + assert trigger.next() == datetime(2020, 2, 23, tzinfo=timezone) + assert trigger.next() == datetime(2020, 3, 29, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2020', month='*', day='last sun', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2020-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_increment_weekday(timezone, serializer): + """ + Tests that incrementing the weekday field in the process of calculating the next + matching date won't cause problems. + + """ + start_time = datetime(2009, 9, 25, 7, tzinfo=timezone) + trigger = CronTrigger(hour="5-6", start_time=start_time, timezone=timezone) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 9, 26, 5, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='*', hour='5-6', minute='0', second='0', " + "start_time='2009-09-25T07:00:00+02:00', timezone='Europe/Berlin')" + ) + + +def test_month_rollover(timezone, serializer): + start_time = datetime(2016, 2, 1, tzinfo=timezone) + trigger = CronTrigger(day=30, start_time=start_time, timezone=timezone) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2016, 3, 30, tzinfo=timezone) + assert trigger.next() == datetime(2016, 4, 30, tzinfo=timezone) + + +@pytest.mark.parametrize("weekday", ["1,0", "mon,sun"], ids=["numeric", "text"]) +def test_weekday_nomatch(timezone, serializer, weekday): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, + month=1, + day="6-10", + day_of_week=weekday, + start_time=start_time, + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() is None + assert repr(trigger) == ( + "CronTrigger(year='2009', month='1', day='6-10', week='*', " + "day_of_week='mon,sun', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_weekday_positional(timezone, serializer): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, month=1, day="4th wed", start_time=start_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 1, 28, tzinfo=timezone) + assert repr(trigger) == ( + "CronTrigger(year='2009', month='1', day='4th wed', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_end_time(timezone, serializer): + """Test that next() won't produce""" + start_time = datetime(2014, 4, 13, 2, tzinfo=timezone) + end_time = datetime(2014, 4, 13, 4, tzinfo=timezone) + trigger = CronTrigger( + hour=4, start_time=start_time, end_time=end_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2014, 4, 13, 4, tzinfo=timezone) + assert trigger.next() is None + assert repr(trigger) == ( + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='*', hour='4', minute='0', second='0', " + "start_time='2014-04-13T02:00:00+02:00', " + "end_time='2014-04-13T04:00:00+02:00', timezone='Europe/Berlin')" + ) + + +def test_week_1(timezone, serializer): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, month=2, week=8, start_time=start_time, timezone=timezone + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + for day in range(16, 23): + assert trigger.next() == datetime(2009, 2, day, tzinfo=timezone) + + assert trigger.next() is None + assert repr(trigger) == ( + "CronTrigger(year='2009', month='2', day='*', week='8', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +@pytest.mark.parametrize("weekday", [3, "wed"], ids=["numeric", "text"]) +def test_week_2(timezone, serializer, weekday): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, + week=15, + day_of_week=weekday, + start_time=start_time, + timezone=timezone, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == datetime(2009, 4, 8, tzinfo=timezone) + assert trigger.next() is None + assert repr(trigger) == ( + "CronTrigger(year='2009', month='*', day='*', week='15', " + "day_of_week='wed', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +@pytest.mark.parametrize( + "trigger_args, start_time, start_time_fold, correct_next_date," + "correct_next_date_fold", + [ + ({"hour": 2}, datetime(2013, 3, 9, 20), 0, datetime(2013, 3, 11, 2), 0), + ({"hour": 8}, datetime(2013, 3, 9, 12), 0, datetime(2013, 3, 10, 8), 0), + ({"hour": 8}, datetime(2013, 11, 2, 12), 0, datetime(2013, 11, 3, 8), 0), + ( + {"minute": "*/30"}, + datetime(2013, 3, 10, 1, 35), + 0, + datetime(2013, 3, 10, 3), + 0, + ), + ( + {"minute": "*/30"}, + datetime(2013, 11, 3, 1, 35), + 0, + datetime(2013, 11, 3, 1), + 1, + ), + ], + ids=[ + "spring_skip_hour", + "absolute_spring", + "absolute_autumn", + "interval_spring", + "interval_autumn", + ], +) +def test_dst_change( + trigger_args, + start_time, + start_time_fold, + correct_next_date, + correct_next_date_fold, + serializer, +): + """ + Making sure that CronTrigger works correctly when crossing the DST switch threshold. + Note that you should explicitly compare datetimes as strings to avoid the internal + datetime comparison which would test for equality in the UTC timezone. + + """ + timezone = ZoneInfo("US/Eastern") + start_time = start_time.replace(tzinfo=timezone, fold=start_time_fold) + trigger = CronTrigger(timezone=timezone, start_time=start_time, **trigger_args) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == correct_next_date.replace( + tzinfo=timezone, fold=correct_next_date_fold + ) + + +@pytest.mark.parametrize( + "minute, start_time, correct_next_dates", + [ + ( + 0, + datetime(2024, 10, 27, 2, 0, 0, 0), + [ + (datetime(2024, 10, 27, 2, 0, 0, 0), 0), + (datetime(2024, 10, 27, 2, 0, 0, 0), 1), + (datetime(2024, 10, 27, 3, 0, 0, 0), 0), + ], + ), + ( + 1, + datetime(2024, 10, 27, 2, 1, 0, 0), + [ + (datetime(2024, 10, 27, 2, 1, 0, 0), 0), + (datetime(2024, 10, 27, 2, 1, 0, 0), 1), + (datetime(2024, 10, 27, 3, 1, 0, 0), 0), + ], + ), + ], + ids=["dst_change_0", "dst_change_1"], +) +def test_dst_change2( + minute, + start_time, + correct_next_dates, + timezone, +): + trigger = CronTrigger(minute=minute, timezone=timezone) + trigger.start_time = start_time.replace(tzinfo=timezone) + for correct_next_date, fold in correct_next_dates: + correct_next_date = correct_next_date.replace(tzinfo=timezone, fold=fold) + next_date = trigger.next() + assert next_date == correct_next_date + assert str(next_date) == str(correct_next_date) + + +def test_zero_value(timezone): + start_time = datetime(2020, 1, 1, tzinfo=timezone) + trigger = CronTrigger( + year=2009, month=2, hour=0, start_time=start_time, timezone=timezone + ) + assert repr(trigger) == ( + "CronTrigger(year='2009', month='2', day='*', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2020-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + + +def test_year_list(timezone, serializer): + start_time = datetime(2009, 1, 1, tzinfo=timezone) + trigger = CronTrigger(year="2009,2008", start_time=start_time, timezone=timezone) + assert ( + repr(trigger) == "CronTrigger(year='2009,2008', month='1', day='1', week='*', " + "day_of_week='*', hour='0', minute='0', second='0', " + "start_time='2009-01-01T00:00:00+01:00', timezone='Europe/Berlin')" + ) + assert trigger.next() == datetime(2009, 1, 1, tzinfo=timezone) + assert trigger.next() is None + + +@pytest.mark.parametrize( + "expr, expected_repr", + [ + ( + "* * * * *", + "CronTrigger(year='*', month='*', day='*', week='*', day_of_week='*', " + "hour='*', minute='*', second='0', start_time='2020-05-19T19:53:22+02:00', " + "timezone='Europe/Berlin')", + ), + ( + "0-14 * 14-28 jul fri", + "CronTrigger(year='*', month='jul', day='14-28', week='*', " + "day_of_week='fri', hour='*', minute='0-14', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ( + " 0-14 * 14-28 jul fri", + "CronTrigger(year='*', month='jul', day='14-28', week='*', " + "day_of_week='fri', hour='*', minute='0-14', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ( + "* * * * 1-5", + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='mon-fri', hour='*', minute='*', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ( + "* * * * 0-3", + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='mon-wed,sun', hour='*', minute='*', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ( + "* * * * 6-1", + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='mon,sat-sun', hour='*', minute='*', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ( + "* * * * 6-7", + "CronTrigger(year='*', month='*', day='*', week='*', " + "day_of_week='sat-sun', hour='*', minute='*', second='0', " + "start_time='2020-05-19T19:53:22+02:00', timezone='Europe/Berlin')", + ), + ], + ids=[ + "always", + "assorted", + "multiple_spaces_in_format", + "working_week", + "sunday_first", + "saturday_first", + "weekend", + ], +) +def test_from_crontab(expr, expected_repr, timezone, serializer): + trigger = CronTrigger.from_crontab(expr, timezone=timezone) + trigger.start_time = datetime(2020, 5, 19, 19, 53, 22, tzinfo=timezone) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert repr(trigger) == expected_repr + + +def test_from_crontab_wrong_number_of_fields(): + exc = pytest.raises(ValueError, CronTrigger.from_crontab, "*") + exc.match("Wrong number of fields; got 1, expected 5") + + +def test_from_crontab_start_end_time(timezone: ZoneInfo) -> None: + start_time = datetime(2020, 5, 19, 19, 53, 22, tzinfo=timezone) + end_time = datetime(2020, 5, 24, 19, 53, 22, tzinfo=timezone) + trigger = CronTrigger.from_crontab( + "* * * * *", start_time=start_time, end_time=end_time + ) + assert trigger.start_time == start_time + assert trigger.end_time == end_time + + +def test_aware_start_time_timezone_conversion() -> None: + est = ZoneInfo("America/New_York") + cst = ZoneInfo("America/Chicago") + start_time = datetime(2009, 9, 26, 10, 16, tzinfo=cst) + trigger = CronTrigger(hour=11, minute="*/5", timezone=est, start_time=start_time) + correct_next_time = datetime(2009, 9, 26, 11, 20, tzinfo=est) + next_time = trigger.next() + assert str(next_time) == str(correct_next_time) + + +def test_aware_end_time_timezone_conversion() -> None: + est = ZoneInfo("America/New_York") + cst = ZoneInfo("America/Chicago") + start_time = datetime(2009, 9, 26, 10, 16, tzinfo=cst) + end_time = datetime(2009, 9, 26, 11, tzinfo=est) + trigger = CronTrigger( + hour=10, minute="*/5", timezone=cst, start_time=start_time, end_time=end_time + ) + next_time = trigger.next() + assert next_time is None + + +def test_non_existing_naive_start_time() -> None: + tz = ZoneInfo("Europe/Berlin") + start_time = datetime(2025, 3, 30, 2, 30, tzinfo=tz) + with pytest.raises(ValueError): + CronTrigger(timezone=tz, start_time=start_time) + + +def test_non_existing_naive_end_time() -> None: + tz = ZoneInfo("Europe/Berlin") + start_time = datetime(2025, 3, 30, 1, 30) + CronTrigger(timezone=tz, start_time=start_time) # start time is ok + end_time = datetime(2025, 3, 30, 2, 30) + with pytest.raises(ValueError): + CronTrigger(timezone=tz, start_time=start_time, end_time=end_time) diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_date.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_date.py new file mode 100644 index 0000000000000000000000000000000000000000..41116b0c0c26261e62b4ce53520882883038a5d4 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_date.py @@ -0,0 +1,17 @@ +from __future__ import annotations + +from datetime import datetime + +from apscheduler.triggers.date import DateTrigger + + +def test_run_time(timezone, serializer): + run_time = datetime(2020, 5, 14, 11, 56, 12, tzinfo=timezone) + trigger = DateTrigger(run_time) + if serializer: + payload = serializer.serialize(trigger) + trigger = serializer.deserialize(payload) + + assert trigger.next() == run_time + assert trigger.next() is None + assert repr(trigger) == "DateTrigger('2020-05-14 11:56:12+02:00')" diff --git a/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_interval.py b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_interval.py new file mode 100644 index 0000000000000000000000000000000000000000..607f3f894b548e51548063b48bfdb7edf77c40a2 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/baseline/tests/triggers/test_interval.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from datetime import datetime, timedelta + +import pytest + +from apscheduler.triggers.interval import IntervalTrigger + + +def test_bad_interval(): + exc = pytest.raises(ValueError, IntervalTrigger) + exc.match("The time interval must be positive") + + +def test_bad_end_time(timezone): + start_time = datetime(2020, 5, 16, tzinfo=timezone) + end_time = datetime(2020, 5, 15, tzinfo=timezone) + exc = pytest.raises( + ValueError, IntervalTrigger, seconds=1, start_time=start_time, end_time=end_time + ) + exc.match("end_time cannot be earlier than start_time") + + +def test_end_time(timezone, serializer): + start_time = datetime(2020, 5, 16, 19, 32, 44, 649521, tzinfo=timezone) + end_time = datetime(2020, 5, 16, 22, 33, 1, tzinfo=timezone) + interval = timedelta(hours=1, seconds=6) + trigger = IntervalTrigger( + start_time=start_time, end_time=end_time, hours=1, seconds=6 + ) + assert trigger.next() == start_time + + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert trigger.next() == start_time + interval + assert trigger.next() == start_time + interval * 2 + assert trigger.next() is None + + +def test_repr(timezone, serializer): + start_time = datetime(2020, 5, 15, 12, 55, 32, 954032, tzinfo=timezone) + end_time = datetime(2020, 6, 4, 16, 18, 49, 306942, tzinfo=timezone) + trigger = IntervalTrigger( + weeks=1, + days=2, + hours=3, + minutes=4, + seconds=5, + microseconds=123525, + start_time=start_time, + end_time=end_time, + ) + if serializer: + trigger = serializer.deserialize(serializer.serialize(trigger)) + + assert repr(trigger) == ( + "IntervalTrigger(weeks=1, days=2, hours=3, minutes=4, seconds=5, " + "microseconds=123525, start_time='2020-05-15 12:55:32.954032+02:00', " + "end_time='2020-06-04 16:18:49.306942+02:00')" + ) diff --git a/harbor/sources/apscheduler-v17/grading/graders.py b/harbor/sources/apscheduler-v17/grading/graders.py new file mode 100644 index 0000000000000000000000000000000000000000..6fee3d036c7fdc74ce02dbf51401cbe466b696e6 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/graders.py @@ -0,0 +1,452 @@ +"""Scoring model for apscheduler_expired_job_lease. + +This module owns the approved rubric (``CRITERIA_SPECS``), the fixture matrix each child is +measured over, and the arithmetic that turns fixture outcomes and the regression wall into the +pinned diagnostic payload. It performs no I/O and runs no candidate code; ``grading.runner`` +gathers the observations. + +Arithmetic (approved grader draft): +- child value: ``all`` matrix -> 1.0 only when every fixture passes; ``fraction`` -> passed / total; +- criterion value = sum(share x child value); raw = sum(weight x criterion value); +- a safety gate fails when its criterion's child value is below 1.0; the build/regression ceiling + fires when the base test wall fails or collects nothing; when any fires, final = min(raw, 0.60) + (shared, fixed, non-stacking); otherwise final = raw. +""" + +from __future__ import annotations + +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +TASK_ID = "apscheduler_expired_job_lease" +CEILING = 0.60 +BUILD_CAP_ID = "build_regression" +HEALTHY = "healthy" +PROBE_FAULT = "probe_infrastructure_failure" +GRADER_EXCEPTION = "grader_exception" +STORES = ("memory", "aiosqlite") + + +def _fixture(name: str, store: str, variant: str | None = None) -> dict[str, Any]: + key = f"{name}:{store}" + (f":{variant}" if variant else "") + return {"key": key, "fixture": name, "store": store, "variant": variant} + + +#: Every probe subprocess the grader runs: one fixture x store x variant. +FIXTURES: tuple[dict[str, Any], ...] = tuple( + [_fixture("takeover", store) for store in STORES] + + [_fixture("expired_claim_missed_deadline", store) for store in STORES] + + [_fixture("stale_release", store, variant) for variant in ("takeover", "cleanup_abandoned", "scheduler_race") for store in STORES] + + [_fixture("renewal_busy_loop", store) for store in STORES] + + [_fixture("renewal_starvation", store) for store in STORES] + + [_fixture("stop_during_acquisition", store, batch) for store in STORES for batch in ("1", "3")] + + [_fixture("unpreparable", store, variant) for store in STORES for variant in ("unimportable", "nofunc")] + + [_fixture("failed_error_release", store) for store in STORES] + + [_fixture("failed_cancel_release", store) for store in STORES] + + [_fixture("extension_failure", store) for store in STORES] + + [_fixture("cancel_during_acquisition", store) for store in STORES] + + [_fixture("preparation_error_tail", store) for store in STORES] + + [_fixture("preparation_cancellation", store) for store in STORES] + + [ + _fixture("interrupted_error_release", store, variant) + for store in STORES + for variant in ("lookup-cancel", "lookup-stop", "unexpected-cancel", "unexpected-stop") + ] + + [_fixture("arbitrary_preparation_failure", store) for store in STORES] + + [_fixture("cancelled_release_failure", store) for store in STORES] + + [_fixture("stale_release_warning", store) for store in STORES] + # Memory store only: the SQLAlchemy store sweeps in one transaction and publishes afterwards, + # so the interleaving C14 measures is not observable there (measured; see the grader draft). + + [_fixture("cleanup_claim_changed", "memory")] + + [_fixture("concurrent_deadline_discard", store) for store in STORES] + + [_fixture("zero_limit", store) for store in STORES] +) + + +def _keys(name: str, variant: str | None = None) -> tuple[str, ...]: + return tuple( + fixture["key"] + for fixture in FIXTURES + if fixture["fixture"] == name and (variant is None or fixture["variant"] == variant) + ) + + +def _child( + child_id: str, + case: str, + share: float, + aggregation: str, + fixture_name: str, + variant: str | None = None, +) -> dict[str, Any]: + return { + "id": child_id, + "case": case, + "share": share, + "aggregation": aggregation, + "fixtures": _keys(fixture_name, variant), + } + + +CRITERIA_SPECS: tuple[dict[str, Any], ...] = ( + { + "id": "expired_claim_takeover", + "weight": 0.001488, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "store_lease_ownership", + "children": ( + _child("takeover_at_capacity_reuses_slot", "C01", 0.39986559, "all", "takeover"), + _child("owner_reacquire_counted_once", "C02", 0.39986559, "all", "takeover"), + _child("expired_claim_past_deadline_discarded", "C23", 0.20026882, "all", "expired_claim_missed_deadline"), + ), + }, + { + "id": "stale_release_ignored", + "weight": 0.000551, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G2", + "group": "store_lease_ownership", + "children": (_child("stale_release_is_noop", "C03", 1.0, "all", "stale_release"),), + }, + { + "id": "acquisition_limit_contract", + "weight": 0.001284, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "store_lease_ownership", + "children": (_child("non_positive_limit_claims_nothing", "C15", 1.0, "all", "zero_limit"),), + }, + { + "id": "running_job_reacquisition", + "weight": 0.064561, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "running_job_renewal", + "children": ( + _child("handed_back_job_runs_once_without_busy_loop", "C04", 0.00425954, "all", "renewal_busy_loop"), + _child("pending_job_not_starved_by_renewals", "C05", 0.99574046, "all", "renewal_starvation"), + ), + }, + { + "id": "stop_during_acquisition_handback", + "weight": 0.200000, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G3", + "group": "stop_safety", + "children": (_child("claimed_jobs_run_by_peer_once", "C06", 1.0, "all", "stop_during_acquisition"),), + }, + { + "id": "cancel_during_acquisition_handback", + "weight": 0.200000, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G4", + "group": "stop_safety", + "children": (_child("cancelled_acquisition_claims_handed_back", "C13", 1.0, "all", "cancel_during_acquisition"),), + }, + { + "id": "unpreparable_job_containment", + "weight": 0.001835, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + "children": ( + _child("unimportable_job_errors_batch_continues", "C07", 0.10027248, "all", "unpreparable", "unimportable"), + _child("no_callable_job_errors_batch_continues", "C16", 0.05013624, "all", "unpreparable", "nofunc"), + _child("failed_error_release_scheduler_survives", "C08", 0.14986376, "all", "failed_error_release"), + _child("failed_error_release_claim_handed_back", "C09", 0.69972752, "all", "failed_error_release"), + ), + }, + { + "id": "stop_failed_release_clean_stop", + "weight": 0.000367, + "evidence_class": "safety", + "is_safety_gate": True, + "gate_id": "G1", + "group": "stop_safety", + "children": (_child("clean_stop_siblings_cancelled", "C10", 1.0, "all", "failed_cancel_release"),), + }, + { + "id": "stop_failed_release_handback", + "weight": 0.001101, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "stop_safety", + "children": (_child("failed_cancel_release_claim_handed_back", "C11", 1.0, "all", "failed_cancel_release"),), + }, + { + "id": "cleanup_claim_integrity", + "weight": 0.322530, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + "children": ( + _child("cleanup_skips_a_claim_that_changed", "C14", 0.00341364, "all", "cleanup_claim_changed"), + _child("concurrent_deadline_discard_is_exactly_once", "C24", 0.99658636, "all", "concurrent_deadline_discard"), + ), + }, + { + "id": "lease_extension_failure_survival", + "weight": 0.000367, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + "children": (_child("extension_resumes_after_failure", "C12", 1.0, "all", "extension_failure"),), + }, + { + "id": "preparation_cancellation_handback", + "weight": 0.190952, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + # The prompt names both interruptions of preparation: an unexpected error (C17) and + # cancellation of the task running the scheduler (C21); each hands back the unstarted tail. + # C22 lands the interruption (cancellation or stop()) inside the error release of a job + # that could not be prepared: that job is claimed and unstarted too, so it is handed back + # unless the release completed and recorded its result. + "children": ( + _child("preparation_error_leaves_no_tail_claims", "C17", 0.01281474, "all", "preparation_error_tail"), + _child("preparation_cancellation_hands_back_unstarted", "C21", 0.33666052, "all", "preparation_cancellation"), + _child("interrupted_error_release_handed_back", "C22", 0.65052474, "all", "interrupted_error_release"), + ), + }, + { + "id": "arbitrary_preparation_isolation", + "weight": 0.006523, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + "children": (_child("unexpected_preparation_error_isolated", "C18", 1.0, "all", "arbitrary_preparation_failure"),), + }, + { + "id": "cancelled_release_containment", + "weight": 0.006015, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "failure_containment", + "children": (_child("cancelled_release_failure_isolated", "C19", 1.0, "all", "cancelled_release_failure"),), + }, + { + "id": "stale_release_observability", + "weight": 0.002426, + "evidence_class": "functional", + "is_safety_gate": False, + "group": "store_lease_ownership", + "children": (_child("stale_release_logs_warning", "C20", 1.0, "all", "stale_release_warning"),), + }, +) + +#: Difficulty budget class per case: the 2026-09-23 de-concentration refit over jobs +#: 9084c34f (4 valid traces) and 71bb9800 (2 valid traces) classifies cases failed at +#: least once as `difficult` and never-failed cases as `easy`; the approved Case +#: inventory classification preceded it. +CASE_BUDGET_CLASS = { + "C01": "easy", "C02": "easy", "C03": "easy", "C04": "easy", "C05": "difficult", "C06": "difficult", + "C07": "easy", "C08": "easy", "C09": "easy", "C10": "easy", "C11": "easy", "C12": "easy", + "C13": "difficult", "C14": "easy", "C15": "easy", "C16": "easy", "C17": "easy", "C18": "easy", + "C19": "easy", "C20": "easy", "C21": "difficult", "C22": "easy", "C23": "easy", "C24": "difficult", +} + + +def case_weights() -> list[dict[str, Any]]: + """One record per implemented child: its case and absolute weight (criterion weight x share).""" + return [ + { + "criterion": spec["id"], + "child": child["id"], + "case": child["case"], + "criterion_weight": spec["weight"], + "share": child["share"], + "absolute_weight": round(spec["weight"] * child["share"], 6), + } + for spec in CRITERIA_SPECS + for child in spec["children"] + ] + + +def _round(value: float) -> float: + return round(float(value), 6) + + +def child_value(child: dict[str, Any], fixture_cases: dict[str, dict[str, Any]]) -> tuple[float, list[dict[str, Any]]]: + """Aggregate one child over its fixture matrix; a missing observation counts as a failure.""" + rows: list[dict[str, Any]] = [] + for key in child["fixtures"]: + observation = (fixture_cases.get(key) or {}).get(child["case"]) + if not isinstance(observation, dict): + rows.append({"fixture": key, "passed": False, "diagnostic": f"{key}: no observation for {child['case']}", "observed": {}}) + continue + rows.append({ + "fixture": key, + "passed": observation.get("passed") is True, + "diagnostic": str(observation.get("diagnostic") or ""), + "observed": observation.get("observed") if isinstance(observation.get("observed"), dict) else {}, + }) + passed = sum(1 for row in rows if row["passed"]) + if not rows: + return 0.0, rows + if child["aggregation"] == "fraction": + return _round(passed / len(rows)), rows + return (1.0 if passed == len(rows) else 0.0), rows + + +def _child_payload(spec: dict[str, Any], child: dict[str, Any], value: float, rows: list[dict[str, Any]], fault: str | None = None) -> dict[str, Any]: + failing = next((row["diagnostic"] or f"{row['fixture']}: failed" for row in rows if not row["passed"]), "") + diagnostic = fault or ("" if value >= 1.0 else failing or f"{child['case']} did not pass") + diagnostics: dict[str, Any] = {"aggregation": child["aggregation"], "fixtures": rows} + if fault: + diagnostics["fault"] = fault + return { + "id": child["id"], + "case_id": child["case"], + "value": value, + "weight": child["share"], + "share": child["share"], + "passed": value >= 1.0, + "contribution": _round(spec["weight"] * child["share"] * value), + "diagnostic": diagnostic, + "diagnostics": diagnostics, + } + + +def _criteria_rows(fixture_cases: dict[str, dict[str, Any]] | None, fault: str | None = None) -> list[dict[str, Any]]: + rows: list[dict[str, Any]] = [] + for spec in CRITERIA_SPECS: + children = [] + for child in spec["children"]: + if fault is None: + value, observations = child_value(child, fixture_cases or {}) + else: + value, observations = 0.0, [] + children.append(_child_payload(spec, child, value, observations, fault)) + value = 0.0 if fault else _round(sum(child["share"] * child["value"] for child in children)) + rows.append({ + "id": spec["id"], + "value": min(value, 1.0), + "weight": spec["weight"], + "evidence_class": spec["evidence_class"], + "is_safety_gate": spec["is_safety_gate"], + "gate_id": spec.get("gate_id"), + "children": children, + }) + return rows + + +def _subscores(criteria: list[dict[str, Any]]) -> list[SubScore]: + return [ + SubScore( + name=row["id"], + value=row["value"], + weight=row["weight"], + info={ + "id": row["id"], + "evidence_class": row["evidence_class"], + "is_safety_gate": row["is_safety_gate"], + "gate_id": row["gate_id"], + "children": row["children"], + }, + ) + for row in criteria + ] + + +def compute_evaluation_result( + fixture_cases: dict[str, dict[str, Any]], + regression_wall: dict[str, Any], + extra_info: dict[str, Any] | None = None, +) -> EvaluationResult: + """Healthy grade from real fixture observations and the regression wall outcome.""" + criteria = _criteria_rows(fixture_cases) + raw = _round(sum(row["weight"] * row["value"] for row in criteria)) + caps: list[dict[str, Any]] = [] + gate_statuses: dict[str, bool] = {} + for row in criteria: + if not row["is_safety_gate"]: + continue + passed = all(child["value"] >= 1.0 for child in row["children"]) + gate_statuses[row["gate_id"]] = passed + if not passed: + caps.append({ + "id": row["gate_id"], + "cap": CEILING, + "ceiling": CEILING, + "reason": f"{row['id']}: " + "; ".join(child["case_id"] for child in row["children"] if child["value"] < 1.0), + }) + build_failed = not (regression_wall.get("passed") is True and int(regression_wall.get("collected") or 0) > 0) + if build_failed: + failing = regression_wall.get("failing_tests") or [] + reason = regression_wall.get("classification") or "failed" + caps.append({ + "id": BUILD_CAP_ID, + "cap": CEILING, + "ceiling": CEILING, + "reason": f"base test wall {reason}: {regression_wall.get('failed', 0)} failed, " + f"{regression_wall.get('errors', 0)} errors, {regression_wall.get('collected', 0)} collected" + + (f"; first failing: {', '.join(failing[:3])}" if failing else ""), + }) + failed_gates = sorted(gate for gate, passed in gate_statuses.items() if not passed) + final = _round(min(raw, CEILING)) if caps else raw + info: dict[str, Any] = { + "task_id": TASK_ID, + "raw_score": raw, + "final_score": final, + "caps": caps, + "grader_health": HEALTHY, + "criteria": criteria, + "group_contributions": {row["id"]: _round(row["weight"] * row["value"]) for row in criteria}, + "gate_statuses": gate_statuses, + "failed_gates": failed_gates, + # True only when a failing safety gate's ceiling lowered the score (raw above the ceiling); + # a gate failing under partial credit alone is reported in `failed_gates`, not here. + "safety_gates_failed": bool(failed_gates) and raw > CEILING, + "build_failed": build_failed, + "regression_wall": regression_wall, + "ceiling_policy": {"ceiling": CEILING, "stacking": "min", "gates": sorted(gate_statuses)}, + } + if extra_info: + info.update(extra_info) + return EvaluationResult( + reward=final, + done=True, + isError=False, + content=f"raw {raw:.4f}, final {final:.4f}, caps {[cap['id'] for cap in caps]}", + info=info, + subscores=_subscores(criteria), + ) + + +def fault_result(health: str, reason: str, extra_info: dict[str, Any] | None = None) -> EvaluationResult: + """Fail-closed grade: zero scores, an error flag, non-healthy health, and no invented caps.""" + if health == HEALTHY: + health = GRADER_EXCEPTION + fault = f"{health}: {reason}"[:300] + criteria = _criteria_rows(None, fault=fault) + info: dict[str, Any] = { + "task_id": TASK_ID, + "raw_score": 0.0, + "final_score": 0.0, + "caps": [], + "grader_health": health, + "grader_health_reason": reason[:300], + "criteria": criteria, + "group_contributions": {row["id"]: 0.0 for row in criteria}, + "gate_statuses": {}, + "failed_gates": [], + "safety_gates_failed": None, + "build_failed": None, + "regression_wall": {}, + } + if extra_info: + info.update(extra_info) + return EvaluationResult( + reward=0.0, + done=True, + isError=True, + content=f"grader fault ({health}); the measurement is invalid", + info=info, + subscores=_subscores(criteria), + ) diff --git a/harbor/sources/apscheduler-v17/grading/probes/probe_cases.py b/harbor/sources/apscheduler-v17/grading/probes/probe_cases.py new file mode 100644 index 0000000000000000000000000000000000000000..3bf356b22009b3a03119385b49fc49d81b91a486 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/probes/probe_cases.py @@ -0,0 +1,1610 @@ +"""Behavioural probe fixtures for apscheduler_expired_job_lease (cases C01-C24). + +Every fixture drives the candidate only through the public ``AsyncScheduler`` and ``DataStore`` +methods the task prompt names. Lease lapses are produced by moving the wall clock with +time-machine; failures are injected by store subclasses that override public methods and call +``super()``. Waits are bounded by ``anyio.fail_after`` deadlines far below the leases in force, so a +candidate that never does the work fails on an explicit observation instead of a hang. + +A fixture returns ``{case_id: {"passed", "diagnostic", "observed"}}``. Exceptions raised by candidate +code are candidate behaviour and fail the case; only ``ProbeInfrastructureError`` (grader-owned +setup such as the SQLite engine) is a grader fault. +""" + +from __future__ import annotations + +import logging +from collections import Counter +from collections.abc import Awaitable, Callable +from contextlib import AsyncExitStack +from datetime import UTC, datetime, timedelta +from pathlib import Path +from typing import Any +from uuid import UUID, uuid4 + +import anyio +import time_machine + +LEASE = timedelta(seconds=30) +RESULT_TTL = timedelta(minutes=10) +PEER_DEADLINE = 3.0 +POLL_INTERVAL = 0.02 +T0 = datetime(2031, 3, 4, 12, 0, tzinfo=UTC) +UNIMPORTABLE_FUNC = "nonexistent_probe_module:func" + + +class ProbeInfrastructureError(RuntimeError): + """Grader-owned setup failed; the measurement is invalid, not a candidate failure.""" + + +def _describe(exc: BaseException) -> str: + """Class and message of an exception; an exception group is described by its first leaf.""" + while isinstance(exc, BaseExceptionGroup) and exc.exceptions: + exc = exc.exceptions[0] + message = str(exc).replace("\n", " ")[:160] + return f"{type(exc).__name__}: {message}" if message else type(exc).__name__ + + +class Case: + """Accumulates the assertions of one case; the first failing one becomes its diagnostic.""" + + def __init__(self, case_id: str, label: str) -> None: + self.case_id = case_id + self.label = label + self.failures: list[str] = [] + self.observed: dict[str, Any] = {} + CASES[case_id] = self + + def expect(self, name: str, condition: bool, observed: Any) -> bool: + self.observed[name] = observed + if not condition: + self.failures.append(f"{self.label}: {name} (observed {observed!r})") + return bool(condition) + + def fail(self, message: str) -> None: + self.failures.append(f"{self.label}: {message}") + + def result(self) -> dict[str, Any]: + if not self.failures and not self.observed: + self.failures.append(f"{self.label}: no observation was recorded") + return { + "passed": not self.failures, + "diagnostic": self.failures[0] if self.failures else "", + "observed": {key: _jsonable(value) for key, value in self.observed.items()}, + } + + +def _jsonable(value: Any) -> Any: + if isinstance(value, str | int | float | bool) or value is None: + return value + if isinstance(value, list | tuple): + return [_jsonable(item) for item in value] + if isinstance(value, dict): + return {str(key): _jsonable(item) for key, item in value.items()} + return str(value) + + +# --------------------------------------------------------------------------- shared job state +# Job functions are module-level so that a second scheduler resolves them by reference without +# reconfiguring the task (which would reset the task's running-job counter in some stores). + +STATE: dict[str, Any] = {} +#: Cases created by the running fixture, kept so an exception escaping the fixture (typically a +#: scheduler crash re-raised when its context exits) still reports what was observed before it. +CASES: dict[str, Case] = {} + + +def _event(name: str) -> anyio.Event: + if name not in STATE: + STATE[name] = anyio.Event() + return STATE[name] + + +def _log() -> list[tuple[str, str]]: + return STATE.setdefault("log", []) + + +def _current_identity() -> str: + from apscheduler import current_async_scheduler + + return current_async_scheduler.get().identity + + +def _current_job_tag() -> str: + from apscheduler import current_job + + return str(current_job.get().id) + + +async def contested_job() -> str: + identity = _current_identity() + _log().append((identity, _current_job_tag())) + _event(f"entered:{identity}").set() + await _event(f"gate:{identity}").wait() + _event(f"exited:{identity}").set() + return identity + + +async def gated_job(name: str) -> str: + _log().append((name, _current_job_tag())) + _event(f"entered:{name}").set() + await _event(f"gate:{name}").wait() + return name + + +async def quick_job(name: str) -> str: + _log().append((name, _current_job_tag())) + _event(f"entered:{name}").set() + return name + + +async def handoff_job() -> str: + identity = _current_identity() + _log().append((identity, _current_job_tag())) + return identity + + +async def long_job(name: str) -> None: + _log().append((name, _current_job_tag())) + _event(f"entered:{name}").set() + await anyio.sleep(60) + + +async def extension_job() -> str: + await _event("extended_after_failure").wait() + return "extended" + + +# --------------------------------------------------------------------------- stores + + +def instrumented_store_class(base_cls: type) -> type: + """A subclass of the candidate store whose public methods can be observed or made to fail.""" + + class ProbeStore(base_cls): # type: ignore[misc, valid-type] + probe: dict[str, Any] = { + "acquire_calls": 0, + "counting": False, + "window_calls": 0, + "after_acquire": None, + "release_fail_ids": frozenset(), + "release_failures": 0, + "extend_failures_left": 0, + "extend_raised": 0, + "extend_after_failure": 0, + "get_task_fail_ids": frozenset(), + "get_task_fail_enabled": False, + "get_task_block_ids": frozenset(), + "get_task_block_call": 0, + "get_task_calls": 0, + "release_block_ids": frozenset(), + "release_block_calls": 0, + } + + async def acquire_jobs(self, scheduler_id, lease_duration, limit=None): + probe = type(self).probe + probe["acquire_calls"] += 1 + if probe["counting"]: + probe["window_calls"] += 1 + jobs = await super().acquire_jobs(scheduler_id, lease_duration, limit) + hook = probe["after_acquire"] + if hook is not None: + jobs = await hook(self, scheduler_id, list(jobs)) + return jobs + + async def release_job(self, scheduler_id, job, result): + probe = type(self).probe + if job.id in probe["release_fail_ids"]: + probe["release_failures"] += 1 + raise RuntimeError("probe: injected release failure") + if job.id in probe["release_block_ids"]: + probe["release_block_calls"] += 1 + if probe["release_block_calls"] == 1: + _event("release_blocked").set() + await _event("release_unblock").wait() + return await super().release_job(scheduler_id, job, result) + + async def get_task(self, task_id): + probe = type(self).probe + task = await super().get_task(task_id) + if probe["get_task_fail_enabled"] and task_id in probe["get_task_fail_ids"]: + raise RuntimeError("probe: injected task preparation failure") + if task_id in probe["get_task_block_ids"]: + probe["get_task_calls"] += 1 + if probe["get_task_calls"] == probe["get_task_block_call"]: + _event("preparation_blocked").set() + await _event("preparation_unblock").wait() + return task + + async def extend_acquired_job_leases(self, scheduler_id, job_ids, duration): + probe = type(self).probe + if probe["extend_failures_left"] > 0 and duration > timedelta(0): + probe["extend_failures_left"] -= 1 + probe["extend_raised"] += 1 + raise RuntimeError("probe: injected lease extension failure") + outcome = await super().extend_acquired_job_leases(scheduler_id, job_ids, duration) + if probe["extend_raised"] and duration > timedelta(0) and job_ids: + probe["extend_after_failure"] += 1 + _event("extended_after_failure").set() + return outcome + + ProbeStore.probe = dict(ProbeStore.probe) + return ProbeStore + + +class StoreFactory: + """Creates candidate stores of one kind; engines are grader-owned infrastructure.""" + + def __init__(self, kind: str, workdir: Path) -> None: + self.kind = kind + self.workdir = workdir + self.engines: list[Any] = [] + self.db_path = workdir / f"probe-{uuid4().hex}.db" + + def store_class(self) -> type: + if self.kind == "memory": + from apscheduler.datastores.memory import MemoryDataStore + + return MemoryDataStore + from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore + + return SQLAlchemyDataStore + + async def engine(self) -> Any: + try: + from sqlalchemy import text + from sqlalchemy.ext.asyncio import create_async_engine + + engine = create_async_engine(f"sqlite+aiosqlite:///{self.db_path}") + async with engine.connect() as conn: + await conn.execute(text("SELECT 1")) + except Exception as exc: # noqa: BLE001 - grader-owned setup + raise ProbeInfrastructureError(f"aiosqlite engine unavailable: {_describe(exc)}") from exc + self.engines.append(engine) + return engine + + async def create(self, cls: type | None = None) -> Any: + cls = cls or self.store_class() + if self.kind == "memory": + return cls() + return cls(await self.engine()) + + async def dispose(self) -> None: + for engine in self.engines: + try: + await engine.dispose() + except Exception: # noqa: BLE001 - disposal is best effort + pass + + +async def started_store(stack: AsyncExitStack, store: Any) -> Any: + from apscheduler.eventbrokers.local import LocalEventBroker + + broker = LocalEventBroker() + logger = logging.getLogger("apscheduler.probe") + await broker.start(stack, logger) + await store.start(stack, broker, logger) + return store + + +async def running_jobs(store: Any, task_id: str) -> Any: + return (await store.get_task(task_id)).running_jobs + + +async def wait_result(store: Any, job_id: UUID, deadline: float = PEER_DEADLINE) -> Any: + """Poll the store for a job result (reading consumes it); ``None`` when the deadline passes.""" + with anyio.move_on_after(deadline): + while True: + result = await store.get_job_result(job_id) + if result is not None: + return result + await anyio.sleep(POLL_INTERVAL) + return None + + +async def wait_event(name: str, deadline: float = PEER_DEADLINE) -> bool: + with anyio.move_on_after(deadline): + await _event(name).wait() + return True + return False + + +async def peer_acquires(store: Any, job_id: UUID, deadline: float = PEER_DEADLINE) -> tuple[bool, float | None, int]: + """Poll ``acquire_jobs("peer", 30 s, 10)`` until it returns ``job_id``; returns (seen, seconds, polls).""" + started = anyio.current_time() + polls = 0 + with anyio.move_on_after(deadline): + while True: + polls += 1 + jobs = await store.acquire_jobs("peer", LEASE, 10) + if any(job.id == job_id for job in jobs): + return True, round(anyio.current_time() - started, 3), polls + await anyio.sleep(POLL_INTERVAL) + return False, None, polls + + +async def peer_acquires_all(store: Any, job_ids: list[Any], deadline: float = PEER_DEADLINE) -> tuple[list[str], float | None, int]: + """Poll ``acquire_jobs("peer", 30 s, 10)`` until every id has been handed to the peer.""" + started = anyio.current_time() + seen: set[str] = set() + wanted = {str(job_id) for job_id in job_ids} + polls = 0 + with anyio.move_on_after(deadline): + while not wanted <= seen: + polls += 1 + for job in await store.acquire_jobs("peer", LEASE, 10): + seen.add(str(job.id)) + if wanted <= seen: + return sorted(seen), round(anyio.current_time() - started, 3), polls + await anyio.sleep(POLL_INTERVAL) + return sorted(seen), None, polls + + +def outcome_name(result: Any) -> str | None: + if result is None: + return None + outcome = getattr(result, "outcome", None) + return getattr(outcome, "name", str(outcome)) + + +async def guarded(case: Case, step: str, coro: Awaitable[Any]) -> tuple[bool, Any]: + """Await one candidate-facing step; an exception from candidate code fails the case.""" + try: + return True, await coro + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + case.fail(f"{step} raised {_describe(exc)}") + return False, None + + +def _new_job(task_id: str) -> Any: + from apscheduler import Job + + return Job(task_id=task_id, executor="async", result_expiration_time=RESULT_TTL) + + +def _new_task(task_id: str, *, func: str | None = None, max_running_jobs: int | None = None) -> Any: + from apscheduler import Task + + return Task(id=task_id, func=func, job_executor="async", max_running_jobs=max_running_jobs) + + +def _ids(jobs: Any) -> list[str]: + return [str(job.id) for job in jobs or []] + + +def _scheduler(store: Any, identity: str, **kwargs: Any) -> Any: + from apscheduler import AsyncScheduler + + kwargs.setdefault("cleanup_interval", None) + return AsyncScheduler(data_store=store, identity=identity, **kwargs) + + +def _state_name(scheduler: Any) -> str: + return getattr(scheduler.state, "name", str(scheduler.state)) + + +def _is_started(scheduler: Any) -> bool: + from apscheduler import RunState + + return scheduler.state is RunState.started + + +# --------------------------------------------------------------------------- C01 / C02 + + +async def fixture_takeover(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + c01 = Case("C01", f"takeover[{factory.kind}]") + c02 = Case("C02", f"owner-reacquire[{factory.kind}]") + from apscheduler import JobOutcome, JobResult + + for case, scenario in ((c01, "takeover"), (c02, "reacquire")): + async with AsyncExitStack() as stack: + store = await started_store(stack, await factory.create()) + task_id = f"lease-slot-{scenario}" + with time_machine.travel(T0, tick=False) as clock: + ok, _ = await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=1))) + job = _new_job(task_id) + ok = ok and (await guarded(case, "add_job", store.add_job(job)))[0] + if not ok: + continue + ok, first = await guarded(case, "acquire_jobs(w1)", store.acquire_jobs("w1", LEASE, 10)) + if not ok or not case.expect("w1 initially receives the job", _ids(first) == [str(job.id)], _ids(first)): + continue + clock.shift(31) + claimant = "w2" if scenario == "takeover" else "w1" + ok, taken = await guarded(case, f"acquire_jobs({claimant}) after lapse", store.acquire_jobs(claimant, LEASE, 10)) + if not ok: + continue + case.expect(f"{claimant} receives the lapsed job", _ids(taken) == [str(job.id)], _ids(taken)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs after the lapsed claim is taken", count == 1, count) + outsider = "w3" if scenario == "takeover" else "w2" + ok, others = await guarded(case, f"acquire_jobs({outsider})", store.acquire_jobs(outsider, LEASE, 10)) + if ok: + case.expect(f"{outsider} receives nothing while the new lease is live", _ids(others) == [], _ids(others)) + if scenario == "takeover" and taken: + held = next(item for item in taken if item.id == job.id) if any(i.id == job.id for i in taken) else None + if held is None: + continue + result = JobResult.from_job(held, JobOutcome.success, return_value="w2") + ok, _ = await guarded(case, "release_job(w2)", store.release_job("w2", held, result)) + if not ok: + continue + ok, remaining = await guarded(case, "get_jobs", store.get_jobs()) + if ok: + case.expect("job removed after the holder's release", _ids(remaining) == [], _ids(remaining)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs after the holder's release", count == 0, count) + return {"C01": c01.result(), "C02": c02.result()} + + +# --------------------------------------------------------------------------- C23 + + +async def fixture_expired_claim_missed_deadline(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """An expired claim whose start deadline passed is discarded, not retaken.""" + case = Case("C23", f"expired-claim-missed-deadline[{factory.kind}]") + from apscheduler import Job, JobOutcome, JobResult + + async with AsyncExitStack() as stack: + store = await started_store(stack, await factory.create()) + task_id = "expired-claim-deadline" + with time_machine.travel(T0, tick=False) as clock: + if not (await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=2))))[0]: + return {"C23": case.result()} + job = Job( + task_id=task_id, + executor="async", + start_deadline=T0 + timedelta(seconds=60), + result_expiration_time=RESULT_TTL, + ) + if not (await guarded(case, "add_job", store.add_job(job)))[0]: + return {"C23": case.result()} + ok, acquired = await guarded(case, "acquire_jobs(w1)", store.acquire_jobs("w1", LEASE, 1)) + if not ok or not case.expect("w1 initially receives the job", _ids(acquired) == [str(job.id)], _ids(acquired)): + return {"C23": case.result()} + + clock.shift(61) + for attempt in range(3): + ok, handed_out = await guarded( + case, + f"acquire_jobs(w2) after deadline attempt {attempt + 1}", + store.acquire_jobs("w2", LEASE, 10), + ) + if not ok: + return {"C23": case.result()} + case.expect( + f"expired job is not handed to w2 on attempt {attempt + 1}", + _ids(handed_out) == [], + _ids(handed_out), + ) + ok, remaining = await guarded(case, "get_jobs", store.get_jobs()) + if ok: + case.expect("expired job is removed", _ids(remaining) == [], _ids(remaining)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs is decremented exactly once", count == 0, count) + + ok, result = await guarded(case, "get_job_result", store.get_job_result(job.id)) + if ok: + case.expect( + "expired job records missed_start_deadline", + result is not None and result.outcome is JobOutcome.missed_start_deadline, + outcome_name(result), + ) + if acquired: + now = datetime.now(UTC) + stale = JobResult.from_job( + acquired[0], JobOutcome.success, finished_at=now, return_value="stale" + ) + ok, _ = await guarded(case, "release_job(w1) stale release", store.release_job("w1", acquired[0], stale)) + if ok: + ok, count = await guarded(case, "get_task after stale release", running_jobs(store, task_id)) + if ok: + case.expect("stale release does not decrement again", count == 0, count) + + return {"C23": case.result()} + + +# --------------------------------------------------------------------------- C03 + + +async def fixture_stale_release(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + case = Case("C03", f"stale-release[{factory.kind}/{variant}]") + if variant == "scheduler_race": + await _stale_release_scheduler_race(factory, case) + return {"C03": case.result()} + + from apscheduler import JobOutcome, JobResult + + async with AsyncExitStack() as stack: + store = await started_store(stack, await factory.create()) + task_id = f"stale-{variant}" + with time_machine.travel(T0, tick=False) as clock: + if not (await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=1))))[0]: + return {"C03": case.result()} + job = _new_job(task_id) + if not (await guarded(case, "add_job", store.add_job(job)))[0]: + return {"C03": case.result()} + ok, first = await guarded(case, "acquire_jobs(w1)", store.acquire_jobs("w1", LEASE, 10)) + if not ok or not case.expect("w1 initially receives the job", _ids(first) == [str(job.id)], _ids(first)): + return {"C03": case.result()} + w1_job = first[0] + clock.shift(31) + if variant == "takeover": + ok, taken = await guarded(case, "acquire_jobs(w2) after lapse", store.acquire_jobs("w2", LEASE, 10)) + if not ok or not case.expect("w2 takes over the lapsed job", _ids(taken) == [str(job.id)], _ids(taken)): + return {"C03": case.result()} + w2_job = taken[0] + stale = JobResult.from_job(w1_job, JobOutcome.success, return_value="w1") + if not (await guarded(case, "stale release_job(w1)", store.release_job("w1", w1_job, stale)))[0]: + return {"C03": case.result()} + ok, listed = await guarded(case, "get_jobs", store.get_jobs()) + if ok: + case.expect("job still listed after the stale release", str(job.id) in _ids(listed), _ids(listed)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs unchanged by the stale release", count == 1, count) + ok, recorded = await guarded(case, "get_job_result", store.get_job_result(job.id)) + if ok: + case.expect("no result recorded by the stale release", recorded is None, outcome_name(recorded)) + holder = JobResult.from_job(w2_job, JobOutcome.success, return_value="w2") + if not (await guarded(case, "release_job(w2)", store.release_job("w2", w2_job, holder)))[0]: + return {"C03": case.result()} + ok, recorded = await guarded(case, "get_job_result", store.get_job_result(job.id)) + if ok: + value = getattr(recorded, "return_value", None) + case.expect("the holder's result is recorded", value == "w2", value) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs after the holder's release", count == 0, count) + else: # cleanup_abandoned + if not (await guarded(case, "cleanup", store.cleanup()))[0]: + return {"C03": case.result()} + stale = JobResult.from_job(w1_job, JobOutcome.success, return_value="w1") + if not (await guarded(case, "stale release_job(w1)", store.release_job("w1", w1_job, stale)))[0]: + return {"C03": case.result()} + ok, recorded = await guarded(case, "get_job_result", store.get_job_result(job.id)) + if ok: + name = outcome_name(recorded) + case.expect("the abandoned result is kept", name == "abandoned", name) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs after abandonment and the stale release", count == 0, count) + return {"C03": case.result()} + + +async def _stale_release_scheduler_race(factory: StoreFactory, case: Case) -> None: + STATE.clear() + store = await factory.create() + with time_machine.travel(T0, tick=True) as clock: + first = _scheduler(store, "a", lease_duration=LEASE) + async with first: + if not (await guarded(case, "configure_task", first.configure_task("contested", func=contested_job)))[0]: + return + ok, job_id = await guarded(case, "add_job", first.add_job("contested", result_expiration_time=RESULT_TTL)) + if not ok or not (await guarded(case, "start_in_background(a)", first.start_in_background()))[0]: + return + if not case.expect("scheduler a starts the job", await wait_event("entered:a"), False): + return + clock.shift(31) + second = _scheduler(store, "b", lease_duration=LEASE) + async with second: + if not (await guarded(case, "start_in_background(b)", second.start_in_background()))[0]: + return + if not case.expect("scheduler b takes over the lapsed job", await wait_event("entered:b"), False): + return + _event("gate:b").set() + result = await wait_result(store, job_id) + value = getattr(result, "return_value", None) + if not case.expect("scheduler b's result is recorded", value == "b", value): + return + _event("gate:a").set() + if not case.expect("scheduler a's run finishes", await wait_event("exited:a"), False): + return + await anyio.sleep(0.3) + late = await guarded(case, "get_job_result after the stale release", store.get_job_result(job_id)) + if late[0]: + case.expect("no result replaces b's after a's stale release", late[1] is None, getattr(late[1], "return_value", None)) + case.expect("scheduler a keeps running", _is_started(first), _state_name(first)) + case.expect("scheduler b keeps running", _is_started(second), _state_name(second)) + ok, count = await guarded(case, "get_task", running_jobs(store, "contested")) + if ok: + case.expect("running_jobs after both releases", count == 0, count) + + +# --------------------------------------------------------------------------- C04 / C05 + + +async def fixture_renewal_busy_loop(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + case = Case("C04", f"renewal-no-busy-loop[{factory.kind}]") + STATE.clear() + from apscheduler import JobAdded + + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + with time_machine.travel(T0, tick=True) as clock: + scheduler = _scheduler(store, "renewer", max_concurrent_jobs=2, lease_duration=timedelta(seconds=60)) + async with scheduler: + for task_id, func in (("renew-j1", gated_job), ("renew-j2", quick_job)): + if not (await guarded(case, "configure_task", scheduler.configure_task(task_id, func=func)))[0]: + return {"C04": case.result()} + if not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {"C04": case.result()} + ok, j1 = await guarded(case, "add_job(J1)", scheduler.add_job("renew-j1", args=("j1",), result_expiration_time=RESULT_TTL)) + if not ok or not case.expect("J1 starts", await wait_event("entered:j1"), False): + return {"C04": case.result()} + clock.shift(61) + + async def hand_back_again(self: Any, scheduler_id: str, jobs: list[Any]) -> list[Any]: + if scheduler_id == "renewer" and not any(job.id == j1 for job in jobs): + jobs = list(await self.get_jobs([j1])) + jobs + return jobs + + probe["after_acquire"] = hand_back_again + probe["counting"] = True + probe["window_calls"] = 0 + await scheduler.event_broker.publish(JobAdded(job_id=uuid4(), task_id="renew-probe-wakeup", schedule_id=None)) + await anyio.sleep(0.5) + probe["counting"] = False + probe["after_acquire"] = None + case.expect("acquire_jobs calls in the 0.5 s window", probe["window_calls"] <= 10, probe["window_calls"]) + _event("gate:j1").set() + r1 = await wait_result(store, j1) + ok, j2 = await guarded(case, "add_job(J2)", scheduler.add_job("renew-j2", args=("j2",), result_expiration_time=RESULT_TTL)) + r2 = await wait_result(store, j2) if ok else None + entries = Counter(name for name, _ in _log()) + case.expect("J1 entered exactly once", entries["j1"] == 1, entries["j1"]) + case.expect("J1 outcome", outcome_name(r1) == "success", outcome_name(r1)) + case.expect("J2 outcome", outcome_name(r2) == "success", outcome_name(r2)) + case.expect("scheduler keeps running", _is_started(scheduler), _state_name(scheduler)) + for task_id in ("renew-j1", "renew-j2"): + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect(f"running_jobs of {task_id}", count == 0, count) + return {"C04": case.result()} + + +async def fixture_renewal_starvation(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + case = Case("C05", f"renewal-no-starvation[{factory.kind}]") + STATE.clear() + store = await factory.create() + with time_machine.travel(T0, tick=True) as clock: + scheduler = _scheduler(store, "renewer", max_concurrent_jobs=3, lease_duration=timedelta(seconds=60)) + async with scheduler: + for task_id, func in (("starve-j1", gated_job), ("starve-j2", gated_job), ("starve-j3", quick_job)): + if not (await guarded(case, "configure_task", scheduler.configure_task(task_id, func=func)))[0]: + return {"C05": case.result()} + if not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {"C05": case.result()} + ids: dict[str, Any] = {} + for name in ("j1", "j2"): + ok, ids[name] = await guarded(case, f"add_job({name})", scheduler.add_job(f"starve-{name}", args=(name,), result_expiration_time=RESULT_TTL)) + if not ok or not case.expect(f"{name.upper()} starts", await wait_event(f"entered:{name}"), False): + return {"C05": case.result()} + clock.shift(61) + ok, ids["j3"] = await guarded(case, "add_job(J3)", scheduler.add_job("starve-j3", args=("j3",), result_expiration_time=RESULT_TTL)) + if not ok: + return {"C05": case.result()} + j3_started = await wait_event("entered:j3") + case.expect("J3 starts with no event other than its own add_job", j3_started, j3_started) + _event("gate:j1").set() + _event("gate:j2").set() + results = {name: await wait_result(store, job_id) for name, job_id in ids.items() if name != "j3" or j3_started} + entries = Counter(name for name, _ in _log()) + case.expect("J1 entered exactly once", entries["j1"] == 1, entries["j1"]) + case.expect("J2 entered exactly once", entries["j2"] == 1, entries["j2"]) + for name in ("j1", "j2", "j3"): + observed = outcome_name(results.get(name)) + case.expect(f"{name.upper()} outcome", observed == "success", observed) + return {"C05": case.result()} + + +# --------------------------------------------------------------------------- C06 + + +async def fixture_stop_during_acquisition(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + batch = int(variant or "1") + case = Case("C06", f"stop-during-acquisition[{factory.kind}/batch {batch}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + claimed, unblock = anyio.Event(), anyio.Event() + + async def block_after_claim(self: Any, scheduler_id: str, jobs: list[Any]) -> list[Any]: + if scheduler_id == "first" and jobs: + probe["after_acquire"] = None + claimed.set() + await unblock.wait() + return jobs + + first = _scheduler(store, "first", max_concurrent_jobs=10, lease_duration=LEASE) + job_ids: list[Any] = [] + stopped = anyio.Event() + async with first: + if not (await guarded(case, "configure_task", first.configure_task("handoff", func=handoff_job, max_running_jobs=10)))[0]: + return {"C06": case.result()} + for _ in range(batch): + ok, job_id = await guarded(case, "add_job", first.add_job("handoff", result_expiration_time=RESULT_TTL)) + if not ok: + return {"C06": case.result()} + job_ids.append(job_id) + probe["after_acquire"] = block_after_claim + from apscheduler import SchedulerStopped + + first.subscribe(lambda _event: stopped.set(), {SchedulerStopped}) + if not (await guarded(case, "start_in_background(first)", first.start_in_background()))[0]: + return {"C06": case.result()} + with anyio.move_on_after(PEER_DEADLINE): + await claimed.wait() + if not case.expect("the batch is claimed while acquire_jobs is in progress", claimed.is_set(), False): + unblock.set() + return {"C06": case.result()} + await guarded(case, "stop()", first.stop()) + unblock.set() + with anyio.move_on_after(5): + await stopped.wait() + case.expect("scheduler first stops", stopped.is_set(), _state_name(first)) + ran_by_first = [tag for identity, tag in _log() if identity == "first"] + case.expect("identity first ran no claimed job", ran_by_first == [], len(ran_by_first)) + for job_id in job_ids: + ok, recorded = await guarded(case, "get_job_result before the peer starts", store.get_job_result(job_id)) + if ok: + case.expect("no result recorded for a claimed but unstarted job", recorded is None, outcome_name(recorded)) + peer = _scheduler(store, "second", max_concurrent_jobs=10, lease_duration=LEASE) + async with peer: + if not (await guarded(case, "start_in_background(second)", peer.start_in_background()))[0]: + return {"C06": case.result()} + results: dict[Any, Any] = {} + with anyio.move_on_after(PEER_DEADLINE): + while len(results) < len(job_ids): + for job_id in job_ids: + if job_id not in results: + recorded = await store.get_job_result(job_id) + if recorded is not None: + results[job_id] = recorded + await anyio.sleep(POLL_INTERVAL) + runs = Counter(tag for identity, tag in _log() if identity == "second") + for index, job_id in enumerate(job_ids): + case.expect(f"job {index} run once by the peer", runs[str(job_id)] == 1, runs[str(job_id)]) + observed = outcome_name(results.get(job_id)) + case.expect(f"job {index} outcome under the peer within {PEER_DEADLINE:g} s", observed == "success", observed) + ok, count = await guarded(case, "get_task", running_jobs(store, "handoff")) + if ok: + case.expect("running_jobs after the peer's releases", count == 0, count) + return {"C06": case.result()} + + +# --------------------------------------------------------------------------- C07 / C08 / C09 + + +async def _add_bad_task(store: Any, variant: str) -> None: + func = UNIMPORTABLE_FUNC if variant == "unimportable" else None + await store.add_task(_new_task("prep-bad", func=func)) + + +async def fixture_unpreparable(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """An unresolvable callable ends the job with ``error`` while the batch keeps going. + + The two triggers are separate cases: C07 is the unimportable module reference, C16 the task + with no local callable configured. C16 is the weaker of the two, because the base already + raises ``CallableLookupError`` on that path. + """ + variant = variant or "unimportable" + case_id = "C07" if variant == "unimportable" else "C16" + case = Case(case_id, f"unpreparable[{factory.kind}/{variant}]") + STATE.clear() + store = await factory.create() + scheduler = _scheduler(store, "preparer", max_concurrent_jobs=5) + async with scheduler: + if not (await guarded(case, "add_task(bad)", _add_bad_task(store, variant)))[0]: + return {case_id: case.result()} + if not (await guarded(case, "configure_task(good)", scheduler.configure_task("prep-good", func=quick_job)))[0]: + return {case_id: case.result()} + ok, bad = await guarded(case, "add_job(bad)", scheduler.add_job("prep-bad", result_expiration_time=RESULT_TTL)) + ok2, good = await guarded(case, "add_job(sibling)", scheduler.add_job("prep-good", args=("sibling",), result_expiration_time=RESULT_TTL)) + if not (ok and ok2) or not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {case_id: case.result()} + bad_result = await wait_result(store, bad) + case.expect("unpreparable job outcome", outcome_name(bad_result) == "error", outcome_name(bad_result)) + exception = getattr(bad_result, "exception", None) + case.expect("recorded exception is a LookupError", isinstance(exception, LookupError), type(exception).__name__) + good_result = await wait_result(store, good) + case.expect("batch sibling outcome", outcome_name(good_result) == "success", outcome_name(good_result)) + ok, later = await guarded(case, "add_job(later)", scheduler.add_job("prep-good", args=("later",), result_expiration_time=RESULT_TTL)) + later_result = await wait_result(store, later) if ok else None + case.expect("later job outcome", outcome_name(later_result) == "success", outcome_name(later_result)) + case.expect("scheduler keeps running", _is_started(scheduler), _state_name(scheduler)) + return {case_id: case.result()} + + +async def fixture_failed_error_release(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + c08 = Case("C08", f"failed-error-release-survival[{factory.kind}]") + c09 = Case("C09", f"failed-error-release-handback[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + scheduler = _scheduler(store, "preparer", max_concurrent_jobs=5, lease_duration=LEASE) + async with scheduler: + for case in (c08, c09): + case.observed["setup"] = "started" + ok, _ = await guarded(c08, "add_task(bad)", _add_bad_task(store, "unimportable")) + ok = ok and (await guarded(c08, "configure_task(good)", scheduler.configure_task("prep-good", func=quick_job)))[0] + if not ok: + c09.fail("setup failed") + return {"C08": c08.result(), "C09": c09.result()} + ok, bad = await guarded(c08, "add_job(bad)", scheduler.add_job("prep-bad", result_expiration_time=RESULT_TTL)) + ok2, good = await guarded(c08, "add_job(sibling)", scheduler.add_job("prep-good", args=("sibling",), result_expiration_time=RESULT_TTL)) + if not (ok and ok2): + c09.fail("setup failed") + return {"C08": c08.result(), "C09": c09.result()} + probe["release_fail_ids"] = frozenset({bad}) + if not (await guarded(c08, "start_in_background", scheduler.start_in_background()))[0]: + c09.fail("scheduler did not start") + return {"C08": c08.result(), "C09": c09.result()} + good_result = await wait_result(store, good) + sibling_ok = outcome_name(good_result) == "success" + c08.expect("batch sibling outcome", sibling_ok, outcome_name(good_result)) + c09.expect("batch sibling outcome read first", sibling_ok, outcome_name(good_result)) + if sibling_ok: + try: + seen, seconds, polls = await peer_acquires(store, bad) + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + c09.fail(f"acquire_jobs(peer) raised {_describe(exc)}") + else: + c09.expect(f"peer acquires the unpreparable job within {PEER_DEADLINE:g} s", seen, {"seconds": seconds, "polls": polls}) + c08.expect("release_job was attempted for the unpreparable job", probe["release_failures"] >= 1, probe["release_failures"]) + ok, later = await guarded(c08, "add_job(later)", scheduler.add_job("prep-good", args=("later",), result_expiration_time=RESULT_TTL)) + later_result = await wait_result(store, later) if ok else None + c08.expect("later job outcome", outcome_name(later_result) == "success", outcome_name(later_result)) + c08.expect("scheduler keeps running", _is_started(scheduler), _state_name(scheduler)) + return {"C08": c08.result(), "C09": c09.result()} + + +# --------------------------------------------------------------------------- C10 / C11 + + +async def fixture_failed_cancel_release(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + c10 = Case("C10", f"failed-cancel-release-clean-stop[{factory.kind}]") + c11 = Case("C11", f"failed-cancel-release-handback[{factory.kind}]") + STATE.clear() + from apscheduler import SchedulerStopped + + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + scheduler = _scheduler(store, "stopper", max_concurrent_jobs=2, lease_duration=LEASE) + stop_events: list[Any] = [] + stopped = anyio.Event() + + def on_stopped(event: Any) -> None: + stop_events.append(event) + stopped.set() + + async with scheduler: + ok, _ = await guarded(c10, "configure_task", scheduler.configure_task("stop-long", func=long_job, max_running_jobs=2)) + ok, x = (await guarded(c10, "add_job(X)", scheduler.add_job("stop-long", args=("x",), result_expiration_time=RESULT_TTL))) if ok else (False, None) + ok, y = (await guarded(c10, "add_job(Y)", scheduler.add_job("stop-long", args=("y",), result_expiration_time=RESULT_TTL))) if ok else (False, None) + if not ok: + c11.fail("setup failed") + return {"C10": c10.result(), "C11": c11.result()} + probe["release_fail_ids"] = frozenset({x}) + scheduler.subscribe(on_stopped, {SchedulerStopped}) + if not (await guarded(c10, "start_in_background", scheduler.start_in_background()))[0]: + c11.fail("scheduler did not start") + return {"C10": c10.result(), "C11": c11.result()} + both = await wait_event("entered:x") and await wait_event("entered:y") + if not c10.expect("both jobs start", both, both): + c11.fail("jobs did not start") + return {"C10": c10.result(), "C11": c11.result()} + await guarded(c10, "stop()", scheduler.stop()) + with anyio.move_on_after(5): + await stopped.wait() + await anyio.sleep(0.3) + c10.expect("exactly one SchedulerStopped", len(stop_events) == 1, len(stop_events)) + exception = getattr(stop_events[0], "exception", "missing") if stop_events else "missing" + c10.expect("SchedulerStopped.exception is None", exception is None, None if exception is None else _describe(exception) if isinstance(exception, BaseException) else exception) + c10.expect("release_job was attempted for X", probe["release_failures"] >= 1, probe["release_failures"]) + ok, y_result = await guarded(c10, "get_job_result(Y)", store.get_job_result(y)) + if ok: + c10.expect("Y outcome", outcome_name(y_result) == "cancelled", outcome_name(y_result)) + c11.expect("SchedulerStopped received before the peer acquires", stopped.is_set(), stopped.is_set()) + if stopped.is_set(): + try: + seen, seconds, polls = await peer_acquires(store, x) + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + c11.fail(f"acquire_jobs(peer) raised {_describe(exc)}") + else: + c11.expect(f"peer acquires X within {PEER_DEADLINE:g} s", seen, {"seconds": seconds, "polls": polls}) + return {"C10": c10.result(), "C11": c11.result()} + + +# --------------------------------------------------------------------------- C12 + + +async def fixture_extension_failure(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + case = Case("C12", f"extension-failure[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + probe["extend_failures_left"] = 1 + scheduler = _scheduler(store, "extender", lease_duration=timedelta(seconds=2)) + async with scheduler: + if not (await guarded(case, "configure_task", scheduler.configure_task("extend-job", func=extension_job)))[0]: + return {"C12": case.result()} + if not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {"C12": case.result()} + ok, job_id = await guarded(case, "add_job", scheduler.add_job("extend-job", result_expiration_time=RESULT_TTL)) + if not ok: + return {"C12": case.result()} + result = await wait_result(store, job_id, deadline=10) + case.expect("exactly one extension raised", probe["extend_raised"] == 1, probe["extend_raised"]) + case.expect("a later extension completed", probe["extend_after_failure"] >= 1, probe["extend_after_failure"]) + case.expect("job outcome", outcome_name(result) == "success", outcome_name(result)) + case.expect("scheduler keeps running", _is_started(scheduler), _state_name(scheduler)) + return {"C12": case.result()} + + +# --------------------------------------------------------------------------- C13 + + +async def fixture_cancel_during_acquisition(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """The task running the scheduler is cancelled from outside while a batch is being claimed. + + ``stop()`` is never called, so a hand-back that is conditional on the stopping state leaves the + claimed batch stranded for the whole lease. + """ + case = Case("C13", f"cancel-during-acquisition[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + claimed, unblock = anyio.Event(), anyio.Event() + + async def block_after_claim(self: Any, scheduler_id: str, jobs: list[Any]) -> list[Any]: + if scheduler_id == "runner" and jobs: + probe["after_acquire"] = None + claimed.set() + await unblock.wait() + return jobs + + scheduler = _scheduler(store, "runner", max_concurrent_jobs=10, lease_duration=LEASE) + job_ids: list[Any] = [] + async with scheduler: + if not (await guarded(case, "configure_task", scheduler.configure_task("handoff", func=handoff_job, max_running_jobs=10)))[0]: + return {"C13": case.result()} + for _ in range(2): + ok, job_id = await guarded(case, "add_job", scheduler.add_job("handoff", result_expiration_time=RESULT_TTL)) + if not ok: + return {"C13": case.result()} + job_ids.append(job_id) + probe["after_acquire"] = block_after_claim + async with anyio.create_task_group() as task_group: + task_group.start_soon(scheduler.run_until_stopped) + with anyio.move_on_after(PEER_DEADLINE): + await claimed.wait() + case.expect("the batch is claimed while acquire_jobs is in progress", claimed.is_set(), claimed.is_set()) + # Cancel the task running the scheduler from the outside; stop() is never called + task_group.cancel_scope.cancel() + unblock.set() + if not claimed.is_set(): + return {"C13": case.result()} + ran = [tag for identity, tag in _log() if identity == "runner"] + case.expect("the cancelled scheduler ran no claimed job", ran == [], len(ran)) + for index, job_id in enumerate(job_ids): + ok, recorded = await guarded(case, "get_job_result", store.get_job_result(job_id)) + if ok: + case.expect(f"no result recorded for claimed job {index}", recorded is None, outcome_name(recorded)) + try: + seen, seconds, polls = await peer_acquires_all(store, job_ids) + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + case.fail(f"acquire_jobs(peer) raised {_describe(exc)}") + else: + case.expect( + f"peer acquires every claimed job within {PEER_DEADLINE:g} s", + sorted(seen) == sorted(str(job_id) for job_id in job_ids), + {"acquired": sorted(seen), "seconds": seconds, "polls": polls}, + ) + return {"C13": case.result()} + + +# --------------------------------------------------------------------------- C17 / C18 / C19 / C20 + + +async def fixture_preparation_error_tail(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """An unexpected preparation error must not strand the rest of an acquired batch.""" + case = Case("C17", f"preparation-error-tail[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + probe["get_task_fail_ids"] = frozenset({"prep-tail-b"}) + scheduler = _scheduler(store, "preparer", max_concurrent_jobs=3, lease_duration=LEASE) + async with scheduler: + for task_id in ("prep-tail-a", "prep-tail-b", "prep-tail-c"): + if not (await guarded(case, f"configure_task({task_id})", scheduler.configure_task(task_id, func=handoff_job)))[0]: + return {"C17": case.result()} + jobs: dict[str, Any] = {} + for task_id in ("prep-tail-a", "prep-tail-b", "prep-tail-c"): + ok, job_id = await guarded(case, f"add_job({task_id})", scheduler.add_job(task_id, result_expiration_time=RESULT_TTL)) + if not ok: + return {"C17": case.result()} + jobs[task_id] = job_id + probe["get_task_fail_enabled"] = True + if not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {"C17": case.result()} + bad_result = await wait_result(store, jobs["prep-tail-b"]) + case.expect("the preparation failure is recorded", outcome_name(bad_result) == "error", outcome_name(bad_result)) + for task_id in ("prep-tail-a", "prep-tail-c"): + result = await wait_result(store, jobs[task_id]) + case.expect(f"{task_id} still runs", outcome_name(result) == "success", outcome_name(result)) + case.expect("the scheduler remains started", _is_started(scheduler), _state_name(scheduler)) + return {"C17": case.result()} + + +async def fixture_preparation_cancellation(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """The task running the scheduler is cancelled from outside while a claimed batch is prepared. + + Preparation of one claimed job is held inside ``get_task`` when the cancellation lands, and + ``stop()`` is never called. Every claimed job that got no result must be handed back promptly + rather than stranded for the whole lease; jobs that did start may finish or be cancelled. + """ + case = Case("C21", f"preparation-cancellation[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + task_ids = ("prep-cancel-a", "prep-cancel-b", "prep-cancel-c") + scheduler = _scheduler(store, "runner", max_concurrent_jobs=10, lease_duration=LEASE) + jobs: dict[str, Any] = {} + async with scheduler: + for task_id in task_ids: + if not (await guarded(case, f"configure_task({task_id})", scheduler.configure_task(task_id, func=handoff_job)))[0]: + return {"C21": case.result()} + for task_id in task_ids: + ok, job_id = await guarded(case, f"add_job({task_id})", scheduler.add_job(task_id, result_expiration_time=RESULT_TTL)) + if not ok: + return {"C21": case.result()} + jobs[task_id] = job_id + # Armed only now: adding a job may itself read the task. + probe["get_task_block_ids"] = frozenset({"prep-cancel-b"}) + probe["get_task_block_call"] = 1 + blocked = _event("preparation_blocked") + async with anyio.create_task_group() as task_group: + task_group.start_soon(scheduler.run_until_stopped) + with anyio.move_on_after(PEER_DEADLINE): + await blocked.wait() + # Cancel the task running the scheduler from the outside; stop() is never called + task_group.cancel_scope.cancel() + _event("preparation_unblock").set() + if not case.expect("preparation of the claimed batch is in progress", blocked.is_set(), blocked.is_set()): + return {"C21": case.result()} + held = str(jobs["prep-cancel-b"]) + ran = [tag for identity, tag in _log() if identity == "runner"] + case.expect("the job held in preparation did not run", held not in ran, ran) + unresulted: list[Any] = [] + for task_id, job_id in jobs.items(): + ok, recorded = await guarded(case, f"get_job_result({task_id})", store.get_job_result(job_id)) + if not ok: + return {"C21": case.result()} + if recorded is None: + unresulted.append(job_id) + elif task_id == "prep-cancel-b": + case.fail(f"the job held in preparation got a result: {outcome_name(recorded)}") + try: + seen, seconds, polls = await peer_acquires_all(store, unresulted) + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + case.fail(f"acquire_jobs(peer) raised {_describe(exc)}") + else: + case.expect( + f"peer acquires every unstarted claimed job within {PEER_DEADLINE:g} s", + sorted(seen) == sorted(str(job_id) for job_id in unresulted), + {"unstarted": sorted(str(job_id) for job_id in unresulted), "acquired": sorted(seen), "seconds": seconds, "polls": polls}, + ) + return {"C21": case.result()} + + +async def fixture_arbitrary_preparation_failure(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """An unexpected preparation error affects one job, not the rest of its batch.""" + case = Case("C18", f"arbitrary-preparation-failure[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + probe["get_task_fail_ids"] = frozenset({"prep-exception"}) + scheduler = _scheduler(store, "preparer", max_concurrent_jobs=3, lease_duration=LEASE) + async with scheduler: + if not (await guarded(case, "add_task(exception)", store.add_task(_new_task("prep-exception"))))[0]: + return {"C18": case.result()} + if not (await guarded(case, "configure_task(good)", scheduler.configure_task("prep-good", func=quick_job)))[0]: + return {"C18": case.result()} + ok, bad = await guarded(case, "add_job(exception)", scheduler.add_job("prep-exception", result_expiration_time=RESULT_TTL)) + ok2, sibling = await guarded(case, "add_job(sibling)", scheduler.add_job("prep-good", args=("sibling",), result_expiration_time=RESULT_TTL)) + if not (ok and ok2): + return {"C18": case.result()} + probe["get_task_fail_enabled"] = True + if not (await guarded(case, "start_in_background", scheduler.start_in_background()))[0]: + return {"C18": case.result()} + bad_result = await wait_result(store, bad) + case.expect("unexpected preparation failure records an error", outcome_name(bad_result) == "error", outcome_name(bad_result)) + sibling_result = await wait_result(store, sibling) + case.expect("the remaining batch job succeeds", outcome_name(sibling_result) == "success", outcome_name(sibling_result)) + ok, later = await guarded(case, "add_job(later)", scheduler.add_job("prep-good", args=("later",), result_expiration_time=RESULT_TTL)) + later_result = await wait_result(store, later) if ok else None + case.expect("the scheduler continues after the error", outcome_name(later_result) == "success" and _is_started(scheduler), {"outcome": outcome_name(later_result), "state": _state_name(scheduler)}) + return {"C18": case.result()} + + +async def fixture_cancelled_release_failure(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """A failed release during external cancellation must not crash or strand the job.""" + case = Case("C19", f"cancelled-release-failure[{factory.kind}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + scheduler = _scheduler(store, "runner", max_concurrent_jobs=1, lease_duration=LEASE) + async with scheduler: + if not (await guarded(case, "configure_task", scheduler.configure_task("cancel-error", func=long_job)))[0]: + return {"C19": case.result()} + ok, job_id = await guarded(case, "add_job", scheduler.add_job("cancel-error", args=("runner",), result_expiration_time=RESULT_TTL)) + if not ok: + return {"C19": case.result()} + probe["release_fail_ids"] = frozenset({job_id}) + async with anyio.create_task_group() as task_group: + task_group.start_soon(scheduler.run_until_stopped) + started = await wait_event("entered:runner") + case.expect("job starts before cancellation", started, started) + task_group.cancel_scope.cancel() + case.expect("the scheduler cancellation does not escape", probe["release_failures"] >= 1, probe["release_failures"]) + try: + seen, seconds, polls = await peer_acquires(store, job_id) + except Exception as exc: # noqa: BLE001 - candidate behaviour + case.fail(f"peer acquire raised {_describe(exc)}") + else: + case.expect("failed cancellation release hands the claim back", seen, {"seconds": seconds, "polls": polls}) + await factory.dispose() + return {"C19": case.result()} + + +async def fixture_stale_release_warning(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """Discarding a stale result emits an operator-visible warning.""" + case = Case("C20", f"stale-release-warning[{factory.kind}]") + STATE.clear() + from apscheduler import JobOutcome, JobResult + + logger = logging.getLogger("apscheduler.probe") + logging.disable(logging.NOTSET) + messages: list[str] = [] + + class WarningHandler(logging.Handler): + def emit(self, record: logging.LogRecord) -> None: + if record.levelno >= logging.WARNING: + messages.append(record.getMessage()) + + handler = WarningHandler() + logger.addHandler(handler) + try: + async with AsyncExitStack() as stack: + store = await started_store(stack, await factory.create()) + with time_machine.travel(T0, tick=False) as clock: + task_id = "warning-stale" + await store.add_task(_new_task(task_id, max_running_jobs=1)) + job = _new_job(task_id) + await store.add_job(job) + first = (await store.acquire_jobs("w1", LEASE, 1))[0] + clock.shift(31) + second = (await store.acquire_jobs("w2", LEASE, 1))[0] + await store.release_job("w1", first, JobResult.from_job(first, JobOutcome.success, return_value="stale")) + await store.release_job("w2", second, JobResult.from_job(second, JobOutcome.success, return_value="live")) + # The prompt asks only for a warning identifying that the result was discarded; it fixes + # no wording. Any warning saying so passes, as do the claim-ownership phrasings accepted before. + case.expect( + "stale release logs a warning", + any( + "discard" in message.lower() + or any( + phrase in message + for phrase in ("does not hold the claim", "without holding its claim", "claim belongs", "no longer owns the job") + ) + for message in messages + ), + messages, + ) + finally: + logger.removeHandler(handler) + return {"C20": case.result()} + + +# --------------------------------------------------------------------------- C22 + + +async def fixture_interrupted_error_release(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """Cancellation or shutdown lands while an unpreparable job's ``error`` release is in progress. + + Preparation of a claimed batch of three is interrupted while the store is releasing the + middle job, which could not be prepared (variants: an unimportable callable, or an unexpected + preparation error), by cancelling the task running the scheduler from outside or by ``stop()``. + Every claimed job that got no result must be handed back promptly rather than stranded for the + whole lease; a candidate that completes the error release under the interruption is accepted, + since that job then has a result. + """ + kind, _, trigger = (variant or "lookup-cancel").partition("-") + case = Case("C22", f"interrupted-error-release[{factory.kind}/{variant}]") + STATE.clear() + store_cls = instrumented_store_class(factory.store_class()) + store = await factory.create(store_cls) + probe = store_cls.probe + scheduler = _scheduler(store, "runner", max_concurrent_jobs=10, lease_duration=LEASE) + jobs: dict[str, Any] = {} + async with scheduler: + for task_id in ("prep-rel-a", "prep-rel-c"): + if not (await guarded(case, f"configure_task({task_id})", scheduler.configure_task(task_id, func=handoff_job)))[0]: + return {"C22": case.result()} + if kind == "lookup": + ok, _ = await guarded(case, "add_task(bad)", store.add_task(_new_task("prep-rel-b", func=UNIMPORTABLE_FUNC))) + else: + ok, _ = await guarded(case, "add_task(bad)", store.add_task(_new_task("prep-rel-b"))) + probe["get_task_fail_ids"] = frozenset({"prep-rel-b"}) + if not ok: + return {"C22": case.result()} + for task_id in ("prep-rel-a", "prep-rel-b", "prep-rel-c"): + ok, job_id = await guarded(case, f"add_job({task_id})", scheduler.add_job(task_id, result_expiration_time=RESULT_TTL)) + if not ok: + return {"C22": case.result()} + jobs[task_id] = job_id + # Armed only now: adding a job may itself read the task. + probe["release_block_ids"] = frozenset({jobs["prep-rel-b"]}) + probe["get_task_fail_enabled"] = True + blocked = _event("release_blocked") + async with anyio.create_task_group() as task_group: + task_group.start_soon(scheduler.run_until_stopped) + with anyio.move_on_after(PEER_DEADLINE): + await blocked.wait() + if trigger == "cancel": + # Cancel the task running the scheduler from the outside; stop() is never called + task_group.cancel_scope.cancel() + else: + await scheduler.stop() + _event("release_unblock").set() + if not case.expect("the error release of the unpreparable job is in progress", blocked.is_set(), blocked.is_set()): + return {"C22": case.result()} + held = str(jobs["prep-rel-b"]) + ran = [tag for identity, tag in _log() if identity == "runner"] + case.expect("the unpreparable job did not run", held not in ran, ran) + unresulted: list[Any] = [] + outcomes: dict[str, Any] = {} + for task_id, job_id in jobs.items(): + ok, recorded = await guarded(case, f"get_job_result({task_id})", store.get_job_result(job_id)) + if not ok: + return {"C22": case.result()} + outcomes[task_id] = outcome_name(recorded) + if recorded is None: + unresulted.append(job_id) + case.observed["outcomes"] = outcomes + try: + seen, seconds, polls = await peer_acquires_all(store, unresulted) + except ProbeInfrastructureError: + raise + except Exception as exc: # noqa: BLE001 - candidate behaviour + case.fail(f"acquire_jobs(peer) raised {_describe(exc)}") + else: + case.expect( + f"peer acquires every claimed job without a result within {PEER_DEADLINE:g} s", + sorted(seen) == sorted(str(job_id) for job_id in unresulted), + {"unresulted": sorted(str(j) for j in unresulted), "acquired": sorted(seen), "seconds": seconds, "polls": polls}, + ) + return {"C22": case.result()} + + +# --------------------------------------------------------------------------- C14 + + +async def fixture_cleanup_claim_changed(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """A claim changes hands while ``cleanup()`` is abandoning an earlier expired job. + + The event broker subclass takes the second job over as ``peer`` when the first abandoned + release is published, which is the only point at which the memory store yields control inside + the loop. Memory store only: the SQLAlchemy store performs the whole sweep in one transaction + and publishes afterwards, so no interleaving is observable there (measured, see grader draft). + """ + case = Case("C14", f"cleanup-claim-changed[{factory.kind}]") + STATE.clear() + from apscheduler.eventbrokers.local import LocalEventBroker + + taken: dict[str, Any] = {"ids": None, "error": None} + + class HookBroker(LocalEventBroker): # type: ignore[misc, valid-type] + armed: bool = False + hooked_store: Any = None + + async def publish(self, event: Any) -> None: + if type(self).armed and type(event).__name__ == "JobReleased": + type(self).armed = False + try: + peer_jobs = await type(self).hooked_store.acquire_jobs("peer", LEASE, 10) + except Exception as exc: # noqa: BLE001 - candidate behaviour + taken["error"] = _describe(exc) + else: + taken["ids"] = _ids(peer_jobs) + return await super().publish(event) + + HookBroker.armed = False + async with AsyncExitStack() as stack: + store = await factory.create() + HookBroker.hooked_store = store + broker = HookBroker() + logger = logging.getLogger("apscheduler.probe") + await broker.start(stack, logger) + await store.start(stack, broker, logger) + task_id = "cleanup-race" + with time_machine.travel(T0, tick=False) as clock: + if not (await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=5))))[0]: + return {"C14": case.result()} + jobs = [_new_job(task_id) for _ in range(2)] + for job in jobs: + if not (await guarded(case, "add_job", store.add_job(job)))[0]: + return {"C14": case.result()} + ok, held = await guarded(case, "acquire_jobs(owner)", store.acquire_jobs("owner", LEASE, 10)) + if not ok or not case.expect("owner claims both jobs", len(held or []) == 2, _ids(held)): + return {"C14": case.result()} + clock.shift(31) + HookBroker.armed = True + if not (await guarded(case, "cleanup()", store.cleanup()))[0]: + return {"C14": case.result()} + case.expect( + "the peer took a claim over while cleanup was running", + bool(taken["ids"]), + taken["ids"] or taken["error"], + ) + if not taken["ids"]: + return {"C14": case.result()} + survivor = UUID(taken["ids"][0]) + ok, listed = await guarded(case, "get_jobs", store.get_jobs()) + if ok: + case.expect("the taken-over job is still in the store", str(survivor) in _ids(listed), _ids(listed)) + ok, recorded = await guarded(case, "get_job_result", store.get_job_result(survivor)) + if ok: + case.expect("no result was recorded for the taken-over job", recorded is None, outcome_name(recorded)) + ok, others = await guarded(case, "acquire_jobs(outsider)", store.acquire_jobs("outsider", LEASE, 10)) + if ok: + case.expect("an outsider receives nothing while the peer's lease is live", _ids(others) == [], _ids(others)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs after the abandoned release", count == 1, count) + return {"C14": case.result()} + + +# --------------------------------------------------------------------------- C15 + + +async def fixture_zero_limit(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """``acquire_jobs`` with a limit of zero or less claims nothing and consumes nothing.""" + case = Case("C15", f"zero-limit[{factory.kind}]") + STATE.clear() + async with AsyncExitStack() as stack: + store = await started_store(stack, await factory.create()) + task_id = "zero-limit" + with time_machine.travel(T0, tick=False): + if not (await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=5))))[0]: + return {"C15": case.result()} + jobs = [_new_job(task_id) for _ in range(2)] + for job in jobs: + if not (await guarded(case, "add_job", store.add_job(job)))[0]: + return {"C15": case.result()} + for label, limit in (("zero", 0), ("negative", -1)): + ok, claimed = await guarded(case, f"acquire_jobs(limit={limit})", store.acquire_jobs("w1", LEASE, limit)) + if not ok: + return {"C15": case.result()} + case.expect(f"a {label} limit claims nothing", _ids(claimed) == [], _ids(claimed)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect(f"running_jobs after a {label} limit", count == 0, count) + ok, claimed = await guarded(case, "acquire_jobs(limit=10)", store.acquire_jobs("w1", LEASE, 10)) + if ok: + case.expect( + "both jobs are still acquirable afterwards", + sorted(_ids(claimed)) == sorted(str(job.id) for job in jobs), + _ids(claimed), + ) + return {"C15": case.result()} + + +# --------------------------------------------------------------------------- C24 + + +async def fixture_concurrent_deadline_discard(factory: StoreFactory, variant: str | None) -> dict[str, Any]: + """An expired claim past its start deadline is discarded exactly once when a peer acquires + while the discarding acquisition is still publishing its events. + + The event broker subclass runs a second ``acquire_jobs`` as ``peer`` on the first event the + discarding acquisition publishes, which is where a store that defers its discards yields + control. The prompt requires such a job to be removed once, its slot decremented once and one + ``missed_start_deadline`` result recorded. A store that discards it again leaves + ``running_jobs`` one short, publishes a second release, or raises out of the acquisition. + """ + case = Case("C24", f"concurrent-deadline-discard[{factory.kind}]") + STATE.clear() + from apscheduler import Job, JobOutcome + from apscheduler.eventbrokers.local import LocalEventBroker + + peer: dict[str, Any] = {"ids": None, "error": None, "fired": False} + released: list[str] = [] + + class HookBroker(LocalEventBroker): # type: ignore[misc, valid-type] + armed: bool = False + hooked_store: Any = None + + async def publish(self, event: Any) -> None: + if type(event).__name__ == "JobReleased": + released.append(str(getattr(event, "job_id", ""))) + if type(self).armed: + type(self).armed = False + peer["fired"] = True + try: + peer_jobs = await type(self).hooked_store.acquire_jobs("peer", LEASE, 10) + except Exception as exc: # noqa: BLE001 - candidate behaviour + peer["error"] = _describe(exc) + else: + peer["ids"] = _ids(peer_jobs) + return await super().publish(event) + + HookBroker.armed = False + async with AsyncExitStack() as stack: + store = await factory.create() + HookBroker.hooked_store = store + broker = HookBroker() + logger = logging.getLogger("apscheduler.probe") + await broker.start(stack, logger) + await store.start(stack, broker, logger) + task_id = "concurrent-deadline-discard" + with time_machine.travel(T0, tick=False) as clock: + if not (await guarded(case, "add_task", store.add_task(_new_task(task_id, max_running_jobs=5))))[0]: + return {"C24": case.result()} + expiring = Job( + task_id=task_id, + executor="async", + start_deadline=T0 + timedelta(seconds=60), + result_expiration_time=RESULT_TTL, + ) + if not (await guarded(case, "add_job(expiring)", store.add_job(expiring)))[0]: + return {"C24": case.result()} + ok, held = await guarded(case, "acquire_jobs(owner)", store.acquire_jobs("owner", LEASE, 1)) + if not ok or not case.expect( + "owner initially receives the deadline job", _ids(held) == [str(expiring.id)], _ids(held) + ): + return {"C24": case.result()} + fresh = _new_job(task_id) + if not (await guarded(case, "add_job(fresh)", store.add_job(fresh)))[0]: + return {"C24": case.result()} + clock.shift(61) + HookBroker.armed = True + ok, claimed = await guarded(case, "acquire_jobs(w2) after the deadline", store.acquire_jobs("w2", LEASE, 10)) + HookBroker.armed = False + if not ok: + return {"C24": case.result()} + case.expect("w2 receives only the fresh job", _ids(claimed) == [str(fresh.id)], _ids(claimed)) + case.expect("the peer acquired while w2 was publishing", peer["fired"] and peer["error"] is None, peer["error"] or peer["fired"]) + case.expect("the peer receives nothing", peer["ids"] == [], peer["ids"]) + ok, listed = await guarded(case, "get_jobs", store.get_jobs()) + if ok: + case.expect("the expired job is removed and the fresh job remains", _ids(listed) == [str(fresh.id)], _ids(listed)) + ok, count = await guarded(case, "get_task", running_jobs(store, task_id)) + if ok: + case.expect("running_jobs counts only the fresh claim", count == 1, count) + ok, result = await guarded(case, "get_job_result", store.get_job_result(expiring.id)) + if ok: + case.expect( + "the expired job records missed_start_deadline", + result is not None and result.outcome is JobOutcome.missed_start_deadline, + outcome_name(result), + ) + case.expect( + "exactly one release event for the expired job", + released.count(str(expiring.id)) == 1, + released.count(str(expiring.id)), + ) + return {"C24": case.result()} + + +FixtureFn = Callable[[StoreFactory, str | None], Awaitable[dict[str, Any]]] + +FIXTURE_FUNCTIONS: dict[str, FixtureFn] = { + "takeover": fixture_takeover, + "expired_claim_missed_deadline": fixture_expired_claim_missed_deadline, + "stale_release": fixture_stale_release, + "renewal_busy_loop": fixture_renewal_busy_loop, + "renewal_starvation": fixture_renewal_starvation, + "stop_during_acquisition": fixture_stop_during_acquisition, + "unpreparable": fixture_unpreparable, + "failed_error_release": fixture_failed_error_release, + "failed_cancel_release": fixture_failed_cancel_release, + "extension_failure": fixture_extension_failure, + "cancel_during_acquisition": fixture_cancel_during_acquisition, + "preparation_error_tail": fixture_preparation_error_tail, + "preparation_cancellation": fixture_preparation_cancellation, + "interrupted_error_release": fixture_interrupted_error_release, + "arbitrary_preparation_failure": fixture_arbitrary_preparation_failure, + "cancelled_release_failure": fixture_cancelled_release_failure, + "stale_release_warning": fixture_stale_release_warning, + "cleanup_claim_changed": fixture_cleanup_claim_changed, + "zero_limit": fixture_zero_limit, + "concurrent_deadline_discard": fixture_concurrent_deadline_discard, +} + +#: Case ids each fixture reports; a fixture that omits one fails that case explicitly. +FIXTURE_CASES: dict[str, tuple[str, ...]] = { + "takeover": ("C01", "C02"), + "expired_claim_missed_deadline": ("C23",), + "stale_release": ("C03",), + "renewal_busy_loop": ("C04",), + "renewal_starvation": ("C05",), + "stop_during_acquisition": ("C06",), + "unpreparable": ("C07",), + "failed_error_release": ("C08", "C09"), + "failed_cancel_release": ("C10", "C11"), + "extension_failure": ("C12",), + "cancel_during_acquisition": ("C13",), + "preparation_error_tail": ("C17",), + "preparation_cancellation": ("C21",), + "interrupted_error_release": ("C22",), + "arbitrary_preparation_failure": ("C18",), + "cancelled_release_failure": ("C19",), + "stale_release_warning": ("C20",), + "cleanup_claim_changed": ("C14",), + "zero_limit": ("C15",), + "concurrent_deadline_discard": ("C24",), +} + +#: Fixtures whose reported case depends on the variant; falls back to FIXTURE_CASES. +FIXTURE_CASES_BY_VARIANT: dict[tuple[str, str | None], tuple[str, ...]] = { + ("unpreparable", "unimportable"): ("C07",), + ("unpreparable", "nofunc"): ("C16",), +} + +FIXTURE_DEADLINE_SECONDS = 25.0 + + +async def run_fixture(name: str, store_kind: str, variant: str | None, workdir: Path) -> dict[str, Any]: + """Run one fixture under an overall deadline; candidate exceptions fail its cases.""" + factory = StoreFactory(store_kind, workdir) + cases = FIXTURE_CASES_BY_VARIANT.get((name, variant), FIXTURE_CASES[name]) + CASES.clear() + try: + with anyio.fail_after(FIXTURE_DEADLINE_SECONDS): + outcome = await FIXTURE_FUNCTIONS[name](factory, variant) + except ProbeInfrastructureError: + raise + except BaseException as exc: # noqa: BLE001 - candidate behaviour, including a deadline + if isinstance(exc, KeyboardInterrupt | SystemExit): + raise + detail = f"{name}[{store_kind}/{variant}]: fixture raised {_describe(exc)}" + outcome = {} + for case_id in cases: + recorded = CASES.get(case_id) + if recorded is None: + outcome[case_id] = {"passed": False, "diagnostic": detail, "observed": {"exception": _describe(exc)}} + continue + recorded.failures.append(detail) + recorded.observed["exception"] = _describe(exc) + outcome[case_id] = recorded.result() + finally: + await factory.dispose() + for case_id in cases: + outcome.setdefault(case_id, {"passed": False, "diagnostic": f"{name}[{store_kind}/{variant}]: case not reported", "observed": {}}) + return outcome diff --git a/harbor/sources/apscheduler-v17/grading/probes/probe_main.py b/harbor/sources/apscheduler-v17/grading/probes/probe_main.py new file mode 100644 index 0000000000000000000000000000000000000000..a10e4f281cdd070f334bd8ee0383d5e267fd7c0f --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/probes/probe_main.py @@ -0,0 +1,70 @@ +"""Subprocess entry point for one probe fixture. + +Usage: ``python -I probe_main.py --fixture NAME --store memory|aiosqlite [--variant V] --src DIR --workdir DIR`` +with a one-line nonce on stdin. The grader-owned dependencies are imported before any candidate +code; a failure there is reported as a grader fault. Output lines are prefixed with the nonce so +incidental candidate output can never be mistaken for a result. +""" + +from __future__ import annotations + +import argparse +import json +import logging +import sys +from pathlib import Path + + +def _emit(nonce: str, kind: str, payload: dict) -> None: + sys.stdout.write(f"{nonce} {kind} {json.dumps(payload, sort_keys=True)}\n") + sys.stdout.flush() + + +def _pin_import_path(src: Path, probe_dir: Path) -> None: + """Import the candidate only from the graded copy, never from another checkout on sys.path.""" + kept = [entry for entry in sys.path if not (entry and (Path(entry) / "apscheduler").is_dir())] + sys.path[:] = [str(src), str(probe_dir), *kept] + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--fixture", required=True) + parser.add_argument("--store", required=True, choices=("memory", "aiosqlite")) + parser.add_argument("--variant", default=None) + parser.add_argument("--src", required=True, type=Path) + parser.add_argument("--workdir", required=True, type=Path) + args = parser.parse_args() + nonce = sys.stdin.readline().strip() + if not nonce: + return 2 + + _pin_import_path(args.src.resolve(), Path(__file__).resolve().parent) + logging.disable(logging.CRITICAL) + try: + import aiosqlite # noqa: F401 + import anyio + import probe_cases + import sqlalchemy.ext.asyncio # noqa: F401 + import time_machine # noqa: F401 + except Exception as exc: # noqa: BLE001 - grader-owned imports + _emit(nonce, "FAULT", {"reason": f"probe dependencies unavailable: {type(exc).__name__}: {str(exc)[:160]}"}) + return 0 + if args.fixture not in probe_cases.FIXTURE_FUNCTIONS: + _emit(nonce, "FAULT", {"reason": f"unknown probe fixture {args.fixture!r}"}) + return 0 + _emit(nonce, "READY", {"fixture": args.fixture, "store": args.store, "variant": args.variant}) + + async def run() -> dict: + return await probe_cases.run_fixture(args.fixture, args.store, args.variant, args.workdir) + + try: + outcome = anyio.run(run, backend="asyncio") + except probe_cases.ProbeInfrastructureError as exc: + _emit(nonce, "FAULT", {"reason": str(exc)[:200]}) + return 0 + _emit(nonce, "RESULT", {"cases": outcome}) + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/harbor/sources/apscheduler-v17/grading/probes/wall_main.py b/harbor/sources/apscheduler-v17/grading/probes/wall_main.py new file mode 100644 index 0000000000000000000000000000000000000000..acca679eeba995f0d35722f75da52fb1da215926 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/probes/wall_main.py @@ -0,0 +1,109 @@ +"""Subprocess entry point for the regression wall. + +Runs the pinned base ``tests/`` with the pinned base pytest settings (``pyproject.toml`` and +``tests/conftest.py`` copied from the base commit into the wall directory) against the candidate +``src/``: ``pytest -m "not external_service" -p no:cacheprovider``. The candidate's own test files and +pytest configuration never take part. A one-line nonce is read from stdin; pytest and candidate +output go to /dev/null, and only nonce-prefixed lines are written to stdout. +""" + +from __future__ import annotations + +import argparse +import json +import os +import sys +from pathlib import Path + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("--src", required=True, type=Path) + parser.add_argument("--rootdir", required=True, type=Path) + parser.add_argument("--basetemp", required=True, type=Path) + args = parser.parse_args() + nonce = sys.stdin.readline().strip() + if not nonce: + return 2 + + src = args.src.resolve() + kept = [entry for entry in sys.path if not (entry and (Path(entry) / "apscheduler").is_dir())] + sys.path[:] = [str(src), *kept] + out = os.fdopen(os.dup(1), "w") + + def emit(kind: str, payload: dict) -> None: + out.write(f"{nonce} {kind} {json.dumps(payload, sort_keys=True)}\n") + out.flush() + + try: + import pytest + except Exception as exc: # noqa: BLE001 - grader-owned dependency + emit("FAULT", {"reason": f"pytest unavailable: {type(exc).__name__}"}) + return 0 + rootdir = args.rootdir.resolve() + if not (rootdir / "pyproject.toml").is_file() or not (rootdir / "tests" / "conftest.py").is_file(): + emit("FAULT", {"reason": "pinned base test wall is incomplete"}) + return 0 + emit("READY", {}) + + class Counter: + def __init__(self) -> None: + self.collected = 0 + self.passed = 0 + self.failed = 0 + self.errors = 0 + self.skipped = 0 + self.collection_errors = 0 + self.failing: list[str] = [] + + def pytest_collectreport(self, report) -> None: + if report.failed: + self.collection_errors += 1 + self.failing.append(str(report.nodeid) or "") + + def pytest_collection_finish(self, session) -> None: + self.collected = len(session.items) + + def pytest_runtest_logreport(self, report) -> None: + if report.failed: + if report.when == "call": + self.failed += 1 + else: + self.errors += 1 + if report.nodeid not in self.failing: + self.failing.append(report.nodeid) + elif report.skipped and report.when in ("setup", "call"): + self.skipped += 1 + elif report.passed and report.when == "call": + self.passed += 1 + + counter = Counter() + devnull = os.open(os.devnull, os.O_WRONLY) + os.dup2(devnull, 1) + os.dup2(devnull, 2) + exit_code = pytest.main( + [ + "-m", "not external_service", + "-p", "no:cacheprovider", + "-q", + "--rootdir", str(rootdir), + "-c", str(rootdir / "pyproject.toml"), + "--basetemp", str(args.basetemp), + str(rootdir / "tests"), + ], + plugins=[counter], + ) + emit("RESULT", { + "exit_code": int(exit_code), + "collected": counter.collected, + "passed": counter.passed, + "failed": counter.failed, + "errors": counter.errors + counter.collection_errors, + "skipped": counter.skipped, + "failing_tests": counter.failing[:20], + }) + os._exit(0) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/harbor/sources/apscheduler-v17/grading/runner.py b/harbor/sources/apscheduler-v17/grading/runner.py new file mode 100644 index 0000000000000000000000000000000000000000..24db79368a23d89208ecdbeae71bab17921f8989 --- /dev/null +++ b/harbor/sources/apscheduler-v17/grading/runner.py @@ -0,0 +1,548 @@ +"""Grading runner for apscheduler_expired_job_lease. + +``grade_repository(project_dir)`` is the authoritative entry point. It never imports or executes +candidate code in this process: + +1. the agent-editable source surface (``src/``) is copied, without heavy trees, into a fresh + root-owned grading directory, so later workspace edits cannot change what is graded; +2. the regression wall runs the pinned base ``tests/`` with the pinned base pytest settings + (``grading/baseline``) against that copy, so candidate test or configuration edits cannot hide a + regression; candidate pytest settings are only compared against base for diagnostics; +3. every probe fixture runs in its own subprocess on the task interpreter with the import path + pinned to the copy, dropped to the unprivileged workspace account when grading as root; +4. ``grading.graders`` turns the observations into the pinned payload. + +A failure of grader-owned tooling (missing interpreter or probe assets, a probe that cannot start) +is a grader fault (``isError``); anything candidate code does after a probe has started is +candidate behaviour. Subprocess stdout/stderr are discarded except for nonce-prefixed result lines. +""" + +from __future__ import annotations + +import ast +import json +import logging +import os +import secrets +import shutil +import subprocess +import tempfile +import time +import tomllib +import uuid +from concurrent.futures import ThreadPoolExecutor +from pathlib import Path +from typing import Any + +from . import graders + +logger = logging.getLogger(__name__) + +HEAVY_EXCLUDE_DIRS = ( + "node_modules", + ".venv", + ".hud", + ".git", + ".tmp", + ".cache", + "dist", + "build", + "cdk.out", + "__pycache__", + ".pytest_cache", + ".ruff_cache", + ".mypy_cache", +) + +GRADING_DIR = Path(__file__).resolve().parent +PROBES_DIR = GRADING_DIR / "probes" +BASELINE_DIR = GRADING_DIR / "baseline" +#: Base-commit files the regression wall runs from, relative to the repository root. +PROTECTED_PATHS = [ + "pyproject.toml", + "tests/conftest.py", + "tests/test_datastores.py", + "tests/test_eventbrokers.py", + "tests/test_marshalling.py", + "tests/test_schedulers.py", + "tests/test_serializers.py", + "tests/triggers/test_calendarinterval.py", + "tests/triggers/test_combining.py", + "tests/triggers/test_cron.py", + "tests/triggers/test_date.py", + "tests/triggers/test_interval.py", +] +PROBE_ASSETS = ("probe_main.py", "probe_cases.py", "wall_main.py") +#: Agent-editable source surface graded by copy; everything else is compared, never executed. +EDITABLE_SURFACE = "src" +#: Candidate modules the probes import and drive (reported as present or missing in diagnostics). +PROBED_SOURCES = ( + Path("src/apscheduler/_schedulers/async_.py"), + Path("src/apscheduler/datastores/memory.py"), + Path("src/apscheduler/datastores/sqlalchemy.py"), + Path("src/apscheduler/abc.py"), +) + +DEFAULT_TASK_PYTHON = "/opt/apscheduler-venv/bin/python" +TASK_PYTHON_ENV = "APSCHEDULER_TASK_PYTHON" +WORKSPACE_UID = 1000 +WORKSPACE_GID = 1000 +PROBE_WORKERS = int(os.environ.get("APSCHEDULER_PROBE_WORKERS", "4")) +PROBE_TIMEOUT_SECONDS = 90 +WALL_TIMEOUT_SECONDS = 240 +GIT_TIMEOUT_SECONDS = 60 + + +class GraderFault(RuntimeError): + """Grader-owned tooling failed; the grade is invalid rather than a candidate zero.""" + + def __init__(self, health: str, reason: str) -> None: + super().__init__(reason) + self.health = health + self.reason = reason + + +class GradingRunner: + """Replicates the candidate's editable surface into an isolated grading directory.""" + + HEAVY_EXCLUDE_DIRS = HEAVY_EXCLUDE_DIRS + + def __init__( + self, + problem_id: str = "apscheduler_expired_job_lease", + repo_path: str | None = None, + patches_dir: str | None = None, + ): + self.problem_id = problem_id + self.patches_dir = patches_dir or os.environ.get("PATCHES_DIR", "/hud/patches") + self.repo_path = ( + repo_path + or os.environ.get("PROJECT_DIR") + or f"/home/ubuntu/{os.environ.get('FOLDER_NAME', 'apscheduler')}" + ) + self.working_dir = f"/tmp/grading_{uuid.uuid4()}" + + def replicate_workspace(self) -> None: + """Replicate the candidate repository without heavy runtime trees.""" + shutil.copytree( + self.repo_path, + self.working_dir, + symlinks=True, + ignore=shutil.ignore_patterns(*self.HEAVY_EXCLUDE_DIRS), + ) + + +def _is_root() -> bool: + return hasattr(os, "geteuid") and os.geteuid() == 0 + + +def task_python() -> str: + return os.environ.get(TASK_PYTHON_ENV) or DEFAULT_TASK_PYTHON + + +def _unprivileged(argv: list[str]) -> list[str]: + """Candidate code never runs as root: drop to the workspace account inside the image.""" + if _is_root(): + return ["setpriv", "--reuid", str(WORKSPACE_UID), "--regid", str(WORKSPACE_GID), "--clear-groups", "--", *argv] + return argv + + +def _subprocess_env(home: Path) -> dict[str, str]: + return { + "PATH": "/usr/local/bin:/usr/bin:/bin", + "HOME": str(home), + "LANG": "C.UTF-8", + "LC_ALL": "C.UTF-8", + "TZ": "UTC", + "PYTHONDONTWRITEBYTECODE": "1", + "TMPDIR": str(home), + } + + +def _copy_tree(source: Path, destination: Path) -> None: + shutil.copytree(source, destination, symlinks=False, ignore=shutil.ignore_patterns(*HEAVY_EXCLUDE_DIRS)) + + +def _run_nonce_process(argv: list[str], *, cwd: Path, env: dict[str, str], timeout: float) -> dict[str, Any]: + """Run one grader subprocess; return its nonce-marked READY/RESULT/FAULT lines and exit class.""" + nonce = secrets.token_hex(16) + started = time.monotonic() + try: + # A session of its own, so a timeout ends every process candidate code spawned (a process + # pool, for example) instead of leaving one holding the output pipe open. + process = subprocess.Popen( + argv, + cwd=cwd, + env=env, + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.DEVNULL, + text=True, + start_new_session=True, + ) + except FileNotFoundError: + return {"classification": "unavailable-executable", "elapsed_seconds": 0.0, "lines": {}} + try: + stdout, _ = process.communicate(input=f"{nonce}\n", timeout=timeout) + except subprocess.TimeoutExpired: + _kill_group(process) + stdout, _ = process.communicate() + return {"classification": "timeout", "elapsed_seconds": round(time.monotonic() - started, 3), "lines": _nonce_lines(stdout or "", nonce)} + finally: + _kill_group(process) + return { + "classification": "pass" if process.returncode == 0 else "nonzero", + "returncode": process.returncode, + "elapsed_seconds": round(time.monotonic() - started, 3), + "lines": _nonce_lines(stdout or "", nonce), + } + + +def _kill_group(process: subprocess.Popen) -> None: + """End the subprocess's whole session; stragglers from candidate code must not outlive a run.""" + try: + os.killpg(process.pid, 9) + except (ProcessLookupError, PermissionError): + pass + + +def _nonce_lines(stdout: str, nonce: str) -> dict[str, Any]: + found: dict[str, Any] = {} + prefix = f"{nonce} " + for line in stdout.splitlines(): + if not line.startswith(prefix): + continue + kind, _, payload = line[len(prefix):].partition(" ") + try: + found[kind] = json.loads(payload) + except json.JSONDecodeError: + found.setdefault("MALFORMED", []).append(kind) + return found + + +# --------------------------------------------------------------------------- workspace facts + + +def _git(project: Path, *args: str) -> subprocess.CompletedProcess[str]: + return subprocess.run( + ["git", "-c", f"safe.directory={project}", "-C", str(project), *args], + capture_output=True, + text=True, + timeout=GIT_TIMEOUT_SECONDS, + check=False, + env={**os.environ, "GIT_CONFIG_GLOBAL": os.devnull, "GIT_CONFIG_NOSYSTEM": "1", "GIT_TERMINAL_PROMPT": "0"}, + ) + + +def changed_outside_surface(project: Path, base_commit: str) -> dict[str, Any]: + """Paths changed outside ``src/`` relative to the pinned base (diagnostic only, never scored).""" + if not (project / ".git").exists(): + return {"status": "unavailable", "reason": "no repository metadata", "paths": []} + try: + tracked = _git(project, "diff", "--name-only", "--no-renames", base_commit, "--") + untracked = _git(project, "ls-files", "--others", "--exclude-standard") + except (OSError, subprocess.TimeoutExpired) as exc: + return {"status": "unavailable", "reason": type(exc).__name__, "paths": []} + if tracked.returncode != 0 or untracked.returncode != 0: + return {"status": "unavailable", "reason": "git exited nonzero", "paths": []} + paths = sorted({ + line.strip() + for line in (tracked.stdout + "\n" + untracked.stdout).splitlines() + if line.strip() and not line.strip().startswith(f"{EDITABLE_SURFACE}/") + }) + return {"status": "captured", "paths": paths[:200], "count": len(paths)} + + +def _pytest_settings(path: Path) -> dict[str, Any] | None: + try: + data = tomllib.loads(path.read_text(encoding="utf-8")) + except (OSError, tomllib.TOMLDecodeError, UnicodeDecodeError): + return None + settings = data.get("tool", {}).get("pytest", {}).get("ini_options") + return settings if isinstance(settings, dict) else {} + + +def _as_tokens(value: Any) -> list[str]: + if isinstance(value, list): + return [str(item) for item in value] + if isinstance(value, str): + return value.split() + return [] + + +WEAKENING_ADDOPTS = ("-k", "--deselect", "--ignore", "--ignore-glob", "-p", "--co", "--collect-only", "-x", "--maxfail", "--lf", "--last-failed") +COLLECTION_HOOKS = ("pytest_collection_modifyitems", "pytest_ignore_collect", "pytest_deselected", "pytest_collect_file", "pytest_pycollect_makeitem") + + +def _function_marks(source: str) -> dict[str, set[str]] | None: + """Test function name -> skip/xfail style marks applied to it (decorators and module pytestmark).""" + try: + tree = ast.parse(source) + except SyntaxError: + return None + module_marks: set[str] = set() + for node in tree.body: + if isinstance(node, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "pytestmark" for t in node.targets): + module_marks |= {mark for mark in ("skip", "skipif", "xfail") if f"mark.{mark}" in ast.unparse(node.value)} + marks: dict[str, set[str]] = {} + for node in ast.walk(tree): + if isinstance(node, ast.FunctionDef | ast.AsyncFunctionDef) and node.name.startswith("test"): + applied = set(module_marks) + for decorator in node.decorator_list: + text = ast.unparse(decorator) + applied |= {mark for mark in ("skip", "skipif", "xfail") if f"mark.{mark}" in text} + marks.setdefault(node.name, set()).update(applied) + return marks + + +def _hooks(source: str) -> set[str]: + try: + tree = ast.parse(source) + except SyntaxError: + return set() + return {node.name for node in ast.walk(tree) if isinstance(node, ast.FunctionDef | ast.AsyncFunctionDef) and node.name in COLLECTION_HOOKS} + + +def weakened_settings(project: Path) -> list[dict[str, str]]: + """Compare the candidate's governing pytest settings with the pinned base, setting by setting. + + Equivalent or stronger settings (reformatting, added tests, added markers) produce nothing. + The wall always runs the base settings, so a finding explains a wall failure; it is never a + penalty by itself. + """ + findings: list[dict[str, str]] = [] + + def add(setting: str, direction: str, base: str, candidate: str) -> None: + findings.append({"setting": setting, "direction": direction, "base": base[:120], "candidate": candidate[:120]}) + + base_settings = _pytest_settings(BASELINE_DIR / "pyproject.toml") or {} + candidate_settings = _pytest_settings(project / "pyproject.toml") + if candidate_settings is None: + add("pyproject.toml [tool.pytest.ini_options]", "unreadable or removed", "present", "unreadable") + candidate_settings = {} + base_addopts, cand_addopts = _as_tokens(base_settings.get("addopts")), _as_tokens(candidate_settings.get("addopts")) + added = [token for token in cand_addopts if token not in base_addopts] + for token in added: + name = token.split("=", 1)[0] + if name in WEAKENING_ADDOPTS or token.startswith("no:"): + add("addopts", f"adds {name} (narrows or stops test collection/execution)", " ".join(base_addopts), " ".join(cand_addopts)) + if _as_tokens(candidate_settings.get("testpaths")) != _as_tokens(base_settings.get("testpaths")): + add("testpaths", "changed test discovery roots", " ".join(_as_tokens(base_settings.get("testpaths"))), " ".join(_as_tokens(candidate_settings.get("testpaths")))) + base_warnings, cand_warnings = _as_tokens(base_settings.get("filterwarnings")), _as_tokens(candidate_settings.get("filterwarnings")) + if any(token.startswith("ignore") for token in cand_warnings) and not any(token.startswith("ignore") for token in base_warnings): + add("filterwarnings", "ignores warnings the base reports", " ".join(base_warnings), " ".join(cand_warnings)) + for alternative in ("pytest.ini", "tox.ini", "setup.cfg", "conftest.py"): + candidate_file = project / alternative + if candidate_file.is_file(): + text = candidate_file.read_text(encoding="utf-8", errors="replace") + if alternative == "conftest.py" or "[pytest]" in text or "[tool:pytest]" in text: + add(alternative, "adds a configuration file that overrides pyproject pytest settings", "absent", "present") + base_conftest = (BASELINE_DIR / "tests" / "conftest.py").read_text(encoding="utf-8") + candidate_conftest_path = project / "tests" / "conftest.py" + if not candidate_conftest_path.is_file(): + add("tests/conftest.py", "removed the base fixtures", "present", "absent") + else: + new_hooks = sorted(_hooks(candidate_conftest_path.read_text(encoding="utf-8", errors="replace")) - _hooks(base_conftest)) + if new_hooks: + add("tests/conftest.py", "collection hook deselects existing tests", "no collection hooks", ", ".join(new_hooks)) + for relative in PROTECTED_PATHS: + if not relative.startswith("tests/test_") and not relative.startswith("tests/triggers/"): + continue + base_marks = _function_marks((BASELINE_DIR / relative).read_text(encoding="utf-8")) or {} + candidate_path = project / relative + if not candidate_path.is_file(): + add(relative, "removed an existing test module", "present", "absent") + continue + candidate_marks = _function_marks(candidate_path.read_text(encoding="utf-8", errors="replace")) + if candidate_marks is None: + add(relative, "existing test module no longer parses", "parses", "syntax error") + continue + removed = sorted(set(base_marks) - set(candidate_marks)) + if removed: + add(relative, "removed existing tests", "", ", ".join(removed[:5])) + newly_skipped = sorted(name for name, marks in candidate_marks.items() if name in base_marks and marks - base_marks[name]) + if newly_skipped: + add(relative, "adds skip/xfail marks to existing tests", "", ", ".join(newly_skipped[:5])) + return findings + + +# --------------------------------------------------------------------------- execution + + +def _verify_grader_assets() -> None: + missing = [name for name in PROBE_ASSETS if not (PROBES_DIR / name).is_file()] + missing += [f"baseline/{relative}" for relative in PROTECTED_PATHS if not (BASELINE_DIR / relative).is_file()] + if missing: + raise GraderFault(graders.PROBE_FAULT, f"grader assets missing: {', '.join(missing[:5])}") + python = task_python() + if not (Path(python).is_file() and os.access(python, os.X_OK)): + raise GraderFault(graders.PROBE_FAULT, "task interpreter unavailable-executable") + + +def _prepare_grading_root(project: Path) -> tuple[Path, Path, Path, Path]: + """Fresh grading root: read-only candidate copy, probes and wall; writable scratch per run.""" + root = Path(tempfile.mkdtemp(prefix="apscheduler-grading-")) + source = project / EDITABLE_SURFACE + candidate_src = root / "candidate" / EDITABLE_SURFACE + if source.is_dir(): + _copy_tree(source, candidate_src) + else: + candidate_src.mkdir(parents=True) + probes = root / "probes" + _copy_tree(PROBES_DIR, probes) + wall = root / "wall" + wall.mkdir() + for relative in PROTECTED_PATHS: + target = wall / relative + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(BASELINE_DIR / relative, target) + scratch = root / "scratch" + scratch.mkdir() + for path in [root, *root.rglob("*")]: + if path.is_symlink(): + continue + path.chmod(0o755 if path.is_dir() else 0o644) + if _is_root(): + os.chown(scratch, WORKSPACE_UID, WORKSPACE_GID) + scratch.chmod(0o700) + return root, candidate_src, probes, wall + + +def _scratch_dir(scratch: Path, label: str) -> Path: + path = scratch / label + path.mkdir() + if _is_root(): + os.chown(path, WORKSPACE_UID, WORKSPACE_GID) + path.chmod(0o700) + return path + + +def run_wall(candidate_src: Path, probes: Path, wall: Path, scratch: Path) -> dict[str, Any]: + home = _scratch_dir(scratch, "wall") + argv = _unprivileged([ + task_python(), "-I", str(probes / "wall_main.py"), + "--src", str(candidate_src), "--rootdir", str(wall), "--basetemp", str(home / "basetemp"), + ]) + outcome = _run_nonce_process(argv, cwd=home, env=_subprocess_env(home), timeout=WALL_TIMEOUT_SECONDS) + lines = outcome["lines"] + if "FAULT" in lines: + raise GraderFault(graders.PROBE_FAULT, f"regression wall: {lines['FAULT'].get('reason', 'fault')}") + if "READY" not in lines: + raise GraderFault(graders.PROBE_FAULT, f"regression wall did not start ({outcome['classification']})") + result = lines.get("RESULT") + if not isinstance(result, dict): + classification = outcome["classification"] if outcome["classification"] != "pass" else "nonzero" + return { + "command": "pytest -m 'not external_service' -p no:cacheprovider (pinned base tests)", + "classification": classification, + "passed": False, "collected": 0, "failed": 0, "errors": 0, "skipped": 0, "failing_tests": [], + "elapsed_seconds": outcome["elapsed_seconds"], + } + passed = result.get("exit_code") == 0 and int(result.get("collected") or 0) > 0 and not result.get("failed") and not result.get("errors") + return { + "command": "pytest -m 'not external_service' -p no:cacheprovider (pinned base tests)", + "classification": "pass" if passed else ("empty" if not result.get("collected") else "nonzero"), + "passed": passed, + "collected": int(result.get("collected") or 0), + "passed_tests": int(result.get("passed") or 0), + "failed": int(result.get("failed") or 0), + "errors": int(result.get("errors") or 0), + "skipped": int(result.get("skipped") or 0), + "failing_tests": [str(test) for test in result.get("failing_tests") or []][:20], + "exit_code": result.get("exit_code"), + "elapsed_seconds": outcome["elapsed_seconds"], + } + + +def run_probe_fixture(fixture: dict[str, Any], candidate_src: Path, probes: Path, scratch: Path) -> dict[str, Any]: + label = fixture["key"].replace(":", "-") + home = _scratch_dir(scratch, label) + argv = [task_python(), "-I", str(probes / "probe_main.py"), "--fixture", fixture["fixture"], "--store", fixture["store"], + "--src", str(candidate_src), "--workdir", str(home)] + if fixture["variant"]: + argv += ["--variant", fixture["variant"]] + outcome = _run_nonce_process(_unprivileged(argv), cwd=home, env=_subprocess_env(home), timeout=PROBE_TIMEOUT_SECONDS) + lines = outcome["lines"] + record = {"fixture": fixture["key"], "classification": outcome["classification"], "elapsed_seconds": outcome["elapsed_seconds"]} + if "FAULT" in lines: + record.update(fault=str(lines["FAULT"].get("reason") or "probe fault")) + return record + if "READY" not in lines: + record.update(fault=f"probe did not start ({outcome['classification']})") + return record + result = lines.get("RESULT") + cases = result.get("cases") if isinstance(result, dict) else None + if not isinstance(cases, dict): + reason = "probe timed out" if outcome["classification"] == "timeout" else f"probe process ended without a result ({outcome['classification']})" + record["cases"] = {} + record["candidate_failure"] = reason + return record + record["cases"] = cases + return record + + +def run_probes(candidate_src: Path, probes: Path, scratch: Path) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]]]: + with ThreadPoolExecutor(max_workers=max(1, PROBE_WORKERS)) as pool: + records = list(pool.map(lambda fixture: run_probe_fixture(fixture, candidate_src, probes, scratch), graders.FIXTURES)) + faults = [record for record in records if record.get("fault")] + if faults: + raise GraderFault(graders.PROBE_FAULT, "; ".join(f"{record['fixture']}: {record['fault']}" for record in faults[:3])) + fixture_cases: dict[str, dict[str, Any]] = {} + for record in records: + cases = dict(record.get("cases") or {}) + if record.get("candidate_failure"): + for spec in graders.CRITERIA_SPECS: + for child in spec["children"]: + if record["fixture"] in child["fixtures"]: + cases.setdefault(child["case"], {"passed": False, "diagnostic": f"{record['fixture']}: {record['candidate_failure']}", "observed": {}}) + fixture_cases[record["fixture"]] = cases + summary = [ + {key: record.get(key) for key in ("fixture", "classification", "elapsed_seconds", "candidate_failure") if record.get(key) is not None} + for record in records + ] + return fixture_cases, summary + + +def _grade(project: Path) -> Any: + started = time.monotonic() + _verify_grader_assets() + if not project.is_dir(): + raise GraderFault(graders.PROBE_FAULT, "project directory is unavailable") + base_commit = os.environ.get("BASE_COMMIT") or "6a2a8851bafeb01dfe48e3b54be6dd3b3d4eae96" + surface = changed_outside_surface(project, base_commit) + weakened = weakened_settings(project) + try: + root, candidate_src, probes, wall = _prepare_grading_root(project) + except OSError as exc: + raise GraderFault(graders.PROBE_FAULT, f"grading directory could not be prepared: {type(exc).__name__}") from exc + try: + scratch = root / "scratch" + regression_wall = run_wall(candidate_src, probes, wall, scratch) + regression_wall["weakened_settings"] = weakened + fixture_cases, probe_summary = run_probes(candidate_src, probes, scratch) + finally: + shutil.rmtree(root, ignore_errors=True) + extra = { + "editable_surface": { + "graded": f"{EDITABLE_SURFACE}/", + "changed_outside": surface, + "probed_sources_missing": [str(path) for path in PROBED_SOURCES if not (project / path).is_file()], + }, + "probe_fixtures": probe_summary, + "native_outcomes": {"regression_wall": regression_wall["classification"]}, + "grading_elapsed_seconds": round(time.monotonic() - started, 3), + } + return graders.compute_evaluation_result(fixture_cases, regression_wall, extra) + + +def grade_repository(project_dir: str | Path | None = None, *, task_id: str = graders.TASK_ID, **_ignored: Any) -> Any: + """Grade the repository at ``project_dir``; fails closed with a complete fault payload.""" + project = Path(project_dir or os.environ.get("PROJECT_DIR") or "/home/ubuntu/apscheduler") + try: + return _grade(project) + except GraderFault as fault: + logger.error("grader fault: %s", fault.reason) + return graders.fault_result(fault.health, fault.reason) + except Exception as exc: # noqa: BLE001 - last-resort fail-closed path + logger.exception("unexpected grader exception") + return graders.fault_result(graders.GRADER_EXCEPTION, f"{type(exc).__name__}: {str(exc)[:200]}") diff --git a/harbor/sources/apscheduler-v17/pyproject.toml b/harbor/sources/apscheduler-v17/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..7913cd0dfaf548b3a9593fa0bd9afd031c2028f4 --- /dev/null +++ b/harbor/sources/apscheduler-v17/pyproject.toml @@ -0,0 +1,47 @@ +[project] +name = "apscheduler-expired-job-lease" +version = "0.1.0" +description = "HUD coding benchmark environment for apscheduler-expired-job-lease" +requires-python = ">=3.11,<3.13" +dependencies = [ + "hud[agents]>=0.6.0", + "pytest>=8.0.0", + "pytest-asyncio>=0.23.0", +] + +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project.optional-dependencies] +dev = [ + "pytest>=8.0.0", + "ruff==0.11.2", + "pre-commit>=3.5.0", +] + +[tool.pytest.ini_options] +testpaths = ["tests"] + +[tool.hud] +image = "apscheduler-expired-job-lease:dev" + +[tool.ruff] +target-version = "py311" +line-length = 120 +# The pinned base test snapshot is repository code, kept byte-identical to the base commit. +extend-exclude = ["grading/baseline"] + +[tool.ruff.lint] +select = ["E", "F", "B", "I", "C4", "UP"] +ignore = ["E501"] +fixable = ["ALL"] +unfixable = [] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +line-ending = "auto" + +[tool.hatch.build.targets.wheel] +packages = ["."] diff --git a/harbor/sources/apscheduler-v17/runtime/apscheduler-test-requirements.txt b/harbor/sources/apscheduler-v17/runtime/apscheduler-test-requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..8683ef01ccd1499eff234d39e16053c3ef29ae9d --- /dev/null +++ b/harbor/sources/apscheduler-v17/runtime/apscheduler-test-requirements.txt @@ -0,0 +1,839 @@ +# Test dependencies of the pinned APScheduler base for CPython 3.13 on x86_64 Linux: the base +# [project].dependencies, the extras its test group installs (cbor, mongodb, mqtt, redis, sqlalchemy) +# and [dependency-groups].test, without APScheduler itself (the workspace src/ is on the path). +# tzdata supplies zoneinfo data because the image has no system time zone database. +# Resolved with: uv pip compile --python-version 3.13 --python-platform x86_64-unknown-linux-gnu +# --generate-hashes --exclude-newer 2026-09-15T00:00:00Z +aiosqlite==0.22.1 \ + --hash=sha256:043e0bd78d32888c0a9ca90fc788b38796843360c855a7262a532813133a0650 \ + --hash=sha256:21c002eb13823fad740196c5a2e9d8e62f6243bd9e7e4a1f87fb5e44ecb4fceb + # via -r requirements.in +anyio==4.15.1 \ + --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 \ + --hash=sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94 + # via -r requirements.in +asyncmy==0.2.14 \ + --hash=sha256:00e6b2d37da51e10cd9057df18455d7de6acb03b04bdce1d973b7bbf9efb8356 \ + --hash=sha256:036c8eb15155fbd5a863c1d7449914e273111aa43ab566727dc69712daa2c202 \ + --hash=sha256:04e52efa263ece430b3fc17f3dbb0c4b75c7c098a0e4557a5dc4899d28b29409 \ + --hash=sha256:07d9ae2805fdc53cdd38dc4a1e7fb01a35dfcdf6c15664f05c81e7a2703b90b9 \ + --hash=sha256:0cf53a89fc5b8572d90bd549fb427373b04a11b064fbdb619e65d440d6e1109d \ + --hash=sha256:1c1c56750503b4a98737124e5e6f98a077349f897430c612e7b71994fdfa1fb1 \ + --hash=sha256:1e1776aeab4259b832c919f9ecfb1e8fe6df7a05d4ad6a1091928a6539a3e784 \ + --hash=sha256:1fad30f706ab1a9ae402360b19288e35f1788c59ef24c565a994d856ab352a50 \ + --hash=sha256:23d6cdfbab90c8b0e5da7499b17422de0008d881179650d15d6b3a7fd7f7321e \ + --hash=sha256:2d2d98de92eb22d702fd5fa6dc9a39ca20b1de49e5a71437f8e5b13b04a5b7ec \ + --hash=sha256:393b7741bc7714721c049c9706cb1965b947d7076b6e713c94f74ca1382bcb38 \ + --hash=sha256:3ef392a9c7e6d9821a3f265880dab960737aa8e3eccb74a529bca86914a7b712 \ + --hash=sha256:3f1ea30352fa047f7000cbf56eda605bb8fad5d331bbbf41956d459e00e5e148 \ + --hash=sha256:420a72054031586f1dc76de2bc471c3634c0a833eb7b2be5c29ea77c2e5819bd \ + --hash=sha256:46f6452448762cd1d8699a9f41c1da955c58d6ecbe1eb63e4b34858530294aeb \ + --hash=sha256:4f88d48947ce41ffe4e0488fa80b9d8b745c422a61133e07d250413974e709d3 \ + --hash=sha256:568c3f75403043431a4ccf5f7de5148753d4d3f1d23a2ab76e5bedad270163d1 \ + --hash=sha256:5af65cfe97d33efc6697ebc056c714f09eb741555c9fc6d73ce0d9651618484d \ + --hash=sha256:5d116cd2b5d5715c8cda7c2af1238bf9b36dca210558b0fa309ae9c587369335 \ + --hash=sha256:5e5210c013d15c6c01d384d7b1607678f3118121a3ce78c69c4e7ab564c41d8f \ + --hash=sha256:62e86e132d4f3b429015c81efd6ed0dfed43cd6820d7c3dd4599cb9bff0d8c44 \ + --hash=sha256:63b3f5f052a9b4cbd837a2a867f954f6e437979a7c74a663ac39f911f9da45ce \ + --hash=sha256:703a1bf9808745f42b630c41ecf5ccbd17f99f4a45001683064b524cef2ffe76 \ + --hash=sha256:74b803d60b00ea476d13912756c2b26f5cc4d70501d1d1c1437f0515bddf8f65 \ + --hash=sha256:83567b8500b5ab00a753433370590ef0b1f11717194a29255903c095ebfb96ab \ + --hash=sha256:8a9f6cad22be74180bb9ae9569c54bf72e72bf8dad8ec6d5d66e835e6d579651 \ + --hash=sha256:9062b7fdd0e14c32e1fac2114fd72a2d4a4677506a6d1a8a522917ec5c4cf0e0 \ + --hash=sha256:91c4188713db7ab3840e854fe812b1bbffa773073315d0f614884ddcbcc0519a \ + --hash=sha256:9405dbd5daeed8878a770b9c068201cb52cd0eac1bc1c453e73ad4b5bdb79916 \ + --hash=sha256:960edb3ffe5c9d44e565f491e4558b49d32b1110281b92ab4a10ba2321df856c \ + --hash=sha256:969570b5ea070662fc178cd84e58b2d3de791499a5275f2e5f2a2fb31a829666 \ + --hash=sha256:96b0cc4ff3fc6550084f74be64a481ad9bb3edfde9e0f5a3430ad9dc3de3b81f \ + --hash=sha256:999546ded3238150b62d62454f9ee1203368db7673095993f2132b907798ec41 \ + --hash=sha256:9c4d3a7982a7a97dcbc9f895f2e9846edd401dd882c5fc24e6587e6b06215f75 \ + --hash=sha256:9f0c1b334b3dea18d8d7ae461af9ecba91983fa4aea8732c2f78ea854f64ea9f \ + --hash=sha256:a20a8f063d279b96f9ed2d391d7ade82bb3ecda375e21d388c110f979e8cc478 \ + --hash=sha256:a21d2cda1e98391743160446542c24660095a225196687a5126b2c0f8326685b \ + --hash=sha256:b086030b0f647c622c675c090a377fdc6ce94421dc71efa745613df175fd4bff \ + --hash=sha256:b0b5b2287c873eda34a449e752eaadc1f23f67e41e74ec01c30e207873ceb8b6 \ + --hash=sha256:b4c4b52d74e97b323d989d430d115f8d42b6c357ef9f6013790014965b3c2188 \ + --hash=sha256:b71c2490c701065f817b72af1bb653bb933b69e4ec124547993e2b24437c7df2 \ + --hash=sha256:bc0403d1b7625557f966ae16b9798d72d20a6293d6d0989118b8f21261adcb02 \ + --hash=sha256:bc8f526d90fe6746a9d80f5822b3d60d41a6ac38fd9fd2f0141f31218be573fe \ + --hash=sha256:bd05da2f082070a4ca2089bad47ee82850de81c3f509909b1c1b4c7260500a59 \ + --hash=sha256:c09809a5ef2f37bce5faec636f670108726bd02530b7cacc5ee6450ec7d8787d \ + --hash=sha256:c46ba9453332bf45e580122ad9bb69657fbb50dbb9684b76ad10d83498372311 \ + --hash=sha256:d058195574cc889f3f773686f7e17d71693641f9ac0386ae59ae623532a841ff \ + --hash=sha256:d073fd93612fecfb02218e8a190a0e2f8cac764a24d95752c335244c83b2b9e4 \ + --hash=sha256:d23f172c101542b5bc93c19dd49ca683eea3211884696c64af89370241e26591 \ + --hash=sha256:d31e61fac2520319894af6951614e6d82f5c0a0207ab02ae2408ffc69583b669 \ + --hash=sha256:d36816da461bb2d6d5ac910cb07ab83527c0b94cc98753c88b070ebecec77cd0 \ + --hash=sha256:d3a15aca6a55de1f9e69ba80ba60befcc34477cdf8addf4c3f232813a364ac63 \ + --hash=sha256:d3b4ed3cb126fa9615c98aa4cfe9f22a75af08ab06253aabedd6c293a9544e9c \ + --hash=sha256:e0551a8470b84f9114d359a0bb8e24584d00a42c379a80ae943d338da8b5f5b7 \ + --hash=sha256:e4755698751e6f04632abf48ee0d9b8882fb369ae21cb14de6c152d0dc1019c7 \ + --hash=sha256:e83bc138424ff4cce01fd5ef9eb624cc98c417105a85375a67e8bbabdb426a55 \ + --hash=sha256:ee8dce45c9c3d25de4186916f4914e24929cc8c60301e85973685d47f98cc910 \ + --hash=sha256:f127fef5f1ebb3143c4af179aa18ee00f9cb8b93ecdf4003aae11b255f464af5 \ + --hash=sha256:f258d918994ff6c39d01fec17a53de950aa521e70fffe2f9bca8e6c09efe4a06 \ + --hash=sha256:f320edc93f62df539e8e48d1f1039387856635a6550e05a1cba5642ce9b48702 \ + --hash=sha256:f36c7f94e97a90bfd860a94971eaf31dd4f01f8e4f19991e549535c99dd62287 \ + --hash=sha256:f84c88a33a4a6b02714ce2b1ac2f012db3f6f570fa2746e6b73335541fc33966 \ + --hash=sha256:fa1d887afa1b5deabad254a864bbfb9e0818810e522cd1037efc1b14823c5007 \ + --hash=sha256:fb0c5ae02f9e5f360cb645fa02f613c0136ac7488ee4677bb05197546b4a6af1 \ + --hash=sha256:fd8e23d2eab3d9249a206f2446e2896ef99893d03ccda900ba5e17018fd44136 + # via -r requirements.in +attrs==26.1.0 \ + --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ + --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 + # via + # -r requirements.in + # outcome + # trio +cbor2==6.1.4 \ + --hash=sha256:01ecc79a28f33d17331943ce508fc1e21f4b06553c73f874f4c77120d72b2ef9 \ + --hash=sha256:032ce71cbdc9267e9cec42132f6ac6c40f441ec27ebc87ca9dd209dcab6804ee \ + --hash=sha256:0859a0837e6e2d4fe5f5b849f6475797e4db545da98c19db4b1d3487bd47aa22 \ + --hash=sha256:164ca22b509408435b2d8236c80c964e4fc77c085ab034569cd04c40d5cc8883 \ + --hash=sha256:179a794bf4be1d46ff190695929f65f0b42019c156919846ae539d2a7ec42e54 \ + --hash=sha256:1fc15061553e4494dc10883237501e3402c645fe509248dd698e1faf2460d68b \ + --hash=sha256:2310f07db3f9ba26f2a623774ff9f3dc7185af54f732ea119785a6b1bf7e1e7e \ + --hash=sha256:239db0f92d537fd29eaec4e40195fc3b2b48bc34a5887059658162489a9eb6ae \ + --hash=sha256:24da0a481294ac416e1e369e2d204b2b1d993cbd082d0d99fa3d6f5f27ae5e69 \ + --hash=sha256:28fa5db05a7eae8fd80709959988d8a7f12838c6d4e5c58ec951414058641195 \ + --hash=sha256:310f3dfb296ba48fe9b63c5cf26e691e3548a1eae6901d2f0c18e941d151f220 \ + --hash=sha256:316e217a496640418d3137483279d0e70053b000cdd4b52a4dbf20ea478bc40a \ + --hash=sha256:32a4663425fbca4a4a7aa918eb5789d844c406439e58424cf34511f79f559242 \ + --hash=sha256:36ae16d64b1f7b620c1af748e7b6947e20069ef80eee56871c5fbb84cc635905 \ + --hash=sha256:3cfb7eec57406b86aab47183f6dc90ece888e03721d37a4d33315e79e486898d \ + --hash=sha256:3f4a434c36bb0d33aeb48ddae8e8b673ca7e1f14545ee7cf4a4c7c39380ea9a2 \ + --hash=sha256:41aae72e8863ac0d50705ea8290b72c49db90a6d953110feaa91360ae526fa8d \ + --hash=sha256:4903f24e0f9087275a0b6606c8b0aa586277001d51e4844fcdbc5b7211330aa8 \ + --hash=sha256:4bd29f21529e279d50fc14f1a811f7b05b4d8e66a7969163cce98983b6817245 \ + --hash=sha256:553a46bda7d09552631a714e22b91e6ff2c867ecd91511596ce290d8879b8d5b \ + --hash=sha256:598710183daae69cbdeb177a870ec64aa601de8138a61491fd256826d15a860f \ + --hash=sha256:5b99305d4013867e059f147752b95f728680682ab03d75a3f4dcfbb270d8dfe9 \ + --hash=sha256:5e6c76004d674ad1c620660cb0bc5a8a0b72a5d8c7b70926d8e09e6d7e87332f \ + --hash=sha256:69978901302ecbc8cda57b520487c5c5240ed217de783eb7728fceb258311d76 \ + --hash=sha256:6abcf072b8c0fdc8ad7902ee26a906cafbf3427d026b662ff21166a253f85e18 \ + --hash=sha256:71fcf4f237d68bf4445bf45070f36f82b333f2e6a62612aa2c256683b51378a9 \ + --hash=sha256:7336ff4cb7d161ec43b65eef43bf3e9bcab44bd152efb54dd637b7afe711254f \ + --hash=sha256:7b697c2a18eab9a3326447fe0f1c927db065a096febc57f064f0f5ed67fe96fc \ + --hash=sha256:7deccc50fd0b55c4c7dd265b144c5358a645121e457c0ae3722b5ad59832b257 \ + --hash=sha256:8156fdeb73c3ff6c8cf67ad414fb5c887cd708ff0af6d61f62629f41cb4c17b2 \ + --hash=sha256:855764e02dc60ab9413acd044e997c3170000fdea6155d6c43a923a1d966dbe6 \ + --hash=sha256:8f1019494b0ec81a3df3ebb01b6acb446d5b946fe35845b1726379abd66a71da \ + --hash=sha256:9b904b8d0f4ddac9259197d21d121fae4cb8b555700d65bc12c5d46a2e6c2025 \ + --hash=sha256:ad4efa23fee6447e56a269191044e06eb39e809458bcd674e164fe9445feafd0 \ + --hash=sha256:ae14eb3f2f251102d72625ab02a28c83a8d11adf3d0383bd6d7bd9d672e18119 \ + --hash=sha256:bd20ecc5c8ece24db952e48a91c8c47319eaa6358af707c85ac2bb388a79abc8 \ + --hash=sha256:c08b9c7d2ea013e24a0cb819b872b0119dde404f64a1182c0b24095b7bba781f \ + --hash=sha256:c0f5f2d6d3b58e44146860c049f3c082207a4005588b8926d51bf937ab66773c \ + --hash=sha256:c204a75f91f8cd9ed0881f6b88ec395c59aeac9fcf4d08155e7f899db2a1c46e \ + --hash=sha256:c435720a25c1de9b241df883b5890b35aff3bf64365efc8037d4d26df085724e \ + --hash=sha256:c48a7c938fc5fa5300ff82b5df09068dcb4838685ae8556b5ee8279d74f97ab4 \ + --hash=sha256:c6b28b928c5f2dbf47dffa12dce9c8e36fe6ac1c1358bc326499c0736263b66f \ + --hash=sha256:cc8cd300e236e9797b2e1ce306109dc481fcccf78bfa2682bf36d99e6eab1ec6 \ + --hash=sha256:d2560c2ba6a95904ba2a0ca257af878c4344409d9b46d8e646d8ebb617b1e0dd \ + --hash=sha256:d9ada5a6ccfbb8ea7a3aa2aeb028421b52d8e0cd9323f0a2aeaa9c09d25fbce2 \ + --hash=sha256:deff027a56e04caebfee649029bfd1836f4fb468d2cf66d2a396ae1018f655db \ + --hash=sha256:e1fe2d62c50df290576280b18247ec63486f78be73e285bae269c2456c6ddff0 \ + --hash=sha256:e8097e8259b78c8feb5dd5b833b23f83ed588e821ef44cf1455082cfc9434440 \ + --hash=sha256:f3fc7d15cba4174373df2496070faa4a927fe3ed772130d281808120aec7b61c + # via -r requirements.in +cffi==2.1.1 \ + --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ + --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ + --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \ + --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ + --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ + --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ + --hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \ + --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ + --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ + --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ + --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ + --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ + --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ + --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ + --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ + --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ + --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \ + --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ + --hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ + --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ + --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ + --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ + --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ + --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ + --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ + --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ + --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ + --hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \ + --hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \ + --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ + --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ + --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ + --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ + --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ + --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ + --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ + --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \ + --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ + --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ + --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ + --hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \ + --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ + --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ + --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ + --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ + --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ + --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ + --hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \ + --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ + --hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \ + --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ + --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ + --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ + --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ + --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ + --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ + --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ + --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ + --hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \ + --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ + --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \ + --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ + --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ + --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ + --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ + --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ + --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ + --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ + --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ + --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ + --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ + --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \ + --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ + --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 + # via cryptography +coverage==7.16.1 \ + --hash=sha256:070acb9da788dff743a4d36fc015feee12d68f0349959017542017c79f59c21c \ + --hash=sha256:0c309096926b119543dc16438a11ef4c80783d2f4e59ff94f7f462651a944cdc \ + --hash=sha256:0d0ececb32090e3fbb03e0d352b973a0485879b4de6c58daf47227b9988b99e5 \ + --hash=sha256:166adae25b05b04c9a84135912066d9c97482115af38df1a419a38aacc6b6f5d \ + --hash=sha256:19a3ea2f364012ef06678118fffdc92442a16bef4a5c8ad4f4019dd8f9ac8876 \ + --hash=sha256:1b24f79e25bcf6c73931aeca7a3dfc7595c0cb5e9364aba3fdf387a3de4b1c22 \ + --hash=sha256:1ec9a4ee989c0d06ad95add0dbfdbb72b00ef53f43431ca0b612384e7878e5de \ + --hash=sha256:2270a794600b635ca9452ce4c32e2fe81a35f9caa17ffac0eba99f14f275bd4d \ + --hash=sha256:2959978f9d1d20a2c0c15d0a68baaeccf615ac1aa214cf4a05a10d6f568926c8 \ + --hash=sha256:29c4d3e32a3b5efa420a3dc627c7e570deb80ef997def52c7686a474f5edc7ab \ + --hash=sha256:2b26b55b18e1a53e1a159dd743728c4ddbbef28ba19000a91aaff5ce023197ec \ + --hash=sha256:2b8256f8b525ba233d2e4cdcdce0d6673c66fc9bf70df1fd5e67c54a74e2d245 \ + --hash=sha256:2c05913d0d5badf7ac83200f35dcf9514cce5df16a7cc89e7d1d7fff0461813b \ + --hash=sha256:3284754371dc78592aa3ae4d661d30ee20e02b2b6b0de3590a181a936d0d3b38 \ + --hash=sha256:33300f2e140ccf26af3d8152e62bff71993f9310cfc63ba7a20940b0d246a0ae \ + --hash=sha256:3397b9032553d281ad6a9253b12675b65e0cc8cd7a3b0633cf48872c9eb13360 \ + --hash=sha256:34bafe9f4094315248573e6223e11af0ec1b25f9cbca43bf0e9a26a189ba2751 \ + --hash=sha256:35cbc81f937fc402971df45c897d2df2bfb2014efcd990360032aa0a651635da \ + --hash=sha256:38a7e16f061504ac2b45370bf5bf97e8250d8d3f25e37385bae884978166554b \ + --hash=sha256:3acd1d78397dead78dd1b011b5fc19cc823c190349acd549e63856dff649c80e \ + --hash=sha256:3d0a3681c12d3e0bcdea3d9414b04087828d6c1a482802d6f7f42c37ed530152 \ + --hash=sha256:3d73bb1f85c4150ac208fb0755beb04b2e44897bad81414de9380f98dd74729f \ + --hash=sha256:3d8bd4e58b6a5c2018d808f297905393c6c61da466a48c3f0596a76a4900ebe4 \ + --hash=sha256:3db3978211c3cead5437a80136ca0556bab8bc7828de15a762884b0598c41361 \ + --hash=sha256:3df82f0a3cef4e1bcfc799436056f0b978dda319d0bfd4460c6e479b2802d98a \ + --hash=sha256:3f3b4469d3da3ecced775d1a8c9c5d9fc80f259e30b7b89f9fed0700d6035ecb \ + --hash=sha256:3f73ee3956fde2d461c9e2955dd48166e4821fc8587d135e8780fb84da2a098b \ + --hash=sha256:4027bf6d7bc0a16df058ce913b69f10c5687f8e1ca668f08caa659ce101744bf \ + --hash=sha256:4184e78a4465dcda359fb403172b8951dd220929cb0984c02fabca1742fff06f \ + --hash=sha256:46a88f51770df7c9bc376bd57d3f86cdc7624b8e16ac4b585a655c22b7a1b4db \ + --hash=sha256:46cd3a73e9140410de62cceb66214bce0e08fb3922b9176fbfc1522fec151b41 \ + --hash=sha256:48a78a66fcce49d7f6156524bf979c0ac633d584199717c68c6ffa949fc14e6a \ + --hash=sha256:49c39c7068a494f8eb427155f5682f44feee43f9b3107fd54b1e52465379c54b \ + --hash=sha256:4b0359eb4c62f9993e176bc8f50450fc736a6b90dbcc05bb8584e948812699ae \ + --hash=sha256:4f12a9e27ca7b65e40a8475d27899b2d45064d9020e6a89148939e01987b5853 \ + --hash=sha256:4f48b345f831eaf4402ab6333c2dc3e2e2b5bc7b9c1b8fe12680dee3f0538f01 \ + --hash=sha256:528a61be40977c340cf201d23b69bd6a6bab507da60e9dbda85f8b30e935d70d \ + --hash=sha256:531d9be377fdcc05593b974656872eb82e808ebeb42a72515e3aaeb8bb7166f5 \ + --hash=sha256:550a2a1faf7559f13d5344f12d1eb886ad87955155d7dfab2a3fe5c8ec8fe776 \ + --hash=sha256:5539304fdbb2cc144df684d35a33b81145334d23e1c2367b5a923d25107f70b2 \ + --hash=sha256:5597180ed7670cc94c04c65347418a467d3a43d5f0cf52fcac647f5425f42037 \ + --hash=sha256:55eb268e5b81aefac759766c9162625b06c1bedb7b77d936225bafc4f038a6f6 \ + --hash=sha256:64a2a5985d81810ed605ff0dc4ccd6555efcb5700353825532a9a0aea65826e1 \ + --hash=sha256:65a8fc80898c9ce59f04349fe8b4849b1f9787f14e52ead990e5f849ff4727a0 \ + --hash=sha256:6618f481053b63fc6121faf8fc676bd9b7163c2a19d9e984a2e850002c28ab57 \ + --hash=sha256:66d70132b69b861805dc1ca46cdd733e54c416890e8f1371d2fd103f70b59c9c \ + --hash=sha256:681a9488c5a234397c4f013da065aa9e53eb7af4c78f1f80c6f15e7208acb855 \ + --hash=sha256:684c7ee9b4c04358fe6ac8b517ab51ec35fcd79d08ff0f105dd8bcd96885bbb7 \ + --hash=sha256:6b3fd0f3435ebb7a7183b32a6062a8b755f08242ced1f3f22761d30b56b3c2a5 \ + --hash=sha256:6dd8dda3402a01a1a8fe8b753a282466f615128574a5590a9108acd07b1f8540 \ + --hash=sha256:6fc735d6fe6d57f803e7ba021be4dde48e43e6aff94e6954350555d5332b0594 \ + --hash=sha256:715dcb72c3280c428c3a20134b87e42c29acec9669136e899ab2de69ca86218d \ + --hash=sha256:72e013665e25cf9d44779f01f340af26319756f9a76822b7c94ce6b1d93813da \ + --hash=sha256:73a32694603a34ad01d7e51a481a4023410d8099e1d0757e067945695c10f0ae \ + --hash=sha256:7562f8067ed9360e8b9739e5703403a7686dd1b36bf0f89fc538047c54cdea90 \ + --hash=sha256:756ba2d96d073c5a2a55d67fa22784763710fadbe22c41adde2d9cfa4dd78a8c \ + --hash=sha256:7580432cbe1e8b762660ae5806f04f869e1c02e519836a43f8094437e561e9f0 \ + --hash=sha256:76491917771f179f9772efe218c5ccc65950dbdb35f4439298d8a8dfc6ec1f72 \ + --hash=sha256:77890395cf37026a5907d3ad32376aa51f41c0f163b7477fdbd4f94966cc1d08 \ + --hash=sha256:79afa9726438912e5cddd1fe541815cea9763c92935f594835e4c432565b68a9 \ + --hash=sha256:7af03247d598a353bbbbe1b925deb735276e4d845e7197c4073dc89352b236fa \ + --hash=sha256:7e5727b2508f817f3126d6c33327dda32fe69d15514badfcd61db8bc4209ecef \ + --hash=sha256:802d1246c540e07486d4ee1adfa19a797e4b33529ffc371dc140644e8f27da0a \ + --hash=sha256:83362b64e215ef00b0ba33fcf13655ace6c9fdd144d5ad2ab59ac86c2daf166e \ + --hash=sha256:8643baeb590726c558b2faed6cd59b0917480f9367fcc692026f1a86d824fd08 \ + --hash=sha256:8bb09a2d19b04db1fa0e087a7ca4f12458f7e0e7364cfcd838441d86fb1c61f6 \ + --hash=sha256:8ee71a38c54bb2676bbe762b8b0943a79ccb1c2fd6a52054f66e63eda392f8c1 \ + --hash=sha256:8f590d46c30d9e4c1fda3efefe5443f4c2f6a4192c5ca2ba403653e9ebadf097 \ + --hash=sha256:8fae08e85b334ac6ac886002b5041396a31bcf805225bbe19847627203da99e2 \ + --hash=sha256:946f58aa59b08bcd6afcc6a7bd0ff54ed5eee844f32ad69fe6814836d15856a2 \ + --hash=sha256:961fc424e9d5229a99f8f1189942d8e7f4e1519147c3af64842f944aca03914d \ + --hash=sha256:996c2b891b441ec2b39725ee3e8386e2f11b4894b92be225fdfd54a3eeada2c8 \ + --hash=sha256:99bf9ea435cefcefd220f8687c3ddbbf78dc2de0bd11b57c3ae9fbbdf8d5561a \ + --hash=sha256:9d8c54ec32e5c102b9241f75d88ae26538b53662868ca491736611db448d9c7a \ + --hash=sha256:a125fac1f6b1e88488d208a86b578e1790e3c4937f2e1568d23356141d236220 \ + --hash=sha256:a337dc2d54c74430cd2febb8ee04f7c508ba8b3b412bf0463f077a66cfc73743 \ + --hash=sha256:a4eff405b545dfcf79cf0d9d3ff750e5c5a887aa066114175193a81d249c5ee6 \ + --hash=sha256:a6410b75fe07d5271eaa95fc24bd0a9177ed588d9d1c10c0cf67829adb8f0567 \ + --hash=sha256:a9647a0ac46255b8fef59a433a2161f03e5483f3a35e1cbd9dfe4600baff0c6b \ + --hash=sha256:b0944dc3bee3091039bf970d73caaf930c906013128a421bdc132e797494d941 \ + --hash=sha256:b10095528b866d322d33d6bf1709b7f8cbf959f12e8cb2ba22fc59c8717866b0 \ + --hash=sha256:b44308854ef210b9b78df9cdfd4e159513382a859f5ef8464306d14a54c2a040 \ + --hash=sha256:b7d4d7e6dcaf33e85f1919f03346403bdcc27437c420a78835f3805bca0ab71f \ + --hash=sha256:b7f2c26ce6ce0b1e0ca0d5fae96ea510e3a2e78b7207f06e76b7f2c87fa3d0af \ + --hash=sha256:b89d22a89d5bc05dd95b64e08295b8394aa96dc88e08f8ba210c9ebfebbe0489 \ + --hash=sha256:bb462d59146656e278d1e8ed913ce374d0ba68a4e081acde1867f6d3377fc881 \ + --hash=sha256:bc5354a124799f1f87b7637bbe6f18cd4bc66a1f37f6aa2b5db40f9adad531dc \ + --hash=sha256:bc53c3f3adaa939b7a063533ffe0ae1259e7073393c618043a99a6970a87e3df \ + --hash=sha256:c08ae35c1be2fe1ce4b4c628df5c6fc0dc9a87f8e5fe8e20238d249678984741 \ + --hash=sha256:c389c6f9d1d518e1249ddcb8a7f158135644ce2c508fa6cc17b680777dad5bf2 \ + --hash=sha256:c510dad19552d912058e4c3e3cbec3fb155dbe8d0ce0ceb7e7dbf5c5822bae0b \ + --hash=sha256:cb05c0ff98b56ba6969adf35556bc43bcb8d094df8bc9cb403acff53460c4e07 \ + --hash=sha256:cc0b37fe6f5ce5f1ccc62ad4fa9b1ad201d8e9b6027fd5e0170877beee4b2d15 \ + --hash=sha256:cdc57746c7ac0ea063351b4d651c3bb4dd4fd35e64dbb8e90c10e14eb03c4080 \ + --hash=sha256:cf047bc39fde5425be2628666d0f435ed8817859111c3aacc84b32d858069f5d \ + --hash=sha256:d06dcc420b570bf683cdb647cc8fe62b672d9e429ef711c3cbbb7a6880ca1572 \ + --hash=sha256:d0f02c633630e2b74522108ee95a84ad6e1204a8016a6cca5297f335ea27147e \ + --hash=sha256:d1039cb2de093225d597109342ce1675626bd127565e80b3044f4eca07c15b2e \ + --hash=sha256:d1ba5142d68dd2cb775cbd0ac8601819298152047803c8efe4eec6d7d7aa7878 \ + --hash=sha256:d4ec944947de098ad5a1738413f9364689a57067ecbc328e9de37218aa1e5cc1 \ + --hash=sha256:d57cc400275b9a2892e905fc893f732b21ddb95271bf96406c88e2f6367848b5 \ + --hash=sha256:d7db888dd0a1df1a653cae7f99d4047430d2187a3626eda51bc847b0fd6b9b43 \ + --hash=sha256:da506e669a8a851b59e122b4b219ea70996a6296f44f3a9348a852526ff961de \ + --hash=sha256:dac8b84c03e6029d272b8249c77018db83de59ca009a9adef7c144b4a62ee5e6 \ + --hash=sha256:db651a9cf325a542bc2b7b8cc8f1b2bdc6492739bae3103731b2f1c85b96cff6 \ + --hash=sha256:dccc142614d3419ed71857deb43f1d757829a4c7fce9994464b71e7e38309827 \ + --hash=sha256:e306e98186b9cd109121f3583aeb7978797ad21d948f22944c5c08845cd554d0 \ + --hash=sha256:e366587b370bc9b8b51b7b7272c610c56db5d5b4795b9e4a29d28ff2f440f809 \ + --hash=sha256:e5eb1762e7eb5fad34ef913e8107c7788a66f19d328e598ce95bf7217f9e5c8f \ + --hash=sha256:e82e10b9d290f60b63459cfb245a841aec347603997206296b93881463a93dcf \ + --hash=sha256:ed5ade1bb18f62edace1bd198c66f9d4c75a8385d5fd24e87d917ea1a5958773 \ + --hash=sha256:ee1d5fc9e3bd6a217906929cc97880239a91d20dae7746f538eb0eefee705ab1 \ + --hash=sha256:ee5465db6e9152a7d09f3215309326878c6aa3ac509195a369f9d264ff4bfbd9 \ + --hash=sha256:f0ba3892d81aacf36996c52f16bca04e39af31a6c5de930b7688ab617f4a6475 \ + --hash=sha256:f2066c447fdd0bca39a9633a082d8ce67bf9a539a203b85059a364a405dc9fe9 \ + --hash=sha256:f4aa0b0a6f81fa3deb211e643f6954e78b4376b62b9c218271236cfa757664e8 \ + --hash=sha256:f83981779bcf9dfa06fa0a8d4cb43e0faec1706328ce07aa3e7b665b4ac0f210 \ + --hash=sha256:fa02d561eb1d8d2f8ba43ba6e3cef4c6c402a3b632a9460fa329fcadcd5df6a3 \ + --hash=sha256:fbbe8265736659a6be2e6042b6a35be13545d14b243cc1d7ecf65f90d788a370 \ + --hash=sha256:fd8ac10cd2458b3c6343aac082fb9bd0e3fa806cb2c4975f2280153474b88412 \ + --hash=sha256:fdb2f528b50953e29d22033b3256c396a700193c6e45b2490222ef9c333cbbf9 + # via -r requirements.in +cryptography==50.0.1 \ + --hash=sha256:01f41478cf33fc605a6a089cd56d28b45c6c0b45a1928b61797f2621a04bac71 \ + --hash=sha256:05ba322c4da95b262a212c345af888ef2c37c88c0509756ea00a0e6d68850f23 \ + --hash=sha256:16c5ecd954b3330ebfb6605eca4fd952da8bef376551d5cc264534e3770a9ee6 \ + --hash=sha256:2a93d05e34d5f67fba6f891fe85d929999baa7195e853923ea6d7576c9e68c5e \ + --hash=sha256:2b34d76a652ea2b6faf777c35df230c5637842cd904e04f16230c3f9f03e4361 \ + --hash=sha256:2ebbfb0f1fed745e91796e3e1080a1440423fdae8ece1b995a1d80883a409054 \ + --hash=sha256:30a125032e5642a21ff816e021152bd4e7e94f03eff3f4b7fca41cd22bc3110f \ + --hash=sha256:330fbb252391c596f1ae42c5754449dc924e6ad012dca8efe0d703f9f2d12ec6 \ + --hash=sha256:359e62deae718bce96170e223fdcb6357e4fbd3bb7a3a75f4430763532560e49 \ + --hash=sha256:407fe2b6db00939c05c0e945e9914238f2f0a430974839429dafc82b1ee6bee5 \ + --hash=sha256:42be3bb70596b3abe4ac097b75be223e8b3ab614a0e5de068e3dcc54d71d6149 \ + --hash=sha256:4c4188f7c0cf655be5c06342b817ed0f9595b69ffa2b12026e5353eed29dea88 \ + --hash=sha256:51593d180cf6d179bde5c5d065bed81386b1f381656ae7d042b7ffc87a9895ad \ + --hash=sha256:51afcfceb15597cf2635068e4ac9a56b2abde622edde17f37d85fd7b5306497a \ + --hash=sha256:53e279950892dc102c6b4e52af03ae5ea92fac572a1ddab78ca73a997f62b69f \ + --hash=sha256:55d16b1ef3ee0958d893a977b19777887e546c9954ea81b200c3301a864013f2 \ + --hash=sha256:5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20 \ + --hash=sha256:5fe002589592ed749ce77fe0695fcbd3500dd61d7d6db5858a7544c612fa8e45 \ + --hash=sha256:5fe939deeb161024a6be98229c953b6591fef1f41214497a78fe793a244c017f \ + --hash=sha256:693c99b49bd37d0d096e4334c10232c77248c415b98d35236094cdf96d57258b \ + --hash=sha256:76de83fbd91ac49c0feaaa983d0748fd7a53176afac5fb3bf7478d244f0eb527 \ + --hash=sha256:79bf008d1f9af6071c797ad133e39915dfee7614f18f18f4db9072eb715064a3 \ + --hash=sha256:804728ce710890870f3aaa344b2e161172d258d768ac139d02cfd9092d0d94e6 \ + --hash=sha256:8921d58f426793c5f1b47f0b59575780de9a095214958d0eb37d909593db8367 \ + --hash=sha256:8df2de9102026855887e4587084f6eabd80ed0f345b8ad8a7ac27ab9bf4723e0 \ + --hash=sha256:9cb3cb952cf5a8abd50c782a98a89d71699715e802fe349704b47f2425b42a94 \ + --hash=sha256:9dde0a357190eb3b1da1bb9ab750e9c85cba82ca5977aa0836cbb94e92611239 \ + --hash=sha256:9ebcdd5519be9b652a46f507817a74591774fc3d6923ac364e4dfa64e36b291b \ + --hash=sha256:a0b1a59e3a089064a0ec309e9428c8e3ae4e161419d20ac33600767e83fc658a \ + --hash=sha256:a255449073358275b64b67d3f595f268bbef70e72b6edb65e0c70c735bf739c9 \ + --hash=sha256:a8f40ea47330e71b594a7e246898f93177c259490c63183dbaf9e571d71ed9a5 \ + --hash=sha256:ac02b07824d4d1001bd4367599f839c19cb171924c796e52c23508ac14c2c0cc \ + --hash=sha256:aed8db4f6d71c51efb89530e12d9464e7bf2923d46c3205dc794a2a93f8c0648 \ + --hash=sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986 \ + --hash=sha256:be224a65493ec5b74a158ff22a5522ce4a5ca1e543c647a3a4730d4a09e5f959 \ + --hash=sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0 \ + --hash=sha256:cbf74a81765ee67413503ca6e26dcc4f6f5a519822436cc0a1b97aab6c1b8a17 \ + --hash=sha256:d63ae8f6481fec907ac0f588eee8a90aefde112c633131fe540e5711ddbb5a4e \ + --hash=sha256:e22dfed744bd4002e909464cb23d2f0b05c6f3113a79ef2e9864a53db737c733 \ + --hash=sha256:e2ca8fd1b6b4b82a1c4cb02841d0837e3c12336c2e24b520ab8ab3b969733d8f \ + --hash=sha256:e74591e283fe6eb956416c929eb58262a719fe0311fd9054c62c3350ed8760d8 \ + --hash=sha256:f74455bb086a85d5e81246412602aaa97ed095e504cd40dd261ef50be42205bf \ + --hash=sha256:fb4b9672d389c738b175c4166e78310f8a70358886aacd9173ee03a85ffdc671 \ + --hash=sha256:fc3ed7ebd2a8c96f5b166de0ab9b624996bef3b07bbeb19364dfb78222c22c80 \ + --hash=sha256:fd3718b960d0b5dd213cdf03f3bcb7000e69dda0de8b956061947ff6bcff5558 \ + --hash=sha256:ff838d62ec1bfce4f9ba7fa16f4a7b554cd8d0c299e6be37502161a660c84eef + # via pymysql +dnspython==2.8.0 \ + --hash=sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af \ + --hash=sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f + # via pymongo +greenlet==3.5.6 \ + --hash=sha256:0616b8f878098c5681fd8f0dc92d887551717402342a70f0abcbfea5f5ad8a44 \ + --hash=sha256:06c0e933290fba8ffe53ead4ae1b8044b0e9754b75cebf381aa2bc3e50d82fac \ + --hash=sha256:128813fc29f2336a21b4d06eedd5e16bcc7ea46f59e9ff1cb30ea70e48195d88 \ + --hash=sha256:188bf333769b7145e2b0b4a7f09615ec550ed44d3a2a8395fb7b36f0e9901e13 \ + --hash=sha256:1c20ea32a73d17b9b60e3371240e17b0068120c98a5ec01a224a7dd8c89733ba \ + --hash=sha256:2ab5f42ac6c238eb71770715e6e909ad9a1a92b6c681ccb64cd5a0f07edb953f \ + --hash=sha256:301102a49120b095e72a7838792b41233975fc1c155daec6d98f81c00c9280e0 \ + --hash=sha256:311018b46472fb26ee85870847fb89eb64cc8aaddb617400789d87076f7cfeec \ + --hash=sha256:3ac3494c381dab876cad7d0b22f3a722f3e0c8deb3a65b9e7f35ad7f58b8fcb3 \ + --hash=sha256:3c6dede9133e1da41d561bc3fb14e92b47e2ce39ae60edefaad145658ea7c5e2 \ + --hash=sha256:3dbb4596a6a4e5d47121a33ff20533a81e60f302d9e67b69909a8bc21a43f0a7 \ + --hash=sha256:3deccbb57a481e3a408fe61cdfd5c13e0678fc0a30fdd09597917ca87b4be877 \ + --hash=sha256:45663c01a4de48b9a64a2ee1509d92d1dfd3afb02b2ccfc9333029d11aef996a \ + --hash=sha256:45bfd2b51e38aaa5f9849f114d9c7c1d75f69187c849b3549cd64c465283abfa \ + --hash=sha256:460e70b033aba8ed47e2ac9b5d0d2157b05a34fbfa30a241400aef4118902cdc \ + --hash=sha256:4fb8e59f68845d56c23c031dcd79c329f345e4a9d2ffac91c3d1ab366bdc457b \ + --hash=sha256:520648db8fb92eef7b3e6013f5a6f901cdf0d6685f639c2f7a245879f865bef7 \ + --hash=sha256:5599b380c1f28efeb724e81569eac80cd92f99a85bd9775456caaf3225d40b11 \ + --hash=sha256:59deccd347735a7774223b05a93773fddbb298aba3cea21be4337fb4752dbe32 \ + --hash=sha256:5a0b2791239c99992a86c1b635b787fe2a877d9eaaa26f8891ce943832b585ae \ + --hash=sha256:5adcbbfe78bdc242c71740a02e0991cc1b2f34d33c8bb15ca45eee8fd1140942 \ + --hash=sha256:5b602b4201b965a8354d74e232364a66ff243dd142e350d035f46169bb36e13d \ + --hash=sha256:5bbda3c70dd35d60671bc33b01916802707a052130d9e50cdb871d34594d35cb \ + --hash=sha256:602024dae6d77e161f4b89491b62ca1d4f19949d79d47b2db057e476d21179d6 \ + --hash=sha256:61a61b4a95a4f97922c3a6f5606d3e360851584bd47e500a5161373c53810e3d \ + --hash=sha256:63aff70fe5aac59c72215f42ec39fcb59ff46774fa966e717f8ecb6ee2273577 \ + --hash=sha256:71890d5247020c25c21a6b65202782bfc281d4e6e244842419d30e3492bb6dcc \ + --hash=sha256:73a29b5ba642e35433166a03a3e02935e7238c4b3467fbd77523b99edea23e5b \ + --hash=sha256:7969bffa322c097bd46ae595ada6a931cefda613f18ba64587e9cff4cb320756 \ + --hash=sha256:7ac4abb3877c43af320392c664774eef6fa2cc063c79a55fc02d844a3cbe7395 \ + --hash=sha256:7f731ebac68ea06d628658295cb2d217b10186329fcf9a3b6a149045059bf92e \ + --hash=sha256:7f924a5a9d5890649566f2f6682e0d8ad8ca23028bacffbbac36dbd7fd680176 \ + --hash=sha256:874cea8bb1ec1ddccbacbd027856f6bf496f6bc18aba97a918c20e067edab236 \ + --hash=sha256:876077e7ebb8c84ed068e2b23d4c62ebb010d60df84b9591af1be2f39010ffb2 \ + --hash=sha256:886bcf1870af74c32bc310fd00a6b803445e17e51b7d5a107c7b35c0f362cc16 \ + --hash=sha256:8b27df301f56e3b3d2298095c8f7d6b68f2521f6b1693e901fa039bdbae34424 \ + --hash=sha256:8b7c73d1cef3d9ae963e9ff03f6222df43efbb9054ffd2f1969c935b7fc84c02 \ + --hash=sha256:8cda13494d86a4f12429641117cb6ac4bbbc9c30a33f711f7d3a2e5fbe4b0b7e \ + --hash=sha256:8cddea1b8339451c2fb3388e138347b6126744f33b611bdb55b7357361cfef46 \ + --hash=sha256:8dba0129b93e7091dfefaf4cf7000172741bff7f47bf6326fcf17f32fbb54d6b \ + --hash=sha256:8e67c43bdfc88d5fee6db0d3e40175b362fc95fb85f0412d233b9b203c53a575 \ + --hash=sha256:9133d68624b1f2e89ec2f554d56aea8a5b0d7168cd9320200ba58d4d794845a4 \ + --hash=sha256:916f92f2a8db10508f739d0b5e00b83defe5d1115a997c54532a6d7cf8c95404 \ + --hash=sha256:9297fb9c39b9a2c039dbcd306c410bd6906b95244dec3bba4318d36c718c164c \ + --hash=sha256:95e7c44d072db623a1aab04ce488cf9533294a77ed9d072cd503a3596f4106ac \ + --hash=sha256:975736b002ed080d124cf81a79cb7e05cb26d6b3f5c7a7b651c0fcce70353aa1 \ + --hash=sha256:97c5a53e8c1754df58e73f047a99e287d4da1bdfe64b0072fb25c87000897951 \ + --hash=sha256:9a09d59bef1db94f384b5bcc2d523694d338f3df6b757aeeaf7baca5d0c0be88 \ + --hash=sha256:a364c1ea75dc51b83a17f52fe0c79cf8bc4ddf740403bebd4581c7666eea017d \ + --hash=sha256:a3b4a01c6da07ef9f80d4fe8933b994bc99747bcea3eab0330a9c34d3c12655b \ + --hash=sha256:a5876d0a60355af98d535c47f6cd6eb0f8a432396dab26845d380b92f8412422 \ + --hash=sha256:a6a4b98a9132e0f45c9fc245a63894cfd8c45fb7a0d6bffc5eab3ec327cf7324 \ + --hash=sha256:a6b4ff33f7e011bbaa148238d131c4fd4f8afbab3c104ddfbdb2b12b74ff7016 \ + --hash=sha256:a93ee7c6e8fd0f8a83525a51bd777be57ee17787e91d805bd8d6faf9dcada18e \ + --hash=sha256:b374e79ffa7511afc11773aef40a4ccea6191fba1c856ea2f9c56738dca69d7a \ + --hash=sha256:b7d501d5eb5d4f67207df364752ad697465b834268744be7581c18d81d35d41d \ + --hash=sha256:c59acfa8eb73a1e0d484392dc002bdf001fd4ce73394e0132df3d1ab6093d7cb \ + --hash=sha256:c75116c9de79949de23006e2d9b35ee82874c594fcf5c0311b439acaa14b8441 \ + --hash=sha256:ca80a49b53ed1d22f7282da7255f7bb2fd1935fd0f623d8613fda38745f18961 \ + --hash=sha256:cad5782f93f7f738b62c6527b6f32a60694d924029f299a8b524758cfa53d815 \ + --hash=sha256:ccadce0130fd813ec86ebfe969a6c58b42acc1d0fe55a47525375b740e07b605 \ + --hash=sha256:d701eab36200c36224833d07dbdb709adb7fd4253429548ddb5e547b8ed40586 \ + --hash=sha256:dad3d233d441a022c1f7155f0fb9d5aff7b97c1ea8c7dfa02cce586b16ab2d0b \ + --hash=sha256:dd0b83bed3405b586a3133629f1d1a5bc7bfd64822a3b7ab342bdc68e6dbc61b \ + --hash=sha256:de3de000d459402cda015068fd135aa50c0bf6f2477a80d4da1e646f123b4e78 \ + --hash=sha256:de9923832f2d8c1a5ecd8d7260465a6ca5a86888a0d129e3bd5cf0406d2fc5bf \ + --hash=sha256:df19e2d0b1620039af5102563fbd96e8938c7f5c3f5828528d641d9fc585525e \ + --hash=sha256:e85880b538e59a59f55117b81f208a6660ad5ac328aad9305f812d9b8bc67a0f \ + --hash=sha256:ee7d9da3bf493909cf811a3f038840cb34fab5ae2956b8a263919f6e289ab188 \ + --hash=sha256:eed88b64a5e5da72d6a71cdc5aaeefaa5ced9b748f8d19f89800b339961dad39 \ + --hash=sha256:f0ba7c2a329d650628f4c8572fd1db29f0a59dd70a3e3e0710dcf18a35cce9d8 \ + --hash=sha256:f8e63209c3e1e828ee6a457529b4a6d8b05d050fe0ae03a7ae49e967c5d312e0 \ + --hash=sha256:f8f0bd690e1a41294ac87905e8121c81a3761ec2583c768f13467428606c8c7a \ + --hash=sha256:f96f0e30b5a95c7631b12bfe214cbc90ec8fe8cfa36920596c10514a65743519 \ + --hash=sha256:f98e8215e172f567ce80eeaed9107fb4d32b6c44f26983d9b8334658136a205a \ + --hash=sha256:f9fe868463ec7e1363733af77e38a5fda3e9b63940337048c945d69e0c80ff24 \ + --hash=sha256:fdacf26402389bdd89857ad3c045a26fe8f3314f9a8b28226f82f88463a65b77 \ + --hash=sha256:fe3170a69fe039b18ad18171e66faa9a75f6fe9d78f968fd9b54e09fbd714d81 \ + --hash=sha256:fea4427d1ffdb3b523d7daa6712038428a4c16c450b9777bdd1221cfee0eab49 + # via sqlalchemy +idna==3.19 \ + --hash=sha256:5e0811a4383b21dc5838069f801c4fb62113b7447663d2530d2bd6e77b49bf15 \ + --hash=sha256:815e7be7a7806d54abb586dc943addc79e8b2ee16915059658cbeff4b1b43bf4 + # via + # anyio + # trio +iniconfig==2.3.0 \ + --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ + --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 + # via pytest +outcome==1.3.0.post0 \ + --hash=sha256:9dcf02e65f2971b80047b377468e72a268e15c0af3cf1238e6ff14f7f91143b8 \ + --hash=sha256:e771c5ce06d1415e356078d3bdd68523f284b4ce5419828922b6871e65eda82b + # via trio +packaging==26.3 \ + --hash=sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79 \ + --hash=sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c + # via pytest +paho-mqtt==2.1.0 \ + --hash=sha256:12d6e7511d4137555a3f6ea167ae846af2c7357b10bc6fa4f7c3968fc1723834 \ + --hash=sha256:6db9ba9b34ed5bc6b6e3812718c7e06e2fd7444540df2455d2c51bd58808feee + # via -r requirements.in +pluggy==1.6.0 \ + --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ + --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 + # via pytest +psycopg==3.3.5 \ + --hash=sha256:ce5aa5cdb4f9379f00f487590e5890bfa7df9a164648c969ffa628505e21af4e \ + --hash=sha256:d0a3d9ccf5788af054cbd745278cb02401b5c312aeaafbf2c6144460aec47da4 + # via -r requirements.in +psycopg-binary==3.3.5 \ + --hash=sha256:0249c3e960cdee686000eb77169fb6590105c05bacc37e057ccdffdcd8e6ebde \ + --hash=sha256:04f64b39830887c2c737b522cbfd6ad215d65e67ebfff674aa4cf21c02af487b \ + --hash=sha256:06de14ac978a2d53e864069fb5487075c6e3cfb0740f1bfd7017bc8b9942067f \ + --hash=sha256:0d8a4b7ae47f3381e2ded89891d2455b809f4afb7e5b58086844abb8cfa420ea \ + --hash=sha256:1344fd57a19737554670e67aecabd4fb37cd7937f2925840009645d641117e5a \ + --hash=sha256:14f432430fd9e1a9e7d9ab2fe14956c77f5d074ebdc556a1ad04e9a1bd3fca04 \ + --hash=sha256:14fdfd65a96ecbd8b586d14546105641f4a6ac7cbe335c786830ea4de94bbe60 \ + --hash=sha256:19e5bf9872dbd164c220567fd385ba2309c7d9df1541f78343510c6b0f36a1b7 \ + --hash=sha256:1ef2e498be47800f6202b9a2304c22646325ca6d54001b7c785bcfdb24a1e8ab \ + --hash=sha256:2111f880add40fb03c60556069ad68e884a0908a74d2debafc603caf93b73552 \ + --hash=sha256:25105f9b46bdf2a30fcb67f56976ed66f6855941ae16bc024192609b917d493c \ + --hash=sha256:2719fe19a4da752c4110cc767716d0a5bdb760d1153d89018bb7c9c61717bde5 \ + --hash=sha256:358748fc4c8ccdc0e2bdf55420494930e19c3ade586ea9c3a6de3dad1f897311 \ + --hash=sha256:35885e333020fc152d27bea1a494bef13b2e68f6fd92b6229015e93539152008 \ + --hash=sha256:39e70c8e3b5fad70e2970ea4cc502bf3b612018f128aa1c670f1fa78b9774543 \ + --hash=sha256:40505676b1526b9ea387dace034040a8c8b0bcf984cd6bd4720a2ab15e813586 \ + --hash=sha256:40f8b132c7243ef5f503f0b6f986bf16d38a51b0df1c6ba2577743f128be03e3 \ + --hash=sha256:479b96fd78149cfa10369dc53fbfb89ee729be13146b584a23dbc7e164c0cf1e \ + --hash=sha256:4901e5b9a31c230211a1871263b6594373bacd770b14ad9b14d349716cb69cbe \ + --hash=sha256:553b5443cbc94fdb9b0e31b62acdf615e0780982d6b13752a15eb3d6c0dfd0d2 \ + --hash=sha256:5698ab5941a4d138c30fef858588e651fe7d583280cd6e41832825ad9e747750 \ + --hash=sha256:5816472e3bb05615f33a741e0835043d1f4bf9709ff30d2f4aed71815cfc6b5e \ + --hash=sha256:5b981d25fc2dd13fa7328e40703ea8a03f3e9d855ec946431e96a23206d3b9fd \ + --hash=sha256:682a17a57415c3ca1731eec018ed031f012ffcb81ba74806eb219cb396065672 \ + --hash=sha256:6e85d50b87257fb117675a19ee59daa7bf9a57f6431500adf7059df799232ef4 \ + --hash=sha256:7b443f943abfe35aa5a776630cea27c9348aa66659286cee0b99084332252080 \ + --hash=sha256:88e01aa2e938a45655a8a5213fc3a44ba78cb4cab8a569b3e0bcb3d1d0eaba16 \ + --hash=sha256:893ce86a4b997f6ca1261a7826db2506727332a6ff66646fa7f024b39b5e630e \ + --hash=sha256:8dbd694f3741dd4ac5bc60b70e17f7841aefb3f0f38cef4d2756de270e03af43 \ + --hash=sha256:972cc28e943746e71ede254a4dfd1fdfcdd6dcadd6f375703849859f09377f24 \ + --hash=sha256:98a388509306e5e08a4203253ac52846bc1b034e5cbd0ae6da1211593cc28594 \ + --hash=sha256:9c071bf78e5c2e6efa40bc9089a954d7b41221347a72f35c6bf2d8c96e632f75 \ + --hash=sha256:a5e45e4bb68656253ce5c7a344c0a425c293581eba954d7fd7c2e4b2dc9f3038 \ + --hash=sha256:ab39e2794b95af61a2ff69e33e5ab6ac5df36e9ffea9a3b18e38b2aaca8c5ad5 \ + --hash=sha256:ae67072db949d0c094b747a8ec52ad0fa3c42b27842a5f746f3613d54dde3fba \ + --hash=sha256:af5084124fb2fd16557073822519dfe8c389636a16adef661a4c0c3918733171 \ + --hash=sha256:ba466011569297114449df9d523438e1adeedf3e4f31ffb78e897ec3fef3076b \ + --hash=sha256:c065531e8c1815276f50dbfa283e3a7f022671414cdda6fa9a16794dd53b28f9 \ + --hash=sha256:c09775c549b40b274206e1b043c5e5b5af39666e85c98382a30bd05d23ab677b \ + --hash=sha256:c0cac998b9b1e82dec853d2e53b3d34d56a525cf231f9441a636cfd5992929a9 \ + --hash=sha256:c6bd84e4cf67930f26f015dec33f615472b9c5871d46408efe112dbc1bc021de \ + --hash=sha256:ca8af7c0454cdce235d4aedcb5528857468f1490202d25e24fc7af40e176d563 \ + --hash=sha256:cb3b3bffebfe07110730626e76238161124f35ac87b748d663316a28d22f58b0 \ + --hash=sha256:cd0faa2475ab254ad1b507430131cf7f7f0be927ffdc03c32ad3b33d2ef63f42 \ + --hash=sha256:cf0e5e63ee86098299c673992053d556c489ba9ae6aca6cb6e24d16a8e0b09e6 \ + --hash=sha256:d06da67e9c687c6a6fdac9da4b17cbeb296ddd59bd01f6416ed4294bc57c5faf \ + --hash=sha256:d2a61e8147902771df7efe14062a3c8736347850d0d8befcf048235752504f2e \ + --hash=sha256:d8b66353b20e79bf7ac0a80f03ae97f522ccbbf909d687eec62f112e56c0276d \ + --hash=sha256:df209e64674a34b41662c67fdc8b4e0ffd77d2136393790691d086a09f9a6cab \ + --hash=sha256:df9853b832b7b916e02ef68e0d5403a7dab2d5c1ddfe94f22b1b155eb862622f \ + --hash=sha256:e5becd311f9af8d180bad372f51fb2252fd02cb2073056e2b170c9274f95fe7f \ + --hash=sha256:f45d77e398542ce0937d9fa3cd9d84e9c5fc6b34c50a66404ae840bada312750 \ + --hash=sha256:f7e1e45aad410e20de45df2b159df68ff6c8dbf47a3501f806c4489b27f4ad2b \ + --hash=sha256:fd5b047c9fd887b767d063845413e405f5de8ce1dc7a9d0da0637b77b836b469 \ + --hash=sha256:fdbeb38c9b7ca8fa57a7bda3802bedb62f4494ad3dd46c7dd36dc3f77fd5093f + # via psycopg +pycparser==3.0 \ + --hash=sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29 \ + --hash=sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992 + # via cffi +pygments==2.21.0 \ + --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ + --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c + # via pytest +pymongo==4.18.1 \ + --hash=sha256:016d21e7fbf55ac89f419daa48da95314896205d902ed9aa4058f26a436e789c \ + --hash=sha256:054b0ba7c5f1c6ddeee058ae808d7aafab1b2d2278d81e70d8a81fbff8d85e0b \ + --hash=sha256:060e3494e7db52bc08bf27b5d7e1920a15b953d649f10c7c71dd68b4a2dac564 \ + --hash=sha256:06d7c9f6388552b1c2b6ba6ea9f60bce1d4cc9c6f5c5e5d103fee7cdd20bdcdb \ + --hash=sha256:088e78ab7340d7ab4c14cd7a96852f9ea3b51c25fc9fb02244715d21f57ec2e5 \ + --hash=sha256:0c3f52a1a793262ef1af15b36535220d194b3ad5ce7564f98c15f3881ffbc269 \ + --hash=sha256:134a8f787360c3cea18cbbc126bf51cd233f1789db8099f7081ace5b1cff7e22 \ + --hash=sha256:173a69caa539731284a815ee2fd616442431d12e8c84d970f3cc555d9ac5ef81 \ + --hash=sha256:1a78dec1c10eaae298aefc6cd7ad916ca2ceeb51f8ff7946dddbca97adf9ed0c \ + --hash=sha256:1c3af67eeff3994ecbe63c711f76e6eb6a7212bc92c3e89f220ba9addd24e1c1 \ + --hash=sha256:1eaed0c72bba39fa42e6167636d56587e30cdab13ec3178a68ac85bee093d44b \ + --hash=sha256:200d873d4972bbc136831a489fbad7631c63503212711b5206037ef8792f1ac8 \ + --hash=sha256:26128b99e50840597431a9c6b01641a225fd5636474d230ec5e174d00a0feb55 \ + --hash=sha256:2653a7df66ac73c18cd0aead309e5585805a432d332efe242540d5e78b01036c \ + --hash=sha256:2869a54f0be27fc4dbc5967e5dc30b29328916925f0c704aa75e74c4349fc79b \ + --hash=sha256:2978698a30e8384abbc37ee0095a9d1c6e9d91462aacb0ac1ec4d6b672a2c478 \ + --hash=sha256:2a4f25e078e36dfc3bd4c933c5665dfb2374f794e2aa68601e98181372f59714 \ + --hash=sha256:2a8fa93a1163a0ee54ff7e2c5c9dcbbcdc5097587ff95d085cf21ddc13c660a2 \ + --hash=sha256:2c8e113867a9ad1eb1c28d2c21fbc896dac1d8a246be802151ea37d801233c73 \ + --hash=sha256:2e50d92eab42a417d503556c9f8e03240dddaa21ea343c4b654d714e9928711d \ + --hash=sha256:305877cd97e4344fde699c8721e4cc9890a689990bd1a1783eb5d0946e093d13 \ + --hash=sha256:3275caec57b76b9e4948c677491d9d5771bf1748afac3d2d7e3242067e264571 \ + --hash=sha256:438171ed19d62a1756db397ee5ba61429d6e9811188394f5aa775a0738327554 \ + --hash=sha256:4541273796aa3022b39de892e265aac4a437adcc6e4894396c23258d990f8c97 \ + --hash=sha256:46740b56e206d4703ac7aad05c9a72177c16854c6364bec4cd3b55d0e79a1adf \ + --hash=sha256:4a787cd29b6bc5735ced10aba4ec052d4ef2d2a82b4875efa8539ecd635e720b \ + --hash=sha256:4b8f7b212ab86552db2f35b2779cc290561a341b73fba1ab1030ed9d48e1b1e5 \ + --hash=sha256:4ebb5a6a42a1512a86f774ca517b4b56aacd0ccbde535d787cfd9789c5905e2a \ + --hash=sha256:4f3625ade4a66327a7ffd7a5742be1b2f15fae5399d2c394d79709420c1482b8 \ + --hash=sha256:55309ea9f6d8f697618f12f1ea2b643f26df434de043cd5de6f96426093011b3 \ + --hash=sha256:58a70d491d872b64b0797581bb5f713965cdb822a5f52627869c3e99c1363021 \ + --hash=sha256:58c3392585c5823ad90e318b6e7c0fb0709763631fb06d81de45166a1844ea18 \ + --hash=sha256:5907ccdcc2f7925100b4bed8069acd0d93156e5cf013a8e15aa5932819ce3d5e \ + --hash=sha256:5da669d4ff5068c4b056ad7a43cb02620c285bef054c3577b65a4b51289ea512 \ + --hash=sha256:618cab1b693ef0561fb7682ecf1f6044da1fefac0d96efc2e2f19b939f276e9f \ + --hash=sha256:67d56552a940d3553024fdf39535975c4de2ff5b82cf20287ba1ffef028f004b \ + --hash=sha256:6efa17c81f431c3061856b29bcb329f8a15200d56c15796720ba89767409cc7a \ + --hash=sha256:70da34fc21099c084741c6318c435e1358db8f4492668b5ad21d8c5d146b0741 \ + --hash=sha256:7c830b5fdf2d0db8e217a12e076c7e9d2ba25e17ac6b6c7169324bbd63800ab7 \ + --hash=sha256:84b5683b644a6123fc37a1d3bb1dda5acc5a855823b044232b1957ff1c31a049 \ + --hash=sha256:8b46ef2de0b077a2c708790e9ced5c8afb5b9deef1cacba28e8d9a90027e86d2 \ + --hash=sha256:905de2265c70365354f920227c9642cd33891a4b077a8f13b190665a51567c9d \ + --hash=sha256:941ec8fc2d32e88c3603c36ccfd2f7fc44f89d31519ca1388615257b634f68f3 \ + --hash=sha256:960c61ed86a316d3636b1f184006d3cc2b972b8546186ae8e2c8324e397632ff \ + --hash=sha256:97e45de5402a3fa63e010e16f5fe00d38f31ff66291a2352aa0d254bbcf2119a \ + --hash=sha256:98b99909ae51e8f61dcad4ef125b204fa3d0a493567253b0dd8f666d706fbffb \ + --hash=sha256:9b97f849c86bd2ac7ce444275647472f8169022352f8c4df2dd002ed6ca1ff58 \ + --hash=sha256:9bf92d46b15fb8fcfcd517442b0b90055924d835fef77e574ff4678b40be49ce \ + --hash=sha256:9da74b79e382bb37311b9bd5beb89f1369a1c3e27e7c97bae79661cfdf3893aa \ + --hash=sha256:a9a4f4638b038bfc2cc787aaefd390ee6617985dab6745b7969261e30ce167bd \ + --hash=sha256:a9ae9c28e6c290c2524c3288a0a6e27dca958daeeaba2f36a6a4ee97c44e5f49 \ + --hash=sha256:ab33db087dc52f8f28bdb8680682ebc8fc5fb0be84e89a0853a8dc059fcc06a8 \ + --hash=sha256:adebc03de2d1520bb163953361779288316e4e9c4b66fe4ce9e91d4183e313b8 \ + --hash=sha256:ae18db68105a0ba7adc190a13cbd73e6c87593bc55a336719f70ad042aa66aaf \ + --hash=sha256:afe2b10be8aee035644e5559af5fc54c290365cd4e5e38e657aa119b8e9acccc \ + --hash=sha256:aff3582edd807980e0f910cc20b3f588b8c5533556b0aeb3f33d88c7681f9b21 \ + --hash=sha256:b2ef166249993afd94b704bd25af27104fccb259580960a41355f8d7869496ed \ + --hash=sha256:ba651c604fee5bbb7021b79dd73da12e834c661a449a2d6140f4574e6e3a897e \ + --hash=sha256:bb327d3555ac4fbd0da657ea3741812b3a1e61e4603bd121298381f5ff5ac396 \ + --hash=sha256:bfc19d3f4e095f354dac1389ef099376a6ee9394b3259f6281c9e68f85ccc029 \ + --hash=sha256:d04134ff4ea0e7d14b6e2ef23dbfe06112a99318c9578b213d2dee9060b23dce \ + --hash=sha256:d1e63d2f8770f0cfb74c7c3fbe35c6b2828f27a16395a7c4019c81451e61489e \ + --hash=sha256:d3f7e608db9a9dcdfb1f97cfec19642bc912f85d3b7a9550c4431c7c87ebe672 \ + --hash=sha256:d5893f41e2832cba8674f3b6cf22d39c0d432d80b7d55ad8ddc3dd1a83a1bf12 \ + --hash=sha256:d9be9221bf2db1562d490bb67522ce2f7378513bc8bcc157e824a0bb3d87eba0 \ + --hash=sha256:dbfed8f6b312c6c110495d6ead2b0da1252cc7bd01029700f08e336036f023ee \ + --hash=sha256:e99d8a30d3043a3daa2e75d80ab99283472ecbd98fc5b4e4c1cd79dd285a9748 \ + --hash=sha256:ea4b0017c24695404848570c4001ea34756f0c4739042e49f02cf0b8fb7e3a47 \ + --hash=sha256:f0a6b59282941d2f6f62acf35fb75bae371d3194ab041f0358446668f9df10be \ + --hash=sha256:f267d11333ecb19af9b30458fc14e71f2adb131bde0b3a4fe6f63be7ea9a5e6a \ + --hash=sha256:fbef9ef64cdae97e85b27cf00e203a26a016f7c803dc9bd0ccd48b3adade1232 + # via -r requirements.in +pymysql==1.2.0 \ + --hash=sha256:62169ce6d5510f08e140c5e7990ee884a9764024e4a9a27b2cc11f1099322ae0 \ + --hash=sha256:6c7b17ca686988104d7426c27895b455cdeea3e9d3ceb1270f0c3704fead8c33 + # via -r requirements.in +pytest==9.0.3 \ + --hash=sha256:2c5efc453d45394fdd706ade797c0a81091eccd1d6e4bccfcd476e2b8e0ab5d9 \ + --hash=sha256:b86ada508af81d19edeb213c681b1d48246c1a91d304c6c81a427674c17eb91c + # via + # -r requirements.in + # pytest-lazy-fixtures + # pytest-mock +pytest-lazy-fixtures==1.4.1 \ + --hash=sha256:42213af5859ea4a3c7ec86a7f9dbb43efa9b02547460bddad041e846cdcf921d \ + --hash=sha256:8684abfd4914ea01f1e2f7b24524739344421d8f3f12286fb3100fb5681e1181 + # via -r requirements.in +pytest-mock==3.15.1 \ + --hash=sha256:0a25e2eb88fe5168d535041d09a4529a188176ae608a6d249ee65abc0949630d \ + --hash=sha256:1849a238f6f396da19762269de72cb1814ab44416fa73a8686deac10b0d87a0f + # via -r requirements.in +redis==8.1.0 \ + --hash=sha256:6e1a19beef9225c83efd689c7e6b7da2d5215b1f42cd13b7fc3714d0a09c7b25 \ + --hash=sha256:a4fe1aac3d3b3cc791d4b3d5931c5a956045dc951ee74d1c913ee3ac4d2ee9fb + # via -r requirements.in +sniffio==1.3.1 \ + --hash=sha256:2f6da418d1f1e0fddd844478f41680e794e6051915791a034ff65e5f100525a2 \ + --hash=sha256:f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc + # via trio +sortedcontainers==2.4.0 \ + --hash=sha256:25caa5a06cc30b6b83d11423433f65d1f9d76c4c6a0c90e3379eaa43b9bfdb88 \ + --hash=sha256:a163dcaede0f1c021485e957a39245190e74249897e2ae4b2aa38595db237ee0 + # via trio +sqlalchemy==2.0.53 \ + --hash=sha256:03dfba40d1de2da62370d5e85ba13ffb8e75f16e8af9e93170a9cf4f394636a5 \ + --hash=sha256:0417dac5a5bbc7bff3fd95f53ff193c0fdcbdde4b3119ca2f46651190e65144c \ + --hash=sha256:05faf168e324b5c609df10530d25620fcce7a815635c653903d3f459617b85bd \ + --hash=sha256:06f3a9a4e82bf984d840c26dafd19688a4e2bfc7401d423cbec960ec737c610f \ + --hash=sha256:0cdefc36945decf40c199ee39f9df3f0765754b9625cf136118b04206854a05a \ + --hash=sha256:12a3bd96dafcf830bcebeecbbda5921cdd57e41bd074646c285a92d4f76862c6 \ + --hash=sha256:13f8f63343a7c34eef67bc8cf8b99d4a875d9f3431075ded7ffeabe22a49ff34 \ + --hash=sha256:255c1ca3810da6994b755c80b3abc27a5fb1d45b6703985092a2f6663f9daa9e \ + --hash=sha256:29e7eb8bb305411f26ead6854e7591cfc6a5b3b6b924a31bd8b843ba243a3ebd \ + --hash=sha256:2ff97dfff33e9c81e57be565ac58b9299affb566e10570cca668e4d67c69567a \ + --hash=sha256:3fe213af5d7e11c91692505ecadb7b0980c424b050d8b6458e39f38090094d7c \ + --hash=sha256:414a71d25b18cd3d1d5ab18b512a550a34398dcfbd68336adff5cd1e93fc7f0d \ + --hash=sha256:41548248e8a5897d3a5f67ad8c1edb78efe72ec00dcc985b5c19b7850949d039 \ + --hash=sha256:4993b0bd56696ef37dd1ab6caec430d4c256b6ab17e23108c00e0da25b97e38a \ + --hash=sha256:49e366b972504f0c600de8ad58054017d7b7a5176e5765cea7df76b5e05548d2 \ + --hash=sha256:4ca22c441645ead511eb73f1efdb0f3a723f138e28f8362224813f64a8097e15 \ + --hash=sha256:577195de5eccba4fea6c289e7537e4d309d9767d16b31afe82deda1f241feb80 \ + --hash=sha256:5f90d64f69cd80ef0acba1e92357bb412e4ba71476b745c83d1499c3b0383303 \ + --hash=sha256:6499513a0ca3984f7e4c4af22dbccc156eeda8846a4c4a2287a5b5e33b3544ff \ + --hash=sha256:659daf25d61973ad6dff7bbfe9fccd116da2ab27618f57c3b9bfb97cb02000f5 \ + --hash=sha256:73c969788609d8158e50ca9fa9eaa9ccf4953bfb84180f3bc8f2af50f897015f \ + --hash=sha256:764eebce5bf2046172f6f32d51ee47b0acc0dbdb05262a6382875267bc5b97d4 \ + --hash=sha256:87eb05fc61a0835dfe1cbf135d0f99cb2764ad09350d92fdd3fe1b827a557d65 \ + --hash=sha256:88c296bd7b6e653d428aa0c97e806ac1e0ad25c385f4dab627b832ba46b7ad91 \ + --hash=sha256:90242b1ad2bdad5fcebf32fb2971465edd4034e0381c1d6126bcb5a5b1851f18 \ + --hash=sha256:9049aaeae45d30dfa3bfba105175a358bf32e9fa563e281a016cf44d8aaa6b5f \ + --hash=sha256:92482d02d28ddc69c643f38e24662f26552734fd56241454987df81799a1f208 \ + --hash=sha256:95b04f3113d8e02b711bbb3f6be5493ed94585b086b5b68571ea324e175022e5 \ + --hash=sha256:a02ff597675e80a7b312683ed88957120bd5b32ce69d92a8c696ebdd9c5a25dc \ + --hash=sha256:ab1489a2a417f5d8f03d2824771e168ac2da8db9c34e05de8a404182390d67e7 \ + --hash=sha256:acc9ee56130c32b609f562ac4041f77311aa6b3c51d507bd3ac93e280631eeed \ + --hash=sha256:ae1a152a25bf194dbcda7d8ada169963ae7ed212951edc30fe72f1d4fcb96704 \ + --hash=sha256:b06667e375da212f2ff4e7e54bf547ffeb63700c0743fc21c107f7d64f632922 \ + --hash=sha256:b06e32d92ed898240793982820c46ae22bdec4f24dcb4ae4a6859001674db186 \ + --hash=sha256:b0a3481fdea08ce9f93c318e40c446c91bc63260a5eae1cf06d85b4d4d5651d4 \ + --hash=sha256:b0e18570b7ff815f9d1314c08bf2d62a139e6229653ce952ecdfddb8fc9e8b49 \ + --hash=sha256:b568a8ac0778988c2710476017ff74fb5dcb9b9322d757189c3d7fc4cc8026fa \ + --hash=sha256:bb684d78694f77991cfc6fd8ba3bba093f06d7efbc354ea84b077a0d2116464d \ + --hash=sha256:bc02d73633f5cee4ebecfc6c20b09a28bdfd940cc2ccf5bf119a6a7de6b5a3a3 \ + --hash=sha256:be6c573bdbeb9dac8ae646d077a3c4fc6eb838d75ee47a16529bfea2e9a81837 \ + --hash=sha256:c6ae9b4632424374efff2e0b2d699fc1a3c23e30e2d30dd9d4cf076edfc87a4f \ + --hash=sha256:ceb32cdde9bdc93c004008fa3d6e4481b0978e46c6478ce8e6fffe0fcc1c9a0e \ + --hash=sha256:cfd51b94590814cfa5020534225f61dda1af485299cd2dbb1ee8112d0e92b52f \ + --hash=sha256:d26a8411cedab7102f31d766711f3e5fd93bf7d3a1470200bacaaaac7faaa826 \ + --hash=sha256:d31e2714d6f5df4a308d8e5aafecb6aea1bc386bbee671044492f9a124461ce1 \ + --hash=sha256:d8281ab632616d364a158d64a2152e2215370143c940693d31d7ff60e9a2ef4a \ + --hash=sha256:da7d6d72fcffbba8258cfe663786b87d711812e09dad757a1f58996ab7f0d8f2 \ + --hash=sha256:dd915d37ae2442be08d6e1317814ac9be173341a1ad83ce133a77b4abba2d09d \ + --hash=sha256:dddaeea9fe9e3b7488c9acf1fdf77c0aa0e26e1d6f83a875b5cddf2e01948c7b \ + --hash=sha256:ea10e7eb83193dccbaaba8c370870c87f1a9b08b232df823e3e63905ec896e06 \ + --hash=sha256:eeb39947f8d3a0531afdcb422f659e6ac09653b50813dbedc9baf84ce2358320 \ + --hash=sha256:f3be935ec4001dda3b207ee4caa7531f857d24a92bfd0960a82dd8f1f985a82c + # via -r requirements.in +tenacity==9.1.4 \ + --hash=sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55 \ + --hash=sha256:adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a + # via -r requirements.in +time-machine==3.5.1 \ + --hash=sha256:03ae7e486fbeda7750b4490cde8101a1b0e3f7073e9e502aeda863cbc250eb68 \ + --hash=sha256:075cc8ff3bf229d96bc7adb8b26be6b1021ee0a5213efe4f57898cda3a3bd766 \ + --hash=sha256:080030169c275b40522e85b6a0a86a02a97e4369ae118c49682b455a0e67d802 \ + --hash=sha256:091bd22bf9dbf297dbff35b688b7667b37a30ab7c1f5831b0688e9ddd2321386 \ + --hash=sha256:0cb9cd81a98efc6dbe1fb9b0197953955369297000c9c8d09adaf0746950a498 \ + --hash=sha256:0f5012ac22f86366b8afd1aa01162f8ce6a7228a23a39168c7039c5cbdb9b08e \ + --hash=sha256:1990c1a3234d1df441ce084618b68d3c4a083f17dea4fd47adcf68d6668b507b \ + --hash=sha256:1b3575d91df2325270e0ae255253e7ecb5f3add4b83d3a01b8c74e02c26470a8 \ + --hash=sha256:2250eba37ebd82fe7235f13fc863f2ad21e02aa6fe3c9d3035acb4e82f321e38 \ + --hash=sha256:27095e90a2b42c2979f40146feb1bbf077dcf6a610889ae5dc36fa015e4fe2ef \ + --hash=sha256:2dc5d12a355e4ab2103f3527f014eb2c7fd50693f3f176cd7750c5f6f83b7e86 \ + --hash=sha256:2f7315ea64cd81405ed17c4a9835d8762a28a1471dae709b5c7d8680cd5495a9 \ + --hash=sha256:2f935a9beef5e31b7cd71ac600ded551c10a748177e679bbb2858b4aa907b509 \ + --hash=sha256:3138159b26ca711991b87b4141e089ee5ce5fe7db4958612271fffd0d4209081 \ + --hash=sha256:31aa239f2e02ec71682eadbf387d43bfe372b9409ff0dd148eca19d736402c73 \ + --hash=sha256:36c1b8790ab98103184d61866feb944589957fb30f9e6e05856012787ea3aea5 \ + --hash=sha256:3e00130b5305f3d06661a04734a7284c1445b454d22b7ff2b3bd534508fb8fcc \ + --hash=sha256:4a0c375c0dc8a3f56a30bf044da2437ae4f869e1ba1c0ea9eb9d279e8174ec41 \ + --hash=sha256:4e191c3e845c5dbbac36513932db1026a43a136dde2e18ef4bc81f419c4d81dc \ + --hash=sha256:54bc68d0bbdd1b903c8d46cb0d42b4da7a50391dde4aa644b77e2480083a479d \ + --hash=sha256:54c7f0c5afcd4f6fed8e2f83cb2e7f695231c426e7364f452976af9000608ec0 \ + --hash=sha256:5b1cd9c4429c2c4e341bee940166c59c030104afa6a99ba7053c118092dd9cff \ + --hash=sha256:6001f4802e0eab1d62e1a74ab7d25f64816ba77671d04e55ba75bc139f636ff1 \ + --hash=sha256:619fc95eef5124da85c2d4e1e64c2cfb830264547f16c9074eefd29bce28f754 \ + --hash=sha256:63c3f74787b96066e737408d679a6a75b750e6de30c276609e99f13c0a12e271 \ + --hash=sha256:66b1c8848794ac83551c643283497fd1ed9dff19b20e86e474fc15a8032e5886 \ + --hash=sha256:687ede95d69ad67eec4503cf077d56bb06e62507f769ce87d384e60d1edd3d7e \ + --hash=sha256:6eb740c4d6fa982bcb773c693903807ac64641c1f14a6d1adc53b9bd582ab2ff \ + --hash=sha256:6edb56e4a41b2d717f28fbdc04ac3fc7cff43b2f573e88189d67650680eb672e \ + --hash=sha256:714b27fa2a2d0cde33fe363a42f3eb477078661fa0ecfae185de67e1c9348c1b \ + --hash=sha256:73632a71eb038477a13212026f4ff26e0eb0208ee45268c345a9b97a5e102814 \ + --hash=sha256:759ec7a3d175ae3b468ec5b7e426a8d0d85f05e543e5aefa20dc99d95fd87535 \ + --hash=sha256:811916fec2ed38c02f6bcbfdfb6d57df7dc019ded640b2eaf06ccebbcdf81599 \ + --hash=sha256:86014c719210389bcfddebd29be3da34651866a7b516648a18f310aaf994b069 \ + --hash=sha256:877f087965da40e1858be3077d990ce26404eb1a159b438252b69fe6de897768 \ + --hash=sha256:89d4a895af01d5fcef106e09d3b966be3fcb02b41bcbf901962b8bd37d65456c \ + --hash=sha256:8a39af6fad7115e2c9d0deef287645260b096919d8918d52191d80ac31e43525 \ + --hash=sha256:8dc65728653643b742ae5ad859d4cc50fdc456533b23c942ea4011aa99b1e67f \ + --hash=sha256:991c4bc4b4a20a96355672065bafb2e517209de09b83d4ac92efe223632a713a \ + --hash=sha256:9f1704e632dd05d93b2c350e9b317ee138071ad7ce53f38e5e06b8543d0764c0 \ + --hash=sha256:a1e9423f9c03a8076d67c644c6d4dbe15f6bfc5174f928fa34a84ffb2fdbd7c6 \ + --hash=sha256:a6415979fac70c7142cfb7d863a118ba2d8c45a96c8d6efa311c9751ec270486 \ + --hash=sha256:a6b409d92cca522c0c1d0ce51894803dd2997054004c4d50273a1d748764749c \ + --hash=sha256:a8d00c6a3daee89345d8f4cfb7022d81e1315bb85b2ec041a6b410ac56cb3c01 \ + --hash=sha256:af8f4a7d729c0d8700d826a5c6befef73010ca0a92fb19ac987d040fbca896e2 \ + --hash=sha256:b68b8f472ea34b4ad0e927777dc8aa49bfac77526571de40e358d1d5f5fa99bd \ + --hash=sha256:b784ec07e978e7f504378302833ecb487b9007218fa5344c1346dd1be4904770 \ + --hash=sha256:c0a865aca362e645947159f2e0e3022131e591ba113b95f2b355410c36ddcd60 \ + --hash=sha256:c615f45b3668fa2ccd4ad2b81899d22efe4e33d23b3540283922796de57ad37c \ + --hash=sha256:cd9252e190b2c6079fd3ec9a7afc26fd26008fee1dc9940714e7d4755668b7ea \ + --hash=sha256:cf1b835219b61565bdc4e2bdb268b3f42a6b4443a0af4060260f65c7b3bdb781 \ + --hash=sha256:cf65e70122e4d6feea6a42c0ff27ade4c90d5ffaf1aaae65fc2160161d6c2b70 \ + --hash=sha256:d2f9761060f914802ed27797c3b311e992e13c5df3982c2450770d121a76803f \ + --hash=sha256:d4cea8ed128c65fe262cc216a4f46fb6080b745a3013baba188e45992ce673c5 \ + --hash=sha256:db35ff86b4137f16cc004e40e47e34c6f5aa0b7463a520008aabf06ffac62b75 \ + --hash=sha256:db80ab6d055a550d5c83f4f55d7c9918fc9531ca3f036c95db02ce266b36ac11 \ + --hash=sha256:e49e9ff451a645906d621aba4fb2d22e334215230a94e0e582d67b33e24970fd \ + --hash=sha256:e5dbc1ffa96ff9100c617024d9119a27046f531c71839eaebd7ad8bb3542d130 \ + --hash=sha256:e9aeaee418b1696b01edc8015b33c2aa746619ca0ce6ebcbc941363ad73b8464 \ + --hash=sha256:e9f54dc0f10093581c63d2eda7f4993c447232260b8120d8f7c196dd4c6c66af \ + --hash=sha256:eb2c50404820fde8bfc6a0713b2a0b8eabececfecefde3a5847ae8006037829f \ + --hash=sha256:ee142848d6f51e719d23d233ae381fb7f1db12bffee1dbd4ed7eba9e0d81ea39 \ + --hash=sha256:f1baa36df51e750a9fae86f32dc8f92915ebd26dbebd4c61dda28ae46ab8faf7 \ + --hash=sha256:fbf8272e461ea311b9feff10021b4a735d6c0076569fb860bda49358ac8b1dee \ + --hash=sha256:fe970adb31deac67a6f7a1dee2a7a8d0cb4c8496a0dd87c7c6e2430fc767d565 + # via -r requirements.in +trio==0.34.0 \ + --hash=sha256:63b9485408bdfdde544fced107045a8c0086cdc4bd0ef2f797b9e0dd111b964b \ + --hash=sha256:6c7c9f49917694dcdcd5f67abd168df5599eca480d61f29854d17a61a75c2f05 + # via anyio +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # anyio + # sqlalchemy +tzdata==2026.4 \ + --hash=sha256:c2169a8b0a7a5e9674da5a135ccdfb2b3e671b333ed9fed17b41f73c34476e81 \ + --hash=sha256:f1b8bd365d8d210c55353f4d7f8d6d8561c0ba50d704b700d195a9424bba0d79 + # via -r requirements.in +tzlocal==5.4.4 \ + --hash=sha256:8dbb8660838688a7b6ba4fed31d18dedf842afb4d47ca050d6d891c2c15f3be4 \ + --hash=sha256:aae09f0126a8a86fa736be266eb4a471380d26a0de3bc14844e7821fee3e2a15 + # via -r requirements.in diff --git a/harbor/sources/apscheduler-v17/task/__init__.py b/harbor/sources/apscheduler-v17/task/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..ba18376927f2743b9f37a3ef51a6d1c8f5790cb3 --- /dev/null +++ b/harbor/sources/apscheduler-v17/task/__init__.py @@ -0,0 +1 @@ +"""Task prompt package.""" diff --git a/harbor/sources/apscheduler-v17/task/prompt.md b/harbor/sources/apscheduler-v17/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..baffb8f1c8738608cb8aa6ef452587a43f5d3eae --- /dev/null +++ b/harbor/sources/apscheduler-v17/task/prompt.md @@ -0,0 +1,64 @@ +# Expired job leases: stale releases, stranded claims and scheduler crashes + +In APScheduler 4, a scheduler claims jobs from the data store through `DataStore.acquire_jobs` +with a lease (`lease_duration`) and extends that lease while jobs run. The current failure is that +a lapsed lease can break ownership while work is still running; the memory and SQLAlchemy stores +also disagree about how a takeover counts against `max_running_jobs`. Related interruption and +failure paths can strand claims or stop the scheduler. + +Fix this in `AsyncScheduler` and in the memory and SQLAlchemy data stores. MongoDB is out of scope. +A *claim* is a scheduler's hold on a job acquired through `acquire_jobs`; it is available to another +scheduler when another identity calling `acquire_jobs` on the same store receives it. + +## Data-store contract + +- An expired claim may be acquired by any scheduler, including its previous owner, even when the + task is at `max_running_jobs`. A takeover reuses the previous owner's slot: `running_jobs` does + not change, and after the new owner releases the job the count returns to its pre-claim value. +- `release_job(scheduler_id, job, result)` has an effect only while that identity holds the claim. + A stale or already-ended claim is unchanged: the job remains in its current state, + `running_jobs` is unchanged, no result is recorded or replaced, and no `JobReleased` event is + published. Only the current holder's result is recorded; duplicate execution by a previous owner + that was still running is accepted. +- A non-positive acquisition limit claims nothing and changes no job or slot count; a later positive + acquisition can still receive the jobs. +- If a claim changes hands or its lease is renewed while expired work is being abandoned, that job is + left alone with its current claim, no result, and no release event. +- If an expired claim also has a passed `start_deadline`, it is not taken over: it is removed once, + its slot is decremented once, and a `missed_start_deadline` result is recorded. A stale release + from the old owner must not decrement the count again. + +## Scheduler contract + +- If acquisition hands back a job this scheduler is still running, do not start it again or crash. + Let it finish once with its normal result, continue pending work without waiting for an + unrelated wake-up, and avoid repeatedly polling unchanged handed-back jobs. +- If shutdown or outside cancellation interrupts acquisition, do not run or record results for the + claimed jobs. Hand their claims back immediately so a peer can acquire them well before the lease + expires. If cancellation or an unexpected error interrupts preparation, hand back every claimed + but unstarted job immediately; this also applies when an error release is itself interrupted before + recording a result. +- An acquired job whose callable cannot be resolved, either because its `func` is unimportable or + because no local callable is configured, receives an `error` result with a `LookupError`. Other + jobs in the batch and later jobs still run, and the scheduler stays alive. If that error release + fails, the scheduler still stays alive and the claim is handed back. An unexpected preparation + exception has the same batch-continuation and scheduler-survival requirements, with that job + recorded as `error`. +- Cancellation must remain clean even if releasing a running job with outcome `cancelled` raises: + other cancellations are still released, the failed claim is handed back promptly, and shutdown + reports one clean `SchedulerStopped` outcome without propagating the release error. A failed + release must not crash the scheduler. +- If `extend_acquired_job_leases` raises, later extension rounds still occur and a job that outlives + the failure keeps its lease and completes normally. +- When a result is discarded because the scheduler no longer holds the claim, the data store emits a + warning identifying that the result was discarded. + +"Handed back" means that the claim becomes immediately available to another scheduler and no result +is recorded for the job. + +## Constraints + +- Do not change public APIs or `DataStore` method names or signatures. +- The existing test suite is the regression bar. Existing tests must remain unmodified, though tests + may be added. Tests marked `external_service` (PostgreSQL, MySQL, MongoDB, Redis, MQTT) cannot run + in this environment; everything else must pass. diff --git a/harbor/sources/apscheduler-v17/task/rubric.md b/harbor/sources/apscheduler-v17/task/rubric.md new file mode 100644 index 0000000000000000000000000000000000000000..5ae5b2fe279ac37bc26e9a717ce6409dd638a7df --- /dev/null +++ b/harbor/sources/apscheduler-v17/task/rubric.md @@ -0,0 +1,98 @@ +# Rubric — apscheduler_expired_job_lease + +Reviewer-only. Implements the approved grader draft (`intake/grader-draft.md`). The grader is +`grading/runner.py::grade_repository`; the scoring model is `grading/graders.py::CRITERIA_SPECS`. + +## Stores and entry points + +Probes run on `MemoryDataStore` and on `SQLAlchemyDataStore` over `sqlite+aiosqlite`, on CPython +3.13, and reach the candidate only through `AsyncScheduler` (`configure_task`, `add_job`, +`start_in_background`, `stop`, `subscribe`, `state`) and the public `DataStore` methods +(`acquire_jobs`, `release_job`, `extend_acquired_job_leases`, `cleanup`, `get_jobs`, `get_task`, +`get_job_result`), plus `run_until_stopped` inside a probe-owned task group and an event-broker +subclass that calls `super().publish`. Lease lapses move the wall clock with time-machine; failures are injected by store +subclasses that override public methods and call `super()`. Each fixture runs in its own subprocess +with the import path pinned to a copy of the candidate `src/`, as the unprivileged workspace account. + +## Criteria + +| Criterion | Weight | Evidence class | Gate | Children (case, share, matrix) | +|---|---:|---|---|---| +| expired_claim_takeover | 0.001488 | functional | — | takeover_at_capacity_reuses_slot (C01, 0.39986559, all over memory/aiosqlite); owner_reacquire_counted_once (C02, 0.39986559, all); expired_claim_past_deadline_discarded (C23, 0.20026882, all over memory/aiosqlite) | +| stale_release_ignored | 0.000551 | safety | G2 | stale_release_is_noop (C03, 1.0, all over orderings takeover / cleanup-abandoned / two-scheduler race × stores) | +| acquisition_limit_contract | 0.001284 | functional | — | non_positive_limit_claims_nothing (C15, 1.0, all over stores) | +| running_job_reacquisition | 0.064561 | functional | — | handed_back_job_runs_once_without_busy_loop (C04, 0.00425954, all); pending_job_not_starved_by_renewals (C05, 0.99574046, all) | +| stop_during_acquisition_handback | 0.200000 | safety | G3 | claimed_jobs_run_by_peer_once (C06, 1.0, all over stores × batch 1 / 3) | +| cancel_during_acquisition_handback | 0.200000 | safety | G4 | cancelled_acquisition_claims_handed_back (C13, 1.0, all over stores) | +| unpreparable_job_containment | 0.001835 | functional | — | unimportable_job_errors_batch_continues (C07, 0.10027248, all over stores); no_callable_job_errors_batch_continues (C16, 0.05013624, all over stores); failed_error_release_scheduler_survives (C08, 0.14986376, all); failed_error_release_claim_handed_back (C09, 0.69972752, all) | +| stop_failed_release_clean_stop | 0.000367 | safety | G1 | clean_stop_siblings_cancelled (C10, 1.0, all) | +| stop_failed_release_handback | 0.001101 | functional | — | failed_cancel_release_claim_handed_back (C11, 1.0, all) | +| cleanup_claim_integrity | 0.322530 | functional | — | cleanup_skips_a_claim_that_changed (C14, 0.00341364, all over memory only); concurrent_deadline_discard_is_exactly_once (C24, 0.99658636, all over memory/aiosqlite) | +| lease_extension_failure_survival | 0.000367 | functional | — | extension_resumes_after_failure (C12, 1.0, all) | +| preparation_cancellation_handback | 0.190952 | functional | — | preparation_error_leaves_no_tail_claims (C17, 0.01281474, all over stores); preparation_cancellation_hands_back_unstarted (C21, 0.33666052, all over stores); interrupted_error_release_handed_back (C22, 0.65052474, all over stores × {unimportable callable, unexpected preparation error} × {outside cancellation, `stop()`}) | +| arbitrary_preparation_isolation | 0.006523 | functional | — | unexpected_preparation_error_isolated (C18, 1.0, all over stores) | +| cancelled_release_containment | 0.006015 | functional | — | cancelled_release_failure_isolated (C19, 1.0, all over stores) | +| stale_release_observability | 0.002426 | functional | — | stale_release_logs_warning (C20, 1.0, all over stores) | + +Weights total 1.00. Per-case absolute weights: C01 0.000595, C02 0.000595, C03 0.000551, C04 0.000275, C05 0.064286, C06 0.200000, C07 0.000184, C08 0.000275, C09 0.001284, C10 0.000367, C11 0.001101, C12 0.000367, C13 0.200000, C14 0.001101, C15 0.001284, C16 0.000092, C17 0.002447, C18 0.006523, C19 0.006015, C20 0.002426, C21 0.064286, C22 0.124219, C23 0.000298, C24 0.321429. Difficult-credit weight 0.85 +(C05, C06, C13, C21, C24); easy-credit weight 0.15 +(C01, C02, C03, C04, C07, C08, C09, C10, C11, C12, C14, C15, C16, C17, C18, C19, C20, C22, C23). Budget classes follow the 2026-09-23 de-concentration refit over jobs 9084c34f and 71bb9800 on this grader (rubric fingerprint 521e1af0; 6 valid traces, trace 2c20a644 excluded as an infrastructure failure): cases failed at least once share the 0.85 difficult budget in proportion to failures / measured runs (C24 5/6, C06 5/6, C13 5/6, C21 1/6, C05 1/6), and never-failed cases share the 0.15 easy budget in proportion to their previous absolute weights. The formula alone puts the two safety gates at 0.25 each, above the 0.20 per-gate raw-weight limit; C06 and C13 are therefore held at 0.20 and the released 0.10 is redistributed across the non-gated difficult cases in the same failure-rate proportion (C24 5/7, C21 1/7, C05 1/7). That ceiling is the only departure from the formula. The resulting allocation leaves cleanup_claim_integrity carrying 43.0% of pooled lost weight, below the half-of-deficit threshold, and no gate ceiling binds on any observed trace. + +C24 is measured on both stores: the concurrent discard it observes is reached while `acquire_jobs` +publishes its events, not inside the single-transaction `cleanup()` sweep, so it is observable on +the SQLAlchemy store too. + +C14 is measured on the memory store only. The SQLAlchemy store performs the whole `cleanup()` sweep +inside one transaction and publishes its events afterwards, so no concurrent claim change is +observable there; the gold implementation itself fails a two-store matrix for this case, which is +why the matrix is `memory` alone. Every other child keeps the two-store matrix. + +## Pass conditions (summary) + +- C01: at `max_running_jobs=1`, `w2` takes the lapsed job with `running_jobs == 1`, `w3` receives nothing, and after `w2`'s release the job is gone and `running_jobs == 0`. +- C02: `w1` re-acquires its own lapsed job with `running_jobs == 1`, and `w2` receives nothing. +- C03: a release by a non-holder leaves the job listed, `running_jobs` unchanged and no result; only the holder's `return_value` is recorded; an `abandoned` result is not replaced; in the two-scheduler race both schedulers keep running, `b`'s result stands and `running_jobs == 0`. +- C04: a running job handed back on every `acquire_jobs` call starts once, at most 10 `acquire_jobs` calls happen in a 0.5 s window, both jobs succeed and the scheduler keeps running. +- C05: with more lapsed running jobs than free slots, a pending job starts within 3 s with no event other than its own `add_job`; the running jobs each start once and all succeed. +- C06: after `stop()` during an in-flight `acquire_jobs`, identity `first` runs nothing and records no result, and identity `second` runs every claimed job exactly once with outcome `success` within 3 s against a 30 s lease. +- C07: a job whose `func` names an unimportable module ends `error` with a `LookupError`; its batch sibling and a later job succeed; the scheduler keeps running. +- C16: the same holds for a task with no local callable configured. +- C08: with that job's `release_job` raising, the scheduler keeps running and the sibling and later job succeed. +- C09: after the sibling's success, `acquire_jobs("peer", 30 s, 10)` returns the unpreparable job within 3 s. +- C10: with job X's `cancelled` release raising during `stop()`, exactly one `SchedulerStopped` arrives with `exception is None`, and sibling Y's outcome is `cancelled`. +- C11: after that `SchedulerStopped`, `acquire_jobs("peer", 30 s, 10)` returns X within 3 s. +- C12: with the first lease extension raising, a later extension completes, the job succeeds and the scheduler keeps running. +- C13: the task running `run_until_stopped` is cancelled from an enclosing cancel scope while an `acquire_jobs` call holds a claimed batch, and `stop()` is never called; the scheduler runs none of the claimed jobs, records no result for them, and `acquire_jobs("peer", 30 s, 10)` returns every claimed job within 3 s. +- C14: an event-broker subclass takes a second expired claim over as `peer` when `cleanup()` publishes its first abandoned release; the taken-over job is still listed, has no recorded result, is not acquirable by an outsider while the peer's lease is live, and the task's `running_jobs` reflects one abandoned release. +- C24: a job whose claim has lapsed and whose `start_deadline` has passed is discarded while a peer + acquires concurrently: an event-broker subclass runs `acquire_jobs("peer", 30 s, 10)` on the first + event the discarding `acquire_jobs("w2", 30 s, 10)` publishes. `w2` receives only the still-runnable + job, the peer receives nothing, the expired job is removed once, `running_jobs` counts only the live + claim, one `missed_start_deadline` result is recorded, and exactly one `JobReleased` event is + published for the expired job. +- C15: `acquire_jobs` with limit `0` and with limit `-1` each return nothing and leave `running_jobs` at 0, and a following call with limit 10 still returns both jobs. +- C17: an unexpected preparation error in a claimed batch records that job as `error`, the remaining jobs still succeed, and no claimed tail is stranded. +- C21: the task running `run_until_stopped` is cancelled from an enclosing cancel scope while one claimed job's preparation is held inside `get_task`, and `stop()` is never called; the held job does not run and records no result, and `acquire_jobs("peer", 30 s, 10)` returns every claimed job that has no recorded result within 3 s. +- C22: the task running `run_until_stopped` is cancelled from an enclosing cancel scope, or `stop()` is called, while the store is releasing a claimed job that could not be prepared (an unimportable callable, or an unexpected preparation error) with outcome `error`; that job does not run, and `acquire_jobs("peer", 30 s, 10)` returns every claimed job that has no recorded result within 3 s. A candidate whose error release completes under the interruption passes: that job then has a result and is not expected back. +- C23: a job acquired by `worker1` has an expired lease and a passed `start_deadline`; repeated `acquire_jobs("worker2", 30 s, 10)` calls return nothing, remove the job exactly once, decrement `running_jobs` to zero, and record `missed_start_deadline`. A stale release from `worker1` does not decrement the counter again. +- C18: an unexpected preparation exception records an `error` for that job, while the batch sibling and a later job succeed and the scheduler remains started. +- C19: an externally cancelled running job whose cancellation release fails does not crash the scheduler, and its claim is promptly acquirable by a peer. +- C20: releasing a result from a scheduler that no longer holds the claim emits a warning identifying that the result was discarded (any wording containing "discard"; the earlier claim-ownership phrasings remain accepted). + +## Arithmetic + +- Child value: `all` matrix → 1.0 only when every fixture passes; `fraction` → passed / total. Every child in force uses `all`; the C07/C16 split replaced the one `fraction` child. +- Criterion value = Σ(share × child value); raw = Σ(weight × criterion value). +- Safety gates G1 (C10), G2 (C03), G3 (C06), G4 (C13) fire when their child is below 1.0. Total gated raw weight 0.212672, and no single gated criterion exceeds 0.20. G4 shares G3's boundary: a scheduler whose acquisition is interrupted must neither run the claimed jobs nor strand them; G3 covers `stop()`, G4 the outside cancellation the prompt names in the same sentence. +- Build/regression ceiling: the pinned base `tests/`, base `pyproject.toml` pytest settings and base `tests/conftest.py` run as `pytest -m "not external_service" -p no:cacheprovider` against the candidate `src/`; any failure or an empty collection fires it. +- When any gate or the build ceiling fires, `final = min(raw, 0.60)`; the ceiling is shared and non-stacking. Otherwise `final = raw`. +- A grader fault (missing interpreter or probe assets, a probe that cannot start) is `isError: true`, `grader_health` non-healthy, reward and raw/final 0.0, `caps: []`. Candidate exceptions and timeouts inside a probe are candidate behaviour and keep `grader_health: "healthy"`. + +## Integrity + +Candidate test or pytest-setting edits never change the wall, which always runs the base copies. +Weakened settings (added `-k`/`--deselect`/`--ignore`/`-p no:` options, collection hooks, new +skip/xfail marks on existing tests, removed tests, ignored warnings, overriding config files) are +reported in `info.regression_wall.weakened_settings` with base and candidate observations; they +explain a wall failure and are never a penalty by themselves. Paths changed outside `src/` are +reported in `info.editable_surface` and never scored. diff --git a/harbor/sources/apscheduler-v17/tasks.py b/harbor/sources/apscheduler-v17/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..609f28cf85412af3d0ec04f076f7eceb11cb089d --- /dev/null +++ b/harbor/sources/apscheduler-v17/tasks.py @@ -0,0 +1,31 @@ +"""Canonical task definitions for apscheduler-expired-job-lease (HUD v6). + +Exports env for HUD discovery and registers, in the public tasks list, the single approved agent +task plus its two reference variants. The variants grade the gold patch and the unchanged base on +a fresh pinned tree; Prompt 07 runs each once per deployed build and Prompt 08 runs only the agent +task. +""" + +from pathlib import Path + +from env import apscheduler_expired_job_lease, env, reference_base, reference_gold # noqa: F401 + +_PROMPT = (Path(__file__).resolve().parent / "task" / "prompt.md").read_text(encoding="utf-8") + +_task = apscheduler_expired_job_lease( + task_id="apscheduler_expired_job_lease", + description=_PROMPT, +) +_task.slug = "apscheduler-expired-job-lease" + +_gold = reference_gold() +_gold.slug = "apscheduler-expired-job-lease-gold" + +_base = reference_base() +_base.slug = "apscheduler-expired-job-lease-base" + +tasks = [ + _task, + _gold, + _base, +] diff --git a/harbor/sources/apscheduler-v17/uv.lock b/harbor/sources/apscheduler-v17/uv.lock new file mode 100644 index 0000000000000000000000000000000000000000..a978f994db347d366cb12212d87f1d2292829c9b --- /dev/null +++ b/harbor/sources/apscheduler-v17/uv.lock @@ -0,0 +1,1809 @@ +version = 1 +revision = 3 +requires-python = ">=3.11, <3.13" +resolution-markers = [ + "python_full_version >= '3.12' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and sys_platform != 'emscripten'", + "python_full_version < '3.12'", +] + +[[package]] +name = "aiofile" +version = "3.12.3" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "caio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/14/31/edb06aabd8f8f0b56d659f30800795f40b93cba96be946ce179f6931e3a5/aiofile-3.12.3.tar.gz", hash = "sha256:caa6aa746b5e47e2165f7abd741b6415e49cf4d44fddc0f61844612cc3924d41", size = 21600, upload-time = "2026-08-04T22:59:27.171Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4e/79/6e45e778c4c3cab39e0937b007b720c15f76c50c6453d153282d0fcc3588/aiofile-3.12.3-py3-none-any.whl", hash = "sha256:5c1bcc9e929c50834608e8cc1a4cc1d7503eb60c15a535b779fd39e2f372c017", size = 22122, upload-time = "2026-08-04T22:59:25.838Z" }, +] + +[[package]] +name = "annotated-doc" +version = "0.0.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" }, +] + +[[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 = "anthropic" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "docstring-parser" }, + { name = "httpx2" }, + { name = "jiter" }, + { name = "pydantic" }, + { name = "sniffio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a6/3d/4170318539de0c163e1806509b0bb9cd7d611ee15e7885f1d16a11a37d29/anthropic-1.6.0.tar.gz", hash = "sha256:ce3c032f940984f67c516db896375bff36959f8dc589973e386f8e6ea81bbec3", size = 1172375, upload-time = "2026-09-15T15:14:55.826Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c1/32/57a8b6c5441d9e6a1f332f70ee02375af6d9b5b65b42689ba83f7c7d010a/anthropic-1.6.0-py3-none-any.whl", hash = "sha256:049434f013d3a874acdfee696ec626e19166d58f4277e8fa34e5d0a5ec250ad0", size = 1249068, upload-time = "2026-09-15T15:14:54.326Z" }, +] + +[[package]] +name = "anyio" +version = "4.15.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "idna" }, + { name = "typing-extensions" }, +] +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 = "apscheduler-expired-job-lease" +version = "0.1.0" +source = { editable = "." } +dependencies = [ + { name = "hud" }, + { name = "pytest" }, + { name = "pytest-asyncio" }, +] + +[package.optional-dependencies] +dev = [ + { name = "pre-commit" }, + { name = "pytest" }, + { name = "ruff" }, +] + +[package.metadata] +requires-dist = [ + { name = "hud", extras = ["agents"], specifier = ">=0.6.0" }, + { name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.5.0" }, + { name = "pytest", specifier = ">=8.0.0" }, + { name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0.0" }, + { name = "pytest-asyncio", specifier = ">=0.23.0" }, + { name = "ruff", marker = "extra == 'dev'", specifier = "==0.11.2" }, +] +provides-extras = ["dev"] + +[[package]] +name = "asyncssh" +version = "2.24.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/dd/7f/2d79247bacc562104f312d27efe541673aa177feac89de291bd61bca52be/asyncssh-2.24.0.tar.gz", hash = "sha256:4064c590e59ce2e8d82a2f66d35f3120d765828b4df5e3dbfb07b4a8c24686c9", size = 550148, upload-time = "2026-06-27T20:34:44.755Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/29/908ce0ca5e8cae76662e354a0f08df552d6d221844748b9e5ca06051cc44/asyncssh-2.24.0-py3-none-any.whl", hash = "sha256:9abd46300adcb6d4b73269b34c53cd0d17a138b9a22b5b38008ce7d5808734b7", size = 381237, upload-time = "2026-06-27T20:34:43.198Z" }, +] + +[[package]] +name = "asyncvnc" +version = "1.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "keysymdef" }, + { name = "numpy", version = "2.4.6", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.12'" }, + { name = "numpy", version = "2.5.3", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.12'" }, +] +wheels = [ + { url = "https://files.pythonhosted.org/packages/5b/55/e7c4483b8952bbe048a107d85a29f06a6336e302b79a2e0508d61d926e43/asyncvnc-1.3.0-py3-none-any.whl", hash = "sha256:f4de4e858449325aefcf82a46b34befb34afdd811e20e7af9b0440192e496e74", size = 19992, upload-time = "2023-02-26T19:12:11.007Z" }, +] + +[[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 = "authlib" +version = "1.8.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "joserfc" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f1/51/bc1729d3cfdc214b4935f4e886e4dd443c3065fd8e1e66423fe84b490f81/authlib-1.8.0.tar.gz", hash = "sha256:f3ecd5f1da737262fb53bf1a4d95c4ea1ad9dd509316587a255c99ab1838a4f0", size = 177759, upload-time = "2026-08-30T12:12:34.833Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/c6/6f124bcfbbfb20fba22c939b4e43a06dccfc0e1ca20e5634ca573cb1e271/authlib-1.8.0-py2.py3-none-any.whl", hash = "sha256:88aebbd9af6757e14e912d5dc007ae1dc1f3e27e3b2152ce7c552ee2c3b3c121", size = 260804, upload-time = "2026-08-30T12:12:33.162Z" }, +] + +[[package]] +name = "backports-tarfile" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/86/72/cd9b395f25e290e633655a100af28cb253e4393396264a98bd5f5951d50f/backports_tarfile-1.2.0.tar.gz", hash = "sha256:d75e02c268746e1b8144c278978b6e98e85de6ad16f8e4b0844a154557eca991", size = 86406, upload-time = "2024-05-28T17:01:54.731Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b9/fa/123043af240e49752f1c4bd24da5053b6bd00cad78c2be53c0d1e8b975bc/backports.tarfile-1.2.0-py3-none-any.whl", hash = "sha256:77e284d754527b01fb1e6fa8a1afe577858ebe4e9dad8919e34c862cb399bc34", size = 30181, upload-time = "2024-05-28T17:01:53.112Z" }, +] + +[[package]] +name = "beartype" +version = "0.22.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/94/1009e248bbfbab11397abca7193bea6626806be9a327d399810d523a07cb/beartype-0.22.9.tar.gz", hash = "sha256:8f82b54aa723a2848a56008d18875f91c1db02c32ef6a62319a002e3e25a975f", size = 1608866, upload-time = "2025-12-13T06:50:30.72Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/71/cc/18245721fa7747065ab478316c7fea7c74777d07f37ae60db2e84f8172e8/beartype-0.22.9-py3-none-any.whl", hash = "sha256:d16c9bbc61ea14637596c5f6fbff2ee99cbe3573e46a716401734ef50c3060c2", size = 1333658, upload-time = "2025-12-13T06:50:28.266Z" }, +] + +[[package]] +name = "cachetools" +version = "7.2.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/29/2c/3f18755527b03ca9ff6be724bd5370cb777c76a87f17301377cf04a4729b/cachetools-7.2.0.tar.gz", hash = "sha256:bcac1a1b8da6909994a2957238a57b8140dab7c5c5c69a43669654fe87a33c1d", size = 41129, upload-time = "2026-09-16T20:48:27.209Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cc/bb/1c6e7a89b11da19f137e4ef5a5c5fe47a5bb686449ba343944ccf8fb34b2/cachetools-7.2.0-py3-none-any.whl", hash = "sha256:3045213f186b89fdd95d94441354c4bd87c570b7a38d8c3fd1d9dd37f6dc90d8", size = 16918, upload-time = "2026-09-16T20:48:25.575Z" }, +] + +[[package]] +name = "caio" +version = "0.12.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d2/c9/ac301b7f86ccf6ad02ee78eb953ce8f75175754cc5e76d398e447af42e3e/caio-0.12.4.tar.gz", hash = "sha256:32d8e9f3e2099c8db29446679252766c9bcd806eb88b4fb60ad274f73df2a5e9", size = 81006, upload-time = "2026-09-07T06:52:39.18Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e7/c6/168bc0eef2c77681e186957d5a1145208802bb0ecdcfd4d7f67b38b629c7/caio-0.12.4-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:b0444d20067642bb272e423de3cc8ef05bf134d335d57fa5bddcfcc98e04313e", size = 47768, upload-time = "2026-09-07T06:52:07.809Z" }, + { url = "https://files.pythonhosted.org/packages/9c/81/ae41a0473525229e56d7ffbb420b7fc7f72e04e468160a3519596ce094ba/caio-0.12.4-cp311-cp311-manylinux_2_34_aarch64.whl", hash = "sha256:780465251a0680039b29c990bca73b40b843e39d06505c62e353ed56490e4576", size = 159620, upload-time = "2026-09-07T06:52:08.881Z" }, + { url = "https://files.pythonhosted.org/packages/86/c5/53838d8ece904637dadc3177e5b5b5b6e4f7af9ce17a1f42c6f6214edc1d/caio-0.12.4-cp311-cp311-manylinux_2_34_x86_64.whl", hash = "sha256:67f1bddc997bef281db36600e3e58d6b16d6486b3540eb62c9e54c6584f137fd", size = 156089, upload-time = "2026-09-07T06:52:09.99Z" }, + { url = "https://files.pythonhosted.org/packages/83/39/34e416ee20493c96d5beda9e4196bec236117b012f6f4d0efdb96b91932c/caio-0.12.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:20acd9a8df90d25b63bc0b7dc264e2a09b99082a420b5d640c76056027ee6b52", size = 157195, upload-time = "2026-09-07T06:52:11.196Z" }, + { url = "https://files.pythonhosted.org/packages/26/c9/f7b78203beaee0e984b219c48c810e547b27353f899ef82d49133f3c4817/caio-0.12.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:0d8d2826bf622644fc374a9f53ac00918b489d03599783953fcbe79af19123f5", size = 155700, upload-time = "2026-09-07T06:52:12.379Z" }, + { url = "https://files.pythonhosted.org/packages/68/35/7ddc8de48cd0142797db186c07e901005b966dc6e8a7852f0273d33e4840/caio-0.12.4-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:67b725641fea682a2e9b1d3b2a150d21f1a25383e3ec8351bd7677ff857fa982", size = 47927, upload-time = "2026-09-07T06:52:13.58Z" }, + { url = "https://files.pythonhosted.org/packages/8c/b4/37556bde83253cf1ed071a754c8405d02b955febd021c400f0ffa6258d5f/caio-0.12.4-cp312-cp312-manylinux_2_34_aarch64.whl", hash = "sha256:4854a029e359e5ddfb5589ab66157a34af6a0dda0acdaa43f5e640d60182c1ea", size = 161402, upload-time = "2026-09-07T06:52:14.581Z" }, + { url = "https://files.pythonhosted.org/packages/7a/11/519e40a1da4d18515ab5ddb54e75cdd896532339010f2dcee7e798e4edab/caio-0.12.4-cp312-cp312-manylinux_2_34_x86_64.whl", hash = "sha256:f063624a98a64bab387430c5eaea61ef3825a98399104a297b8da4741c15139f", size = 159311, upload-time = "2026-09-07T06:52:15.853Z" }, + { url = "https://files.pythonhosted.org/packages/45/2a/0db30de6c2561e41721d94ac627aa65db61a403545e67914814d8c2b5305/caio-0.12.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8a926d562f8c06767774a91239770ebaa93c10a24074e21ea741db208df9cc1d", size = 158910, upload-time = "2026-09-07T06:52:17.27Z" }, + { url = "https://files.pythonhosted.org/packages/1e/e0/5eb43a89aecdf9d6f929b0080e49d92ccdf3f88bbc637353f52843b483af/caio-0.12.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:53605636e3b1eaeca368b475f1471ad9774736c6502a4b58b8b6b8d74b531770", size = 158973, upload-time = "2026-09-07T06:52:18.527Z" }, + { url = "https://files.pythonhosted.org/packages/e8/e6/07100a694613344d22958fb6d803fdf914ee9395278fe58ad1b1b9c59e52/caio-0.12.4-py3-none-any.whl", hash = "sha256:7a5e231bbf81eaed269f99afa9ef46457f51f9407952a1795c0795b3a62c23c0", size = 25628, upload-time = "2026-09-07T06:52:38.147Z" }, +] + +[[package]] +name = "certifi" +version = "2026.7.22" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/a3/c2/24167ea9858356b47a87a50d39908bfdb72ceeefe0041586e704e5376b3a/certifi-2026.7.22.tar.gz", hash = "sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55", size = 138112, upload-time = "2026-07-22T03:35:12.644Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0b/a7/71ac2cff56fec219ed242bb11b8efb69fcc4bec75db06fb7bfe35de520e6/certifi-2026.7.22-py3-none-any.whl", hash = "sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775", size = 136983, upload-time = "2026-07-22T03:35:11.276Z" }, +] + +[[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" }, +] + +[[package]] +name = "cfgv" +version = "3.5.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/4e/b5/721b8799b04bf9afe054a3899c6cf4e880fcf8563cc71c15610242490a0c/cfgv-3.5.0.tar.gz", hash = "sha256:d5b1034354820651caa73ede66a6294d6e95c1b00acc5e9b098e917404669132", size = 7334, upload-time = "2025-11-19T20:55:51.612Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/db/3c/33bac158f8ab7f89b2e59426d5fe2e4f63f7ed25df84c036890172b412b5/cfgv-3.5.0-py2.py3-none-any.whl", hash = "sha256:a8dc6b26ad22ff227d2634a65cb388215ce6cc96bbcc5cfde7641ae87e8dacc0", size = 7445, upload-time = "2025-11-19T20:55:50.744Z" }, +] + +[[package]] +name = "charset-normalizer" +version = "3.5.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e5/3f/143b048436775b0f76ac3eec145c019e8173ccc2885c8f20319b996d5e83/charset_normalizer-3.5.1.tar.gz", hash = "sha256:6117b84ea48435e5356dc737f5121485c30920ba43375fa7b434fd753df0eac3", size = 171764, upload-time = "2026-08-15T08:20:44.807Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6a/b6/034f6802e9c3f6418966cfabb7db8c9252cc2429c5098f41cc43af804149/charset_normalizer-3.5.1-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:eda059b6bc8bc0812d626fd91a7ce01bf583df0a61296eff390fd94141a34e30", size = 363585, upload-time = "2026-08-15T08:16:46.646Z" }, + { url = "https://files.pythonhosted.org/packages/d5/fa/6a7e2a7c4b5451912b8c417732df79574354443592a88d616de03da66ae5/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:aa2bb0b37202dca27175591f761108b5d34096ade1191ffe4808bdf6b1571488", size = 251189, upload-time = "2026-08-15T08:16:48.287Z" }, + { url = "https://files.pythonhosted.org/packages/a4/c8/ab42b07cfd82e919f427fcfaa7c41abae8242833ad1aad66d42bae40b669/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:0b2b1b3fa5670c127b246df1d0c059defd41f689a868a3b9d79df9b1cac42d22", size = 239724, upload-time = "2026-08-15T08:16:49.67Z" }, + { url = "https://files.pythonhosted.org/packages/e7/80/b9348b5d3041209f98b4cdad7655766369233f1d533f4f4f7558e9717bec/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:6e5e4d73d588ca5ed09df1b7dcd1b203d1df3c542e3f50d126c947d432b10731", size = 280078, upload-time = "2026-08-15T08:16:51.228Z" }, + { url = "https://files.pythonhosted.org/packages/82/38/083a24028304bc85bb9e376fed801178423dcbb67495f73b6ea0624e1894/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:b54e7e13267d49ffbfe68e25b3cbd774dab38fa37238f71265e91b36146eb21c", size = 276650, upload-time = "2026-08-15T08:16:52.625Z" }, + { url = "https://files.pythonhosted.org/packages/0d/35/731ac04aa0a097fc1c97f0994c375bdb230c6c96619db794208fe664e9ce/charset_normalizer-3.5.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:c7b742bf31c88566b4bb6335a7f393bb322e580b6bb98df7bd0c25e6e3519ce8", size = 262325, upload-time = "2026-08-15T08:16:54.085Z" }, + { url = "https://files.pythonhosted.org/packages/f5/28/c2028e7021fb89c6e56868ed0e387b8e9aa811abdd2ab3208d6578d2c930/charset_normalizer-3.5.1-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:6ba32c4d2abf1d2fe7cf27d280f4cca5664233b0f885549c7761719eb977f486", size = 261140, upload-time = "2026-08-15T08:16:55.604Z" }, + { url = "https://files.pythonhosted.org/packages/28/f0/0c0ceec6d98b7daa62e361e418135d59685811d79ba11529aad5cdf15e84/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:0722590aabf9dc6a6c0343d523c05458fa2b5047dbe6302fd526bb570600753f", size = 252791, upload-time = "2026-08-15T08:16:57.103Z" }, + { url = "https://files.pythonhosted.org/packages/f0/3e/48f4cd187b1c33189d86039e9cbe4f92c05454175504b44ff81806d4d1bf/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:aa1099b956fb795e686d073568f6dc002a0bb89765ea6d5b055dd7d9bf1b116c", size = 240730, upload-time = "2026-08-15T08:16:58.418Z" }, + { url = "https://files.pythonhosted.org/packages/42/85/f9e22af69af67c54cce42be9455d9c81294f918b4ccc454db01f66efcac2/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:bd6c173f04743d483881bffa1478d5a4624475b8cd1d2194956a75548e191c18", size = 280791, upload-time = "2026-08-15T08:16:59.918Z" }, + { url = "https://files.pythonhosted.org/packages/fd/4c/9044135f42127630b6fa742feb51256353f6ab87a78f2fdd1de3de955a7f/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:f298e218441525d3794428b4c8b8fb8662c6d3ea79925d4807ee6b9a96a3bca5", size = 259598, upload-time = "2026-08-15T08:17:01.421Z" }, + { url = "https://files.pythonhosted.org/packages/ba/ed/1dd7cfebb4e75812934c49ca3b79757d11948053f7937ab7070c151f3c55/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_s390x.whl", hash = "sha256:6e2912d4babbc65196ac13c2f53468dc57fb8b9c25ef913e8c59ddf7c6dc0e1b", size = 278217, upload-time = "2026-08-15T08:17:02.782Z" }, + { url = "https://files.pythonhosted.org/packages/bf/eb/239c84503cc9e3ba6eb34686a24bc66e84f3924efdd7e38e751a19f6bc10/charset_normalizer-3.5.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:3d27167433c0d5f18dc850f07d0b3816221984fecdc405d6c157a6f0b8f8e9e6", size = 263417, upload-time = "2026-08-15T08:17:04.216Z" }, + { url = "https://files.pythonhosted.org/packages/37/ab/4e4510e1e288478e2c8333131d1c1382382ba8cd2165053c79e39d1da961/charset_normalizer-3.5.1-cp311-cp311-win32.whl", hash = "sha256:ac00177c4831ffa650f8609e4bdddd5fe09c03b1c0c47acece7e6ea20421598b", size = 181774, upload-time = "2026-08-15T08:17:05.58Z" }, + { url = "https://files.pythonhosted.org/packages/e3/57/32f0ccea59e8612057c61d6fd22ef2cb63cca93c9fe594094919696ac170/charset_normalizer-3.5.1-cp311-cp311-win_amd64.whl", hash = "sha256:f9b1e28d0e8dbfa858abdba91d6b547beaf2df1a59bec6da6faae7b96a4991a9", size = 206653, upload-time = "2026-08-15T08:17:07.075Z" }, + { url = "https://files.pythonhosted.org/packages/17/d4/b65c433fc521e58b5f54293982a5e51c05cb5f2dd3f1c7a6acb65b75324e/charset_normalizer-3.5.1-cp311-cp311-win_arm64.whl", hash = "sha256:ae31a1a1db2ee6cc2942fccaf695c934bc7f3db9f2133a3fef1f367cf1a4ab10", size = 185630, upload-time = "2026-08-15T08:17:08.502Z" }, + { url = "https://files.pythonhosted.org/packages/30/27/78873dc8b6a56357517b74b6bb9568b80450e7bb4f6ef7e3fa9d22aa0bd7/charset_normalizer-3.5.1-cp312-cp312-macosx_10_13_universal2.whl", hash = "sha256:5b6d1386bf0096d26d3a863dc0a487a5b4eb9aa93cf5ba69683d29dde6b9d60f", size = 344456, upload-time = "2026-08-15T08:17:10.072Z" }, + { url = "https://files.pythonhosted.org/packages/9a/4c/be49ada26b1f0232d57aa89bbebf997a5cc2332a5616b6eca26ff680044d/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4582c27e8c889d64811987b5967fbd3ae0c823fe1fd933b543d55ac20bb475fa", size = 238530, upload-time = "2026-08-15T08:17:11.563Z" }, + { url = "https://files.pythonhosted.org/packages/76/84/6f1290fa07ae6978d3960caa3eb1b8019bf9284ab7c2297b00c099ef4250/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1d1c7a53a6c2103925cdd6d7229f8c567379f211c869793df679f2e9f738c369", size = 230200, upload-time = "2026-08-15T08:17:12.919Z" }, + { url = "https://files.pythonhosted.org/packages/e7/a0/47b18adeed31c8f16ba9700f32c1b18594cfa09f47eb672a488c273c22bf/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:e6621fb2a4988d6e53eedc455e5903e2679f3967b8acb3d639f1b63c14a2e893", size = 262222, upload-time = "2026-08-15T08:17:14.571Z" }, + { url = "https://files.pythonhosted.org/packages/38/fe/341861ac118dae06f3ec0eb487488af52128f2ef2faf0b11003944d22259/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:7c0c10730342b0c9b35dd1d619beb8214e520bd96a1f870f452680b238aab3e0", size = 258951, upload-time = "2026-08-15T08:17:16.158Z" }, + { url = "https://files.pythonhosted.org/packages/6f/89/bb5108dc6c3651dca963f2b0a3ba19bbcb370c94e1b6d3e0e844a58e6dca/charset_normalizer-3.5.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b9af956078716df40d985fb0dfeb2c2120c5ca92ba4ff4b388acfd01cdc14d08", size = 248801, upload-time = "2026-08-15T08:17:17.683Z" }, + { url = "https://files.pythonhosted.org/packages/b1/ba/ef83ae3aca816393decfa3530976f38a79812d707b80b580ac33b83f9877/charset_normalizer-3.5.1-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f9f8405c2c758532c74fed975dbee57be1f31a6e865c031870c79a6ed3212ada", size = 244070, upload-time = "2026-08-15T08:17:19.191Z" }, + { url = "https://files.pythonhosted.org/packages/f6/0b/c5292a2462d69b7378ea89793bbb5b2b6fcf6f7dd6d1667f9619094ad553/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:96fef3e886d6a9874b14f27fc193fbdc69d5d8035783d86aa4e1cea594e695f9", size = 240110, upload-time = "2026-08-15T08:17:20.547Z" }, + { url = "https://files.pythonhosted.org/packages/46/22/111e5be3b740d5c2a5bfcedb3d237b6591e5c2e82ae9d6ffcb121fe0909c/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:5d8531a6569d025f68e2321e7638fb7978f23db58e5f69f56913837aae03816e", size = 232836, upload-time = "2026-08-15T08:17:21.895Z" }, + { url = "https://files.pythonhosted.org/packages/f9/d2/d2aad6fe0dbb44b194bf3becb60f5a0ac48446ade999a47fe7bb41eb09a7/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:aae2ee51122d3ae968a3837d97dc24a0aeebb0dea23694422cd172bd30017cd6", size = 262712, upload-time = "2026-08-15T08:17:23.727Z" }, + { url = "https://files.pythonhosted.org/packages/35/5a/337e4663a5eae6de99db940ee8066d4145caafb61327db62deda15313cce/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:7235dc28fc6dd9d832ac7c7bce95367dedb85929f17368a0c2bee1e080b9acbf", size = 242977, upload-time = "2026-08-15T08:17:25.157Z" }, + { url = "https://files.pythonhosted.org/packages/ca/85/f82f8a92e31c7519410e2e1afdc630f28ec47490ce2c09a11c1a43cbb459/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_s390x.whl", hash = "sha256:4abdc5f9ad448c1ecbfae2974b820535d6bc6e7eef63babbab3d81cf46968c71", size = 260207, upload-time = "2026-08-15T08:17:26.602Z" }, + { url = "https://files.pythonhosted.org/packages/b7/52/643d11ffd60e9ac2fd1fb87e167a19285b9eefeff4a40e63c87cbfbeab36/charset_normalizer-3.5.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:ba501e667c17d8411f98e67a022d9604ef179aff0e459b7e292c796837c13573", size = 250562, upload-time = "2026-08-15T08:17:27.971Z" }, + { url = "https://files.pythonhosted.org/packages/62/16/46556278c2168d12df9da7fede5dc6fc70e60301b26a82bbeec238c9cfe3/charset_normalizer-3.5.1-cp312-cp312-win32.whl", hash = "sha256:cfa1c0cc3a8f9f53f1243a5a99ac36fd003880199383b37672e86ddda9cb07e2", size = 178507, upload-time = "2026-08-15T08:17:29.277Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7a/4c6c298171e6b3e745633180ff59350fc0ca0db1ffd28df1e369e0579f71/charset_normalizer-3.5.1-cp312-cp312-win_amd64.whl", hash = "sha256:3617ac3cfd8b9888f145ad89dd6e692285834b0201c6074a5eeaad3fd4d668c2", size = 200551, upload-time = "2026-08-15T08:17:30.668Z" }, + { url = "https://files.pythonhosted.org/packages/cd/d7/eb95a042f0dd22e304b0b6472b154f3546a1a039a9ee89ccb2a7f61591fc/charset_normalizer-3.5.1-cp312-cp312-win_arm64.whl", hash = "sha256:88e85ab89cb822c1e635f51d6d32e488f94e002e70e2f492bdb8b945543f345a", size = 180700, upload-time = "2026-08-15T08:17:32.028Z" }, + { url = "https://files.pythonhosted.org/packages/5b/97/fb4e82231aba271ffd775a1b4993b0defc4e3059f286ae41d9433409fe85/charset_normalizer-3.5.1-cp37-abi3-macosx_10_9_universal2.whl", hash = "sha256:41876ee62a3dddf48ff1121ad8f0798032aa03f2fd35f21f34a4cab14f18d8d2", size = 331467, upload-time = "2026-08-15T08:19:50.959Z" }, + { url = "https://files.pythonhosted.org/packages/9f/2f/fe3f187327aac18e2d54e9d2b08e15d27bf9b642d9e51c219f130fc34d1a/charset_normalizer-3.5.1-cp37-abi3-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl", hash = "sha256:a6dac12ff6b846103483683f60c5f8fee205121adc58ffd87e90a90a3af69e99", size = 253057, upload-time = "2026-08-15T08:19:52.654Z" }, + { url = "https://files.pythonhosted.org/packages/d7/c7/9e48cee5c161fe24da823b61bf381921d77cb994a0a4de148e95018c1984/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cee5dd7c6fb5dd52a0fe2a740f9bc6e3593f5f8b1788bde49de02086f30182b2", size = 240930, upload-time = "2026-08-15T08:19:54.163Z" }, + { url = "https://files.pythonhosted.org/packages/49/e0/716601f3cc69be7b198951150c75ead1ece33c3c8036ff6ffa46029659a0/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:343fb4f2821043bd87095f7b08a1a181febc8e36ac64212143bbfd0a0e1bc235", size = 230822, upload-time = "2026-08-15T08:19:55.807Z" }, + { url = "https://files.pythonhosted.org/packages/d3/05/71bfc5caa0abcc45aea1f6a4d50ac68e59605ddc7666fe8494f4cd229665/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:ae4a097991662cd4fff0ddc74e0fe7874f82e00042fa0ea00855645ed0c79598", size = 260037, upload-time = "2026-08-15T08:19:57.312Z" }, + { url = "https://files.pythonhosted.org/packages/c3/92/de7e32ed05341e7a9c4c877c318418197b7f2d66a3b68d561bf2ac57ca3e/charset_normalizer-3.5.1-cp37-abi3-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:4b599739b93b2cbeded49645ae3c8d1405c29ddfbceac1545c87a3f9580a9e96", size = 255097, upload-time = "2026-08-15T08:19:59.056Z" }, + { url = "https://files.pythonhosted.org/packages/f5/7b/ade0a122600319dfa0b1000ab0f9731c94a817904cf3c5de408c73a4ede7/charset_normalizer-3.5.1-cp37-abi3-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b39b69b347e5e47a3b5b8cfc005c68c1ba347474e3960236c4944a8ecd174962", size = 250166, upload-time = "2026-08-15T08:20:00.612Z" }, + { url = "https://files.pythonhosted.org/packages/75/9c/019fbb9f4834491a160951349b1a3714439376f66e5f7cf18b4f18f0c7aa/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:a2028475ba855475b8b4d3cfeb4994269c967aea8b9892dfba907f4263a863a3", size = 241821, upload-time = "2026-08-15T08:20:02.321Z" }, + { url = "https://files.pythonhosted.org/packages/2b/b8/11d4840bfc99330cc7fbcc2681ee5a044553a6e77655508d8f9b2bff7b34/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_armv7l.whl", hash = "sha256:36047af20e17097c3bb9476c2b7655f2f7aa51322c0ba58c07695bedf755a950", size = 232529, upload-time = "2026-08-15T08:20:04.008Z" }, + { url = "https://files.pythonhosted.org/packages/18/96/2b3a21492d9f65171ac75d872f5018260013d00bfa0ff70ec9f179148cbd/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_ppc64le.whl", hash = "sha256:4c4fb141a727957c93edfe5c32a26ceb6b5f6461d67146e2d39f51e16170bea8", size = 260348, upload-time = "2026-08-15T08:20:05.877Z" }, + { url = "https://files.pythonhosted.org/packages/d6/aa/a69a2028e8bd052476c245460ab19d7de595de084dd968f2d75cd50c3e25/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_riscv64.whl", hash = "sha256:2f293479cce755c75f1697e87c409b7ae4c555c7dfecb6e988ad13abba943031", size = 247234, upload-time = "2026-08-15T08:20:07.487Z" }, + { url = "https://files.pythonhosted.org/packages/35/8a/3d130aeabcaf3d2466af76b7b141c08d9e89c9016ab4b7cdd0f7dc2d1c62/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_s390x.whl", hash = "sha256:3588e376b3ea2eea84976f67273d679f229e24c66dce7b82ae45aef04ff6e072", size = 256917, upload-time = "2026-08-15T08:20:09.142Z" }, + { url = "https://files.pythonhosted.org/packages/80/c2/a7379b840292d0c1ab9fbd17d1f3967aa81794dc95bc74be8999d7fedcf7/charset_normalizer-3.5.1-cp37-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:e199fb99720074809a7720f1c0b4d919eea8b87e88713e0f8f602f7bef543d9d", size = 254846, upload-time = "2026-08-15T08:20:10.727Z" }, + { url = "https://files.pythonhosted.org/packages/01/65/d43b714731bb2f40d4053dfa00ecfc1c5a301f8e3316c5db3a09af59fe94/charset_normalizer-3.5.1-cp37-abi3-win32.whl", hash = "sha256:dd732602a7009217f658d5863d12d79d373a4de0eebc111094bcdd3bb8e0a6cc", size = 174216, upload-time = "2026-08-15T08:20:12.334Z" }, + { url = "https://files.pythonhosted.org/packages/35/4f/b911ed898b26a09789eba9c9200c999aff6c61b4bafaf4838e56d1a1e1a3/charset_normalizer-3.5.1-cp37-abi3-win_amd64.whl", hash = "sha256:70055ff39b97c99e7ae40ea3e393fb62aa2e44dbd9b29f8d14f42fb0025c3959", size = 199764, upload-time = "2026-08-15T08:20:13.908Z" }, + { url = "https://files.pythonhosted.org/packages/f0/a7/920baf467bfd9bf689f3b318340f37aee4572a71f162bd8db51da55ba4fa/charset_normalizer-3.5.1-cp37-abi3-win_arm64.whl", hash = "sha256:87e4f41d375c0b9be2fb5251aee4b8a689169e134535aed81bf085c3b647451e", size = 287318, upload-time = "2026-08-15T08:20:15.551Z" }, + { url = "https://files.pythonhosted.org/packages/cc/61/d01fc49b8dea277640b55a9e15960dbca9fdc8c9fde18e572d39c59f4019/charset_normalizer-3.5.1-py3-none-any.whl", hash = "sha256:6df0ec430f9a831772c23ca5a224cba36517a58a84bb32c32bb59a9fa67c47f6", size = 68658, upload-time = "2026-08-15T08:20:43.306Z" }, +] + +[[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" }, +] + +[[package]] +name = "colorama" +version = "0.4.6" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } +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.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cffi", marker = "platform_python_implementation != 'PyPy'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/ad/5d6702db60b1e40b41ef513b6967ff5848f307d50f8449baf1634f5908f1/cryptography-50.0.1.tar.gz", hash = "sha256:5dd9bda1c12b4162f6ff568eeb5e0ff956c28d14406e875cfe8a63a2d414ff20", size = 880381, upload-time = "2026-08-25T19:45:45.499Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/19/797e2aaac9df6a66f1550f49979dc1b1e39ecd2077501c30efa81e8d5d67/cryptography-50.0.1-cp311-abi3-macosx_11_0_arm64.whl", hash = "sha256:b8f852c65863251b9e3a1b8c150ce21e59b522dbb6a7d4bc80e680d38388e986", size = 4010153, upload-time = "2026-08-25T19:44:03.155Z" }, + { url = "https://files.pythonhosted.org/packages/90/34/9ce9a62ed9dc82ca9fd6a34445b6904af56e5f38b3eae2ed32e49c36053d/cryptography-50.0.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:53e279950892dc102c6b4e52af03ae5ea92fac572a1ddab78ca73a997f62b69f", size = 4723133, upload-time = "2026-08-25T19:44:05.461Z" }, + { url = "https://files.pythonhosted.org/packages/57/26/e6d4fc8512a51a5f9ee7bfdbfb853bce1197087df40c9ad993ad370b846f/cryptography-50.0.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:ff838d62ec1bfce4f9ba7fa16f4a7b554cd8d0c299e6be37502161a660c84eef", size = 4712478, upload-time = "2026-08-25T19:44:07.375Z" }, + { url = "https://files.pythonhosted.org/packages/e6/de/d3cdc2815697aae84126cbd6a030ca7b6b452e28a88b501b836bd3aa7a86/cryptography-50.0.1-cp311-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:e74591e283fe6eb956416c929eb58262a719fe0311fd9054c62c3350ed8760d8", size = 4730726, upload-time = "2026-08-25T19:44:09.294Z" }, + { url = "https://files.pythonhosted.org/packages/55/32/38c0d344b98c06d34b5df8946565a9c0d6dbf32c8e0730a7f05f0a3c6cab/cryptography-50.0.1-cp311-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:5fe002589592ed749ce77fe0695fcbd3500dd61d7d6db5858a7544c612fa8e45", size = 5353524, upload-time = "2026-08-25T19:44:11.96Z" }, + { url = "https://files.pythonhosted.org/packages/e1/1b/82f0f0d8858d4432be1af790477edf62aef90324041aa07c57e57bef1af7/cryptography-50.0.1-cp311-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:51593d180cf6d179bde5c5d065bed81386b1f381656ae7d042b7ffc87a9895ad", size = 4746720, upload-time = "2026-08-25T19:44:14.051Z" }, + { url = "https://files.pythonhosted.org/packages/29/ba/042ca458b8c64348c768284b5d23e69b92ed53d057ab779fee628564676d/cryptography-50.0.1-cp311-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:359e62deae718bce96170e223fdcb6357e4fbd3bb7a3a75f4430763532560e49", size = 4361866, upload-time = "2026-08-25T19:44:16.167Z" }, + { url = "https://files.pythonhosted.org/packages/39/3b/e96c1ef71edef71057c7e3c3d982ce8fda554e0c52d0cc19c18845cde3eb/cryptography-50.0.1-cp311-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:e2ca8fd1b6b4b82a1c4cb02841d0837e3c12336c2e24b520ab8ab3b969733d8f", size = 4730028, upload-time = "2026-08-25T19:44:18.085Z" }, + { url = "https://files.pythonhosted.org/packages/e3/38/45abd72ef63f2e7d0754a6cacf97bd8b69512ace7f6130d24c39ece65da2/cryptography-50.0.1-cp311-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:76de83fbd91ac49c0feaaa983d0748fd7a53176afac5fb3bf7478d244f0eb527", size = 5308405, upload-time = "2026-08-25T19:44:20.197Z" }, + { url = "https://files.pythonhosted.org/packages/85/66/6ccca4722987ddedaa7fc9c3f4708af7431f5535666c174350830888c6b7/cryptography-50.0.1-cp311-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:51afcfceb15597cf2635068e4ac9a56b2abde622edde17f37d85fd7b5306497a", size = 4746230, upload-time = "2026-08-25T19:44:22.376Z" }, + { url = "https://files.pythonhosted.org/packages/13/0e/b1f92e013228111413f2e6743948b80bc24dfd3c1b87ba98ceea16f5df89/cryptography-50.0.1-cp311-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:be224a65493ec5b74a158ff22a5522ce4a5ca1e543c647a3a4730d4a09e5f959", size = 4862596, upload-time = "2026-08-25T19:44:24.472Z" }, + { url = "https://files.pythonhosted.org/packages/7e/22/c3654cccc856e9d682817b04ac3ee79731cb09ca6f95996a95c904de2883/cryptography-50.0.1-cp311-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:9ebcdd5519be9b652a46f507817a74591774fc3d6923ac364e4dfa64e36b291b", size = 5014082, upload-time = "2026-08-25T19:44:26.709Z" }, + { url = "https://files.pythonhosted.org/packages/42/8b/cb12b1b60c91b074ca6bf0fdd59aa8f10d8bc5f73af8faece86ef0421b37/cryptography-50.0.1-cp311-abi3-win_amd64.whl", hash = "sha256:aed8db4f6d71c51efb89530e12d9464e7bf2923d46c3205dc794a2a93f8c0648", size = 3842826, upload-time = "2026-08-25T19:44:28.784Z" }, + { url = "https://files.pythonhosted.org/packages/84/a9/ee16a903f13755e914d1eecc482fe64d1f10761c3960e5d8fa6837377aff/cryptography-50.0.1-cp39-abi3-macosx_11_0_arm64.whl", hash = "sha256:ca83d00d9e69cd5eb63f2e69c3a5a59e0cecae5ae14c6ae0b35830fe3b37bad0", size = 4035307, upload-time = "2026-08-25T19:44:58.305Z" }, + { url = "https://files.pythonhosted.org/packages/5e/a5/9ec7e81e8526c0d7a387d73386b2daed3f39e10d81a85930bd1b6bfba65c/cryptography-50.0.1-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl", hash = "sha256:05ba322c4da95b262a212c345af888ef2c37c88c0509756ea00a0e6d68850f23", size = 4751900, upload-time = "2026-08-25T19:45:00.401Z" }, + { url = "https://files.pythonhosted.org/packages/7e/3c/0e77bd5ffcf078e9dd27d3074aad6c030d9b10d0bf69329d573c927a188c/cryptography-50.0.1-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl", hash = "sha256:e22dfed744bd4002e909464cb23d2f0b05c6f3113a79ef2e9864a53db737c733", size = 4738357, upload-time = "2026-08-25T19:45:02.786Z" }, + { url = "https://files.pythonhosted.org/packages/27/3a/3c5f80daa4dcd47323c7af8a2fcb90de27a33564d4fcac69846c0972691a/cryptography-50.0.1-cp39-abi3-manylinux_2_28_aarch64.whl", hash = "sha256:4c4188f7c0cf655be5c06342b817ed0f9595b69ffa2b12026e5353eed29dea88", size = 4758474, upload-time = "2026-08-25T19:45:04.889Z" }, + { url = "https://files.pythonhosted.org/packages/6e/2b/214cf0cf93db9628c3c20c896b229f327f6fb1b20e4b3743d8ad3f00af8b/cryptography-50.0.1-cp39-abi3-manylinux_2_28_ppc64le.whl", hash = "sha256:2ebbfb0f1fed745e91796e3e1080a1440423fdae8ece1b995a1d80883a409054", size = 5375862, upload-time = "2026-08-25T19:45:07.163Z" }, + { url = "https://files.pythonhosted.org/packages/d6/51/3f9701867a46b6c1740c9b52fc4d3bed6cbdcfedcc9b6e64305c07f39cff/cryptography-50.0.1-cp39-abi3-manylinux_2_28_x86_64.whl", hash = "sha256:407fe2b6db00939c05c0e945e9914238f2f0a430974839429dafc82b1ee6bee5", size = 4772942, upload-time = "2026-08-25T19:45:09.396Z" }, + { url = "https://files.pythonhosted.org/packages/0d/5c/13ea642e08e2544d0f5396122055f4820cfacb3203562197b5967125ea97/cryptography-50.0.1-cp39-abi3-manylinux_2_31_armv7l.whl", hash = "sha256:2b34d76a652ea2b6faf777c35df230c5637842cd904e04f16230c3f9f03e4361", size = 4383347, upload-time = "2026-08-25T19:45:11.659Z" }, + { url = "https://files.pythonhosted.org/packages/84/d5/7d1fe1cb93f91c428093ff234e128c89ba8ea61a6f26aab406081f9b996e/cryptography-50.0.1-cp39-abi3-manylinux_2_34_aarch64.whl", hash = "sha256:01f41478cf33fc605a6a089cd56d28b45c6c0b45a1928b61797f2621a04bac71", size = 4758050, upload-time = "2026-08-25T19:45:13.745Z" }, + { url = "https://files.pythonhosted.org/packages/dd/04/557fc5ead96a829e0bc812a3b9dc4a52a2f27e4f7f5950da7ff27653a805/cryptography-50.0.1-cp39-abi3-manylinux_2_34_ppc64le.whl", hash = "sha256:fc3ed7ebd2a8c96f5b166de0ab9b624996bef3b07bbeb19364dfb78222c22c80", size = 5332955, upload-time = "2026-08-25T19:45:16.193Z" }, + { url = "https://files.pythonhosted.org/packages/8c/eb/5d7124083e8d8cda8f5b348f544b71ad6f707ad63193758ef4d8e569da02/cryptography-50.0.1-cp39-abi3-manylinux_2_34_x86_64.whl", hash = "sha256:9dde0a357190eb3b1da1bb9ab750e9c85cba82ca5977aa0836cbb94e92611239", size = 4772694, upload-time = "2026-08-25T19:45:18.315Z" }, + { url = "https://files.pythonhosted.org/packages/63/8e/f1f955e0921dd2b6d22eae7e8d24a4c4b638d10735ffbf6a71f99eb0fcb8/cryptography-50.0.1-cp39-abi3-musllinux_1_2_aarch64.whl", hash = "sha256:fd3718b960d0b5dd213cdf03f3bcb7000e69dda0de8b956061947ff6bcff5558", size = 4888413, upload-time = "2026-08-25T19:45:20.4Z" }, + { url = "https://files.pythonhosted.org/packages/1f/ab/89e2b798d2c3925f82e2bb72d5979f3d2f6da2dd22ef4a8cd8b70d920039/cryptography-50.0.1-cp39-abi3-musllinux_1_2_x86_64.whl", hash = "sha256:2a93d05e34d5f67fba6f891fe85d929999baa7195e853923ea6d7576c9e68c5e", size = 5044355, upload-time = "2026-08-25T19:45:22.353Z" }, + { url = "https://files.pythonhosted.org/packages/99/89/87ef49ffe383ef4e147d27b7bf2088fb0b54ea409dd87b5a89442e5828a5/cryptography-50.0.1-cp39-abi3-win_amd64.whl", hash = "sha256:55d16b1ef3ee0958d893a977b19777887e546c9954ea81b200c3301a864013f2", size = 3875429, upload-time = "2026-08-25T19:45:24.418Z" }, + { url = "https://files.pythonhosted.org/packages/c7/27/8d207af749c453ee17ea087340b3f2b4adef75aadd1d277b1b129bdda84e/cryptography-50.0.1-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:9cb3cb952cf5a8abd50c782a98a89d71699715e802fe349704b47f2425b42a94", size = 3974350, upload-time = "2026-08-25T19:45:26.551Z" }, + { url = "https://files.pythonhosted.org/packages/14/9a/6d3a4d7852e22d657438b7bf51f66102c7d71c0e1fafeec652281d0403e5/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_28_aarch64.whl", hash = "sha256:5fe939deeb161024a6be98229c953b6591fef1f41214497a78fe793a244c017f", size = 4698675, upload-time = "2026-08-25T19:45:28.658Z" }, + { url = "https://files.pythonhosted.org/packages/73/35/5c3717edf9e68a0550ce04e28eab493fe545eccd81742af03f6a75fe260b/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_28_x86_64.whl", hash = "sha256:fb4b9672d389c738b175c4166e78310f8a70358886aacd9173ee03a85ffdc671", size = 4707410, upload-time = "2026-08-25T19:45:30.816Z" }, + { url = "https://files.pythonhosted.org/packages/1d/e0/e786934472e3ac4ecdecc7b129a0ca1a2a40dffdafcf2c3ea9d4397f8def/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_34_aarch64.whl", hash = "sha256:d63ae8f6481fec907ac0f588eee8a90aefde112c633131fe540e5711ddbb5a4e", size = 4698378, upload-time = "2026-08-25T19:45:33.043Z" }, + { url = "https://files.pythonhosted.org/packages/51/cf/5b3f53a0b74d122f023476ede40ba5d3e70d5cf475f73b899740d26a4fb2/cryptography-50.0.1-pp311-pypy311_pp73-manylinux_2_34_x86_64.whl", hash = "sha256:804728ce710890870f3aaa344b2e161172d258d768ac139d02cfd9092d0d94e6", size = 4706889, upload-time = "2026-08-25T19:45:35.086Z" }, + { url = "https://files.pythonhosted.org/packages/71/44/711e61f7d014be825ef79b285b047292d1bf893732ac1bc030a351fb517f/cryptography-50.0.1-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:693c99b49bd37d0d096e4334c10232c77248c415b98d35236094cdf96d57258b", size = 3824006, upload-time = "2026-08-25T19:45:37.281Z" }, +] + +[[package]] +name = "cyclopts" +version = "4.25.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "docstring-parser" }, + { name = "rich" }, + { name = "rich-rst" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/8f/6caec9cf291ba294a0d0669b0388e5676d8887d8b75a8c3ad0a2dc2eeed9/cyclopts-4.25.2.tar.gz", hash = "sha256:0776bc1fa796cd351646c345b7420279e58d6c2c4a8f5d5dd54dea85bdb2de8f", size = 202467, upload-time = "2026-09-08T16:58:04.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2c/0e/eadf712ca776fd96982c09348dd8f141ae6f96746a4eabc3e3fb54dea738/cyclopts-4.25.2-py3-none-any.whl", hash = "sha256:51b42513eea5e4ba6a08b68acf187b81f1191032cf77b9631086cfa2c88fa7a4", size = 242400, upload-time = "2026-09-08T16:58:02.696Z" }, +] + +[[package]] +name = "distlib" +version = "0.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c9/02/bd72be9134d25ed783ecbbc38a539ffaefbf90c78418c7fb7229600dbac7/distlib-0.4.3.tar.gz", hash = "sha256:f152097224a0ae24be5a0f6bae1b9359af82133bce63f98a95f86cae1aede9ed", size = 615141, upload-time = "2026-06-12T08:04:52.847Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/08/9c41fb51ab5b43eb21674aff13df270e8ba6c4b29c8624e328dc7a9482af/distlib-0.4.3-py2.py3-none-any.whl", hash = "sha256:4b0ce306c966eb73bc3a7b6abad017c556dadd92c44701562cd528ac7fde4d5b", size = 470628, upload-time = "2026-06-12T08:04:50.506Z" }, +] + +[[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 = "dnspython" +version = "2.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/8c/8b/57666417c0f90f08bcafa776861060426765fdb422eb10212086fb811d26/dnspython-2.8.0.tar.gz", hash = "sha256:181d3c6996452cb1189c4046c61599b84a5a86e099562ffde77d26984ff26d0f", size = 368251, upload-time = "2025-09-07T18:58:00.022Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ba/5a/18ad964b0086c6e62e2e7500f7edc89e3faa45033c71c1893d34eed2b2de/dnspython-2.8.0-py3-none-any.whl", hash = "sha256:01d9bbc4a2d76bf0db7c1f729812ded6d912bd318d3b1cf81d30c0f845dbf3af", size = 331094, upload-time = "2025-09-07T18:57:58.071Z" }, +] + +[[package]] +name = "docstring-parser" +version = "0.18.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e0/4d/f332313098c1de1b2d2ff91cf2674415cc7cddab2ca1b01ae29774bd5fdf/docstring_parser-0.18.0.tar.gz", hash = "sha256:292510982205c12b1248696f44959db3cdd1740237a968ea1e2e7a900eeb2015", size = 29341, upload-time = "2026-04-14T04:09:19.867Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a7/5f/ed01f9a3cdffbd5a008556fc7b2a08ddb1cc6ace7effa7340604b1d16699/docstring_parser-0.18.0-py3-none-any.whl", hash = "sha256:b3fcbed555c47d8479be0796ef7e19c2670d428d72e96da63f3a40122860374b", size = 22484, upload-time = "2026-04-14T04:09:18.638Z" }, +] + +[[package]] +name = "email-validator" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "dnspython" }, + { name = "idna" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/f5/22/900cb125c76b7aaa450ce02fd727f452243f2e91a61af068b40adba60ea9/email_validator-2.3.0.tar.gz", hash = "sha256:9fc05c37f2f6cf439ff414f8fc46d917929974a82244c20eb10231ba60c54426", size = 51238, upload-time = "2025-08-26T13:09:06.831Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/15/545e2b6cf2e3be84bc1ed85613edd75b8aea69807a71c26f4ca6a9258e82/email_validator-2.3.0-py3-none-any.whl", hash = "sha256:80f13f623413e6b197ae73bb10bf4eb0908faf509ad8362c5edeb0be7fd450b4", size = 35604, upload-time = "2025-08-26T13:09:05.858Z" }, +] + +[[package]] +name = "exceptiongroup" +version = "1.3.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/50/79/66800aadf48771f6b62f7eb014e352e5d06856655206165d775e675a02c9/exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219", size = 30371, upload-time = "2025-11-21T23:01:54.787Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/8a/0e/97c33bf5009bdbac74fd2beace167cab3f978feb69cc36f1ef79360d6c4e/exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598", size = 16740, upload-time = "2025-11-21T23:01:53.443Z" }, +] + +[[package]] +name = "fastmcp" +version = "3.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "authlib" }, + { name = "cyclopts" }, + { name = "exceptiongroup" }, + { name = "httpx" }, + { name = "jsonref" }, + { name = "jsonschema-path" }, + { name = "mcp" }, + { name = "openapi-pydantic" }, + { name = "opentelemetry-api" }, + { name = "packaging" }, + { name = "platformdirs" }, + { name = "py-key-value-aio", extra = ["filetree", "keyring", "memory"] }, + { name = "pydantic", extra = ["email"] }, + { name = "pyperclip" }, + { name = "python-dotenv" }, + { name = "pyyaml" }, + { name = "rich" }, + { name = "uncalled-for" }, + { name = "uvicorn" }, + { name = "watchfiles" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/d0/32/4f1b2cfd7b50db89114949f90158b1dcc2c92a1917b9f57c0ff24e47a2f4/fastmcp-3.2.0.tar.gz", hash = "sha256:d4830b8ffc3592d3d9c76dc0f398904cf41f04910e41a0de38cc1004e0903bef", size = 26318581, upload-time = "2026-03-30T20:25:37.692Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/4f/67/684fa2d2de1e7504549d4ca457b4f854ccec3cd3be03bd86b33b599fbf58/fastmcp-3.2.0-py3-none-any.whl", hash = "sha256:e71aba3df16f86f546a4a9e513261d3233bcc92bef0dfa647bac3fa33623f681", size = 705550, upload-time = "2026-03-30T20:25:35.499Z" }, +] + +[[package]] +name = "filelock" +version = "3.32.7" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0f/59/e19834834cb01a32febfbb0f8a23a9088088f5d45991824ff2bc3b5e8acb/filelock-3.32.7.tar.gz", hash = "sha256:37b8a3d9811b0f9aef7e5ec5c71bb320de52df51e6ca9bcd6f5ad81187660da7", size = 225154, upload-time = "2026-09-16T00:24:20.907Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/15/df/31098c5aeb4d966b553641472bd55fcf5fdfac953549894b8a765ba44e91/filelock-3.32.7-py3-none-any.whl", hash = "sha256:65ff0d0190ea42038b32bda4b77834fb05be2cad4c5b9b01aa4dfb3614536e52", size = 100157, upload-time = "2026-09-16T00:24:19.543Z" }, +] + +[[package]] +name = "google-auth" +version = "2.58.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "pyasn1-modules" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ac/ca/f398a483ce5aad18ca2f735646e45ccee2439bd94a41a4ad0cfa646bd495/google_auth-2.58.0.tar.gz", hash = "sha256:55e30cf15e737de92c5323d78cda8a83fcd57e7ffbaf900c4600039fd60a80fd", size = 380018, upload-time = "2026-09-09T20:49:38.043Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/59/13/477d90d09591b3938b45c4e11f4d8a51291682112cb5efcac961e815d562/google_auth-2.58.0-py3-none-any.whl", hash = "sha256:8a9c4645bb4c8e91668fb1934b95ae6a8687084232753639220ba9bf04a1610d", size = 262404, upload-time = "2026-09-09T20:49:33.951Z" }, +] + +[package.optional-dependencies] +requests = [ + { name = "requests" }, +] + +[[package]] +name = "google-genai" +version = "2.24.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/35/26/176d04f442e82d60cadc74cfaf81f01017062ce274a790455a57aec48c8f/google_genai-2.24.0.tar.gz", hash = "sha256:814b63d05dca4776c5a322699eb30c565040cf8d5fd77c38714076535fb2e019", size = 705409, upload-time = "2026-09-16T22:38:37.367Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/84/5b/87913fe392ba7b6402577259289ed3740c577956554a674b191a2971d33e/google_genai-2.24.0-py3-none-any.whl", hash = "sha256:59e5f2d88bc2d6ed04aa1aa14cb5629090cfe9458401745e620b24d1fe9893d7", size = 1142675, upload-time = "2026-09-16T22:38:35.332Z" }, +] + +[[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.13.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "h11" }, + { name = "truststore" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/15/8c/e925b1c92018abb3a1863ce1549d76d2381e334d21d65d4ac8f65dabd78a/httpcore2-2.13.0.tar.gz", hash = "sha256:2adc8be4fb285fbcd6d894298db3b52c177e74b6674eda3a76bd36be3292a3db", size = 67740, upload-time = "2026-09-14T14:18:04.717Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7e/0d/117a771a2bb91df334b66bf4da14cd02f21aefbcfe53180f336ce55e8f90/httpcore2-2.13.0-py3-none-any.whl", hash = "sha256:35ae5be347aa40467b4a5dc032ac67ebb6d27189fc97e8cebcf99616f6a1bb9e", size = 83162, upload-time = "2026-09-14T14:18:02.529Z" }, +] + +[[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 = "httpx-sse" +version = "0.4.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/0f/4c/751061ffa58615a32c31b2d82e8482be8dd4a89154f003147acee90f2be9/httpx_sse-0.4.3.tar.gz", hash = "sha256:9b1ed0127459a66014aec3c56bebd93da3c1bc8bb6618c8082039a44889a755d", size = 15943, upload-time = "2025-10-10T21:48:22.271Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d2/fd/6668e5aec43ab844de6fc74927e155a3b37bf40d7c3790e49fc0406b6578/httpx_sse-0.4.3-py3-none-any.whl", hash = "sha256:0ac1c9fe3c0afad2e0ebb25a934a59f4c7823b60792691f779fad2c5568830fc", size = 8960, upload-time = "2025-10-10T21:48:21.158Z" }, +] + +[[package]] +name = "httpx2" +version = "2.13.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" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b9/a0/e9deef4654132857b5a5dbe4eddd0ac59c2814500e11f2f5044cd81103ee/httpx2-2.13.0.tar.gz", hash = "sha256:81bd07dc67a3701729ef1f777a3c00c915d4539604fdb5afd327f8682f6b7b44", size = 100290, upload-time = "2026-09-14T14:18:05.486Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fe/d1/a0c72b0e006df654709fbc366cc5bcb53e5aee13e1e3395152c6dd293376/httpx2-2.13.0-py3-none-any.whl", hash = "sha256:fc12720cedf72faa26cca6b4ca394e05c894e7d7933fc45cafe767960804e49a", size = 95565, upload-time = "2026-09-14T14:18:03.553Z" }, +] + +[[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 = "hud" +version = "0.6.17" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anthropic" }, + { name = "asyncssh" }, + { name = "asyncvnc" }, + { name = "fastmcp" }, + { name = "google-genai" }, + { name = "httpx" }, + { name = "httpx2" }, + { name = "mcp" }, + { name = "openai" }, + { name = "packaging" }, + { name = "pillow" }, + { name = "prompt-toolkit" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { name = "python-dotenv" }, + { name = "questionary" }, + { name = "rich" }, + { name = "typer" }, + { name = "websockets" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/0a/42/bb291ffe0c3748b4aad72fac1aa778113312b15b5198e30488e6639cfe5e/hud-0.6.17.tar.gz", hash = "sha256:76dbdd3c8251b65d8407f6080d1d4d17909ed3a013f6a5de5f710a6393bb1909", size = 548264, upload-time = "2026-09-14T07:13:43.274Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/54/d685413b1322cf28cd3884c7e6ddb7a57ac6ba1b360359d88f6dc9be6843/hud-0.6.17-py3-none-any.whl", hash = "sha256:f7023c7d72987d45b08bff76c76f5851f644f84fcd7da6fdd8ef3da2bb744a84", size = 656048, upload-time = "2026-09-14T07:13:41.841Z" }, +] + +[[package]] +name = "identify" +version = "2.6.19" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/52/63/51723b5f116cc04b061cb6f5a561790abf249d25931d515cd375e063e0f4/identify-2.6.19.tar.gz", hash = "sha256:6be5020c38fcb07da56c53733538a3081ea5aa70d36a156f83044bfbf9173842", size = 99567, upload-time = "2026-04-17T18:39:50.265Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/84/d9273cd09688070a6523c4aee4663a8538721b2b755c4962aafae0011e72/identify-2.6.19-py2.py3-none-any.whl", hash = "sha256:20e6a87f786f768c092a721ad107fc9df0eb89347be9396cadf3f4abbd1fb78a", size = 99397, upload-time = "2026-04-17T18:39:49.221Z" }, +] + +[[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 = "importlib-metadata" +version = "9.0.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "zipp" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6f/7e/1e7e8dc30634b93ebb3d58a3dea569ad146e656218d3960ab04f62047b29/importlib_metadata-9.0.1.tar.gz", hash = "sha256:ab830580bc0ef3db61ce8fae716389e5462b67e033018bab6d8f80ef17172f99", size = 59124, upload-time = "2026-08-28T15:30:34.646Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/55/ecca97ae19075f1fac62def77731e7f535e6c1fb8f92ff08160c5e6dade8/importlib_metadata-9.0.1-py3-none-any.whl", hash = "sha256:bba5600596a7e21f3eef53281cf28d6a5195634d2f2b78ff9501a3272c6eaab0", size = 27920, upload-time = "2026-08-28T15:30:33.433Z" }, +] + +[[package]] +name = "iniconfig" +version = "2.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/72/34/14ca021ce8e5dfedc35312d08ba8bf51fdd999c576889fc2c24cb97f4f10/iniconfig-2.3.0.tar.gz", hash = "sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730", size = 20503, upload-time = "2025-10-18T21:55:43.219Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" }, +] + +[[package]] +name = "jaraco-classes" +version = "3.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "more-itertools" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/c0/ed4a27bc5571b99e3cff68f8a9fa5b56ff7df1c2251cc715a652ddd26402/jaraco.classes-3.4.0.tar.gz", hash = "sha256:47a024b51d0239c0dd8c8540c6c7f484be3b8fcf0b2d85c13825780d3b3f3acd", size = 11780, upload-time = "2024-03-31T07:27:36.643Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/7f/66/b15ce62552d84bbfcec9a4873ab79d993a1dd4edb922cbfccae192bd5b5f/jaraco.classes-3.4.0-py3-none-any.whl", hash = "sha256:f662826b6bed8cace05e7ff873ce0f9283b5c924470fe664fff1c2f00f581790", size = 6777, upload-time = "2024-03-31T07:27:34.792Z" }, +] + +[[package]] +name = "jaraco-context" +version = "6.1.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "backports-tarfile", marker = "python_full_version < '3.12'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/50/4763cd07e722bb6285316d390a164bc7e479db9d90daa769f22578f698b4/jaraco_context-6.1.2.tar.gz", hash = "sha256:f1a6c9d391e661cc5b8d39861ff077a7dc24dc23833ccee564b234b81c82dfe3", size = 16801, upload-time = "2026-03-20T22:13:33.922Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f2/58/bc8954bda5fcda97bd7c19be11b85f91973d67a706ed4a3aec33e7de22db/jaraco_context-6.1.2-py3-none-any.whl", hash = "sha256:bf8150b79a2d5d91ae48629d8b427a8f7ba0e1097dd6202a9059f29a36379535", size = 7871, upload-time = "2026-03-20T22:13:32.808Z" }, +] + +[[package]] +name = "jaraco-functools" +version = "4.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "more-itertools" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/6c/1f/c23395957d41ccf27c4e535c3d334c4051e5395b3752057ba4cbaec35c56/jaraco_functools-4.6.0.tar.gz", hash = "sha256:880c577ec9720b3a052d5bc611fb9f2269b3d87902ef42440df443b88e443280", size = 20837, upload-time = "2026-07-14T01:28:02.544Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/02/36/ecc85bc96c273dc8a11273ed4782272975e6338d4a3e9228621175edf0e3/jaraco_functools-4.6.0-py3-none-any.whl", hash = "sha256:99e3dc0060c5cbe8fcd1cdb36258e2a65ca40f1566b2033b12abb1bb44dd3c30", size = 11677, upload-time = "2026-07-14T01:28:01.59Z" }, +] + +[[package]] +name = "jeepney" +version = "0.9.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7b/6f/357efd7602486741aa73ffc0617fb310a29b588ed0fd69c2399acbb85b0c/jeepney-0.9.0.tar.gz", hash = "sha256:cf0e9e845622b81e4a28df94c40345400256ec608d0e55bb8a3feaa9163f5732", size = 106758, upload-time = "2025-02-27T18:51:01.684Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b2/a3/e137168c9c44d18eff0376253da9f1e9234d0239e0ee230d2fee6cea8e55/jeepney-0.9.0-py3-none-any.whl", hash = "sha256:97e5714520c16fc0a45695e5365a2e11b81ea79bba796e26f9f1d178cb182683", size = 49010, upload-time = "2025-02-27T18:51:00.104Z" }, +] + +[[package]] +name = "jiter" +version = "0.17.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/9c/1f/8176d92e001f86505424b41664032ae26a882bc9ca41a32c803f373f9195/jiter-0.17.0.tar.gz", hash = "sha256:03e432f226a453851079fb84cd17c6da9991eab723e28d716f14ae3d906e0c12", size = 229037, upload-time = "2026-09-12T15:14:14.253Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a1/50/17afdaffcc8af4bf4fddf2b6c26d066553aa2221983f2affcde435fc2532/jiter-0.17.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:cfafd7be8b16ceadd298db542cead37cddc211c4c49e04ad2596924df18625b1", size = 290699, upload-time = "2026-09-12T15:11:30.085Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e4/c185d32d5b3657ad84da26c84a9eb15f00aa1b39d6882fcc0052dba2d7c2/jiter-0.17.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:8adca2e793288e5f1bb29279bb439d0d3cfbb50eddca7e7e6ffd42ff4f482406", size = 324246, upload-time = "2026-09-12T15:11:31.3Z" }, + { url = "https://files.pythonhosted.org/packages/24/7a/8b8903bfe91a90a8fa1ec9b45d9fda5b6287a386693b69d720a882d73f3c/jiter-0.17.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:30c692d567ba206c7cca38c9d1d0ccc70c9786290173c184d871ca12e9981ed7", size = 343275, upload-time = "2026-09-12T15:11:32.758Z" }, + { url = "https://files.pythonhosted.org/packages/a2/5d/6821fae2abc71a3c3a84bef8598d31fc4f27d9edfb55bd8f6c08afb8ef93/jiter-0.17.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:81c83c0abe614446a283d994d2c07c4f58632dea2cdf66ba9e2921bb8ccd593e", size = 328034, upload-time = "2026-09-12T15:11:33.9Z" }, + { url = "https://files.pythonhosted.org/packages/f3/51/8e7a963b1c2dfdc01d6228b004f50a2a3d7c46f0549d7b096a5d15ef81d5/jiter-0.17.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:073dc68c1a700c8fc480e877864a6b6ffc887533e261f4380c08c16bf09d057a", size = 342457, upload-time = "2026-09-12T15:11:36.414Z" }, + { url = "https://files.pythonhosted.org/packages/73/27/8b2a267e3bda45d9298331cacfe3521e761f0a2b05ad10a23c6548d08358/jiter-0.17.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:492f37230bbf9581ab2c17bcda862c249afb9ae2e3ab2dd6db59943bc4cc3153", size = 351271, upload-time = "2026-09-12T15:11:37.692Z" }, + { url = "https://files.pythonhosted.org/packages/4a/8f/5c74e5e142a6736833d7a991ab04d5c0738038dc44db05af0bb3cd2559e8/jiter-0.17.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:5888fe5abc1ca2fa834a3e1b4c7ef0dcece286a7d7e95a609ef0934b777b9fc9", size = 346052, upload-time = "2026-09-12T15:11:39.722Z" }, + { url = "https://files.pythonhosted.org/packages/98/9c/f54920f06d1696e80b1be841d56412871c6856b1b1e3b541b1ed35346554/jiter-0.17.0-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:84ac78df457e1ee3f7e733bd114823302ae8c5ad5542d7e6647d92ffaa090a04", size = 328915, upload-time = "2026-09-12T15:11:41.065Z" }, + { url = "https://files.pythonhosted.org/packages/21/53/080f126863bceb055db9f1fd5431485eb493b35545a3c35e961ac18cd924/jiter-0.17.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7573e80232c5bcf80c24c038cf7e53a463f5c3b1dd1dd4109d66304f4dccc233", size = 337240, upload-time = "2026-09-12T15:11:42.356Z" }, + { url = "https://files.pythonhosted.org/packages/f0/76/3ab742823a0e0e70e143c6c90a482d9d90396ac2445e7b9483eb7245d3b5/jiter-0.17.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:11902505d401691720f5785c15b02204248526edee11b635cd6c40cd52b81599", size = 484917, upload-time = "2026-09-12T15:11:43.549Z" }, + { url = "https://files.pythonhosted.org/packages/14/e0/8ca71bc8b9cc9ed96c9da565863e00f3bb875a8fb82abcf03e975e067902/jiter-0.17.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:64846211a2debe7c071d2146d2283d2b0c1c93dc8fd5fb7794faac2ca6061b5c", size = 521868, upload-time = "2026-09-12T15:11:44.704Z" }, + { url = "https://files.pythonhosted.org/packages/c1/02/81f8719dcedb75713082a2048405376c81f6546b75af8167f3bba01a1ed0/jiter-0.17.0-cp311-cp311-win32.whl", hash = "sha256:c19b9357309b8cc6de8a48fca8e44a8c9c2feaaa2f5896d037fa505d48fcab80", size = 187844, upload-time = "2026-09-12T15:11:45.874Z" }, + { url = "https://files.pythonhosted.org/packages/3e/8c/59693f348488f01ed12d862e99ab8da14961152d3e9c39b9b1ef363f3572/jiter-0.17.0-cp311-cp311-win_amd64.whl", hash = "sha256:e654b6b04e39c9cb19cb8b04c6ddf1f2db07751fa14156413969fd78bad0e5cb", size = 231402, upload-time = "2026-09-12T15:11:47.083Z" }, + { url = "https://files.pythonhosted.org/packages/fe/89/fb35e286463cb9f01edc2c4e47df6e5477ee36bca5096414e9ea87985588/jiter-0.17.0-cp311-cp311-win_arm64.whl", hash = "sha256:3ad556afc289f15d2b181b941982d01f06190863c07440185b9f354e1bd2def3", size = 187006, upload-time = "2026-09-12T15:11:48.245Z" }, + { url = "https://files.pythonhosted.org/packages/aa/f8/07bd8c3a23f7a8a6875e6a820bbffe1483a18f18f9398a91b5495123176e/jiter-0.17.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:ebf918dfd6a74adc1b9ad71f63c4ab00902fcd3b7fd39f2e24d871db8d713b91", size = 291633, upload-time = "2026-09-12T15:11:49.431Z" }, + { url = "https://files.pythonhosted.org/packages/0e/5e/0de4c6f84ffefa6809ffc2d550b9a314365acf7e7ec9b6c7375d49047900/jiter-0.17.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:61aed66ee042b3b49ef85fdf75714234d055d89d8496ac1c6e47f89e7a30d5e4", size = 321695, upload-time = "2026-09-12T15:11:52.727Z" }, + { url = "https://files.pythonhosted.org/packages/20/ac/befe2e82065bee37a0252081666ed2f48c1ac5f5c6c318c2de8168ba393d/jiter-0.17.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:76eb4a5c20e86f9f848286f167024890f2862258a965d254774deb7fc1545ca1", size = 341967, upload-time = "2026-09-12T15:11:54.231Z" }, + { url = "https://files.pythonhosted.org/packages/9f/cd/9797c1e529746750ae589da7c1a8c24373f00d88e11a989f9e5eb1959079/jiter-0.17.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:bcc064f99183a9cbe7f26ed648c352031a74145cd61ed75d34632c73eb46a5a8", size = 326546, upload-time = "2026-09-12T15:11:55.41Z" }, + { url = "https://files.pythonhosted.org/packages/d9/fd/e6914c38d6347bab4ebff2b1f0c0f191db276e7a1d5c376176757da42fe3/jiter-0.17.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:73b64e69c4150748e020356d958af94bec33c70a0a93d665cfa8f6d580fe1a63", size = 340995, upload-time = "2026-09-12T15:11:58.211Z" }, + { url = "https://files.pythonhosted.org/packages/9d/7d/611b3abf6f88945b5474da5cdc6d1a185e805ac9bf446bb7766dcda6ea87/jiter-0.17.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:f0bc7f684b65bcda9c20434267577db71bf9905ceddd32b60d1d93278d8c8d3a", size = 352188, upload-time = "2026-09-12T15:11:59.414Z" }, + { url = "https://files.pythonhosted.org/packages/52/f8/b6e513ecbdf3b3cebe587c2279281ecf775b729a58cf4cc7bdf898ded029/jiter-0.17.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c21265b251d99bbb40080d178a8953e35601d3a1564e05c4de4c0d2ca616797", size = 345025, upload-time = "2026-09-12T15:12:00.697Z" }, + { url = "https://files.pythonhosted.org/packages/28/a8/fe26d06c5a6c5a4cfe703c5154c8a140da1305671eb3681aba9422d4f393/jiter-0.17.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:f3d7f7b34114f7ddc6d72a8e882d49de636b35d9fd12b4d420d3c5729f6c9812", size = 329180, upload-time = "2026-09-12T15:12:01.831Z" }, + { url = "https://files.pythonhosted.org/packages/e1/58/e6d66a26af40a20e62486feb7e222fd50f6e7aaa4f107abd89675dcc835b/jiter-0.17.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:5078ab00664307fab2019b522a93aeb191122789f085daf5fd9e362154021d4a", size = 335805, upload-time = "2026-09-12T15:12:03.056Z" }, + { url = "https://files.pythonhosted.org/packages/ef/3e/96520aa2fef5ef831d95483a902140bfab83dcac9eaa74f7df61b5e50a1b/jiter-0.17.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:470e1b1e4c42f1ead2189166a299691871a2df5056c976e7fb96feafaf5f9d44", size = 484121, upload-time = "2026-09-12T15:12:04.414Z" }, + { url = "https://files.pythonhosted.org/packages/6a/8f/5d9d92fe538bf36ff481a2278c48147e59c1cf8eb2f7be665260665febe5/jiter-0.17.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:6eb6aedeb7352b8f3b6af9cbd67983840165c00428e63f1b420a85885128ea31", size = 521310, upload-time = "2026-09-12T15:12:05.612Z" }, + { url = "https://files.pythonhosted.org/packages/50/06/a09f979b22e652afbc3de66c709b2ba92edcef555f7535ab937c86b4f21a/jiter-0.17.0-cp312-cp312-win32.whl", hash = "sha256:362bb47423886d45a9f705d2d9d4008c6eedd4e41eb1bab4e96fb6daa06b33fd", size = 185029, upload-time = "2026-09-12T15:12:06.994Z" }, + { url = "https://files.pythonhosted.org/packages/6c/d9/98265a005b2473ec2be5a84e2b64c2f65382c673879f1574845cd4bcd77c/jiter-0.17.0-cp312-cp312-win_amd64.whl", hash = "sha256:9bd3caac219df476dd0cc3fe01d2f1581ed588906feac767abd9614c1c12f8b3", size = 227381, upload-time = "2026-09-12T15:12:08.823Z" }, + { url = "https://files.pythonhosted.org/packages/a8/11/2e05bf5a56e57a543ebb8f585074adf09383e99d7b062dac92eab1f4d57f/jiter-0.17.0-cp312-cp312-win_arm64.whl", hash = "sha256:36ee6e69027396664e59995b9a635a947a5304ee9837279584a0bb8145c8f6b8", size = 183610, upload-time = "2026-09-12T15:12:10.374Z" }, + { url = "https://files.pythonhosted.org/packages/b9/3b/05a917204413e2e09906dfa35240c1021227aeb56c7305abea9562c598b4/jiter-0.17.0-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:eaba834b72d573547b9d966465b3394b749d5e14208cc70acb63aca37619ab33", size = 288143, upload-time = "2026-09-12T15:14:02.998Z" }, + { url = "https://files.pythonhosted.org/packages/d9/e1/a1cd3c0cf8f79945939e4f8caae9990529f67d7f77f671769f73956329b9/jiter-0.17.0-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:51e1519d676a9f14dad9c2a411170d43b022ddb7989562df4e849b261ce127b2", size = 281847, upload-time = "2026-09-12T15:14:04.414Z" }, + { url = "https://files.pythonhosted.org/packages/72/b4/9b797679e09f4a46c32986aeb3670bd9bc562fc0b373c7a0ee5c5dce1206/jiter-0.17.0-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d0ce4feb52493e3513335b2accdcd75605652e4632772d3c8c2f7b86954d7f39", size = 304797, upload-time = "2026-09-12T15:14:05.733Z" }, + { url = "https://files.pythonhosted.org/packages/25/4a/0d77415b27a00d970e4e710f7c1de62e96a11c4cab3ed1add0015af04626/jiter-0.17.0-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:29f49b325e0234e4ad9ecca5b861ffbd09b95ccac9bd46fa55841b6e56eea5fe", size = 307815, upload-time = "2026-09-12T15:14:07.105Z" }, + { url = "https://files.pythonhosted.org/packages/17/31/4bb27f54333d3b9ef1e5bd3312dc0b4bbe59c68bb0885fdb40583a6b1567/jiter-0.17.0-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:454c4997d73cc466c71fd565d91e603b0274e48ea0c6b0b7a7aee6967e4ceb7c", size = 288415, upload-time = "2026-09-12T15:14:08.455Z" }, + { url = "https://files.pythonhosted.org/packages/28/30/879570ecf82574eaea77c5eb10309f4b630dece5f2a556e9814a90ba3f2d/jiter-0.17.0-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:40d2c240f8f80b5b0f201b29f0ae129c81448c60c772227a41747b5e0026f6a2", size = 279113, upload-time = "2026-09-12T15:14:10.117Z" }, + { url = "https://files.pythonhosted.org/packages/77/7a/1f0b8a35fbd079a4f1752c31a15dc99cf277f863747c459be0af39e900e5/jiter-0.17.0-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e05f5adbf68c4bd11e1610f394034d984152988e84be6f8314235ce6f2139e5", size = 303708, upload-time = "2026-09-12T15:14:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/e1/8b/d76219ebdbcf3d4209d9d21a0810db4c8d0a6f88e3ee87d30bdea4e90d30/jiter-0.17.0-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d2c0bf24c72fd0491405dce5d40194f2070e9021ce648c1a1d46234b93d848ff", size = 307147, upload-time = "2026-09-12T15:14:12.897Z" }, +] + +[[package]] +name = "joserfc" +version = "1.7.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/19/94/80fea1514b7c6d7d37804d3fe9ca81455f633347fc98731bd71ffe1faa17/joserfc-1.7.5.tar.gz", hash = "sha256:d5ff536e658e17664f8c1b1ab60dc4aa62aa973fcef1edd33cc44bda45d6f5ea", size = 234990, upload-time = "2026-08-29T13:05:42.057Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/67/c5/82addfd375e5ee6520644e0553e4aadde92d668c4fc99cc716d337fe7bb3/joserfc-1.7.5-py3-none-any.whl", hash = "sha256:add2c2c84e8373b084d526a8b53daba5d7a513a118cd2dcd9fc9f979d0922159", size = 71269, upload-time = "2026-08-29T13:05:40.718Z" }, +] + +[[package]] +name = "jsonref" +version = "1.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/0d/c1f3277e90ccdb50d33ed5ba1ec5b3f0a242ed8c1b1a85d3afeb68464dca/jsonref-1.1.0.tar.gz", hash = "sha256:32fe8e1d85af0fdefbebce950af85590b22b60f9e95443176adbde4e1ecea552", size = 8814, upload-time = "2023-01-16T16:10:04.455Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/ec/e1db9922bceb168197a558a2b8c03a7963f1afe93517ddd3cf99f202f996/jsonref-1.1.0-py3-none-any.whl", hash = "sha256:590dc7773df6c21cbf948b5dac07a72a251db28b0238ceecce0a2abfa8ec30a9", size = 9425, upload-time = "2023-01-16T16:10:02.255Z" }, +] + +[[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-path" +version = "0.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "pathable" }, + { name = "pyyaml" }, + { name = "referencing" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/39/79/cd02a4df6d9270efdc7d3feefe6edd730b0820c39eeaa107a2faee8322d5/jsonschema_path-0.5.0.tar.gz", hash = "sha256:493b156ba895c97602655b620a8456caa2ce08c1aa389f5a7addec065e6e855c", size = 19597, upload-time = "2026-05-19T20:45:00.971Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/04/2c/9e69d73c4297508be9e3b64a970ea3971b3eb8db64ffc5802d40bd25981f/jsonschema_path-0.5.0-py3-none-any.whl", hash = "sha256:2790a070bc7abb08ea3dbe4d340ece4efadf639223001f020c7503229ba068e2", size = 24077, upload-time = "2026-05-19T20:44:59.225Z" }, +] + +[[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 = "keyring" +version = "25.7.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "importlib-metadata", marker = "python_full_version < '3.12'" }, + { name = "jaraco-classes" }, + { name = "jaraco-context" }, + { name = "jaraco-functools" }, + { name = "jeepney", marker = "sys_platform == 'linux'" }, + { name = "pywin32-ctypes", marker = "sys_platform == 'win32'" }, + { name = "secretstorage", marker = "sys_platform == 'linux'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/4b/674af6ef2f97d56f0ab5153bf0bfa28ccb6c3ed4d1babf4305449668807b/keyring-25.7.0.tar.gz", hash = "sha256:fe01bd85eb3f8fb3dd0405defdeac9a5b4f6f0439edbb3149577f244a2e8245b", size = 63516, upload-time = "2025-11-16T16:26:09.482Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/81/db/e655086b7f3a705df045bf0933bdd9c2f79bb3c97bfef1384598bb79a217/keyring-25.7.0-py3-none-any.whl", hash = "sha256:be4a0b195f149690c166e850609a477c532ddbfbaed96a404d4e43f8d5e2689f", size = 39160, upload-time = "2025-11-16T16:26:08.402Z" }, +] + +[[package]] +name = "keysymdef" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/42/d3/c3db0b92a0ff39c3e08f168cd382c24bf021d4a96fc89b47a3e55294f883/keysymdef-1.2.0-py2.py3-none-any.whl", hash = "sha256:19a5c2263a861f3ff884a1f58e2b4f7efa319ffc9d11f9ba8e20129babc31a9e", size = 20146, upload-time = "2023-02-25T00:22:36.318Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "mcp" +version = "1.30.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx" }, + { name = "httpx-sse" }, + { name = "jsonschema" }, + { name = "pydantic" }, + { name = "pydantic-settings" }, + { 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/ba/93/0142dc84a666daf8ad51a34268f34c12fd6fda4f3810c4be2504eecc8212/mcp-1.30.0.tar.gz", hash = "sha256:445414625fce5c295faa505bb11bacece661ab6f4028d57c935db57820b7a3e4", size = 680511, upload-time = "2026-09-07T14:34:15.845Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f5/f4/e58bc33317c92a0203664daaf00bf6f41166cc0149e5d6870a03f7cd004a/mcp-1.30.0-py3-none-any.whl", hash = "sha256:666edb5009503e1047c9d60346a756f94b261f05cc2625f23d41c728ffc484d0", size = 234581, upload-time = "2026-09-07T14:34:14.266Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "more-itertools" +version = "11.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/de/1d/f4da6f02cdffe04d6362210b807146a26044c88d839208aec273bb0d9184/more_itertools-11.1.0.tar.gz", hash = "sha256:48e8f4d9e7e5878571ecf6f2b4e57634f93cd474cc8cfbd2376f2d11b396e30d", size = 145772, upload-time = "2026-05-22T14:14:29.909Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e8/3d/1087453384dbde46a8c7f9356eead2c58be8a7bf156bca40243377c85715/more_itertools-11.1.0-py3-none-any.whl", hash = "sha256:4b65538ae22f6fed0ce4874efd317463a7489796a0939fa66824dd542125a192", size = 72226, upload-time = "2026-05-22T14:14:28.824Z" }, +] + +[[package]] +name = "nodeenv" +version = "1.10.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/24/bf/d1bda4f6168e0b2e9e5958945e01910052158313224ada5ce1fb2e1113b8/nodeenv-1.10.0.tar.gz", hash = "sha256:996c191ad80897d076bdfba80a41994c2b47c68e224c542b48feba42ba00f8bb", size = 55611, upload-time = "2025-12-20T14:08:54.006Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/88/b2/d0896bdcdc8d28a7fc5717c305f1a861c26e18c05047949fb371034d98bd/nodeenv-1.10.0-py2.py3-none-any.whl", hash = "sha256:5bb13e3eed2923615535339b3c620e76779af4cb4c6a90deccc9e36b274d3827", size = 23438, upload-time = "2025-12-20T14:08:52.782Z" }, +] + +[[package]] +name = "numpy" +version = "2.4.6" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version < '3.12'", +] +sdist = { url = "https://files.pythonhosted.org/packages/d0/ad/fed0499ce6a338d2a03ebae59cd15093910c8875328855781952abf6c2fe/numpy-2.4.6.tar.gz", hash = "sha256:f3a3570c4a2a16746ac2c31a7c7c7b0c186b95ce902e33db6f28094ed7387dda", size = 20735807, upload-time = "2026-05-18T23:37:14.07Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/49/ec46835a70be8fa6446c495126ac84fdb28cb2558e1620ffb87a10c8b64c/numpy-2.4.6-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:0280e0356c0829a18d9de1cb7eee50ec22ca639878d7240307ca0943d73cd2c4", size = 16969194, upload-time = "2026-05-18T23:33:13.503Z" }, + { url = "https://files.pythonhosted.org/packages/0e/0d/f5957185c0ee2f3e12f78715aa9e3b353fd83633316c8532b38faa37e3f6/numpy-2.4.6-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:110f8b71aacb688ec69062bb7f6938a0f8acb01b7c1c4beb453c65b6d234584d", size = 14964111, upload-time = "2026-05-18T23:33:17.795Z" }, + { url = "https://files.pythonhosted.org/packages/ad/40/40a40ee0ddf7ceb782c49af278894b686e586d65d8c1889c8b5da01a3d7d/numpy-2.4.6-cp311-cp311-macosx_14_0_arm64.whl", hash = "sha256:4cfe66903cc32a9921a6733d96b19bb6abf310397581bbad89c228f5abaf0ee8", size = 5469159, upload-time = "2026-05-18T23:33:20.654Z" }, + { url = "https://files.pythonhosted.org/packages/63/13/f9a8046535cb21deae82f8d03de9617e08882d274fad2539630761888228/numpy-2.4.6-cp311-cp311-macosx_14_0_x86_64.whl", hash = "sha256:8155154c7c691289fe18f510b5d4657c68c67989f293f0535a91360392ff6538", size = 6798936, upload-time = "2026-05-18T23:33:22.987Z" }, + { url = "https://files.pythonhosted.org/packages/33/a8/6fa8c1a345a8c85dbb21932c447bee07c30a2c2a3f31e369c0a84b300147/numpy-2.4.6-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:0ab0a9c4ffb1a6d95ef519fe4247dba8eb6b18ad93999f76b7f657039acabd47", size = 15966692, upload-time = "2026-05-18T23:33:26.62Z" }, + { url = "https://files.pythonhosted.org/packages/02/03/74fe2a4cb3817d94d86402f2506554130a2f01414e299b5a843e5a8a957f/numpy-2.4.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:89cd468399cfd2504718f0ba50e410dca55a170b61a02ad92bb18c8a65186e93", size = 16918164, upload-time = "2026-05-18T23:33:29.955Z" }, + { url = "https://files.pythonhosted.org/packages/c5/80/3615be3313f7e7696609bc194b9f0101da809df79e859bdb84e0cd043f46/numpy-2.4.6-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:c2d37ab77531417474168eb79d6d80b14f821a966818505d03013d0833edb7a8", size = 17322877, upload-time = "2026-05-18T23:33:34.724Z" }, + { url = "https://files.pythonhosted.org/packages/ca/ac/a691e0fe2675e370d0e08ff905adc49a1c8830e8cae03efe4477e92cd55d/numpy-2.4.6-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:f407cb6b8e9d6d8c626bc73c945db1706035af8fd632295547bf1c9e46d092d6", size = 18651487, upload-time = "2026-05-18T23:33:38.217Z" }, + { url = "https://files.pythonhosted.org/packages/15/a7/9bc1cd626d7bf6869bfedf27b91b6ab5dd607758bf8e959d6fa80c6a59cb/numpy-2.4.6-cp311-cp311-win32.whl", hash = "sha256:ddea102b48f9e339f3948bf22040944184627a30fdf7f858667673b9c5f033c8", size = 6233945, upload-time = "2026-05-18T23:33:41.331Z" }, + { url = "https://files.pythonhosted.org/packages/c5/31/7fc6239c12bce7e931463251cca4426c465e1876ba3cc785402ef4dd8f4e/numpy-2.4.6-cp311-cp311-win_amd64.whl", hash = "sha256:1e254a00cdf42b1e4d5b3d68d33af63268d41340d8885df2ab6470f2e1500147", size = 12608406, upload-time = "2026-05-18T23:33:44.131Z" }, + { url = "https://files.pythonhosted.org/packages/27/83/140f85a466595a16382996a1bf06b2b54bcd597488921b0c9daaeeda72af/numpy-2.4.6-cp311-cp311-win_arm64.whl", hash = "sha256:ed9749eef4cbd126da3dc1d6bcb3a57f5eb7ac6a6484146bdbf743f552dfc577", size = 10479528, upload-time = "2026-05-18T23:33:50.725Z" }, + { url = "https://files.pythonhosted.org/packages/95/2a/3d7b5ac8aac24feaf9ad7ed58f45b0bbc06d37e4338ae84c9f2298b570f9/numpy-2.4.6-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:001fbb8e08d942dd57599e781f2472269ee7f2755fae407b4f67b2f0b17da3f1", size = 16689119, upload-time = "2026-05-18T23:33:54.065Z" }, + { url = "https://files.pythonhosted.org/packages/ea/12/92c4c131527599e8288d6918e888d88726f84d805d784b771f32408aeaef/numpy-2.4.6-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ebfb099f8dcf083deef3ac1ca4c1503f387cf76296fcb3816b66f5ecb5f54fdb", size = 14699246, upload-time = "2026-05-18T23:33:57.621Z" }, + { url = "https://files.pythonhosted.org/packages/ad/fe/c0a6b7b2ca128a8fb228575147073b660656734b8ebe4d76c8fd748dcc79/numpy-2.4.6-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:3213d622a0283a39a93d188f3cf72b26862df52fbb4ca3697f51705016523d41", size = 5204410, upload-time = "2026-05-18T23:34:00.302Z" }, + { url = "https://files.pythonhosted.org/packages/f3/d4/9770d14ba719432bb90a421bfd443872ed0f70f7264b64bec12ea363d5fd/numpy-2.4.6-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:357cc07a6d7b0b182ff02249616a03742827ebb1277546b5c7cd7f7620a45698", size = 6551240, upload-time = "2026-05-18T23:34:02.852Z" }, + { url = "https://files.pythonhosted.org/packages/c9/c6/50a46a6205feba2343f1d6d17438107c5dc491ed1c736e6ea68689fd906b/numpy-2.4.6-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5f9fb9157b4ce2971008323afe46053787b526ef624fea915b261468a8421a0f", size = 15671012, upload-time = "2026-05-18T23:34:05.485Z" }, + { url = "https://files.pythonhosted.org/packages/99/60/14115e6364fa676c5397c2ad3004e527e9aa487abf5d0706ec81bbd08529/numpy-2.4.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:90f9849678c75fe7afa2d348ac842c168b0a4d3d61919687216dfc547976d853", size = 16645538, upload-time = "2026-05-18T23:34:09.265Z" }, + { url = "https://files.pythonhosted.org/packages/ae/c5/693cbe59e57db94d2231fa519ca3978dc9e19da5a8f088588f5c6e947ff2/numpy-2.4.6-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:c1a2af6c6ef86344a6b0db6b97834208bf598db514f2b155042439b62605601a", size = 17020706, upload-time = "2026-05-18T23:34:13.053Z" }, + { url = "https://files.pythonhosted.org/packages/ef/fc/85b7c4eff9b4966ade25c2273cf7e7012e92366c032058653934b37de044/numpy-2.4.6-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:e5805d5a22fd19c8ccff10a9561f9df94436b0545619ea579db2d3c35294bce2", size = 18368541, upload-time = "2026-05-18T23:34:17.024Z" }, + { url = "https://files.pythonhosted.org/packages/f6/81/e1b27545deedce7f4a0b348618c6b62d74e36a4dc9ccd42f3eb2f85eee32/numpy-2.4.6-cp312-cp312-win32.whl", hash = "sha256:e3eeb0aabd6bd5ce64faae67e9935203a6991b4bc2a485a767fbafb2c5125f45", size = 5962825, upload-time = "2026-05-18T23:34:20.3Z" }, + { url = "https://files.pythonhosted.org/packages/ab/ca/feab00bd44aa5fe1ad2c18f08b4d3bb92e26484b0b1d1443897809ed528c/numpy-2.4.6-cp312-cp312-win_amd64.whl", hash = "sha256:d8e8286dd7cea7895157318d1b91cdacac64c479f3cbc8dce548331728484751", size = 12321687, upload-time = "2026-05-18T23:34:23.095Z" }, + { url = "https://files.pythonhosted.org/packages/63/cf/5a6d34850a39d1093558564f77ee8e8e0bee5061151b8f05a55711001ec7/numpy-2.4.6-cp312-cp312-win_arm64.whl", hash = "sha256:4081eb135ac24158bd51cdfbef16f1c64df7063b1143f24731387137c092bec8", size = 10221482, upload-time = "2026-05-18T23:34:25.876Z" }, + { url = "https://files.pythonhosted.org/packages/de/12/b422cc84439adc0d00de605bf4a308890ae5c26f2c71fbd73e5d08fbb0dd/numpy-2.4.6-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:55cced7c52e981362f708ad635198e97a752dfba412cc03c23bbf3bd8d5cd662", size = 16847511, upload-time = "2026-05-18T23:36:50.673Z" }, + { url = "https://files.pythonhosted.org/packages/44/53/f481bef68011740f8849418d82db07230e825013f31f4eef5ba5b805316a/numpy-2.4.6-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:d6da64deb6b8ed903e7560180a92f2d804ee1ba5eeb849ac2748b8c1aba1f6d7", size = 14889064, upload-time = "2026-05-18T23:36:53.879Z" }, + { url = "https://files.pythonhosted.org/packages/7f/57/42ed575c10ced8af951d426bc4e1f8aff16fd851db33f067036215a7f860/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_arm64.whl", hash = "sha256:68a5124b13fa6cc2086764a20005d30bc0548146f7f5322f02fce212ca14317f", size = 5394157, upload-time = "2026-05-18T23:36:57.194Z" }, + { url = "https://files.pythonhosted.org/packages/6a/ef/f66cc724fcc36c1e364c67f51ae9146090b8b584f27d58b97fdae3edd737/numpy-2.4.6-pp311-pypy311_pp73-macosx_14_0_x86_64.whl", hash = "sha256:948424b06129ce883307e8cff868c31396d8dc7630a59c61d70d98dbe70f222c", size = 6708728, upload-time = "2026-05-18T23:36:59.575Z" }, + { url = "https://files.pythonhosted.org/packages/1a/9c/c531f2293b91265d8b48e9b329f54fdd7ffae73cb4134ea10cca4237e9cc/numpy-2.4.6-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:5dbbdb29840ca3d91ee0fece42fc29278886d908280bfec0a5846c6f901a3eb0", size = 15798374, upload-time = "2026-05-18T23:37:02.674Z" }, + { url = "https://files.pythonhosted.org/packages/1a/b0/413077f6b1153ed3cba361401c6783bbad6114804a000cc22eb71c13e190/numpy-2.4.6-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8ad03c0965fb3c692200e74d458ca28c1dbb4ce96f9a479a8aa041ad5fabca02", size = 16747286, upload-time = "2026-05-18T23:37:06.327Z" }, + { url = "https://files.pythonhosted.org/packages/15/ce/e5ec180bc41812edcd8daeb8639d205622c0e8c02259d8ab25a0201b3c2a/numpy-2.4.6-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:2803abfebfc990042cd494d8ce2d5f82e9d847af6d35ec486923aa19dbad5e73", size = 12504263, upload-time = "2026-05-18T23:37:09.715Z" }, +] + +[[package]] +name = "numpy" +version = "2.5.3" +source = { registry = "https://pypi.org/simple" } +resolution-markers = [ + "python_full_version >= '3.12' and sys_platform == 'emscripten'", + "python_full_version >= '3.12' and sys_platform != 'emscripten'", +] +sdist = { url = "https://files.pythonhosted.org/packages/13/01/11703282db468b85f6f7b8c7f22d058de5970d5c7e60a3a8aaa313c3de36/numpy-2.5.3.tar.gz", hash = "sha256:df2d5874ff183595a4ba404edd04f6bd9b5505c1d7708573f6a6c17489a67563", size = 20791231, upload-time = "2026-09-06T16:27:47.073Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/d6/50/8fdbb16af64895706a45f06a4068e29db732ec180f3c1375f14123359138/numpy-2.5.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:cb189f09db39283b26bfd061ec16189e14f71c6755207f72a0f7540867afe5b9", size = 16994982, upload-time = "2026-09-06T16:24:29.244Z" }, + { url = "https://files.pythonhosted.org/packages/60/39/789131c1188c078dcb3a1692e72e1e050c68b88ffe72c9ccaac9bcd7a9cd/numpy-2.5.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:f59a878c33d6b88122d80d239bb3b845d58708750b0cb06a09aebb9b18ec696c", size = 12009327, upload-time = "2026-09-06T16:24:32.491Z" }, + { url = "https://files.pythonhosted.org/packages/9c/59/a312e95696e5f601914dd8b6dd844692ba61670807417e24b68e337b5c70/numpy-2.5.3-cp312-cp312-macosx_14_0_arm64.whl", hash = "sha256:a72f874bc9e10e4b8f80426fb49716d5141f64442a0c8418065093ec8017fbb0", size = 5445405, upload-time = "2026-09-06T16:24:35.071Z" }, + { url = "https://files.pythonhosted.org/packages/30/d0/5623a1707ed4fe16e3909fe3cf5ee3da004ae677ad23d83bbf3adf1a6faf/numpy-2.5.3-cp312-cp312-macosx_14_0_x86_64.whl", hash = "sha256:fc36dc566135b5eceec4cf89758fcb719266a019ef07dae1754ae7c9f617ef3e", size = 6783213, upload-time = "2026-09-06T16:24:37.253Z" }, + { url = "https://files.pythonhosted.org/packages/f1/32/84146fc020ad3c25f805f70ab60da46fe3c540a21369754a7e4369754b6f/numpy-2.5.3-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:76c2c1e6bfa5c84adc6434dfbf013aa92096a7985221762c8f11fedfd20fff58", size = 15687872, upload-time = "2026-09-06T16:24:39.751Z" }, + { url = "https://files.pythonhosted.org/packages/65/af/aa78d1a88805456e212b65461354cd943197fb9acecc4c90fd12295123a3/numpy-2.5.3-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b7e18c623bb5c95acb3b3328861272816ba199fb531921c5d6d0b675f1fde9e3", size = 16717410, upload-time = "2026-09-06T16:24:42.745Z" }, + { url = "https://files.pythonhosted.org/packages/3b/24/faa79d865e69a97ba17473b23a1b74094b2259c03e820c70297293b9ea49/numpy-2.5.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:4f8929ee6c96bfbd7b4ed2032e0c03af86fe1826740ab61ddabf9072d06e57ff", size = 17040975, upload-time = "2026-09-06T16:24:45.961Z" }, + { url = "https://files.pythonhosted.org/packages/62/4a/8877e629445a7176297dffcaf9c485faa96a95d81728a62521ad55bd4c0f/numpy-2.5.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b5d93cf48f687479941d12b69c873ad2cc76bbd487f0091c2200636497f34034", size = 18476479, upload-time = "2026-09-06T16:24:49.35Z" }, + { url = "https://files.pythonhosted.org/packages/c8/db/35e1c2d38b04cbd5b731f9d71495e055e813197669d22b612f11748d2ff9/numpy-2.5.3-cp312-cp312-win32.whl", hash = "sha256:bf63afbe037eb5d2fe87fbcc7778e61da53ebaf21d938a4515aa73b62532a5d4", size = 6133378, upload-time = "2026-09-06T16:24:51.915Z" }, + { url = "https://files.pythonhosted.org/packages/3c/a1/accf6d4f0c80c5d9ba9735d6b1550e444180599f34dec69ca01360f717ad/numpy-2.5.3-cp312-cp312-win_amd64.whl", hash = "sha256:0a59a421a32580a009e8a1751345bf829631b990dc1794b80514ab722b435def", size = 12567828, upload-time = "2026-09-06T16:24:54.255Z" }, + { url = "https://files.pythonhosted.org/packages/22/43/1764aff32e4652526ae2f71fa8b3efd8d25c8a3d6926914454e47138ed1e/numpy-2.5.3-cp312-cp312-win_arm64.whl", hash = "sha256:ccb32e0525d29e8b0572eb84c9a57af0e7a4e615726927506f55063c62414034", size = 10485432, upload-time = "2026-09-06T16:24:57.278Z" }, +] + +[[package]] +name = "openai" +version = "3.14.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "httpx2" }, + { name = "jiter" }, + { name = "pydantic" }, + { name = "sniffio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a2/a5/bc3681f645a0d026332047cc19a703315979740a11a5763f46c163abd614/openai-3.14.1.tar.gz", hash = "sha256:2f3423a71af767d9071b059cf6df1e97a721c3a8d19417375ad7993d4df0d346", size = 1634770, upload-time = "2026-09-15T23:13:35.708Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f7/13/d1caa2b2385ed22a1e10e1fd7fc09a92e282cffadad49c569827315f468a/openai-3.14.1-py3-none-any.whl", hash = "sha256:a6758739282f3b1cafe8df1204f7a2f7b1e9edbbcfa41c0efba687448fbc51cf", size = 2003545, upload-time = "2026-09-15T23:13:33.164Z" }, +] + +[[package]] +name = "openapi-pydantic" +version = "0.5.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/02/2e/58d83848dd1a79cb92ed8e63f6ba901ca282c5f09d04af9423ec26c56fd7/openapi_pydantic-0.5.1.tar.gz", hash = "sha256:ff6835af6bde7a459fb93eb93bb92b8749b754fc6e51b2f1590a19dc3005ee0d", size = 60892, upload-time = "2025-01-08T19:29:27.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/12/cf/03675d8bd8ecbf4445504d8071adab19f5f993676795708e36402ab38263/openapi_pydantic-0.5.1-py3-none-any.whl", hash = "sha256:a3a09ef4586f5bd760a8df7f43028b60cafb6d9f61de2acba9574766255ab146", size = 96381, upload-time = "2025-01-08T19:29:25.275Z" }, +] + +[[package]] +name = "opentelemetry-api" +version = "1.44.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/ee/8b/aa9e2d8b8dfa7c946f7dec5d1f8f6ba8eca062f43509a06bdb5ce93d26c0/opentelemetry_api-1.44.0.tar.gz", hash = "sha256:67647e5e9566edcf421166fdf022b3537f818635daa852b289e34604dc6fb33a", size = 72406, upload-time = "2026-07-16T15:25:32.678Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ca/6f/a04e900f465ff3221ccc395522503e2d10e79fa21f2723c8e177aae1e0d1/opentelemetry_api-1.44.0-py3-none-any.whl", hash = "sha256:94b98c893a91b88657eaac1e3ba89618cdb85be6918196705354f34728b2cdef", size = 60018, upload-time = "2026-07-16T15:25:11.657Z" }, +] + +[[package]] +name = "packaging" +version = "26.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz", hash = "sha256:94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79", size = 313412, upload-time = "2026-08-04T18:15:28.737Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/63/34/ba1c580383c9eada3711951fef0795c80b829a078d72188184bcab9dd527/packaging-26.3-py3-none-any.whl", hash = "sha256:d7193f7c8e4e93f444fde0262bf90af30e16fa0ad0ad44cb553c87339b23cd1c", size = 129956, upload-time = "2026-08-04T18:15:27.159Z" }, +] + +[[package]] +name = "pathable" +version = "0.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/66/f3/5a20387de9bcd0607871bfc2198ee0e15836da7baa4592ccd7f24c27c986/pathable-0.6.0.tar.gz", hash = "sha256:6404b8b82aef5ff0fd478934137128b99b12212ba35afdde5525ca4f8388ea58", size = 18970, upload-time = "2026-05-19T18:15:11.911Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/e8/6d75ffd9784bce2e93d1ae4415649427e39a53bb172d4672b2b59c6f0a7b/pathable-0.6.0-py3-none-any.whl", hash = "sha256:82c4ca6c98c502ad12e0d4e9779b6210afee93c38990988c8c5d1b49bdcdf566", size = 18983, upload-time = "2026-05-19T18:15:10.728Z" }, +] + +[[package]] +name = "pillow" +version = "12.3.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1c/3d/bb7fca845737cf9d7dbde16ed1843984665ff2e0a518f5db43e77ec540b9/pillow-12.3.0.tar.gz", hash = "sha256:3b8182a766685eaa002637e28b4ec8d6b18819a0c71f579bf0dbaa5830297cce", size = 47025035, upload-time = "2026-07-01T11:56:38.965Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/c8/0a78b0e02d7ac54bc03e5321c9220da52f0c2ea83b21f7c40e7f3169c502/pillow-12.3.0-cp311-cp311-macosx_10_10_x86_64.whl", hash = "sha256:00808c5e14ef63ac5161091d242999076604ff74b883423a11e5d7bbb38bf756", size = 5392415, upload-time = "2026-07-01T11:53:47.162Z" }, + { url = "https://files.pythonhosted.org/packages/b2/5b/a02d30018abd97ced9f5a6c63d28597694a00d066516b9c1c6de45859fc9/pillow-12.3.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:37d6d0a00072fd2948eb22bce7e1475f34569d90c87c59f7a2ec59541b77f7a6", size = 4785266, upload-time = "2026-07-01T11:53:49.079Z" }, + { url = "https://files.pythonhosted.org/packages/c8/98/766667a4be768150a202836acd9fad19c06824ca86c4286d3cf6b274964e/pillow-12.3.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:bcb46e2f9feff8d06323983bd83ed00c201fdcab3d74973e7072a889b3979fcd", size = 6263814, upload-time = "2026-07-01T11:53:51.32Z" }, + { url = "https://files.pythonhosted.org/packages/3b/2d/ede717bc1144f63886c21fd349bb95860b0d1a21149ff16f2bb362b612b6/pillow-12.3.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:23d27a3e0307ec2244cc51e7287b919aa68d097504ebe19df4e76a98a3eea5bd", size = 6934408, upload-time = "2026-07-01T11:53:53.487Z" }, + { url = "https://files.pythonhosted.org/packages/a3/48/9c58b685e69d49c31af6c8eb9012055fab7e665785165c84796e2c73ce72/pillow-12.3.0-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4f883547d4b7f0495ebe7056b0cc2aea76094e7a4abc8e933540f3271df27d9c", size = 6337160, upload-time = "2026-07-01T11:53:55.457Z" }, + { url = "https://files.pythonhosted.org/packages/ff/fa/dc2a5c0ba6df93f67c31d34b808b7ce440b40cdbf96f0b81cde1d1e6fa93/pillow-12.3.0-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:236ff70b9312fb68943c703aa842ca6a758abfa45ac187a5e7c1452e96ef72b5", size = 7045172, upload-time = "2026-07-01T11:53:57.736Z" }, + { url = "https://files.pythonhosted.org/packages/86/a5/444817a4d4c4c2417df00513086ca196f388d8f9ef40c2e4ccd1ad1af54b/pillow-12.3.0-cp311-cp311-win32.whl", hash = "sha256:10e41f0fbf1eec8cfd234b8fe17a4caac7c9d0db4c204d3c173a8f9f6ef3232b", size = 6472232, upload-time = "2026-07-01T11:53:59.767Z" }, + { url = "https://files.pythonhosted.org/packages/63/c6/4bad1b18d132a50b27e1365e1ab163616f7a5bb56d330f66f9d1d9d4f9d4/pillow-12.3.0-cp311-cp311-win_amd64.whl", hash = "sha256:8e95e1385e4998ae9694eeaa4730ba5457ff61185b3a55e2e7bea0880aef452a", size = 7233653, upload-time = "2026-07-01T11:54:02.066Z" }, + { url = "https://files.pythonhosted.org/packages/fd/16/00f91ab7760dc842f5aad55217e80fc4a7067a0604535249bc8a2d6d9870/pillow-12.3.0-cp311-cp311-win_arm64.whl", hash = "sha256:ebaea975e03d3141d9d3a507df75c9b3ec90fa9d2ffd07567b3a978d9d790b26", size = 2568195, upload-time = "2026-07-01T11:54:04.622Z" }, + { url = "https://files.pythonhosted.org/packages/37/bf/fb3ebff8ddcb76aac5a01389251bbbb9519922a9b520d8247c1ca864a25d/pillow-12.3.0-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:ba09209fbe443b4acccebe845d8a138b89a8f4fbaeedd44953490b5315d5e965", size = 5345969, upload-time = "2026-07-01T11:54:06.397Z" }, + { url = "https://files.pythonhosted.org/packages/d8/66/9a386a92561f402389a4fc70c18838bf6d35eb5eb5c6850b4b2dc64f5048/pillow-12.3.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:ffd0c5368496f41b0944be820fcb7a838aa6e623d250b01acf2643939c3f99d7", size = 4780323, upload-time = "2026-07-01T11:54:09.351Z" }, + { url = "https://files.pythonhosted.org/packages/25/27/ac8f99618ffd3dde21db0f4d4b1d2ab00c0880595bfd17df103f7f39fd0c/pillow-12.3.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:d9c7f76c0673154f044e9d78c8655fb4213f6ca31a836df48b40fe5d187717b9", size = 6266838, upload-time = "2026-07-01T11:54:11.71Z" }, + { url = "https://files.pythonhosted.org/packages/84/21/a35af28dcc61f37ed850a2d64c65c701321dfbf25085e469d5559360cbbf/pillow-12.3.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:78cb2c6865a35ab8ff8b75fd122f6033b92a62c82801110e48ddd6c936a45d91", size = 6940830, upload-time = "2026-07-01T11:54:13.732Z" }, + { url = "https://files.pythonhosted.org/packages/eb/51/8b08617af3ad95e33ce6d7dd2c99ed6c8298f7fb131636303956be022e25/pillow-12.3.0-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:e491916b378fba47242221bb9ead245211b70d504f495d105d17b14a24b4907c", size = 6344383, upload-time = "2026-07-01T11:54:15.756Z" }, + { url = "https://files.pythonhosted.org/packages/1d/72/cf78ac9780bb93c28328f408973845a309d4d145041665f734572ced1b52/pillow-12.3.0-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:0dd2064cbc55aaec028ef5fbb60fa47bb6c3e7918e07ff17935284b227a9d2df", size = 7052934, upload-time = "2026-07-01T11:54:17.721Z" }, + { url = "https://files.pythonhosted.org/packages/20/20/25e0f4dc178a6bc0696793720055519a0de89e7661dae886992decbd2f81/pillow-12.3.0-cp312-cp312-win32.whl", hash = "sha256:dbce0b29841537a2fa4a214c2bbf14de3587c9680caa9b4e217568472490b28f", size = 6472684, upload-time = "2026-07-01T11:54:19.839Z" }, + { url = "https://files.pythonhosted.org/packages/45/89/da2f7971a317f83d807fdd4065c0af40208e59e692cc43d315a71a0e96d1/pillow-12.3.0-cp312-cp312-win_amd64.whl", hash = "sha256:a2b55dd6b2a4c4b7d87ffa56bdb33fdc5fdb9a462173861a7bc097f17d91cb09", size = 7227137, upload-time = "2026-07-01T11:54:22.025Z" }, + { url = "https://files.pythonhosted.org/packages/de/47/4845a0a6c0dbf1db8456bd9fc791f13c5ced7ced20606d08a0aacfd25b49/pillow-12.3.0-cp312-cp312-win_arm64.whl", hash = "sha256:331b624368d4f1d069149002f25f44bc61c8919ce8ddb3c45bdad8f6e2d89510", size = 2568267, upload-time = "2026-07-01T11:54:24.051Z" }, + { url = "https://files.pythonhosted.org/packages/75/18/2e8b40223153ccbc60df07f9e8928dc0c76202aa4e55ae9f53962b6510d6/pillow-12.3.0-pp311-pypy311_pp73-macosx_10_15_x86_64.whl", hash = "sha256:b3c777e849237620b022f7f297dd67705f9f5cf1685f09f02e46f93e92725468", size = 5302510, upload-time = "2026-07-01T11:56:25.736Z" }, + { url = "https://files.pythonhosted.org/packages/46/3e/51fabf59d5ab801ceab709453d3ab6b180083496579549de4c45ced6528a/pillow-12.3.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:b343699e8308bdc51978310e1c959c584e7869cc8c40780058c87da7781a1e94", size = 4736058, upload-time = "2026-07-01T11:56:28.041Z" }, + { url = "https://files.pythonhosted.org/packages/bf/20/22fe9384b7949e25fb1293bcfc84fb82590ff4ea6b37c95b24d26d793d86/pillow-12.3.0-pp311-pypy311_pp73-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:fbd139c8447d25dd750ab79ee274cc5e1fe80fc56340ab10b18a195e1b6eca3e", size = 5237776, upload-time = "2026-07-01T11:56:30.263Z" }, + { url = "https://files.pythonhosted.org/packages/08/14/f6ba68107680ffa74b39985f3f30884e41318fbc4250caa423c79b4788bb/pillow-12.3.0-pp311-pypy311_pp73-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:e7e480451b9fa137494bccd3a7d69adbe8ac65a87d97be61e11f1b1050a5bac3", size = 5860358, upload-time = "2026-07-01T11:56:32.68Z" }, + { url = "https://files.pythonhosted.org/packages/36/54/0169bc772ec491108b62f644f8ecf1fe5d8ae5ebafde2ee2142210166903/pillow-12.3.0-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:04f01d28a6aaff387bf842a13be313df23ba0597a44f1a976c9feb3c6ff4711a", size = 7231786, upload-time = "2026-07-01T11:56:35.046Z" }, +] + +[[package]] +name = "platformdirs" +version = "4.11.9" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/b9/8adc4e1b422b27fd88540ec7bf1f406f77ef393ec070e26fc430e914cde8/platformdirs-4.11.9.tar.gz", hash = "sha256:e2c66a8d384596cd98e3c4aea2d761df7bac95d9d8a2cc3946daa8cdafdaebc1", size = 38345, upload-time = "2026-09-16T13:31:45.259Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f3/94/803ba86705257d7eedddac4b02eb88a7483b1600e9200c1fefc6f1a9a3ff/platformdirs-4.11.9-py3-none-any.whl", hash = "sha256:0a3958f58a9e30321eaef0a424dd0b77cce242886b36b8aa992f9731ef2d59c1", size = 24472, upload-time = "2026-09-16T13:31:44.049Z" }, +] + +[[package]] +name = "pluggy" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, +] + +[[package]] +name = "pre-commit" +version = "4.6.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cfgv" }, + { name = "identify" }, + { name = "nodeenv" }, + { name = "pyyaml" }, + { name = "virtualenv" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/74/89/1f3e8e1fc3e97de0fa963495832f581f025f29471602a309e48808244292/pre_commit-4.6.2.tar.gz", hash = "sha256:8f5d7bfb021ecdbcd9d49d89847082dd24172ccde534390081a679ad046e2441", size = 198670, upload-time = "2026-08-10T22:07:18.421Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/45/e2/bbb7129c9e7999a6b8ee9cca3b66486c25c423ab5a75f34071798b74ce94/pre_commit-4.6.2-py2.py3-none-any.whl", hash = "sha256:e2dde9a75d3bce11bd3831c26d134df00a2803c1d818be6a0383c3dcda25dc4e", size = 226202, upload-time = "2026-08-10T22:07:16.942Z" }, +] + +[[package]] +name = "prompt-toolkit" +version = "3.0.51" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "wcwidth" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/bb/6e/9d084c929dfe9e3bfe0c6a47e31f78a25c54627d64a66e884a8bf5474f1c/prompt_toolkit-3.0.51.tar.gz", hash = "sha256:931a162e3b27fc90c86f1b48bb1fb2c528c2761475e57c9c06de13311c7b54ed", size = 428940, upload-time = "2025-04-15T09:18:47.731Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ce/4f/5249960887b1fbe561d9ff265496d170b55a735b76724f10ef19f9e40716/prompt_toolkit-3.0.51-py3-none-any.whl", hash = "sha256:52742911fde84e2d423e2f9a4cf1de7d7ac4e51958f648d9540e0fb8db077b07", size = 387810, upload-time = "2025-04-15T09:18:44.753Z" }, +] + +[[package]] +name = "py-key-value-aio" +version = "0.4.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "beartype" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/fb/e2/d689d922894a7ecde73b6daeaf9b13dab5aae06fe6aaaf7514722644d382/py_key_value_aio-0.4.5.tar.gz", hash = "sha256:c6563a2c6abe5da5e20f4f9e875c2a9b425a2244a54fadbf46cf140a9eea45d7", size = 107547, upload-time = "2026-05-27T16:37:08.107Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/f6/95/b8ba862968712caa12a19666175334fa979e1f198b896a430adb3bacfe87/py_key_value_aio-0.4.5-py3-none-any.whl", hash = "sha256:ab862adbcb8c72547d1c57821f22cbbb71ab86509039c96f36e914e0336c8dd7", size = 170005, upload-time = "2026-05-27T16:37:06.629Z" }, +] + +[package.optional-dependencies] +filetree = [ + { name = "aiofile" }, + { name = "anyio" }, +] +keyring = [ + { name = "keyring" }, +] +memory = [ + { name = "cachetools" }, +] + +[[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.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz", hash = "sha256:600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29", size = 103492, upload-time = "2026-01-21T14:26:51.89Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0c/c3/44f3fbbfa403ea2a7c779186dc20772604442dde72947e7d01069cbe98e3/pycparser-3.0-py3-none-any.whl", hash = "sha256:b727414169a36b7d524c1c3e31839a521725078d7b2ff038656844266160a992", size = 48172, upload-time = "2026-01-21T14:26:50.693Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.5" +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/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750, upload-time = "2026-08-28T14:04:00.916Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589, upload-time = "2026-08-28T14:03:59.136Z" }, +] + +[package.optional-dependencies] +email = [ + { name = "email-validator" }, +] + +[[package]] +name = "pydantic-core" +version = "2.46.5" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262, upload-time = "2026-08-28T10:01:31.677Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/b6/81d2d19ea0be2c03664381b59f65fa72fc7969decedae00bc2c4ad835708/pydantic_core-2.46.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f", size = 2074737, upload-time = "2026-08-28T09:57:57.711Z" }, + { url = "https://files.pythonhosted.org/packages/0c/18/b70da8300e292df4099684ea11b1958043580d2f50d2dc8bf7e542bdd84a/pydantic_core-2.46.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f", size = 1921751, upload-time = "2026-08-28T09:57:59.265Z" }, + { url = "https://files.pythonhosted.org/packages/e7/1a/0d590341b6ffa4b4aca83508e6b8db4761aaeacfc15a25ca3815876d4797/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061", size = 1948231, upload-time = "2026-08-28T09:58:00.678Z" }, + { url = "https://files.pythonhosted.org/packages/7d/1d/02eb35761c51f2f7b1b042d6ab4cda6600f0c8c88a2243b3f734376201e5/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be", size = 2020708, upload-time = "2026-08-28T09:58:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ea/f86073830e35d508cc8ddf9c3d9e6e6840fcb88d34bf726b0b4710186f27/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a", size = 2194914, upload-time = "2026-08-28T09:58:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/bb/d7/fc36240d7791ce90939e51608568c33bfdae26202016f9770c229a487d86/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b", size = 2235622, upload-time = "2026-08-28T09:58:05.516Z" }, + { url = "https://files.pythonhosted.org/packages/cf/bc/3fa2d76b83162820a17da7f645b28d1cba99fc8e1e5fc6517067ec450fa1/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c", size = 2062091, upload-time = "2026-08-28T09:58:07.135Z" }, + { url = "https://files.pythonhosted.org/packages/ab/9a/095d557bb492c90cd8a70a6dd048bf793d433d03d86c81c11e912e4cd049/pydantic_core-2.46.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee", size = 2089904, upload-time = "2026-08-28T09:58:08.814Z" }, + { url = "https://files.pythonhosted.org/packages/24/98/7b76b1ad10a19a617a52aaa1d80e159115af939b095e86f8e756fd52e0df/pydantic_core-2.46.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e", size = 2132244, upload-time = "2026-08-28T09:58:10.435Z" }, + { url = "https://files.pythonhosted.org/packages/20/32/7d6ca365fadba186a0c8f85de1a701663bce81efd309d9479be58687622f/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2", size = 2143901, upload-time = "2026-08-28T09:58:12.033Z" }, + { url = "https://files.pythonhosted.org/packages/f8/09/eb9a6aa57f22fd1541a9c0aa2a1f3aeef3ec65347d33e10a6da2f43e0ee9/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689", size = 2299425, upload-time = "2026-08-28T09:58:13.614Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f9/548a5bb9d4ba8cd26e26daf48052236f6b38bb61e7b7241fbc3c995719eb/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec", size = 2318566, upload-time = "2026-08-28T09:58:15.199Z" }, + { url = "https://files.pythonhosted.org/packages/4a/20/06454d18834c02c406c9133f1a3b485305fd9ee984f9636c2f730bef6a9d/pydantic_core-2.46.5-cp311-cp311-win32.whl", hash = "sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129", size = 1954258, upload-time = "2026-08-28T09:58:16.813Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c2/718b9deb4b72453b5d8c7447a3b14cb77bef36917ef5f514e0948a4096a0/pydantic_core-2.46.5-cp311-cp311-win_amd64.whl", hash = "sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c", size = 2041030, upload-time = "2026-08-28T09:58:18.288Z" }, + { url = "https://files.pythonhosted.org/packages/67/ea/c1d1a5b72d6e1ff7f377a4d9199f6591f095beb5b409a8a5d89f7238d939/pydantic_core-2.46.5-cp311-cp311-win_arm64.whl", hash = "sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8", size = 2009234, upload-time = "2026-08-28T09:58:19.929Z" }, + { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516, upload-time = "2026-08-28T09:58:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874, upload-time = "2026-08-28T09:58:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772, upload-time = "2026-08-28T09:58:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832, upload-time = "2026-08-28T09:58:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645, upload-time = "2026-08-28T09:58:28.948Z" }, + { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935, upload-time = "2026-08-28T09:58:30.625Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284, upload-time = "2026-08-28T09:58:32.289Z" }, + { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889, upload-time = "2026-08-28T09:58:33.986Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006, upload-time = "2026-08-28T09:58:35.647Z" }, + { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408, upload-time = "2026-08-28T09:58:37.38Z" }, + { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609, upload-time = "2026-08-28T09:58:39.22Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618, upload-time = "2026-08-28T09:58:40.89Z" }, + { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475, upload-time = "2026-08-28T09:58:42.591Z" }, + { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140, upload-time = "2026-08-28T09:58:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729, upload-time = "2026-08-28T09:58:46.13Z" }, + { url = "https://files.pythonhosted.org/packages/af/1e/ecca01fce348f7e8afa9572441ff6f7d1cc70d21e4859f33944d10877e1e/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2", size = 2075342, upload-time = "2026-08-28T10:00:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/1f/4c/af80c7a8032dfc897040ad5cb772bebde529a381186499e6e29987f23f8c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c", size = 1907219, upload-time = "2026-08-28T10:00:53.438Z" }, + { url = "https://files.pythonhosted.org/packages/be/3e/54d89e2b092e778716bf6153634ef479e955f48c261090be23aa1e0fb0b5/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47", size = 1953393, upload-time = "2026-08-28T10:00:55.58Z" }, + { url = "https://files.pythonhosted.org/packages/ea/89/828ee90cda28ce17bdefaa3a6eaf74fe430e113295a10e6126beca559d6c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a", size = 2099024, upload-time = "2026-08-28T10:00:57.794Z" }, + { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540, upload-time = "2026-08-28T10:01:00.318Z" }, + { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040, upload-time = "2026-08-28T10:01:02.529Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479, upload-time = "2026-08-28T10:01:05.004Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034, upload-time = "2026-08-28T10:01:07.345Z" }, + { url = "https://files.pythonhosted.org/packages/20/21/22102e9950b3049526d20e811b95396508377d87651edd2b80d2b3d28659/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f", size = 2071333, upload-time = "2026-08-28T10:01:09.636Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/87aefa427d191e6d3ab1447f1efc1cdcac86af1069239b133e8a0fd7f7c9/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0", size = 1912713, upload-time = "2026-08-28T10:01:12.285Z" }, + { url = "https://files.pythonhosted.org/packages/1f/93/fd89e9ad49b1805ca94d24ce1088b7d305f05c35ffafcedb9819d03588a0/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4", size = 2090926, upload-time = "2026-08-28T10:01:15.19Z" }, + { url = "https://files.pythonhosted.org/packages/6f/45/8e59dab6acf8d35f02f0a958980074f31038968bdb2c983fcae9d1efee03/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25", size = 2131303, upload-time = "2026-08-28T10:01:17.937Z" }, + { url = "https://files.pythonhosted.org/packages/d5/a5/e1d4dc5180dd887a9522efc1f8716b8692b7606b1d3273d7862eaf66be44/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6", size = 2145128, upload-time = "2026-08-28T10:01:20.694Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d7/ad493864a7fb21c0c4df98f965e2db430cb25a9d7369b5778d5016c09fd9/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e", size = 2294560, upload-time = "2026-08-28T10:01:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/b41c84c913f29973a268e6c2b5bbf13c95adb9956c126d10da11ba3b2bef/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda", size = 2317531, upload-time = "2026-08-28T10:01:26.334Z" }, + { url = "https://files.pythonhosted.org/packages/db/1d/068464f23075f66a8f1b806935e9cd9363ee446636ea70d2c22ee8659dbf/pydantic_core-2.46.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266", size = 2140686, upload-time = "2026-08-28T10:01:28.947Z" }, +] + +[[package]] +name = "pydantic-settings" +version = "2.15.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pydantic" }, + { name = "python-dotenv" }, + { name = "typing-inspection" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/68/ca/31c57507b13119d7d3cfa1576dad2911a4861e3be07b579395f4e9d393f9/pydantic_settings-2.15.0.tar.gz", hash = "sha256:694b793e84f766ba76a90ebdefc01d0a9a045dab0382bee70393da93712ad117", size = 261253, upload-time = "2026-08-07T09:24:57.419Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/30/a4/2bffa9f8e804325a09867f0e9d30795c80ea9f8d62560bd1b6ad6220eb2f/pydantic_settings-2.15.0-py3-none-any.whl", hash = "sha256:0ba092c291c94baceb5eff768aa0d56400a457585bc0175925a5a5510303da42", size = 69413, upload-time = "2026-08-07T09:24:55.839Z" }, +] + +[[package]] +name = "pygments" +version = "2.21.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } +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.14.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/af/c3/8a3b59c25070cc61dc517fbdfa5dc0904670c96f605cc69759dc09166b99/pyjwt-2.14.0.tar.gz", hash = "sha256:77283c83fb56ecf566a886c757a714bc83668e38156de2cce8263302f42e0b86", size = 113177, upload-time = "2026-09-11T13:11:54.638Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/9c/97/672cb32ce0dfea44b740cb7b4f97038463b9cf7c0ead1aacf595572851d6/pyjwt-2.14.0-py3-none-any.whl", hash = "sha256:ad0cef71c756a56e74863c2919cf0985f72decbcfcb550ee2f422e7c62b5eedc", size = 32896, upload-time = "2026-09-11T13:11:53.409Z" }, +] + +[package.optional-dependencies] +crypto = [ + { name = "cryptography" }, +] + +[[package]] +name = "pyperclip" +version = "1.11.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/e8/52/d87eba7cb129b81563019d1679026e7a112ef76855d6159d24754dbd2a51/pyperclip-1.11.0.tar.gz", hash = "sha256:244035963e4428530d9e3a6101a1ef97209c6825edab1567beac148ccc1db1b6", size = 12185, upload-time = "2025-09-26T14:40:37.245Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/df/80/fc9d01d5ed37ba4c42ca2b55b4339ae6e200b456be3a1aaddf4a9fa99b8c/pyperclip-1.11.0-py3-none-any.whl", hash = "sha256:299403e9ff44581cb9ba2ffeed69c7aa96a008622ad0c46cb575ca75b5b84273", size = 11063, upload-time = "2025-09-26T14:40:36.069Z" }, +] + +[[package]] +name = "pytest" +version = "9.1.1" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "iniconfig" }, + { name = "packaging" }, + { name = "pluggy" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e4/47/b9efed96c114afcfa3c9d3fe98a76a1d14c74a9e266d397cf6eb64be5e01/pytest-9.1.1.tar.gz", hash = "sha256:1088fbde8f2b49d95a549a195707afa7a76a3ce9bcadc26b6d71f0ffda5fe313", size = 1636369, upload-time = "2026-06-19T10:58:32.857Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/24/25/1de2678b631f5a49215c6c96fff41ba892b0a34df68d6d80292b1b48aa7f/pytest-9.1.1-py3-none-any.whl", hash = "sha256:37a86b45efb9a47a61a36449063e8e18d0cab3161329fc099eb21783169c4f0c", size = 386536, upload-time = "2026-06-19T10:58:31.347Z" }, +] + +[[package]] +name = "pytest-asyncio" +version = "1.4.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pytest" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/43/7c/d36d04db312ecf4298932ef77e6e4a9e8ad017906e24e34f0b0c361a2473/pytest_asyncio-1.4.0.tar.gz", hash = "sha256:c6c0d2259945122819f171a32ecea2c349ead889ee28176caaf492143424be42", size = 58514, upload-time = "2026-05-26T09:56:04.083Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/03/e2/08a497ef684b88559c9cc5f4ad53a37e7b99e727094a86d6ea32536d5d3c/pytest_asyncio-1.4.0-py3-none-any.whl", hash = "sha256:933ca923a23075a87fb7070c0ec272a6848489824d887c85c812670932835aa1", size = 16930, upload-time = "2026-05-26T09:56:02.576Z" }, +] + +[[package]] +name = "python-discovery" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "filelock" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/91/96/0f93e27c9f60a650838f2118159aa115fd5732c0716247917b7ba7ede665/python_discovery-1.6.0.tar.gz", hash = "sha256:6393b4eae1be8b2182670635e7baff89ac21cb9f8e86fd1ff40c7b1144febb4c", size = 82849, upload-time = "2026-08-28T17:30:02.366Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/43/5e/21abf578182fb15006a57faf3711a1e659e29d600d19b6e557eae908c81d/python_discovery-1.6.0-py3-none-any.whl", hash = "sha256:d4e244cf17b8b29819ed78003d55fbacf86eda23425b075454fff9271b79377a", size = 38451, upload-time = "2026-08-28T17:30:01.236Z" }, +] + +[[package]] +name = "python-dotenv" +version = "1.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6a/53/ed9d74092561d4b01a2ef1349d52cdbc135e526c245f366b089cfca6de49/python_dotenv-1.2.3.tar.gz", hash = "sha256:a20a594dabeaa385725aa239d5244871c143ecb356add8a20fcf23773a6c3a35", size = 58945, upload-time = "2026-08-16T16:54:54.067Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/0d/17/c5c6b53ddc18f297992099b3d9ec16c855c0ccc83263a21fe4d1c625ec6c/python_dotenv-1.2.3-py3-none-any.whl", hash = "sha256:904552145e8bfed22162c09dab1c2b9b54fefa7b23ba780f4f26ca0316b0f0d9", size = 22780, upload-time = "2026-08-16T16:54:52.473Z" }, +] + +[[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" }, +] + +[[package]] +name = "pywin32-ctypes" +version = "0.2.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/85/9f/01a1a99704853cb63f253eea009390c88e7131c67e66a0a02099a8c917cb/pywin32-ctypes-0.2.3.tar.gz", hash = "sha256:d162dc04946d704503b2edc4d55f3dba5c1d539ead017afa00142c38b9885755", size = 29471, upload-time = "2024-08-14T10:15:34.626Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/de/3d/8161f7711c017e01ac9f008dfddd9410dff3674334c233bde66e7ba65bbf/pywin32_ctypes-0.2.3-py3-none-any.whl", hash = "sha256:8a1513379d709975552d202d942d9837758905c8d01eb82b8bcc30918929e7b8", size = 30756, upload-time = "2024-08-14T10:15:33.187Z" }, +] + +[[package]] +name = "pyyaml" +version = "6.0.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz", hash = "sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f", size = 130960, upload-time = "2025-09-25T21:33:16.546Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/6d/16/a95b6757765b7b031c9374925bb718d55e0a9ba8a1b6a12d25962ea44347/pyyaml-6.0.3-cp311-cp311-macosx_10_13_x86_64.whl", hash = "sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e", size = 185826, upload-time = "2025-09-25T21:31:58.655Z" }, + { url = "https://files.pythonhosted.org/packages/16/19/13de8e4377ed53079ee996e1ab0a9c33ec2faf808a4647b7b4c0d46dd239/pyyaml-6.0.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824", size = 175577, upload-time = "2025-09-25T21:32:00.088Z" }, + { url = "https://files.pythonhosted.org/packages/0c/62/d2eb46264d4b157dae1275b573017abec435397aa59cbcdab6fc978a8af4/pyyaml-6.0.3-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c", size = 775556, upload-time = "2025-09-25T21:32:01.31Z" }, + { url = "https://files.pythonhosted.org/packages/10/cb/16c3f2cf3266edd25aaa00d6c4350381c8b012ed6f5276675b9eba8d9ff4/pyyaml-6.0.3-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00", size = 882114, upload-time = "2025-09-25T21:32:03.376Z" }, + { url = "https://files.pythonhosted.org/packages/71/60/917329f640924b18ff085ab889a11c763e0b573da888e8404ff486657602/pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d", size = 806638, upload-time = "2025-09-25T21:32:04.553Z" }, + { url = "https://files.pythonhosted.org/packages/dd/6f/529b0f316a9fd167281a6c3826b5583e6192dba792dd55e3203d3f8e655a/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a", size = 767463, upload-time = "2025-09-25T21:32:06.152Z" }, + { url = "https://files.pythonhosted.org/packages/f2/6a/b627b4e0c1dd03718543519ffb2f1deea4a1e6d42fbab8021936a4d22589/pyyaml-6.0.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4", size = 794986, upload-time = "2025-09-25T21:32:07.367Z" }, + { url = "https://files.pythonhosted.org/packages/45/91/47a6e1c42d9ee337c4839208f30d9f09caa9f720ec7582917b264defc875/pyyaml-6.0.3-cp311-cp311-win32.whl", hash = "sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b", size = 142543, upload-time = "2025-09-25T21:32:08.95Z" }, + { url = "https://files.pythonhosted.org/packages/da/e3/ea007450a105ae919a72393cb06f122f288ef60bba2dc64b26e2646fa315/pyyaml-6.0.3-cp311-cp311-win_amd64.whl", hash = "sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf", size = 158763, upload-time = "2025-09-25T21:32:09.96Z" }, + { url = "https://files.pythonhosted.org/packages/d1/33/422b98d2195232ca1826284a76852ad5a86fe23e31b009c9886b2d0fb8b2/pyyaml-6.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196", size = 182063, upload-time = "2025-09-25T21:32:11.445Z" }, + { url = "https://files.pythonhosted.org/packages/89/a0/6cf41a19a1f2f3feab0e9c0b74134aa2ce6849093d5517a0c550fe37a648/pyyaml-6.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0", size = 173973, upload-time = "2025-09-25T21:32:12.492Z" }, + { url = "https://files.pythonhosted.org/packages/ed/23/7a778b6bd0b9a8039df8b1b1d80e2e2ad78aa04171592c8a5c43a56a6af4/pyyaml-6.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28", size = 775116, upload-time = "2025-09-25T21:32:13.652Z" }, + { url = "https://files.pythonhosted.org/packages/65/30/d7353c338e12baef4ecc1b09e877c1970bd3382789c159b4f89d6a70dc09/pyyaml-6.0.3-cp312-cp312-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl", hash = "sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c", size = 844011, upload-time = "2025-09-25T21:32:15.21Z" }, + { url = "https://files.pythonhosted.org/packages/8b/9d/b3589d3877982d4f2329302ef98a8026e7f4443c765c46cfecc8858c6b4b/pyyaml-6.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc", size = 807870, upload-time = "2025-09-25T21:32:16.431Z" }, + { url = "https://files.pythonhosted.org/packages/05/c0/b3be26a015601b822b97d9149ff8cb5ead58c66f981e04fedf4e762f4bd4/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e", size = 761089, upload-time = "2025-09-25T21:32:17.56Z" }, + { url = "https://files.pythonhosted.org/packages/be/8e/98435a21d1d4b46590d5459a22d88128103f8da4c2d4cb8f14f2a96504e1/pyyaml-6.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea", size = 790181, upload-time = "2025-09-25T21:32:18.834Z" }, + { url = "https://files.pythonhosted.org/packages/74/93/7baea19427dcfbe1e5a372d81473250b379f04b1bd3c4c5ff825e2327202/pyyaml-6.0.3-cp312-cp312-win32.whl", hash = "sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5", size = 137658, upload-time = "2025-09-25T21:32:20.209Z" }, + { url = "https://files.pythonhosted.org/packages/86/bf/899e81e4cce32febab4fb42bb97dcdf66bc135272882d1987881a4b519e9/pyyaml-6.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b", size = 154003, upload-time = "2025-09-25T21:32:21.167Z" }, + { url = "https://files.pythonhosted.org/packages/1a/08/67bd04656199bbb51dbed1439b7f27601dfb576fb864099c7ef0c3e55531/pyyaml-6.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd", size = 140344, upload-time = "2025-09-25T21:32:22.617Z" }, +] + +[[package]] +name = "questionary" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "prompt-toolkit" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/a8/b8/d16eb579277f3de9e56e5ad25280fab52fc5774117fb70362e8c2e016559/questionary-2.1.0.tar.gz", hash = "sha256:6302cdd645b19667d8f6e6634774e9538bfcd1aad9be287e743d96cacaf95587", size = 26775, upload-time = "2024-12-29T11:49:17.802Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ad/3f/11dd4cd4f39e05128bfd20138faea57bec56f9ffba6185d276e3107ba5b2/questionary-2.1.0-py3-none-any.whl", hash = "sha256:44174d237b68bc828e4878c763a9ad6790ee61990e0ae72927694ead57bab8ec", size = 36747, upload-time = "2024-12-29T11:49:16.734Z" }, +] + +[[package]] +name = "referencing" +version = "0.37.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs" }, + { name = "rpds-py" }, + { name = "typing-extensions" }, +] +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 = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py" }, + { name = "pygments" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + +[[package]] +name = "rich-rst" +version = "2.1.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "pygments" }, + { name = "rich" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/e2/d6/d0b9fafc73b65767200da027acab1db1bdb1048f4fea5ebf659df01c700e/rich_rst-2.1.0.tar.gz", hash = "sha256:f4d117b49697f338769759fa5cacf5197da4888b347b9fda2e50aef5cd8d93bd", size = 302732, upload-time = "2026-07-05T02:59:44.308Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/2a/68/1fc93dd759605b5d00fc98b50200739e41ed32bd22d6ba35ca6c3932371b/rich_rst-2.1.0-py3-none-any.whl", hash = "sha256:7ecd1343ee12c879d0e7ae74c3eb6d263b023d2929c6d114212eb1fd91057255", size = 272987, upload-time = "2026-07-05T02:59:42.792Z" }, +] + +[[package]] +name = "rpds-py" +version = "2026.6.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/aa/2a/9618a122aeb2a169a28b03889a2995fe297588964333d4a7d67bdf46e147/rpds_py-2026.6.3.tar.gz", hash = "sha256:1cebd1337c242e4ec2293e541f712b2da849b29f48f0c293684b71c0632625d4", size = 64051, upload-time = "2026-06-30T07:17:53.009Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/94/1f/a2dca5ffdbf1d475ffc4e80e4d5d720ff3a00f691795910116960ee12511/rpds_py-2026.6.3-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:7b689145a1485c335569bd056464f3243a29af7ed3871c7be31ad624ba239bc7", size = 342174, upload-time = "2026-06-30T07:14:54.821Z" }, + { url = "https://files.pythonhosted.org/packages/4d/dc/323d08583c0832911768663d1944f0107fcd4088704858d84b5e06d105a0/rpds_py-2026.6.3-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:db08f45aecde626498fb3df07bcf6d2ec040af42e859a4f5040d79c200342911", size = 345513, upload-time = "2026-06-30T07:14:56.515Z" }, + { url = "https://files.pythonhosted.org/packages/0b/2a/e31989834d18d2f26ec1d2774c5b1eb3331df4ea8ada525175294c94b48a/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:acc992ab27b15f852c76755eb2ab7dce86585ddadba6fa5946e58556088845b4", size = 373783, upload-time = "2026-06-30T07:14:57.736Z" }, + { url = "https://files.pythonhosted.org/packages/87/fe/e80107ee3639585c9941c17d6a42cd65325022f656c023191fce78c324c8/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:7f88d653e7b3b779d71ae7454e20dcc9b6bae903f33c269db9f2be41bda3f261", size = 378316, upload-time = "2026-06-30T07:14:59.077Z" }, + { url = "https://files.pythonhosted.org/packages/22/6f/81e3adf81acfb6fa694de2a6e4e7d8863121e3e0799e0a7725e6cf5679c4/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e52655eaf81e32593abedaa4bfe33170c8cfedf3365ed9be6e11e07f148f0278", size = 499423, upload-time = "2026-06-30T07:15:00.488Z" }, + { url = "https://files.pythonhosted.org/packages/2d/9a/41263969df0ce3d9af2a96d5005a288200af1989aed3354bfceb5fc0b21f/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:dfcc8b909769d19db55c7cc9541eb64b9b774b1057ffffb4f1048070475bb9f9", size = 386077, upload-time = "2026-06-30T07:15:01.911Z" }, + { url = "https://files.pythonhosted.org/packages/5e/19/7e98f468bd50346faff5b10e5297374b443bfdddacc8e9fbc65984539597/rpds_py-2026.6.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c1255b302953c86a486b81d330d5ee1d5bd937691ce271b6be0ef0e299eaab7", size = 371315, upload-time = "2026-06-30T07:15:03.317Z" }, + { url = "https://files.pythonhosted.org/packages/99/3c/2b973b4d371906a134b03decfea7f5d9835a2c6d263454392e15b64b5b18/rpds_py-2026.6.3-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:8d2294a31386bfa251d8c8a39472beee17db67d4f1a6eabea665d35c9a4461c3", size = 383502, upload-time = "2026-06-30T07:15:04.627Z" }, + { url = "https://files.pythonhosted.org/packages/98/2a/12e2799500af0a307bca76b63361c51f9fe479223561489c29eea1f2ee41/rpds_py-2026.6.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:f8f23ead891a3b762f35ab3b04623da7056545b48aa60d59957e6789914545da", size = 402673, upload-time = "2026-06-30T07:15:05.856Z" }, + { url = "https://files.pythonhosted.org/packages/2d/e3/21e5872d165fe08be4f229e3d5ee9d90019c0bf0e5538de60dbd54009450/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:421aba32367055614287a4292b6a17f1939c9452299f7a0209c117e990b646d4", size = 549964, upload-time = "2026-06-30T07:15:07.159Z" }, + { url = "https://files.pythonhosted.org/packages/1a/d0/5ee0fe36844297de8123bee27bc12078c1a7416ad9f1b8a8ca18d6b0c0ac/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:1e5822dfc2f0d4ab7e745eaa6d85945069329beeccef965af3f3bb26058fcab6", size = 615446, upload-time = "2026-06-30T07:15:08.531Z" }, + { url = "https://files.pythonhosted.org/packages/b1/80/1ea5873cb683f2fbe5f21b23ea1f6d179ead19f3c5b249b7eb5dca568ef2/rpds_py-2026.6.3-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:83e35b57523816c8613fd0776b40cd8bb9f596b37ddd2692eb4a6bb5ab2f8c93", size = 576975, upload-time = "2026-06-30T07:15:09.97Z" }, + { url = "https://files.pythonhosted.org/packages/c9/e1/90ef639217a5ddb15b7f4f61b1c33911fd044ad03c311bafdd2bcab85582/rpds_py-2026.6.3-cp311-cp311-win32.whl", hash = "sha256:de3eceba0b683bcbb1ab93da016d0270df1f9ae7be716b40214c5dafac6ea45a", size = 204453, upload-time = "2026-06-30T07:15:11.324Z" }, + { url = "https://files.pythonhosted.org/packages/f2/b7/b7a1695d7af36f521fb11e80d6d3adbd744f73b921859bd3c2a2c0dc706f/rpds_py-2026.6.3-cp311-cp311-win_amd64.whl", hash = "sha256:2c54a076ca4d370980ab57bc0e31df57bbe8d41340436a90ef8b1219a3cbb127", size = 223219, upload-time = "2026-06-30T07:15:12.476Z" }, + { url = "https://files.pythonhosted.org/packages/d7/a2/145afacf796e4506062825941176ad9445c2dcf2b3b6a1f13d3030a15e19/rpds_py-2026.6.3-cp311-cp311-win_arm64.whl", hash = "sha256:168c733a7112e071bb7a66460e667edfcff06c017a3c523f7a8a8e08d0140804", size = 219137, upload-time = "2026-06-30T07:15:13.631Z" }, + { url = "https://files.pythonhosted.org/packages/5c/be/2e8974163072e7bab7df1a5acd54c4498e75e35d6d18b864d3a9d5dadc92/rpds_py-2026.6.3-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:a0811d33247c3d6128a3001d763f2aa056bb3425204335400ac54f89eec3a0d0", size = 343691, upload-time = "2026-06-30T07:15:14.96Z" }, + { url = "https://files.pythonhosted.org/packages/a4/73/319dfa745dd668efe89309141ded489126461fcecd2b8f3a3cda185129b6/rpds_py-2026.6.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:538949e262e46caa31ac01bdb3c1e8f642622922cacbabbae6a8445d9dc33eaf", size = 338542, upload-time = "2026-06-30T07:15:16.267Z" }, + { url = "https://files.pythonhosted.org/packages/21/63/4239893be1c4d09b709b1a8f6be4188f0870084ff547f46606b8a75f1b03/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:55927d532399c2c646100ff7feb48eaa940ad70f42cd68e1328f3ded9f81ca24", size = 368180, upload-time = "2026-06-30T07:15:17.62Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ca/9c5de382225234ceb37b1844ebdb140db12b2a278bb9efe2fcd19f6c82ce/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:f56f1695bc5c0871cbc33dc0130fcf503aab0c57dcc5a6700a4f49eba4f2652e", size = 375067, upload-time = "2026-06-30T07:15:18.952Z" }, + { url = "https://files.pythonhosted.org/packages/87/dc/863f69d1bf04ade34b7fe0d59b9fdf6f0135fe2d7cbca74f1d665589559d/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:270b293dae9058fc9fcedab50f13cebf46fb8ed1d1d54e0521a9da5d6b211975", size = 490509, upload-time = "2026-06-30T07:15:20.434Z" }, + { url = "https://files.pythonhosted.org/packages/ce/ef/eac16a12048b45ec7c7fa94f2be3438a5f26bf9cc8580b18a1cfd609b7f6/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:127565fead0a10943b282957bd5447804ff3160ad79f2ad2635e6d249e380680", size = 382754, upload-time = "2026-06-30T07:15:21.831Z" }, + { url = "https://files.pythonhosted.org/packages/04/8f/d2f3f532616be4d06c316ef119683e832bd3d41e112bf3a88f4151c95b17/rpds_py-2026.6.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ecabd69db66de867690f9797f2f8fa27ba501bbc24540cbdbdc649cd15888ba6", size = 366189, upload-time = "2026-06-30T07:15:23.371Z" }, + { url = "https://files.pythonhosted.org/packages/e3/29/41a7b0e98a4b44cd676ab7598419623373eb43b20be68c084935c1a8cf88/rpds_py-2026.6.3-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:58eadac9cd119677b60e1cf8ac4052f35949d71b8a9e5556efccbe82533cf22a", size = 377750, upload-time = "2026-06-30T07:15:24.659Z" }, + { url = "https://files.pythonhosted.org/packages/2e/05/ecda0bec46f9a1565090bcdc941d023f6a25aff85fda28f89f8d19878152/rpds_py-2026.6.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:7491ee23305ac3eb59e492b6945881f5cd77a6f731061a3f25b77fd40f9e99a4", size = 395576, upload-time = "2026-06-30T07:15:25.987Z" }, + { url = "https://files.pythonhosted.org/packages/68/a8/6ed52f03ee6cb854ce78785cc9a9a672eb880e83fd7224d471f667d151f1/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:2c99f7e8ccb3dd6e3e4bfeac657a7b208c9bac8075f4b078c02d7404c34107fa", size = 543807, upload-time = "2026-06-30T07:15:27.356Z" }, + { url = "https://files.pythonhosted.org/packages/8f/d6/156c0d3eea27ba09b92562ba2364ba124c0a061b199e17eac637cd25a5e2/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:62698275682bf121181861295c9181e789030a2d516071f5b8f3c23c170cd0fc", size = 611187, upload-time = "2026-06-30T07:15:28.931Z" }, + { url = "https://files.pythonhosted.org/packages/f1/31/774212ed989c62f7f310220089f9b0a3fb8f40f5443d1727abd5d9f52bc9/rpds_py-2026.6.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:a214c993455f99a89aaeadc9b21241900037adc9d97203e374d75513c5911822", size = 573030, upload-time = "2026-06-30T07:15:30.553Z" }, + { url = "https://files.pythonhosted.org/packages/c9/50/22f73127a41f1ce4f87fe39aadfb9a126345801c274aa93ae88456249327/rpds_py-2026.6.3-cp312-cp312-win32.whl", hash = "sha256:501f9f04a588d6a09179368c57071301445191767c64e4b52a6aa9871f1ef5ed", size = 202185, upload-time = "2026-06-30T07:15:32.027Z" }, + { url = "https://files.pythonhosted.org/packages/04/3a/f0ee4d4dde9d3b69dedf1b5f74e7a40017046d55052d173e418c6a94f960/rpds_py-2026.6.3-cp312-cp312-win_amd64.whl", hash = "sha256:2c958bf94822e9290a40aaf2a822d4bc5c88099093e3948ad6c571eca9272e5f", size = 220394, upload-time = "2026-06-30T07:15:33.359Z" }, + { url = "https://files.pythonhosted.org/packages/f3/83/3382fe37f809b59f02aac04dbc4e765b480b46ee0227ed516e3bdc4d3dfc/rpds_py-2026.6.3-cp312-cp312-win_arm64.whl", hash = "sha256:22bffe6042b9bcb0822bcd1955ec00e245daf17b4344e4ed8e9551b976b63e96", size = 215753, upload-time = "2026-06-30T07:15:34.778Z" }, + { url = "https://files.pythonhosted.org/packages/b4/9c/f0d19ac587fd0e4ab6b72cda355e9c5a6166b01ef7e064e437aef8eb9fef/rpds_py-2026.6.3-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:4cf2d36a2357e4d07bb5a4f98801265327b48256867816cfd2ceb001e9754a8f", size = 349791, upload-time = "2026-06-30T07:17:33.315Z" }, + { url = "https://files.pythonhosted.org/packages/38/c7/1d49d204c9fd2ee6c537601dc4c1ba921e03363ca576bfab94a00254ac9a/rpds_py-2026.6.3-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:30c6dc199b24a5e3e81d50da0f00858c5bbdb2617a750395687f4339c5818171", size = 352842, upload-time = "2026-06-30T07:17:34.897Z" }, + { url = "https://files.pythonhosted.org/packages/ac/e5/c0b5dc93cd0d4c06ce1f438907649514e2ea077bcd911e3154a51e96c38e/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9891e594296ab9dada6551c8e7b387b2721f27a67eecd528412e8906247a7b90", size = 382094, upload-time = "2026-06-30T07:17:36.514Z" }, + { url = "https://files.pythonhosted.org/packages/0d/54/ec0e907b4ca8d541112db352409bd15f871c9b243e0c92c9b5a46ae96f01/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b5c2dc92304aa48a4a60443b548bb12f12e119d4b72f314015e67b9e1be97fca", size = 388662, upload-time = "2026-06-30T07:17:38.235Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f4/921c22a4fd0f1c1ac13a3996ffbf0aa67951e2c8ad0d1d9574938a2932e8/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:127e08c0642d880cf32ca47ec2a4a77b901f7e2dd1ad9762adb13955d72ffcc9", size = 504896, upload-time = "2026-06-30T07:17:39.689Z" }, + { url = "https://files.pythonhosted.org/packages/0b/1b/a114b972cefa1ab1cdb3c7bb177cd3844a12826c507c722d3a73516dbbaf/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8bb68f03f395eb793220b45c097bd4d8c32944393da0fad8b999efac0868fc8c", size = 391545, upload-time = "2026-06-30T07:17:41.336Z" }, + { url = "https://files.pythonhosted.org/packages/4e/98/af9b3db77d47fcbe6c8c1f36e2c2147ec70292819e99c325f871584a1c11/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a3450b693fde92133e9f51060568a4c31fcca76d5e53bbd611e689ca446517e9", size = 380059, upload-time = "2026-06-30T07:17:42.857Z" }, + { url = "https://files.pythonhosted.org/packages/c9/ba/0efd8668b97c1d26a61566386c636a7a7a09829e474fdf807caa15a2c844/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_31_riscv64.whl", hash = "sha256:5e8d07bddee435a2ff6f1920e18feff28d0bc4533e42f4bf6927fbd073312c41", size = 393235, upload-time = "2026-06-30T07:17:44.637Z" }, + { url = "https://files.pythonhosted.org/packages/62/90/8c139ee9690f73b0829f32647de6f40d826f8f443af6fa72644f96351aac/rpds_py-2026.6.3-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3a83ae6c67b7676b9878378547ca8e93ed77a580037bcbcd1d32f739e1e6089c", size = 413008, upload-time = "2026-06-30T07:17:46.225Z" }, + { url = "https://files.pythonhosted.org/packages/9c/97/0043896fdd7828ce09a1d9a8b06433714d0960fc4ff3fc4aa72b666b764e/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_aarch64.whl", hash = "sha256:2bfd04c19ddbd6640de0b51894d764bd2758854d5b75bd102d2ef10cb9c293a9", size = 558118, upload-time = "2026-06-30T07:17:47.759Z" }, + { url = "https://files.pythonhosted.org/packages/f6/40/02355f0e134f783a8f9814c4680a1bd311d37671577a5964ea838573ff37/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_i686.whl", hash = "sha256:ca6546b66be9dc4738b1b043d5ebd5488c66c578c5ff0fd0e8065313fe3afb76", size = 623138, upload-time = "2026-06-30T07:17:49.355Z" }, + { url = "https://files.pythonhosted.org/packages/10/85/48f0abdcef5cce4e034c7a5b0ceeceba0b01bf0d942824f4bb720afe2dec/rpds_py-2026.6.3-pp311-pypy311_pp73-musllinux_1_2_x86_64.whl", hash = "sha256:8e65860d238379ed982fd9ba690579b5e95af2f4840f99c772816dbe573cb826", size = 586486, upload-time = "2026-06-30T07:17:51.141Z" }, +] + +[[package]] +name = "ruff" +version = "0.11.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/90/61/fb87430f040e4e577e784e325351186976516faef17d6fcd921fe28edfd7/ruff-0.11.2.tar.gz", hash = "sha256:ec47591497d5a1050175bdf4e1a4e6272cddff7da88a2ad595e1e326041d8d94", size = 3857511, upload-time = "2025-03-21T13:31:17.419Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/99/102578506f0f5fa29fd7e0df0a273864f79af044757aef73d1cae0afe6ad/ruff-0.11.2-py3-none-linux_armv6l.whl", hash = "sha256:c69e20ea49e973f3afec2c06376eb56045709f0212615c1adb0eda35e8a4e477", size = 10113146, upload-time = "2025-03-21T13:30:26.68Z" }, + { url = "https://files.pythonhosted.org/packages/74/ad/5cd4ba58ab602a579997a8494b96f10f316e874d7c435bcc1a92e6da1b12/ruff-0.11.2-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:2c5424cc1c4eb1d8ecabe6d4f1b70470b4f24a0c0171356290b1953ad8f0e272", size = 10867092, upload-time = "2025-03-21T13:30:37.949Z" }, + { url = "https://files.pythonhosted.org/packages/fc/3e/d3f13619e1d152c7b600a38c1a035e833e794c6625c9a6cea6f63dbf3af4/ruff-0.11.2-py3-none-macosx_11_0_arm64.whl", hash = "sha256:ecf20854cc73f42171eedb66f006a43d0a21bfb98a2523a809931cda569552d9", size = 10224082, upload-time = "2025-03-21T13:30:39.962Z" }, + { url = "https://files.pythonhosted.org/packages/90/06/f77b3d790d24a93f38e3806216f263974909888fd1e826717c3ec956bbcd/ruff-0.11.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0c543bf65d5d27240321604cee0633a70c6c25c9a2f2492efa9f6d4b8e4199bb", size = 10394818, upload-time = "2025-03-21T13:30:42.551Z" }, + { url = "https://files.pythonhosted.org/packages/99/7f/78aa431d3ddebfc2418cd95b786642557ba8b3cb578c075239da9ce97ff9/ruff-0.11.2-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:20967168cc21195db5830b9224be0e964cc9c8ecf3b5a9e3ce19876e8d3a96e3", size = 9952251, upload-time = "2025-03-21T13:30:45.196Z" }, + { url = "https://files.pythonhosted.org/packages/30/3e/f11186d1ddfaca438c3bbff73c6a2fdb5b60e6450cc466129c694b0ab7a2/ruff-0.11.2-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:955a9ce63483999d9f0b8f0b4a3ad669e53484232853054cc8b9d51ab4c5de74", size = 11563566, upload-time = "2025-03-21T13:30:47.516Z" }, + { url = "https://files.pythonhosted.org/packages/22/6c/6ca91befbc0a6539ee133d9a9ce60b1a354db12c3c5d11cfdbf77140f851/ruff-0.11.2-py3-none-manylinux_2_17_ppc64.manylinux2014_ppc64.whl", hash = "sha256:86b3a27c38b8fce73bcd262b0de32e9a6801b76d52cdb3ae4c914515f0cef608", size = 12208721, upload-time = "2025-03-21T13:30:49.56Z" }, + { url = "https://files.pythonhosted.org/packages/19/b0/24516a3b850d55b17c03fc399b681c6a549d06ce665915721dc5d6458a5c/ruff-0.11.2-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a3b66a03b248c9fcd9d64d445bafdf1589326bee6fc5c8e92d7562e58883e30f", size = 11662274, upload-time = "2025-03-21T13:30:52.055Z" }, + { url = "https://files.pythonhosted.org/packages/d7/65/76be06d28ecb7c6070280cef2bcb20c98fbf99ff60b1c57d2fb9b8771348/ruff-0.11.2-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:0397c2672db015be5aa3d4dac54c69aa012429097ff219392c018e21f5085147", size = 13792284, upload-time = "2025-03-21T13:30:54.24Z" }, + { url = "https://files.pythonhosted.org/packages/ce/d2/4ceed7147e05852876f3b5f3fdc23f878ce2b7e0b90dd6e698bda3d20787/ruff-0.11.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:869bcf3f9abf6457fbe39b5a37333aa4eecc52a3b99c98827ccc371a8e5b6f1b", size = 11327861, upload-time = "2025-03-21T13:30:56.757Z" }, + { url = "https://files.pythonhosted.org/packages/c4/78/4935ecba13706fd60ebe0e3dc50371f2bdc3d9bc80e68adc32ff93914534/ruff-0.11.2-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:2a2b50ca35457ba785cd8c93ebbe529467594087b527a08d487cf0ee7b3087e9", size = 10276560, upload-time = "2025-03-21T13:30:58.881Z" }, + { url = "https://files.pythonhosted.org/packages/81/7f/1b2435c3f5245d410bb5dc80f13ec796454c21fbda12b77d7588d5cf4e29/ruff-0.11.2-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:7c69c74bf53ddcfbc22e6eb2f31211df7f65054bfc1f72288fc71e5f82db3eab", size = 9945091, upload-time = "2025-03-21T13:31:01.45Z" }, + { url = "https://files.pythonhosted.org/packages/39/c4/692284c07e6bf2b31d82bb8c32f8840f9d0627d92983edaac991a2b66c0a/ruff-0.11.2-py3-none-musllinux_1_2_i686.whl", hash = "sha256:6e8fb75e14560f7cf53b15bbc55baf5ecbe373dd5f3aab96ff7aa7777edd7630", size = 10977133, upload-time = "2025-03-21T13:31:04.013Z" }, + { url = "https://files.pythonhosted.org/packages/94/cf/8ab81cb7dd7a3b0a3960c2769825038f3adcd75faf46dd6376086df8b128/ruff-0.11.2-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:842a472d7b4d6f5924e9297aa38149e5dcb1e628773b70e6387ae2c97a63c58f", size = 11378514, upload-time = "2025-03-21T13:31:06.166Z" }, + { url = "https://files.pythonhosted.org/packages/d9/3a/a647fa4f316482dacf2fd68e8a386327a33d6eabd8eb2f9a0c3d291ec549/ruff-0.11.2-py3-none-win32.whl", hash = "sha256:aca01ccd0eb5eb7156b324cfaa088586f06a86d9e5314b0eb330cb48415097cc", size = 10319835, upload-time = "2025-03-21T13:31:10.7Z" }, + { url = "https://files.pythonhosted.org/packages/86/54/3c12d3af58012a5e2cd7ebdbe9983f4834af3f8cbea0e8a8c74fa1e23b2b/ruff-0.11.2-py3-none-win_amd64.whl", hash = "sha256:3170150172a8f994136c0c66f494edf199a0bbea7a409f649e4bc8f4d7084080", size = 11373713, upload-time = "2025-03-21T13:31:13.148Z" }, + { url = "https://files.pythonhosted.org/packages/d6/d4/dd813703af8a1e2ac33bf3feb27e8a5ad514c9f219df80c64d69807e7f71/ruff-0.11.2-py3-none-win_arm64.whl", hash = "sha256:52933095158ff328f4c77af3d74f0379e34fd52f175144cefc1b192e7ccd32b4", size = 10441990, upload-time = "2025-03-21T13:31:15.206Z" }, +] + +[[package]] +name = "secretstorage" +version = "3.5.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "cryptography" }, + { name = "jeepney" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/1c/03/e834bcd866f2f8a49a85eaff47340affa3bfa391ee9912a952a1faa68c7b/secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be", size = 19884, upload-time = "2025-11-23T19:02:53.191Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b7/46/f5af3402b579fd5e11573ce652019a67074317e18c1935cc0b4ba9b35552/secretstorage-3.5.0-py3-none-any.whl", hash = "sha256:0ce65888c0725fcb2c5bc0fdb8e5438eece02c523557ea40ce0703c266248137", size = 15554, upload-time = "2025-11-23T19:02:51.545Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] + +[[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.4.11" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "starlette" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/2b/54/6767bb789b2f2fed6e0f953df949cd39dc263a384c1b65a95232598621d6/sse_starlette-3.4.11.tar.gz", hash = "sha256:1bae716c02f3e6f294be41ff333220692dae7c3cbab077c900f159676719dade", size = 34972, upload-time = "2026-09-05T12:11:04.607Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/98/6a/2ba3ed4a69babf3afdddf7d8314a48d87562c0a442206bbc2a1b50d5efc0/sse_starlette-3.4.11-py3-none-any.whl", hash = "sha256:c7b2244bdff016fe7f64e10075e89a3e6bbf899649cc89b0fe884b5545042453", size = 17122, upload-time = "2026-09-05T12:11:03.195Z" }, +] + +[[package]] +name = "starlette" +version = "1.6.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, + { name = "typing-extensions" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/b5/b4/205b0d5241d934e8add0c38aa924c4f9fb7330834ff11e5444db964ec3f9/starlette-1.6.0.tar.gz", hash = "sha256:d4e3ac5e546444960c710297a3c9fc3f7ebae1b7e963f3d36173b49da535be9b", size = 2716969, upload-time = "2026-08-08T18:27:57.512Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c8/cb/6a6a47d5b464bd08695d254f3da6e7986cc70c9fa5d778eda57538edfe56/starlette-1.6.0-py3-none-any.whl", hash = "sha256:a86dd39d14bb45f85a3d18525215a9ef0cfd1f192ac793220e72598c90335f0c", size = 75969, upload-time = "2026-08-08T18:27:56.196Z" }, +] + +[[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.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/53/a3/1585216310e344e8102c22482f6060c7a6ea0322b63e026372e6dcefcfd6/truststore-0.10.4.tar.gz", hash = "sha256:9d91bd436463ad5e4ee4aba766628dd6cd7010cf3e2461756b3303710eebc301", size = 26169, upload-time = "2025-08-12T18:49:02.73Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/19/97/56608b2249fe206a67cd573bc93cd9896e1efb9e98bce9c163bcdc704b88/truststore-0.10.4-py3-none-any.whl", hash = "sha256:adaeaecf1cbb5f4de3b1959b42d41f6fab57b2b1666adb59e89cb0b53361d981", size = 18660, upload-time = "2025-08-12T18:49:01.46Z" }, +] + +[[package]] +name = "typer" +version = "0.27.2" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "annotated-doc" }, + { name = "colorama", marker = "sys_platform == 'win32'" }, + { name = "rich" }, + { name = "shellingham" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/16/f7/57713ba479fd405eb76de31404b2c744c289e336b2d999511ebf51e496f7/typer-0.27.2.tar.gz", hash = "sha256:269b7eb9d3c202ca84b4bc9618cb04ebb43d3d4d1e567e4c768607232c05f945", size = 204045, upload-time = "2026-08-28T10:26:55.046Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/dc/bf/205d0004930ede8f542fb58f601526fccf4ae7626075ca1e6c4de5d3d652/typer-0.27.2-py3-none-any.whl", hash = "sha256:b3a5fc4342d5fc8fda8fc3010b1cf117e9249aab7fae800c2eff62fd3842d97d", size = 123130, upload-time = "2026-08-28T10:26:53.752Z" }, +] + +[[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 = "uncalled-for" +version = "0.4.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/6b/5a/92ce0b3ea5481915f55da994c2c2c5f7a3c09949afde196ee89f8ab961aa/uncalled_for-0.4.0.tar.gz", hash = "sha256:335b95bd2422332ec210d518f314a16e4c640921c39fc8bf2ad095bd3538f4af", size = 56979, upload-time = "2026-08-10T14:51:46.247Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/a2/40/97cec87c077eb3291fc7905e6633e08b7ca593c57d30238444bcb6bb3d53/uncalled_for-0.4.0-py3-none-any.whl", hash = "sha256:16c4bb3337532e4bd5569adc192285976f3ad5305402256d34c67a12b5c968bd", size = 15502, upload-time = "2026-08-10T14:51:45.068Z" }, +] + +[[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.53.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "click" }, + { name = "h11" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/5d/ad/04bbb797c84fc1f26cb171f7394716f4865ffb8d8c5e1eef42565c2dfa6b/uvicorn-0.53.0.tar.gz", hash = "sha256:a9356f0cb89b3b8621529c5d5eebd69bfe154f4c3f68b4cf2de47e45fa855c2e", size = 110881, upload-time = "2026-09-14T07:44:23.815Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/76/18/0eea75741ee812e9f598b687619ce2454f6c3a1c5cd21ea990ec6bd26f45/uvicorn-0.53.0-py3-none-any.whl", hash = "sha256:e8dca71ec86dce5f04e333f0d56cdedf942446e6643b9cea1af0d6d3a02cb03e", size = 87081, upload-time = "2026-09-14T07:44:22.179Z" }, +] + +[[package]] +name = "virtualenv" +version = "21.7.10" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "distlib" }, + { name = "filelock" }, + { name = "platformdirs" }, + { name = "python-discovery" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/45/9d/5acd348310e0803c658c8cf7c4d928e2d22fc4f79c29098b651cd3edfdba/virtualenv-21.7.10.tar.gz", hash = "sha256:a7bf10f37ecc36f1942d6e469d6b59f5fe308f60ac711f66f51ef3bd8cb2c9aa", size = 5350247, upload-time = "2026-09-15T23:36:05.739Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/85/7c/b75957b57ef372d84628b1099c4a530b3c361878cc6c54a8dfc5071d371a/virtualenv-21.7.10-py3-none-any.whl", hash = "sha256:d7ac9669ba19e675ffadbb97fe8e887ef92fb1743fe9a0032be62b947657327a", size = 5324900, upload-time = "2026-09-15T23:36:03.751Z" }, +] + +[[package]] +name = "watchfiles" +version = "1.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "anyio" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/cd/41/5e1a4bb12aac5f1493fa1bdc11154eca3b258ca4eba65d39c473fe19d8e9/watchfiles-1.2.0.tar.gz", hash = "sha256:c995fba777f1ea992f090f9236e9284cf7a5d1a0130dd5a3d82c598cacd76838", size = 108252, upload-time = "2026-05-18T04:32:04.251Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fc/3d/8024c801df84d1587740d0359e7fdd80afeae3d159011f3d5376dd82f18e/watchfiles-1.2.0-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:704fd259e332e01f9b9c178f4bce9e49027e5587cc2600eeeaf8e76e1c846201", size = 400242, upload-time = "2026-05-18T04:31:19.014Z" }, + { url = "https://files.pythonhosted.org/packages/87/5b/f4dfd45323e949984a3a7f9dc31d1cbb049921e7d98253488dda72ccdaa9/watchfiles-1.2.0-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:6543cf55d170003296d185c0af981f3e1311564907e1f4e08671fc7693a890a5", size = 394562, upload-time = "2026-05-18T04:30:08.46Z" }, + { url = "https://files.pythonhosted.org/packages/98/d8/19483ef075d601c409bce8bcbb5c0f81a10876fff870400568f08ce484a1/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:89d8c2394a065ca86f5d2910ff263ae67c127e1376ccc4f9fc35c71db879f80a", size = 456611, upload-time = "2026-05-18T04:30:45.723Z" }, + { url = "https://files.pythonhosted.org/packages/b1/6a/cc81fbe7ee42f2f22e661a6e12def7807e01b14b2f39e0ff83fd373fd307/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:772b80df316480d894a0e3165fdd19cf77f5d17f9a787f94029465ad0e3529d1", size = 461379, upload-time = "2026-05-18T04:31:29.292Z" }, + { url = "https://files.pythonhosted.org/packages/b1/57/7e669002082c0a0f4fb5113bb70125f7110124b846b0a11bc5ae8e90eac1/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d158cd89df6053823533e06fb1d73c549133bff5f0396170c0e53d9559340717", size = 493556, upload-time = "2026-05-18T04:30:05.44Z" }, + { url = "https://files.pythonhosted.org/packages/45/7d/f60a2b19807b21fe8281f3a8da4f59eef0d5f96825ac4680ba2d4f2ebf91/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:d516b3283a758e087841aedb8031549fb41ced08f3db10aa6d2bf32dc042525b", size = 575255, upload-time = "2026-05-18T04:30:40.568Z" }, + { url = "https://files.pythonhosted.org/packages/bd/49/77f5b5e6efbcd57482f74948ebb1b97e5c0046d6b61475042d830c84b3ff/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:53b2290c92e0506d102cd448fbc610d87079553f86caa39d67440856a8b8bba5", size = 467052, upload-time = "2026-05-18T04:31:17.942Z" }, + { url = "https://files.pythonhosted.org/packages/ee/5a/73e2959af1b97fd5d556f9a8bdba017be23ceeef731869d5eaa0a753d5a3/watchfiles-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a711b51aec4370d0dcda5b6c09463206f133a5759341d7744b953a7b62e1100e", size = 456858, upload-time = "2026-05-18T04:30:30.182Z" }, + { url = "https://files.pythonhosted.org/packages/50/57/1bc8c27fad7e6c19bddee15d276dbb6ab72480ec01c127afff1673aee417/watchfiles-1.2.0-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:e2ca07fa7d89195ec0865d3d285666286740bfa83d83e5cee204043a31ecc165", size = 467579, upload-time = "2026-05-18T04:32:15.897Z" }, + { url = "https://files.pythonhosted.org/packages/09/6c/3c2e44edba3553c5e3c3b8c8a2a6dee6b9e12ae2cf4bd2378bebf9dc3038/watchfiles-1.2.0-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e0618518f282c4ebff60f5e5b1247b6d91bb8b9f4476947563a1e74acc66f3c6", size = 633253, upload-time = "2026-05-18T04:31:37.123Z" }, + { url = "https://files.pythonhosted.org/packages/30/c2/d8c84a882ab39bbefcc4915ab3e91830b7a7e990c5570b0b69075aba3faf/watchfiles-1.2.0-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:0d191c054d0715c3c95c99df9b8dbf6fd096d8c1e021e8f212e1bd8bc444ccb5", size = 660713, upload-time = "2026-05-18T04:31:24.62Z" }, + { url = "https://files.pythonhosted.org/packages/a9/07/f97736a5fc605364fe67b25e9fa4a6965dfd4840d50c406ada507e9d735f/watchfiles-1.2.0-cp311-cp311-win32.whl", hash = "sha256:9342472aff9b093c5acd4f6d8f70ae0937964ab56542502bcf5579782da69ae8", size = 277222, upload-time = "2026-05-18T04:31:21.131Z" }, + { url = "https://files.pythonhosted.org/packages/cf/99/2b04981977fc2608afd60360d928c6aecf6b950292ca221d98f4005f6694/watchfiles-1.2.0-cp311-cp311-win_amd64.whl", hash = "sha256:dbd6c97045dad81227c8d040173da044c1de08de64a5ea8b555da4aee1d5fa22", size = 290274, upload-time = "2026-05-18T04:31:45.966Z" }, + { url = "https://files.pythonhosted.org/packages/3c/74/f7f58a7075ee9cf612b0cfcddb78b8cd8234f0742d6f0075cf0da2dde1c6/watchfiles-1.2.0-cp311-cp311-win_arm64.whl", hash = "sha256:57a2d9fa4fb4c2ecae57b13dfff2c7ab53e21a2ba674fe9f05506680fcdcc0d7", size = 283460, upload-time = "2026-05-18T04:31:39.126Z" }, + { url = "https://files.pythonhosted.org/packages/b8/2f/e42c992d2afda3108ea1c02acecc991b9f31d05c14adc2a7cee9ee211fc4/watchfiles-1.2.0-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:bc13eb17538be00c874699dc0abe4ee2bc8d50bb1166a6b9e175ef3fd7eb8f26", size = 400115, upload-time = "2026-05-18T04:32:02.06Z" }, + { url = "https://files.pythonhosted.org/packages/5f/8f/6af2ea19065c91d8b0ea3516fdfc8c0d349f407e8e9fbf4e5a17360de8ad/watchfiles-1.2.0-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:2d95ddc1eb6914154253d239089900813f6a767e174b8e6a50e7fdacb7e4236c", size = 393659, upload-time = "2026-05-18T04:30:50.951Z" }, + { url = "https://files.pythonhosted.org/packages/13/01/b32a967c56fb3e3e5be3db52c3d3b87fa4513aa367d8ed1ad96d42952e5f/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8f70d8b291ef6e88d19b1f297a6905ddb978888d9272b0d05e6f53309856bcfc", size = 453207, upload-time = "2026-05-18T04:31:04.231Z" }, + { url = "https://files.pythonhosted.org/packages/04/98/97557a812180338cb1abd32e1cffcc4588f59b5f23e0cb006b2ba95ba64a/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:56d8641cf834c2836922899105bd3ce3d0dfc69291d52edf0b4d0436829b34c0", size = 459273, upload-time = "2026-05-18T04:31:50.377Z" }, + { url = "https://files.pythonhosted.org/packages/e8/a8/b4b08dcb7653b8087c6586f7ce649505900e866bbcfe40dc9587af02e686/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:2581a94056e55d7d0a31a823ea92bf73749c489ca2285bfdc0fbe6b2bb49d50c", size = 489927, upload-time = "2026-05-18T04:31:42.485Z" }, + { url = "https://files.pythonhosted.org/packages/50/94/3dceea03545d2e5ddfd839f0ddd5e1cecbf1697b5a428d5ba11cef6af95d/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:41bc1199f7523b3f82843c88cbb979180c949caef0342cf90968f178e5d49b01", size = 570476, upload-time = "2026-05-18T04:31:03.071Z" }, + { url = "https://files.pythonhosted.org/packages/cc/f2/d39a5450c3532092b91f81d274360e613c2371bc874a89c7a1a3c5e8d138/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:7571e4464cb6e434958f867f7f730b8ab0b75e3f8e5eac0499168486ab3c33a8", size = 465650, upload-time = "2026-05-18T04:30:12.701Z" }, + { url = "https://files.pythonhosted.org/packages/22/24/ed72f68cbc1333ca9b9f2200aa048bb6658ae41709bc1caad4310f4bdffd/watchfiles-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e53a384f76b631c3ae5334ce6a52f0baa3a911eb94a4eac7f160079868b716d5", size = 456398, upload-time = "2026-05-18T04:30:13.784Z" }, + { url = "https://files.pythonhosted.org/packages/0d/64/982ef4a4e5bab5b6e5b6becc8cd5e732f6130a78b855f0abec6439a9a135/watchfiles-1.2.0-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:d20029a60a71a052a24c4db7673bc4de39ab89adbaccbfb5d67987c5d73f424d", size = 465140, upload-time = "2026-05-18T04:31:52.111Z" }, + { url = "https://files.pythonhosted.org/packages/a0/0c/95282abf4ed680b6096010bcfc30c5fa7a041fc5aa5a2ad17a2cc6c75bba/watchfiles-1.2.0-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:2cb93af48550faf1cea04c303107c8b75833de7013e57ce27d3b8d21d8d0f58c", size = 630259, upload-time = "2026-05-18T04:31:25.676Z" }, + { url = "https://files.pythonhosted.org/packages/30/45/607c1de1530c4bdcf2cf1d1ecc2505ddba5d96bd43ba9f2b0e79876f850f/watchfiles-1.2.0-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:2995c176de7692b86a2e4c58d9ec718f753150a979cb4a754e2b4ffa38e70906", size = 659859, upload-time = "2026-05-18T04:30:24.333Z" }, + { url = "https://files.pythonhosted.org/packages/fa/08/d9e2e0f9e8e6791d33aefc694ad7eefa7f901f63caff84a81ded38692f9c/watchfiles-1.2.0-cp312-cp312-win32.whl", hash = "sha256:7a2cffd17d27d2ecbb310c2b1d8174f222a5495b1a721894afa88ec11e25b898", size = 275480, upload-time = "2026-05-18T04:30:31.307Z" }, + { url = "https://files.pythonhosted.org/packages/1c/e6/9d42569c0102645cc8cea5d8c7d8a1e9d4ada2cb7f05f75e554b8aa2202a/watchfiles-1.2.0-cp312-cp312-win_amd64.whl", hash = "sha256:f155b3a1b2a5fc89cdc70d47ee5d54e3b75e88efa34982028a35daef9ba00379", size = 288718, upload-time = "2026-05-18T04:32:10.745Z" }, + { url = "https://files.pythonhosted.org/packages/0a/26/88e0dc6ee3898169d7fa22bb6a69cabf2502d2ee25cb8c876d1262d204f8/watchfiles-1.2.0-cp312-cp312-win_arm64.whl", hash = "sha256:8fa585ede612ee9f9e91b18bebf9ba11b9ae29a4e3a0d0cf6fca3e382133f0d5", size = 281026, upload-time = "2026-05-18T04:30:22.23Z" }, + { url = "https://files.pythonhosted.org/packages/23/f4/7513ef1e85fc4c6331b59479d6d72661fc391fbe543678052ac72c8b6c19/watchfiles-1.2.0-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:4674d49eb94706dfe666c069fc0a1b646ffcf920473492e209f6d5f60d3f0cc2", size = 403050, upload-time = "2026-05-18T04:30:36.753Z" }, + { url = "https://files.pythonhosted.org/packages/27/0b/a54103cfd732bb703c7a749222011a0483ef3705948dae3b203158601119/watchfiles-1.2.0-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:094b9b70103d4e963499bdea001ee3c2697b144cd9ae6218a62c0f89ec9e31db", size = 396629, upload-time = "2026-05-18T04:32:03.268Z" }, + { url = "https://files.pythonhosted.org/packages/5e/2c/73f31a3b893886206c3f54d73e8ad8dee58cdb2f69ad2622e0a8a9e07f4e/watchfiles-1.2.0-pp311-pypy311_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b0ef001f8c25ad0fa9529f914c1600647ecd0f542d11c19b7894768c67b6acb7", size = 457318, upload-time = "2026-05-18T04:31:01.932Z" }, + { url = "https://files.pythonhosted.org/packages/e9/f9/45d021e4a5cc7b9dd567f7cbb06d3b75f751a690063fb6cc7ec60f4e46b7/watchfiles-1.2.0-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a88fc94e647bc4eec523f1caa540258eb71d14278b9daf72fa1e2658a98df0f0", size = 457771, upload-time = "2026-05-18T04:30:56.331Z" }, +] + +[[package]] +name = "wcwidth" +version = "0.8.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/36/57/ed58088fafdf4c55a0ad6bde846502567645424d7ebf325230b9237f4085/wcwidth-0.8.3.tar.gz", hash = "sha256:d128512515fbf4612e0ff21fd6380399210318b7b54a9af59dff8454cf9730eb", size = 1458450, upload-time = "2026-08-28T18:10:06.875Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/c4/0e/57f6bb3024a597b2e8ec4aee710ffe62ddc95af2e2bb1ee7a7abdc22c68c/wcwidth-0.8.3-py3-none-any.whl", hash = "sha256:d5b73dba6158a595ec9370350e7f2637bcac8d6c5e4fde34f30fcffb6103a5e4", size = 331669, upload-time = "2026-08-28T18:10:04.909Z" }, +] + +[[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/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" }, +] + +[[package]] +name = "zipp" +version = "4.1.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/b9/d8/eab98a517c14134c0b2eb4e2387bc5f457334293ec5d2dd3857ec2966802/zipp-4.1.0.tar.gz", hash = "sha256:4cb57381f544315db7688e976e922a2b18cdb513d21cc194eb42232ba2a3e602", size = 26214, upload-time = "2026-05-18T20:08:57.967Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3a/13/547360d81e6d88d58492968ffda9f9542854f11310ee556fef14260cc886/zipp-4.1.0-py3-none-any.whl", hash = "sha256:25ad4e16390cd314347dd8f1de67a2ac538ae658ed4ab9db16029c07c188e97f", size = 10238, upload-time = "2026-05-18T20:08:57.045Z" }, +] diff --git a/harbor/sources/archives/aioftp-v11.tar.gz b/harbor/sources/archives/aioftp-v11.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..67ef766f01da1ad0f3199027d732258f4fd779bc --- /dev/null +++ b/harbor/sources/archives/aioftp-v11.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1895ed12246b0256d2bbc9368415967403638236132865c097a56d591b19d67b +size 188416 diff --git a/harbor/sources/archives/apscheduler-v17.tar.gz b/harbor/sources/archives/apscheduler-v17.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..814e5fe50619323a0d0d53dcf1b68b8e4588498d --- /dev/null +++ b/harbor/sources/archives/apscheduler-v17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f0fac3c28154c8042b2b8a01b2441a9a83eb8556424060fba860dbec19281586 +size 198850 diff --git a/harbor/sources/archives/coredns-v4.tar.gz b/harbor/sources/archives/coredns-v4.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b9043cd7eaabdd00bb38a066ff5c11c45ba64c83 --- /dev/null +++ b/harbor/sources/archives/coredns-v4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f3e54c704918dc7b5043354e24681e708f15164f4069f857d4abf9de0faf796d +size 19866 diff --git a/harbor/sources/archives/mikro-orm-v7.tar.gz b/harbor/sources/archives/mikro-orm-v7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..555a9303c77c01d4d1ba10d874a0bd4340126b68 --- /dev/null +++ b/harbor/sources/archives/mikro-orm-v7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8031b2f407a804aa05ef75b76e91f8e6c194db01614878e49f41967128e9062b +size 173710 diff --git a/harbor/sources/archives/zod-v7.tar.gz b/harbor/sources/archives/zod-v7.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..7c9cd93df1e8f842b877394d247a0a6b8ec76672 --- /dev/null +++ b/harbor/sources/archives/zod-v7.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:feb1e6acfc057e95a3a89532cb7f322f2c08f6bfea65556d66a04ceca877a5bc +size 240266 diff --git a/harbor/sources/babylonjs-v8/Dockerfile.hud b/harbor/sources/babylonjs-v8/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..6a592ed34428d303c6b213b3b043a8cfb955df72 --- /dev/null +++ b/harbor/sources/babylonjs-v8/Dockerfile.hud @@ -0,0 +1,273 @@ +# Babylon.js — taking things out of the scene leaves them in its passes, on the coding-template. +# +# Substrate: https://github.com/BabylonJS/Babylon.js at the pinned commit (history +# vaulted at task setup by coding/repo.py), Node 22 + npm workspaces, CPython, +# hud serve. Everything answer-key-shaped lives under /hud (root, mode 700): the +# vault, the hidden spec and its vitest configuration, the pristine copies the +# gate compares against, the control diffs and gold.diff. Agent shells drop to +# uid 1000 (setpriv), so /hud is unreadable from the agent side. +# +# The network is used only while this image builds (the npm install). Grading +# afterwards is hermetic: NullEngine, no GPU, no server, no clock any verdict +# depends on, no RNG, no LLM and no judge of any kind. +# +# The dependency tree is the repository's own package-lock.json, installed with +# `npm ci --ignore-scripts`; the repository's `prepare` steps that the unit +# suite needs (the build tools and the generated shader sources) are then run +# explicitly. Their output is gitignored, so `git status` stays clean. +# +# There is exactly ONE checkout: calibration produces every variant IN PLACE +# (calibrate.py: git apply, grade, revert). The only things frozen out of the +# pristine tree are every file under the core package's unit test directory, +# the path aliases (tsconfig.json) and the vitest setup file — the grader's +# whole oracle for the gate and for loading the hidden cells. +# +# THE IMAGE DOES NOT EXIST UNLESS IT IS CALIBRATED. Calibration grades the +# reference solution, the untouched checkout, a comment-only change and every +# recorded control with the real grader, and fails the build unless each earns +# exactly the reward written down for it. + +FROM python@sha256:782412e85d0f0984994c290652577d4018aff08145c85b262bb63dc0c7522254 + +ARG REPO_URL=https://github.com/BabylonJS/Babylon.js +ARG REPO_SHA=5c0c12d93845c42f792030c537c4579e00190d47 +ARG NODE_VERSION=22.20.0 +ARG NPM_VERSION=11.20.0 +# full = gold + base + noop AND every recorded control diff, each asserted to +# the exact reward calibrate.py says it earns +# smoke = the cells of gold + base + noop, and the gate once on gold, for a +# remote builder with a short wall +ARG CALIB_MODE=full + +# util-linux: setpriv, the privilege wall for agent shells. +# procps: `ps`/`top`. E-3 — diagnosing a container OOM without a process table +# is guesswork. xz-utils: unpacking the Node tarball. +RUN apt-get update && apt-get install -y --no-install-recommends \ + git curl ca-certificates util-linux patch procps xz-utils \ + && rm -rf /var/lib/apt/lists/* + +# E-3: /tmp sticky and world-writable. An agent shell at uid 1000 with no +# writable /tmp fails in ways that read as the task being impossible. +RUN install -d -m 1777 /tmp + +# TWO INTERPRETERS, on purpose. +# /opt/hudvenv — the env process: hud pinned to the SAME version the runner +# uses (E-3; a skew between image and runner killed SSH). +# /opt/agentvenv — the agent's interpreter: no hud, no platform credentials. +RUN python -m venv /opt/hudvenv \ + && /opt/hudvenv/bin/pip install --no-cache-dir "hud==0.6.15" "pytest==8.3.4" +RUN python -m venv /opt/agentvenv \ + && /opt/agentvenv/bin/pip install --no-cache-dir "pytest==8.3.4" + +ENV PATH=/opt/hudvenv/bin:$PATH + +# ── Node toolchain ───────────────────────────────────────────────────────── +# node, npm and npx are linked into /usr/local/bin, which is on the PATH +# Debian's /etc/profile assigns to every LOGIN shell. That matters twice: hud's +# BashGrader runs `/bin/bash -lc`, and an agent session is `env -i ... bash -l`; +# both throw the image's ENV PATH away. The guard below asserts it from inside a +# login shell rather than trusting it. The repository asks for npm 11. +RUN set -eux; \ + arch="$(dpkg --print-architecture)"; \ + case "$arch" in \ + amd64) nodearch=x64 ;; \ + arm64) nodearch=arm64 ;; \ + *) echo "unsupported arch $arch" >&2; exit 1 ;; \ + esac; \ + curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${nodearch}.tar.xz" \ + -o /tmp/node.txz; \ + mkdir -p /usr/local/node; \ + tar -C /usr/local/node --strip-components=1 -xJf /tmp/node.txz; \ + rm /tmp/node.txz; \ + for b in node npm npx; do ln -sf "/usr/local/node/bin/$b" "/usr/local/bin/$b"; done; \ + npm install -g --no-fund --no-audit "npm@${NPM_VERSION}"; \ + for b in npm npx; do ln -sf "/usr/local/node/bin/$b" "/usr/local/bin/$b"; done; \ + rm -rf /root/.npm /tmp/node-compile-cache; \ + bash -lc 'command -v node && command -v npm && node --version && npm --version' \ + | tee /dev/stderr | grep -qx "${NPM_VERSION}" + +ENV NODE_OPTIONS=--max-old-space-size=4096 \ + REPO_DIR=/workspace/repo VAULT_DIR=/hud/vault GRADING_LOGS_DIR=/hud/logs \ + GOLD_DIFF=/hud/gold.diff GRADER_DIR=/hud/grader BASE_SRC=/hud/base-src + +# ── 1. substrate repo at the pinned commit ───────────────────────────────── +RUN set -eux; \ + install -d -m 700 /hud /hud/vault /hud/logs /hud/grader; \ + install -d -m 755 /workspace; \ + git init -q /workspace/repo; \ + cd /workspace/repo; \ + git remote add origin "$REPO_URL"; \ + git fetch -q --depth 1 origin "$REPO_SHA"; \ + git checkout -q FETCH_HEAD; \ + git checkout -q -b main; \ + test "$(git rev-parse HEAD)" = "$REPO_SHA"; \ + git remote remove origin; \ + git config --system user.email "dev@localhost"; \ + git config --system user.name "dev"; \ + git config --system --add safe.directory /workspace/repo; \ + git config --system gc.auto 0 + +# ── 2. install the workspace (the only step that needs the network) ──────── +# As uid 1000 from the start, so the ~1.2 GB of node_modules the agent will use +# are its own without a chown that would copy every file into another layer. +# `npm ci --ignore-scripts` from the committed lock; then the two `prepare` +# steps the unit suite depends on: the build tools, and the shader sources the +# engine imports (generated from the .fx files, gitignored). +RUN set -eux; \ + chown -R 1000:1000 /workspace/repo; \ + install -d -o 1000 -g 1000 /tmp/build-home; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/local/bin:/usr/bin:/bin HOME=/tmp/build-home \ + bash -c 'set -eux -o pipefail; cd /workspace/repo; \ + npm ci --ignore-scripts --no-fund --no-audit --loglevel=error 2>&1 | tail -n 5; \ + npm run build:tools 2>&1 | tail -n 3; \ + npm rebuild @dev/build-tools 2>&1 | tail -n 2; \ + npm run build:assets 2>&1 | tail -n 3; \ + test -f node_modules/vitest/vitest.mjs; \ + test -f packages/dev/core/src/Shaders/shadowMap.fragment.ts; \ + test -f packages/dev/core/src/Shaders/default.vertex.ts'; \ + rm -rf /tmp/build-home; \ + cd /workspace/repo; git status --porcelain | tee /tmp/dirty; test ! -s /tmp/dirty; rm -f /tmp/dirty + +# ── 3. /hud: everything the agent must never read ────────────────────────── +COPY task/grader/ /hud/grader/ +COPY task/gold.diff /hud/gold.diff +# calibrate.py reads GRADERS / BLOCKER_CAP / GATE / CONDITIONAL_BLOCKERS out of +# tasks.py by AST — that file is the one place the scoreboard is written down — +# so it sits in the grader tree as well as beside hud serve. +COPY tasks.py /hud/grader/tasks.py +COPY calibrate.py /hud/calibrate.py + +# ── 4. the gate's oracle, frozen from the UNTOUCHED tree ─────────────────── +# Every file the repository ships under the core package's unit test directory +# (byte equality is half of the gate), the path aliases and the vitest setup +# file (the grader loads the cells and the suite with THESE copies, so editing +# the workspace's own changes nothing), and the list of the core package's own +# unit suites at the pin. +RUN set -eux; \ + install -d -m 700 /hud/base-src /hud/base-src/tests; \ + cd /workspace/repo; \ + git ls-files -z packages/dev/core/test/unit | xargs -0 cp --parents -t /hud/base-src/tests; \ + cp tsconfig.json /hud/base-src/tsconfig.pristine.json; \ + cp vitest.setup.ts /hud/base-src/vitest.setup.ts; \ + git ls-files 'packages/dev/core/test/unit/*.test.ts' 'packages/dev/core/test/unit/*.test.tsx' \ + | sort > /hud/base-src/suite.txt; \ + find /hud/base-src/tests -type f | wc -l; \ + wc -l < /hud/base-src/suite.txt; \ + test "$(wc -l < /hud/base-src/suite.txt)" -eq 231; \ + test "$(find /hud/base-src/tests -type f | wc -l)" -eq 239 + +# ── 5. prove the grader before anyone runs it ────────────────────────────── +# It has to STREAM: `hud deploy` watches the remote build over a websocket and +# a silent step looks dead. +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -eux; \ + echo "builder: nproc=$(nproc) MemTotal=$(awk '/MemTotal/{print $2}' /proc/meminfo)kB"; \ + echo "calibration mode: ${CALIB_MODE}"; \ + case "${CALIB_MODE}" in full|smoke|none) ;; \ + *) echo "unknown CALIB_MODE=${CALIB_MODE}" >&2; exit 2 ;; esac; \ + mkdir -p /hud/logs /hud/grader/data; \ + if [ "${CALIB_MODE}" != none ]; then \ + ( while sleep 60; do echo " ... calibration still running ($(date -u +%H:%M:%S)) ..."; done ) & \ + hb=$!; trap "kill $hb 2>/dev/null || true" EXIT; \ + MODEFLAG="--controls"; [ "${CALIB_MODE}" = smoke ] && MODEFLAG="--smoke"; \ + CALIB_STATE=/hud/logs/calib /usr/local/bin/python3 -u /hud/calibrate.py --repo /workspace/repo \ + --base-src /hud/base-src ${MODEFLAG} 2>&1 | tee /hud/grader/data/calibration.txt; \ + kill $hb 2>/dev/null || true; \ + grep -q '^CALIBRATION OK' /hud/grader/data/calibration.txt; \ + if [ "${CALIB_MODE}" = full ]; then \ + grep -q '^| \*\*gold\*\* | \*\*1.0000\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*base\*\* | \*\*0.0000\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*noop\*\* | \*\*0.0000\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*lazy\*\* | \*\*0.1500\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*w1\*\* | \*\*0.6000\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*alt\*\* | \*\*0.8500\*\*' /hud/grader/data/calibration.txt; \ + grep -q '^| \*\*cheat\*\* | \*\*0.5700\*\*' /hud/grader/data/calibration.txt; \ + else \ + grep -q '^SMOKE GATE OK' /hud/grader/data/calibration.txt; \ + fi; \ + else \ + echo "CALIB_MODE=none: grader NOT calibrated in this image" > /hud/grader/data/calibration.txt; \ + fi; \ + bash /hud/grader/run_grading.sh cleanup || true; \ + rm -rf /hud/grader/__pycache__ /hud/grader/*/__pycache__ /hud/logs/grading-state /hud/logs/calib; \ + cd /workspace/repo && git status --porcelain | tee /tmp/dirty; test ! -s /tmp/dirty; rm -f /tmp/dirty + +# ── 6. E-5: sweep the build's own leftovers, then prove the agent can work ── +# Everything above ran as root and may have left scratch in /tmp that uid 1000 +# cannot touch; an agent told to run the tests would hit EACCES and read it as +# the task being impossible. /tmp is rebuilt, the checkout is handed to uid 1000 +# (node_modules already is), and then the core package's WHOLE unit suite is +# asserted UNDER uid 1000, in the same `env -i ... bash -lc` shell hud hands the +# agent, with exactly the command the workspace note gives. If an agent could +# not do that, the image does not exist. +# +# v4 deploy repair (29.09): the full output goes to a file, the failing test +# NAMES are printed (the old `tail -n 8` hid them), and a red run is given one +# more chance file by file — each red file (at most six) is run again ALONE +# with the same command; a tree or an environment that is really broken is red +# alone as well. Two remote builds (nproc=8) came back with one red test out of +# 3821 that no local run (x12, 8-16 cpus, under contention) reproduced. +RUN set -eux; \ + rm -rf /tmp/vitest-* /tmp/bjs-grading-* /tmp/dirty /tmp/node.txz /tmp/node-compile-cache; \ + install -d -m 1777 /tmp; \ + mkdir -p /tmp/agent-home; \ + find /workspace/repo -path '*/node_modules' -prune -o ! -user 1000 -exec chown -h 1000:1000 {} +; \ + chown -R 1000:1000 /workspace/repo/node_modules/.vite 2>/dev/null || true; \ + chown 1000:1000 /tmp/agent-home; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/local/bin:/usr/bin:/bin \ + HOME=/tmp/agent-home TERM=xterm \ + bash -lc 'set -eux; cd /workspace/repo; node --version; npm --version; \ + test -r /hud/gold.diff && exit 91; \ + touch /workspace/repo/packages/dev/core/src/.w && rm /workspace/repo/packages/dev/core/src/.w; \ + rc=0; npx vitest run --project=unit packages/dev/core/test/unit > /tmp/agent-suite.txt 2>&1 || rc=$?; \ + sed -E "s/\x1b\[[0-9;]*m//g" /tmp/agent-suite.txt > /tmp/agent-suite.plain; \ + grep -E "^ *(Test Files|Tests|Duration) " /tmp/agent-suite.plain; \ + grep -qE "Test Files .*\(231\)" /tmp/agent-suite.plain; \ + if [ "$rc" -eq 0 ] && grep -qE "Test Files +231 passed" /tmp/agent-suite.plain; then exit 0; fi; \ + echo "E-5: the suite came back red (exit $rc) under uid 1000; red tests:"; \ + grep -E "^ *(FAIL|×) " /tmp/agent-suite.plain | head -40; \ + grep -E -A25 "^ *FAIL .*\.test\.tsx? >" /tmp/agent-suite.plain | head -120; \ + red=$(grep -oE "(FAIL|❯|×) +(unit +)?packages/dev/core/test/unit/[^ ]+\.test\.tsx?" /tmp/agent-suite.plain | grep -oE "packages/dev/core/test/unit/[^ ]+\.test\.tsx?" | sort -u); \ + n=$(printf "%s\n" $red | grep -c . || true); \ + echo "E-5: red files: $n"; \ + [ "$n" -ge 1 ] || { echo "E-5: red run but no red file recognised"; exit 1; }; \ + [ "$n" -le 6 ] || { echo "E-5: more than six red files"; exit 1; }; \ + for f in $red; do \ + echo "E-5: rerun alone: $f"; \ + rc2=0; npx vitest run --project=unit "$f" > /tmp/agent-rerun.txt 2>&1 || rc2=$?; \ + sed -E "s/\x1b\[[0-9;]*m//g" /tmp/agent-rerun.txt > /tmp/agent-rerun.plain; \ + if [ "$rc2" -ne 0 ]; then tail -n 60 /tmp/agent-rerun.plain; exit 1; fi; \ + grep -E "^ *(Test Files|Tests) " /tmp/agent-rerun.plain; \ + grep -qE "Test Files +1 passed" /tmp/agent-rerun.plain; \ + done; \ + echo "E-5 SUITE OK: red only in the parallel run, green alone: $red"'; \ + rm -rf /tmp/vitest-* /tmp/agent-suite.txt /tmp/agent-suite.plain /tmp/agent-rerun.txt /tmp/agent-rerun.plain /tmp/agent-home /tmp/node-compile-cache; \ + find /tmp -mindepth 1 -maxdepth 1 -print; \ + test -z "$(find /tmp -mindepth 1 -user 0 -print | head -1)"; \ + install -d -m 1777 /tmp; \ + mkdir -p /tmp/agent-home; \ + chown 1000:1000 /tmp/agent-home; \ + test -z "$(find /workspace/repo -path '*/node_modules' -prune -o ! -user 1000 -print | head -1)"; \ + cd /workspace/repo && git status --porcelain | tee /tmp/dirty2; test ! -s /tmp/dirty2; \ + rm -f /tmp/dirty2 + +# ── 7. lock it down ──────────────────────────────────────────────────────── +RUN chown -R root:root /hud && chmod -R 700 /hud + +WORKDIR /app +COPY env.py tasks.py pyproject.toml /app/ +COPY coding/ /app/coding/ +COPY task/prompt.md /app/task/prompt.md +RUN chmod 600 /app/tasks.py + +# Provenance the IMAGE prints about itself: what the deploy log shows is what +# actually shipped, not what the local working copy happened to contain. +RUN sha256sum /app/task/prompt.md /hud/gold.diff /app/tasks.py /app/env.py \ + /hud/grader/run_grading.sh /hud/grader/harness/cells.test.ts \ + /hud/grader/harness/vitest.hud.mjs /workspace/repo/package-lock.json + +# CMD is NOT inherited: without this the container starts a bare python and +# DockerRuntime hangs on `docker port` with an unhelpful timeout. +CMD ["hud", "serve", "tasks.py", "--host", "0.0.0.0"] diff --git a/harbor/sources/babylonjs-v8/calibrate.py b/harbor/sources/babylonjs-v8/calibrate.py new file mode 100644 index 0000000000000000000000000000000000000000..e7cae411b9c6e8a368a37928d887f3ebef82dc44 --- /dev/null +++ b/harbor/sources/babylonjs-v8/calibrate.py @@ -0,0 +1,306 @@ +#!/usr/bin/env python3 +"""Calibration for the Babylon.js "taking things out of the scene" task. + + python3 calibrate.py gold base noop # the three invariants + python3 calibrate.py --controls # + every recorded control tree + python3 calibrate.py --smoke # cells of gold/base/noop, gate once + python3 calibrate.py --repo /path/to/Babylon.js --base-src /path/to/base-src --criteria a,b + +It grades a tree the way tasks.py does: every criterion of run_grading.sh in +table order, the core first; the conditional blockers (the four rules and the +gate) are handed CORE_GREEN exactly as tasks.py hands it (1 if a cell of the +core came out green, else 0) and fail by themselves beside a dead core; then +the weights read out of tasks.py and the flat blocker cap. + +There is exactly ONE checkout. node_modules is ~1.2 GB, so every variant is +produced IN PLACE by `git apply` on the pristine checkout and taken away again +afterwards (git clean without -x: node_modules and other ignored output stay). + +Invariants, all hard: + + gold -> 1.0000 every criterion green on the reference solution + base -> 0.0000 the untouched checkout + base -> red on EVERY cell of the core, one by one + noop -> 0.0000 a comment-only change + +and, with --controls, every recorded control tree earns exactly the reward +written below — a prediction made before the build, which fails when the board +stops agreeing with it. + +The weights table is read from tasks.py by AST, never imported (tasks.py pulls +in the platform SDK and this has to run anywhere). +""" + +from __future__ import annotations + +import argparse +import ast +import json +import os +import subprocess +import time +from pathlib import Path + +HERE = Path(__file__).resolve().parent +GRADER = Path(os.environ.get("CALIB_GRADER_DIR") or (HERE / "grader")) +if not GRADER.exists(): + GRADER = HERE / "task" / "grader" +GOLD = Path(os.environ.get("CALIB_GOLD") or "/hud/gold.diff") +if not GOLD.exists(): + GOLD = HERE / "task" / "gold.diff" +CONTROLS = GRADER / "controls" +STATE_ROOT = Path(os.environ.get("CALIB_STATE") or "/hud/logs/calib") + +# A comment-only change: it must apply to the pristine tree and mean nothing. +NOOP_FILE = "packages/dev/core/src/scene.pure.ts" +NOOP_LINE = "// a comment, and nothing else\n" + +EXPECT = {"gold": "1.0000", "base": "0.0000", "noop": "0.0000"} +# The controls, recorded wrong (and one right) answers: +# lazy the dispose() cleanup copied into removeMesh: lights' include/exclude +# lists and shadow render lists spliced, nothing remembered (24 lines) +# w1 the natural consumer-side fix: every render list filtered by "is the +# mesh still in scene.meshes", custom render targets and procedural +# textures filtered by "is the texture still in scene.textures" — takes +# every core cell and stops drawing a helper kept out of the scene +# alt a different correct fix, written apart from the gold: removal parks +# meshes out of every render target's and object renderer's list (every +# entry of a mesh listed twice) and textures out of the custom-render- +# target lists of the scene and of every camera, those out of the scene +# included, and out of the procedural list; adding puts them back +# cheat removed meshes made invisible, made visible again when added back +# v4 (CELLS round bc4): alt restores every parked entry of a mesh listed twice (a list the mesh was put into +# meanwhile excepted) at its saved index -- which, for two neighbours unloaded together, puts them back +# in the reverse order: it misses put_back_meshes_are_drawn_in_their_former_order (0.15) and keeps 0.85 +CONTROL_EXPECT = {"lazy": "0.1500", "w1": "0.6000", "alt": "0.8500", "cheat": "0.5700"} + + +def _tasks_src() -> str: + for p in (GRADER / "tasks.py", HERE / "tasks.py"): + if p.exists(): + return p.read_text() + raise SystemExit("no tasks.py beside calibrate.py or in the grader tree") + + +def load_table(): + tree = ast.parse(_tasks_src()) + out = {} + for node in tree.body: + if not isinstance(node, ast.Assign): + continue + for t in node.targets: + name = getattr(t, "id", None) + if name in ("GRADERS", "BLOCKER_CAP", "GATE", "GATE_TIMEOUT", "CONDITIONAL_BLOCKERS"): + out[name] = ast.literal_eval(node.value) + for k in ("GRADERS", "BLOCKER_CAP", "GATE", "CONDITIONAL_BLOCKERS"): + if k not in out: + raise SystemExit(f"could not read {k} out of tasks.py") + total = sum(w for _n, w, _b, _k, _t in out["GRADERS"]) + if abs(total - 1.0) > 1e-9: + raise SystemExit(f"weights sum to {total}, not 1.0") + return out + + +TABLE = load_table() +GRADERS = TABLE["GRADERS"] +CAP = TABLE["BLOCKER_CAP"] +GATE = TABLE["GATE"] +CONDITIONAL = tuple(TABLE["CONDITIONAL_BLOCKERS"]) +CORE = [n for n, _w, _b, _k, _t in GRADERS if n not in CONDITIONAL] + + +def git(repo: Path, *args, check=True): + p = subprocess.run(["git", "-C", str(repo), *args], capture_output=True, text=True) + if check and p.returncode != 0: + raise SystemExit(f"git {' '.join(args)} failed:\n{p.stdout}\n{p.stderr}") + return p + + +def pristine(repo: Path): + git(repo, "checkout", "--", ".") + # -d but NOT -x: node_modules and the generated shader sources stay. + git(repo, "clean", "-fdq", "packages") + dirty = git(repo, "status", "--porcelain").stdout.strip() + if dirty: + raise SystemExit(f"the checkout will not come clean:\n{dirty}") + + +def make_variant(repo: Path, which: str): + pristine(repo) + if which == "base": + return + if which == "noop": + f = repo / NOOP_FILE + f.write_text(NOOP_LINE + f.read_text()) + return + patch = GOLD if which == "gold" else CONTROLS / f"{which}.diff" + if not patch.exists(): + raise SystemExit(f"no patch for variant {which} at {patch}") + p = subprocess.run(["git", "-C", str(repo), "apply", str(patch)], + capture_output=True, text=True) + if p.returncode != 0: + raise SystemExit(f"{which}: the patch does not apply:\n{p.stderr}") + if not git(repo, "status", "--porcelain").stdout.strip(): + raise SystemExit(f"{which}: the patch applied and changed nothing") + + +def run_criterion(repo: Path, base_src: Path, name: str, state: Path, budget: int, + core_green: bool | None): + env = dict(os.environ) + env.update({ + "REPO_DIR": str(repo), + "HARNESS_DIR": str(GRADER), + "GRADER_STATE_DIR": str(state), + "BASE_SRC": str(base_src), + }) + if core_green is not None: + env["CORE_GREEN"] = "1" if core_green else "0" + started = time.time() + p = subprocess.run(["bash", str(GRADER / "run_grading.sh"), name, str(budget)], + env=env, capture_output=True, text=True, timeout=budget + 300) + (state / f"{name}.log").write_text(p.stdout + "\n--- stderr ---\n" + p.stderr) + if p.returncode == 3: + raise SystemExit(f"GRADER FAULT in {name}:\n{p.stdout[-4000:]}\n{p.stderr[-2000:]}") + if name in CONDITIONAL and core_green is False: + # CORE_GREEN=0: the check must fail by itself, with no PASS line. + if p.returncode == 0 or any(l.startswith("PASS") for l in p.stdout.splitlines()): + raise SystemExit(f"{name}: paid, or printed PASS, beside a dead core:\n{p.stdout[-2000:]}") + if "not paid: no scored behaviour was fixed" not in p.stdout: + raise SystemExit(f"{name}: failed beside a dead core without saying why:\n{p.stdout[-2000:]}") + return p.returncode == 0, time.time() - started, p.stdout + + +def score(results: dict) -> tuple: + uncapped = sum(w for n, w, _b, _k, _t in GRADERS if results.get(n)) + failed = [n for n, _w, b, _k, _t in GRADERS if b and not results.get(n)] + reward = uncapped if not failed else max(0.0, min(uncapped, CAP)) + return round(reward, 4), round(uncapped, 4), failed + + +def calibrate(repo: Path, base_src: Path, which: str, criteria): + make_variant(repo, which) + state = STATE_ROOT / which + subprocess.run(["rm", "-rf", str(state)]) + state.mkdir(parents=True, exist_ok=True) + print(f"\n=== {which} ===", flush=True) + results = {} + core_measured, core_green = 0, False + for name, weight, blocker, _kind, budget in GRADERS: + if criteria and name not in criteria: + continue + cg = None + if name in CONDITIONAL: + cg = bool(core_green or core_measured == 0) + ok, took, out = run_criterion(repo, base_src, name, state, budget, cg) + results[name] = ok + if name in CORE: + core_measured += 1 + core_green = core_green or ok + flag = "blocker" if blocker else " " + cgs = "" if cg is None else f" CORE_GREEN={int(cg)}" + print(f" {'PASS' if ok else 'FAIL'} {name:<52} w={weight:.4f} {flag} {took:6.1f}s{cgs}", + flush=True) + reward, uncapped, failed = score(results) + print(f" -> uncapped {uncapped:.4f}, failed blockers {failed or 'none'}, reward {reward:.4f}") + print(f"REWARD {which} {reward:.4f}", flush=True) + pristine(repo) + return {"tree": which, "results": results, "reward": reward, "uncapped": uncapped} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("trees", nargs="*", default=None) + ap.add_argument("--repo", default=os.environ.get("CALIB_REPO", "/workspace/repo")) + ap.add_argument("--base-src", default=os.environ.get("BASE_SRC", "/hud/base-src")) + ap.add_argument("--criteria", default="") + ap.add_argument("--controls", action="store_true") + ap.add_argument("--smoke", action="store_true", + help="grade the cells of gold/base/noop and run the gate ONCE, on gold " + "(for a remote builder with a short wall)") + ap.add_argument("--json", default=os.environ.get("CALIB_JSON", "")) + args = ap.parse_args() + + repo, base_src = Path(args.repo), Path(args.base_src) + if not (repo / NOOP_FILE).exists(): + raise SystemExit(f"{repo} does not look like the Babylon.js checkout") + if not (base_src / "tests").is_dir() or not (base_src / "suite.txt").is_file(): + raise SystemExit(f"{base_src} holds no pristine tests tree / suite list") + criteria = [c for c in args.criteria.split(",") if c] + + if args.smoke: + cells = [n for n, *_ in GRADERS if n != GATE] + rows = [calibrate(repo, base_src, t, cells) for t in ["gold", "base", "noop"]] + by = {r["tree"]: r for r in rows} + bad = [] + missing = [n for n in cells if not by["gold"]["results"].get(n)] + if missing: + bad.append("gold: red cells " + ",".join(missing)) + for t in ("base", "noop"): + green = [n for n in CORE if by[t]["results"].get(n)] + if green: + bad.append(f"{t}: these cells pay for a change that fixes nothing: " + ",".join(green)) + print("\n=== gold, gate only ===") + make_variant(repo, "gold") + st = STATE_ROOT / "gate-smoke" + subprocess.run(["rm", "-rf", str(st)]) + st.mkdir(parents=True, exist_ok=True) + gate_ok, took, gate_out = run_criterion(repo, base_src, GATE, st, + dict((n, t) for n, _w, _b, _k, t in GRADERS)[GATE], True) + print(f" {'PASS' if gate_ok else 'FAIL'} {GATE} {took:6.1f}s") + if not gate_ok: + # v1b: the builder's log is the only place a red gate can be read. + for line in gate_out.splitlines()[-40:]: + print(" | " + line) + pristine(repo) + if not gate_ok: + bad.append("the gate is red on the reference solution") + if bad: + print("\nCALIBRATION FAILED") + for b in bad: + print(" - " + b) + raise SystemExit(1) + print("\nSMOKE GATE OK (full calibration proven in the local linux build)") + print("CALIBRATION OK") + return + + trees = list(args.trees) or ["gold", "base", "noop"] + if args.controls: + trees += [t for t in CONTROL_EXPECT if t not in trees] + rows = [calibrate(repo, base_src, t, criteria) for t in trees] + if criteria: + print("\npartial run (--criteria): nothing asserted") + return + + print("\n| tree | reward | expected |") + print("| --- | --- | --- |") + bad = [] + for r in rows: + want = EXPECT.get(r["tree"]) or CONTROL_EXPECT.get(r["tree"]) + got = f"{r['reward']:.4f}" + print(f"| **{r['tree']}** | **{got}** | {want or '-'} |") + if want is not None and got != want: + bad.append(f"{r['tree']}: {got} != {want}") + by = {r["tree"]: r for r in rows} + if "gold" in by and not all(by["gold"]["results"].get(n) for n, *_ in GRADERS): + bad.append("gold: not every criterion is green: " + + ",".join(n for n, *_ in GRADERS if not by["gold"]["results"].get(n))) + for t in ("base", "noop"): + if t in by: + green = [n for n in CORE if by[t]["results"].get(n)] + if green: + bad.append(f"{t}: these criteria pay for a change that fixes nothing: " + + ",".join(green)) + if args.json: + Path(args.json).write_text(json.dumps( + {"trees": [{"tree": r["tree"], "reward": r["reward"], "uncapped": r["uncapped"], + "results": r["results"]} for r in rows]}, indent=1)) + if bad: + print("\nCALIBRATION FAILED") + for b in bad: + print(" - " + b) + raise SystemExit(1) + print("\nCALIBRATION OK") + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/babylonjs-v8/coding/__init__.py b/harbor/sources/babylonjs-v8/coding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88280a271d88bae2eb437ca5e8c172120a66f336 --- /dev/null +++ b/harbor/sources/babylonjs-v8/coding/__init__.py @@ -0,0 +1,5 @@ +"""The coding environment's core: repo-lifecycle primitives and task flavors.""" + +from . import repo, swe_bench_pro + +__all__ = ["repo", "swe_bench_pro"] diff --git a/harbor/sources/babylonjs-v8/coding/github.py b/harbor/sources/babylonjs-v8/coding/github.py new file mode 100644 index 0000000000000000000000000000000000000000..d07288e5f438181af931b88982147e86ebd1c16f --- /dev/null +++ b/harbor/sources/babylonjs-v8/coding/github.py @@ -0,0 +1,158 @@ +"""A minimal mock GitHub for SDLC tasks. + +One in-process store holds issues (seeded per task) and the pull requests and +comments the agent creates; :func:`serve` publishes it as ``github_*`` MCP +tools over an ``mcp`` capability. The remote itself is a bare git repo on +disk (see :func:`coding.repo.create_remote`) — the agent pushes branches with +plain git and references them from pull requests here. +""" + +from __future__ import annotations + +import asyncio +import json +import socket +from dataclasses import asdict, dataclass, field +from typing import Any + +from fastmcp import FastMCP +from hud.capabilities import Capability + + +@dataclass +class Issue: + number: int + title: str + body: str + labels: list[str] = field(default_factory=list) + state: str = "open" + comments: list[str] = field(default_factory=list) + + +@dataclass +class PullRequest: + number: int + title: str + body: str + head: str + base: str + state: str = "open" + comments: list[str] = field(default_factory=list) + + +class MockGitHub: + """Issue/PR store with an action log (for rubric grading).""" + + def __init__(self) -> None: + self.issues: dict[int, Issue] = {} + self.pull_requests: dict[int, PullRequest] = {} + self.actions: list[dict[str, Any]] = [] + + def seed(self, issues: list[dict[str, Any]]) -> None: + """Reset the store to the task's fixtures.""" + self.issues = { + int(entry["number"]): Issue( + number=int(entry["number"]), + title=str(entry["title"]), + body=str(entry.get("body", "")), + labels=[str(label) for label in entry.get("labels", [])], + ) + for entry in issues + } + self.pull_requests = {} + self.actions = [] + + def _record(self, action: str, **details: Any) -> None: + self.actions.append({"action": action, **details}) + + # ─── operations (the tool surface) ──────────────────────────────── + + def list_issues(self) -> list[dict[str, Any]]: + return [asdict(issue) for issue in self.issues.values()] + + def get_issue(self, number: int) -> dict[str, Any]: + return asdict(self._issue(number)) + + def close_issue(self, number: int) -> dict[str, Any]: + issue = self._issue(number) + issue.state = "closed" + self._record("close_issue", number=number) + return asdict(issue) + + def comment_on_issue(self, number: int, body: str) -> dict[str, Any]: + issue = self._issue(number) + issue.comments.append(body) + self._record("comment_on_issue", number=number, body=body) + return asdict(issue) + + def create_pull_request(self, title: str, body: str, head: str, base: str) -> dict[str, Any]: + number = len(self.pull_requests) + 1 + pr = PullRequest(number=number, title=title, body=body, head=head, base=base) + self.pull_requests[number] = pr + self._record("create_pull_request", number=number, title=title, head=head) + return asdict(pr) + + def list_pull_requests(self) -> list[dict[str, Any]]: + return [asdict(pr) for pr in self.pull_requests.values()] + + def _issue(self, number: int) -> Issue: + if number not in self.issues: + raise ValueError(f"no such issue: #{number}") + return self.issues[number] + + # ─── grading views ──────────────────────────────────────────────── + + def latest_pull_request(self) -> PullRequest | None: + return next(reversed(self.pull_requests.values()), None) + + def transcript(self) -> str: + """Everything the agent did here, for rubric judging.""" + return json.dumps( + { + "issues": [asdict(issue) for issue in self.issues.values()], + "pull_requests": [asdict(pr) for pr in self.pull_requests.values()], + "actions": self.actions, + }, + indent=2, + ) + + +def serve(github: MockGitHub) -> tuple[asyncio.Task[None], Capability]: + """Serve *github* as ``github_*`` MCP tools; returns the server task + capability.""" + server: FastMCP = FastMCP(name="github") + + @server.tool + def github_list_issues() -> list[dict[str, Any]]: + """List all issues in the repository.""" + return github.list_issues() + + @server.tool + def github_get_issue(number: int) -> dict[str, Any]: + """Get one issue by number.""" + return github.get_issue(number) + + @server.tool + def github_close_issue(number: int) -> dict[str, Any]: + """Close an issue.""" + return github.close_issue(number) + + @server.tool + def github_comment_on_issue(number: int, body: str) -> dict[str, Any]: + """Add a comment to an issue.""" + return github.comment_on_issue(number, body) + + @server.tool + def github_create_pull_request(title: str, body: str, head: str, base: str = "main") -> dict[str, Any]: + """Open a pull request from branch *head* (already pushed to the remote) into *base*.""" + return github.create_pull_request(title, body, head, base) + + @server.tool + def github_list_pull_requests() -> list[dict[str, Any]]: + """List all pull requests.""" + return github.list_pull_requests() + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + port = int(sock.getsockname()[1]) + task = asyncio.create_task(server.run_async(transport="http", host="127.0.0.1", port=port, show_banner=False)) + return task, Capability.mcp(name="github", url=f"http://127.0.0.1:{port}/mcp") diff --git a/harbor/sources/babylonjs-v8/coding/repo.py b/harbor/sources/babylonjs-v8/coding/repo.py new file mode 100644 index 0000000000000000000000000000000000000000..bb675cf6f58da32de51e10bc71bdb1bc4b5057d9 --- /dev/null +++ b/harbor/sources/babylonjs-v8/coding/repo.py @@ -0,0 +1,172 @@ +"""Git-history vaulting and diff-based grading primitives. + +The repo's real ``.git`` may contain the answer key — solution branches, the +fix commit, the hidden tests. Every task flavor shares this lifecycle: + +- setup (:func:`vault_history`): snapshot the pre-agent worktree into the + real history, move ``.git`` into a vault outside the workspace, and leave a + fresh single-commit repo — git works normally for the agent, but there is + no history, no refs, and no remotes. +- grading (:func:`restore_history` → :func:`capture_agent_diff` → + :func:`reset_worktree` → :func:`apply_diff`): discard the agent's ``.git`` + (hooks and history included), restore the vaulted history, capture the + agent's changes as a diff against the setup snapshot, reset the worktree to + that snapshot, and re-apply the diff. Hidden tests come from vaulted refs + and land after the agent's diff. + +The snapshot covers the whole worktree, so installed dependencies and build +artifacts survive into grading. +""" + +from __future__ import annotations + +import asyncio +import os +import shutil +from pathlib import Path + +_GIT_ID = ("-c", "user.name=hud-grader", "-c", "user.email=grader@hud.ai") +_SETUP_COMMIT = "setup_commit" + + +async def run( + *argv: str, + cwd: Path, + timeout: float = 600.0, + check: bool = True, +) -> tuple[int, str, str]: + """Run a command, returning ``(returncode, stdout, stderr)``. Kills on timeout.""" + proc = await asyncio.create_subprocess_exec( + *argv, + cwd=str(cwd), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + try: + out_bytes, err_bytes = await asyncio.wait_for(proc.communicate(), timeout=timeout) + except TimeoutError: + proc.kill() + await proc.wait() + raise TimeoutError(f"{' '.join(argv[:4])} timed out after {timeout:.0f}s") from None + out = out_bytes.decode("utf-8", "replace") + err = err_bytes.decode("utf-8", "replace") + if check and proc.returncode != 0: + detail = (err.strip() or out.strip())[:2000] + raise RuntimeError(f"{' '.join(argv)} failed ({proc.returncode}): {detail}") + return proc.returncode if proc.returncode is not None else 1, out, err + + +async def git(repo: Path, *args: str, timeout: float = 600.0, check: bool = True) -> tuple[int, str, str]: + return await run("git", *_GIT_ID, *args, cwd=repo, timeout=timeout, check=check) + + +def _append_git_exclude(git_dir: Path) -> None: + """Keep the workspace's SSH credential dir out of snapshots and diffs.""" + exclude = git_dir / "info" / "exclude" + exclude.parent.mkdir(parents=True, exist_ok=True) + with exclude.open("a", encoding="utf-8") as fh: + fh.write("\n.hud/\n") + + +async def vault_history(repo: Path, vault: Path) -> None: + """Snapshot the pre-agent state, then hide the repo's history in *vault*.""" + if (vault / "git").exists(): + raise RuntimeError(f"vault {vault} already holds a history: one task per substrate") + + if hasattr(os, "geteuid") and os.geteuid() == 0: + # Grade-time git runs as root on the (chowned) agent-owned repo; git + # honors safe.directory only from system/global config, never from -c. + await run("git", "config", "--global", "--add", "safe.directory", str(repo), cwd=Path("/")) + + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: pre-agent snapshot") + _, sha, _ = await git(repo, "rev-parse", "HEAD") + + vault.mkdir(parents=True, exist_ok=True) + (vault / _SETUP_COMMIT).write_text(sha.strip(), "utf-8") + shutil.move(str(repo / ".git"), str(vault / "git")) + + await git(repo, "init", "-q", ".") + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "baseline") + + +async def create_remote(repo: Path, remote: Path, ref: str, *, branch: str = "main") -> None: + """A bare "GitHub" remote holding *ref*'s history as *branch*. + + Pushing a single ref publishes only its ancestry — sibling answer-key + branches (hidden tests, golden fix) stay unreachable, while the agent + still gets realistic past history to work with. + """ + remote.parent.mkdir(parents=True, exist_ok=True) + await git(remote.parent, "init", "-q", "--bare", "-b", branch, str(remote)) + await git(repo, "push", "-q", str(remote), f"{ref}:refs/heads/{branch}") + + +async def attach_to_remote(repo: Path, remote: Path, *, branch: str = "main") -> None: + """Point the agent's fresh repo at the remote, sharing its (sanitized) history. + + Called after :func:`vault_history`: the throwaway single-commit repo is + replaced by the remote's clone state — same worktree, but with ``origin`` + configured and history the agent can branch from and push back to. + """ + shutil.rmtree(repo / ".git") + await git(repo, "init", "-q", "-b", branch, ".") + _append_git_exclude(repo / ".git") + await git(repo, "remote", "add", "origin", str(remote)) + await git(repo, "fetch", "-q", "origin") + # Adopt the remote's history without a checkout: the worktree already + # matches (plus untracked build artifacts a checkout would refuse to + # cross), so point the branch at origin and sync only the index. + await git(repo, "update-ref", f"refs/heads/{branch}", f"refs/remotes/origin/{branch}") + await git(repo, "reset", "-q") + await git(repo, "branch", "-q", f"--set-upstream-to=origin/{branch}", branch) + + +async def restore_history(repo: Path, vault: Path) -> str: + """Swap the agent's throwaway ``.git`` for the vaulted real history. + + Returns the setup-snapshot commit sha recorded by :func:`vault_history`. + """ + agent_git = repo / ".git" + if agent_git.exists(): + shutil.rmtree(agent_git) + shutil.move(str(vault / "git"), str(agent_git)) + return (vault / _SETUP_COMMIT).read_text("utf-8").strip() + + +async def capture_agent_diff(repo: Path, setup_commit: str) -> str: + """The agent's changes: setup snapshot -> final worktree state. + + Runs on the restored real history: the final worktree (including files the + agent added) is committed and diffed against the snapshot. + """ + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: final snapshot") + _, final, _ = await git(repo, "rev-parse", "HEAD") + # --binary is mandatory: without it git emits "Binary files ... differ" for + # any binary file the agent added, and `git apply` then rejects the ENTIRE + # patch — scoring a real solution 0.0. Verified end to end. + _, diff, _ = await git( + repo, "diff", "--binary", setup_commit, final.strip(), timeout=1200.0 + ) + return diff + + +async def reset_worktree(repo: Path, setup_commit: str) -> None: + await git(repo, "reset", "--hard", setup_commit) + await git(repo, "clean", "-fd") + + +async def apply_diff(repo: Path, diff: str, patch_path: Path) -> str | None: + """Apply *diff* to the worktree; returns git's error output on failure.""" + if not diff.strip(): + return None + patch_path.parent.mkdir(parents=True, exist_ok=True) + patch_path.write_text(diff, "utf-8") + code, out, err = await git(repo, "apply", "-v", str(patch_path), check=False) + if code != 0: + return (err.strip() or out.strip())[-4000:] + return None diff --git a/harbor/sources/babylonjs-v8/coding/swe_bench_pro.py b/harbor/sources/babylonjs-v8/coding/swe_bench_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..da655cfc4cfaf8596fa6e18c3a47c8aad21d42d5 --- /dev/null +++ b/harbor/sources/babylonjs-v8/coding/swe_bench_pro.py @@ -0,0 +1,149 @@ +"""The SWE-bench Pro task flavor: dataset-row parsing and the official grading pipeline. + +An instance directory (baked into the instance image by ``swe_tasks.py``) +holds the dataset row (``instance.json``) plus the official per-instance +``run_script.sh`` and ``parser.py`` from scaleapi/SWE-bench_Pro-os. Grading +replays the official evaluator's entryscript on the repo-lifecycle primitives +in :mod:`coding.repo`: reset to the pre-agent snapshot, apply the (agent or +golden) patch, check out the hidden test files, run the script, parse, and +resolve iff every ``fail_to_pass`` and ``pass_to_pass`` test passes. +""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +from . import repo as repo_lib + + +def load_instance(instance_dir: Path) -> dict[str, Any]: + return json.loads((instance_dir / "instance.json").read_text("utf-8")) + + +def str_list(field: str) -> list[str]: + """Parse the dataset's list-shaped string fields. + + The rows store lists as Python reprs (single quotes; the official + evaluator uses ``eval``), so ``ast.literal_eval`` is the safe equivalent. + """ + value = ast.literal_eval(field) + if not isinstance(value, list): + raise ValueError(f"expected a list, got {type(value).__name__}") + return [str(item) for item in value] + + +def strip_binary_hunks(patch: str) -> str: + """Drop binary diff sections, exactly like the official evaluator.""" + if not patch: + return patch + sections = re.split(r"(?=^diff --git )", patch, flags=re.MULTILINE) + kept = [ + section + for section in sections + if section.strip() + and not re.search(r"^Binary files .* differ$", section, re.MULTILINE) + and not re.search(r"^GIT binary patch$", section, re.MULTILINE) + ] + return "".join(kept) + + +def score(instance: dict[str, Any], tests: list[dict[str, Any]]) -> EvaluationResult: + """The official resolution criterion: every required test passes.""" + passed = {t["name"] for t in tests if t.get("status") == "PASSED"} + fail_to_pass = set(str_list(instance["fail_to_pass"])) + pass_to_pass = set(str_list(instance["pass_to_pass"])) + required = fail_to_pass | pass_to_pass + resolved = required <= passed + + def fraction(subset: set[str]) -> float: + return len(subset & passed) / len(subset) if subset else 1.0 + + missing = sorted(required - passed) + return EvaluationResult( + reward=1.0 if resolved else 0.0, + content="resolved" if resolved else f"unresolved: {len(missing)} required test(s) not passing", + subscores=[ + SubScore(name="resolved", value=1.0 if resolved else 0.0, weight=1.0), + SubScore(name="fail_to_pass", value=fraction(fail_to_pass), weight=0.0), + SubScore(name="pass_to_pass", value=fraction(pass_to_pass), weight=0.0), + ], + info={"tests_reported": len(tests), "missing": missing[:20]}, + ) + + +def build_prompt(instance: dict[str, Any], repo_dir: Path) -> str: + sections = [ + f"You are working in {repo_dir}, a checkout of the {instance['repo']} repository. " + "Resolve the issue described below by modifying the code. Hidden tests grade your " + "work when you finish; do not modify existing tests.", + instance["problem_statement"], + ] + if instance.get("requirements"): + sections.append("## Requirements\n\n" + instance["requirements"]) + if instance.get("interface"): + sections.append("## Interface\n\n" + instance["interface"]) + return "\n\n".join(section.strip() for section in sections if section and section.strip()) + + +async def grade( + instance: dict[str, Any], + instance_dir: Path, + repo_dir: Path, + vault_dir: Path, + logs_dir: Path, + *, + validate_mode: str | None = None, + tests_timeout: float = 3600.0, +) -> EvaluationResult: + """Replay the official evaluator's entryscript in place. + + ``validate_mode="golden"`` grades the dataset's golden patch instead of + the agent's diff (the official gold-patch sanity check). The hidden test + files (the last line of ``before_repo_set_cmd``) are checked out *after* + the patch, so patch edits to them never survive. + """ + logs_dir.mkdir(parents=True, exist_ok=True) + setup_commit = await repo_lib.restore_history(repo_dir, vault_dir) + + if validate_mode == "golden": + diff = instance["patch"] + else: + diff = await repo_lib.capture_agent_diff(repo_dir, setup_commit) + diff = strip_binary_hunks(diff) + + await repo_lib.reset_worktree(repo_dir, setup_commit) + apply_error = await repo_lib.apply_diff(repo_dir, diff, logs_dir / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + + test_checkout = instance["before_repo_set_cmd"].strip().splitlines()[-1] + await repo_lib.run("bash", "-c", test_checkout, cwd=repo_dir) + + files_csv = ",".join(str_list(instance["selected_test_files_to_run"])) + _, out, err = await repo_lib.run( + "bash", + str(instance_dir / "run_script.sh"), + files_csv, + cwd=repo_dir, + timeout=tests_timeout, + check=False, + ) + (logs_dir / "stdout.log").write_text(out, "utf-8") + (logs_dir / "stderr.log").write_text(err, "utf-8") + await repo_lib.run( + sys.executable, + str(instance_dir / "parser.py"), + "stdout.log", + "stderr.log", + "output.json", + cwd=logs_dir, + ) + tests = json.loads((logs_dir / "output.json").read_text("utf-8"))["tests"] + return score(instance, tests) diff --git a/harbor/sources/babylonjs-v8/env.py b/harbor/sources/babylonjs-v8/env.py new file mode 100644 index 0000000000000000000000000000000000000000..c5a125925dc43e475a13de612831ab0a8a74d407 --- /dev/null +++ b/harbor/sources/babylonjs-v8/env.py @@ -0,0 +1,434 @@ +"""Coding environment (HUD v6): a repo workspace with diff-based grading. + +The env publishes one ``ssh`` workspace over a git repo; the agent's harness +brings its own bash/file tools. Task setup vaults the repo's real history +(:mod:`coding.repo`) so the agent gets a fresh single-commit repo with working +git but no answer-key refs; grading captures the agent's changes as a diff, +resets to the pre-agent snapshot, re-applies, brings in the hidden tests, and +runs them. + +Three task templates: + +- ``coding-task`` — hidden tests live as refs in the repo's vaulted history + (the ``{task}_baseline`` / ``{task}_test`` / ``{task}_golden`` branch + convention) and a shell command scores by exit code. Runs locally (clones + ``REPO_URL`` per process) or from an image that bakes the repo. +- ``sdlc-task`` — adds workflow: a bare mock-GitHub remote the agent pushes + to, ``github_*`` issue/PR tools (:mod:`coding.github`), and grading over + the pushed pull-request branch instead of the worktree. +- one SWE-bench Pro instance template, registered only when an instance dir + is baked in (see ``swe_tasks.py``): grading replays the official evaluator + (:mod:`coding.swe_bench_pro`). + +Images set ``REPO_DIR``; locally everything lives in per-process temp dirs. + +The image substrate here is BabylonJS/Babylon.js (a TypeScript monorepo of npm +workspaces; the package under work is the engine core under ``packages/dev``, +and its dependencies are installed with npm at image build), so the agent's +node environment is declared explicitly on the workspace — see +``AGENT_NODE_ENV``. +The vault, the hidden grader, the pristine copies and gold.diff sit outside the +workspace — under ``/hud`` (root, mode 700) in images — and agent shells drop +to a non-root uid, so only the env process can read them. + +The task this env carries is +``babylonjs_scene_remove_owner_refs_contract``, registered in ``tasks.py``; +the three generic templates below come with the coding-template and are unused +here. + +""" + +from __future__ import annotations + +import asyncio +import logging +import os +import shutil +import tempfile +from pathlib import Path +from typing import Any + +from hud.environment import Environment, Workspace +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine +from hud.settings import settings + +from coding import repo as repo_lib +from coding import swe_bench_pro as swe +from coding.github import MockGitHub +from coding.github import serve as serve_github + +logger = logging.getLogger(__name__) + +# ─── substrate layout ──────────────────────────────────────────────────── +# Images set REPO_DIR (and ship the repo); locally everything lives in +# per-process temp dirs and the repo is cloned from REPO_URL at startup. + +_explicit_repo = os.environ.get("REPO_DIR") +if _explicit_repo: + REPO_DIR = Path(_explicit_repo) + VAULT_DIR = Path(os.environ.get("VAULT_DIR", "/hud/vault")) + LOGS_DIR = Path(os.environ.get("GRADING_LOGS_DIR", "/hud/logs")) + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / "hud-coding" + REPO_DIR = _LOCAL_ROOT / f"repo-{os.getpid()}" + VAULT_DIR = _LOCAL_ROOT / f"vault-{os.getpid()}" + LOGS_DIR = _LOCAL_ROOT / f"logs-{os.getpid()}" + _LOCAL_SUBSTRATE = True + +# The SDLC flavor's mock-GitHub remote: a bare repo the agent pushes to. It +# must be writable by the agent, so it lives outside /hud. +REMOTE_DIR = ( + Path(os.environ.get("REMOTE_DIR", "/srv/git/project.git")) + if _explicit_repo + else _LOCAL_ROOT / f"remote-{os.getpid()}" / "project.git" +) + +REPO_URL = os.environ.get( + "REPO_URL", "https://github.com/BabylonJS/Babylon.js" +) +TESTS_TIMEOUT = float(os.environ.get("GRADING_TIMEOUT", "3600")) + +INSTANCE_DIR = Path(os.environ.get("INSTANCE_DIR", "/hud/instance")) + +AGENT_UID = 1000 +AGENT_HOME = Path("/tmp/agent-home") # noqa: S108 - container-local, created at setup + +env = Environment(name="ec-swe-babylonjs-scene-remove-owner-refs") + + +# The agent's node environment, and why it is spelled out here rather than left +# to the image. hud starts the agent's shell with a scrubbed environment +# (`env -i ... bash -l`), so anything the Dockerfile exported is gone by the +# time the first command runs; what the shell needs has to be handed to it here. +# +# node itself needs nothing: node, npm and npx are linked into /usr/local/bin, +# which is on the PATH a login shell assigns. What the tools do want +# is a writable HOME — npm's cache and its logs insist on one — which is why +# they are pointed inside the agent's HOME rather than at a root-owned default. +# +# The dependencies are already installed (npm ci, at image build, from the +# repository's own lock), owned by uid 1000, and the generated shader sources +# are in place, so `npx vitest run --project=unit ` runs without touching +# the network. Verified by execution: Dockerfile.hud step 6 runs the core +# package's whole unit suite with exactly that command as uid 1000 in a login +# shell. +AGENT_NODE_ENV = { + "npm_config_cache": str(AGENT_HOME / ".npm"), + "npm_config_update_notifier": "false", + "npm_config_fund": "false", + "npm_config_audit": "false", +} +# PATH is deliberately NOT in that dict. An agent session is a LOGIN shell +# (`env -i ... bash -l`), and Debian's /etc/profile assigns PATH +# unconditionally, so anything set here would be thrown away before the first +# command runs. node and npm are therefore installed at locations already on +# that PATH, and the image asserts it from inside a login shell (Dockerfile.hud, +# the PATH guard) rather than trusting it. + + +# network=True — hud's own default (Workspace.__init__, workspace.py:321). We had +# True only because the CLI scaffold ships it (hud/cli/templates.py:35). +# ⚠️ MEASURED 2026-09-03: this flag is a NO-OP in our images. `unshare --net` is +# applied only through bwrap (workspace.py:1049, :1292 fall back to a bare shell +# when self._bwrap is None), and bwrap is absent from every image; installing it +# does not help either — usable_bwrap() still returns None because the eval +# substrate denies the privileges (unshare: Operation not permitted). +# Verified inside the image: `git ls-remote https://github.com/... HEAD` → RC 0. +# The agent shell REACHES THE INTERNET regardless of this flag. Kept False so the +# intent is right if the substrate ever grants isolation — but never rely on it, +# and never claim "offline" in a ticket. +_ws = Workspace( + REPO_DIR, + guest_path=str(REPO_DIR), +# Сеть. Флаг network в наших образах — НЕ ИЗОЛЯЦИЯ: `unshare --net` применяется +# только через bwrap, а bwrap в образах нет и права на unshare субстрат не даёт +# (измерено: `git ls-remote https://github.com/… HEAD` внутри образа → RC 0). +# Поэтому здесь стоит True — честное описание того, что есть: агентский шелл +# достаёт интернет. Закон: «сеть открыта — не запрещать» (network=True уже +# ломал воркспейс: /workspace root:700 для uid 1000, живой голд слеп — piscina v3), +# и заметка среды НИКОГДА не говорит «offline» (RH-2: ран, который читает +# недоступность сервиса как свою вину, введён в заблуждение). + network=True, + env={"HOME": str(AGENT_HOME), **({} if _LOCAL_SUBSTRATE else AGENT_NODE_ENV)}, + track_files=False, + shell_uid=AGENT_UID, +) + +SDLC_TOOLS = os.environ.get("SDLC_TOOLS", "") not in ("", "0", "false") + +# Hedged on purpose ("can exhaust it", not "is killed"): the note may state the +# size of the box; it may not state a failure nobody measured. Everything here is +# a fact about the MACHINE — the size of it, the shape of a command that fits in +# it, the closed network, the services it does not run — and nothing here is a +# fact about the ticket: no symptom, no file name, no identifier, no sample +# (minimal-ticket law, ORG15). Nothing in this note is graded. +# +# The last sentence is law RH-2: a rollout that spends its turns trying to make +# a test that dials the internet pass, and reads its failure as its own, has been +# misled by the sandbox. Saying so costs nothing and points nowhere — and the +# grader agrees with it by construction: the no-regression gate compares the +# suite on the candidate's tree with the same suite on the pristine one, so a +# test the sandbox is red on is red on both sides and decides nothing. +WORKSPACE_NOTE = ( + f"Please make your changes directly in {REPO_DIR}, not in a copy or a " + "separate worktree.\n" + "Environment: this container has about 2 vCPUs and a hard memory limit, and " + "a fully parallel test run can exhaust it. The repository is a monorepo of " + "npm workspaces; the engine itself is the core package under packages/dev, " + "its dependencies are already installed and its generated shader sources are " + "in place. Its unit tests run from the repository root with vitest, e.g. " + "`npx vitest run --project=unit packages/dev/core/test/unit/Scene` (a " + "directory or a single file by naming it, a single test with `-t`). They " + "run on NullEngine, without a GPU. Nothing needs to be installed or " + "downloaded for that to work." +) + +_github = MockGitHub() +_github_server: asyncio.Task[None] | None = None + + +@env.initialize +async def _up() -> None: + global _github_server + if _LOCAL_SUBSTRATE and not (REPO_DIR / ".git").exists(): + REPO_DIR.parent.mkdir(parents=True, exist_ok=True) + logger.info("cloning %s into %s", REPO_URL, REPO_DIR) + await repo_lib.run("git", "clone", "-q", REPO_URL, str(REPO_DIR), cwd=REPO_DIR.parent) + await _ws.start() + env.add_capability(_ws.capability("shell")) + if _ws.tracks_files: + env.add_capability(_ws.file_tracking_capability()) + # The mock-GitHub tools belong to the SDLC flavor, which seeds issues and + # wants a pull request. A plain coding task never uses them, and offering + # them anyway spends agent steps on an empty issue list - every rollout so + # far called github_list_issues and github_list_pull_requests once. + if SDLC_TOOLS: + _github_server, github_capability = serve_github(_github) + env.add_capability(github_capability) + + +@env.shutdown +async def _down() -> None: + if _github_server is not None: + _github_server.cancel() + await _ws.stop() + if _LOCAL_SUBSTRATE: + for path in (REPO_DIR, VAULT_DIR, LOGS_DIR, REMOTE_DIR.parent): + shutil.rmtree(path, ignore_errors=True) + + +# ─── shared task lifecycle ─────────────────────────────────────────────── + + +async def _setup(base_ref: str | None = None, *, remote: bool = False) -> None: + """Check out the task's baseline, vault the history, hand the repo to the agent. + + With ``remote=True`` (the SDLC flavor) a bare "GitHub" remote is created + from the baseline first, and the agent's repo is attached to it as a + normal clone would be — realistic history, pushes, and branches, but no + reachable answer-key refs. + """ + if base_ref: + await repo_lib.git(REPO_DIR, "checkout", "-qf", base_ref) + if remote: + await repo_lib.create_remote(REPO_DIR, REMOTE_DIR, base_ref or "HEAD") + await repo_lib.vault_history(REPO_DIR, VAULT_DIR) + if remote: + await repo_lib.attach_to_remote(REPO_DIR, REMOTE_DIR) + if hasattr(os, "geteuid") and os.geteuid() == 0: + AGENT_HOME.mkdir(parents=True, exist_ok=True) + uid = f"{AGENT_UID}:{AGENT_UID}" + paths = [str(REPO_DIR), str(AGENT_HOME)] + ([str(REMOTE_DIR)] if remote else []) + await repo_lib.run("chown", "-R", uid, *paths, cwd=Path("/")) + if remote: + # The grader (root) pushes to and clones from the agent-owned remote. + await repo_lib.run("git", "config", "--global", "--add", "safe.directory", str(REMOTE_DIR), cwd=Path("/")) + + +# ─── generic flavor ────────────────────────────────────────────────────── + + +async def _grade_generic( + test_command: str, + base_ref: str | None, + test_ref: str | None, + test_files: list[str] | None, + golden_ref: str | None, + validate_mode: str | None, +) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + if not (base_ref and golden_ref): + raise ValueError('validate_mode="golden" needs base_ref and golden_ref') + _, diff, _ = await repo_lib.git(REPO_DIR, "diff", base_ref, golden_ref) + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + if test_ref: + # Hidden tests come from the vaulted history, after the agent's diff — + # so agent edits to them never survive into grading. + await repo_lib.git(REPO_DIR, "checkout", test_ref, "--", *(test_files or ["."])) + + command = test_command.format(test_files=" ".join(test_files or [])) + return await combine( + BashGrader.grade(weight=1.0, command=command, cwd=str(REPO_DIR), timeout_seconds=int(TESTS_TIMEOUT)) + ) + + +@env.template(id="coding-task", description="Fix a bug in the repo; hidden tests grade the diff.") +async def coding_task( + description: str, + test_command: str, + base_ref: str | None = None, + test_ref: str | None = None, + test_files: list[str] | None = None, + golden_ref: str | None = None, + validate_mode: str | None = None, +): + """Generic coding task. + + ``base_ref`` is the agent's starting state; ``test_ref`` holds the hidden + tests (``test_files`` are checked out from it at grade time); + ``test_command`` scores by exit code, with ``{test_files}`` expanded. + ``validate_mode="golden"`` grades ``base_ref..golden_ref`` instead of + agent edits. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup(base_ref) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. {WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests grade your " + f"work when you finish; do not modify existing tests.\n\n{description}" + ) + yield await _grade_generic(test_command, base_ref, test_ref, test_files, golden_ref, validate_mode) + + +# ─── SDLC flavor: issue-driven fix, graded on the pushed PR branch ─────── + + +async def _fetch_hidden_ref(dest: Path, ref: str) -> None: + """Fetch an answer-key ref from the vaulted history into *dest*.""" + full = f"refs/remotes/{ref}" if ref.startswith("origin/") else ref + await repo_lib.git(dest, "fetch", "-q", str(VAULT_DIR / "git"), full) + + +async def _grade_sdlc( + test_command: str, + test_ref: str, + test_files: list[str], + golden_ref: str | None, + pr_rubric: str | None, + validate_mode: str | None, +) -> EvaluationResult: + if validate_mode == "golden": + # Simulate the workflow the agent is graded on: push the reference + # fix as a branch and open a pull request for it. + if not golden_ref: + raise ValueError('validate_mode="golden" needs golden_ref') + await repo_lib.git(VAULT_DIR / "git", "push", "-q", str(REMOTE_DIR), f"{golden_ref}:refs/heads/golden-fix") + _github.create_pull_request( + "Fix the reported bug", "Applies the reference fix.", head="golden-fix", base="main" + ) + + pr = _github.latest_pull_request() + if pr is None: + return EvaluationResult(reward=0.0, content="no pull request was opened") + + # Hermetic checkout of the PR head from the remote (never the worktree). + grading_dir = LOGS_DIR / "pr-checkout" + shutil.rmtree(grading_dir, ignore_errors=True) + LOGS_DIR.mkdir(parents=True, exist_ok=True) + await repo_lib.run("git", "clone", "-q", str(REMOTE_DIR), str(grading_dir), cwd=LOGS_DIR) + code, _, err = await repo_lib.git(grading_dir, "checkout", "-q", pr.head, check=False) + if code != 0: + return EvaluationResult( + reward=0.0, + content=f"pull request head branch {pr.head!r} was never pushed", + info={"git_checkout": err.strip()[-2000:]}, + ) + + await _fetch_hidden_ref(grading_dir, test_ref) + await repo_lib.git(grading_dir, "checkout", "FETCH_HEAD", "--", *test_files) + + command = test_command.format(test_files=" ".join(test_files)) + quality: Any + if pr_rubric: + quality = LLMJudgeGrader.grade(weight=0.2, answer=_github.transcript(), criteria=[pr_rubric]) + else: + opened_well = bool(pr.title.strip() and pr.body.strip()) + quality = SubScore(name="pull_request", value=1.0 if opened_well else 0.0, weight=0.2) + return await combine( + BashGrader.grade(weight=0.8, command=command, cwd=str(grading_dir), timeout_seconds=int(TESTS_TIMEOUT)), + quality, + ) + + +@env.template( + id="sdlc-task", + description="Issue-driven bug fix: fix the code, push a branch, open a pull request.", +) +async def sdlc_task( + description: str, + test_command: str, + base_ref: str, + test_ref: str, + test_files: list[str], + issues: list[dict[str, Any]] | None = None, + golden_ref: str | None = None, + pr_rubric: str | None = None, + validate_mode: str | None = None, +): + """The generic flavor plus workflow: the repo has an ``origin`` remote (a + bare mock-GitHub repo) and ``github_*`` tools seeded with *issues*; the + deliverable is a pushed branch with a pull request. Grading checks the PR + head out of the remote, brings in the hidden tests, runs ``test_command`` + (weight 0.8), and scores the PR itself (weight 0.2) — structurally, or + against ``pr_rubric`` with an LLM judge when provided. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + _github.seed(issues or []) + await _setup(base_ref, remote=True) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}; its `origin` remote " + "is the team's shared repository, and the `github_*` tools give you the team's " + "issue tracker.\n\n" + "Complete the following task. When you are done, push your work to `origin` as a " + "new branch and open a pull request for it with `github_create_pull_request`. " + "Hidden tests grade your work; do not modify existing tests.\n\n" + f"{description}" + ) + yield await _grade_sdlc(test_command, test_ref, test_files, golden_ref, pr_rubric, validate_mode) + + +# ─── SWE-bench Pro flavor (present only in baked instance images) ──────── + +if (INSTANCE_DIR / "instance.json").is_file(): + INSTANCE = swe.load_instance(INSTANCE_DIR) + + @env.template( + id=INSTANCE["instance_id"], + description=f"SWE-bench Pro instance on {INSTANCE['repo']}", + ) + async def swe_bench_pro_task(validate_mode: str | None = None): + """One SWE-bench Pro rollout. ``validate_mode="golden"`` grades the + dataset's golden patch instead of agent edits (gold-patch validation).""" + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + _ = yield swe.build_prompt(INSTANCE, REPO_DIR) + yield await swe.grade( + INSTANCE, + INSTANCE_DIR, + REPO_DIR, + VAULT_DIR, + LOGS_DIR, + validate_mode=validate_mode, + tests_timeout=TESTS_TIMEOUT, + ) diff --git a/harbor/sources/babylonjs-v8/pyproject.toml b/harbor/sources/babylonjs-v8/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..467481db13ee2eead584c259e72e80a209c88c07 --- /dev/null +++ b/harbor/sources/babylonjs-v8/pyproject.toml @@ -0,0 +1,8 @@ +[project] +name = "babylonjs-scene-remove-owner-refs-task" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = ["hud-python==0.6.15"] + +[tool.hud] +image = "ec-swe-babylonjs-scene-remove-owner-refs" diff --git a/harbor/sources/babylonjs-v8/task/gold.diff b/harbor/sources/babylonjs-v8/task/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..70aa4b82f33f109a457b539cbc58483c1699d0e1 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/gold.diff @@ -0,0 +1,731 @@ +diff --git a/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts b/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts +index 9eaacae..657ec7b 100644 +--- a/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts ++++ b/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts +@@ -52,6 +52,10 @@ export class ProceduralTextureSceneComponent implements ISceneComponent { + Tools.StartPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0); + for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) { + const proceduralTexture = this.scene.proceduralTextures[proceduralIndex]; ++ if (this.scene.textures.indexOf(proceduralTexture) === -1) { ++ // Removed from the scene: the scene does not render it ++ continue; ++ } + if (proceduralTexture._shouldRender()) { + proceduralTexture.render(); + } +diff --git a/packages/dev/core/src/scene.pure.ts b/packages/dev/core/src/scene.pure.ts +index ab37c26..03afa55 100644 +--- a/packages/dev/core/src/scene.pure.ts ++++ b/packages/dev/core/src/scene.pure.ts +@@ -102,6 +102,8 @@ import { type BoundingBoxRenderer } from "./Rendering/boundingBoxRenderer.pure"; + import { type BoundingBox } from "./Culling/boundingBox"; + import { RegisterClass } from "./Misc/typeStore"; + ++declare const WeakRef: any; ++ + /** + * Options for creating a scene uniform buffer + */ +@@ -2500,6 +2502,10 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + for (index = 0; index < this.customRenderTargets.length; ++index) { + const rtt = this.customRenderTargets[index]; ++ if (this.textures.indexOf(rtt) === -1) { ++ // Removed from the scene: the scene does not render it ++ continue; ++ } + if (!rtt.isReadyForRendering()) { + isReady = false; + } +@@ -2538,6 +2544,10 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + // Procedural textures + if (this.proceduralTexturesEnabled) { + for (const proceduralTexture of this.proceduralTextures) { ++ if (this.textures.indexOf(proceduralTexture) === -1) { ++ // Removed from the scene: the scene does not render it ++ continue; ++ } + if (!proceduralTexture.isReady()) { + isReady = false; + } +@@ -2965,6 +2975,8 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + newMesh._resyncLightSources(); + ++ this._restoreRenderListsOfRemovedMesh(newMesh); ++ + if (!newMesh.parent) { + newMesh._addToSceneRootNodes(); + } +@@ -2998,6 +3010,10 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + if (!toRemove.parent) { + toRemove._removeFromSceneRootNodes(); + } ++ ++ if (!this._isDisposing) { ++ this._takeRemovedMeshOutOfRenderLists(toRemove); ++ } + } + + this._inputManager._invalidateMesh(toRemove); +@@ -3012,6 +3028,126 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + return index; + } + ++ /** ++ * Render lists a removed mesh was taken out of, so that adding the mesh back restores them ++ */ ++ private _renderListsOfRemovedMeshes = new WeakMap }>>(); ++ ++ /** ++ * Render targets taken out of the scene: they keep their render list and draw it again once added back, so a mesh ++ * removed meanwhile must be taken out of their lists too. Held weakly: a render target nobody puts back can be collected ++ */ ++ private _renderTargetsOutOfScene: Array<{ deref(): RenderTargetTexture | undefined }> = []; ++ ++ /** ++ * @param target defines the object to reference ++ * @returns a weak reference to the object (a strong one where WeakRef is not supported) ++ */ ++ private _makeWeakReference(target: T): { deref(): T | undefined } { ++ return typeof WeakRef !== "undefined" ? new WeakRef(target) : { deref: () => target }; ++ } ++ ++ /** ++ * Forgets a render target put back into the scene, and the ones that were collected ++ * @param renderTarget defines the render target added back to the scene ++ */ ++ private _forgetRenderTargetOutOfScene(renderTarget: RenderTargetTexture): void { ++ this._renderTargetsOutOfScene = this._renderTargetsOutOfScene.filter((reference) => { ++ const target = reference.deref(); ++ return !!target && target !== renderTarget; ++ }); ++ } ++ ++ /** ++ * Gathers every render list the scene draws from, or will draw from once put back: render target textures (mirrors, ++ * probes, custom render targets...), including the ones taken out of the scene, and the shadow maps of the lights ++ * @returns the render lists of the scene ++ */ ++ private _getRenderLists(): Set { ++ const lists = new Set(); ++ const addRenderList = (renderTarget: Nullable | undefined) => { ++ if (renderTarget && renderTarget.renderList) { ++ lists.add(renderTarget.renderList); ++ } ++ }; ++ ++ for (const texture of this.textures) { ++ if (texture.isRenderTarget) { ++ addRenderList(texture as RenderTargetTexture); ++ } ++ } ++ for (const renderTarget of this.customRenderTargets) { ++ addRenderList(renderTarget); ++ } ++ this._renderTargetsOutOfScene = this._renderTargetsOutOfScene.filter((reference) => { ++ const renderTarget = reference.deref(); ++ addRenderList(renderTarget); ++ return !!renderTarget; ++ }); ++ for (const camera of this.cameras) { ++ if (camera.customRenderTargets) { ++ for (const renderTarget of camera.customRenderTargets) { ++ addRenderList(renderTarget); ++ } ++ } ++ } ++ for (const light of this.lights) { ++ const generators = light.getShadowGenerators(); ++ if (generators) { ++ for (const generator of generators.values()) { ++ addRenderList(generator.getShadowMap()); ++ } ++ } ++ } ++ ++ return lists; ++ } ++ ++ /** ++ * A mesh taken out of the scene must not be drawn by the scene anymore: take it out of the render lists it is in, ++ * remembering where it was so that adding it back puts it back ++ * @param mesh defines the mesh that was removed from the scene ++ */ ++ private _takeRemovedMeshOutOfRenderLists(mesh: AbstractMesh): void { ++ const entries = this._renderListsOfRemovedMeshes.get(mesh) ?? []; ++ for (const list of this._getRenderLists()) { ++ // A mesh can be listed more than once: every entry leaves, or the pass keeps drawing it ++ let index = list.indexOf(mesh); ++ while (index !== -1) { ++ entries.push({ list, index, next: list[index + 1] ?? null }); ++ list.splice(index, 1); ++ index = list.indexOf(mesh); ++ } ++ } ++ if (entries.length) { ++ this._renderListsOfRemovedMeshes.set(mesh, entries); ++ } ++ } ++ ++ /** ++ * Puts a mesh added back to the scene into the render lists it was taken out of when it was removed ++ * @param mesh defines the mesh added to the scene ++ */ ++ private _restoreRenderListsOfRemovedMesh(mesh: AbstractMesh): void { ++ const entries = this._renderListsOfRemovedMeshes.get(mesh); ++ if (!entries) { ++ return; ++ } ++ this._renderListsOfRemovedMeshes.delete(mesh); ++ // Lists the mesh was put into while out of the scene keep it as they have it ++ const listedMeanwhile = new Set(entries.filter(({ list }) => list.indexOf(mesh) !== -1).map(({ list }) => list)); ++ // Last taken out, first put back: a mesh listed twice gets both of its entries back where they were ++ for (let i = entries.length - 1; i >= 0; i--) { ++ const { list, index, next } = entries[i]; ++ if (listedMeanwhile.has(list)) { ++ continue; ++ } ++ // Back at the end if it was last, in front of the mesh that followed it if that one is still listed, at its former index otherwise ++ const nextIndex = next ? list.indexOf(next) : list.length; ++ list.splice(nextIndex !== -1 ? nextIndex : Math.min(index, list.length), 0, mesh); ++ } ++ } ++ + /** + * Add a transform node to the list of scene's transform nodes + * @param newTransformNode defines the transform node to add +@@ -3272,6 +3408,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + const index = this.textures.indexOf(toRemove); + if (index !== -1) { + this.textures.splice(index, 1); ++ if (toRemove.isRenderTarget && !this._isDisposing) { ++ this._renderTargetsOutOfScene.push(this._makeWeakReference(toRemove as RenderTargetTexture)); ++ } + } + this.onTextureRemovedObservable.notifyObservers(toRemove); + +@@ -3530,6 +3669,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + return; + } + this.textures.push(newTexture); ++ if (newTexture.isRenderTarget) { ++ this._forgetRenderTargetOutOfScene(newTexture as RenderTargetTexture); ++ } + this.onNewTextureAddedObservable.notifyObservers(newTexture); + } + +@@ -5077,11 +5219,11 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets); + + if (camera.customRenderTargets && camera.customRenderTargets.length > 0) { +- this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets); ++ this._addCustomRenderTargetsInScene(camera.customRenderTargets); + } + + if (rigParent && rigParent.customRenderTargets && rigParent.customRenderTargets.length > 0) { +- this._renderTargets.concatWithNoDuplicate(rigParent.customRenderTargets); ++ this._addCustomRenderTargetsInScene(rigParent.customRenderTargets); + } + + if (this.environmentTexture && this.environmentTexture.isRenderTarget) { +@@ -5231,6 +5373,18 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + this.onAfterRenderCameraObservable.notifyObservers(camera); + } + ++ /** ++ * Adds to the render targets of the frame the custom render targets that are still part of the scene ++ * @param renderTargets defines the custom render targets to add ++ */ ++ private _addCustomRenderTargetsInScene(renderTargets: RenderTargetTexture[]): void { ++ for (const renderTarget of renderTargets) { ++ if (this.textures.indexOf(renderTarget) !== -1) { ++ this._renderTargets.pushNoDuplicate(renderTarget); ++ } ++ } ++ } ++ + private _checkIntersections(): void { + for (let index = 0; index < this._meshesForIntersections.length; index++) { + const sourceMesh = this._meshesForIntersections.data[index]; +@@ -5428,7 +5582,7 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + this._renderTargets.pushNoDuplicate(this.environmentTexture as RenderTargetTexture); + } + +- this._renderTargets.concatWithNoDuplicate(this.customRenderTargets); ++ this._addCustomRenderTargetsInScene(this.customRenderTargets); + + Tools.StartPerformanceCounter("Custom render targets", this._renderTargets.length > 0); + for (let customIndex = 0; customIndex < this._renderTargets.length; customIndex++) { +@@ -5660,6 +5814,10 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) { + const renderTarget = this.customRenderTargets[customIndex]; ++ if (this.textures.indexOf(renderTarget) === -1) { ++ // Removed from the scene: the scene does not render it ++ continue; ++ } + const activeCamera = renderTarget.activeCamera || this.activeCamera; + + this._renderRenderTarget(renderTarget, activeCamera, currentActiveCamera !== activeCamera, this.dumpNextRenderTargets); +diff --git a/packages/dev/core/test/unit/Scene/babylon.scene.removeFromScene.test.ts b/packages/dev/core/test/unit/Scene/babylon.scene.removeFromScene.test.ts +new file mode 100644 +index 0000000..c8f214f +--- /dev/null ++++ b/packages/dev/core/test/unit/Scene/babylon.scene.removeFromScene.test.ts +@@ -0,0 +1,455 @@ ++import { type Engine } from "core/Engines/engine"; ++import { type Nullable } from "core/types"; ++import { NullEngine } from "core/Engines/nullEngine"; ++import { Scene } from "core/scene"; ++import { Vector3 } from "core/Maths/math.vector"; ++import { Plane } from "core/Maths/math.plane"; ++import { FreeCamera } from "core/Cameras/freeCamera"; ++import { DirectionalLight } from "core/Lights/directionalLight"; ++import { PointLight } from "core/Lights/pointLight"; ++import { ShadowGenerator } from "core/Lights/Shadows/shadowGenerator"; ++import { CreateBox } from "core/Meshes/Builders/boxBuilder"; ++import { CreateGround } from "core/Meshes/Builders/groundBuilder"; ++import { type AbstractMesh } from "core/Meshes/abstractMesh"; ++import { RenderTargetTexture } from "core/Materials/Textures/renderTargetTexture"; ++import { MirrorTexture } from "core/Materials/Textures/mirrorTexture"; ++import { NoiseProceduralTexture } from "core/Materials/Textures/Procedurals/noiseProceduralTexture"; ++import { StandardMaterial } from "core/Materials/standardMaterial"; ++import { ReflectionProbe } from "core/Probes/reflectionProbe"; ++import { AssetContainer } from "core/assetContainer"; ++ ++import "core/Lights/Shadows/shadowGeneratorSceneComponent"; ++import "core/Probes/reflectionProbe"; ++import "core/Materials/Textures/Procedurals/proceduralTextureSceneComponent"; ++ ++// Pre-load the shaders the scenes below compile, so that no shader import is still pending when a test ends. ++import "core/Shaders/default.vertex"; ++import "core/Shaders/default.fragment"; ++import "core/Shaders/shadowMap.vertex"; ++import "core/Shaders/shadowMap.fragment"; ++import "core/Shaders/depthBoxBlur.fragment"; ++import "core/Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow"; ++import "core/Shaders/procedural.vertex"; ++import "core/Shaders/noise.fragment"; ++ ++/** ++ * Counts the draws of meshes per render target (draws outside the watched render targets are counted as "main") ++ */ ++class DrawCounter { ++ private _counts = new Map(); ++ private _current = "main"; ++ ++ public watch(pass: string, renderTarget: RenderTargetTexture) { ++ renderTarget.onBeforeRenderObservable.add(() => (this._current = pass)); ++ renderTarget.onAfterRenderObservable.add(() => (this._current = "main")); ++ } ++ ++ public count(...meshes: AbstractMesh[]) { ++ for (const mesh of meshes) { ++ (mesh as any).onBeforeDrawObservable.add(() => { ++ const key = `${this._current}:${mesh.name}`; ++ this._counts.set(key, (this._counts.get(key) ?? 0) + 1); ++ }); ++ } ++ } ++ ++ public get(pass: string, mesh: AbstractMesh): number { ++ return this._counts.get(`${pass}:${mesh.name}`) ?? 0; ++ } ++ ++ public reset() { ++ this._counts.clear(); ++ } ++} ++ ++describe("Scene - taking things out of the scene", () => { ++ let engine: Engine; ++ let scene: Scene; ++ let camera: FreeCamera; ++ ++ beforeEach(() => { ++ engine = new NullEngine({ ++ renderHeight: 256, ++ renderWidth: 256, ++ textureSize: 256, ++ deterministicLockstep: false, ++ lockstepMaxSteps: 1, ++ }); ++ scene = new Scene(engine); ++ camera = new FreeCamera("camera", new Vector3(0, 6, -12), scene); ++ camera.setTarget(Vector3.Zero()); ++ }); ++ ++ afterEach(() => { ++ engine.dispose(); ++ }); ++ ++ const renderUntil = async (condition: () => boolean) => { ++ for (let i = 0; i < 80 && !condition(); i++) { ++ scene.render(); ++ await new Promise((resolve) => setTimeout(resolve, 5)); ++ } ++ expect(condition()).toBe(true); ++ }; ++ ++ const renderFrames = async (count = 4) => { ++ for (let i = 0; i < count; i++) { ++ scene.render(); ++ await new Promise((resolve) => setTimeout(resolve, 5)); ++ } ++ }; ++ ++ const createSun = () => { ++ const sun = new DirectionalLight("sun", new Vector3(-1, -2, -1), scene); ++ sun.position = new Vector3(20, 40, 20); ++ const shadowGenerator = new ShadowGenerator(512, sun); ++ const ground = CreateGround("ground", { width: 20, height: 20 }, scene); ++ ground.receiveShadows = true; ++ return { sun, shadowGenerator, ground }; ++ }; ++ ++ const names = (list: Nullable | undefined) => (list ?? []).map((mesh) => mesh.name); ++ ++ const createBox = (name: string, x: number) => { ++ const box = CreateBox(name, { size: 1 }, scene); ++ box.position.x = x; ++ return box; ++ }; ++ ++ it("stops drawing a removed mesh into the shadow maps", async () => { ++ const { shadowGenerator } = createSun(); ++ const removed = createBox("removed", -2); ++ const child = createBox("child", 0); ++ child.parent = removed; ++ const kept = createBox("kept", 2); ++ shadowGenerator.addShadowCaster(removed); ++ shadowGenerator.addShadowCaster(kept); ++ const counter = new DrawCounter(); ++ counter.watch("shadow", shadowGenerator.getShadowMap()!); ++ counter.count(removed, child, kept); ++ await renderUntil(() => counter.get("shadow", removed) > 0 && counter.get("shadow", child) > 0); ++ ++ scene.removeMesh(removed, true); ++ counter.reset(); ++ await renderFrames(); ++ ++ expect(counter.get("shadow", removed)).toBe(0); ++ expect(counter.get("shadow", child)).toBe(0); ++ expect(counter.get("shadow", kept)).toBeGreaterThan(0); ++ }); ++ ++ it("stops drawing a removed mesh into render targets, mirrors and reflection probes", async () => { ++ const removed = createBox("removed", -2); ++ const kept = createBox("kept", 2); ++ const counter = new DrawCounter(); ++ ++ const sceneTarget = new RenderTargetTexture("sceneTarget", 64, scene); ++ sceneTarget.renderList = [removed, kept]; ++ scene.customRenderTargets.push(sceneTarget); ++ const cameraTarget = new RenderTargetTexture("cameraTarget", 64, scene); ++ cameraTarget.renderList = [removed, kept]; ++ camera.customRenderTargets.push(cameraTarget); ++ const mirror = new MirrorTexture("mirror", 64, scene); ++ mirror.mirrorPlane = new Plane(0, -1, 0, 0); ++ mirror.renderList = [removed, kept]; ++ const probe = new ReflectionProbe("probe", 64, scene); ++ probe.renderList!.push(removed, kept); ++ const holder = createBox("holder", 0); ++ const material = new StandardMaterial("material", scene); ++ material.reflectionTexture = mirror; ++ holder.material = material; ++ const holder2 = createBox("holder2", 4); ++ const material2 = new StandardMaterial("material2", scene); ++ material2.reflectionTexture = probe.cubeTexture; ++ holder2.material = material2; ++ ++ const passes: [string, RenderTargetTexture][] = [ ++ ["sceneTarget", sceneTarget], ++ ["cameraTarget", cameraTarget], ++ ["mirror", mirror], ++ ["probe", probe.cubeTexture], ++ ]; ++ for (const [pass, renderTarget] of passes) { ++ counter.watch(pass, renderTarget); ++ } ++ counter.count(removed, kept); ++ await renderUntil(() => passes.every(([pass]) => counter.get(pass, removed) > 0)); ++ ++ scene.removeMesh(removed); ++ counter.reset(); ++ await renderFrames(8); ++ ++ for (const [pass] of passes) { ++ expect(counter.get(pass, removed)).toBe(0); ++ expect(counter.get(pass, kept)).toBeGreaterThan(0); ++ } ++ }); ++ ++ it("stops drawing the meshes of a container removed from the scene", async () => { ++ const { shadowGenerator } = createSun(); ++ const house = createBox("house", -2); ++ const kept = createBox("kept", 2); ++ shadowGenerator.addShadowCaster(house); ++ shadowGenerator.addShadowCaster(kept); ++ const renderTarget = new RenderTargetTexture("renderTarget", 64, scene); ++ renderTarget.renderList = [house, kept]; ++ scene.customRenderTargets.push(renderTarget); ++ const counter = new DrawCounter(); ++ counter.watch("shadow", shadowGenerator.getShadowMap()!); ++ counter.watch("renderTarget", renderTarget); ++ counter.count(house, kept); ++ await renderUntil(() => counter.get("shadow", house) > 0 && counter.get("renderTarget", house) > 0); ++ ++ const container = new AssetContainer(scene); ++ container.meshes.push(house); ++ container.removeFromScene(); ++ counter.reset(); ++ await renderFrames(); ++ ++ expect(counter.get("shadow", house)).toBe(0); ++ expect(counter.get("renderTarget", house)).toBe(0); ++ expect(counter.get("shadow", kept)).toBeGreaterThan(0); ++ expect(counter.get("renderTarget", kept)).toBeGreaterThan(0); ++ }); ++ ++ it("stops rendering render target and procedural textures removed from the scene", async () => { ++ const mesh = createBox("mesh", 0); ++ const removedTarget = new RenderTargetTexture("removedTarget", 64, scene); ++ const removedCameraTarget = new RenderTargetTexture("removedCameraTarget", 64, scene); ++ const keptTarget = new RenderTargetTexture("keptTarget", 64, scene); ++ for (const renderTarget of [removedTarget, removedCameraTarget, keptTarget]) { ++ renderTarget.renderList = [mesh]; ++ } ++ scene.customRenderTargets.push(removedTarget, keptTarget); ++ camera.customRenderTargets.push(removedCameraTarget); ++ const removedProcedural = new NoiseProceduralTexture("removedProcedural", 64, scene); ++ const keptProcedural = new NoiseProceduralTexture("keptProcedural", 64, scene); ++ ++ const renders = new Map(); ++ const count = (name: string) => renders.set(name, (renders.get(name) ?? 0) + 1); ++ for (const renderTarget of [removedTarget, removedCameraTarget, keptTarget]) { ++ renderTarget.onAfterUnbindObservable.add(() => count(renderTarget.name)); ++ } ++ for (const procedural of [removedProcedural, keptProcedural]) { ++ procedural.onGeneratedObservable.add(() => count(procedural.name)); ++ } ++ await renderUntil(() => renders.size === 5); ++ ++ scene.removeTexture(removedTarget); ++ scene.removeTexture(removedProcedural); ++ const container = new AssetContainer(scene); ++ container.textures.push(removedCameraTarget); ++ container.removeFromScene(); ++ renders.clear(); ++ await renderFrames(); ++ ++ expect(renders.get("removedTarget")).toBeUndefined(); ++ expect(renders.get("removedCameraTarget")).toBeUndefined(); ++ expect(renders.get("removedProcedural")).toBeUndefined(); ++ expect(renders.get("keptTarget")).toBeGreaterThan(0); ++ expect(renders.get("keptProcedural")).toBeGreaterThan(0); ++ ++ container.addToScene(); ++ scene.addTexture(removedTarget); ++ scene.addTexture(removedProcedural); ++ renders.clear(); ++ await renderUntil(() => renders.size === 5); ++ expect(scene.customRenderTargets.map((texture) => texture.name)).toEqual(["removedTarget", "keptTarget"]); ++ expect(camera.customRenderTargets.map((texture) => texture.name)).toEqual(["removedCameraTarget"]); ++ }); ++ ++ it("draws meshes put back into the scene exactly as before", async () => { ++ const { shadowGenerator } = createSun(); ++ const lamp = new PointLight("lamp", new Vector3(0, 3, 0), scene); ++ const house = createBox("house", -2); ++ const tree = createBox("tree", 2); ++ shadowGenerator.addShadowCaster(house); ++ shadowGenerator.addShadowCaster(tree); ++ lamp.excludedMeshes.push(house); ++ const renderTarget = new RenderTargetTexture("renderTarget", 64, scene); ++ renderTarget.renderList = [house, tree]; ++ scene.customRenderTargets.push(renderTarget); ++ const counter = new DrawCounter(); ++ counter.watch("shadow", shadowGenerator.getShadowMap()!); ++ counter.watch("renderTarget", renderTarget); ++ counter.count(house, tree); ++ await renderUntil(() => counter.get("shadow", house) > 0 && counter.get("renderTarget", house) > 0); ++ ++ const container = new AssetContainer(scene); ++ container.meshes.push(house); ++ container.removeFromScene(); ++ scene.removeMesh(tree); ++ await renderFrames(2); ++ container.addToScene(); ++ scene.addMesh(tree); ++ counter.reset(); ++ await renderUntil( ++ () => counter.get("shadow", house) > 0 && counter.get("renderTarget", house) > 0 && counter.get("shadow", tree) > 0 && counter.get("renderTarget", tree) > 0 ++ ); ++ ++ expect(names(shadowGenerator.getShadowMap()!.renderList)).toEqual(["house", "tree"]); ++ expect(names(renderTarget.renderList)).toEqual(["house", "tree"]); ++ expect(names(lamp.excludedMeshes)).toEqual(["house"]); ++ }); ++ ++ it("keeps drawing what stays in the scene and what is listed after the removal", async () => { ++ const { shadowGenerator } = createSun(); ++ const cart = createBox("cart", -2); ++ const wheel = createBox("wheel", 0); ++ wheel.parent = cart; ++ const helper = createBox("helper", 2); ++ shadowGenerator.addShadowCaster(cart); ++ const renderTarget = new RenderTargetTexture("renderTarget", 64, scene); ++ renderTarget.renderList = [cart, wheel]; ++ scene.customRenderTargets.push(renderTarget); ++ ++ scene.removeMesh(cart); ++ scene.removeMesh(helper); ++ const ownTarget = new RenderTargetTexture("ownTarget", 64, scene); ++ ownTarget.renderList = [helper]; ++ scene.customRenderTargets.push(ownTarget); ++ ++ const counter = new DrawCounter(); ++ counter.watch("shadow", shadowGenerator.getShadowMap()!); ++ counter.watch("renderTarget", renderTarget); ++ counter.watch("ownTarget", ownTarget); ++ counter.count(cart, wheel, helper); ++ await renderUntil(() => counter.get("shadow", wheel) > 0 && counter.get("renderTarget", wheel) > 0 && counter.get("ownTarget", helper) > 0); ++ ++ expect(counter.get("main", wheel)).toBeGreaterThan(0); ++ expect(counter.get("shadow", cart)).toBe(0); ++ expect(counter.get("renderTarget", cart)).toBe(0); ++ expect(counter.get("main", helper)).toBe(0); ++ expect(cart.isEnabled()).toBe(true); ++ expect(cart.isVisible).toBe(true); ++ }); ++ ++ it("stops a mirror taken out of the scene from drawing a mesh removed meanwhile, once the mirror is back", async () => { ++ const lakeGround = CreateGround("lakeGround", { width: 6, height: 6 }, scene); ++ lakeGround.position.z = 5; ++ const lake = new MirrorTexture("lake", 64, scene); ++ lake.mirrorPlane = new Plane(0, -1, 0, 0); ++ const house = createBox("house", -2); ++ const kept = createBox("kept", 2); ++ lake.renderList = [house, kept]; ++ const water = new StandardMaterial("water", scene); ++ water.reflectionTexture = lake; ++ lakeGround.material = water; ++ const counter = new DrawCounter(); ++ counter.watch("lake", lake); ++ counter.count(house, kept); ++ await renderUntil(() => counter.get("lake", house) > 0 && counter.get("lake", kept) > 0); ++ ++ const lakeChunk = new AssetContainer(scene); ++ lakeChunk.meshes.push(lakeGround); ++ lakeChunk.materials.push(water); ++ lakeChunk.textures.push(lake); ++ const houseChunk = new AssetContainer(scene); ++ houseChunk.meshes.push(house); ++ ++ lakeChunk.removeFromScene(); ++ houseChunk.removeFromScene(); ++ lakeChunk.addToScene(); ++ counter.reset(); ++ await renderFrames(); ++ ++ expect(counter.get("lake", house)).toBe(0); ++ expect(counter.get("lake", kept)).toBeGreaterThan(0); ++ expect(names(lake.renderList)).toEqual(["kept"]); ++ ++ houseChunk.addToScene(); ++ counter.reset(); ++ await renderUntil(() => counter.get("lake", house) > 0); ++ expect(names(lake.renderList)).toEqual(["house", "kept"]); ++ }); ++ ++ it("takes a mesh listed twice out of a render target, and puts both entries back", async () => { ++ const house = createBox("house", -2); ++ const kept = createBox("kept", 2); ++ const renderTarget = new RenderTargetTexture("renderTarget", 64, scene); ++ renderTarget.renderList = [house, kept, house]; ++ scene.customRenderTargets.push(renderTarget); ++ const counter = new DrawCounter(); ++ counter.watch("renderTarget", renderTarget); ++ counter.count(house, kept); ++ await renderUntil(() => counter.get("renderTarget", house) > 0 && counter.get("renderTarget", kept) > 0); ++ ++ scene.removeMesh(house); ++ counter.reset(); ++ await renderFrames(); ++ expect(counter.get("renderTarget", house)).toBe(0); ++ expect(counter.get("renderTarget", kept)).toBeGreaterThan(0); ++ ++ scene.addMesh(house); ++ expect(names(renderTarget.renderList)).toEqual(["house", "kept", "house"]); ++ }); ++ ++ it("does not render a texture taken out of the scene while its camera was away, once the camera is back", async () => { ++ const box = createBox("box", 0); ++ const tower = new FreeCamera("tower", new Vector3(0, 6, 12), scene); ++ scene.activeCameras = [camera, tower]; ++ const monitor = new RenderTargetTexture("monitor", 64, scene); ++ const feed = new RenderTargetTexture("feed", 64, scene); ++ monitor.renderList = [box]; ++ feed.renderList = [box]; ++ tower.customRenderTargets.push(monitor, feed); ++ const renders = { monitor: 0, feed: 0 }; ++ monitor.onAfterUnbindObservable.add(() => renders.monitor++); ++ feed.onAfterUnbindObservable.add(() => renders.feed++); ++ await renderUntil(() => renders.monitor > 0 && renders.feed > 0); ++ ++ const towerChunk = new AssetContainer(scene); ++ towerChunk.cameras.push(tower); ++ towerChunk.removeFromScene(); ++ scene.removeTexture(monitor); ++ towerChunk.addToScene(); ++ scene.activeCameras = [camera, tower]; ++ renders.monitor = 0; ++ renders.feed = 0; ++ await renderFrames(); ++ expect(renders.monitor).toBe(0); ++ expect(renders.feed).toBeGreaterThan(0); ++ ++ scene.addTexture(monitor); ++ await renderUntil(() => renders.monitor > 0); ++ }); ++ ++ it("keeps a mesh listed after its chunk was unloaded when the chunk is unloaded again", async () => { ++ const { shadowGenerator } = createSun(); ++ const house = createBox("house", -2); ++ const shed = createBox("shed", 0); ++ shadowGenerator.addShadowCaster(house); ++ shadowGenerator.addShadowCaster(shed); ++ const chunk = new AssetContainer(scene); ++ chunk.meshes.push(house, shed); ++ chunk.removeFromScene(); ++ const preview = new RenderTargetTexture("preview", 64, scene); ++ preview.renderList = [house]; ++ scene.customRenderTargets.push(preview); ++ ++ chunk.removeFromScene(); ++ ++ const counter = new DrawCounter(); ++ counter.watch("preview", preview); ++ counter.watch("shadow", shadowGenerator.getShadowMap()!); ++ counter.count(house, shed); ++ await renderUntil(() => counter.get("preview", house) > 0); ++ expect(counter.get("shadow", shed)).toBe(0); ++ expect(counter.get("shadow", house)).toBe(0); ++ expect(names(preview.renderList)).toEqual(["house"]); ++ }); ++ ++ // Side effect of dispose going through removeMesh: a disposed mesh leaves every render list too ++ it("takes a disposed mesh out of every list, as it does a removed one", () => { ++ const { shadowGenerator } = createSun(); ++ const mesh = createBox("mesh", 0); ++ shadowGenerator.addShadowCaster(mesh); ++ const renderTarget = new RenderTargetTexture("renderTarget", 64, scene); ++ renderTarget.renderList = [mesh]; ++ ++ mesh.dispose(); ++ ++ expect(names(shadowGenerator.getShadowMap()!.renderList)).toEqual([]); ++ expect(names(renderTarget.renderList)).toEqual([]); ++ }); ++}); diff --git a/harbor/sources/babylonjs-v8/task/grader/controls/alt.diff b/harbor/sources/babylonjs-v8/task/grader/controls/alt.diff new file mode 100644 index 0000000000000000000000000000000000000000..c5e7b23e2900d7da09cc52a5fbf22d08a9179042 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/controls/alt.diff @@ -0,0 +1,136 @@ +diff --git a/packages/dev/core/src/scene.pure.ts b/packages/dev/core/src/scene.pure.ts +index ab37c26..5c2cfca 100644 +--- a/packages/dev/core/src/scene.pure.ts ++++ b/packages/dev/core/src/scene.pure.ts +@@ -1671,6 +1671,10 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + */ + public customRenderTargets: RenderTargetTexture[] = []; + ++ private _parkedMeshes = new Map(); ++ private _parkedTextures = new Map(); ++ private _camerasOutOfScene = new Set(); ++ + /** + * Defines if texture loading must be delayed + * If true, textures will only be loaded when they need to be rendered +@@ -2963,6 +2967,19 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + this.meshes.push(newMesh); + ++ const parked = this._parkedMeshes.get(newMesh); ++ if (parked) { ++ this._parkedMeshes.delete(newMesh); ++ // a list the mesh was put into meanwhile keeps it as it is; every other entry comes back ++ const listedMeanwhile = new Set(parked.filter(({ target }) => !!target.renderList && target.renderList.indexOf(newMesh) !== -1).map(({ target }) => target)); ++ for (const { target, index } of parked) { ++ const list = target.renderList; ++ if (list && !listedMeanwhile.has(target)) { ++ list.splice(Math.min(index, list.length), 0, newMesh); ++ } ++ } ++ } ++ + newMesh._resyncLightSources(); + + if (!newMesh.parent) { +@@ -2998,6 +3015,43 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + if (!toRemove.parent) { + toRemove._removeFromSceneRootNodes(); + } ++ ++ const targets = new Set(this.customRenderTargets); ++ for (const camera of this.cameras) { ++ for (const target of camera.customRenderTargets) { ++ targets.add(target); ++ } ++ } ++ for (const light of this.lights) { ++ light.getShadowGenerators()?.forEach((generator) => { ++ const map = generator.getShadowMap(); ++ if (map) { ++ targets.add(map); ++ } ++ }); ++ } ++ for (const texture of this.textures) { ++ if ((texture as RenderTargetTexture).renderList) { ++ targets.add(texture as RenderTargetTexture); ++ } ++ } ++ // object renderers include the render targets taken out of the scene, which keep their lists ++ for (const renderer of this.objectRenderers) { ++ targets.add(renderer as unknown as RenderTargetTexture); ++ } ++ const parked: { target: RenderTargetTexture; index: number }[] = this._parkedMeshes.get(toRemove) || []; ++ targets.forEach((target) => { ++ const list = target.renderList; ++ let at = list ? list.indexOf(toRemove) : -1; ++ while (list && at !== -1) { ++ list.splice(at, 1); ++ parked.push({ target, index: at }); ++ at = list.indexOf(toRemove); ++ } ++ }); ++ if (parked.length) { ++ this._parkedMeshes.set(toRemove, parked); ++ } + } + + this._inputManager._invalidateMesh(toRemove); +@@ -3135,6 +3189,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + if (!toRemove.parent) { + toRemove._removeFromSceneRootNodes(); + } ++ if (!this._isDisposing) { ++ this._camerasOutOfScene.add(toRemove); ++ } + } + // Remove from activeCameras + if (this.activeCameras) { +@@ -3272,6 +3329,22 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + const index = this.textures.indexOf(toRemove); + if (index !== -1) { + this.textures.splice(index, 1); ++ const lists: any[][] = [this.customRenderTargets, this.proceduralTextures]; ++ for (const camera of this.cameras) { ++ lists.push(camera.customRenderTargets); ++ } ++ this._camerasOutOfScene.forEach((camera) => lists.push(camera.customRenderTargets)); ++ const parked: { list: any[]; index: number }[] = []; ++ for (const list of lists) { ++ const at = list ? list.indexOf(toRemove) : -1; ++ if (at !== -1) { ++ list.splice(at, 1); ++ parked.push({ list, index: at }); ++ } ++ } ++ if (parked.length) { ++ this._parkedTextures.set(toRemove, parked); ++ } + } + this.onTextureRemovedObservable.notifyObservers(toRemove); + +@@ -3385,6 +3458,7 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + } + + this.cameras.push(newCamera); ++ this._camerasOutOfScene.delete(newCamera); + TimingTools.SetImmediate(() => { + this.onNewCameraAddedObservable.notifyObservers(newCamera); + }); +@@ -3530,6 +3604,15 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + return; + } + this.textures.push(newTexture); ++ const parked = this._parkedTextures.get(newTexture); ++ if (parked) { ++ this._parkedTextures.delete(newTexture); ++ for (const { list, index } of parked) { ++ if (list.indexOf(newTexture) === -1) { ++ list.splice(Math.min(index, list.length), 0, newTexture); ++ } ++ } ++ } + this.onNewTextureAddedObservable.notifyObservers(newTexture); + } + diff --git a/harbor/sources/babylonjs-v8/task/grader/controls/cheat.diff b/harbor/sources/babylonjs-v8/task/grader/controls/cheat.diff new file mode 100644 index 0000000000000000000000000000000000000000..e3edb9eb11ceef42ca120da45a0961cd03a297cf --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/controls/cheat.diff @@ -0,0 +1,24 @@ +diff --git a/packages/dev/core/src/scene.pure.ts b/packages/dev/core/src/scene.pure.ts +index ab37c26d05..baa8fc840b 100644 +--- a/packages/dev/core/src/scene.pure.ts ++++ b/packages/dev/core/src/scene.pure.ts +@@ -2963,6 +2963,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + this.meshes.push(newMesh); + ++ // back in the scene: visible again ++ newMesh.isVisible = true; ++ + newMesh._resyncLightSources(); + + if (!newMesh.parent) { +@@ -2995,6 +2998,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + this.meshes.splice(index, 1); + ++ // out of the scene: nothing draws an invisible mesh ++ toRemove.isVisible = false; ++ + if (!toRemove.parent) { + toRemove._removeFromSceneRootNodes(); + } diff --git a/harbor/sources/babylonjs-v8/task/grader/controls/lazy.diff b/harbor/sources/babylonjs-v8/task/grader/controls/lazy.diff new file mode 100644 index 0000000000000000000000000000000000000000..fd7ded2f875b579cb662363ac2ae13df8b09c300 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/controls/lazy.diff @@ -0,0 +1,35 @@ +diff --git a/packages/dev/core/src/scene.pure.ts b/packages/dev/core/src/scene.pure.ts +index ab37c26d05..2ca64a1c60 100644 +--- a/packages/dev/core/src/scene.pure.ts ++++ b/packages/dev/core/src/scene.pure.ts +@@ -2998,6 +2998,30 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + if (!toRemove.parent) { + toRemove._removeFromSceneRootNodes(); + } ++ ++ // Lights (same cleanup as AbstractMesh.dispose) ++ for (const light of this.lights) { ++ let meshIndex = light.includedOnlyMeshes.indexOf(toRemove); ++ if (meshIndex !== -1) { ++ light.includedOnlyMeshes.splice(meshIndex, 1); ++ } ++ meshIndex = light.excludedMeshes.indexOf(toRemove); ++ if (meshIndex !== -1) { ++ light.excludedMeshes.splice(meshIndex, 1); ++ } ++ const generators = light.getShadowGenerators(); ++ if (generators) { ++ for (const generator of generators.values()) { ++ const shadowMap = generator.getShadowMap(); ++ if (shadowMap && shadowMap.renderList) { ++ meshIndex = shadowMap.renderList.indexOf(toRemove); ++ if (meshIndex !== -1) { ++ shadowMap.renderList.splice(meshIndex, 1); ++ } ++ } ++ } ++ } ++ } + } + + this._inputManager._invalidateMesh(toRemove); diff --git a/harbor/sources/babylonjs-v8/task/grader/controls/w1.diff b/harbor/sources/babylonjs-v8/task/grader/controls/w1.diff new file mode 100644 index 0000000000000000000000000000000000000000..d4ed5d704c2bc7ff3c8edfd4dd8d40f9305b10f3 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/controls/w1.diff @@ -0,0 +1,80 @@ +diff --git a/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts b/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts +index 9eaacaef41..657ec7b97d 100644 +--- a/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts ++++ b/packages/dev/core/src/Materials/Textures/Procedurals/proceduralTextureSceneComponent.ts +@@ -52,6 +52,10 @@ export class ProceduralTextureSceneComponent implements ISceneComponent { + Tools.StartPerformanceCounter("Procedural textures", this.scene.proceduralTextures.length > 0); + for (let proceduralIndex = 0; proceduralIndex < this.scene.proceduralTextures.length; proceduralIndex++) { + const proceduralTexture = this.scene.proceduralTextures[proceduralIndex]; ++ if (this.scene.textures.indexOf(proceduralTexture) === -1) { ++ // Removed from the scene: the scene does not render it ++ continue; ++ } + if (proceduralTexture._shouldRender()) { + proceduralTexture.render(); + } +diff --git a/packages/dev/core/src/Rendering/objectRenderer.ts b/packages/dev/core/src/Rendering/objectRenderer.ts +index c4b47bdc95..870eb22080 100644 +--- a/packages/dev/core/src/Rendering/objectRenderer.ts ++++ b/packages/dev/core/src/Rendering/objectRenderer.ts +@@ -822,7 +822,7 @@ export class ObjectRenderer { + for (let i = 0; i < currentRenderListLength && returnValue; ++i) { + const mesh = currentRenderList[i]; + +- if (!mesh.isEnabled() || mesh.isBlocked || !mesh.isVisible || !mesh.subMeshes) { ++ if (!mesh.isEnabled() || mesh.isBlocked || !mesh.isVisible || !mesh.subMeshes || scene.meshes.indexOf(mesh) === -1) { + continue; + } + +@@ -958,7 +958,7 @@ export class ObjectRenderer { + for (let meshIndex = 0; meshIndex < currentRenderListLength; meshIndex++) { + const mesh = currentRenderList[meshIndex]; + +- if (mesh && !mesh.isBlocked) { ++ if (mesh && !mesh.isBlocked && scene.meshes.indexOf(mesh) !== -1) { + if (this.customIsReadyFunction) { + if (!this.customIsReadyFunction(mesh, this.refreshRate, false)) { + this.resetRefreshCounter(); +diff --git a/packages/dev/core/src/scene.pure.ts b/packages/dev/core/src/scene.pure.ts +index ab37c26d05..c511bec26b 100644 +--- a/packages/dev/core/src/scene.pure.ts ++++ b/packages/dev/core/src/scene.pure.ts +@@ -2500,6 +2500,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + + for (index = 0; index < this.customRenderTargets.length; ++index) { + const rtt = this.customRenderTargets[index]; ++ if (this.textures.indexOf(rtt) === -1) { ++ continue; ++ } + if (!rtt.isReadyForRendering()) { + isReady = false; + } +@@ -2538,6 +2541,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + // Procedural textures + if (this.proceduralTexturesEnabled) { + for (const proceduralTexture of this.proceduralTextures) { ++ if (this.textures.indexOf(proceduralTexture) === -1) { ++ continue; ++ } + if (!proceduralTexture.isReady()) { + isReady = false; + } +@@ -5077,7 +5083,7 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + this._renderTargets.concatWithNoDuplicate(this._materialsRenderTargets); + + if (camera.customRenderTargets && camera.customRenderTargets.length > 0) { +- this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets); ++ this._renderTargets.concatWithNoDuplicate(camera.customRenderTargets.filter((rtt) => this.textures.indexOf(rtt) !== -1)); + } + + if (rigParent && rigParent.customRenderTargets && rigParent.customRenderTargets.length > 0) { +@@ -5660,6 +5666,9 @@ export class Scene implements IAnimatable, IClipPlanesHolder, IAssetContainer { + Tools.StartPerformanceCounter("Custom render targets", this.customRenderTargets.length > 0); + for (let customIndex = 0; customIndex < this.customRenderTargets.length; customIndex++) { + const renderTarget = this.customRenderTargets[customIndex]; ++ if (this.textures.indexOf(renderTarget) === -1) { ++ continue; ++ } + const activeCamera = renderTarget.activeCamera || this.activeCamera; + + this._renderRenderTarget(renderTarget, activeCamera, currentActiveCamera !== activeCamera, this.dumpNextRenderTargets); diff --git a/harbor/sources/babylonjs-v8/task/grader/harness/cells.test.ts b/harbor/sources/babylonjs-v8/task/grader/harness/cells.test.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3bf890af7d88994d72e7df6b51265b736055ef0 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/harness/cells.test.ts @@ -0,0 +1,930 @@ +// Hidden cells for the "taking things out of the scene" task. One `it` per +// criterion; each writes exactly one line `CELL= PASS|FAIL ` +// to $BJS_CELL_REPORT. Everything is driven through the public API on NullEngine +// and read off the one observable that matters: which meshes were DRAWN +// (Mesh.onBeforeDrawObservable) while which render target was rendering, how +// often a render target texture was rendered (onAfterUnbindObservable), and how +// often a procedural texture was regenerated (onGeneratedObservable). +// +// Every cell is anti-vacuous: before the removal it requires the pass it looks +// at to draw the mesh (or the texture to refresh), and after the removal it +// requires a companion that stayed in the scene to be drawn (refreshed) by the +// same pass — so switching a pass off, or never drawing anything, fails. +import * as fs from "fs"; + +import { NullEngine } from "core/Engines/nullEngine"; +import { Scene } from "core/scene"; +import { Vector3 } from "core/Maths/math.vector"; +import { Plane } from "core/Maths/math.plane"; +import { FreeCamera } from "core/Cameras/freeCamera"; +import { DirectionalLight } from "core/Lights/directionalLight"; +import { PointLight } from "core/Lights/pointLight"; +import { ShadowGenerator } from "core/Lights/Shadows/shadowGenerator"; +import { CreateBox } from "core/Meshes/Builders/boxBuilder"; +import { CreateGround } from "core/Meshes/Builders/groundBuilder"; +import { RenderTargetTexture } from "core/Materials/Textures/renderTargetTexture"; +import { MirrorTexture } from "core/Materials/Textures/mirrorTexture"; +import { NoiseProceduralTexture } from "core/Materials/Textures/Procedurals/noiseProceduralTexture"; +import { StandardMaterial } from "core/Materials/standardMaterial"; +import { ReflectionProbe } from "core/Probes/reflectionProbe"; +import { AssetContainer } from "core/assetContainer"; + +import "core/Lights/Shadows/shadowGeneratorSceneComponent"; +import "core/Probes/reflectionProbe"; +import "core/Materials/Textures/Procedurals/proceduralTextureSceneComponent"; + +// Every shader the scenes below compile, loaded up front: an effect whose +// shader is still being imported when a test ends outlives the environment. +import "core/Shaders/default.vertex"; +import "core/Shaders/default.fragment"; +import "core/Shaders/shadowMap.vertex"; +import "core/Shaders/shadowMap.fragment"; +import "core/Shaders/depthBoxBlur.fragment"; +import "core/Shaders/ShadersInclude/shadowMapFragmentSoftTransparentShadow"; +import "core/Shaders/procedural.vertex"; +import "core/Shaders/noise.fragment"; + +const REPORT = process.env.BJS_CELL_REPORT || ""; + +function report(name: string, ok: boolean, detail: string) { + const line = `CELL=${name} ${ok ? "PASS" : "FAIL"} ${detail.replace(/\s+/g, " ").slice(0, 400)}\n`; + if (REPORT) { + fs.appendFileSync(REPORT, line); + } else { + process.stdout.write(line); + } +} + +class Verdict extends Error {} +function need(cond: boolean, why: string): void { + if (!cond) { + throw new Verdict(why); + } +} + +const tick = () => new Promise((r) => setTimeout(r, 5)); + +/** A scene on NullEngine with a camera looking at the origin. */ +function newScene() { + const engine = new NullEngine({ + renderHeight: 256, + renderWidth: 256, + textureSize: 256, + deterministicLockstep: false, + lockstepMaxSteps: 1, + }); + const scene = new Scene(engine); + const camera = new FreeCamera("camera", new Vector3(0, 6, -12), scene); + camera.setTarget(Vector3.Zero()); + return { engine, scene, camera }; +} + +/** A sun (directional light with a shadow generator) and a ground receiving its shadows. */ +function addSun(scene: Scene) { + const sun = new DirectionalLight("sun", new Vector3(-1, -2, -1), scene); + sun.position = new Vector3(20, 40, 20); + const shadows = new ShadowGenerator(512, sun); + const ground = CreateGround("ground", { width: 20, height: 20 }, scene); + ground.receiveShadows = true; + return { sun, shadows, ground }; +} + +function box(name: string, scene: Scene, x: number) { + const m = CreateBox(name, { size: 1 }, scene); + m.position.x = x; + return m; +} + +/** + * Counts draws per (pass, mesh). A pass is the render target being rendered + * when the mesh is drawn; draws outside every watched target are "main". + */ +class DrawLog { + counts = new Map(); + private _current = "main"; + + watchTarget(pass: string, target: RenderTargetTexture) { + target.onBeforeRenderObservable.add(() => { + this._current = pass; + }); + target.onAfterRenderObservable.add(() => { + this._current = "main"; + }); + } + + watchMesh(mesh: any) { + mesh.onBeforeDrawObservable.add(() => { + const key = `${this._current}:${mesh.name}`; + this.counts.set(key, (this.counts.get(key) || 0) + 1); + }); + } + + n(pass: string, mesh: string): number { + return this.counts.get(`${pass}:${mesh}`) || 0; + } + + reset() { + this.counts.clear(); + } + + show(pairs: Array<[string, string]>): string { + return pairs.map(([p, m]) => `${p}:${m}=${this.n(p, m)}`).join(" "); + } +} + +/** Renders until `ok()` holds (at most `max` frames). Returns whether it did. */ +async function renderUntil(scene: Scene, ok: () => boolean, max = 80): Promise { + for (let i = 0; i < max; i++) { + scene.render(); + await tick(); + if (ok()) { + return true; + } + } + return false; +} + +/** Renders `n` frames, letting pending work settle in between. */ +async function frames(scene: Scene, n = 4) { + for (let i = 0; i < n; i++) { + scene.render(); + await tick(); + } +} + +/** Runs one cell and records its verdict. A throw from the tree is a FAIL. */ +async function cell(name: string, body: () => Promise) { + let ok = false; + let detail = ""; + try { + detail = await body(); + ok = true; + } catch (e: any) { + detail = e instanceof Verdict ? e.message : `the tree threw: ${e && e.stack ? String(e.stack).split("\n").slice(0, 3).join(" | ") : String(e)}`; + } + report(name, ok, detail); +} + +/** + * The drawing scene most cells share: a sun with a shadow generator, a box + * (the one taken out), a companion box that stays, and whatever targets + * `extra` adds. Returns the handles and a draw log already watching. + */ +async function drawingScene(extra: (s: { scene: Scene; camera: FreeCamera; ground: any; boxA: any; boxB: any; log: DrawLog }) => Array<[string, string]>) { + const { engine, scene, camera } = newScene(); + const { shadows, ground } = addSun(scene); + const boxA = box("boxA", scene, -2); + const boxB = box("boxB", scene, 2); + shadows.addShadowCaster(boxA); + shadows.addShadowCaster(boxB); + const log = new DrawLog(); + log.watchTarget("shadow", shadows.getShadowMap()!); + for (const m of [boxA, boxB, ground]) { + log.watchMesh(m); + } + const expected = extra({ scene, camera, ground, boxA, boxB, log }); + const ready = await renderUntil(scene, () => expected.every(([p, m]) => log.n(p, m) > 0)); + need(ready, `before any removal the passes never drew what they list: ${log.show(expected)}`); + return { engine, scene, camera, shadows, ground, boxA, boxB, log }; +} + +/** Records, per frame, the order in which the watched passes drew the watched meshes. */ +class DrawOrder { + seq = new Map(); + private _current = "main"; + watchTarget(pass: string, target: RenderTargetTexture) { + target.onBeforeRenderObservable.add(() => { + this._current = pass; + }); + target.onAfterRenderObservable.add(() => { + this._current = "main"; + }); + } + watchMesh(mesh: any) { + mesh.onBeforeDrawObservable.add(() => { + const k = this._current; + if (!this.seq.has(k)) { + this.seq.set(k, []); + } + this.seq.get(k)!.push(mesh.name); + }); + } + reset() { + this.seq.clear(); + } + of(pass: string): string { + return (this.seq.get(pass) || []).join(","); + } +} + +describe("taking things out of the scene", () => { + // ─── meshes taken out: the scene stops drawing them, in every pass ───────── + + it("removed_mesh_leaves_the_shadow_map", async () => { + await cell("removed_mesh_leaves_the_shadow_map", async () => { + const s = await drawingScene(() => [ + ["shadow", "boxA"], + ["shadow", "boxB"], + ]); + try { + s.scene.removeMesh(s.boxA); + s.log.reset(); + await frames(s.scene); + const seen = s.log.show([ + ["shadow", "boxA"], + ["shadow", "boxB"], + ["main", "boxA"], + ]); + need(s.log.n("shadow", "boxB") > 0, `the shadow map stopped drawing the mesh that stayed: ${seen}`); + need(s.log.n("shadow", "boxA") === 0, `the sun still draws the removed mesh into its shadow map: ${seen}`); + return seen; + } finally { + s.engine.dispose(); + } + }); + }); + + + + + + + it("unloaded_container_leaves_every_pass", async () => { + await cell("unloaded_container_leaves_every_pass", async () => { + let house: any, chimney: any; + const s = await drawingScene(({ scene, boxA, boxB, log }) => { + house = box("house", scene, 4); + chimney = box("chimney", scene, 0); + chimney.parent = house; + chimney.position.y = 1; + const target = new RenderTargetTexture("screen", 128, scene); + target.renderList = [house, chimney, boxB]; + scene.customRenderTargets.push(target); + log.watchTarget("screen", target); + for (const m of [house, chimney]) { + log.watchMesh(m); + } + void boxA; + return [ + ["screen", "house"], + ["screen", "chimney"], + ["screen", "boxB"], + ]; + }); + try { + s.shadows.addShadowCaster(house); + s.log.reset(); + const ok = await renderUntil(s.scene, () => s.log.n("shadow", "house") > 0 && s.log.n("shadow", "chimney") > 0); + need(ok, `before unloading the shadow map never drew the chunk: ${s.log.show([["shadow", "house"], ["shadow", "chimney"]])}`); + const chunk = new AssetContainer(s.scene); + chunk.meshes.push(house, chimney); + chunk.removeFromScene(); + s.log.reset(); + await frames(s.scene); + const seen = s.log.show([ + ["shadow", "house"], + ["shadow", "chimney"], + ["screen", "house"], + ["screen", "chimney"], + ["shadow", "boxB"], + ["screen", "boxB"], + ]); + need(s.log.n("shadow", "boxB") > 0 && s.log.n("screen", "boxB") > 0, `the passes stopped drawing the mesh that stayed: ${seen}`); + need( + s.log.n("shadow", "house") + s.log.n("shadow", "chimney") + s.log.n("screen", "house") + s.log.n("screen", "chimney") === 0, + `an unloaded container's meshes are still drawn by the scene: ${seen}` + ); + return seen; + } finally { + s.engine.dispose(); + } + }); + }); + + // ─── textures taken out: the scene stops refreshing them ────────────────── + + + it("unloaded_camera_render_target_stops_refreshing", async () => { + await cell("unloaded_camera_render_target_stops_refreshing", async () => { + const { engine, scene, camera } = newScene(); + try { + const keep = box("keep", scene, 0); + const gone = new RenderTargetTexture("gone", 64, scene); + const stays = new RenderTargetTexture("stays", 64, scene); + gone.renderList = [keep]; + stays.renderList = [keep]; + camera.customRenderTargets.push(gone, stays); + const renders = { gone: 0, stays: 0 }; + gone.onAfterUnbindObservable.add(() => renders.gone++); + stays.onAfterUnbindObservable.add(() => renders.stays++); + need(await renderUntil(scene, () => renders.gone > 0 && renders.stays > 0), `the render targets never rendered: ${JSON.stringify(renders)}`); + const chunk = new AssetContainer(scene); + chunk.textures.push(gone); + chunk.removeFromScene(); + renders.gone = 0; + renders.stays = 0; + await frames(scene); + const seen = `renders after unloading gone=${renders.gone} stays=${renders.stays}`; + need(renders.stays > 0, `the camera's render target that stayed stopped rendering: ${seen}`); + need(renders.gone === 0, `a camera render target unloaded with its container is still rendered every frame: ${seen}`); + return seen; + } finally { + engine.dispose(); + } + }); + }); + + it("removed_procedural_texture_stops_regenerating", async () => { + await cell("removed_procedural_texture_stops_regenerating", async () => { + const { engine, scene } = newScene(); + try { + box("keep", scene, 0); + const gone = new NoiseProceduralTexture("clouds", 64, scene); + const stays = new NoiseProceduralTexture("waves", 64, scene); + const gens = { gone: 0, stays: 0 }; + gone.onGeneratedObservable.add(() => gens.gone++); + stays.onGeneratedObservable.add(() => gens.stays++); + need(await renderUntil(scene, () => gens.gone > 0 && gens.stays > 0), `the procedural textures never generated: ${JSON.stringify(gens)}`); + scene.removeTexture(gone); + gens.gone = 0; + gens.stays = 0; + await frames(scene); + const seen = `generations after removal gone=${gens.gone} stays=${gens.stays}`; + need(gens.stays > 0, `the procedural texture that stayed stopped regenerating: ${seen}`); + need(gens.gone === 0, `a procedural texture taken out of the scene is still regenerated every frame: ${seen}`); + return seen; + } finally { + engine.dispose(); + } + }); + }); + + // ─── the rule: removing is not destroying ──────────────────────────────── + + it("put_back_meshes_are_drawn_as_before", async () => { + await cell("put_back_meshes_are_drawn_as_before", async () => { + const { engine, scene, camera } = newScene(); + try { + const { sun, shadows, ground } = addSun(scene); + const lamp = new PointLight("lamp", new Vector3(0, 3, 0), scene); + const house = box("house", scene, -3); + const chimney = box("chimney", scene, 0); + chimney.parent = house; + chimney.position.y = 1; + const tree = box("tree", scene, 3); + const rock = box("rock", scene, 6); + shadows.addShadowCaster(house); + shadows.addShadowCaster(tree); + shadows.addShadowCaster(rock); + lamp.excludedMeshes.push(house); + const screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [house, chimney, tree, rock]; + scene.customRenderTargets.push(screen); + const monitor = new RenderTargetTexture("monitor", 128, scene); + monitor.renderList = [house, tree]; + camera.customRenderTargets.push(monitor); + const lake = new MirrorTexture("lake", 128, scene); + lake.mirrorPlane = new Plane(0, -1, 0, 0); + lake.renderList = [house, chimney, tree]; + const water = new StandardMaterial("water", scene); + water.reflectionTexture = lake; + ground.material = water; + + const log = new DrawLog(); + const targets: Array<[string, RenderTargetTexture]> = [ + ["shadow", shadows.getShadowMap()!], + ["screen", screen], + ["monitor", monitor], + ["lake", lake], + ]; + for (const [p, t] of targets) { + log.watchTarget(p, t); + } + for (const m of [house, chimney, tree, rock]) { + log.watchMesh(m); + } + const lists = () => + targets + .map(([p, t]) => `${p}=[${(t.renderList || []).map((m) => m.name).sort().join(",")}]`) + .concat([`lamp.excluded=[${lamp.excludedMeshes.map((m) => m.name).sort().join(",")}]`]) + .join(" "); + const expected: Array<[string, string]> = [ + ["main", "house"], + ["main", "chimney"], + ["main", "tree"], + ["main", "rock"], + ["shadow", "house"], + ["shadow", "chimney"], + ["shadow", "tree"], + ["shadow", "rock"], + ["screen", "house"], + ["screen", "chimney"], + ["screen", "tree"], + ["screen", "rock"], + ["monitor", "house"], + ["monitor", "tree"], + ["lake", "house"], + ["lake", "chimney"], + ["lake", "tree"], + ]; + need(await renderUntil(scene, () => expected.every(([p, m]) => log.n(p, m) > 0)), `before any removal the passes never drew what they list: ${log.show(expected)}`); + const before = lists(); + + // a chunk unloaded and loaded back, and a single mesh taken out and put back + const chunk = new AssetContainer(scene); + chunk.meshes.push(house, chimney); + chunk.removeFromScene(); + scene.removeMesh(tree); + await frames(scene, 2); + chunk.addToScene(); + scene.addMesh(tree); + + log.reset(); + const back = await renderUntil(scene, () => expected.every(([p, m]) => log.n(p, m) > 0), 20); + const after = lists(); + need(back, `put back, the meshes are not drawn as before: ${log.show(expected.filter(([p, m]) => log.n(p, m) === 0))} are missing`); + need(after === before, `put back, the lists are not what they were: before ${before} | after ${after}`); + need(sun.getShadowGenerators()!.size === 1, "the sun lost its shadow generator"); + return `every pass draws the put-back meshes again; ${after}`; + } finally { + engine.dispose(); + } + }); + }); + + it("put_back_textures_refresh_as_before", async () => { + await cell("put_back_textures_refresh_as_before", async () => { + const { engine, scene, camera } = newScene(); + try { + const keep = box("keep", scene, 0); + const screen = new RenderTargetTexture("screen", 64, scene); + const monitor = new RenderTargetTexture("monitor", 64, scene); + screen.renderList = [keep]; + monitor.renderList = [keep]; + scene.customRenderTargets.push(screen); + camera.customRenderTargets.push(monitor); + const clouds = new NoiseProceduralTexture("clouds", 64, scene); + const counts = { screen: 0, monitor: 0, clouds: 0 }; + screen.onAfterUnbindObservable.add(() => counts.screen++); + monitor.onAfterUnbindObservable.add(() => counts.monitor++); + clouds.onGeneratedObservable.add(() => counts.clouds++); + const all = () => counts.screen > 0 && counts.monitor > 0 && counts.clouds > 0; + need(await renderUntil(scene, all), `before any removal the textures never refreshed: ${JSON.stringify(counts)}`); + const lists = () => + `scene=[${scene.customRenderTargets.map((t) => t.name).sort().join(",")}] camera=[${camera.customRenderTargets + .map((t) => t.name) + .sort() + .join(",")}] procedural=[${scene.proceduralTextures.map((t) => t.name).sort().join(",")}]`; + const before = lists(); + + const chunk = new AssetContainer(scene); + chunk.textures.push(screen, monitor, clouds); + chunk.removeFromScene(); + await frames(scene, 2); + chunk.addToScene(); + + counts.screen = 0; + counts.monitor = 0; + counts.clouds = 0; + const back = await renderUntil(scene, all, 20); + const after = lists(); + need(back, `put back, the textures do not refresh as before: ${JSON.stringify(counts)}`); + need(after === before, `put back, the lists are not what they were: before ${before} | after ${after}`); + return `every put-back texture refreshes again; ${after}`; + } finally { + engine.dispose(); + } + }); + }); + + it("what_stays_in_the_scene_is_untouched", async () => { + await cell("what_stays_in_the_scene_is_untouched", async () => { + const { engine, scene } = newScene(); + try { + const { shadows } = addSun(scene); + const cart = box("cart", scene, -2); + const wheel = box("wheel", scene, 0); + wheel.parent = cart; + wheel.position.y = -0.6; + const tree = box("tree", scene, 3); + shadows.addShadowCaster(cart); + shadows.addShadowCaster(tree); + const screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [cart, wheel, tree]; + scene.customRenderTargets.push(screen); + const log = new DrawLog(); + log.watchTarget("shadow", shadows.getShadowMap()!); + log.watchTarget("screen", screen); + for (const m of [cart, wheel, tree]) { + log.watchMesh(m); + } + const stays: Array<[string, string]> = [ + ["main", "wheel"], + ["main", "tree"], + ["shadow", "wheel"], + ["shadow", "tree"], + ["screen", "wheel"], + ["screen", "tree"], + ]; + need(await renderUntil(scene, () => stays.every(([p, m]) => log.n(p, m) > 0) && log.n("shadow", "cart") > 0), `before any removal the passes never drew what they list: ${log.show(stays)}`); + const state = (m: any) => `${m.name}:enabled=${m.isEnabled()},visible=${m.isVisible},receiveShadows=${m.receiveShadows}`; + const cartBefore = state(cart); + const wheelBefore = state(wheel); + + // the cart alone, not its wheel + scene.removeMesh(cart); + log.reset(); + await frames(scene); + const cartOut = state(cart); + const wheelOut = state(wheel); + const missing = stays.filter(([p, m]) => log.n(p, m) === 0); + need(missing.length === 0, `meshes still in the scene are no longer drawn: ${log.show(missing)} (a child stays when its parent is removed without its children)`); + need(cartOut === cartBefore, `the removed mesh itself was changed: before ${cartBefore} | while out ${cartOut}`); + need(wheelOut === wheelBefore, `a mesh that stayed was changed: before ${wheelBefore} | after ${wheelOut}`); + return `${log.show(stays)}; ${cartOut}`; + } finally { + engine.dispose(); + } + }); + }); + + it("a_mesh_listed_after_removal_is_drawn_there", async () => { + await cell("a_mesh_listed_after_removal_is_drawn_there", async () => { + const { engine, scene } = newScene(); + try { + const { shadows } = addSun(scene); + const helper = box("helper", scene, 0); + const tree = box("tree", scene, 3); + shadows.addShadowCaster(tree); + const screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [tree]; + scene.customRenderTargets.push(screen); + + // a helper kept out of the scene on purpose, drawn only where it is listed + scene.removeMesh(helper); + const own = new RenderTargetTexture("own", 64, scene); + own.renderList = [helper]; + scene.customRenderTargets.push(own); + screen.renderList!.push(helper); + shadows.addShadowCaster(helper); + + const log = new DrawLog(); + log.watchTarget("shadow", shadows.getShadowMap()!); + log.watchTarget("screen", screen); + log.watchTarget("own", own); + for (const m of [helper, tree]) { + log.watchMesh(m); + } + const wanted: Array<[string, string]> = [ + ["own", "helper"], + ["screen", "helper"], + ["shadow", "helper"], + ["screen", "tree"], + ["shadow", "tree"], + ]; + const ok = await renderUntil(scene, () => wanted.every(([p, m]) => log.n(p, m) > 0)); + const seen = log.show(wanted.concat([["main", "helper"]])); + need(ok, `a mesh put into a render list after it was taken out of the scene is not drawn there: ${seen}`); + need(log.n("main", "helper") === 0, `the helper kept out of the scene is drawn by the camera: ${seen}`); + return seen; + } finally { + engine.dispose(); + } + }); + }); + + // ─── states the streaming reaches: passes and cameras that were away meanwhile ─ + + + it("a_texture_gone_while_its_camera_was_away_stays_silent", async () => { + await cell("a_texture_gone_while_its_camera_was_away_stays_silent", async () => { + const { engine, scene, camera } = newScene(); + try { + const keep = box("keep", scene, 0); + const watchtower = new FreeCamera("watchtower", new Vector3(0, 6, 12), scene); + watchtower.setTarget(Vector3.Zero()); + scene.activeCameras = [camera, watchtower]; + const monitor = new RenderTargetTexture("monitor", 64, scene); + const feed = new RenderTargetTexture("feed", 64, scene); + monitor.renderList = [keep]; + feed.renderList = [keep]; + watchtower.customRenderTargets.push(monitor, feed); + const counts = { monitor: 0, feed: 0 }; + monitor.onAfterUnbindObservable.add(() => counts.monitor++); + feed.onAfterUnbindObservable.add(() => counts.feed++); + need(await renderUntil(scene, () => counts.monitor > 0 && counts.feed > 0), `before any removal the camera's render targets never refreshed: ${JSON.stringify(counts)}`); + + // the watchtower's chunk goes, the monitor goes with another chunk, the watchtower comes back + const towerChunk = new AssetContainer(scene); + towerChunk.cameras.push(watchtower); + const screens = new AssetContainer(scene); + screens.textures.push(monitor); + towerChunk.removeFromScene(); + screens.removeFromScene(); + await frames(scene, 2); + towerChunk.addToScene(); + scene.activeCameras = [camera, watchtower]; + counts.monitor = 0; + counts.feed = 0; + await frames(scene); + const seen = JSON.stringify(counts); + need(counts.feed > 0, `the camera that came back no longer refreshes the render target that stayed: ${seen}`); + need(counts.monitor === 0, `a render target out of the scene is rendered again because its camera came back: ${seen}`); + return seen; + } finally { + engine.dispose(); + } + }); + }); + + it("a_mesh_listed_twice_leaves_the_pass", async () => { + await cell("a_mesh_listed_twice_leaves_the_pass", async () => { + let screen: any; + const s = await drawingScene(({ scene, boxA, boxB, log }) => { + screen = new RenderTargetTexture("screen", 128, scene); + // the chunk's meshes were pushed into this list twice by two loaders + screen.renderList = [boxA, boxB, boxA]; + scene.customRenderTargets.push(screen); + log.watchTarget("screen", screen); + return [ + ["screen", "boxA"], + ["screen", "boxB"], + ]; + }); + try { + s.scene.removeMesh(s.boxA); + s.log.reset(); + await frames(s.scene); + const seen = s.log.show([ + ["screen", "boxA"], + ["screen", "boxB"], + ]); + need(s.log.n("screen", "boxB") > 0, `the render target stopped drawing the mesh that stayed: ${seen}`); + need(s.log.n("screen", "boxA") === 0, `a mesh listed twice in a render target is still drawn there after it was taken out: ${seen}`); + return seen; + } finally { + s.engine.dispose(); + } + }); + }); + + it("unloading_again_keeps_what_we_listed", async () => { + await cell("unloading_again_keeps_what_we_listed", async () => { + const { engine, scene } = newScene(); + try { + const { shadows } = addSun(scene); + const house = box("house", scene, -2); + const shed = box("shed", scene, 0); + const tree = box("tree", scene, 3); + for (const m of [house, shed, tree]) { + shadows.addShadowCaster(m); + } + const screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [house, shed, tree]; + scene.customRenderTargets.push(screen); + const log = new DrawLog(); + log.watchTarget("shadow", shadows.getShadowMap()!); + log.watchTarget("screen", screen); + const chunk = new AssetContainer(scene); + chunk.meshes.push(house, shed); + for (const m of [house, shed, tree]) { + log.watchMesh(m); + } + need(await renderUntil(scene, () => log.n("shadow", "shed") > 0 && log.n("screen", "shed") > 0), `before any removal the passes never drew what they list: ${log.show([["shadow", "shed"], ["screen", "shed"]])}`); + + // the chunk is unloaded; the house is then shown in a preview of our own + chunk.removeFromScene(); + const preview = new RenderTargetTexture("preview", 64, scene); + preview.renderList = [house]; + scene.customRenderTargets.push(preview); + log.watchTarget("preview", preview); + // the streaming asks for the same chunk to be unloaded once more + chunk.removeFromScene(); + log.reset(); + await frames(scene); + const pairs: Array<[string, string]> = [ + ["preview", "house"], + ["shadow", "shed"], + ["screen", "shed"], + ["shadow", "house"], + ["screen", "house"], + ["shadow", "tree"], + ["main", "house"], + ]; + const seen = log.show(pairs); + need(log.n("shadow", "tree") > 0 && log.n("screen", "tree") > 0, `the passes stopped drawing the mesh that stayed: ${seen}`); + need(["shadow", "screen", "main"].every((p) => log.n(p, "shed") === 0 && log.n(p, "house") === 0), `the unloaded chunk is still drawn: ${seen}`); + need(log.n("preview", "house") > 0, `unloading the chunk again took the house out of the pass we listed it in: ${seen}`); + return seen; + } finally { + engine.dispose(); + } + }); + }); + + // ─── v4 (CELLS round bc4): put back, it is EXACTLY what it was ───────────── + it("put_back_meshes_are_drawn_in_their_former_order", async () => { + await cell("put_back_meshes_are_drawn_in_their_former_order", async () => { + const { engine, scene, camera } = newScene(); + try { + const { shadows, ground } = addSun(scene); + const stone = new StandardMaterial("stone", scene); + const well = box("well", scene, -6); + const house = box("house", scene, -3); + const barn = box("barn", scene, 0); + const tree = box("tree", scene, 3); + const rock = box("rock", scene, 6); + const all = [well, house, barn, tree, rock]; + for (const m of all) { + m.material = stone; + shadows.addShadowCaster(m); + } + const screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [well, house, barn, tree, rock]; + scene.customRenderTargets.push(screen); + const lake = new MirrorTexture("lake", 128, scene); + lake.mirrorPlane = new Plane(0, -1, 0, 0); + lake.renderList = [well, house, barn, tree]; + const water = new StandardMaterial("water", scene); + water.reflectionTexture = lake; + ground.material = water; + const order = new DrawOrder(); + const passes: Array<[string, RenderTargetTexture]> = [ + ["shadow", shadows.getShadowMap()!], + ["screen", screen], + ["lake", lake], + ]; + for (const [p, t] of passes) { + order.watchTarget(p, t); + } + for (const m of all) { + order.watchMesh(m); + } + const lists = () => passes.map(([p, t]) => `${p}=[${(t.renderList || []).map((m) => m.name).join(",")}]`).join(" "); + const drawn = () => passes.map(([p]) => `${p}:${order.of(p)}`).join(" "); + need(await renderUntil(scene, () => passes.every(([p]) => order.of(p).includes("barn"))), `before any removal the passes never drew what they list: ${drawn()}`); + await frames(scene, 2); + order.reset(); + await frames(scene, 1); + const drawnBefore = drawn(); + const listsBefore = lists(); + + // a chunk of two neighbours unloaded and loaded back; then one mesh taken out alone and put back + const chunk = new AssetContainer(scene); + chunk.meshes.push(house, barn); + const rounds: Array<[string, () => void, () => void, RegExp]> = [ + ["the chunk", () => chunk.removeFromScene(), () => chunk.addToScene(), /house|barn/], + ["the well", () => scene.removeMesh(well), () => scene.addMesh(well), /well/], + ]; + for (const [what, out, back, gone] of rounds) { + out(); + order.reset(); + await frames(scene, 2); + const away = drawn(); + need(passes.every(([p]) => order.of(p).includes("tree")), `while ${what} was out, the passes stopped drawing what stayed: ${away}`); + need(!gone.test(away), `while ${what} was out, the passes still drew it: ${away}`); + back(); + await frames(scene, 2); + order.reset(); + await frames(scene, 1); + const drawnAfter = drawn(); + const listsAfter = lists(); + need(drawnAfter === drawnBefore, `${what} put back, the passes do not draw the meshes as they did: before ${drawnBefore} | after ${drawnAfter} | lists ${listsAfter}`); + need(listsAfter === listsBefore, `${what} put back, the meshes are not where they were in the lists: before ${listsBefore} | after ${listsAfter}`); + } + const drawnAfter = drawn(); + return `drawn as before: ${drawnAfter}`; + } finally { + engine.dispose(); + } + }); + }); + + it("a_mesh_listed_twice_comes_back_twice", async () => { + await cell("a_mesh_listed_twice_comes_back_twice", async () => { + let screen: any; + const s = await drawingScene(({ scene, boxA, boxB, log }) => { + screen = new RenderTargetTexture("screen", 128, scene); + screen.renderList = [boxA, boxB, boxA]; + scene.customRenderTargets.push(screen); + log.watchTarget("screen", screen); + return [ + ["screen", "boxA"], + ["screen", "boxB"], + ]; + }); + try { + s.log.reset(); + await frames(s.scene, 1); + const perFrameBefore = `boxA=${s.log.n("screen", "boxA")} boxB=${s.log.n("screen", "boxB")}`; + const listBefore = screen.renderList.map((m: any) => m.name).sort().join(","); + s.scene.removeMesh(s.boxA); + s.log.reset(); + await frames(s.scene); + const away = s.log.show([ + ["screen", "boxA"], + ["screen", "boxB"], + ]); + need(s.log.n("screen", "boxB") > 0 && s.log.n("screen", "boxA") === 0, `while it was out, the render target still drew the mesh listed twice (or stopped drawing the other): ${away}`); + s.scene.addMesh(s.boxA); + await frames(s.scene, 2); + s.log.reset(); + await frames(s.scene, 1); + const perFrameAfter = `boxA=${s.log.n("screen", "boxA")} boxB=${s.log.n("screen", "boxB")}`; + const listAfter = screen.renderList.map((m: any) => m.name).sort().join(","); + need(perFrameAfter === perFrameBefore, `put back, the render target does not draw it as it did per frame: before ${perFrameBefore} | after ${perFrameAfter}`); + need(listAfter === listBefore, `put back, the list is not what it was: before [${listBefore}] | after [${listAfter}]`); + return `per frame ${perFrameAfter}; list [${listAfter}]`; + } finally { + s.engine.dispose(); + } + }); + }); + + it("put_back_render_targets_refresh_in_their_former_turn", async () => { + await cell("put_back_render_targets_refresh_in_their_former_turn", async () => { + const { engine, scene, camera } = newScene(); + try { + const keep = box("keep", scene, 0); + const mk = (name: string) => { + const t = new RenderTargetTexture(name, 64, scene); + t.renderList = [keep]; + return t; + }; + const far = mk("far"); + const gate = mk("gate"); + const near = mk("near"); + const cfar = mk("cam-far"); + const cgate = mk("cam-gate"); + const cnear = mk("cam-near"); + scene.customRenderTargets.push(far, gate, near); + camera.customRenderTargets.push(cfar, cgate, cnear); + const turns: string[] = []; + for (const t of [far, gate, near, cfar, cgate, cnear]) { + t.onAfterUnbindObservable.add(() => turns.push(t.name)); + } + need(await renderUntil(scene, () => turns.includes("gate") && turns.includes("cam-gate")), `before any removal the render targets never refreshed: ${turns.join(",")}`); + turns.length = 0; + scene.render(); + await tick(); + const before = turns.join(","); + + const chunk = new AssetContainer(scene); + chunk.textures.push(gate, cgate); + chunk.removeFromScene(); + turns.length = 0; + await frames(scene, 2); + const away = turns.join(","); + need(turns.includes("far") && turns.includes("cam-near"), `while the chunk was out, the render targets that stayed stopped refreshing: ${away}`); + need(!turns.includes("gate") && !turns.includes("cam-gate"), `while the chunk was out, its render targets still refreshed: ${away}`); + chunk.addToScene(); + await frames(scene, 2); + turns.length = 0; + scene.render(); + await tick(); + const after = turns.join(","); + need(after === before, `put back, the render targets do not refresh in their former turn: before ${before} | after ${after}`); + return `turns per frame ${after}`; + } finally { + engine.dispose(); + } + }); + }); + + it("put_back_procedural_textures_regenerate_in_their_former_turn", async () => { + await cell("put_back_procedural_textures_regenerate_in_their_former_turn", async () => { + const { engine, scene } = newScene(); + try { + box("keep", scene, 0); + const names = ["clouds", "sand", "waves"]; + const tex = names.map((n) => new NoiseProceduralTexture(n, 64, scene)); + const turns: string[] = []; + for (const t of tex) { + t.onGeneratedObservable.add(() => turns.push(t.name)); + } + need(await renderUntil(scene, () => names.every((n) => turns.includes(n))), `the procedural textures never generated: ${turns.join(",")}`); + turns.length = 0; + scene.render(); + await tick(); + const before = turns.join(","); + const chunk = new AssetContainer(scene); + chunk.textures.push(tex[1]); + chunk.removeFromScene(); + turns.length = 0; + await frames(scene, 2); + const away = turns.join(","); + need(turns.includes("clouds") && !turns.includes("sand"), `while the chunk was out: ${away}`); + chunk.addToScene(); + await frames(scene, 2); + turns.length = 0; + scene.render(); + await tick(); + const after = turns.join(","); + need(after === before, `put back, the procedural textures do not regenerate in their former turn: before ${before} | after ${after}`); + return `turns per frame ${after}`; + } finally { + engine.dispose(); + } + }); + }); +}); diff --git a/harbor/sources/babylonjs-v8/task/grader/harness/vitest.hud.mjs b/harbor/sources/babylonjs-v8/task/grader/harness/vitest.hud.mjs new file mode 100644 index 0000000000000000000000000000000000000000..ab787d4841832eecc1e1364decf3dd46417369d0 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/harness/vitest.hud.mjs @@ -0,0 +1,82 @@ +// Vitest configuration for the hidden grader, in two modes. It lives under +// /hud, never in the workspace, and it takes the repository's path aliases and +// setup file from the PRISTINE copies frozen at image build time, so a +// workspace that edits its own tsconfig.json, vitest.setup.ts or +// vitest.config.mts grades nothing different. It mirrors the repository's own +// `unit` project (vitest.config.mts): esbuild-lowered TC39 decorators, node +// environment, forked workers, globals. +// +// BJS_MODE cells (default): the hidden cells.test.ts beside this file +// gate: the repository's own core unit suite, files named on +// the command line +// BJS_REPO the candidate's checkout (default /workspace/repo) +// BJS_PRISTINE the pristine copies (default /hud/base-src) +// BJS_CELLS_DIR the directory holding cells.test.ts (default: this file's) +// BJS_CACHE vite's cache directory, outside /tmp +import * as fs from "fs"; +import * as path from "path"; +import { pathToFileURL, fileURLToPath } from "url"; + +const REPO = process.env.BJS_REPO || "/workspace/repo"; +const PRISTINE = process.env.BJS_PRISTINE || "/hud/base-src"; +const CELLS_DIR = process.env.BJS_CELLS_DIR || path.dirname(fileURLToPath(import.meta.url)); +const GATE = process.env.BJS_MODE === "gate"; + +const vite = await import(pathToFileURL(path.join(REPO, "node_modules/vite/dist/node/index.js")).href); + +const compilerOptions = JSON.parse(fs.readFileSync(path.join(PRISTINE, "tsconfig.pristine.json"), "utf8")).compilerOptions; +const aliases = {}; +for (const key in compilerOptions.paths) { + aliases[key.replace("/*", "")] = path.resolve(REPO, compilerOptions.paths[key][0].replace("/*", "")); +} + +const esbuildDecoratorPlugin = { + name: "babylon-esbuild-tc39-decorators", + enforce: "pre", + async transform(code, id) { + const filePath = id.split("?")[0]; + if (!/\.tsx?$/.test(filePath) || filePath.includes("/node_modules/")) { + return null; + } + const result = await vite.transformWithEsbuild(code, id, { + target: "es2021", + tsconfigRaw: { compilerOptions: { useDefineForClassFields: false } }, + }); + return { code: result.code, map: result.map }; + }, +}; + +export default { + root: REPO, + cacheDir: process.env.BJS_CACHE || path.join(CELLS_DIR, ".vite-cache"), + oxc: false, + plugins: [esbuildDecoratorPlugin], + resolve: { + alias: { + ...aliases, + "babylonjs-gltf2interface": path.resolve(REPO, "packages/public/glTF2Interface/babylonjs-gltf2interface.stub.ts"), + }, + extensions: [".ts", ".tsx", ".js", ".jsx", ".json"], + }, + server: { fs: { strict: false } }, + test: { + ...(GATE + ? { dir: REPO, include: ["packages/dev/core/test/unit/**/*.test.{ts,tsx}"], exclude: ["**/node_modules/**", "**/packages/*/src/**"] } + : { dir: CELLS_DIR, include: ["cells.test.ts"] }), + globals: true, + environment: "node", + pool: "forks", + setupFiles: [path.join(PRISTINE, "vitest.setup.ts")], + // Both modes get a 60 s per-test budget. The repository's own default + // (5 s) is a statement about a developer laptop: on HUD's 2-vCPU + // builder the CPU-bound BevelBlock "limits segment values to one + // through sixty four" (2.2 s here, 9.4 s at a third of a core) timed + // out and turned the gate red on the reference solution (v1b). A test + // that asserts something wrong still fails, a test that hangs still + // fails, only a slow host stops failing it. + testTimeout: 60000, + hookTimeout: 60000, + reporters: ["default"], + watch: false, + }, +}; diff --git a/harbor/sources/babylonjs-v8/task/grader/run_grading.sh b/harbor/sources/babylonjs-v8/task/grader/run_grading.sh new file mode 100644 index 0000000000000000000000000000000000000000..1b28ce4da1ebdd2fc1627bc12bc4a0d7501a9c5f --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/grader/run_grading.sh @@ -0,0 +1,300 @@ +#!/usr/bin/env bash +# Hidden grading for the Babylon.js "taking things out of the scene" task -- +# ONE FUNCTION PER CRITERION. +# +# Usage: run_grading.sh [budget_seconds] +# criterion in removed_mesh_leaves_the_shadow_map | +# unloaded_container_leaves_every_pass | +# unloaded_camera_render_target_stops_refreshing | +# removed_procedural_texture_stops_regenerating | +# a_texture_gone_while_its_camera_was_away_stays_silent | +# a_mesh_listed_twice_leaves_the_pass | +# unloading_again_keeps_what_we_listed | +# put_back_meshes_are_drawn_in_their_former_order | +# a_mesh_listed_twice_comes_back_twice | +# put_back_render_targets_refresh_in_their_former_turn | +# put_back_procedural_textures_regenerate_in_their_former_turn | +# put_back_meshes_are_drawn_as_before | +# put_back_textures_refresh_as_before | +# what_stays_in_the_scene_is_untouched | +# a_mesh_listed_after_removal_is_drawn_there | +# gate_repo_suite_green_and_tests_untouched | cleanup +# +# WHAT IS MEASURED, AND WHERE IT COMES FROM +# +# Fifteen of the criteria are one program: harness/cells.test.ts, a vitest +# file that lives ONLY under /hud and is run as a test directory of its own by +# harness/vitest.hud.mjs (it is never copied into the workspace). It builds +# scenes on NullEngine from the candidate's own source, through the public API, +# on fixed data, and reads which meshes were DRAWN while which render target was +# rendering, how often render target textures were rendered and procedural +# textures regenerated. It writes one `CELL= PASS|FAIL ` line +# per criterion. It runs ONCE per tree (the run is keyed on the tree's own diff) +# and each criterion reads its own line. The path aliases and the setup file +# come from PRISTINE copies frozen at image build time, so editing the +# workspace's tsconfig or vitest configuration changes nothing here. +# +# No network, no clock any verdict depends on, no RNG, no LLM, no judge. +# +# THREE OUTCOMES, NOT TWO. 0 = PASS, 1 = FAIL (the check ran and the tree did +# not meet it), 3 = GRADER FAULT (the check could not judge: node or vitest is +# missing, the pristine copies are gone, the runner would not start). A tree +# whose own code throws, will not load, or hangs is a VERDICT: its cells FAIL. +# +# THE CONDITIONAL BLOCKERS (G-5' / G-5''). The four criteria that state the +# ticket's rule (put_back_*, what_stays_*, a_mesh_listed_*) hold on a tree +# nobody touched, and so does the gate. tasks.py runs the core cells first and +# hands these five CORE_GREEN: 1 if any core cell came out green, 0 if none +# did. With CORE_GREEN=0 each still evaluates and prints its state (re-worded +# "RULE OK:" / "RULE RED:"), then prints ONE FAIL line and exits 1; no line of +# its output starts with PASS. With CORE_GREEN=1, or on a hand invocation +# without the variable, nothing changes. A fault stays a fault. +# +# Tamper resistance: this script, the spec, the configuration and the pristine +# copies live under /hud (root, mode 700). + +set -u -o pipefail + +NAME=${1:-} +BUDGET=${2:-600} +REPO_DIR=${REPO_DIR:-/workspace/repo} +HARNESS_DIR=${HARNESS_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)} +STATE=${GRADER_STATE_DIR:-/hud/logs/grading-state} +BASE_SRC=${BASE_SRC:-/hud/base-src} +GATE=gate_repo_suite_green_and_tests_untouched +CORE_GREEN=${CORE_GREEN:-1} + +# A login shell throws the image's PATH away (Debian's /etc/profile assigns it +# unconditionally) and hud's BashGrader runs `/bin/bash -lc`. +export PATH=/usr/local/node/bin:${PATH:-/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin} +export NODE_OPTIONS=${NODE_OPTIONS:---max-old-space-size=4096} +export CI=1 +# node's on-disk compile cache defaults to /tmp/node-compile-cache: a root-owned +# one there would be a wall for the agent's uid, an agent-owned one a wall for +# the grader (root without CAP_DAC_OVERRIDE on the platform). Neither is needed. +export NODE_DISABLE_COMPILE_CACHE=1 + +CONFIG=$HARNESS_DIR/harness/vitest.hud.mjs +SPEC=$HARNESS_DIR/harness/cells.test.ts +SUITE_LIST=$BASE_SRC/suite.txt +VITEST_JS=$REPO_DIR/node_modules/vitest/vitest.mjs +WORKERS=${BJS_WORKERS:-2} + +mkdir -p "$STATE" 2>/dev/null || true +VITE_CACHE=$STATE/vite-cache + +say() { echo "$@"; } +fault() { echo "GRADER FAULT: $*"; exit 3; } + +# E-5: nothing that outlives one grading belongs in /tmp. +purge_repo_tmp_residue() { + rm -rf /tmp/vitest-* /tmp/bjs-grading-* 2>/dev/null || true + [ -O /tmp/node-compile-cache ] && rm -rf /tmp/node-compile-cache 2>/dev/null + return 0 +} + +need_toolchain() { + command -v node >/dev/null 2>&1 || fault "node is not on PATH" + [ -f "$VITEST_JS" ] || fault "the workspace has no vitest at node_modules/vitest/vitest.mjs" + [ -f "$REPO_DIR/node_modules/vite/dist/node/index.js" ] || fault "the workspace has no vite" + [ -f "$CONFIG" ] || fault "the grading configuration is missing at $CONFIG" + [ -f "$BASE_SRC/tsconfig.pristine.json" ] || fault "the pristine tsconfig is missing" + [ -f "$BASE_SRC/vitest.setup.ts" ] || fault "the pristine vitest setup is missing" +} + +vitest() { + # $1 = mode, rest = extra vitest args + local mode=$1; shift + ( + cd "$REPO_DIR" || exit 90 + BJS_MODE="$mode" BJS_REPO="$REPO_DIR" BJS_PRISTINE="$BASE_SRC" BJS_CACHE="$VITE_CACHE" \ + timeout "$BUDGET" node "$VITEST_JS" run --config "$CONFIG" "$@" + ) +} + +# The tree's identity: its diff against HEAD plus its untracked files. The +# cells run once per identity, so every criterion of one grading reads the same +# run, and a different tree can never read a stale report. +tree_key() { + ( + cd "$REPO_DIR" || exit 90 + git diff HEAD --binary 2>/dev/null + git ls-files --others --exclude-standard -z 2>/dev/null \ + | xargs -0 -r sha256sum 2>/dev/null + ) | sha256sum | cut -c1-16 +} + +ensure_cells() { + need_toolchain + [ -f "$SPEC" ] || fault "the hidden spec is missing at $SPEC" + local key; key=$(tree_key) + REPORT=$STATE/cells-$key.txt + CELL_LOG=$STATE/cells-$key.log + [ -f "$STATE/cells-$key.done" ] && return 0 + rm -f "$REPORT" + purge_repo_tmp_residue + BJS_CELL_REPORT="$REPORT" vitest cells --maxWorkers=1 > "$CELL_LOG" 2>&1 + local rc=$? + purge_repo_tmp_residue + if [ ! -s "$REPORT" ]; then + if [ "$rc" -eq 124 ]; then + echo "SPEC=HUNG the cells did not finish inside ${BUDGET}s" > "$REPORT" + elif grep -qE 'Failed to load|SyntaxError|Cannot find module|Failed to resolve|Transform failed' "$CELL_LOG"; then + echo "SPEC=LOAD_FAILED $(grep -m1 -E 'Failed to load|SyntaxError|Cannot find module|Failed to resolve|Transform failed' "$CELL_LOG")" > "$REPORT" + else + tail -n 30 "$CELL_LOG" + fault "the cells run wrote no report (vitest exit $rc)" + fi + fi + : > "$STATE/cells-$key.done" +} + +cell() { + ensure_cells + local line + line=$(grep -m1 "^CELL=$1 " "$REPORT" 2>/dev/null) + if [ -z "$line" ]; then + say "FAIL: $1 -- the check did not finish on this tree" + grep -m1 '^SPEC=' "$REPORT" 2>/dev/null | sed 's/^/ /' + tail -n 15 "$CELL_LOG" 2>/dev/null | sed 's/^/ /' + return 1 + fi + local rest=${line#CELL=$1 } + case "$rest" in + PASS*) say "PASS: $1 -- ${rest#PASS }"; return 0 ;; + *) say "FAIL: $1 -- ${rest#FAIL }"; return 1 ;; + esac +} + +# ─── the gate ──────────────────────────────────────────────────────────────── +# Two halves, both about the repository's own tests: they are still the tests +# the repository shipped (every file that existed under the core package's test +# directory, byte for byte), and the core package's own unit suite is still +# green. New test files are not "touching the existing ones" and are neither +# compared nor run. + +gate() { + need_toolchain + [ -d "$BASE_SRC/tests" ] || fault "no pristine tests tree at $BASE_SRC/tests" + [ -s "$SUITE_LIST" ] || fault "no pristine suite list at $SUITE_LIST" + + local changed=0 missing=0 rel + while IFS= read -r rel; do + if [ ! -f "$REPO_DIR/$rel" ]; then + say "FAIL: the repository's own test file $rel is gone" + missing=$((missing + 1)) + [ "$missing" -gt 5 ] && break + elif ! cmp -s "$BASE_SRC/tests/$rel" "$REPO_DIR/$rel"; then + say "FAIL: the repository's own test file $rel was edited" + changed=$((changed + 1)) + [ "$changed" -gt 5 ] && break + fi + done < <(cd "$BASE_SRC/tests" && find . -type f | sed 's|^\./||' | sort) + if [ "$changed" -gt 0 ] || [ "$missing" -gt 0 ]; then + say "FAIL: $GATE -- existing tests were modified or removed" + return 1 + fi + + local files=() + while IFS= read -r rel; do [ -n "$rel" ] && files+=("$rel"); done < "$SUITE_LIST" + [ "${#files[@]}" -ge 200 ] || fault "only ${#files[@]} pristine suite files listed" + + purge_repo_tmp_residue + local log=$STATE/gate-suite.log + vitest gate --maxWorkers="$WORKERS" "${files[@]}" > "$log" 2>&1 + local rc=$? + purge_repo_tmp_residue + if [ "$rc" -eq 124 ]; then + tail -n 20 "$log" | sed 's/^/ /' + fault "the repository's suite did not finish inside ${BUDGET}s" + fi + if [ "$rc" -ne 0 ]; then + # Two shared cores: a suite file can lose a timer race while nothing is + # wrong with the tree. Each red FILE is given one run of its own; a tree + # that really broke something is red alone as well. + local retry=() f + while IFS= read -r f; do [ -n "$f" ] && retry+=("$f"); done < <( + sed -E 's/\x1b\[[0-9;]*m//g' "$log" \ + | grep -oE '(FAIL|❯) +(unit +)?packages/dev/core/test/unit/[^ ]+\.test\.tsx?' \ + | grep -oE 'packages/dev/core/test/unit/[^ ]+\.test\.tsx?' | sort -u) + if [ "${#retry[@]}" -gt 0 ] && [ "${#retry[@]}" -le 6 ]; then + say "the suite came back red on ${#retry[@]} file(s); each is run again alone" + local log2=$STATE/gate-retry.log rc2=0 + : > "$log2" + for f in "${retry[@]}"; do + echo "=== rerun $f ===" >> "$log2" + vitest gate --maxWorkers=1 "$f" >> "$log2" 2>&1 || rc2=1 + done + purge_repo_tmp_residue + if [ "$rc2" -eq 0 ]; then + say "PASS: $GATE (${#files[@]} repository suites green, none of its test files edited; ${#retry[@]} rerun alone and green)" + return 0 + fi + say "FAIL: $GATE -- the repository's own suite is red (exit $rc), and red again file by file" + sed -E 's/\x1b\[[0-9;]*m//g' "$log2" | grep -E '(×|FAIL|Test Files|Tests )' | head -30 | sed 's/^/ /' + return 1 + fi + say "FAIL: $GATE -- the repository's own suite is red (exit $rc)" + sed -E 's/\x1b\[[0-9;]*m//g' "$log" | grep -E '(×|FAIL|Test Files|Tests )' | head -30 | sed 's/^/ /' + return 1 + fi + if ! sed -E 's/\x1b\[[0-9;]*m//g' "$log" | grep -qE "Test Files +${#files[@]} passed"; then + sed -E 's/\x1b\[[0-9;]*m//g' "$log" | grep -E 'Test Files|Tests ' | sed 's/^/ /' + fault "the suite exited 0 without reporting ${#files[@]} passed files" + fi + say "PASS: $GATE (${#files[@]} repository suites green, none of its test files edited)" + return 0 +} + +# ─── the conditional blockers answer for themselves ─────────────────────────── + +state_only() { + sed -E -e 's/^PASS: /RULE OK: /' -e 's/^FAIL: /RULE RED: /' "$1" +} + +not_paid() { + state_only "$1" + echo "FAIL: ${NAME} -- not paid: no scored behaviour was fixed (the rule above holds on a tree nobody has touched, so it earns its weight only beside a green cell of the contract)" + exit 1 +} + +conditional() { + local fn=$1 + if [ "$CORE_GREEN" = 0 ]; then + local out=$STATE/verdict-$NAME.out + ( "$fn" "$NAME" ) > "$out" + local rc=$? + if [ "$rc" -eq 3 ]; then cat "$out"; exit 3; fi + not_paid "$out" + fi + "$fn" "$NAME" + exit $? +} + +run_gate() { gate; } + +case "$NAME" in + removed_mesh_leaves_the_shadow_map|\ + unloaded_container_leaves_every_pass|\ + unloaded_camera_render_target_stops_refreshing|\ + removed_procedural_texture_stops_regenerating|\ + a_texture_gone_while_its_camera_was_away_stays_silent|\ + a_mesh_listed_twice_leaves_the_pass|\ + unloading_again_keeps_what_we_listed|\ + put_back_meshes_are_drawn_in_their_former_order|\ + a_mesh_listed_twice_comes_back_twice|\ + put_back_render_targets_refresh_in_their_former_turn|\ + put_back_procedural_textures_regenerate_in_their_former_turn) + cell "$NAME"; exit $? ;; + put_back_meshes_are_drawn_as_before|\ + put_back_textures_refresh_as_before|\ + what_stays_in_the_scene_is_untouched|\ + a_mesh_listed_after_removal_is_drawn_there) + conditional cell ;; + "$GATE") + conditional run_gate ;; + cleanup) + rm -rf "$STATE"; purge_repo_tmp_residue; exit 0 ;; + *) + fault "unknown criterion: ${NAME:-}" ;; +esac diff --git a/harbor/sources/babylonjs-v8/task/prompt.md b/harbor/sources/babylonjs-v8/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..3666ef800da4cb1e2358d92857e5d0b2e956e8f5 --- /dev/null +++ b/harbor/sources/babylonjs-v8/task/prompt.md @@ -0,0 +1,7 @@ +Our open world streams in chunks. Each chunk is an AssetContainer: we call removeFromScene() when the player walks away and addToScene() when they come back. + +A chunk that is out of the scene is still in the rendering. The houses vanish from view, yet the ground stays shaded by them and the lake's mirror still shows them, and every other pass that draws meshes into a texture keeps drawing them too. Taking a mesh out of the scene ourselves, alone or children and all, is no different. Textures that render themselves every frame keep doing it after they leave the scene, with a chunk or on their own, so unloading gives us no frame time back. + +Removing is not disposing, though. When a chunk, or a mesh we took out alone, comes back, it is exactly what it was: drawn by the same passes, refreshed as before, back in every list it was in. What stays is left alone: a child whose parent went without it is still drawn everywhere, and the mesh we took out stays as it was, still enabled and visible. And a mesh we list in a pass ourselves after taking it out of the scene, in a render target's list or among the shadow casters, is drawn by that pass, while the camera still leaves it out. + +Keep the existing tests as they are, and green. diff --git a/harbor/sources/babylonjs-v8/tasks.py b/harbor/sources/babylonjs-v8/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..a8dd08e586401430c730e2892dc11924a0152242 --- /dev/null +++ b/harbor/sources/babylonjs-v8/tasks.py @@ -0,0 +1,342 @@ +"""Babylon.js — taking things out of the scene leaves them in its passes: the board and the grading of it. + +GRADERS is the single list of ALL criteria: (name, weight, blocker, kind, +timeout). It is a literal table on purpose — calibrate.py and the offline gates +read it out of this file by AST, so a computed table would be invisible to all +of them. The assertions below are executed on import: a tasks.py that breaks +one of them cannot be loaded, let alone deployed. + +Board source: board.json; edit both or neither. +""" + +from __future__ import annotations + +from decimal import Decimal +from pathlib import Path + +from hud.graders import BashGrader, EvaluationResult, SubScore, combine + +from coding import repo as repo_lib +from env import LOGS_DIR, REPO_DIR, VAULT_DIR, WORKSPACE_NOTE, env, _setup + +PROMPT = (Path(__file__).parent / "task" / "prompt.md").read_text() +GRADER = "/hud/grader/run_grading.sh" +GOLD_DIFF = Path("/hud/gold.diff") + +# On blocker failure the reward is capped FLAT. Any number of failed blockers +# sets the same ceiling; the cap never drops below 0.60, and the gradient below +# it is preserved, so what separates two wrong answers is which criteria they met. +BLOCKER_CAP = 0.60 + +# G-5: the gate is a cell of the board like any other — it is IN the weights +# table, it is handed to `combine` with the rest, and it blocks. Its weight is +# deliberately small: enough that the scoreboard shows it, not enough to buy +# anything. +GATE = "gate_repo_suite_green_and_tests_untouched" +GATE_WEIGHT = Decimal("0.0300") +GATE_TIMEOUT = 900 + +# G-5'' — the ticket's rule (part 2 of the field manual's shape): removing is +# not disposing. Four criteria state it, each one thing the ticket asks for in +# words: what is put back is drawn / refreshed exactly as before, what stays in +# the scene (children of a mesh removed without its children, the removed mesh's +# own state) is untouched, and a mesh listed somewhere AFTER it was taken out is +# drawn there. All four hold on a tree nobody touched — that is what makes them +# a rule — and each is red on a tree that buys the core cheaply: copying the +# dispose() cleanup into removal loses the put-back shadows; filtering every +# render list by scene membership stops drawing the helper; hiding the removed +# mesh changes it. Like the gate, they earn their weight only beside a green +# cell of the core, so an empty change is worth 0.000 and not their weight. +RULES = ("put_back_meshes_are_drawn_as_before", + "put_back_textures_refresh_as_before", + "what_stays_in_the_scene_is_untouched", + "a_mesh_listed_after_removal_is_drawn_there") +RULE_WEIGHT = Decimal("0.0300") + +# Every conditional blocker, in one place: tasks.py and calibrate.py read this +# and nothing else, so the two arithmetics cannot drift. +CONDITIONAL_BLOCKERS = ("put_back_meshes_are_drawn_as_before", + "put_back_textures_refresh_as_before", + "what_stays_in_the_scene_is_untouched", + "a_mesh_listed_after_removal_is_drawn_there", + "gate_repo_suite_green_and_tests_untouched") + +WEIGHTS = { + "removed_mesh_leaves_the_shadow_map": Decimal("0.0300"), + "unloaded_container_leaves_every_pass": Decimal("0.0300"), + "unloaded_camera_render_target_stops_refreshing": Decimal("0.0300"), + "removed_procedural_texture_stops_regenerating": Decimal("0.0300"), + "a_texture_gone_while_its_camera_was_away_stays_silent": Decimal("0.0600"), + "a_mesh_listed_twice_leaves_the_pass": Decimal("0.1500"), + "unloading_again_keeps_what_we_listed": Decimal("0.0600"), + "put_back_meshes_are_drawn_in_their_former_order": Decimal("0.1500"), + "a_mesh_listed_twice_comes_back_twice": Decimal("0.1500"), + "put_back_render_targets_refresh_in_their_former_turn": Decimal("0.1200"), + "put_back_procedural_textures_regenerate_in_their_former_turn": Decimal("0.0400"), + "put_back_meshes_are_drawn_as_before": Decimal("0.0300"), + "put_back_textures_refresh_as_before": Decimal("0.0300"), + "what_stays_in_the_scene_is_untouched": Decimal("0.0300"), + "a_mesh_listed_after_removal_is_drawn_there": Decimal("0.0300"), + "gate_repo_suite_green_and_tests_untouched": Decimal("0.0300"), +} +BLOCKERS = frozenset({ + "removed_mesh_leaves_the_shadow_map", + "put_back_meshes_are_drawn_as_before", + "put_back_textures_refresh_as_before", + "what_stays_in_the_scene_is_untouched", + "a_mesh_listed_after_removal_is_drawn_there", + "gate_repo_suite_green_and_tests_untouched", +}) + +GRADERS = [ + ("removed_mesh_leaves_the_shadow_map", 0.0300, True, "bash", 600), + ("unloaded_container_leaves_every_pass", 0.0300, False, "bash", 600), + ("unloaded_camera_render_target_stops_refreshing", 0.0300, False, "bash", 600), + ("removed_procedural_texture_stops_regenerating", 0.0300, False, "bash", 600), + ("a_texture_gone_while_its_camera_was_away_stays_silent", 0.0600, False, "bash", 600), + ("a_mesh_listed_twice_leaves_the_pass", 0.1500, False, "bash", 600), + ("unloading_again_keeps_what_we_listed", 0.0600, False, "bash", 600), + ("put_back_meshes_are_drawn_in_their_former_order", 0.1500, False, "bash", 600), + ("a_mesh_listed_twice_comes_back_twice", 0.1500, False, "bash", 600), + ("put_back_render_targets_refresh_in_their_former_turn", 0.1200, False, "bash", 600), + ("put_back_procedural_textures_regenerate_in_their_former_turn", 0.0400, False, "bash", 600), + ("put_back_meshes_are_drawn_as_before", 0.0300, True, "bash", 600), + ("put_back_textures_refresh_as_before", 0.0300, True, "bash", 600), + ("what_stays_in_the_scene_is_untouched", 0.0300, True, "bash", 600), + ("a_mesh_listed_after_removal_is_drawn_there", 0.0300, True, "bash", 600), + ("gate_repo_suite_green_and_tests_untouched", 0.0300, True, "bash", 900), +] + +# ─── the scoreboard's arithmetic, checked where it is written ────────────── +assert [n for n, _w, _b, _k, _t in GRADERS] == list(WEIGHTS), \ + "GRADERS and WEIGHTS list different criteria, or list them in a different order" +assert all(Decimal(str(w)) == WEIGHTS[n] for n, w, _b, _k, _t in GRADERS), \ + "a weight in GRADERS disagrees with the Decimal table above it" +assert all(b == (n in BLOCKERS) for n, _w, b, _k, _t in GRADERS), \ + "a blocker flag in GRADERS disagrees with BLOCKERS" +assert sum(WEIGHTS.values()) == Decimal("1.0000"), \ + f"the weights sum to {sum(WEIGHTS.values())}, not 1.0000" +assert all(w >= Decimal("0.03") for w in WEIGHTS.values()), "a criterion carries less than 0.03" +assert len(WEIGHTS) >= 6, "fewer than six criteria" +# §1.A + B-1 +assert BLOCKERS, "no blocker: a board with nothing that must be right is not a board" +assert all(WEIGHTS[n] <= Decimal("0.20") for n in BLOCKERS), "a blocker is worth more than 0.20" +assert sum(WEIGHTS[n] for n in BLOCKERS) <= Decimal("0.75"), "the blocking mass is over 0.75" +assert min(Decimal("1.00") - max(WEIGHTS[n] for n in BLOCKERS), + Decimal(str(BLOCKER_CAP))) >= Decimal("0.60"), \ + "a tree that fails one blocker would land below 0.60" +assert BLOCKER_CAP >= 0.60, "the blocker cap is below the floor" +# G-5 +assert GATE in WEIGHTS, "the gate is a cell of the board and must be in the table" +assert WEIGHTS[GATE] == GATE_WEIGHT and GATE_WEIGHT >= Decimal("0.01"), \ + "the gate carries no weight (G-5: every gate is a blocker worth at least 0.01)" +assert GATE in BLOCKERS, "the gate is a blocker" +assert GRADERS[-1][0] == GATE, "the gate runs last" +assert GRADERS[-1][4] == GATE_TIMEOUT, "the gate's budget is written down twice and they differ" +# G-5'' +assert all(r in WEIGHTS and WEIGHTS[r] == RULE_WEIGHT for r in RULES), "a rule is not on the board at its weight" +assert all(r in BLOCKERS for r in RULES), "every rule blocks" +assert set(CONDITIONAL_BLOCKERS) == set(RULES) | {GATE} and set(CONDITIONAL_BLOCKERS) <= BLOCKERS, \ + "the conditional criteria are the rules and the gate" +_CORE = [w for n, w in WEIGHTS.items() if n != GATE] +# v3 (CELLS round bc3, recorded in FREEZE §v3): the corridor of the core is x5, not x3 -- the fourteen +# cells every run of the v2 five took sit at the floor, the four states the five split on carry the rest. +# v4 (CELLS round bc4, FREEZE §v4): same x5 corridor; seven cells every run of the v3 farm five took were +# retired from the board (their states stay covered by the sweep and the v4 cells), four new ones added. +assert max(_CORE) / min(_CORE) <= 5, "the core of the board spans more than a factor of five" + +# The cells of the contract itself: everything on the board that is not a rule +# or the gate. The conditional blockers are told, in CORE_GREEN, whether any of +# these came out green, and they have to run AFTER all of them for that to be +# known. +CORE = tuple(n for n, _w, _b, _k, _t in GRADERS if n not in CONDITIONAL_BLOCKERS) +assert [n for n, _w, _b, _k, _t in GRADERS][:len(CORE)] == list(CORE), \ + "a conditional blocker runs before a cell of the core, so it cannot be told CORE_GREEN" + + +# ─── grading machinery ───────────────────────────────────────────────────── + +# run_grading.sh exits 3 when the grader COULD NOT JUDGE (an interpreter that +# would not run, a missing report, its own budget). A fault is not a failed +# criterion: it earns nothing and it proves nothing, so a faulted blocker keeps +# the cap on rather than passing quietly. +FAULT_EXIT = 3 + + +def _fault_reason(stdout: str) -> str: + tail = (stdout or "").strip().splitlines() + return tail[-1][:200] if tail else "the grader exited %d without a word" % FAULT_EXIT + + +def _is_fault(subscore) -> bool: + meta = getattr(subscore, "metadata", None) or {} + return meta.get("exit_code") == FAULT_EXIT or meta.get("returncode") == FAULT_EXIT + + +def _absolve_faults(subscores) -> dict: + faults = {} + for s in subscores: + meta = getattr(s, "metadata", None) or {} + if _is_fault(s): + faults[s.name] = _fault_reason(meta.get("stdout") or meta.get("stderr") or "") + return faults + + +def _measured_scale(subscores, faults) -> tuple: + """(weight that was measured, reward expressed over that weight).""" + weights = {name: weight for name, weight, _b, _k, _t in GRADERS} + measured = sum(w for n, w in weights.items() if n not in faults) + if measured <= 0: + return 0.0, 0.0 + earned = sum(weights[s.name] * s.value for s in subscores + if s.name in weights and s.name not in faults) + return float(measured), float(earned / measured) + + +async def _grade(validate_mode: str | None) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + diff = GOLD_DIFF.read_bytes().decode("utf-8") # CRLF-файлы репо: read_text() превратил бы CRLF в LF, и git apply голда упал бы + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult( + reward=0.0, content="patch failed to apply", info={"git_apply": apply_error} + ) + + subscores: list[SubScore] = [] + # G-5' / G-5'', executed by the conditional blockers themselves. The cells + # of the core run first (asserted above), and the rule and the gate are then + # handed CORE_GREEN: 1 if any cell of the core came out green, 0 if none did. + # With 0 each of them prints the state of its rule on a line of its own and + # then FAILS, exit 1, with no PASS line anywhere in its output — so what the + # trace shows and what the subscore says are the same thing (an organisers' + # checker throws away a run where a check scored 0 on output that says it + # passed). A core cell that FAULTED was not measured and cannot say that + # nothing was fixed: if every cell of the core faulted, the conditional + # blockers are not asked to fail for it (CORE_GREEN=1) and the fault + # handling below keeps the ceiling on. + core_measured = 0 + core_green = False + for name, weight, _blocker, _kind, timeout in GRADERS: + prefix = "" + if name in CONDITIONAL_BLOCKERS: + prefix = "CORE_GREEN=%d " % int(core_green or core_measured == 0) + s = await BashGrader.grade( + weight, + name=name, + command=f"{prefix}bash {GRADER} {name} {timeout}", + cwd=str(REPO_DIR), + timeout_seconds=timeout, + ) + subscores.append(s) + if name in CORE and not _is_fault(s): + core_measured += 1 + if s.value > 0.0: + core_green = True + + faults = _absolve_faults(subscores) + # Kept as a safety net only: with CORE_GREEN=0 the rule and the gate have + # already failed by themselves, so this finds nothing to zero. + # G-5-prime: гейт зелен только рядом с зелёной клеткой. Гейт, который + # проходит на нетронутом checkout, иначе платит за пустой diff, и лестница + # читает base/noop как массу гейта вместо 0.000. Ни одной измеренной + # не-гейтовой клетки в зелёном => гейт зарабатывает ноль (и, как блокер, + # кладёт итог на кап, который на пустом дереве и без того ноль). + _G5P_GATES = CONDITIONAL_BLOCKERS + _g5p_cells = [s for s in subscores + if s.name not in _G5P_GATES and s.name not in faults] + if _g5p_cells and not any(s.value > 0.0 for s in _g5p_cells): + for _g5p in subscores: + if _g5p.name in _G5P_GATES and _g5p.value > 0.0: + _g5p.value = 0.0 + _g5p.info = {**(_g5p.info or {}), "g5_prime": + "the gate earns nothing on a tree that met no " + "criterion: a green gate on an empty change is " + "weight for doing nothing"} + result = await combine(*subscores) + + failed = sorted( + (name, weight) + for name, weight, blocker, _kind, _t in GRADERS + if blocker and name not in faults + and next(s.value for s in subscores if s.name == name) < 1.0 + ) + unproven = sorted(n for n, _w, blocker, _k, _t in GRADERS if blocker and n in faults) + + if faults: + measured_weight, over_measured = _measured_scale(subscores, faults) + capped = bool(failed) or bool(unproven) + return EvaluationResult( + reward=result.reward if not capped else max(0.0, min(result.reward, BLOCKER_CAP)), + subscores=result.subscores, + isError=True, + info={**result.info, "grader_faults": dict(faults), + "failed_blockers": [n for n, _w in failed], + "unproven_blockers": unproven, + "measured_weight": round(measured_weight, 4), + "reward_over_measured_weight": round(over_measured, 4)}, + content=( + "GRADER FAULT: this run was not graded. " + + "; ".join(f"{n}: {why}" for n, why in faults.items()) + + ". A fault is the grader failing to judge, not the change failing a " + "criterion. A criterion that was not measured earns nothing, and a " + f"blocker that was not proven keeps the {BLOCKER_CAP:.2f} ceiling on. " + "This run has to be re-run; do not read the reward as a measurement." + ), + ) + + if failed: + reward = max(0.0, min(result.reward, BLOCKER_CAP)) + names = [name for name, _weight in failed] + return EvaluationResult( + reward=reward, subscores=result.subscores, + info={**result.info, "uncapped_reward": result.reward, + "failed_blockers": names, "blocker_cap": BLOCKER_CAP}, + content=(f"Blocker criteria failed ({', '.join(names)}); " + f"cap {BLOCKER_CAP:.2f}, reward {reward:.3f} " + f"(uncapped {result.reward:.3f})."), + ) + return result + + +@env.template( + id="babylonjs_scene_remove_owner_refs_contract", + description=( + "Taking meshes and textures out of a scene: the scene stops drawing and " + "refreshing them in every pass, and putting them back restores them." + ), +) +async def babylonjs_scene_remove_owner_refs_contract( + validate_mode: str | None = None, + revision: str | None = None, +): + # V-2: `revision` is INERT. It exists so that a change of ticket, gold, + # grader or image can be handed to `hud sync tasks` as an argument, which is + # part of the task signature and therefore yields a NEW task version in the + # UI (columns alone do not). Nothing in the scenario or the grading reads it; + # it is provenance, and it is deliberately never shown to the agent. + _ = revision + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + if validate_mode == "golden": + _ = yield "Golden-validation run: no work is expected of you. Finish immediately." + else: + # E-4: the ticket travels inside the coding-task scenario's own framing, + # never bare. The same words handed over without it have been measured to + # change how a run starts. + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. " + f"{WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests " + "grade your work when you finish; do not modify existing tests.\n\n" + f"{PROMPT}" + ) + yield await _grade(validate_mode) + + +tasks = [babylonjs_scene_remove_owner_refs_contract()] diff --git a/harbor/sources/badger-v2/Dockerfile.hud b/harbor/sources/badger-v2/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..9c3ecefe82d1bb3dd6c205fc80be6599784e4991 --- /dev/null +++ b/harbor/sources/badger-v2/Dockerfile.hud @@ -0,0 +1,480 @@ +# journal_recovery_after_unclean_stop on the coding-template. +# +# Substrate: dgraph-io/badger at the pinned base SHA (history vaulted at task +# setup by coding/repo.py), Go 1.24 toolchain, hud serve. Everything answer-key- +# shaped lives under /hud (root, mode 700): the vault, the hidden grader, the +# oracle it builds against the candidate, the three held-out fixtures the +# RELEASED build wrote, the pristine base checkout and gold.diff. Agent shells +# drop to uid 1000 (setpriv), so /hud is unreadable from the agent side. +# +# The network exists only while this image builds. After that grading is +# hermetic: no network, no clock any verdict depends on, no RNG, no LLM, no +# judge of any kind. Every criterion is a writer killed with SIGKILL after an +# acknowledgement it chose, a log torn at a fraction of its length, a directory +# reopened read-only and read-write, every key read back, every file hashed. +# +# THE IMAGE DOES NOT EXIST UNLESS IT IS CALIBRATED. Step 9 grades the reference +# solution and the untouched checkout with the real grader and fails the build +# unless gold scores 1.00 with every criterion green, base scores 0.00 with +# every criterion red one by one, and the weight rules hold. An unbuildable +# image is better than an uncalibrated one. + +FROM python:3.12-slim-bookworm + +ARG REPO_URL=https://github.com/dgraph-io/badger +ARG BADGER_SHA=2a001d466f6b71a917319a1db41f99860e16e269 +# go.mod says `go 1.24.0`; GOTOOLCHAIN=local below keeps go from fetching a +# different one at build or grading time, so this is the toolchain for +# everything: the agent, the grader, the driver and the API probe. +ARG GO_VERSION=1.24.13 + +# util-linux: setpriv, the privilege wall for agent shells. +# build-essential: badger itself is pure Go, but the grader runs the repo's +# suite under `-race`, and on linux the race detector will not build without +# cgo -- "go: -race requires cgo; enable cgo by setting CGO_ENABLED=1", exit 2, +# measured in this image's own base image. No gcc, no `deletes_stay_deleted`. +# procps: `ps`/`top`. Three of five rollouts in the last final died with +# metadata.container_oom_killed=True and no way to say WHAT was resident at the +# kill, because the image had no ps. Diagnosis of an OOM without a process +# table is guesswork; 400 kB buys the answer. +RUN apt-get update && apt-get install -y --no-install-recommends \ + git curl ca-certificates util-linux patch build-essential procps \ + && rm -rf /var/lib/apt/lists/* + +# /tmp is the agent's HOME parent (AGENT_HOME=/tmp/agent-home, env.py) and the +# scratch of every tool the agent runs. A base image whose /tmp is not +# world-writable+sticky loses the agent shell for uid 1000 (law E-3, measured on +# piscina v3: /workspace root:700 blinded a whole final). Assert it here. +RUN install -d -m 1777 /tmp + +# hud pinned to 0.6.15, the runner's own version (law E-3). 0.6.13 in the image +# against a 0.6.15 runner is the version skew that killed the agent SSH channel. +RUN python -m venv /opt/hudvenv \ + && /opt/hudvenv/bin/pip install --no-cache-dir "hud==0.6.15" "pytest==8.3.4" +ENV PATH="/opt/hudvenv/bin:${PATH}" + +# ── Go toolchain ──────────────────────────────────────────────────────────── +RUN set -eux; \ + arch="$(dpkg --print-architecture)"; \ + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz" -o /tmp/go.tgz; \ + tar -C /usr/local -xzf /tmp/go.tgz; \ + rm /tmp/go.tgz + +# The two memory variables are the v20 measure and they are set with := like the +# rest: env.py (AGENT_GO_ENV) is the primary source for an agent session, this +# file is the fallback for any login shell that env.py did not construct, and +# neither overrides the other. uid 0 -- the grader -- is deliberately outside the +# `if`, so no oracle inherits them. +# GOPATH is shared and root-owned; the agent gets read-only access to the module +# cache in step 6 and writes only to its own GOCACHE (see env.py, AGENT_GO_ENV). +# GOCACHE lives inside /hud so the warm build cache the grader uses cannot be +# touched from /workspace. +# +# GOPROXY is deliberately NOT set here: the build needs the network, and every +# grading path forces GOPROXY=off itself (run_grading.sh, _reclaim_lib.GO_ENV). +# Setting it here would either break the build or, worse, survive as a live +# proxy setting into a rollout that has no network. +# +# GOWORK=off: nothing in the image ships a go.work, but the factory tree does, +# and an inherited workspace would make every `go` command fail with "directory +# not contained in workspace". +ENV PATH=/usr/local/go/bin:$PATH \ + GOTOOLCHAIN=local \ + CGO_ENABLED=1 \ + GOWORK=off \ + GOFLAGS=-mod=mod \ + GOPATH=/go \ + GOMODCACHE=/go/pkg/mod \ + GOCACHE=/hud/gocache + +# ENV PATH is not enough, and this is measured, not assumed. Both shells that +# matter are LOGIN shells -- hud's BashGrader runs `/bin/bash -lc`, and an agent +# session is `env -i ... bash -l` -- and Debian's /etc/profile assigns PATH +# unconditionally, so the image's PATH is thrown away the moment either starts: +# +# $ docker run --rm IMG bash -c 'echo $PATH' -> /usr/local/go/bin:... go found +# $ docker run --rm IMG bash -lc 'echo $PATH' -> /usr/local/sbin:... NO GO +# +# The grader survives it because run_grading.sh re-exports PATH itself. The +# agent would not: a rollout that cannot run `go` cannot do the task at all, +# every run would sit on the floor, and nothing in the grader would say why. So +# the toolchain goes on PATH where a login shell cannot lose it. The Go +# variables below are defaults for the dropped uid only -- env.py declares the +# same set on the workspace (AGENT_GO_ENV) and those come through `env -i` ahead +# of this file; this is the second lock on the same door, not the first. Nothing +# here is answer-key-shaped: the file is world-readable by design. +RUN set -eux; \ + printf '%s\n' \ + 'case ":$PATH:" in' \ + ' *:/usr/local/go/bin:*) ;;' \ + ' *) PATH="/usr/local/go/bin:$PATH" ;;' \ + 'esac' \ + 'export PATH' \ + 'if [ "$(id -u)" != "0" ]; then' \ + ' : "${GOPATH:=/go}"' \ + ' : "${GOMODCACHE:=/go/pkg/mod}"' \ + ' : "${GOCACHE:=$HOME/.cache/go-build}"' \ + ' : "${GOFLAGS:=-mod=mod}"' \ + ' : "${GOPROXY:=off}"' \ + ' : "${GOTOOLCHAIN:=local}"' \ + ' : "${GOWORK:=off}"' \ + ' : "${CGO_ENABLED:=1}"' \ + ' : "${GOMEMLIMIT:=1GiB}"' \ + ' : "${GOMAXPROCS:=2}"' \ + ' export GOPATH GOMODCACHE GOCACHE GOFLAGS GOPROXY GOTOOLCHAIN GOWORK CGO_ENABLED' \ + ' export GOMEMLIMIT GOMAXPROCS' \ + 'fi' \ + > /etc/profile.d/10-go-toolchain.sh; \ + chmod 0644 /etc/profile.d/10-go-toolchain.sh; \ + bash -lc 'command -v go' | grep -q '^/usr/local/go/bin/go$' + +# ── 1. substrate repo at the pinned base commit ──────────────────────────── +# Fetched here rather than COPYed: the working checkout in the factory pilot is +# the GOLD worktree, with the reference solution staged in it, and a build +# context that shipped it would hand the agent the answer. Fetching the SHA +# makes the workspace pristine by construction, and step 8 proves it by +# requiring gold.diff to still apply. +RUN mkdir -p /workspace /hud/gocache \ + && git init -q /workspace/repo \ + && cd /workspace/repo \ + && git remote add origin ${REPO_URL} \ + && git fetch --depth 1 origin ${BADGER_SHA} \ + && git checkout -q FETCH_HEAD \ + && git checkout -q -b main \ + && test "$(git rev-parse HEAD)" = "${BADGER_SHA}" \ + && git config --system user.email "dev@localhost" \ + && git config --system user.name "dev" \ + && git config --system --add safe.directory /workspace/repo + +# ── 2. warm the module cache and the build cache ─────────────────────────── +# `go mod download all` covers the test dependencies too, so the offline +# rollout never reaches for the network. The -run XXXNONE pass compiles every +# test binary into GOCACHE -- twice, because the grader runs the suite under +# `-race` and the race build is a different set of objects. Both passes are +# what keeps `deletes_stay_deleted` inside its timeout at grading time. +# +# That sentence got heavier in v11. `deletes_stay_deleted` now runs the -race +# suite TWICE at grading time -- once on /hud/base-src for the baseline it used +# to be handed by the image, once on the workspace -- so this cache is the +# difference between two compiles and none. Step 3 warms it for base-src as +# well, because without -trimpath the source directory is part of what the +# build cache keys on and /workspace/repo's objects cannot be assumed to serve +# /hud/base-src. +RUN set -eux; \ + cd /workspace/repo; \ + go mod download all; \ + go build ./...; \ + go test -count=1 -run XXXNONE ./... >/dev/null; \ + CGO_ENABLED=1 go test -race -count=1 -run XXXNONE ./... >/dev/null + +# ── 3. the pristine base checkout, kept out of the workspace ─────────────── +# /hud/base-src is the task's base commit; /workspace/repo is the agent's copy. +# The released-build probe in `format_compat_after_reclaim` is compiled from +# this one, which is why that criterion does not depend on anything in the +# workspace. +# +# The -race warm-up at the end is what pays for moving the suite baseline out of +# the image and into grading time: the baseline leg runs `go test -race ./...` +# from THIS directory, and a cold cache there would cost the criterion a full +# race-instrumented compile of the tree inside its own budget. `-run XXXNONE` +# compiles and links every test binary and runs no test, so it costs build time +# and not memory -- it is the same command step 2 already runs, which the HUD +# builder has never failed (every failed build died later, at the record_baseline +# step) -- and `-p 1` bounds the compile fan-out below the 2 the builder has, +# instead of letting it follow GOMAXPROCS on a bigger machine. +RUN set -eux; \ + cp -a /workspace/repo /hud/base-src; \ + rm -rf /hud/base-src/.git; \ + git -C /workspace/repo rev-parse HEAD > /hud/base_sha; \ + cd /hud/base-src; \ + CGO_ENABLED=1 go test -race -count=1 -p 1 -run XXXNONE ./... >/dev/null + +# ── 4. /hud: everything the agent must never read ────────────────────────── +COPY task/grader/ /hud/grader/ +COPY task/gold.diff /hud/gold.diff +# calibrate.py, mutprobe.py and test_weights_and_faults.py all read the weights +# table out of tasks.py by AST -- that file is the one and only place the +# scoreboard is written down -- and each resolves `grader/` and `tasks.py` +# relative to ITS OWN directory. Putting all four at /hud is what makes +# HERE=/hud, GRADER=/hud/grader and CALIB=/hud/.calib line up, and what keeps +# the copy hud serves and the copy the gates read byte-identical. +COPY tasks.py /hud/tasks.py +# faultprobe.py rides along because two of the tests in step 5 import it: the +# exhaustive proof that breaking a fixture is worth nothing walks every outcome +# vector through its three rules. It reads .calib when run as a script and skips +# it when it is absent, so it needs nothing else in the image. +COPY calibrate.py mutprobe.py faultprobe.py test_weights_and_faults.py /hud/ +RUN chmod +x /hud/grader/run_grading.sh + +# ── 5. the weight rules, as a build gate ─────────────────────────────────── +# Arithmetic, not a machine: it takes a second and it is the half of the +# calibration that a gold/base total cannot show. The field manual's enforced +# limits — the weights sum to 1.0000 in Decimal (the platform normalises +# silently otherwise), no criterion is worth 0.00, there are at least six of +# them, no single blocker is worth more than 0.30, the blocking mass stays at or +# under 0.75, and a tree that fails exactly one blocker still scores the 0.60 cap — plus the fault rule: a +# grader fault can neither fail a criterion nor cap a run, and never earns its +# weight either. All of them have been got wrong in prose while looking right. +RUN set -eux; \ + cd /hud; \ + /opt/hudvenv/bin/python -m pytest test_weights_and_faults.py -q + +# ── 6. hand the workspace to the agent, and prove the agent can build ────── +# The module cache is readable but not writable from uid 1000: the grader +# compiles its own driver against the agent's tree with GOPROXY=off, and a +# module cache the agent could rewrite would be a way to change what that driver +# compiles. cache/lock is the one file Go opens read-write on every module +# operation, so it -- and only it -- is world-writable. +# +# The setpriv run is not a nicety and not an idealised environment. hud does not +# pass the serving process's environment to a uid-dropped shell +# (Workspace._session_env builds a minimal one from scratch: PATH, HOME, TERM, +# plus the workspace env), and the shell it starts is a LOGIN shell, which +# re-assigns PATH from /etc/profile. So this reproduces that exactly -- `env -i` +# with the same variables env.py declares, a PATH that deliberately does NOT +# contain the toolchain, uid 1000, `bash -lc`, GOPROXY=off -- and builds the +# repo, vets it, and compiles the suite under `-race`. That last one is the +# point: the agent is graded on the race suite staying green, so the agent has +# to be able to run it. If it could not, the image does not exist. +RUN set -eux; \ + chmod -R a+rX /go; \ + [ -f /go/pkg/mod/cache/lock ] && chmod 0666 /go/pkg/mod/cache/lock || true; \ + mkdir -p /tmp/agent-home/.cache/go-build; \ + chown -R 1000:1000 /workspace/repo /tmp/agent-home; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/local/bin:/usr/bin:/bin \ + HOME=/tmp/agent-home TERM=xterm \ + GOPATH=/go GOMODCACHE=/go/pkg/mod \ + GOCACHE=/tmp/agent-home/.cache/go-build \ + GOFLAGS=-mod=mod GOPROXY=off GOTOOLCHAIN=local GOWORK=off CGO_ENABLED=1 \ + bash -lc 'set -eux; cd /workspace/repo; go version; go build ./...; \ + go vet ./... || true; \ + go test -count=1 -run XXXNONE ./... >/dev/null; \ + go test -race -count=1 -run XXXNONE . >/dev/null'; \ + chown -R 1000:1000 /tmp/agent-home + +# ── 7. NOTHING IS RECORDED AT IMAGE BUILD TIME ANY MORE ─────────────────── +# This step used to exist. It ran tools/record_baseline.py against /hud/base-src +# and baked grader/baseline/vet.txt into the image, so that +# `reclaims_by_default_and_ships` could compare `go vet` on the agent's tree +# against a list of diagnostics recorded here. +# +# Two things were wrong with it, and the second is the one that removed it. +# +# The first was memory: the -race suite baseline used to be recorded in the same +# step, and it failed four consecutive deploys in the BUILD phase. The builder +# printed its own size (build f2bc5550, step [16/26]) -- amd64, nproc=2, +# MemTotal 3.60 GiB, MemAvailable 2.78 GiB, no cgroup cap -- against a step that +# needs 3.42 GiB anon. That half moved to grading time in v11. +# +# The second is that a recorded baseline is A LIST OF ANSWERS SHIPPED INSIDE THE +# CONTAINER THAT THE CRITERION GRADES. `go vet` being cheap is not a defence: it +# is the same artefact as the suite baseline, and it was kept only because it +# fitted. So it is gone too. Both baselines are now measured at GRADING time by +# the criteria that consume them, on both trees, minutes apart, in one process, +# with no file written and none read back. grader/tools/ and grader/baseline/ +# are empty and deleted along with it. +# +# What that costs the build gate: nothing it was actually buying. The gate below +# (step 9) runs every criterion over the gold and the untouched tree with the +# real run_grading.sh, and the vet comparison is now INSIDE those criteria, so +# it is exercised on both trees by the calibration itself. + +# ── 8. the workspace is the base SHA, not the solution ───────────────────── +# gold.diff has to still apply to both trees. If the solution had leaked into +# the fetched checkout this fails, so the image refuses to build rather than +# handing the agent the answer. +RUN set -eux; \ + cd /workspace/repo && git apply --check /hud/gold.diff; \ + cd /hud/base-src && git apply --check /hud/gold.diff + +# ── 9. prove the grader on the gold before anyone runs it ────────────────── +# Apply the vaulted gold diff to a scratch copy and run EVERY criterion over +# both the gold and the untouched tree with the real run_grading.sh. +# calibrate.py asserts the invariants itself and exits non-zero if any breaks, +# so `set -e` fails the build: +# +# gold -> 1.00, and every criterion green ONE BY ONE +# base -> 0.00, and every criterion red ONE BY ONE +# +# The second half of each is the one that matters and the one that is easy to +# fake. The base is graded criterion by criterion here, not short-circuited as +# an empty diff: a zero that rests on the short circuit proves nothing about the +# grader, and a criterion an untouched checkout can pass is a criterion that +# scores code that was already there. +# +# Roughly 20-40 minutes. That is the price of an image that cannot ship a +# miscalibrated grader. +# +# It has to STREAM, and that is not cosmetic. `hud deploy` watches the remote +# build over a websocket, and the first attempt redirected calibrate.py to a +# file: the step printed nothing for twenty minutes, the log stream dropped, and +# the CLI reported `Build status: FAILED` while `/v2/builds//status` still +# said IN_PROGRESS and the build went on to finish. A silent step is a step that +# looks dead. So the output is piped through `tee` and the pipeline's exit code +# is preserved by running this step under bash with `pipefail` -- the default +# shell is dash, which has neither, and the exit code of calibrate.py is the +# whole point of this step. +# +# `-u` is deliberately NOT set: `set -eux` under pipefail is fine, but the trace +# is what keeps the stream alive between criteria, so it stays. +# +# `git init` in the gold tree because git apply wants a work tree; the .git it +# creates is thrown away with the whole directory below. +# +# ── TWO TIERS, AND WHY ────────────────────────────────────────────────────── +# CALIB_MODE=full is the default and is everything written above: both trees, +# every criterion, the totals and the one-by-one colours. It is what the image +# is calibrated by, and it is what runs when nobody says otherwise. +# +# CALIB_MODE=smoke exists for exactly one machine: the HUD remote builder. That +# builder is 2 vCPU with a hard ~30 minute wall, and the full gate does not fit +# -- twice measured, twice killed at 32:12 and 32:11, both times inside this +# step. The criteria that blow the budget are the GENERATIONAL ones: the two +# checks that call `generate_dirty` (check_reclaim_fresh.py and +# check_reclaims_by_default_and_ships.py) write a database from scratch and then +# wait for it to settle, and on two cores that wait runs 10-15x the workstation. +# The fixture-backed criteria do not: measured on the builder itself, +# reclaims_proportionally_and_stays_compactable took 327.1s against 323.6s local +# and reclaim_existing 40.8s against 40.8s local -- par, because they unpack +# held-out bytes instead of making them. +# +# What smoke gives up is real, so it is worth being exact about what it does not +# give up. The builder is NOT the grading machine: rollouts are graded on the +# runtime hosts, from this image, and a criterion's colour here says nothing +# about that host that the same criterion in a LOCAL docker build of the same +# linux base image does not already say. That local build is the full gate, it +# has passed, and it is what caught both linux-only bugs (cgo/-race and the +# GRADER FAULT). Smoke therefore proves the thing that is genuinely specific to +# the remote build -- that THIS image, as assembled there, has a grader that +# runs, scores the reference solution green and the untouched checkout red, one +# criterion at a time, and a scoreboard whose arithmetic still holds -- and +# leaves the exhaustive proof where it was actually performed. +# +# So smoke MUST NOT print the strings a full calibration prints. `gold: **1.00**` +# and `base: **0.00**` are the full gate's signature; calibrate.py does not emit +# them for a partial run (it says "partial run, not checked" instead) and this +# step does not synthesise them. What it prints is SMOKE GATE OK, which says +# what it is. +# +# calibrate.py does not enforce anything on a --criteria run, so the subset's +# colours are asserted here, out of .calib/calibration.json: every criterion in +# the subset green on gold, red on base, one by one. Plus the invariants that +# cost nothing and are the half of the calibration a total cannot show: the cap, +# the blocking weight, the weights, and the grader's own unit tests. +ARG CALIB_MODE=full +# The fixture-backed criteria, and only those. Overridable so a retry can trim +# the set from the command line instead of from this file. +ARG CALIB_SMOKE_CRITERIA=torn_value_log_tail_keeps_transactions_whole,mixed_version_transaction_whole_after_tear,history_comes_back_as_a_prefix,writes_after_recovery_win,read_only_open_after_kill_serves_acknowledged_commits,read_only_open_refuses_a_torn_history,history_from_released_build_replays_whole + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -eux; \ + # What the builder actually is. The first remote attempt died inside this + # step with no output and no error at all -- disk was fine (47 GiB free), so + # the process was killed, and a killed process leaves no message. Printing + # the cgroup limits makes the next one answerable instead of a guess. + echo "builder: nproc=$(nproc) mem.max=$(cat /sys/fs/cgroup/memory.max 2>/dev/null \ + || cat /sys/fs/cgroup/memory/memory.limit_in_bytes 2>/dev/null || echo '?') \ + MemTotal=$(awk '/MemTotal/{print $2\"kB\"}' /proc/meminfo)"; \ + df -h /hud /tmp | sed 's/^/ /'; \ + echo "calibration mode: ${CALIB_MODE}"; \ + # An unknown mode is not a reason to guess, and defaulting it to either tier + # would be the wrong guess half the time. + case "${CALIB_MODE}" in full|smoke) ;; \ + *) echo "unknown CALIB_MODE=${CALIB_MODE}; expected full or smoke" >&2; exit 2 ;; esac; \ + mkdir -p /hud/.calib; \ + cp -a /hud/base-src /hud/.calib/base; \ + cp -a /hud/base-src /hud/.calib/gold; \ + cd /hud/.calib/gold && git init -q . && git apply /hud/gold.diff; \ + cd /hud; \ + # calibrate.py prints a line per criterion, but the longest single criterion + # is ~5 minutes of silence on its own. A once-a-minute heartbeat keeps the + # stream warm through it; it is killed with the step. + ( while sleep 60; do echo " ... calibration still running ($(date -u +%H:%M:%S)) ..."; done ) & \ + hb=$!; trap "kill $hb 2>/dev/null || true" EXIT; \ + if [ "${CALIB_MODE}" = full ]; then \ + stdbuf -oL -eL /usr/local/bin/python3 -u /hud/calibrate.py 2>&1 \ + | tee /hud/calibration.txt; \ + kill $hb 2>/dev/null || true; \ + grep -q 'gold: \*\*1.00\*\*' /hud/calibration.txt; \ + grep -q 'base: \*\*0.00\*\*' /hud/calibration.txt; \ + grep -q 'base: all criteria red, one by one' /hud/calibration.txt; \ + grep -q 'gold: all criteria green, one by one' /hud/calibration.txt; \ + else \ + echo "smoke criteria: ${CALIB_SMOKE_CRITERIA}"; \ + stdbuf -oL -eL /usr/local/bin/python3 -u /hud/calibrate.py \ + --criteria "${CALIB_SMOKE_CRITERIA}" 2>&1 \ + | tee /hud/calibration.txt; \ + kill $hb 2>/dev/null || true; \ + # The colours, one by one, over the subset that ran. calibrate.py prints + # "(partial run, not checked)" for a --criteria run and checks nothing, so + # this is the check. + /usr/local/bin/python3 -c 'import json,sys; rows=json.load(open("/hud/.calib/calibration.json")); m={r["tree"]: r for r in rows}; sub=sys.argv[1].split(","); g=m["gold"]["results"]; b=m["base"]["results"]; bad=[c+" green on gold: NO" for c in sub if not g.get(c)]+[c+" red on base: NO" for c in sub if b.get(c)]; print("smoke subset: gold green one by one, base red one by one -- "+", ".join(sub)) if not bad else sys.exit("SMOKE GATE FAILED -- "+"; ".join(bad))' "${CALIB_SMOKE_CRITERIA}"; \ + # The scoreboard's arithmetic: the field manual's enforced limits. The + # flat cap, the sum, no weightless criterion, no blocker over 0.20, the + # blocking mass, and the result of failing one blocker still >= 0.60. + /usr/local/bin/python3 -c 'import sys; sys.path.insert(0,"/hud"); from calibrate import load_table; g,cap=load_table(); tot=sum(w for _n,w,_b in g); blk=sum(w for _n,w,b in g if b); zero=[n for n,w,_b in g if w<=0]; big=[n for n,w,b in g if b and w>0.30+1e-9]; worst=min((min(1.0-w,cap) for n,w,b in g if b), default=1.0); print("invariants: BLOCKER_CAP=%.2f sum(blocker weight)=%.2f sum(weights)=%.2f criteria=%d zero-weight=%d blockers>0.30=%d one-blocker-fail floor=%.2f" % (cap,blk,tot,len(g),len(zero),len(big),worst)); sys.exit(0 if (cap>=0.60-1e-9 and blk<=0.75+1e-9 and abs(tot-1.0)<1e-9 and len(g)>=6 and not zero and not big and worst>=0.60-1e-9) else "INVARIANTS FAILED")'; \ + # And the grader's own unit tests, again. They are step 5 as well; they + # take a hundredth of a second and they are the half of the calibration a + # subset of criteria cannot show. + /opt/hudvenv/bin/python -m pytest /hud/test_weights_and_faults.py -q; \ + echo 'SMOKE GATE OK (full calibration proven in local linux build, log attached)'; \ + fi; \ + kill $hb 2>/dev/null || true; \ + rm -rf /hud/.calib /hud/grader/__pycache__ /hud/grader/tests/__pycache__ \ + /hud/__pycache__ /hud/.pytest_cache + +# ── 10. lock it down ─────────────────────────────────────────────────────── +RUN mkdir -p /hud/vault /hud/logs \ + && chown -R root:root /hud \ + && chmod -R 700 /hud + +# Template runtime layout +ENV REPO_DIR=/workspace/repo \ + VAULT_DIR=/hud/vault \ + GRADING_LOGS_DIR=/hud/logs \ + GOLD_DIFF=/hud/gold.diff \ + GRADER_DIR=/hud/grader \ + BASE_SRC=/hud/base-src \ + GRADER_STATE_DIR=/hud/logs/grading-state \ + PYTHON_BIN=/usr/local/bin/python3 + +WORKDIR /app +COPY coding/ /app/coding/ +COPY env.py tasks.py /app/ +COPY task/prompt.md /app/task/prompt.md + +# The ticket, pinned by content. It is the one artefact in this tree that is +# finished: the criteria are written against these words, the mutation probe was +# run against these words, and a build that ships a different ticket is grading +# a task nobody calibrated. This is part of the gate in BOTH tiers -- smoke +# gives up criteria, not the ticket -- and it costs a hash. +RUN set -eux; \ + echo "e235e9cfb731a8d638fe30c29652eb17c5e2241a76c3b1a674fca88f0f792110 /app/task/prompt.md" \ + | sha256sum -c - + +# What is actually INSIDE this image, printed by the image itself. `hud sync +# tasks` says "Unchanged: 1" even when the ticket changed (its signature does +# not include the prompt text), and the grader travels by image, not by sync -- +# so the only honest answer to "did the edit ship?" is a hash taken in here. +# There is deliberately nothing under grader/baseline or grader/tools to hash: +# both baselines this grader compares against -- the suite's and `go vet`'s -- +# are measured at grading time by the criteria that consume them, and a shipped +# copy of either is precisely the artefact that move exists to abolish. Their +# absence is asserted here rather than assumed. +RUN set -eux; \ + sha256sum /app/task/prompt.md /app/tasks.py /hud/tasks.py \ + /hud/grader/run_grading.sh \ + /hud/grader/tests/check_journal.py \ + /hud/grader/tests/new_vet_diagnostics.py \ + /hud/grader/driver/main.go /hud/grader/driver/fixtures.go \ + /hud/grader/fixtures/*.tar.gz; \ + test ! -e /hud/grader/baseline; \ + test ! -e /hud/grader/tools + +RUN chmod 600 /app/tasks.py + +# CMD is NOT inherited: without this the container starts a bare python and +# DockerRuntime hangs on `docker port` with an unhelpful timeout. Symptom -> +# check `docker inspect --format '{{json .Config.Cmd}}'`. +CMD ["hud", "serve", "tasks.py", "--host", "0.0.0.0"] diff --git a/harbor/sources/badger-v2/calibrate.py b/harbor/sources/badger-v2/calibrate.py new file mode 100644 index 0000000000000000000000000000000000000000..4e33022efda07f85863ece89839270619cb812d4 --- /dev/null +++ b/harbor/sources/badger-v2/calibrate.py @@ -0,0 +1,392 @@ +#!/usr/bin/env python3 +"""Calibration for lmax_reclaim_idle_lsm — runs the grader, no Docker needed. + + python3 calibrate.py # gold and base + python3 calibrate.py gold # one tree + python3 calibrate.py --criteria reclaims_on_the_reported_directory,reclaims_bytes_this_build_wrote + python3 calibrate.py rg3-gold rg3-base --as-gold rg3-gold --as-base rg3-base + +It grades a tree the way tasks.py does: run every criterion in run_grading.sh, +weight the results with the table read out of tasks.py, and apply the flat +blocker cap. Three invariants, all of them hard: + + gold -> 1.00 every criterion green on the reference solution + base -> 0.00 the untouched checkout + base -> red on EVERY criterion, one by one + +The third is the one that matters and the one that is easy to fake. A grader +whose baseline is zero only because an untouched tree reaches the platform as an +empty diff has not been calibrated; this runs the criteria against the untouched +checkout itself and requires each of them to fail on their own. Anything a +baseline can pass is a criterion that scores code that was already there. + +The weights table is read from tasks.py rather than duplicated, so the two can +never drift; tasks.py itself is not imported, because it pulls in the platform +SDK and this has to run anywhere. +""" + +from __future__ import annotations + +import argparse +import ast +import hashlib +import json +import os +import shutil +import subprocess +import sys +import time +from pathlib import Path + +HERE = Path(__file__).resolve().parent +# In the image this file sits at /hud beside /hud/grader, which is where the +# Dockerfile copies task/grader to; in the package tree the same grader lives at +# task/grader. CALIB_GRADER_DIR is how an author's local calibration says so, +# and it changes nothing about what is graded — the same run_grading.sh, the +# same checks, the same fixtures. +GRADER = Path(os.environ.get("CALIB_GRADER_DIR") or (HERE / "grader")) +CALIB = HERE / ".calib" +# Any tree under .calib/ can be graded. Two of them are the calibration +# invariants; the rest are the anti-noop patches (grader/antinoop), which have +# to land on their predicted colours before the grader is worth deploying. +BASE_TREE = CALIB / "base" +# Which tree plays the reference solution and which plays the untouched +# checkout. They are `.calib/gold` and `.calib/base` unless --as-gold/--as-base +# name copies of them: a re-grade that must not overwrite the rows and logs an +# earlier verdict cites still has to be held to the same three invariants, and +# before this it silently was not - a tree called anything else printed its +# reward and was checked against nothing. +ALL_GREEN, ALL_RED = "gold", "base" +EXPECTED = {ALL_GREEN: 1.00, ALL_RED: 0.00} + + +def tree_path(name: str) -> Path: + return CALIB / name + + +def load_table() -> tuple[list[tuple[str, float, bool]], float]: + """Read GRADERS and BLOCKER_CAP straight out of tasks.py.""" + tree = ast.parse((HERE / "tasks.py").read_text()) + graders, cap = None, None + for node in tree.body: + if not isinstance(node, ast.Assign): + continue + for target in node.targets: + if not isinstance(target, ast.Name): + continue + if target.id == "GRADERS": + graders = [ + (t[0], t[1], t[2]) for t in ast.literal_eval(node.value) + ] + elif target.id == "BLOCKER_CAP": + cap = ast.literal_eval(node.value) + if graders is None or cap is None: + raise SystemExit("could not read GRADERS/BLOCKER_CAP out of tasks.py") + total = sum(w for _n, w, _b in graders) + if abs(total - 1.0) > 1e-9: + raise SystemExit(f"weights sum to {total}, not 1.0") + return graders, cap + + +def reward(results: dict[str, bool], graders, cap: float) -> tuple[float, float, list[str]]: + """The same arithmetic tasks.py does: weighted sum, then the flat cap.""" + uncapped = sum(w for n, w, _b in graders if results.get(n)) + failed = [n for n, _w, b in graders if b and not results.get(n)] + if not failed: + return uncapped, uncapped, [] + return max(0.0, min(uncapped, cap)), uncapped, failed + + +# Files the repo's own suite regenerates in place when the tools to do so happen +# to be installed (TestProtosRegenerate calls ./gen.sh). Grading a tree must not +# leave it different from the tree that was graded, or the next run is measuring +# something else. They are snapshotted before the first criterion and put back +# after the last one. +MUTABLE = ("pb/badgerpb4.pb.go",) + + +def snapshot(tree: Path) -> dict[str, bytes]: + out = {} + for rel in MUTABLE: + f = tree / rel + if f.exists(): + out[rel] = f.read_bytes() + return out + + +def restore(tree: Path, snap: dict[str, bytes]) -> list[str]: + changed = [] + for rel, data in snap.items(): + f = tree / rel + if f.exists() and f.read_bytes() != data: + f.write_bytes(data) + changed.append(rel) + return changed + + +def load_timeouts() -> dict[str, int]: + """The per-criterion timeout out of the same GRADERS table. + + It is handed to run_grading.sh as its second argument, exactly as tasks.py + does, so that the retry ladder here is fitted to the same budget it will have + on the platform. Grading locally against a different budget than the platform + uses is how a ladder that does not fit goes unnoticed. + """ + tree = ast.parse((HERE / "tasks.py").read_text()) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GRADERS" for t in node.targets): + return {t[0]: t[4] for t in ast.literal_eval(node.value)} + raise SystemExit("could not read GRADERS out of tasks.py") + + +TIMEOUTS = load_timeouts() + + +def run_criterion(tree: Path, name: str, state: Path, log_dir: Path) -> tuple[bool, float, str]: + env = dict(os.environ) + env.update({ + "REPO_DIR": str(tree), + "GRADER_DIR": str(GRADER), + "BASE_SRC": str(BASE_TREE), + "GRADER_STATE_DIR": str(state), + "PYTHON_BIN": sys.executable, + }) + budget = TIMEOUTS[name] + started = time.time() + proc = subprocess.run( + ["bash", str(GRADER / "run_grading.sh"), name, str(budget)], + env=env, capture_output=True, text=True, timeout=budget + 300, + ) + elapsed = time.time() - started + (log_dir / f"{name}.log").write_text(proc.stdout + "\n--- stderr ---\n" + proc.stderr) + if proc.returncode == 3: + raise SystemExit( + f"GRADER FAULT in {name} on {tree.name}:\n{proc.stdout[-4000:]}") + return proc.returncode == 0, elapsed, proc.stdout + + +def tree_digest(tree: Path) -> str: + """sha256 of a .calib tree: every tracked file, by path and content. + + `.git` is excluded because the trees are built by `cp -a base && git init && + git apply`, so the repository metadata differs between two trees that hold + the same source. + """ + h = hashlib.sha256() + for path in sorted(tree.rglob("*")): + rel = path.relative_to(tree).as_posix() + if rel == ".git" or rel.startswith(".git/"): + continue + if path.is_symlink(): + h.update(rel.encode() + b"\0symlink\0" + str(path.readlink()).encode()) + continue + if not path.is_file(): + continue + h.update(rel.encode() + b"\0") + h.update(hashlib.sha256(path.read_bytes()).digest()) + return h.hexdigest() + + +def refuse_if_it_is_base(which: str, tree: Path) -> None: + """A tree that IS the base tree cannot be graded under another name. + + An anti-noop row is a wrong ANSWER, and a wrong answer is a patched tree. + When the patch does not apply -- the file was not in the image, the hunk + went stale -- what is left in .calib/ is a byte-for-byte copy of the + untouched checkout, and grading it produces base's own row under the + patch's name: a control that measured nothing and reads as if it did. That + happened (lmax_option_only, 2026-09-05: `error: can't open patch`, row + 0.000 filed as a no-op control), so it is refused here rather than trusted + to a caller's `set -e`. + """ + if which == ALL_RED or not BASE_TREE.exists(): + return + if tree_digest(tree) == tree_digest(BASE_TREE): + raise SystemExit( + f"refusing to grade {tree}: it is byte-for-byte the untouched " + f"checkout in {BASE_TREE}, so a row filed under '{which}' would be " + f"base's row wearing another name. If this is an anti-noop tree, " + f"its patch did not apply -- rebuild it and check `git apply`'s " + f"exit status; if it is meant to be a copy of base, grade it as " + f"'{ALL_RED}'.") + + +def calibrate(which: str, graders, cap0: float, criteria: list[str], keep: bool) -> dict: + tree = tree_path(which) + if not (tree / "go.mod").exists(): + raise SystemExit(f"no {which} tree at {tree}; see .calib/README") + refuse_if_it_is_base(which, tree) + state = CALIB / f"state-{which}" + if not keep: + shutil.rmtree(state, ignore_errors=True) + state.mkdir(parents=True, exist_ok=True) + log_dir = CALIB / f"logs-{which}" + log_dir.mkdir(parents=True, exist_ok=True) + + print(f"\n=== {which} ===") + snap = snapshot(tree) + results: dict[str, bool] = {} + timings: dict[str, float] = {} + for name, weight, blocker in graders: + if criteria and name not in criteria: + continue + ok, elapsed, out = run_criterion(tree, name, state, log_dir) + results[name] = ok + timings[name] = elapsed + flag = "blocker" if blocker else " " + print(f" {'PASS' if ok else 'FAIL'} {name:<46} w={weight:.2f} {flag} " + f"{elapsed:6.1f}s") + for line in out.splitlines(): + if line.strip().startswith((" ratio_", " sst_", " elapsed_", " live_keys", + " gone_keys", " resurrections")): + print(f" {line.strip()}") + + reverted = restore(tree, snap) + if reverted: + print(f" (grading rewrote {', '.join(reverted)}; the tree has been put back)") + + final, uncapped, failed = reward(results, graders, cap0) + print(f" -> uncapped {uncapped:.3f}, failed blockers {failed or 'none'}, " + f"reward {final:.3f}") + return {"tree": which, "results": results, "timings": timings, + "uncapped": uncapped, "reward": final, "failed_blockers": failed} + + +def build_time_gate(args, criteria: list[str]) -> bool: + """There is no build-time step left to gate. + + There used to be one: the image recorded `go vet ./...` on the pristine base + checkout into grader/baseline/vet.txt while it was being built, and this + rung proved that step could run under the builder's memory cap. Both are + gone. The vet baseline was a RECORDED ANSWER shipped inside the container + that the criterion grades — the same shape of artefact the -race suite + baseline was moved out of, and with no better defence — so it is measured at + grading time now, on both trees, minutes apart, by the criterion that + consumes it. With nothing recorded at build time, record_baseline.py and + this gate have nothing to measure, and a gate that measures nothing is a + green light that means nothing. + """ + if args.build_time_steps == "on": + print("build-time gate: there are no build-time steps in this grader any " + "more (the vet baseline is measured at grading time); nothing to run", + file=sys.stderr) + return False + print("build-time gate: not applicable — this grader records nothing at image " + "build time, so there is no step whose memory this could prove") + return True + + +def main() -> None: + global ALL_GREEN, ALL_RED, EXPECTED + ap = argparse.ArgumentParser() + ap.add_argument("trees", nargs="*", default=None, + help="gold, base, or any .calib/ tree (default: gold and base)") + ap.add_argument("--criteria", default="", + help="comma separated subset of criteria to run") + ap.add_argument("--keep-state", action="store_true", + help="reuse the built driver binaries from a previous run") + ap.add_argument("--as-gold", default=ALL_GREEN, + help="tree that plays the reference solution (default: gold)") + ap.add_argument("--as-base", default=ALL_RED, + help="tree that plays the untouched checkout (default: base)") + # Kept as a flag so that an old command line still parses, and because the + # hole it was built for is worth remembering: v6 shipped two green local + # calibrations and failed two deploys, because the calibration proved the + # CRITERIA and said nothing about a step that ran at image build time. The + # answer this round is that there is no such step any more (see + # build_time_gate above), which closes the hole rather than gating it. + ap.add_argument("--build-time-steps", choices=("auto", "on", "off"), + default="auto", + help="no build-time steps remain; kept so old invocations parse") + ap.add_argument("--build-time-headroom", type=float, default=0.15, + help="fraction of the memory cap that must be free at peak") + args = ap.parse_args() + + ALL_GREEN, ALL_RED = args.as_gold, args.as_base + EXPECTED = {ALL_GREEN: 1.00, ALL_RED: 0.00} + + graders, cap0 = load_table() + criteria = [c for c in args.criteria.split(",") if c] + trees = args.trees or [ALL_GREEN, ALL_RED] + + if not build_time_gate(args, criteria): + sys.exit(1) + + report = [calibrate(t, graders, cap0, criteria, args.keep_state) for t in trees] + out = CALIB / "calibration.json" + + # Accumulate rather than overwrite: the anti-noop patches are graded in + # their own invocations, and the file is supposed to end up holding the + # whole matrix - gold, base and every wrong answer - not whichever run + # happened to go last. + previous = [] + if out.exists(): + try: + previous = json.loads(out.read_text()) + except (ValueError, OSError): + previous = [] + merged = {e["tree"]: e for e in previous if isinstance(e, dict) and "tree" in e} + merged.update({e["tree"]: e for e in report}) + order = ["gold", "base"] + rows = ([merged[t] for t in order if t in merged] + + [e for t, e in sorted(merged.items()) if t not in order]) + out.write_text(json.dumps(rows, indent=2) + "\n") + + by_tree = {e["tree"]: e for e in report} + + # criterion -> gold -> base, the table the calibration is actually about. + if not criteria and ALL_GREEN in by_tree and ALL_RED in by_tree: + print("\n=== criterion | weight | blocker | gold | base ===") + for name, weight, blocker in graders: + g = by_tree[ALL_GREEN]["results"].get(name) + b = by_tree[ALL_RED]["results"].get(name) + print(f" {name:<46} {weight:>5.2f} {'blocker' if blocker else ' '} " + f"{'PASS' if g else 'FAIL':<5} {'PASS' if b else 'FAIL'}") + + print("\n=== calibration ===") + ok = True + for entry in report: + got = entry["reward"] + if entry["tree"] not in EXPECTED: + failed = entry["failed_blockers"] or "none" + print(f" {entry['tree']}: reward {got:.3f}, failed blockers {failed}") + continue + want = EXPECTED[entry["tree"]] + if criteria: + print(f" {entry['tree']}: reward {got:.3f} (partial run, not checked)") + continue + mark = "**%.2f**" % got + good = abs(got - want) < 1e-9 + ok = ok and good + print(f" {entry['tree']}: {mark} (expected {want:.2f}) " + f"{'OK' if good else 'MISCALIBRATED'}") + + # The invariant that a total alone cannot show: nothing an untouched + # checkout does may be worth a point, and nothing the reference solution + # does may be worth less than one. + if not criteria: + if ALL_RED in by_tree: + green = sorted(n for n, v in by_tree[ALL_RED]["results"].items() if v) + if green: + ok = False + print(f" base: NOT ALL RED — {', '.join(green)} passed on the " + f"untouched checkout; a criterion a baseline can pass is a " + f"criterion that scores code that was already there") + else: + print(" base: all criteria red, one by one") + if ALL_GREEN in by_tree: + red = sorted(n for n, v in by_tree[ALL_GREEN]["results"].items() if not v) + if red: + ok = False + print(f" gold: NOT ALL GREEN — {', '.join(red)} failed on the " + f"reference solution") + else: + print(" gold: all criteria green, one by one") + + print(f"\nwritten to {out}") + sys.exit(0 if ok else 1) + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/badger-v2/coding/__init__.py b/harbor/sources/badger-v2/coding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88280a271d88bae2eb437ca5e8c172120a66f336 --- /dev/null +++ b/harbor/sources/badger-v2/coding/__init__.py @@ -0,0 +1,5 @@ +"""The coding environment's core: repo-lifecycle primitives and task flavors.""" + +from . import repo, swe_bench_pro + +__all__ = ["repo", "swe_bench_pro"] diff --git a/harbor/sources/badger-v2/coding/github.py b/harbor/sources/badger-v2/coding/github.py new file mode 100644 index 0000000000000000000000000000000000000000..d07288e5f438181af931b88982147e86ebd1c16f --- /dev/null +++ b/harbor/sources/badger-v2/coding/github.py @@ -0,0 +1,158 @@ +"""A minimal mock GitHub for SDLC tasks. + +One in-process store holds issues (seeded per task) and the pull requests and +comments the agent creates; :func:`serve` publishes it as ``github_*`` MCP +tools over an ``mcp`` capability. The remote itself is a bare git repo on +disk (see :func:`coding.repo.create_remote`) — the agent pushes branches with +plain git and references them from pull requests here. +""" + +from __future__ import annotations + +import asyncio +import json +import socket +from dataclasses import asdict, dataclass, field +from typing import Any + +from fastmcp import FastMCP +from hud.capabilities import Capability + + +@dataclass +class Issue: + number: int + title: str + body: str + labels: list[str] = field(default_factory=list) + state: str = "open" + comments: list[str] = field(default_factory=list) + + +@dataclass +class PullRequest: + number: int + title: str + body: str + head: str + base: str + state: str = "open" + comments: list[str] = field(default_factory=list) + + +class MockGitHub: + """Issue/PR store with an action log (for rubric grading).""" + + def __init__(self) -> None: + self.issues: dict[int, Issue] = {} + self.pull_requests: dict[int, PullRequest] = {} + self.actions: list[dict[str, Any]] = [] + + def seed(self, issues: list[dict[str, Any]]) -> None: + """Reset the store to the task's fixtures.""" + self.issues = { + int(entry["number"]): Issue( + number=int(entry["number"]), + title=str(entry["title"]), + body=str(entry.get("body", "")), + labels=[str(label) for label in entry.get("labels", [])], + ) + for entry in issues + } + self.pull_requests = {} + self.actions = [] + + def _record(self, action: str, **details: Any) -> None: + self.actions.append({"action": action, **details}) + + # ─── operations (the tool surface) ──────────────────────────────── + + def list_issues(self) -> list[dict[str, Any]]: + return [asdict(issue) for issue in self.issues.values()] + + def get_issue(self, number: int) -> dict[str, Any]: + return asdict(self._issue(number)) + + def close_issue(self, number: int) -> dict[str, Any]: + issue = self._issue(number) + issue.state = "closed" + self._record("close_issue", number=number) + return asdict(issue) + + def comment_on_issue(self, number: int, body: str) -> dict[str, Any]: + issue = self._issue(number) + issue.comments.append(body) + self._record("comment_on_issue", number=number, body=body) + return asdict(issue) + + def create_pull_request(self, title: str, body: str, head: str, base: str) -> dict[str, Any]: + number = len(self.pull_requests) + 1 + pr = PullRequest(number=number, title=title, body=body, head=head, base=base) + self.pull_requests[number] = pr + self._record("create_pull_request", number=number, title=title, head=head) + return asdict(pr) + + def list_pull_requests(self) -> list[dict[str, Any]]: + return [asdict(pr) for pr in self.pull_requests.values()] + + def _issue(self, number: int) -> Issue: + if number not in self.issues: + raise ValueError(f"no such issue: #{number}") + return self.issues[number] + + # ─── grading views ──────────────────────────────────────────────── + + def latest_pull_request(self) -> PullRequest | None: + return next(reversed(self.pull_requests.values()), None) + + def transcript(self) -> str: + """Everything the agent did here, for rubric judging.""" + return json.dumps( + { + "issues": [asdict(issue) for issue in self.issues.values()], + "pull_requests": [asdict(pr) for pr in self.pull_requests.values()], + "actions": self.actions, + }, + indent=2, + ) + + +def serve(github: MockGitHub) -> tuple[asyncio.Task[None], Capability]: + """Serve *github* as ``github_*`` MCP tools; returns the server task + capability.""" + server: FastMCP = FastMCP(name="github") + + @server.tool + def github_list_issues() -> list[dict[str, Any]]: + """List all issues in the repository.""" + return github.list_issues() + + @server.tool + def github_get_issue(number: int) -> dict[str, Any]: + """Get one issue by number.""" + return github.get_issue(number) + + @server.tool + def github_close_issue(number: int) -> dict[str, Any]: + """Close an issue.""" + return github.close_issue(number) + + @server.tool + def github_comment_on_issue(number: int, body: str) -> dict[str, Any]: + """Add a comment to an issue.""" + return github.comment_on_issue(number, body) + + @server.tool + def github_create_pull_request(title: str, body: str, head: str, base: str = "main") -> dict[str, Any]: + """Open a pull request from branch *head* (already pushed to the remote) into *base*.""" + return github.create_pull_request(title, body, head, base) + + @server.tool + def github_list_pull_requests() -> list[dict[str, Any]]: + """List all pull requests.""" + return github.list_pull_requests() + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + port = int(sock.getsockname()[1]) + task = asyncio.create_task(server.run_async(transport="http", host="127.0.0.1", port=port, show_banner=False)) + return task, Capability.mcp(name="github", url=f"http://127.0.0.1:{port}/mcp") diff --git a/harbor/sources/badger-v2/coding/repo.py b/harbor/sources/badger-v2/coding/repo.py new file mode 100644 index 0000000000000000000000000000000000000000..bb675cf6f58da32de51e10bc71bdb1bc4b5057d9 --- /dev/null +++ b/harbor/sources/badger-v2/coding/repo.py @@ -0,0 +1,172 @@ +"""Git-history vaulting and diff-based grading primitives. + +The repo's real ``.git`` may contain the answer key — solution branches, the +fix commit, the hidden tests. Every task flavor shares this lifecycle: + +- setup (:func:`vault_history`): snapshot the pre-agent worktree into the + real history, move ``.git`` into a vault outside the workspace, and leave a + fresh single-commit repo — git works normally for the agent, but there is + no history, no refs, and no remotes. +- grading (:func:`restore_history` → :func:`capture_agent_diff` → + :func:`reset_worktree` → :func:`apply_diff`): discard the agent's ``.git`` + (hooks and history included), restore the vaulted history, capture the + agent's changes as a diff against the setup snapshot, reset the worktree to + that snapshot, and re-apply the diff. Hidden tests come from vaulted refs + and land after the agent's diff. + +The snapshot covers the whole worktree, so installed dependencies and build +artifacts survive into grading. +""" + +from __future__ import annotations + +import asyncio +import os +import shutil +from pathlib import Path + +_GIT_ID = ("-c", "user.name=hud-grader", "-c", "user.email=grader@hud.ai") +_SETUP_COMMIT = "setup_commit" + + +async def run( + *argv: str, + cwd: Path, + timeout: float = 600.0, + check: bool = True, +) -> tuple[int, str, str]: + """Run a command, returning ``(returncode, stdout, stderr)``. Kills on timeout.""" + proc = await asyncio.create_subprocess_exec( + *argv, + cwd=str(cwd), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + try: + out_bytes, err_bytes = await asyncio.wait_for(proc.communicate(), timeout=timeout) + except TimeoutError: + proc.kill() + await proc.wait() + raise TimeoutError(f"{' '.join(argv[:4])} timed out after {timeout:.0f}s") from None + out = out_bytes.decode("utf-8", "replace") + err = err_bytes.decode("utf-8", "replace") + if check and proc.returncode != 0: + detail = (err.strip() or out.strip())[:2000] + raise RuntimeError(f"{' '.join(argv)} failed ({proc.returncode}): {detail}") + return proc.returncode if proc.returncode is not None else 1, out, err + + +async def git(repo: Path, *args: str, timeout: float = 600.0, check: bool = True) -> tuple[int, str, str]: + return await run("git", *_GIT_ID, *args, cwd=repo, timeout=timeout, check=check) + + +def _append_git_exclude(git_dir: Path) -> None: + """Keep the workspace's SSH credential dir out of snapshots and diffs.""" + exclude = git_dir / "info" / "exclude" + exclude.parent.mkdir(parents=True, exist_ok=True) + with exclude.open("a", encoding="utf-8") as fh: + fh.write("\n.hud/\n") + + +async def vault_history(repo: Path, vault: Path) -> None: + """Snapshot the pre-agent state, then hide the repo's history in *vault*.""" + if (vault / "git").exists(): + raise RuntimeError(f"vault {vault} already holds a history: one task per substrate") + + if hasattr(os, "geteuid") and os.geteuid() == 0: + # Grade-time git runs as root on the (chowned) agent-owned repo; git + # honors safe.directory only from system/global config, never from -c. + await run("git", "config", "--global", "--add", "safe.directory", str(repo), cwd=Path("/")) + + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: pre-agent snapshot") + _, sha, _ = await git(repo, "rev-parse", "HEAD") + + vault.mkdir(parents=True, exist_ok=True) + (vault / _SETUP_COMMIT).write_text(sha.strip(), "utf-8") + shutil.move(str(repo / ".git"), str(vault / "git")) + + await git(repo, "init", "-q", ".") + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "baseline") + + +async def create_remote(repo: Path, remote: Path, ref: str, *, branch: str = "main") -> None: + """A bare "GitHub" remote holding *ref*'s history as *branch*. + + Pushing a single ref publishes only its ancestry — sibling answer-key + branches (hidden tests, golden fix) stay unreachable, while the agent + still gets realistic past history to work with. + """ + remote.parent.mkdir(parents=True, exist_ok=True) + await git(remote.parent, "init", "-q", "--bare", "-b", branch, str(remote)) + await git(repo, "push", "-q", str(remote), f"{ref}:refs/heads/{branch}") + + +async def attach_to_remote(repo: Path, remote: Path, *, branch: str = "main") -> None: + """Point the agent's fresh repo at the remote, sharing its (sanitized) history. + + Called after :func:`vault_history`: the throwaway single-commit repo is + replaced by the remote's clone state — same worktree, but with ``origin`` + configured and history the agent can branch from and push back to. + """ + shutil.rmtree(repo / ".git") + await git(repo, "init", "-q", "-b", branch, ".") + _append_git_exclude(repo / ".git") + await git(repo, "remote", "add", "origin", str(remote)) + await git(repo, "fetch", "-q", "origin") + # Adopt the remote's history without a checkout: the worktree already + # matches (plus untracked build artifacts a checkout would refuse to + # cross), so point the branch at origin and sync only the index. + await git(repo, "update-ref", f"refs/heads/{branch}", f"refs/remotes/origin/{branch}") + await git(repo, "reset", "-q") + await git(repo, "branch", "-q", f"--set-upstream-to=origin/{branch}", branch) + + +async def restore_history(repo: Path, vault: Path) -> str: + """Swap the agent's throwaway ``.git`` for the vaulted real history. + + Returns the setup-snapshot commit sha recorded by :func:`vault_history`. + """ + agent_git = repo / ".git" + if agent_git.exists(): + shutil.rmtree(agent_git) + shutil.move(str(vault / "git"), str(agent_git)) + return (vault / _SETUP_COMMIT).read_text("utf-8").strip() + + +async def capture_agent_diff(repo: Path, setup_commit: str) -> str: + """The agent's changes: setup snapshot -> final worktree state. + + Runs on the restored real history: the final worktree (including files the + agent added) is committed and diffed against the snapshot. + """ + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: final snapshot") + _, final, _ = await git(repo, "rev-parse", "HEAD") + # --binary is mandatory: without it git emits "Binary files ... differ" for + # any binary file the agent added, and `git apply` then rejects the ENTIRE + # patch — scoring a real solution 0.0. Verified end to end. + _, diff, _ = await git( + repo, "diff", "--binary", setup_commit, final.strip(), timeout=1200.0 + ) + return diff + + +async def reset_worktree(repo: Path, setup_commit: str) -> None: + await git(repo, "reset", "--hard", setup_commit) + await git(repo, "clean", "-fd") + + +async def apply_diff(repo: Path, diff: str, patch_path: Path) -> str | None: + """Apply *diff* to the worktree; returns git's error output on failure.""" + if not diff.strip(): + return None + patch_path.parent.mkdir(parents=True, exist_ok=True) + patch_path.write_text(diff, "utf-8") + code, out, err = await git(repo, "apply", "-v", str(patch_path), check=False) + if code != 0: + return (err.strip() or out.strip())[-4000:] + return None diff --git a/harbor/sources/badger-v2/coding/swe_bench_pro.py b/harbor/sources/badger-v2/coding/swe_bench_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..da655cfc4cfaf8596fa6e18c3a47c8aad21d42d5 --- /dev/null +++ b/harbor/sources/badger-v2/coding/swe_bench_pro.py @@ -0,0 +1,149 @@ +"""The SWE-bench Pro task flavor: dataset-row parsing and the official grading pipeline. + +An instance directory (baked into the instance image by ``swe_tasks.py``) +holds the dataset row (``instance.json``) plus the official per-instance +``run_script.sh`` and ``parser.py`` from scaleapi/SWE-bench_Pro-os. Grading +replays the official evaluator's entryscript on the repo-lifecycle primitives +in :mod:`coding.repo`: reset to the pre-agent snapshot, apply the (agent or +golden) patch, check out the hidden test files, run the script, parse, and +resolve iff every ``fail_to_pass`` and ``pass_to_pass`` test passes. +""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +from . import repo as repo_lib + + +def load_instance(instance_dir: Path) -> dict[str, Any]: + return json.loads((instance_dir / "instance.json").read_text("utf-8")) + + +def str_list(field: str) -> list[str]: + """Parse the dataset's list-shaped string fields. + + The rows store lists as Python reprs (single quotes; the official + evaluator uses ``eval``), so ``ast.literal_eval`` is the safe equivalent. + """ + value = ast.literal_eval(field) + if not isinstance(value, list): + raise ValueError(f"expected a list, got {type(value).__name__}") + return [str(item) for item in value] + + +def strip_binary_hunks(patch: str) -> str: + """Drop binary diff sections, exactly like the official evaluator.""" + if not patch: + return patch + sections = re.split(r"(?=^diff --git )", patch, flags=re.MULTILINE) + kept = [ + section + for section in sections + if section.strip() + and not re.search(r"^Binary files .* differ$", section, re.MULTILINE) + and not re.search(r"^GIT binary patch$", section, re.MULTILINE) + ] + return "".join(kept) + + +def score(instance: dict[str, Any], tests: list[dict[str, Any]]) -> EvaluationResult: + """The official resolution criterion: every required test passes.""" + passed = {t["name"] for t in tests if t.get("status") == "PASSED"} + fail_to_pass = set(str_list(instance["fail_to_pass"])) + pass_to_pass = set(str_list(instance["pass_to_pass"])) + required = fail_to_pass | pass_to_pass + resolved = required <= passed + + def fraction(subset: set[str]) -> float: + return len(subset & passed) / len(subset) if subset else 1.0 + + missing = sorted(required - passed) + return EvaluationResult( + reward=1.0 if resolved else 0.0, + content="resolved" if resolved else f"unresolved: {len(missing)} required test(s) not passing", + subscores=[ + SubScore(name="resolved", value=1.0 if resolved else 0.0, weight=1.0), + SubScore(name="fail_to_pass", value=fraction(fail_to_pass), weight=0.0), + SubScore(name="pass_to_pass", value=fraction(pass_to_pass), weight=0.0), + ], + info={"tests_reported": len(tests), "missing": missing[:20]}, + ) + + +def build_prompt(instance: dict[str, Any], repo_dir: Path) -> str: + sections = [ + f"You are working in {repo_dir}, a checkout of the {instance['repo']} repository. " + "Resolve the issue described below by modifying the code. Hidden tests grade your " + "work when you finish; do not modify existing tests.", + instance["problem_statement"], + ] + if instance.get("requirements"): + sections.append("## Requirements\n\n" + instance["requirements"]) + if instance.get("interface"): + sections.append("## Interface\n\n" + instance["interface"]) + return "\n\n".join(section.strip() for section in sections if section and section.strip()) + + +async def grade( + instance: dict[str, Any], + instance_dir: Path, + repo_dir: Path, + vault_dir: Path, + logs_dir: Path, + *, + validate_mode: str | None = None, + tests_timeout: float = 3600.0, +) -> EvaluationResult: + """Replay the official evaluator's entryscript in place. + + ``validate_mode="golden"`` grades the dataset's golden patch instead of + the agent's diff (the official gold-patch sanity check). The hidden test + files (the last line of ``before_repo_set_cmd``) are checked out *after* + the patch, so patch edits to them never survive. + """ + logs_dir.mkdir(parents=True, exist_ok=True) + setup_commit = await repo_lib.restore_history(repo_dir, vault_dir) + + if validate_mode == "golden": + diff = instance["patch"] + else: + diff = await repo_lib.capture_agent_diff(repo_dir, setup_commit) + diff = strip_binary_hunks(diff) + + await repo_lib.reset_worktree(repo_dir, setup_commit) + apply_error = await repo_lib.apply_diff(repo_dir, diff, logs_dir / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + + test_checkout = instance["before_repo_set_cmd"].strip().splitlines()[-1] + await repo_lib.run("bash", "-c", test_checkout, cwd=repo_dir) + + files_csv = ",".join(str_list(instance["selected_test_files_to_run"])) + _, out, err = await repo_lib.run( + "bash", + str(instance_dir / "run_script.sh"), + files_csv, + cwd=repo_dir, + timeout=tests_timeout, + check=False, + ) + (logs_dir / "stdout.log").write_text(out, "utf-8") + (logs_dir / "stderr.log").write_text(err, "utf-8") + await repo_lib.run( + sys.executable, + str(instance_dir / "parser.py"), + "stdout.log", + "stderr.log", + "output.json", + cwd=logs_dir, + ) + tests = json.loads((logs_dir / "output.json").read_text("utf-8"))["tests"] + return score(instance, tests) diff --git a/harbor/sources/badger-v2/env.py b/harbor/sources/badger-v2/env.py new file mode 100644 index 0000000000000000000000000000000000000000..4790cabb1be4ef9a0d53b4bea06f7ae6224a6df9 --- /dev/null +++ b/harbor/sources/badger-v2/env.py @@ -0,0 +1,438 @@ +"""Coding environment (HUD v6): a repo workspace with diff-based grading. + +The env publishes one ``ssh`` workspace over a git repo; the agent's harness +brings its own bash/file tools. Task setup vaults the repo's real history +(:mod:`coding.repo`) so the agent gets a fresh single-commit repo with working +git but no answer-key refs; grading captures the agent's changes as a diff, +resets to the pre-agent snapshot, re-applies, brings in the hidden tests, and +runs them. + +Three task templates: + +- ``coding-task`` — hidden tests live as refs in the repo's vaulted history + (the ``{task}_baseline`` / ``{task}_test`` / ``{task}_golden`` branch + convention) and a shell command scores by exit code. Runs locally (clones + ``REPO_URL`` per process) or from an image that bakes the repo. +- ``sdlc-task`` — adds workflow: a bare mock-GitHub remote the agent pushes + to, ``github_*`` issue/PR tools (:mod:`coding.github`), and grading over + the pushed pull-request branch instead of the worktree. +- one SWE-bench Pro instance template, registered only when an instance dir + is baked in (see ``swe_tasks.py``): grading replays the official evaluator + (:mod:`coding.swe_bench_pro`). + +Images set ``REPO_DIR``; locally everything lives in per-process temp dirs. +The image substrate here is badger (Go, ~15 modules), so the agent's Go +environment is declared explicitly on the workspace — see ``AGENT_GO_ENV``. +The vault, the hidden grader, the held-out fixtures, the pristine base +checkout and gold.diff sit outside the workspace — under ``/hud`` (root, mode +700) in images — and agent shells drop to a non-root uid, so only the env +process can read them. + +The task this env carries is ``lmax_reclaim_idle_lsm``, registered in +``tasks.py``; the three generic templates below come with the coding-template +and are unused here. +""" + +from __future__ import annotations + +import asyncio +import logging +import os +import shutil +import tempfile +from pathlib import Path +from typing import Any + +from hud.environment import Environment, Workspace +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine +from hud.settings import settings + +from coding import repo as repo_lib +from coding import swe_bench_pro as swe +from coding.github import MockGitHub +from coding.github import serve as serve_github + +logger = logging.getLogger(__name__) + +# ─── substrate layout ──────────────────────────────────────────────────── +# Images set REPO_DIR (and ship the repo); locally everything lives in +# per-process temp dirs and the repo is cloned from REPO_URL at startup. + +_explicit_repo = os.environ.get("REPO_DIR") +if _explicit_repo: + REPO_DIR = Path(_explicit_repo) + VAULT_DIR = Path(os.environ.get("VAULT_DIR", "/hud/vault")) + LOGS_DIR = Path(os.environ.get("GRADING_LOGS_DIR", "/hud/logs")) + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / "hud-coding" + REPO_DIR = _LOCAL_ROOT / f"repo-{os.getpid()}" + VAULT_DIR = _LOCAL_ROOT / f"vault-{os.getpid()}" + LOGS_DIR = _LOCAL_ROOT / f"logs-{os.getpid()}" + _LOCAL_SUBSTRATE = True + +# The SDLC flavor's mock-GitHub remote: a bare repo the agent pushes to. It +# must be writable by the agent, so it lives outside /hud. +REMOTE_DIR = ( + Path(os.environ.get("REMOTE_DIR", "/srv/git/project.git")) + if _explicit_repo + else _LOCAL_ROOT / f"remote-{os.getpid()}" / "project.git" +) + +REPO_URL = os.environ.get("REPO_URL", "https://github.com/dgraph-io/badger") +TESTS_TIMEOUT = float(os.environ.get("GRADING_TIMEOUT", "3600")) + +INSTANCE_DIR = Path(os.environ.get("INSTANCE_DIR", "/hud/instance")) + +AGENT_UID = 1000 +AGENT_HOME = Path("/tmp/agent-home") # noqa: S108 - container-local, created at setup + +env = Environment(name="ec-swe-badger-journal") + + +# The agent's Go environment, and why it is spelled out here rather than left +# to the image's ENV. +# +# When shell_uid drops privileges, hud does NOT hand the session the serving +# process's environment: Workspace._session_env() builds a minimal one from +# scratch (PATH, HOME, TERM) and layers this dict on top, precisely so a +# secret the env process holds cannot leak into the agent's shell. So every +# `ENV GO...` line in the Dockerfile reaches the grader and never the agent. +# +# That is harmless for a repo with no dependencies. badger has ~15 (ristretto, +# flatbuffers, klauspost/compress, otel, protobuf, ...) and the rollout is +# offline: with GOPATH left at its default the agent's module cache would be +# $HOME/go — empty — and `go build ./...` would fail on the first import with +# no network to recover from. The task would be impossible for reasons that +# have nothing to do with the ticket. +# +# GOPATH points at the module cache the image pre-populated. It is root-owned +# and read-only to uid 1000 on purpose: the grader compiles its own harness +# against the agent's tree with GOPROXY=off, and a module cache the agent +# could rewrite would be a way to change what that harness compiles. GOCACHE +# is the one Go directory the agent must be able to write, so it sits in the +# agent's HOME (pre-warmed at image build). +AGENT_GO_ENV = { + "GOPATH": os.environ.get("AGENT_GOPATH", "/go"), + "GOMODCACHE": os.environ.get("AGENT_GOMODCACHE", "/go/pkg/mod"), + "GOCACHE": str(AGENT_HOME / ".cache" / "go-build"), + "GOFLAGS": "-mod=mod", + "GOPROXY": "off", + "GOTOOLCHAIN": "local", + "GOWORK": "off", + # cgo on, and gcc in the image, for one concrete reason: the ticket + # promises three named regression tests stay green and the grader runs the + # suite under `-race`, which on linux refuses to build without cgo + # ("go: -race requires cgo"). An agent that cannot run the check it is + # graded by is being graded on something it could not see. + "CGO_ENABLED": "1", + # ── memory, not difficulty ──────────────────────────────────────────── + # MEASURED 2026-09-08: three of five rollouts in the 300-step final died + # with metadata.container_oom_killed=True, i.e. the harness lost the run + # before the grader ever saw a tree. The container's memory limit cannot be + # raised from this package (hud/eval/runtime/hud.py::_runtime_session -- + # declared `limits` on an already-deployed env raise ValueError, and + # cpu/memory in runtime_config are softly ignored with a warning; memory_mb + # exists only for the docker/compose/modal/daytona providers, i.e. locally). + # So the only honest lever is to make the AGENT's toolchain fit the box it + # is in: a soft heap ceiling and two build/test workers instead of one per + # core. This is the agent session only -- the grader compiles its harness + # with its own environment (Dockerfile.hud, step 8), so no oracle changes. + "GOMEMLIMIT": "1GiB", + "GOMAXPROCS": "2", +} +# PATH is deliberately NOT in that dict. An agent session is a LOGIN shell +# (`env -i ... bash -l`), and Debian's /etc/profile assigns PATH +# unconditionally, so anything set here would be thrown away before the first +# command runs -- measured, not assumed: `docker run IMG bash -lc 'command -v +# go'` finds nothing without the fix. The toolchain therefore goes on PATH from +# inside the image, in /etc/profile.d/10-go-toolchain.sh, where a login shell +# cannot lose it. That file also repeats the variables above as defaults, so +# the two mechanisms cover each other. + + +# network=False — hud's own default (Workspace.__init__, workspace.py:321). We had +# True only because the CLI scaffold ships it (hud/cli/templates.py:35). +# ⚠️ MEASURED 2026-09-03: this flag is a NO-OP in our images. `unshare --net` is +# applied only through bwrap (workspace.py:1049, :1292 fall back to a bare shell +# when self._bwrap is None), and bwrap is absent from every image; installing it +# does not help either — usable_bwrap() still returns None because the eval +# substrate denies the privileges (unshare: Operation not permitted). +# Verified inside the image: `git ls-remote https://github.com/... HEAD` → RC 0. +# The agent shell REACHES THE INTERNET regardless of this flag. Kept False so the +# intent is right if the substrate ever grants isolation — but never rely on it, +# and never claim "offline" in a ticket. +_ws = Workspace( + REPO_DIR, + guest_path=str(REPO_DIR), + network=False, + env={"HOME": str(AGENT_HOME), **({} if _LOCAL_SUBSTRATE else AGENT_GO_ENV)}, + track_files=settings.file_tracking_enabled, + shell_uid=AGENT_UID, +) + +SDLC_TOOLS = os.environ.get("SDLC_TOOLS", "") not in ("", "0", "false") + +# Hedged on purpose ("can exhaust it", not "is killed"): the local memory gate +# (forensics/v20-board/memory-gate.log) could NOT reproduce a container kill from +# the repo's own suite at 2900m or at 1000m, with or without the limits above. The +# note may state the size of the box; it may not state a failure nobody measured. +# A fact about the machine, not a hint about the ticket: the size of the box and +# the shape of the command that fits in it. No symptom, no file name, no sample +# of the task is stated here (minimal-ticket law), and nothing here is graded. +WORKSPACE_NOTE = ( + f"Please make your changes directly in {REPO_DIR}, not in a copy or a " + "separate worktree.\n" + "Environment: this container has about 2 vCPUs and a hard memory limit, and " + "a fully parallel build or test run (especially under `-race`) can exhaust " + "it. Build and test package by package, e.g. `go test -p 1 ./...`." +) + +_github = MockGitHub() +_github_server: asyncio.Task[None] | None = None + + +@env.initialize +async def _up() -> None: + global _github_server + if _LOCAL_SUBSTRATE and not (REPO_DIR / ".git").exists(): + REPO_DIR.parent.mkdir(parents=True, exist_ok=True) + logger.info("cloning %s into %s", REPO_URL, REPO_DIR) + await repo_lib.run("git", "clone", "-q", REPO_URL, str(REPO_DIR), cwd=REPO_DIR.parent) + await _ws.start() + env.add_capability(_ws.capability("shell")) + if _ws.tracks_files: + env.add_capability(_ws.file_tracking_capability()) + # The mock-GitHub tools belong to the SDLC flavor, which seeds issues and + # wants a pull request. A plain coding task never uses them, and offering + # them anyway spends agent steps on an empty issue list - every rollout so + # far called github_list_issues and github_list_pull_requests once. + if SDLC_TOOLS: + _github_server, github_capability = serve_github(_github) + env.add_capability(github_capability) + + +@env.shutdown +async def _down() -> None: + if _github_server is not None: + _github_server.cancel() + await _ws.stop() + if _LOCAL_SUBSTRATE: + for path in (REPO_DIR, VAULT_DIR, LOGS_DIR, REMOTE_DIR.parent): + shutil.rmtree(path, ignore_errors=True) + + +# ─── shared task lifecycle ─────────────────────────────────────────────── + + +async def _setup(base_ref: str | None = None, *, remote: bool = False) -> None: + """Check out the task's baseline, vault the history, hand the repo to the agent. + + With ``remote=True`` (the SDLC flavor) a bare "GitHub" remote is created + from the baseline first, and the agent's repo is attached to it as a + normal clone would be — realistic history, pushes, and branches, but no + reachable answer-key refs. + """ + if base_ref: + await repo_lib.git(REPO_DIR, "checkout", "-qf", base_ref) + if remote: + await repo_lib.create_remote(REPO_DIR, REMOTE_DIR, base_ref or "HEAD") + await repo_lib.vault_history(REPO_DIR, VAULT_DIR) + if remote: + await repo_lib.attach_to_remote(REPO_DIR, REMOTE_DIR) + if hasattr(os, "geteuid") and os.geteuid() == 0: + AGENT_HOME.mkdir(parents=True, exist_ok=True) + uid = f"{AGENT_UID}:{AGENT_UID}" + paths = [str(REPO_DIR), str(AGENT_HOME)] + ([str(REMOTE_DIR)] if remote else []) + await repo_lib.run("chown", "-R", uid, *paths, cwd=Path("/")) + if remote: + # The grader (root) pushes to and clones from the agent-owned remote. + await repo_lib.run("git", "config", "--global", "--add", "safe.directory", str(REMOTE_DIR), cwd=Path("/")) + + +# ─── generic flavor ────────────────────────────────────────────────────── + + +async def _grade_generic( + test_command: str, + base_ref: str | None, + test_ref: str | None, + test_files: list[str] | None, + golden_ref: str | None, + validate_mode: str | None, +) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + if not (base_ref and golden_ref): + raise ValueError('validate_mode="golden" needs base_ref and golden_ref') + _, diff, _ = await repo_lib.git(REPO_DIR, "diff", base_ref, golden_ref) + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + if test_ref: + # Hidden tests come from the vaulted history, after the agent's diff — + # so agent edits to them never survive into grading. + await repo_lib.git(REPO_DIR, "checkout", test_ref, "--", *(test_files or ["."])) + + command = test_command.format(test_files=" ".join(test_files or [])) + return await combine( + BashGrader.grade(weight=1.0, command=command, cwd=str(REPO_DIR), timeout_seconds=int(TESTS_TIMEOUT)) + ) + + +@env.template(id="coding-task", description="Fix a bug in the repo; hidden tests grade the diff.") +async def coding_task( + description: str, + test_command: str, + base_ref: str | None = None, + test_ref: str | None = None, + test_files: list[str] | None = None, + golden_ref: str | None = None, + validate_mode: str | None = None, +): + """Generic coding task. + + ``base_ref`` is the agent's starting state; ``test_ref`` holds the hidden + tests (``test_files`` are checked out from it at grade time); + ``test_command`` scores by exit code, with ``{test_files}`` expanded. + ``validate_mode="golden"`` grades ``base_ref..golden_ref`` instead of + agent edits. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup(base_ref) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. {WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests grade your " + f"work when you finish; do not modify existing tests.\n\n{description}" + ) + yield await _grade_generic(test_command, base_ref, test_ref, test_files, golden_ref, validate_mode) + + +# ─── SDLC flavor: issue-driven fix, graded on the pushed PR branch ─────── + + +async def _fetch_hidden_ref(dest: Path, ref: str) -> None: + """Fetch an answer-key ref from the vaulted history into *dest*.""" + full = f"refs/remotes/{ref}" if ref.startswith("origin/") else ref + await repo_lib.git(dest, "fetch", "-q", str(VAULT_DIR / "git"), full) + + +async def _grade_sdlc( + test_command: str, + test_ref: str, + test_files: list[str], + golden_ref: str | None, + pr_rubric: str | None, + validate_mode: str | None, +) -> EvaluationResult: + if validate_mode == "golden": + # Simulate the workflow the agent is graded on: push the reference + # fix as a branch and open a pull request for it. + if not golden_ref: + raise ValueError('validate_mode="golden" needs golden_ref') + await repo_lib.git(VAULT_DIR / "git", "push", "-q", str(REMOTE_DIR), f"{golden_ref}:refs/heads/golden-fix") + _github.create_pull_request( + "Fix the reported bug", "Applies the reference fix.", head="golden-fix", base="main" + ) + + pr = _github.latest_pull_request() + if pr is None: + return EvaluationResult(reward=0.0, content="no pull request was opened") + + # Hermetic checkout of the PR head from the remote (never the worktree). + grading_dir = LOGS_DIR / "pr-checkout" + shutil.rmtree(grading_dir, ignore_errors=True) + LOGS_DIR.mkdir(parents=True, exist_ok=True) + await repo_lib.run("git", "clone", "-q", str(REMOTE_DIR), str(grading_dir), cwd=LOGS_DIR) + code, _, err = await repo_lib.git(grading_dir, "checkout", "-q", pr.head, check=False) + if code != 0: + return EvaluationResult( + reward=0.0, + content=f"pull request head branch {pr.head!r} was never pushed", + info={"git_checkout": err.strip()[-2000:]}, + ) + + await _fetch_hidden_ref(grading_dir, test_ref) + await repo_lib.git(grading_dir, "checkout", "FETCH_HEAD", "--", *test_files) + + command = test_command.format(test_files=" ".join(test_files)) + quality: Any + if pr_rubric: + quality = LLMJudgeGrader.grade(weight=0.2, answer=_github.transcript(), criteria=[pr_rubric]) + else: + opened_well = bool(pr.title.strip() and pr.body.strip()) + quality = SubScore(name="pull_request", value=1.0 if opened_well else 0.0, weight=0.2) + return await combine( + BashGrader.grade(weight=0.8, command=command, cwd=str(grading_dir), timeout_seconds=int(TESTS_TIMEOUT)), + quality, + ) + + +@env.template( + id="sdlc-task", + description="Issue-driven bug fix: fix the code, push a branch, open a pull request.", +) +async def sdlc_task( + description: str, + test_command: str, + base_ref: str, + test_ref: str, + test_files: list[str], + issues: list[dict[str, Any]] | None = None, + golden_ref: str | None = None, + pr_rubric: str | None = None, + validate_mode: str | None = None, +): + """The generic flavor plus workflow: the repo has an ``origin`` remote (a + bare mock-GitHub repo) and ``github_*`` tools seeded with *issues*; the + deliverable is a pushed branch with a pull request. Grading checks the PR + head out of the remote, brings in the hidden tests, runs ``test_command`` + (weight 0.8), and scores the PR itself (weight 0.2) — structurally, or + against ``pr_rubric`` with an LLM judge when provided. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + _github.seed(issues or []) + await _setup(base_ref, remote=True) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}; its `origin` remote " + "is the team's shared repository, and the `github_*` tools give you the team's " + "issue tracker.\n\n" + "Complete the following task. When you are done, push your work to `origin` as a " + "new branch and open a pull request for it with `github_create_pull_request`. " + "Hidden tests grade your work; do not modify existing tests.\n\n" + f"{description}" + ) + yield await _grade_sdlc(test_command, test_ref, test_files, golden_ref, pr_rubric, validate_mode) + + +# ─── SWE-bench Pro flavor (present only in baked instance images) ──────── + +if (INSTANCE_DIR / "instance.json").is_file(): + INSTANCE = swe.load_instance(INSTANCE_DIR) + + @env.template( + id=INSTANCE["instance_id"], + description=f"SWE-bench Pro instance on {INSTANCE['repo']}", + ) + async def swe_bench_pro_task(validate_mode: str | None = None): + """One SWE-bench Pro rollout. ``validate_mode="golden"`` grades the + dataset's golden patch instead of agent edits (gold-patch validation).""" + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + _ = yield swe.build_prompt(INSTANCE, REPO_DIR) + yield await swe.grade( + INSTANCE, + INSTANCE_DIR, + REPO_DIR, + VAULT_DIR, + LOGS_DIR, + validate_mode=validate_mode, + tests_timeout=TESTS_TIMEOUT, + ) diff --git a/harbor/sources/badger-v2/faultprobe.py b/harbor/sources/badger-v2/faultprobe.py new file mode 100644 index 0000000000000000000000000000000000000000..cda5019ef542d4278cf450a0c92efe080c62a112 --- /dev/null +++ b/harbor/sources/badger-v2/faultprobe.py @@ -0,0 +1,181 @@ +#!/usr/bin/env python3 +"""Is "break the grader's fixture and collect the weight" a strategy? + + python3 faultprobe.py + +One question, asked over every tree that has ever been graded with this grader +(.calib/mutation-probe.json and the current-schema rows of .calib/calibration.json): + + for each criterion this tree does not pass, what does the tree GAIN by + turning that criterion from a FAIL into a GRADER FAULT? + +An agent can do that without touching the criterion it is failing: the checks +build a fixture inside the workspace with the library under test, so a tree that +makes `generate` never settle, or makes the driver refuse to build for one +scenario, converts a criterion it would fail into one the grader cannot judge. +That is the channel. Three rules are compared: + + absolve the shipped rule: a faulted criterion is scored 1.0 + normalise §5.3 as literally written: scored 0.0 and struck from the + denominator, the reward renormalised over the weight measured + strike what is implemented: scored 0.0, struck from the blocker set, + nothing renormalised. The normalised figure is reported in the + info block, and the run is flagged isError for a re-run. + +A rule closes the channel iff no tree can gain under it. Anything above zero is +weight an agent can have for breaking the grader instead of meeting a criterion. +""" + +from __future__ import annotations + +import json +from pathlib import Path + +import mutprobe as M + +HERE = Path(__file__).resolve().parent +CALIB = HERE / ".calib" + + +def load_matrix() -> dict[str, dict[str, bool]]: + """Every recorded tree whose row uses the criterion names in force today.""" + graders, _cap = M.load_table() + known = {n for n, _w, _b in graders} + # The one criterion added in this round has no recorded rows yet; a row is + # usable as long as it covers the criteria that existed when it was graded. + core = known - {"reclaims_keys_that_expire_while_idle"} + rows: dict[str, dict[str, bool]] = {} + for path in (CALIB / "mutation-probe.json", CALIB / "calibration.json"): + if not path.exists(): + continue + try: + entries = json.loads(path.read_text()) + except (ValueError, OSError): + continue + for e in entries: + res = e.get("results") or {} + if not core.issubset(res): + continue # an older schema, or a partial run + rows[e["tree"]] = {n: bool(res.get(n)) for n in known} + return rows + + +# ─── the three rules ─────────────────────────────────────────────────────── + + +def absolve(results, graders, cap, faults): + """Shipped: a faulted criterion is scored 1.0 and cannot cap.""" + faults = set(faults) + uncapped = sum(w for n, w, _b in graders if results.get(n) or n in faults) + failed = [n for n, _w, b in graders if b and n not in faults and not results.get(n)] + return uncapped if not failed else max(0.0, min(uncapped, cap)) + + +def normalise(results, graders, cap, faults): + """§5.3 literally: scored 0.0, and out of the denominator too.""" + faults = set(faults) + measured = sum(w for n, w, _b in graders if n not in faults) + if measured <= 0: + return 0.0 + earned = sum(w for n, w, _b in graders if n not in faults and results.get(n)) + failed = [n for n, _w, b in graders if b and n not in faults and not results.get(n)] + score = earned / measured + return score if not failed else max(0.0, min(score, cap)) + + +def strike_no_ceiling(results, graders, cap, faults): + """Scored 0.0 and struck from the blocker set, without the unproven ceiling. + + The intermediate step, kept because it is the one that looks right and is + not: striking a faulted BLOCKER also lifts the cap, and lifting the cap is + worth the whole gap between it and 1.00 to a tree that would fail a gate. + """ + faults = set(faults) + uncapped = sum(w for n, w, _b in graders if n not in faults and results.get(n)) + failed = [n for n, _w, b in graders if b and n not in faults and not results.get(n)] + return uncapped if not failed else max(0.0, min(uncapped, cap)) + + +def strike(results, graders, cap, faults): + """Implemented: scored 0.0, not renormalised, unproven blockers keep the cap.""" + return M.reward(results, graders, cap, faults)[0] + + +RULES = (("absolve", absolve), ("normalise", normalise), + ("no-ceiling", strike_no_ceiling), ("strike", strike)) + + +def main() -> None: + graders, cap = M.load_table() + names = [n for n, _w, _b in graders] + weights = {n: w for n, w, _b in graders} + rows = load_matrix() + if not rows: + raise SystemExit("no recorded rows use today's criterion names") + + print(f"{len(rows)} recorded trees, {len(names)} criteria, cap {cap:.2f}") + print("gain = what the tree scores once one criterion it FAILS is turned " + "into a fault, minus what it scores honestly\n") + + worst = {label: (-9.9, "", "") for label, _fn in RULES} + print(f"{'tree':<28} {'criterion it breaks':<46} {'honest':>7} " + + " ".join(f"{label:>10}" for label, _fn in RULES)) + for tree in sorted(rows): + results = rows[tree] + honest = M.reward(results, graders, cap)[0] + for c in names: + if results.get(c): + continue # it passes this one; breaking it can only cost + line = f"{tree:<28} {c + f' (w={weights[c]:.2f})':<46} {honest:>7.3f}" + for label, fn in RULES: + got = fn(results, graders, cap, {c}) + gain = got - honest + line += f" {got:>6.3f}{gain:+.3f}" + if gain > worst[label][0]: + worst[label] = (gain, tree, c) + print(line) + + print("\n=== the most a tree can gain by breaking one fixture ===") + for label, _fn in RULES: + gain, tree, c = worst[label] + verdict = "CHANNEL OPEN" if gain > 1e-9 else "closed" + print(f" {label:<10} {gain:+.3f} ({tree}, {c}) -> {verdict}") + + # ─── the proof, as opposed to the illustration ───────────────────────── + # + # The rows above are the trees that happen to have been graded. The channel + # is a property of the arithmetic, not of the sample, so: every one of the + # 2^n outcome vectors a tree could possibly have, against every non-empty + # subset of criteria it could turn into a fault. A rule is closed iff the + # largest gain over the whole space is zero. + print(f"\n=== every possible tree ({1 << len(names)} outcome vectors) x every " + f"subset of faults ({(1 << len(names)) - 1}) ===") + worst_all = {label: (-9.9, (), ()) for label, _fn in RULES} + for outcome in range(1 << len(names)): + results = {n: bool(outcome >> i & 1) for i, n in enumerate(names)} + honest = M.reward(results, graders, cap)[0] + for mask in range(1, 1 << len(names)): + faults = {names[i] for i in range(len(names)) if mask >> i & 1} + for label, fn in RULES: + gain = fn(results, graders, cap, faults) - honest + if gain > worst_all[label][0]: + reds = tuple(n for n in names if not results[n]) + worst_all[label] = (gain, reds, tuple(sorted(faults))) + for label, _fn in RULES: + gain, reds, faults = worst_all[label] + verdict = "CHANNEL OPEN" if gain > 1e-9 else "CLOSED" + print(f" {label:<11} max gain {gain:+.3f} -> {verdict}") + if gain > 1e-9: + print(f" worst case: a tree failing {list(reds) or 'nothing'}") + print(f" breaks {list(faults)}") + + strike_gain = worst_all["strike"][0] + print("\n" + ("PASS: under the implemented rule, breaking any set of fixtures " + "is never worth anything." + if strike_gain <= 1e-9 else + f"FAIL: the implemented rule still pays {strike_gain:+.3f}.")) + return 0 if strike_gain <= 1e-9 else 1 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/harbor/sources/badger-v2/mutprobe.py b/harbor/sources/badger-v2/mutprobe.py new file mode 100644 index 0000000000000000000000000000000000000000..16f9b52bb578cede63e0a8c836be60fb8fd097aa --- /dev/null +++ b/harbor/sources/badger-v2/mutprobe.py @@ -0,0 +1,208 @@ +#!/usr/bin/env python3 +"""Mutation probe runner — grades a tree with the SHIPPED grader. + +Deliberately a sibling of calibrate.py rather than a flag on it: an in-flight +calibration owns .calib/calibration.json, and a mutation matrix must not write +into the file a verdict cites. Same weights (read out of tasks.py), same flat +blocker cap, same run_grading.sh, own state dirs, own logs, own JSON. + + python3 mutprobe.py mut-timer [mut-...] + python3 mutprobe.py mut-formatbump --criteria format_compat_after_reclaim +""" + +from __future__ import annotations + +import argparse +import ast +import json +import os +import shutil +import subprocess +import sys +import time +from pathlib import Path + +HERE = Path(__file__).resolve().parent +GRADER = HERE / "grader" +CALIB = HERE / ".calib" +BASE_TREE = CALIB / "base" +OUT = CALIB / "mutation-probe.json" +MUTABLE = ("pb/badgerpb4.pb.go",) + + +def load_table(): + tree = ast.parse((HERE / "tasks.py").read_text()) + graders = cap = None + for node in tree.body: + if not isinstance(node, ast.Assign): + continue + for target in node.targets: + if not isinstance(target, ast.Name): + continue + if target.id == "GRADERS": + graders = [(t[0], t[1], t[2]) for t in ast.literal_eval(node.value)] + elif target.id == "BLOCKER_CAP": + cap = ast.literal_eval(node.value) + assert graders and cap is not None + total = sum(w for _n, w, _b in graders) + if abs(total - 1.0) > 1e-9: + raise SystemExit(f"weights sum to {total}, not 1.0") + return graders, cap + + +def reward(results, graders, cap, faults=()): + """The same arithmetic tasks.py does, faults included. + + A criterion the grader could not judge is STRUCK FROM THE BLOCKER SET — the + grader broke, so it cannot cap the run; scoring a fault as a failed + criterion is what turned mut-timer's 0.860 into a 0.600 with a blocker + failure it never had. It does not earn its weight either: paying for an + unjudged criterion is a channel, and it paid run 8d578573 a free 0.12 (see + faultprobe.py for the arithmetic over this whole matrix). + """ + faults = set(faults) + uncapped = sum(w for n, w, _b in graders if n not in faults and results.get(n)) + failed = [n for n, _w, b in graders + if b and n not in faults and not results.get(n)] + # A blocker that was not measured is not a blocker that was passed. It is + # not reported as failed — that was the mut-timer phantom — but the ceiling + # stays on, because lifting it is worth up to the whole gap between the cap + # and 1.00 to a tree that would have failed the gate. Measured over every + # possible outcome vector in faultprobe.py: without this, breaking a gate + # fixture is worth +0.40. + unproven = [n for n, _w, b in graders if b and n in faults] + if not failed and not unproven: + return uncapped, uncapped, [] + return max(0.0, min(uncapped, cap)), uncapped, failed + + +def measured_scale(results, graders, cap, faults=()): + """(weight measured, reward over that weight) — reported, never the reward. + + §5.3 of SOLVER-FORENSICS asks for this number, and it is the right number to + show a human re-reading a faulted trace. It is not the reward, because + renormalising pays for a broken fixture exactly when the unmeasured + criterion would have scored below the run's average — which is the criterion + an agent would pick. faultprobe.py measures how much, on every tree in the + matrix. + """ + faults = set(faults) + measured = sum(w for n, w, _b in graders if n not in faults) + if measured <= 0: + return 0.0, 0.0 + final, _uncapped, _failed = reward(results, graders, cap, faults) + return measured, final / measured + + +def load_timeouts(): + """Per-criterion timeout from the same GRADERS table, handed to the grader. + + The ladder is fitted to this budget, so grading locally against a different + one is grading a different ladder. + """ + tree = ast.parse((HERE / "tasks.py").read_text()) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GRADERS" for t in node.targets): + return {t[0]: t[4] for t in ast.literal_eval(node.value)} + raise SystemExit("could not read GRADERS out of tasks.py") + + +TIMEOUTS = load_timeouts() + + +def run_criterion(tree: Path, name: str, state: Path, log_dir: Path): + env = dict(os.environ) + env.update({ + "REPO_DIR": str(tree), + "GRADER_DIR": str(GRADER), + "BASE_SRC": str(BASE_TREE), + "GRADER_STATE_DIR": str(state), + "PYTHON_BIN": sys.executable, + }) + budget = TIMEOUTS[name] + started = time.time() + proc = subprocess.run(["bash", str(GRADER / "run_grading.sh"), name, str(budget)], + env=env, capture_output=True, text=True, timeout=budget + 300) + elapsed = time.time() - started + (log_dir / f"{name}.log").write_text(proc.stdout + "\n--- stderr ---\n" + proc.stderr) + if proc.returncode == 3: + return None, elapsed, proc.stdout # grader fault + return proc.returncode == 0, elapsed, proc.stdout + + +def grade(which: str, graders, cap, criteria, keep): + tree = CALIB / which + if not (tree / "go.mod").exists(): + raise SystemExit(f"no tree at {tree}") + state = CALIB / f"state-{which}" + if not keep: + shutil.rmtree(state, ignore_errors=True) + state.mkdir(parents=True, exist_ok=True) + log_dir = CALIB / f"logs-{which}" + log_dir.mkdir(parents=True, exist_ok=True) + + snap = {r: (tree / r).read_bytes() for r in MUTABLE if (tree / r).exists()} + print(f"\n=== {which} ===", flush=True) + results, timings, faults = {}, {}, [] + for name, weight, blocker in graders: + if criteria and name not in criteria: + continue + ok, elapsed, out = run_criterion(tree, name, state, log_dir) + verdict = "PASS" if ok else "FAIL" + if ok is None: + faults.append(name) + ok, verdict = False, "FAULT" + results[name] = ok + timings[name] = elapsed + print(f" {verdict:<5} {name:<46} w={weight:.2f} " + f"{'blocker' if blocker else ' '} {elapsed:6.1f}s", flush=True) + for line in out.splitlines(): + if line.strip().startswith((" ratio_", " sst_", " elapsed_", " live_keys", + " gone_keys", " resurrections", " level_sizes", + " levels_above", " consolidate_error", + " settled", " settle_sec")): + print(f" {line.strip()}", flush=True) + for rel, data in snap.items(): + f = tree / rel + if f.exists() and f.read_bytes() != data: + f.write_bytes(data) + + final, uncapped, failed = reward(results, graders, cap, faults) + print(f" -> uncapped {uncapped:.3f}, failed blockers {failed or 'none'}, " + f"reward {final:.3f}" + + (f" ⚠ NOT A MEASUREMENT — grader faults: {faults} " + f"(counted as met, struck from the blockers)" if faults else ""), flush=True) + return {"tree": which, "results": results, "timings": timings, "uncapped": uncapped, + "reward": final, "failed_blockers": failed, "grader_faults": faults, + "partial": bool(criteria)} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("trees", nargs="+") + ap.add_argument("--criteria", default="") + ap.add_argument("--keep-state", action="store_true") + args = ap.parse_args() + graders, cap = load_table() + criteria = [c for c in args.criteria.split(",") if c] + report = [grade(t, graders, cap, criteria, args.keep_state) for t in args.trees] + + previous = [] + if OUT.exists(): + try: + previous = json.loads(OUT.read_text()) + except (ValueError, OSError): + previous = [] + merged = {e["tree"]: e for e in previous if isinstance(e, dict) and "tree" in e} + for e in report: + if e["partial"] and e["tree"] in merged and not merged[e["tree"]]["partial"]: + merged[e["tree"]]["results"].update(e["results"]) + continue + merged[e["tree"]] = e + OUT.write_text(json.dumps(sorted(merged.values(), key=lambda e: e["tree"]), indent=2) + "\n") + print(f"\nwritten to {OUT}") + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/badger-v2/pyproject.toml b/harbor/sources/badger-v2/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..b5e0fb86fad70888019c1925ca69ce2790c7385e --- /dev/null +++ b/harbor/sources/badger-v2/pyproject.toml @@ -0,0 +1,31 @@ +[project] +name = "swe-task-badger-lmax-reclaim" +version = "0.1.0" +description = "lmax_reclaim_idle_lsm on the coding-template: per-criterion execution grading" +requires-python = ">=3.11,<3.13" +dependencies = [ "hud>=0.6.13", "httpx>=0.27.0",] + +[build-system] +requires = [ "hatchling",] +build-backend = "hatchling.build" + +[project.optional-dependencies] +dev = [ "pytest>=8.0.0", "ruff==0.11.2",] + +[tool.ruff] +target-version = "py311" +line-length = 120 + +[tool.ruff.lint] +select = [ "E", "F", "B", "I", "C4", "UP",] +ignore = [ "E501",] +fixable = [ "ALL",] +unfixable = [] + +[tool.ruff.format] +quote-style = "double" +indent-style = "space" +line-ending = "auto" + +[tool.hatch.build.targets.wheel] +packages = [ ".",] diff --git a/harbor/sources/badger-v2/task/gold.diff b/harbor/sources/badger-v2/task/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..2bc2fe7a10e1f6be71dc1ee7d68bc5be5ce74290 --- /dev/null +++ b/harbor/sources/badger-v2/task/gold.diff @@ -0,0 +1,1036 @@ +diff --git a/db.go b/db.go +index 9572203..cf8e0f4 100644 +--- a/db.go ++++ b/db.go +@@ -341,6 +341,14 @@ func Open(opt Options) (*DB, error) { + db.closers.updateSize = z.NewCloser(1) + go db.updateSize(db.closers.updateSize) + ++ // The value log files must be known before the memtables are replayed: ++ // an entry in the WAL may point at a value the value log lost in an ++ // unclean stop, and such a transaction must not come back. ++ db.vlog.init(db) ++ if err := db.vlog.openFiles(); err != nil { ++ return db, y.Wrapf(err, "During db.vlog.openFiles") ++ } ++ + if err := db.openMemTables(db.opt); err != nil { + return nil, y.Wrapf(err, "while opening memtables") + } +@@ -356,9 +364,6 @@ func Open(opt Options) (*DB, error) { + return db, err + } + +- // Initialize vlog struct. +- db.vlog.init(db) +- + if !opt.ReadOnly { + db.closers.compactors = z.NewCloser(1) + db.lc.startCompact(db.closers.compactors) +diff --git a/journal_recovery_test.go b/journal_recovery_test.go +new file mode 100644 +index 0000000..0ad986f +--- /dev/null ++++ b/journal_recovery_test.go +@@ -0,0 +1,634 @@ ++/* ++ * SPDX-FileCopyrightText: © Hypermode Inc. ++ * SPDX-License-Identifier: Apache-2.0 ++ */ ++ ++package badger ++ ++import ( ++ "bufio" ++ "crypto/sha256" ++ "encoding/hex" ++ "fmt" ++ "io" ++ "math" ++ "os" ++ "os/exec" ++ "path/filepath" ++ "strings" ++ "sync" ++ "testing" ++ ++ "github.com/stretchr/testify/require" ++ ++ "github.com/dgraph-io/badger/v4/y" ++) ++ ++// The tests in this file drive a child process that writes to a DB and never ++// closes it. The parent tells the child when to take a step, the child answers ++// "ok " once the step's ++// commit has been acknowledged, and the parent kills the child with SIGKILL ++// after the step it is interested in. No timers are involved: every kill ++// happens at a point the child has reported. ++ ++const ( ++ journalChildEnv = "BADGER_JOURNAL_CHILD" ++ journalDirEnv = "BADGER_JOURNAL_DIR" ++ journalBigSize = 4096 // goes to the value log ++ journalSmallLen = 1024 // stays in the WAL ++ journalGCSize = 8000 // fills a value log file quickly ++ journalWriters = 8 ++) ++ ++func journalOptions(dir string) Options { ++ return DefaultOptions(dir). ++ WithSyncWrites(true). ++ WithValueThreshold(2048). ++ WithMemTableSize(256 << 10). ++ WithValueLogFileSize(1 << 20). ++ WithLoggingLevel(ERROR) ++} ++ ++func journalBlob(tag string, size int) []byte { ++ return []byte(strings.Repeat(tag+"|", size/(len(tag)+1)+1)[:size]) ++} ++ ++func journalBig(tag string) []byte { ++ return journalBlob(tag, journalBigSize) ++} ++ ++func journalSmall(tag string) []byte { ++ return []byte(fmt.Sprintf("%-*s", journalSmallLen, tag)[:journalSmallLen]) ++} ++ ++// journalStep performs step n of the given scenario on db. ++func journalStep(db *DB, scenario string, n int) error { ++ switch scenario { ++ case "vlog": ++ switch n { ++ case 1: ++ return db.Update(func(txn *Txn) error { ++ if err := txn.Set([]byte("k1"), journalBig("k1v1")); err != nil { ++ return err ++ } ++ return txn.Set([]byte("k2"), journalSmall("k2v1")) ++ }) ++ case 2: ++ return db.Update(func(txn *Txn) error { ++ if err := txn.Set([]byte("k3"), journalBig("k3v1")); err != nil { ++ return err ++ } ++ if err := txn.Set([]byte("k4"), journalSmall("k4v1")); err != nil { ++ return err ++ } ++ return txn.Set([]byte("k1"), journalBig("k1v2")) ++ }) ++ case 3: ++ return db.Update(func(txn *Txn) error { return txn.Delete([]byte("k2")) }) ++ case 4: ++ return db.Update(func(txn *Txn) error { return txn.Set([]byte("k5"), journalSmall("k5v1")) }) ++ } ++ case "mixed": ++ switch n { ++ case 1: ++ wb := db.NewManagedWriteBatch() ++ for i, ts := range []uint64{10, 11, 12} { ++ k := []byte(fmt.Sprintf("m%d", i+1)) ++ if err := wb.SetEntryAt(NewEntry(k, journalSmall(string(k))), ts); err != nil { ++ return err ++ } ++ } ++ return wb.Flush() ++ case 2: ++ txn := db.NewTransactionAt(20, true) ++ if err := txn.Set([]byte("m4"), journalBig("m4")); err != nil { ++ return err ++ } ++ return txn.CommitAt(20, nil) ++ case 3: ++ wb := db.NewWriteBatchAt(30) ++ if err := wb.SetEntryAt(NewEntry([]byte("m5"), journalSmall("m5")), 31); err != nil { ++ return err ++ } ++ if err := wb.DeleteAt([]byte("m2"), 32); err != nil { ++ return err ++ } ++ return wb.Flush() ++ } ++ case "gc": ++ // x twice (each version flushed to a table, so that the tables carry ++ // the discard statistics), then y and z until the value log rotates; ++ // compaction, then garbage collection until nothing is left to move. ++ // Every live value of the first file is copied to the last one and ++ // re-logged in the WAL, and the first file is deleted. ++ if n != 1 { ++ break ++ } ++ put := func(prefix string, count int, tag string) error { ++ for i := 0; i < count; i++ { ++ k := fmt.Sprintf("%s-%03d", prefix, i) ++ if err := db.Update(func(txn *Txn) error { ++ return txn.Set([]byte(k), journalBlob(k+tag, journalGCSize)) ++ }); err != nil { ++ return err ++ } ++ } ++ return nil ++ } ++ flush := func() error { ++ if err := db.Update(func(txn *Txn) error { ++ return txn.Set([]byte("drop-me"), []byte("x")) ++ }); err != nil { ++ return err ++ } ++ return db.DropPrefix([]byte("drop-")) ++ } ++ if err := put("x", 40, "/1"); err != nil { ++ return err ++ } ++ if err := flush(); err != nil { ++ return err ++ } ++ if err := put("x", 40, "/2"); err != nil { ++ return err ++ } ++ if err := flush(); err != nil { ++ return err ++ } ++ if err := put("y", 20, ""); err != nil { ++ return err ++ } ++ if err := put("z", 60, ""); err != nil { ++ return err ++ } ++ if err := db.Flatten(1); err != nil { ++ return err ++ } ++ for { ++ err := db.RunValueLogGC(0.05) ++ if err == ErrNoRewrite { ++ break ++ } ++ if err != nil { ++ return err ++ } ++ } ++ db.vlog.filesLock.RLock() ++ _, kept := db.vlog.filesMap[1] ++ db.vlog.filesLock.RUnlock() ++ if kept { ++ return fmt.Errorf("garbage collection did not retire value log file 1") ++ } ++ return nil ++ case "load": ++ var wg sync.WaitGroup ++ errs := make([]error, journalWriters) ++ for g := 0; g < journalWriters; g++ { ++ wg.Add(1) ++ go func(g int) { ++ defer wg.Done() ++ errs[g] = db.Update(func(txn *Txn) error { ++ big := fmt.Sprintf("g%d-b%d", g, n) ++ small := fmt.Sprintf("g%d-s%d", g, n) ++ if err := txn.Set([]byte(big), journalBig(big)); err != nil { ++ return err ++ } ++ return txn.Set([]byte(small), journalSmall(small)) ++ }) ++ }(g) ++ } ++ wg.Wait() ++ for _, err := range errs { ++ if err != nil { ++ return err ++ } ++ } ++ return nil ++ } ++ return fmt.Errorf("no step %d in scenario %q", n, scenario) ++} ++ ++// TestJournalChild is the child process. It only runs when spawned by the ++// tests below. ++func TestJournalChild(t *testing.T) { ++ scenario := os.Getenv(journalChildEnv) ++ if scenario == "" { ++ t.Skip("child process of the journal recovery tests") ++ } ++ opt := journalOptions(os.Getenv(journalDirEnv)) ++ var db *DB ++ var err error ++ if scenario == "mixed" { ++ db, err = OpenManaged(opt) ++ } else { ++ db, err = Open(opt) ++ } ++ if err != nil { ++ fmt.Printf("error %v\n", err) ++ os.Exit(2) ++ } ++ in := bufio.NewScanner(os.Stdin) ++ for step := 1; in.Scan(); step++ { ++ if err := journalStep(db, scenario, step); err != nil { ++ fmt.Printf("error %v\n", err) ++ os.Exit(2) ++ } ++ fmt.Printf("ok %d %d %d %d %d\n", step, ++ db.vlog.maxFid, db.vlog.woffset(), db.mt.wal.fid, db.mt.wal.writeAt) ++ } ++ // The parent went away without killing us. Leave without closing, as a ++ // crash would. ++ os.Exit(0) ++} ++ ++type journalMark struct { ++ vlogFid, vlogOff, walFid, walOff uint32 ++} ++ ++type journalChild struct { ++ t *testing.T ++ cmd *exec.Cmd ++ in io.WriteCloser ++ out *bufio.Scanner ++} ++ ++func startJournalChild(t *testing.T, scenario, dir string) *journalChild { ++ t.Helper() ++ cmd := exec.Command(os.Args[0], "-test.run=^TestJournalChild$") ++ cmd.Env = append(os.Environ(), journalChildEnv+"="+scenario, journalDirEnv+"="+dir) ++ cmd.Stderr = os.Stderr ++ in, err := cmd.StdinPipe() ++ require.NoError(t, err) ++ out, err := cmd.StdoutPipe() ++ require.NoError(t, err) ++ require.NoError(t, cmd.Start()) ++ c := &journalChild{t: t, cmd: cmd, in: in, out: bufio.NewScanner(out)} ++ t.Cleanup(func() { c.kill() }) ++ return c ++} ++ ++// step asks the child for one more step and returns where its logs ended ++// once the step was acknowledged. ++func (c *journalChild) step() journalMark { ++ c.t.Helper() ++ _, err := io.WriteString(c.in, "next\n") ++ require.NoError(c.t, err) ++ require.True(c.t, c.out.Scan(), "child stopped answering") ++ var m journalMark ++ var n int ++ _, err = fmt.Sscanf(c.out.Text(), "ok %d %d %d %d %d", ++ &n, &m.vlogFid, &m.vlogOff, &m.walFid, &m.walOff) ++ require.NoError(c.t, err, "child said %q", c.out.Text()) ++ return m ++} ++ ++// kill stops the child the way a crash would. ++func (c *journalChild) kill() { ++ if c.cmd.ProcessState != nil { ++ return ++ } ++ _ = c.cmd.Process.Kill() ++ _ = c.cmd.Wait() ++} ++ ++// runJournalChild runs the scenario for the given number of steps in a fresh ++// directory, kills the child and returns the directory and the marks. ++func runJournalChild(t *testing.T, scenario string, steps int) (string, []journalMark) { ++ t.Helper() ++ dir, err := os.MkdirTemp("", "badger-journal") ++ require.NoError(t, err) ++ t.Cleanup(func() { removeDir(dir) }) ++ c := startJournalChild(t, scenario, dir) ++ marks := make([]journalMark, 0, steps) ++ for i := 0; i < steps; i++ { ++ marks = append(marks, c.step()) ++ } ++ c.kill() ++ return dir, marks ++} ++ ++func journalFileHashes(t *testing.T, dir string) map[string]string { ++ t.Helper() ++ entries, err := os.ReadDir(dir) ++ require.NoError(t, err) ++ hashes := make(map[string]string) ++ for _, e := range entries { ++ // Tables are outside the journal: a flush that was under way when the ++ // process died leaves one the manifest does not know about, and that ++ // one is removed on open, read-only or not, as it always was. ++ if e.IsDir() || strings.HasSuffix(e.Name(), ".sst") { ++ continue ++ } ++ data, err := os.ReadFile(filepath.Join(dir, e.Name())) ++ require.NoError(t, err) ++ sum := sha256.Sum256(data) ++ hashes[e.Name()] = fmt.Sprintf("%d:%s", len(data), hex.EncodeToString(sum[:])) ++ } ++ return hashes ++} ++ ++// zeroTail overwrites path from off to its end with zeros, as if the pages ++// after off had never reached the disk. ++func zeroTail(t *testing.T, path string, off uint32) { ++ t.Helper() ++ fi, err := os.Stat(path) ++ require.NoError(t, err) ++ f, err := os.OpenFile(path, os.O_WRONLY, 0) ++ require.NoError(t, err) ++ defer f.Close() ++ _, err = f.WriteAt(make([]byte, fi.Size()-int64(off)), int64(off)) ++ require.NoError(t, err) ++} ++ ++func openJournal(t *testing.T, dir string, readOnly, managed bool) (*DB, error) { ++ t.Helper() ++ opt := journalOptions(dir) ++ opt.ReadOnly = readOnly ++ if managed { ++ return OpenManaged(opt) ++ } ++ return Open(opt) ++} ++ ++// journalGet returns the value of key, or "" and false when it is absent. ++func journalGet(t *testing.T, db *DB, key string) (string, bool) { ++ t.Helper() ++ var txn *Txn ++ if db.opt.managedTxns { ++ txn = db.NewTransactionAt(math.MaxUint64, false) ++ } else { ++ txn = db.NewTransaction(false) ++ } ++ defer txn.Discard() ++ item, err := txn.Get([]byte(key)) ++ if err == ErrKeyNotFound { ++ return "", false ++ } ++ require.NoError(t, err) ++ val, err := item.ValueCopy(nil) ++ require.NoError(t, err) ++ return string(val), true ++} ++ ++func requireJournalValue(t *testing.T, db *DB, key string, want []byte) { ++ t.Helper() ++ got, ok := journalGet(t, db, key) ++ require.True(t, ok, "key %s is missing", key) ++ require.Equal(t, string(want), got, "key %s", key) ++} ++ ++func requireJournalAbsent(t *testing.T, db *DB, key string) { ++ t.Helper() ++ got, ok := journalGet(t, db, key) ++ require.False(t, ok, "key %s should be absent, has %q", key, got) ++} ++ ++// requireReadOnlyRefuses opens the DB read-only, expects an error and ++// expects every file to be exactly as it was. ++func requireReadOnlyRefuses(t *testing.T, dir string, managed bool) { ++ t.Helper() ++ before := journalFileHashes(t, dir) ++ db, err := openJournal(t, dir, true, managed) ++ if err == nil { ++ require.NoError(t, db.Close()) ++ } ++ require.Error(t, err, "read-only open must refuse a torn history") ++ require.Equal(t, before, journalFileHashes(t, dir), "read-only open changed a file") ++} ++ ++func TestJournalTornValueLogTailKeepsTransactionsWhole(t *testing.T) { ++ // A tear in the middle of the second transaction's values, emulating ++ // pages that never reached the disk: the file keeps its length. ++ t.Run("zeroed", func(t *testing.T) { ++ dir, marks := runJournalChild(t, "vlog", 4) ++ vlogPath := vlogFilePath(dir, marks[1].vlogFid) ++ require.Equal(t, marks[0].vlogFid, marks[1].vlogFid) ++ zeroTail(t, vlogPath, marks[0].vlogOff+(marks[1].vlogOff-marks[0].vlogOff)/2) ++ ++ requireReadOnlyRefuses(t, dir, false) ++ ++ db, err := openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ // The first transaction is whole, the torn one is gone entirely — ++ // including the part of it that lived in the WAL — and so is ++ // everything committed after it. ++ requireJournalValue(t, db, "k1", journalBig("k1v1")) ++ requireJournalValue(t, db, "k2", journalSmall("k2v1")) ++ requireJournalAbsent(t, db, "k3") ++ requireJournalAbsent(t, db, "k4") ++ requireJournalAbsent(t, db, "k5") ++ ++ // Writes after recovery win, and stay won. ++ require.NoError(t, db.Update(func(txn *Txn) error { ++ return txn.Set([]byte("k1"), journalBig("k1v3")) ++ })) ++ requireJournalValue(t, db, "k1", journalBig("k1v3")) ++ require.NoError(t, db.Close()) ++ db, err = openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ requireJournalValue(t, db, "k1", journalBig("k1v3")) ++ requireJournalValue(t, db, "k2", journalSmall("k2v1")) ++ requireJournalAbsent(t, db, "k3") ++ require.NoError(t, db.Close()) ++ }) ++ ++ // The file cut exactly where the first transaction's values end: that ++ // transaction is whole, the next one is not. ++ t.Run("truncated at a record boundary", func(t *testing.T) { ++ dir, marks := runJournalChild(t, "vlog", 4) ++ require.NoError(t, os.Truncate(vlogFilePath(dir, marks[0].vlogFid), int64(marks[0].vlogOff))) ++ ++ requireReadOnlyRefuses(t, dir, false) ++ ++ db, err := openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ requireJournalValue(t, db, "k1", journalBig("k1v1")) ++ requireJournalValue(t, db, "k2", journalSmall("k2v1")) ++ requireJournalAbsent(t, db, "k3") ++ requireJournalAbsent(t, db, "k4") ++ requireJournalAbsent(t, db, "k5") ++ require.NoError(t, db.Close()) ++ }) ++ ++ // A tear in the WAL itself, with the value log whole. ++ t.Run("torn wal", func(t *testing.T) { ++ dir, marks := runJournalChild(t, "vlog", 4) ++ require.Equal(t, marks[0].walFid, marks[1].walFid) ++ zeroTail(t, filepath.Join(dir, fmt.Sprintf("%05d%s", marks[1].walFid, memFileExt)), marks[1].walOff-5) ++ ++ requireReadOnlyRefuses(t, dir, false) ++ ++ db, err := openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ requireJournalValue(t, db, "k1", journalBig("k1v1")) ++ requireJournalValue(t, db, "k2", journalSmall("k2v1")) ++ requireJournalAbsent(t, db, "k3") ++ requireJournalAbsent(t, db, "k4") ++ requireJournalAbsent(t, db, "k5") ++ require.NoError(t, db.Close()) ++ }) ++} ++ ++func TestJournalMixedVersionTransactionWholeAfterTear(t *testing.T) { ++ checkWhole := func(t *testing.T, db *DB) { ++ t.Helper() ++ requireJournalValue(t, db, "m1", journalSmall("m1")) ++ requireJournalAbsent(t, db, "m2") // deleted at 32 ++ requireJournalValue(t, db, "m3", journalSmall("m3")) ++ requireJournalValue(t, db, "m4", journalBig("m4")) ++ requireJournalValue(t, db, "m5", journalSmall("m5")) ++ } ++ ++ t.Run("killed without a tear", func(t *testing.T) { ++ dir, _ := runJournalChild(t, "mixed", 3) ++ before := journalFileHashes(t, dir) ++ db, err := openJournal(t, dir, true, true) ++ require.NoError(t, err) ++ checkWhole(t, db) ++ require.NoError(t, db.Close()) ++ require.Equal(t, before, journalFileHashes(t, dir)) ++ ++ db, err = openJournal(t, dir, false, true) ++ require.NoError(t, err) ++ checkWhole(t, db) ++ require.NoError(t, db.Close()) ++ }) ++ ++ t.Run("torn inside the mixed transaction", func(t *testing.T) { ++ dir, marks := runJournalChild(t, "mixed", 3) ++ zeroTail(t, filepath.Join(dir, fmt.Sprintf("%05d%s", marks[0].walFid, memFileExt)), marks[0].walOff-5) ++ ++ requireReadOnlyRefuses(t, dir, true) ++ ++ db, err := openJournal(t, dir, false, true) ++ require.NoError(t, err) ++ for _, k := range []string{"m1", "m2", "m3", "m4", "m5"} { ++ requireJournalAbsent(t, db, k) ++ } ++ require.NoError(t, db.Close()) ++ }) ++ ++ t.Run("torn after the mixed transaction", func(t *testing.T) { ++ dir, marks := runJournalChild(t, "mixed", 3) ++ zeroTail(t, filepath.Join(dir, fmt.Sprintf("%05d%s", marks[2].walFid, memFileExt)), marks[2].walOff-5) ++ ++ requireReadOnlyRefuses(t, dir, true) ++ ++ db, err := openJournal(t, dir, false, true) ++ require.NoError(t, err) ++ requireJournalValue(t, db, "m1", journalSmall("m1")) ++ requireJournalValue(t, db, "m2", journalSmall("m2")) ++ requireJournalValue(t, db, "m3", journalSmall("m3")) ++ requireJournalValue(t, db, "m4", journalBig("m4")) ++ requireJournalAbsent(t, db, "m5") ++ require.NoError(t, db.Close()) ++ }) ++} ++ ++func TestJournalReadOnlyOpenAfterKillServesAcknowledgedCommits(t *testing.T) { ++ const steps = 40 ++ dir, marks := runJournalChild(t, "load", steps) ++ last := marks[len(marks)-1] ++ require.Greater(t, last.vlogFid, uint32(1), "the value log should have rotated") ++ require.Greater(t, last.walFid, uint32(1), "the memtable should have rotated") ++ ++ check := func(t *testing.T, db *DB) { ++ t.Helper() ++ for g := 0; g < journalWriters; g++ { ++ for n := 1; n <= steps; n++ { ++ big := fmt.Sprintf("g%d-b%d", g, n) ++ small := fmt.Sprintf("g%d-s%d", g, n) ++ requireJournalValue(t, db, big, journalBig(big)) ++ requireJournalValue(t, db, small, journalSmall(small)) ++ } ++ } ++ } ++ ++ before := journalFileHashes(t, dir) ++ db, err := openJournal(t, dir, true, false) ++ require.NoError(t, err) ++ check(t, db) ++ require.NoError(t, db.Close()) ++ require.Equal(t, before, journalFileHashes(t, dir), "read-only open changed a file") ++ ++ db, err = openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ check(t, db) ++ require.NoError(t, db.Update(func(txn *Txn) error { ++ return txn.Set([]byte("after"), journalBig("after")) ++ })) ++ requireJournalValue(t, db, "after", journalBig("after")) ++ require.NoError(t, db.Close()) ++} ++ ++// Garbage collection deletes a value log file once every live value in it ++// has been copied to the last file and re-logged in the WAL. A crash before ++// the next flush leaves the WAL still pointing at the deleted file for those ++// values' first records. That is not a tear: nothing acknowledged was lost, ++// and recovery, read-only or not, serves the whole history. ++func TestJournalRetiredValueLogFileIsNotATear(t *testing.T) { ++ dir, marks := runJournalChild(t, "gc", 1) ++ require.Greater(t, marks[0].vlogFid, uint32(1), "the value log should have rotated") ++ require.NoFileExists(t, filepath.Join(dir, "000001.vlog"), "file 1 should have been retired") ++ ++ check := func(t *testing.T, db *DB) { ++ t.Helper() ++ for i := 0; i < 40; i++ { ++ k := fmt.Sprintf("x-%03d", i) ++ requireJournalValue(t, db, k, journalBlob(k+"/2", journalGCSize)) ++ } ++ for i := 0; i < 20; i++ { ++ k := fmt.Sprintf("y-%03d", i) ++ requireJournalValue(t, db, k, journalBlob(k, journalGCSize)) ++ } ++ for i := 0; i < 60; i++ { ++ k := fmt.Sprintf("z-%03d", i) ++ requireJournalValue(t, db, k, journalBlob(k, journalGCSize)) ++ } ++ } ++ ++ before := journalFileHashes(t, dir) ++ db, err := openJournal(t, dir, true, false) ++ require.NoError(t, err) ++ check(t, db) ++ require.NoError(t, db.Close()) ++ require.Equal(t, before, journalFileHashes(t, dir), "read-only open changed a file") ++ ++ db, err = openJournal(t, dir, false, false) ++ require.NoError(t, err) ++ check(t, db) ++ require.NoError(t, db.Close()) ++} ++ ++// A WAL written by an earlier build holds transactions with entries of ++// different versions and no markers around them. They still come back whole. ++func TestJournalOldTransactionWithoutMarkersReplaysWhole(t *testing.T) { ++ dir, err := os.MkdirTemp("", "badger-journal") ++ require.NoError(t, err) ++ defer removeDir(dir) ++ ++ opt := journalOptions(dir) ++ db0, err := OpenManaged(opt) ++ require.NoError(t, err) ++ defer func() { require.NoError(t, db0.Close()) }() ++ for i, ts := range []uint64{10, 11, 12} { ++ k := fmt.Sprintf("o%d", i+1) ++ require.NoError(t, db0.mt.Put(y.KeyWithTs([]byte(k), ts), y.ValueStruct{Value: journalSmall(k)})) ++ } ++ require.NoError(t, db0.mt.SyncWAL()) ++ // Simulate a crash by not closing db0, but releasing the locks. ++ require.NoError(t, db0.dirLockGuard.release()) ++ db0.dirLockGuard = nil ++ if db0.valueDirGuard != nil { ++ require.NoError(t, db0.valueDirGuard.release()) ++ db0.valueDirGuard = nil ++ } ++ ++ db1, err := openJournal(t, dir, true, true) ++ require.NoError(t, err) ++ for i := 1; i <= 3; i++ { ++ k := fmt.Sprintf("o%d", i) ++ requireJournalValue(t, db1, k, journalSmall(k)) ++ } ++ require.NoError(t, db1.Close()) ++} +diff --git a/memtable.go b/memtable.go +index 161a463..f107477 100644 +--- a/memtable.go ++++ b/memtable.go +@@ -38,6 +38,9 @@ type memTable struct { + maxVersion uint64 + opt Options + buf *bytes.Buffer ++ // vptrOK tells replay whether a value pointer found in the WAL still ++ // addresses a record the value log holds. ++ vptrOK func(valuePointer) bool + } + + func (db *DB) openMemTables(opt Options) error { +@@ -98,9 +101,10 @@ func (db *DB) openMemTable(fid, flags int) (*memTable, error) { + filepath := db.mtFilePath(fid) + s := skl.NewSkiplist(arenaSize(db.opt)) + mt := &memTable{ +- sl: s, +- opt: db.opt, +- buf: &bytes.Buffer{}, ++ sl: s, ++ opt: db.opt, ++ buf: &bytes.Buffer{}, ++ vptrOK: db.vlog.contains, + } + // We don't need to create the wal for the skiplist in in-memory mode so return the mt. + if db.opt.InMemory { +@@ -202,12 +206,19 @@ func (mt *memTable) UpdateSkipList() error { + if mt.wal == nil || mt.sl == nil { + return nil + } +- endOff, err := mt.wal.iterate(true, 0, mt.replayFunction(mt.opt)) ++ endOff, stopAt, err := mt.wal.replay(0, mt.replayFunction(mt.opt), mt.vptrOK) + if err != nil { + return y.Wrapf(err, "while iterating wal: %s", mt.wal.Fd.Name()) + } +- if endOff < mt.wal.size.Load() && mt.opt.ReadOnly { +- return y.Wrapf(ErrTruncateNeeded, "end offset: %d < size: %d", endOff, mt.wal.size.Load()) ++ if mt.opt.ReadOnly { ++ // The file is pre-allocated, so a tail of zeros after the last record ++ // is the normal state after an unclean stop and needs no repair. Any ++ // other bytes there are a damaged record, and a read-only DB must ++ // not repair it. ++ if !mt.wal.zeroFrom(stopAt) { ++ return y.Wrapf(ErrTruncateNeeded, "end offset: %d < size: %d", endOff, mt.wal.size.Load()) ++ } ++ return nil + } + return mt.wal.Truncate(int64(endOff)) + } +@@ -431,6 +442,41 @@ func (lf *logFile) doneWriting(offset uint32) error { + // iterate iterates over log file. It doesn't not allocate new memory for every kv pair. + // Therefore, the kv pair is only valid for the duration of fn call. + func (lf *logFile) iterate(readOnly bool, offset uint32, fn logEntry) (uint32, error) { ++ end, _, err := lf.replay(offset, fn, nil) ++ return end, err ++} ++ ++// lostValue reports whether e's value lives in the value log at a place the ++// value log no longer holds, according to vptrOK. ++func lostValue(e *Entry, vptrOK func(valuePointer) bool) bool { ++ if vptrOK == nil || e.meta&bitValuePointer == 0 { ++ return false ++ } ++ if uintptr(len(e.Value)) < vptrSize { ++ return true ++ } ++ var vp valuePointer ++ vp.Decode(e.Value) ++ return !vptrOK(vp) ++} ++ ++// zeroFrom reports whether nothing but zeros follows off in the file. ++func (lf *logFile) zeroFrom(off uint32) bool { ++ if int64(off) >= int64(len(lf.Data)) { ++ return true ++ } ++ return len(bytes.TrimLeft(lf.Data[off:], "\x00")) == 0 ++} ++ ++// replay is iterate with two additions. When vptrOK is given, an entry whose ++// value lives in the value log is checked against it before anything of its ++// transaction is applied, so a pointer to a lost value stops the replay in ++// front of that transaction. Besides the offset up to which the log was ++// applied, replay returns the offset of the record it stopped at: the one it ++// could not read, or the one it could not accept — a transaction with a ++// missing or mismatching end marker, an entry pointing at a lost value. ++func (lf *logFile) replay(offset uint32, fn logEntry, vptrOK func(valuePointer) bool) ( ++ uint32, uint32, error) { + if offset == 0 { + // If offset is set to zero, let's advance past the encryption key header. + offset = vlogHeaderSize +@@ -445,14 +491,19 @@ func (lf *logFile) iterate(readOnly bool, offset uint32, fn logEntry) (uint32, e + lf: lf, + } + +- var lastCommit uint64 ++ // lastCommit is the version of the entry that opened the transaction ++ // being read, or zero outside a transaction; txnMax is the largest ++ // version seen in it, which its end marker must repeat. ++ var lastCommit, txnMax uint64 + var validEndOffset uint32 = offset + + var entries []*Entry + var vptrs []valuePointer + ++ var stopAt uint32 + loop: + for { ++ stopAt = read.recordOffset + e, err := read.Entry(reader) + switch { + // We have not reached the end of the file but the entry we read is +@@ -463,7 +514,7 @@ loop: + case err == io.ErrUnexpectedEOF || err == errTruncate: + break loop + case err != nil: +- return 0, err ++ return 0, 0, err + case e == nil: + continue + case e.isZero(): +@@ -483,19 +534,24 @@ loop: + if lastCommit == 0 { + lastCommit = txnTs + } +- if lastCommit != txnTs { +- break loop ++ if txnTs > txnMax { ++ txnMax = txnTs + } + entries = append(entries, e) + vptrs = append(vptrs, vp) + + case e.meta&bitFinTxn > 0: + txnTs, err := strconv.ParseUint(string(e.Value), 10, 64) +- if err != nil || lastCommit != txnTs { ++ if err != nil || lastCommit == 0 || txnTs != txnMax { + break loop + } ++ for _, e := range entries { ++ if lostValue(e, vptrOK) { ++ break loop ++ } ++ } + // Got the end of txn. Now we can store them. +- lastCommit = 0 ++ lastCommit, txnMax = 0, 0 + validEndOffset = read.recordOffset + + for i, e := range entries { +@@ -504,7 +560,7 @@ loop: + if err == errStop { + break + } +- return 0, errFile(err, lf.path, "Iteration function") ++ return 0, 0, errFile(err, lf.path, "Iteration function") + } + } + entries = entries[:0] +@@ -516,17 +572,20 @@ loop: + // We shouldn't get this entry in the middle of a transaction. + break loop + } ++ if lostValue(e, vptrOK) { ++ break loop ++ } + validEndOffset = read.recordOffset + + if err := fn(*e, vp); err != nil { + if err == errStop { + break + } +- return 0, errFile(err, lf.path, "Iteration function") ++ return 0, 0, errFile(err, lf.path, "Iteration function") + } + } + } +- return validEndOffset, nil ++ return validEndOffset, stopAt, nil + } + + // Zero out the next entry to deal with any crashes. +diff --git a/txn.go b/txn.go +index 9c916d1..5e852af 100644 +--- a/txn.go ++++ b/txn.go +@@ -532,12 +532,17 @@ func (txn *Txn) commitAndSend() (func() error, error) { + return nil, ErrConflict + } + +- keepTogether := true ++ // Every transaction is bracketed by markers in the log so that replay can ++ // apply it whole or not at all. Entries may carry their own versions ++ // (SetEntryAt in managed mode), and commitTs may then even be zero, so the ++ // end marker carries the largest version in the transaction. ++ var maxVersion uint64 + setVersion := func(e *Entry) { + if e.version == 0 { + e.version = commitTs +- } else { +- keepTogether = false ++ } ++ if e.version > maxVersion { ++ maxVersion = e.version + } + } + for _, e := range txn.pendingWrites { +@@ -555,14 +560,7 @@ func (txn *Txn) commitAndSend() (func() error, error) { + // Suffix the keys with commit ts, so the key versions are sorted in + // descending order of commit timestamp. + e.Key = y.KeyWithTs(e.Key, e.version) +- // Add bitTxn only if these entries are part of a transaction. We +- // support SetEntryAt(..) in managed mode which means a single +- // transaction can have entries with different timestamps. If entries +- // in a single transaction have different timestamps, we don't add the +- // transaction markers. +- if keepTogether { +- e.meta |= bitTxn +- } ++ e.meta |= bitTxn + entries = append(entries, e) + } + +@@ -579,16 +577,14 @@ func (txn *Txn) commitAndSend() (func() error, error) { + processEntry(e) + } + +- if keepTogether { +- // CommitTs should not be zero if we're inserting transaction markers. +- y.AssertTrue(commitTs != 0) +- e := &Entry{ +- Key: y.KeyWithTs(txnKey, commitTs), +- Value: []byte(strconv.FormatUint(commitTs, 10)), +- meta: bitFinTxn, +- } +- entries = append(entries, e) +- } ++ // commitPrecheck guarantees a non-zero commitTs whenever no entry has a ++ // version of its own. ++ y.AssertTrue(maxVersion != 0) ++ entries = append(entries, &Entry{ ++ Key: y.KeyWithTs(txnKey, maxVersion), ++ Value: []byte(strconv.FormatUint(maxVersion, 10)), ++ meta: bitFinTxn, ++ }) + + req, err := txn.db.sendToWriteCh(entries) + if err != nil { +diff --git a/value.go b/value.go +index e042651..c343473 100644 +--- a/value.go ++++ b/value.go +@@ -580,26 +580,24 @@ func (vlog *valueLog) init(db *DB) { + db.logToSyncChan(endVLogInitMsg) + } + +-func (vlog *valueLog) open(db *DB) error { +- // We don't need to open any vlog files or collect stats for GC if DB is opened +- // in InMemory mode. InMemory mode doesn't create any files/directories on disk. +- if db.opt.InMemory { ++// openFiles opens the value log files found on disk and establishes how much ++// of each one holds records. Files that were rotated out were cut down to ++// their records when they were retired; the last file is pre-allocated and ++// may end in whatever an unclean stop left behind, so its size is what can be ++// parsed from it. Nothing is written: this runs before the memtables are ++// replayed, in read-only mode too, so that replay can tell a pointer into a ++// lost value from a good one. ++func (vlog *valueLog) openFiles() error { ++ if vlog.opt.InMemory { + return nil + } +- + if err := vlog.populateFilesMap(); err != nil { + return err + } +- // If no files are found, then create a new file. + if len(vlog.filesMap) == 0 { +- if vlog.opt.ReadOnly { +- return nil +- } +- _, err := vlog.createVlogFile() +- return y.Wrapf(err, "Error while creating log file in valueLog.open") ++ return nil + } +- fids := vlog.sortedFids() +- for _, fid := range fids { ++ for _, fid := range vlog.sortedFids() { + lf, ok := vlog.filesMap[fid] + y.AssertTrue(ok) + +@@ -612,20 +610,8 @@ func (vlog *valueLog) open(db *DB) error { + 2*vlog.opt.ValueLogFileSize); err != nil { + return y.Wrapf(err, "Open existing file: %q", lf.path) + } +- // We shouldn't delete the maxFid file. +- if lf.size.Load() == vlogHeaderSize && fid != vlog.maxFid && !vlog.opt.ReadOnly { +- vlog.opt.Infof("Deleting empty file: %s", lf.path) +- if err := lf.Delete(); err != nil { +- return y.Wrapf(err, "while trying to delete empty file: %s", lf.path) +- } +- delete(vlog.filesMap, fid) +- } + } +- +- if vlog.opt.ReadOnly { +- return nil +- } +- // Now we can read the latest value log file, and see if it needs truncation. We could ++ // Read the latest value log file to see where its records end. We could + // technically do this over all the value log files, but that would mean slowing down the value + // log open. + last, ok := vlog.filesMap[vlog.maxFid] +@@ -637,7 +623,51 @@ func (vlog *valueLog) open(db *DB) error { + if err != nil { + return y.Wrapf(err, "while iterating over: %s", last.path) + } +- if err := last.Truncate(int64(lastOff)); err != nil { ++ last.size.Store(lastOff) ++ return nil ++} ++ ++// contains reports whether vp addresses a record the value log holds, as ++// established by openFiles. For use while no writes are in flight. ++func (vlog *valueLog) contains(vp valuePointer) bool { ++ lf, ok := vlog.filesMap[vp.Fid] ++ if !ok { ++ // A file that is gone was retired by garbage collection, which had ++ // moved every live value out of it first; an unclean stop never ++ // removes a file. The entry is stale, not torn. ++ return true ++ } ++ return uint64(vp.Offset)+uint64(vp.Len) <= uint64(lf.size.Load()) ++} ++ ++// open makes the value log writable after openFiles: empty retired files are ++// deleted, the last file is cut down to its records, and a fresh file is ++// created to write into. A read-only DB leaves the files as they are. ++func (vlog *valueLog) open(db *DB) error { ++ // We don't need to open any vlog files or collect stats for GC if DB is opened ++ // in InMemory mode. InMemory mode doesn't create any files/directories on disk. ++ if db.opt.InMemory || vlog.opt.ReadOnly { ++ return nil ++ } ++ // If no files are found, then create a new file. ++ if len(vlog.filesMap) == 0 { ++ _, err := vlog.createVlogFile() ++ return y.Wrapf(err, "Error while creating log file in valueLog.open") ++ } ++ for _, fid := range vlog.sortedFids() { ++ lf := vlog.filesMap[fid] ++ // We shouldn't delete the maxFid file. ++ if lf.size.Load() == vlogHeaderSize && fid != vlog.maxFid { ++ vlog.opt.Infof("Deleting empty file: %s", lf.path) ++ if err := lf.Delete(); err != nil { ++ return y.Wrapf(err, "while trying to delete empty file: %s", lf.path) ++ } ++ delete(vlog.filesMap, fid) ++ } ++ } ++ last, ok := vlog.filesMap[vlog.maxFid] ++ y.AssertTrue(ok) ++ if err := last.Truncate(int64(last.size.Load())); err != nil { + return y.Wrapf(err, "while truncating last value log file: %s", last.path) + } + diff --git a/harbor/sources/badger-v2/task/grader/driver/build_driver.sh b/harbor/sources/badger-v2/task/grader/driver/build_driver.sh new file mode 100644 index 0000000000000000000000000000000000000000..78dbb69640616296eacac150fdb0b5428533e284 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/build_driver.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Build the driver against a badger tree. +# build_driver.sh [] +# The module is built OUTSIDE the tree it points at, so nothing the driver needs +# ever appears inside the candidate's workspace. +set -euo pipefail +SRC=$(cd "${1:?usage: build_driver.sh []}" && pwd) +OUT=${2:?usage: build_driver.sh []} +HERE=$(cd "$(dirname "$0")" && pwd) +BUILD=${3:-$(mktemp -d)} +mkdir -p "$BUILD" +cp "$HERE"/*.go "$BUILD/" +cp "$HERE/go.sum" "$BUILD/go.sum" +sed "s#@BADGER_SRC@#$SRC#" "$HERE/go.mod.tmpl" > "$BUILD/go.mod" +( cd "$BUILD" && GOFLAGS=-mod=mod go build -o "$OUT" . ) diff --git a/harbor/sources/badger-v2/task/grader/driver/child.go b/harbor/sources/badger-v2/task/grader/driver/child.go new file mode 100644 index 0000000000000000000000000000000000000000..d0285be0f7d409edadeff066cbbc378eae96636d --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/child.go @@ -0,0 +1,180 @@ +// The writer child. +// +// It opens the database, then does nothing until the parent says so: one `next` +// line on stdin, one step executed, one `ok ` line on stdout — and only +// after the commits of that step have returned. It never calls Close, never +// sets a timer, and never exits on its own; the parent ends it with SIGKILL +// after an `ok` it chose, which makes the kill point a property of the script +// rather than of the clock. +// +// Everything here goes through the exported badger API: Open, OpenManaged, +// DefaultOptions and its With* helpers, Update, NewTransactionAt, CommitAt, +// NewManagedWriteBatch, SetEntryAt, DeleteAt, Flush. +package main + +import ( + "bufio" + "fmt" + "os" + "strings" + "sync" + + badger "github.com/dgraph-io/badger/v4" +) + +func options(p *Program, dir string, readOnly bool) badger.Options { + o := badger.DefaultOptions(dir). + WithLogger(nil). + WithMemTableSize(p.MemTableSize). + WithValueLogFileSize(p.ValueLogFileSize). + WithValueThreshold(p.ValueThreshold). + WithNumMemtables(3). + WithNumCompactors(2). + WithBlockCacheSize(4 << 20). + WithIndexCacheSize(0). + WithNumVersionsToKeep(versionsToKeep(p)). + WithDetectConflicts(false). + WithSyncWrites(true) + if readOnly { + o = o.WithReadOnly(true) + } + return o +} + +// Managed programs keep every version they write; ordinary ones keep one. +func versionsToKeep(p *Program) int { + if p.Managed { + return 100 + } + return 1 +} + +func openDB(p *Program, dir string, readOnly bool) (*badger.DB, error) { + if p.Managed { + return badger.OpenManaged(options(p, dir, readOnly)) + } + return badger.Open(options(p, dir, readOnly)) +} + +func runChild(progName, dir string) int { + p := programByName(progName) + if p == nil { + fmt.Fprintf(os.Stderr, "child: unknown program %q\n", progName) + return 2 + } + db, err := openDB(p, dir, false) + if err != nil { + fmt.Fprintf(os.Stderr, "child: open: %v\n", err) + return 2 + } + // No Close anywhere: this process is meant to die mid-flight. + + in := bufio.NewScanner(os.Stdin) + in.Buffer(make([]byte, 4096), 4096) + out := bufio.NewWriter(os.Stdout) + n := 0 + for in.Scan() { + if strings.TrimSpace(in.Text()) != "next" { + break + } + if n >= len(p.Steps) { + break + } + if err := runStep(db, p, p.Steps[n]); err != nil { + fmt.Fprintf(os.Stderr, "child: step %d: %v\n", n, err) + return 2 + } + n++ + fmt.Fprintf(out, "ok %d\n", n) + if err := out.Flush(); err != nil { + return 2 + } + } + // The parent ran out of steps to ask for; it kills us rather than letting + // us shut down, so a clean fall-through here means the run was cut short. + fmt.Fprintf(os.Stderr, "child: input closed after %d steps\n", n) + return 0 +} + +func runStep(db *badger.DB, p *Program, s Step) error { + if len(s.Txns) == 1 { + return commitTx(db, p, s.Txns[0]) + } + var wg sync.WaitGroup + errs := make([]error, len(s.Txns)) + for i, tx := range s.Txns { + wg.Add(1) + go func(i int, tx Tx) { defer wg.Done(); errs[i] = commitTx(db, p, tx) }(i, tx) + } + wg.Wait() + for _, e := range errs { + if e != nil { + return e + } + } + return nil +} + +func commitTx(db *badger.DB, p *Program, tx Tx) error { + switch tx.Kind { + case kindMixed: + wb := db.NewManagedWriteBatch() + for _, op := range tx.Ops { + if op.Del { + if err := wb.DeleteAt([]byte(op.Key), op.Ver); err != nil { + return err + } + continue + } + e := badger.NewEntry([]byte(op.Key), valueBytes(p.Name, tx.ID, op.Key, op.Size)) + if err := wb.SetEntryAt(e, op.Ver); err != nil { + return err + } + } + return wb.Flush() + + case kindBatch: + wb := db.NewWriteBatchAt(tx.Ts) + for _, op := range tx.Ops { + if op.Del { + if err := wb.Delete([]byte(op.Key)); err != nil { + return err + } + continue + } + if err := wb.Set([]byte(op.Key), valueBytes(p.Name, tx.ID, op.Key, op.Size)); err != nil { + return err + } + } + return wb.Flush() + + default: // kindTxn + apply := func(t *badger.Txn) error { + for _, op := range tx.Ops { + if op.Del { + if err := t.Delete([]byte(op.Key)); err != nil { + return err + } + continue + } + if err := t.Set([]byte(op.Key), valueBytes(p.Name, tx.ID, op.Key, op.Size)); err != nil { + return err + } + } + return nil + } + if p.Managed { + read := tx.Ts + if read > 0 { + read-- + } + t := db.NewTransactionAt(read, true) + defer t.Discard() + if err := apply(t); err != nil { + return err + } + return t.CommitAt(tx.Ts, nil) + } + return db.Update(apply) + } +} diff --git a/harbor/sources/badger-v2/task/grader/driver/fixtures.go b/harbor/sources/badger-v2/task/grader/driver/fixtures.go new file mode 100644 index 0000000000000000000000000000000000000000..b8908ce9689bad5ef493b318dffa24dfeab66d7a --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/fixtures.go @@ -0,0 +1,294 @@ +// Held-out fixtures: directories the RELEASED build left behind. +// +// Everything else in this driver makes its own crash directory with the +// candidate's own build. That is the right way round for almost every question +// — the bytes and the build that has to read them then come from the same +// place — but it cannot ask the one question a stored database always asks in +// the end: can this build still read what the SHIPPED one wrote? +// +// So three directories are baked ONCE, offline, by a driver compiled against a +// pristine checkout of the task's base commit, torn while they are being baked, +// and frozen as tarballs in the grader tree. At grading time they are unpacked +// and handed to the candidate's build. Nothing about them is negotiable +// afterwards: the write script that produced them is pinned by a digest carried +// in the manifest, so a later edit to a program cannot silently invalidate the +// bytes it was baked from — the check reports a GRADER FAULT instead of a +// verdict. +// +// A fixture that was torn carries one more number: how far into the file's +// written bytes the cut landed. A build is free to lose the commits behind the +// cut — that is what a torn tail means — but a build that answers every tear by +// throwing the whole log away is not recovering anything, and an empty history +// is a legal prefix. The manifest therefore records the smallest history the +// fixture can honestly be expected to give back, computed from where the cut +// fell in the written bytes and NOT from what any build actually did with it. +package main + +import ( + "crypto/sha256" + "encoding/hex" + "encoding/json" + "fmt" + "os" + "path/filepath" +) + +type FixtureManifest struct { + Fixture string `json:"fixture"` + Program string `json:"program"` + ProgramDigest string `json:"program_digest"` + Acked int `json:"acked"` + Target string `json:"target,omitempty"` + Cut string `json:"cut,omitempty"` + File string `json:"file,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + CutAt int64 `json:"cut_at,omitempty"` + WrittenThrough int64 `json:"written_through,omitempty"` + Hit bool `json:"hit_written_bytes"` + MinBoundary int `json:"min_boundary"` + BakedBy string `json:"baked_by"` +} + +type FixtureResult struct { + Fixture string `json:"fixture"` + Hit bool `json:"hit_written_bytes"` + Acked int `json:"acked"` + MinBound int `json:"min_boundary"` + ROOpenErr string `json:"ro_open_err,omitempty"` + RODied string `json:"ro_died,omitempty"` + ROBytes []string `json:"ro_byte_changes,omitempty"` + RWOpenErr string `json:"rw_open_err,omitempty"` + RWDied string `json:"rw_died,omitempty"` + Judge Judgement `json:"judge"` + Legs map[string]bool `json:"legs"` + Notes []string `json:"notes,omitempty"` + Fault string `json:"fault,omitempty"` + OK bool `json:"ok"` +} + +// progDigest pins a write script by what it WRITES, not by the source that +// produces it: the ordered list of every operation of every transaction, plus +// the option sizes that decide where the bytes land. A fixture baked from one +// script cannot be judged against another. +func progDigest(p *Program) string { + h := sha256.New() + fmt.Fprintf(h, "%s|%v|%d|%d|%d\n", p.Name, p.Managed, p.MemTableSize, + p.ValueLogFileSize, p.ValueThreshold) + for _, tx := range p.flat() { + fmt.Fprintf(h, "%d|%s|%d;", tx.ID, tx.Kind, tx.Ts) + for _, op := range tx.Ops { + fmt.Fprintf(h, "%s,%v,%d,%d;", op.Key, op.Del, op.Size, op.Ver) + } + fmt.Fprint(h, "\n") + } + return hex.EncodeToString(h.Sum(nil))[:16] +} + +// writtenThrough is the length of the prefix of a file that was ever written +// to. Log files are created at their full length and filled from the front, so +// the first offset from which everything is zero is where the data ends. +func writtenThrough(path string) (int64, error) { + fi, err := os.Stat(path) + if err != nil { + return 0, err + } + lo, hi := int64(0), fi.Size() + for lo < hi { + mid := (lo + hi) / 2 + w, err := regionWasWritten(path, mid) + if err != nil { + return 0, err + } + if w { + lo = mid + 1 + } else { + hi = mid + } + } + return lo, nil +} + +// runBake writes one fixture: crash a program's writer, optionally tear a log, +// and record everything the check will need. Author-only; it never runs inside +// the task image, and the build it runs with is the released one. +func runBake(name, progName, outDir, target, cut string, frac float64) int { + p := programByName(progName) + if p == nil { + return fault("bake: unknown program " + progName) + } + db := filepath.Join(outDir, "db") + if err := os.MkdirAll(db, 0o755); err != nil { + return fault("bake: " + err.Error()) + } + acked, said, err := crashOnce(p, db) + if err != nil { + return fault("bake: " + err.Error()) + } + if acked != len(p.Steps) { + return fault(fmt.Sprintf("bake: the writer acknowledged %d of %d commits: %s", + acked, len(p.Steps), said)) + } + m := FixtureManifest{ + Fixture: name, Program: p.Name, ProgramDigest: progDigest(p), Acked: acked, + Target: target, Cut: cut, MinBoundary: acked, + BakedBy: "a driver compiled against the pristine base checkout", + } + if target != "" { + path, err := pickFile(db, target, "last") + if err != nil { + return fault("bake: " + err.Error()) + } + fi, err := os.Stat(path) + if err != nil { + return fault("bake: " + err.Error()) + } + through, err := writtenThrough(path) + if err != nil { + return fault("bake: " + err.Error()) + } + off := int64(float64(fi.Size()) * frac) + hit, err := tear(path, cut, off) + if err != nil { + return fault("bake: " + err.Error()) + } + m.File, m.FileSize, m.CutAt, m.WrittenThrough, m.Hit = filepath.Base(path), fi.Size(), off, through, hit + // What the fixture may honestly be expected to keep. The cut fell at + // cut_at of written_through bytes; a build that keeps the commits behind + // it keeps about that share of the history. Three quarters of that share + // is the bar — slack for a script whose commits are not all the same + // size — and it exists to refuse ONE answer: throwing the log away and + // calling nothing a prefix. + if hit && through > 0 { + share := float64(off) / float64(through) + m.MinBoundary = int(float64(acked) * share * 0.75) + } else if hit { + m.MinBoundary = 0 + } else { + m.MinBoundary = acked + } + } + b, _ := json.MarshalIndent(&m, "", " ") + if err := os.WriteFile(filepath.Join(outDir, "manifest.json"), append(b, '\n'), 0o644); err != nil { + return fault("bake: " + err.Error()) + } + os.Stdout.Write(append(b, '\n')) + return 0 +} + +// runFixCheck opens an unpacked fixture with the candidate's build — read-only +// first, then read-write — and judges what it serves against the write script +// the manifest names. +func runFixCheck(dir string) int { + res := &FixtureResult{Legs: map[string]bool{}} + emitFix := func() int { + b, _ := json.MarshalIndent(res, "", " ") + os.Stdout.Write(append(b, '\n')) + if res.Fault != "" { + return 3 + } + if !res.OK { + return 1 + } + return 0 + } + raw, err := os.ReadFile(filepath.Join(dir, "manifest.json")) + if err != nil { + res.Fault = "fixture manifest: " + err.Error() + return emitFix() + } + var m FixtureManifest + if err := json.Unmarshal(raw, &m); err != nil { + res.Fault = "fixture manifest: " + err.Error() + return emitFix() + } + res.Fixture, res.Hit, res.Acked, res.MinBound = m.Fixture, m.Hit, m.Acked, m.MinBoundary + p := programByName(m.Program) + if p == nil { + res.Fault = "fixture names an unknown write script: " + m.Program + return emitFix() + } + if got := progDigest(p); got != m.ProgramDigest { + res.Fault = fmt.Sprintf("the write script %q has changed since this fixture was "+ + "baked (%s now, %s then); rebake the fixtures", m.Program, got, m.ProgramDigest) + return emitFix() + } + db := filepath.Join(dir, "db") + if _, err := os.Stat(db); err != nil { + res.Fault = "fixture directory: " + err.Error() + return emitFix() + } + + before, err := stampDir(db) + if err != nil { + res.Fault = "stamp: " + err.Error() + return emitFix() + } + roObs, roDied := observeIn(p, db, true) + res.ROOpenErr, res.RODied = roObs.OpenErr, roDied + after, err := stampDir(db) + if err != nil { + res.Fault = "stamp: " + err.Error() + return emitFix() + } + same, changes := sameStamps(before, after) + res.ROBytes, res.Legs["read_only_alters_no_byte"] = changes, same + + roOpened := roObs.OpenErr == "" && roDied == "" + if m.Hit { + res.Legs["read_only_follows_the_rule"] = !roOpened && roDied == "" + } else { + ok := roOpened + if ok { + var why string + ok, why = sameState(p, roObs) + if !ok { + res.Notes = append(res.Notes, "read-only history incomplete: "+why) + } + } + res.Legs["read_only_follows_the_rule"] = ok + } + + rwObs, rwDied := observeIn(p, db, false) + res.RWOpenErr, res.RWDied = rwObs.OpenErr, rwDied + if rwObs.OpenErr != "" || rwDied != "" { + res.Legs["reopens_read_write"] = false + res.Legs["history_is_a_prefix"] = false + res.Legs["no_value_nobody_wrote"] = false + res.Legs["keeps_enough_of_the_history"] = false + res.OK = false + return emitFix() + } + res.Legs["reopens_read_write"] = true + j := judge(p, rwObs) + res.Judge = j + res.Legs["history_is_a_prefix"] = j.Boundary >= 0 + res.Legs["no_value_nobody_wrote"] = len(j.Phantoms) == 0 && len(j.ReadErrs) == 0 + res.Legs["keeps_enough_of_the_history"] = j.Boundary >= m.MinBoundary + if j.Boundary < m.MinBoundary { + res.Notes = append(res.Notes, fmt.Sprintf( + "the build gave back %d of the %d commits this directory acknowledged; "+ + "the cut it carries is %d bytes into %d written ones, so at least %d were still there", + max0(j.Boundary), m.Acked, m.CutAt, m.WrittenThrough, m.MinBoundary)) + } + if roOpened && res.Legs["history_is_a_prefix"] { + agree, why := sameObservation(roObs, rwObs) + res.Legs["read_only_and_read_write_agree"] = agree + if !agree { + res.Notes = append(res.Notes, "read-only and read-write disagree: "+why) + } + } + res.OK = true + for _, ok := range res.Legs { + if !ok { + res.OK = false + } + } + return emitFix() +} + +func max0(n int) int { + if n < 0 { + return 0 + } + return n +} diff --git a/harbor/sources/badger-v2/task/grader/driver/go.mod.tmpl b/harbor/sources/badger-v2/task/grader/driver/go.mod.tmpl new file mode 100644 index 0000000000000000000000000000000000000000..5abe9d263844cd0072517d7cf8ab60beecacd316 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/go.mod.tmpl @@ -0,0 +1,23 @@ +module journalgrader/driver + +go 1.24.0 + +require github.com/dgraph-io/badger/v4 v4.0.0 + +require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/dgraph-io/ristretto/v2 v2.2.0 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/go-logr/logr v1.4.3 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/flatbuffers v25.2.10+incompatible // indirect + github.com/klauspost/compress v1.18.0 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.41.0 // indirect + go.opentelemetry.io/otel/metric v1.41.0 // indirect + go.opentelemetry.io/otel/trace v1.41.0 // indirect + golang.org/x/sys v0.41.0 // indirect + google.golang.org/protobuf v1.36.7 // indirect +) + +replace github.com/dgraph-io/badger/v4 => @BADGER_SRC@ diff --git a/harbor/sources/badger-v2/task/grader/driver/go.sum b/harbor/sources/badger-v2/task/grader/driver/go.sum new file mode 100644 index 0000000000000000000000000000000000000000..e15a12ba568b4970cbd5bf4e2aa3147a59fa3059 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/go.sum @@ -0,0 +1,39 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgraph-io/ristretto/v2 v2.2.0 h1:bkY3XzJcXoMuELV8F+vS8kzNgicwQFAaGINAEJdWGOM= +github.com/dgraph-io/ristretto/v2 v2.2.0/go.mod h1:RZrm63UmcBAaYWC1DotLYBmTvgkrs0+XhBd7Npn7/zI= +github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da h1:aIftn67I1fkbMa512G+w+Pxci9hJPB8oMnkcP3iZF38= +github.com/dgryski/go-farm v0.0.0-20240924180020-3414d57e47da/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/google/flatbuffers v25.2.10+incompatible h1:F3vclr7C3HpB1k9mxCGRMXq6FdUalZ6H/pNX4FP1v0Q= +github.com/google/flatbuffers v25.2.10+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/klauspost/compress v1.18.0 h1:c/Cqfb0r+Yi+JtIEq73FWXVkRonBlf0CRNYc8Zttxdo= +github.com/klauspost/compress v1.18.0/go.mod h1:2Pp+KzxcywXVXMr50+X0Q/Lsb43OQHYWRCY2AiWywWQ= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.41.0 h1:YlEwVsGAlCvczDILpUXpIpPSL/VPugt7zHThEMLce1c= +go.opentelemetry.io/otel v1.41.0/go.mod h1:Yt4UwgEKeT05QbLwbyHXEwhnjxNO6D8L5PQP51/46dE= +go.opentelemetry.io/otel/metric v1.41.0 h1:rFnDcs4gRzBcsO9tS8LCpgR0dxg4aaxWlJxCno7JlTQ= +go.opentelemetry.io/otel/metric v1.41.0/go.mod h1:xPvCwd9pU0VN8tPZYzDZV/BMj9CM9vs00GuBjeKhJps= +go.opentelemetry.io/otel/trace v1.41.0 h1:Vbk2co6bhj8L59ZJ6/xFTskY+tGAbOnCtQGVVa9TIN0= +go.opentelemetry.io/otel/trace v1.41.0/go.mod h1:U1NU4ULCoxeDKc09yCWdWe+3QoyweJcISEVa1RBzOis= +golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k= +golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A= +google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/harbor/sources/badger-v2/task/grader/driver/main.go b/harbor/sources/badger-v2/task/grader/driver/main.go new file mode 100644 index 0000000000000000000000000000000000000000..b210bc3c3b2235790f91493736551377f2b6b73f --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/main.go @@ -0,0 +1,640 @@ +// Command driver is the whole crash-recovery oracle: parent, writer child and +// reader, in one binary built against the candidate's tree. +// +// driver -mode=run -scenario=c1|c2|c3|c4|c7|all -work=DIR [-out=FILE] +// +// It is built ONLY against the exported badger API — Open, OpenManaged, +// DefaultOptions and its With* helpers, Update, View, NewTransactionAt, +// CommitAt, NewManagedWriteBatch, NewWriteBatchAt, SetEntryAt, DeleteAt, Flush, +// Txn.Get, Iterator, Item — so a candidate is free to rename, split or rewrite +// anything unexported without the grading noticing. +// +// A run is: start the child, ask it for step after step, kill it with SIGKILL +// after an acknowledgement it chose, then work on COPIES of the directory it +// left behind — one copy per cut. That is what keeps the cost down: the +// expensive part (writing a few thousand commits with SyncWrites on) happens +// once per scenario, and the twenty-odd cuts are each a directory copy and two +// short reader processes. +// +// Nothing here is timed. The kill point is an acknowledgement count, the cuts +// are fractions of a file length, and every verdict is a comparison of bytes. +// The one clock in the file is a stall guard on the child, which never fires in +// a healthy run and, when it does, reports a GRADER FAULT rather than a failed +// criterion — it can never turn a working build into a broken one. +package main + +import ( + "bufio" + "encoding/json" + "flag" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "strings" + "time" +) + +// ------------------------------------------------------------------ scenarios + +type Variant struct { + Name string + Target string // ".vlog" | ".mem" | "" for no cut at all + Which string // "last" | "first" + Cut string // "zero" | "trunc" + Frac float64 // fraction of the file's length + Minus1 bool // cut one byte off the end instead +} + +type Scenario struct { + Name string + Prog *Program + Variants []Variant + PostWrite []string // keys to write after recovery (C7) + WantHit bool // this scenario must land at least two cuts in written bytes + WantMiss bool // ... and at least one past them +} + +func cuts(target string, fracs ...float64) []Variant { + var out []Variant + for _, cut := range []string{"zero", "trunc"} { + for _, f := range fracs { + out = append(out, Variant{ + Name: fmt.Sprintf("%s_%s_%02d", strings.TrimPrefix(target, "."), cut, int(f*100)), + Target: target, Which: "last", Cut: cut, Frac: f, + }) + } + } + return out +} + +func scenarioByName(n string) *Scenario { + switch n { + case "c1": + // One value log, filled to about two fifths of its length. The early + // fractions land in written bytes, the late ones past them, and the + // last byte is a shortening that costs nothing. + s := &Scenario{Name: "c1", Prog: progC1(), WantHit: true, WantMiss: true} + s.Variants = cuts(".vlog", 0.05, 0.15, 0.25, 0.35, 0.60) + s.Variants = append(s.Variants, Variant{Name: "vlog_trunc_minus1", Target: ".vlog", Which: "last", Cut: "trunc", Minus1: true}) + return s + case "c2": + // Several value logs. The cut is in the newest one; behind it sit + // commits that deleted a key and commits that wrote nothing to any + // value log at all, and keys whose values live in the older, untouched + // files have to keep coming back. + s := &Scenario{Name: "c2", Prog: progC2(), WantHit: true, WantMiss: true} + s.Variants = cuts(".vlog", 0.03, 0.06, 0.10, 0.14, 0.50) + return s + case "c3": + // Managed mode, versions inside one commit differing from each other. + // The cut is in the write-ahead log, where those commits live. + s := &Scenario{Name: "c3", Prog: progC3(), WantHit: true, WantMiss: true} + s.Variants = cuts(".mem", 0.05, 0.15, 0.25, 0.35, 0.60) + s.Variants = append(s.Variants, + Variant{Name: "mem_trunc_minus1", Target: ".mem", Which: "last", Cut: "trunc", Minus1: true}, + Variant{Name: "no_cut", Target: ""}, + Variant{Name: "vlog_zero_02", Target: ".vlog", Which: "last", Cut: "zero", Frac: 0.02}, + Variant{Name: "vlog_trunc_04", Target: ".vlog", Which: "last", Cut: "trunc", Frac: 0.04}, + ) + return s + case "c4": + // Eight writers at once, both logs rotating, killed with nothing cut. + // Every acknowledged commit has to come back, read-only included, and + // the read-only attempt has to leave the directory alone. + return &Scenario{Name: "c4", Prog: progC4(), + Variants: []Variant{{Name: "no_cut", Target: ""}}} + case "c7": + // Recover, then write. The recovered build has to accept the write and + // serve it afterwards, across a close and a reopen. + s := &Scenario{Name: "c7", Prog: progC1(), WantHit: true} + s.Variants = []Variant{ + {Name: "vlog_zero_25", Target: ".vlog", Which: "last", Cut: "zero", Frac: 0.25}, + {Name: "vlog_trunc_15", Target: ".vlog", Which: "last", Cut: "trunc", Frac: 0.15}, + } + s.PostWrite = []string{"big-000", "sml-000", "ov-000", "fresh-key"} + return s + } + return nil +} + +var allScenarios = []string{"c1", "c2", "c3", "c4", "c7"} + +// -------------------------------------------------------------------- results + +type VariantResult struct { + Name string `json:"name"` + File string `json:"file,omitempty"` + FileSize int64 `json:"file_size,omitempty"` + CutAt int64 `json:"cut_at,omitempty"` + Cut string `json:"cut,omitempty"` + HitData bool `json:"hit_written_bytes"` + ROOpenErr string `json:"ro_open_err,omitempty"` + RODied string `json:"ro_died,omitempty"` + ROBytes []string `json:"ro_byte_changes,omitempty"` + RWOpenErr string `json:"rw_open_err,omitempty"` + RWDied string `json:"rw_died,omitempty"` + Judge Judgement `json:"judge"` + Legs map[string]bool `json:"legs"` + Notes []string `json:"notes,omitempty"` +} + +type ScenarioResult struct { + Scenario string `json:"scenario"` + Program string `json:"program"` + Steps int `json:"steps"` + Txns int `json:"txns"` + OK bool `json:"ok"` + Fault string `json:"fault,omitempty"` + Legs map[string]bool `json:"legs"` + Variants []VariantResult `json:"variants"` +} + +type Report struct { + OK bool `json:"ok"` + Fault string `json:"fault,omitempty"` + Scenarios map[string]*ScenarioResult `json:"scenarios"` +} + +// ----------------------------------------------------------------------- main + +func main() { + mode := flag.String("mode", "run", "run | child | observe | postwrite | bake | fixcheck") + prog := flag.String("program", "", "program name (child/observe modes)") + dir := flag.String("dir", "", "database directory (child/observe modes)") + readOnly := flag.Bool("readonly", false, "open read-only (observe mode)") + keys := flag.String("keys", "", "comma-separated keys (postwrite mode)") + scenario := flag.String("scenario", "all", "scenario name or 'all'") + work := flag.String("work", "", "scratch directory (run mode)") + out := flag.String("out", "", "write the JSON report here as well as to stdout") + fixture := flag.String("fixture", "", "fixture name (bake mode)") + target := flag.String("target", "", "log suffix to tear when baking: .vlog | .mem | \"\"") + cut := flag.String("cut", "zero", "zero | trunc (bake mode)") + frac := flag.Float64("frac", 0.25, "fraction of the file's length to cut at (bake mode)") + flag.Parse() + + switch *mode { + case "child": + os.Exit(runChild(*prog, *dir)) + case "observe": + os.Exit(runObserve(*prog, *dir, *readOnly)) + case "postwrite": + var ks []string + if *keys != "" { + ks = strings.Split(*keys, ",") + } + os.Exit(runPostWrite(*prog, *dir, ks)) + case "bake": + os.Exit(runBake(*fixture, *prog, *dir, *target, *cut, *frac)) + case "fixcheck": + os.Exit(runFixCheck(*dir)) + case "probe": + os.Exit(runProbe(*scenario, *work)) + case "run": + os.Exit(runAll(*scenario, *work, *out)) + } + fmt.Fprintf(os.Stderr, "unknown mode %q\n", *mode) + os.Exit(2) +} + +func runAll(which, work, outPath string) int { + if work == "" { + d, err := os.MkdirTemp("", "journal-driver-") + if err != nil { + return fault("scratch directory: " + err.Error()) + } + work = d + defer os.RemoveAll(work) + } + if err := os.MkdirAll(work, 0o755); err != nil { + return fault("scratch directory: " + err.Error()) + } + names := allScenarios + if which != "all" { + names = strings.Split(which, ",") + } + rep := &Report{OK: true, Scenarios: map[string]*ScenarioResult{}} + for _, n := range names { + s := scenarioByName(strings.TrimSpace(n)) + if s == nil { + return fault("unknown scenario " + n) + } + r := runScenario(s, filepath.Join(work, s.Name)) + rep.Scenarios[s.Name] = r + if r.Fault != "" && rep.Fault == "" { + rep.Fault = s.Name + ": " + r.Fault + } + if !r.OK { + rep.OK = false + } + } + b, _ := json.MarshalIndent(rep, "", " ") + os.Stdout.Write(append(b, '\n')) + if outPath != "" { + if err := os.WriteFile(outPath, append(b, '\n'), 0o644); err != nil { + return fault("write report: " + err.Error()) + } + } + if rep.Fault != "" { + return 3 + } + return 0 +} + +// runProbe crashes a scenario's writer and reports, for every log file it left +// behind, its length and how much of it was ever written to. NOTHING in the +// grading calls this or reads its output: it exists so that the author can see +// that the fractions a scenario cuts at straddle the written bytes, which is +// the property runScenario then re-checks for itself on every run. +func runProbe(name, work string) int { + s := scenarioByName(name) + if s == nil { + return fault("unknown scenario " + name) + } + dir := filepath.Join(work, "probe-"+name) + _ = os.RemoveAll(dir) + if err := os.MkdirAll(dir, 0o755); err != nil { + return fault(err.Error()) + } + if _, _, err := crashOnce(s.Prog, dir); err != nil { + return fault(err.Error()) + } + ents, _ := os.ReadDir(dir) + for _, e := range ents { + p := filepath.Join(dir, e.Name()) + fi, err := os.Stat(p) + if err != nil { + continue + } + lo, hi := int64(0), fi.Size() + for lo < hi { + mid := (lo + hi) / 2 + w, err := regionWasWritten(p, mid) + if err != nil { + break + } + if w { + lo = mid + 1 + } else { + hi = mid + } + } + fmt.Printf("%-16s size=%-9d written_through=%-9d fraction=%.3f\n", e.Name(), fi.Size(), lo, float64(lo)/float64(fi.Size())) + } + return 0 +} + +func fault(msg string) int { + b, _ := json.MarshalIndent(&Report{OK: false, Fault: msg, Scenarios: map[string]*ScenarioResult{}}, "", " ") + os.Stdout.Write(append(b, '\n')) + return 3 +} + +// ------------------------------------------------------------- one scenario + +func runScenario(s *Scenario, work string) *ScenarioResult { + p := s.Prog + r := &ScenarioResult{Scenario: s.Name, Program: p.Name, Steps: len(p.Steps), + Txns: len(p.flat()), OK: true, Legs: map[string]bool{}} + + crash := filepath.Join(work, "crash") + if err := os.MkdirAll(crash, 0o755); err != nil { + r.Fault, r.OK = "mkdir: "+err.Error(), false + return r + } + acked, childSaid, err := crashOnce(p, crash) + if err != nil { + r.Fault, r.OK = "child: "+err.Error(), false + return r + } + // A writer that stopped answering before the script was done did not + // acknowledge the commits the rest of the run is about. That is a verdict on + // the build — it refused a write, or it died on one — not a fault in the + // grader, and it is scored as one. + if acked != len(p.Steps) { + r.OK = false + r.Legs = map[string]bool{"the_build_accepts_every_commit": false} + r.Variants = append(r.Variants, VariantResult{ + Name: "writer", Legs: map[string]bool{"the_build_accepts_every_commit": false}, + Notes: []string{fmt.Sprintf("the writer acknowledged %d of %d commits and then stopped: %s", + acked, len(p.Steps), childSaid)}}) + return r + } + r.Legs["the_build_accepts_every_commit"] = true + + hits, misses := 0, 0 + for _, v := range s.Variants { + vr := runVariant(s, p, crash, filepath.Join(work, "v-"+v.Name), v) + if vr.HitData { + hits++ + } else { + misses++ + } + for k, ok := range vr.Legs { + if !ok { + r.OK = false + } + if prev, seen := r.Legs[k]; !seen || prev { + r.Legs[k] = ok + } + } + if vr.Notes != nil { + for _, n := range vr.Notes { + if strings.HasPrefix(n, "FAULT ") { + r.Fault, r.OK = n, false + } + } + } + r.Variants = append(r.Variants, vr) + } + _ = os.RemoveAll(crash) + + // A scenario whose cuts all missed the written bytes would be green for the + // wrong reason, and one whose cuts all hit them would never exercise the + // other half. Either is a fault in the grader, not a verdict on the build. + if s.WantHit && hits < 2 { + r.Fault, r.OK = fmt.Sprintf("only %d cut(s) landed in written bytes; the scenario is miscalibrated", hits), false + } + if s.WantMiss && misses < 1 { + r.Fault, r.OK = "no cut landed past the written bytes; the scenario is miscalibrated", false + } + return r +} + +// crashOnce runs the writer child to the end of its script and kills it with +// SIGKILL after the last acknowledgement. It returns the number of commits the +// child acknowledged, which is what the history is judged against. +func crashOnce(p *Program, dir string) (int, string, error) { + self, err := os.Executable() + if err != nil { + return 0, "", err + } + cmd := exec.Command(self, "-mode=child", "-program="+p.Name, "-dir="+dir) + stdin, err := cmd.StdinPipe() + if err != nil { + return 0, "", err + } + stdout, err := cmd.StdoutPipe() + if err != nil { + return 0, "", err + } + var errbuf strings.Builder + cmd.Stderr = &errbuf + if err := cmd.Start(); err != nil { + return 0, "", err + } + // Not part of any verdict: a child that stops answering would otherwise + // hang the grader with nothing to say. See the note at the top of the file. + guard := time.AfterFunc(4*time.Minute, func() { _ = cmd.Process.Kill() }) + defer guard.Stop() + + sc := bufio.NewScanner(stdout) + acked := 0 + for i := 0; i < len(p.Steps); i++ { + if _, err := io.WriteString(stdin, "next\n"); err != nil { + break + } + if !sc.Scan() { + break + } + line := strings.TrimSpace(sc.Text()) + var n int + if _, err := fmt.Sscanf(line, "ok %d", &n); err != nil || n != i+1 { + break + } + acked = n + } + // The child is still alive, holding everything it acknowledged. Kill it + // where it stands; it never gets to shut anything down cleanly. + _ = cmd.Process.Kill() + _ = cmd.Wait() + return acked, tail(errbuf.String()), nil +} + +func tail(s string) string { + s = strings.TrimSpace(s) + if len(s) > 400 { + return "..." + s[len(s)-400:] + } + return s +} + +// ------------------------------------------------------------- one cut + +func runVariant(s *Scenario, p *Program, crash, dir string, v Variant) VariantResult { + vr := VariantResult{Name: v.Name, Cut: v.Cut, Legs: map[string]bool{}} + defer os.RemoveAll(dir) + + if err := copyDir(crash, dir); err != nil { + vr.Notes = append(vr.Notes, "FAULT copy: "+err.Error()) + return vr + } + + if v.Target != "" { + path, err := pickFile(dir, v.Target, v.Which) + if err != nil { + vr.Notes = append(vr.Notes, "FAULT pick: "+err.Error()) + return vr + } + fi, err := os.Stat(path) + if err != nil { + vr.Notes = append(vr.Notes, "FAULT stat: "+err.Error()) + return vr + } + off := int64(float64(fi.Size()) * v.Frac) + if v.Minus1 { + off = fi.Size() - 1 + } + hit, err := tear(path, v.Cut, off) + if err != nil { + vr.Notes = append(vr.Notes, "FAULT cut: "+err.Error()) + return vr + } + vr.File, vr.FileSize, vr.CutAt, vr.HitData = filepath.Base(path), fi.Size(), off, hit + } + + before, err := stampDir(dir) + if err != nil { + vr.Notes = append(vr.Notes, "FAULT stamp: "+err.Error()) + return vr + } + + // Read-only first, so that what it is asked not to change is still there to + // be compared against. + roObs, roDied := observeIn(p, dir, true) + vr.ROOpenErr, vr.RODied = roObs.OpenErr, roDied + after, err := stampDir(dir) + if err != nil { + vr.Notes = append(vr.Notes, "FAULT stamp: "+err.Error()) + return vr + } + same, changes := sameStamps(before, after) + vr.ROBytes = changes + vr.Legs["read_only_alters_no_byte"] = same + + roOpened := roObs.OpenErr == "" && roDied == "" + if vr.HitData { + // Written bytes were destroyed. A read-only open cannot serve the whole + // history and cannot repair anything, so it has to say why it will not + // serve it — an error, not a panic, and not a shorter history. + vr.Legs["read_only_follows_the_rule"] = !roOpened && roDied == "" + } else { + // Nothing written was touched: a killed process, and a tail of a file + // that never held anything. The whole history has to come back, and it + // has to come back read-only too. + ok := roOpened + if ok { + var why string + ok, why = sameState(p, roObs) + if !ok { + vr.Notes = append(vr.Notes, "read-only history incomplete: "+why) + } + } + vr.Legs["read_only_follows_the_rule"] = ok + } + + // Now the same directory, read-write. + rwObs, rwDied := observeIn(p, dir, false) + vr.RWOpenErr, vr.RWDied = rwObs.OpenErr, rwDied + if rwObs.OpenErr != "" || rwDied != "" { + vr.Legs["reopens_read_write"] = false + vr.Legs["history_is_a_prefix"] = false + vr.Legs["no_value_nobody_wrote"] = false + vr.Legs["nothing_lost_when_the_cut_missed"] = false + return vr + } + vr.Legs["reopens_read_write"] = true + + j := judge(p, rwObs) + vr.Judge = j + if p.Concurrent { + // Commits that ran at once have no order the grader can know, so the + // only history it will accept from them is all of it — which is what a + // kill with nothing torn owes. + full, why := sameState(p, rwObs) + vr.Legs["history_is_a_prefix"] = full + if !full { + vr.Notes = append(vr.Notes, "concurrent history incomplete: "+why) + } + } else { + vr.Legs["history_is_a_prefix"] = j.Boundary >= 0 + } + vr.Legs["no_value_nobody_wrote"] = len(j.Phantoms) == 0 && len(j.ReadErrs) == 0 + if vr.HitData { + vr.Legs["nothing_lost_when_the_cut_missed"] = true // not this variant's question + } else { + vr.Legs["nothing_lost_when_the_cut_missed"] = j.Boundary == j.NumTxns + } + // An overwritten key whose newer version was lost has to come back with the + // older one; a prefix already says so, but say it separately so a failure + // reads as what it is. + vr.Legs["earlier_version_comes_back"] = j.Boundary >= 0 + + if roOpened && vr.Legs["history_is_a_prefix"] { + same, why := sameObservation(roObs, rwObs) + vr.Legs["read_only_and_read_write_agree"] = same + if !same { + vr.Notes = append(vr.Notes, "read-only and read-write disagree: "+why) + } + } + + if s.Name == "c2" { + vr.Legs["keys_in_the_older_logs_survive"] = olderLogKeysIntact(p, rwObs, j) + } + + if len(s.PostWrite) > 0 { + pw, died := observePostWrite(p, dir, s.PostWrite) + ok := died == "" && pw.OpenErr == "" + if ok { + got := pw.state() + for _, k := range s.PostWrite { + if got[k] != vdigest(postValue(k)) { + ok = false + vr.Notes = append(vr.Notes, "after recovery the write to "+k+" did not come back") + } + } + } else { + vr.Notes = append(vr.Notes, "post-recovery write failed: "+pw.OpenErr+died) + } + vr.Legs["writes_after_recovery_win"] = ok + } + return vr +} + +// olderLogKeysIntact looks only at keys whose last write happened in the first +// half of the surviving history — the ones whose values sit in value log files +// the cut never touched, reached through pointers written long before it. A +// build that decides the newest log's damage says something about the older +// ones drops exactly these. +func olderLogKeysIntact(p *Program, obs *Observation, j Judgement) bool { + if j.Boundary < 0 { + return false + } + txs := p.flat() + half := j.Boundary / 2 + if half == 0 { + return false + } + lastWrite := map[string]int{} + for i := 0; i < j.Boundary; i++ { + for _, op := range txs[i].Ops { + lastWrite[op.Key] = i + } + } + want := p.simulate(j.Boundary) + got := obs.state() + n := 0 + for k, v := range want { + if lastWrite[k] >= half { + continue + } + if got[k] != v { + return false + } + n++ + } + return n > 0 +} + +// ------------------------------------------------------------- reader helpers + +func observeIn(p *Program, dir string, readOnly bool) (*Observation, string) { + args := []string{"-mode=observe", "-program=" + p.Name, "-dir=" + dir} + if readOnly { + args = append(args, "-readonly") + } + return runReader(args) +} + +func observePostWrite(p *Program, dir string, keys []string) (*Observation, string) { + return runReader([]string{"-mode=postwrite", "-program=" + p.Name, "-dir=" + dir, + "-keys=" + strings.Join(keys, ",")}) +} + +// runReader spawns one reader process. A build that panics on open, or that +// dies in a goroutine no recover can reach, comes back here as a message — +// which is an observation about the build, not a fault in the grader. +func runReader(args []string) (*Observation, string) { + self, err := os.Executable() + if err != nil { + return &Observation{}, "executable: " + err.Error() + } + cmd := exec.Command(self, args...) + var outbuf, errbuf strings.Builder + cmd.Stdout, cmd.Stderr = &outbuf, &errbuf + runErr := cmd.Run() + line := strings.TrimSpace(outbuf.String()) + if i := strings.LastIndex(line, "\n"); i >= 0 { + line = strings.TrimSpace(line[i+1:]) + } + obs := &Observation{Entries: []ObsEntry{}} + if line != "" && json.Unmarshal([]byte(line), obs) == nil { + return obs, "" + } + msg := "reader process did not report" + if runErr != nil { + msg = runErr.Error() + } + return obs, msg + ": " + tail(errbuf.String()) +} diff --git a/harbor/sources/badger-v2/task/grader/driver/observe.go b/harbor/sources/badger-v2/task/grader/driver/observe.go new file mode 100644 index 0000000000000000000000000000000000000000..76a940f9ee5bcf19d0b07dbd11b79bd9054e5d4b --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/observe.go @@ -0,0 +1,176 @@ +// Reading a directory back. +// +// Every read of a candidate directory happens in its own process. A build that +// panics on open, or that dies inside a background goroutine where no recover +// can reach it, is then an OBSERVATION — a non-zero exit with its message — +// rather than something that takes the grader down with it. +// +// What is observed is only what a user could see: the error Open returned, and +// the key, the version and the exact value bytes an iterator yields. Values are +// reported as a digest so that a wrong value, an empty value, and a value from +// another version are all distinguishable from the right one without carrying +// megabytes through a pipe. +package main + +import ( + "encoding/json" + "fmt" + "math" + "os" + + badger "github.com/dgraph-io/badger/v4" +) + +type ObsEntry struct { + Key string `json:"k"` + Version uint64 `json:"v"` + Digest string `json:"d"` + Len int `json:"n"` + ReadErr string `json:"e,omitempty"` +} + +type Observation struct { + OpenErr string `json:"open_err,omitempty"` + IterErr string `json:"iter_err,omitempty"` + Entries []ObsEntry `json:"entries"` +} + +func (o *Observation) state() map[string]string { + m := map[string]string{} + for _, e := range o.Entries { + m[e.Key] = e.Digest + } + return m +} + +func dump(db *badger.DB, p *Program) (*Observation, error) { + obs := &Observation{Entries: []ObsEntry{}} + read := func(txn *badger.Txn) error { + io := badger.DefaultIteratorOptions + io.PrefetchValues = false + it := txn.NewIterator(io) + defer it.Close() + for it.Rewind(); it.Valid(); it.Next() { + item := it.Item() + e := ObsEntry{Key: string(item.KeyCopy(nil)), Version: item.Version()} + v, err := item.ValueCopy(nil) + if err != nil { + e.ReadErr = err.Error() + } + e.Len = len(v) + e.Digest = vdigest(v) + obs.Entries = append(obs.Entries, e) + } + return nil + } + if p.Managed { + txn := db.NewTransactionAt(math.MaxUint64, false) + defer txn.Discard() + if err := read(txn); err != nil { + return obs, err + } + return obs, nil + } + if err := db.View(read); err != nil { + obs.IterErr = err.Error() + } + return obs, nil +} + +// runObserve opens dir and prints one Observation as JSON on stdout. It exits 0 +// whenever it managed to say something about the directory — including "Open +// refused, and here is why", which is an answer, not a failure. +func runObserve(progName, dir string, readOnly bool) int { + p := programByName(progName) + if p == nil { + fmt.Fprintf(os.Stderr, "observe: unknown program %q\n", progName) + return 2 + } + obs := &Observation{Entries: []ObsEntry{}} + db, err := openDB(p, dir, readOnly) + if err != nil { + obs.OpenErr = err.Error() + emit(obs) + return 0 + } + got, derr := dump(db, p) + if derr != nil { + got.IterErr = derr.Error() + } + if err := db.Close(); err != nil && got.IterErr == "" { + got.IterErr = "close: " + err.Error() + } + emit(got) + return 0 +} + +// runPostWrite recovers the directory read-write, writes fresh values for the +// named keys, closes, reopens, and reports what the reopened build serves. It +// is the "writes after recovery win" leg: a recovered build that cannot be +// written to, or whose new writes are invisible because its version counter came +// back too low, shows up here and nowhere else. +func runPostWrite(progName, dir string, keys []string) int { + p := programByName(progName) + if p == nil { + fmt.Fprintf(os.Stderr, "postwrite: unknown program %q\n", progName) + return 2 + } + obs := &Observation{Entries: []ObsEntry{}} + db, err := openDB(p, dir, false) + if err != nil { + obs.OpenErr = "recover: " + err.Error() + emit(obs) + return 0 + } + write := func() error { + if p.Managed { + txn := db.NewTransactionAt(math.MaxUint64-1, true) + defer txn.Discard() + for _, k := range keys { + if err := txn.Set([]byte(k), postValue(k)); err != nil { + return err + } + } + return txn.CommitAt(math.MaxUint64-1, nil) + } + return db.Update(func(txn *badger.Txn) error { + for _, k := range keys { + if err := txn.Set([]byte(k), postValue(k)); err != nil { + return err + } + } + return nil + }) + } + if err := write(); err != nil { + obs.OpenErr = "write: " + err.Error() + _ = db.Close() + emit(obs) + return 0 + } + if err := db.Close(); err != nil { + obs.OpenErr = "close: " + err.Error() + emit(obs) + return 0 + } + db2, err := openDB(p, dir, false) + if err != nil { + obs.OpenErr = "reopen: " + err.Error() + emit(obs) + return 0 + } + got, derr := dump(db2, p) + if derr != nil { + got.IterErr = derr.Error() + } + _ = db2.Close() + emit(got) + return 0 +} + +func postValue(k string) []byte { return valueBytes("post", 0, k, 4096) } + +func emit(o *Observation) { + b, _ := json.Marshal(o) + os.Stdout.Write(append(b, '\n')) +} diff --git a/harbor/sources/badger-v2/task/grader/driver/program.go b/harbor/sources/badger-v2/task/grader/driver/program.go new file mode 100644 index 0000000000000000000000000000000000000000..11c4b8334abc1b9f24f080f5f71b991b1cc72ef1 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/program.go @@ -0,0 +1,270 @@ +// Programs: the deterministic write scripts the child process replays and the +// parent simulates. +// +// A program is a list of STEPS. The child executes one step per `next` line on +// stdin and prints `ok ` on stdout after the step's commits have returned +// (with SyncWrites=true, so the bytes are on disk and fsynced before the ack). +// The parent therefore knows, without reading a single badger-internal byte, +// exactly which commits were acknowledged before it sent SIGKILL. +// +// A step holds one or more transactions. More than one means they were +// committed CONCURRENTLY by separate goroutines; such steps only ever use +// disjoint keys, and they are only used in scenarios that apply no tear (where +// the whole history must come back regardless of the order the commits landed +// in). +// +// Values are generated from the key and the transaction index by a pure +// function both sides compute, so the parent can assert on the exact bytes a +// read gives back: an empty value, or a value from the wrong version, is a +// value nobody wrote. +package main + +import ( + "crypto/sha256" + "encoding/binary" + "encoding/hex" + "fmt" +) + +type Op struct { + Key string + Del bool + Size int // value size in bytes (ignored for Del) + Ver uint64 // per-entry version, managed WriteBatch only (0 = not per-entry) +} + +// Tx is one transaction: everything in it is acknowledged together or not at +// all. Kind picks the public API used to commit it. +type Tx struct { + ID int // index in the program's flat transaction order + Kind string + Ts uint64 // commit ts (managed txn); ignored otherwise + Ops []Op +} + +const ( + kindTxn = "txn" // db.Update / NewTransactionAt+CommitAt + kindBatch = "batch" // WriteBatch (non-managed) or NewWriteBatchAt + kindMixed = "mixed" // NewManagedWriteBatch + SetEntryAt/DeleteAt at DIFFERENT versions +) + +type Step struct{ Txns []Tx } + +type Program struct { + Name string + Managed bool + Concurrent bool // some step commits in parallel => require the whole history back + MemTableSize int64 + ValueLogFileSize int64 + ValueThreshold int64 + Steps []Step +} + +func (p *Program) flat() []Tx { + var out []Tx + for _, s := range p.Steps { + out = append(out, s.Txns...) + } + return out +} + +// valueBytes is the only source of value content anywhere in this driver. +func valueBytes(prog string, txID int, key string, size int) []byte { + h := sha256.Sum256([]byte(fmt.Sprintf("journal|%s|%d|%s|%d", prog, txID, key, size))) + s := binary.LittleEndian.Uint64(h[:8]) | 1 + out := make([]byte, size) + for i := range out { + s ^= s << 13 + s ^= s >> 7 + s ^= s << 17 + out[i] = byte(s) + } + return out +} + +func vdigest(b []byte) string { + s := sha256.Sum256(b) + return hex.EncodeToString(s[:8]) +} + +// ---------------------------------------------------------------- simulation + +// simulate returns the key->value-digest map after the first n transactions of +// the program have been applied and every later one has been lost. +func (p *Program) simulate(n int) map[string]string { + st := map[string]string{} + txs := p.flat() + for i := 0; i < n && i < len(txs); i++ { + for _, op := range txs[i].Ops { + if op.Del { + delete(st, op.Key) + } else { + st[op.Key] = vdigest(valueBytes(p.Name, txs[i].ID, op.Key, op.Size)) + } + } + } + return st +} + +// everWritten is the set of (key, digest) pairs the program ever produces. Any +// observed pair outside it is a value nobody wrote. +func (p *Program) everWritten() map[string]bool { + out := map[string]bool{} + for _, tx := range p.flat() { + for _, op := range tx.Ops { + if !op.Del { + out[op.Key+"/"+vdigest(valueBytes(p.Name, tx.ID, op.Key, op.Size))] = true + } + } + } + return out +} + +// ------------------------------------------------------------------ builders + +type builder struct { + p *Program + next int +} + +func (b *builder) step(txs ...Tx) { + for i := range txs { + txs[i].ID = b.next + b.next++ + } + b.p.Steps = append(b.p.Steps, Step{Txns: txs}) +} + +func set(k string, sz int) Op { return Op{Key: k, Size: sz} } +func del(k string) Op { return Op{Key: k, Del: true} } +func setAt(k string, sz int, v uint64) Op { + return Op{Key: k, Size: sz, Ver: v} +} + +// progC1 — one value log file, filled to roughly 40% of its (pre-extended) +// length, every step pairing a value that lives in the log with an inline +// neighbour, and every step rewriting a key ten steps older. A tear anywhere in +// the data zone therefore exercises, at once: the inline neighbour of a torn +// commit, the previous version of an overwritten key, and the record boundary. +func progC1() *Program { + p := &Program{Name: "c1", MemTableSize: 1 << 20, ValueLogFileSize: 1 << 20, ValueThreshold: 1024} + b := &builder{p: p} + const n = 80 + for i := 0; i < n; i++ { + ops := []Op{ + set(fmt.Sprintf("big-%03d", i), 4096), // lives in the value log + set(fmt.Sprintf("sml-%03d", i), 200), // inline neighbour, same commit + set(fmt.Sprintf("ov-%03d", i), 3000), // first version + } + if i >= 10 { + ops = append(ops, set(fmt.Sprintf("ov-%03d", i-10), 3500)) // second version + } + b.step(Tx{Kind: kindTxn, Ops: ops}) + } + return p +} + +// progC2 — three value log files (rotation at 1 MiB), with delete-only and +// inline-only commits sprinkled after the big ones, so a tear in the LAST file +// has later commits behind it that touch neither the torn file nor the value +// log at all. Whether the history comes back as a prefix is decided by those. +func progC2() *Program { + p := &Program{Name: "c2", MemTableSize: 2 << 20, ValueLogFileSize: 1 << 20, ValueThreshold: 512} + b := &builder{p: p} + const n = 420 + for i := 0; i < n; i++ { + switch { + case i > 20 && i%7 == 0: // delete-only commit + b.step(Tx{Kind: kindTxn, Ops: []Op{del(fmt.Sprintf("big-%03d", i-20))}}) + case i > 20 && i%11 == 0: // inline-only commit + b.step(Tx{Kind: kindTxn, Ops: []Op{set(fmt.Sprintf("tiny-%03d", i), 64)}}) + default: + b.step(Tx{Kind: kindTxn, Ops: []Op{ + set(fmt.Sprintf("big-%03d", i), 4096), + set(fmt.Sprintf("sml-%03d", i), 100), + }}) + } + } + return p +} + +// progC3 — managed mode, and almost every byte of the write-ahead log belongs +// to a commit whose entries carry DIFFERENT versions from one another: eight +// entries across four versions, plus a delete of a key an earlier such commit +// wrote. Between them sit small ordinary managed commits, so a cut that lands +// inside one of the mixed commits still has whole ordinary ones behind it that +// must survive. Values are mostly inline, which is what puts the cut in the +// write-ahead log rather than the value log. +func progC3() *Program { + p := &Program{Name: "c3", Managed: true, MemTableSize: 512 << 10, ValueLogFileSize: 1 << 20, ValueThreshold: 1024} + b := &builder{p: p} + const n = 100 + ts := uint64(10) + for i := 0; i < n; i++ { + if i%2 == 0 { + base := ts + ops := []Op{ + setAt(fmt.Sprintf("mx-%03d-a", i), 1000, base+1), + setAt(fmt.Sprintf("mx-%03d-b", i), 1000, base+1), + setAt(fmt.Sprintf("mx-%03d-c", i), 1000, base+2), + setAt(fmt.Sprintf("mx-%03d-d", i), 1000, base+2), + setAt(fmt.Sprintf("mx-%03d-e", i), 2500, base+3), // above threshold: value log + setAt(fmt.Sprintf("mx-%03d-f", i), 1000, base+3), + setAt(fmt.Sprintf("mx-%03d-g", i), 1000, base+4), + setAt(fmt.Sprintf("mx-%03d-h", i), 1000, base+4), + } + if i >= 4 { + ops = append(ops, Op{Key: fmt.Sprintf("mx-%03d-a", i-4), Del: true, Ver: base + 5}) + } + b.step(Tx{Kind: kindMixed, Ops: ops}) + ts = base + 10 + } else { + b.step(Tx{Kind: kindTxn, Ts: ts, Ops: []Op{set(fmt.Sprintf("nx-%03d", i), 200)}}) + ts += 10 + } + } + return p +} + +// progC4 — eight goroutines committing at once, memtable and value log both +// rotating, killed with nothing torn. Keys are disjoint per transaction. +// +// The sizes are what make the rotation real, and they were measured rather than +// assumed: at 40 steps of 2048-byte values the value log reached 664 KB of its +// 1 MB and the write-ahead log 159 KB of its 256 KB, so neither ever rotated +// and the scenario quietly tested a single pair of files. At 60 steps of 4096 +// bytes, with a 128 KB memtable, both roll over several times — which is what +// puts value pointers into value log files that are already closed and full, +// and an immutable write-ahead log into the replay, in the one scenario that +// demands the WHOLE history back rather than a prefix. +func progC4() *Program { + p := &Program{Name: "c4", Concurrent: true, MemTableSize: 128 << 10, + ValueLogFileSize: 1 << 20, ValueThreshold: 1024} + b := &builder{p: p} + const steps, par = 60, 8 + for i := 0; i < steps; i++ { + var txs []Tx + for g := 0; g < par; g++ { + txs = append(txs, Tx{Kind: kindTxn, Ops: []Op{ + set(fmt.Sprintf("w%d-big-%03d", g, i), 4096), + set(fmt.Sprintf("w%d-sml-%03d", g, i), 400), + }}) + } + b.step(txs...) + } + return p +} + +func programByName(n string) *Program { + switch n { + case "c1": + return progC1() + case "c2": + return progC2() + case "c3": + return progC3() + case "c4": + return progC4() + } + return nil +} diff --git a/harbor/sources/badger-v2/task/grader/driver/surgery.go b/harbor/sources/badger-v2/task/grader/driver/surgery.go new file mode 100644 index 0000000000000000000000000000000000000000..75aafd71001f413ddde548afb295b9fa92fd153f --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/surgery.go @@ -0,0 +1,234 @@ +// Tearing a tail, and watching bytes. +// +// The tear knows nothing about the on-disk format. It picks a file by suffix +// (the two kinds of log the build keeps), takes a FRACTION OF THE FILE'S +// LENGTH, and either zeroes everything from there to the end — a tail of pages +// that never reached the platter — or shortens the file there. It never looks +// for a record boundary, a header, a checksum, or the last non-zero byte, +// because a grader that knew where the records were would be grading a format +// instead of a promise. +// +// The one thing it reports afterwards is whether the bytes it destroyed had +// been written to at all: a log file is created larger than the data in it, so +// a cut past the data is a cut that costs nothing, and the two cases carry +// different obligations. That number is measured AFTER the cut is chosen, never +// used to choose it. +package main + +import ( + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "os" + "path/filepath" + "sort" +) + +type FileStamp struct { + Size int64 `json:"size"` + Digest string `json:"digest"` +} + +func stampDir(dir string) (map[string]FileStamp, error) { + ents, err := os.ReadDir(dir) + if err != nil { + return nil, err + } + out := map[string]FileStamp{} + for _, e := range ents { + if e.IsDir() { + continue + } + // Sorted tables are deliberately outside the stamp. Opening a directory + // read-only reverts it to what its manifest lists, and a table the + // manifest never knew about is deleted on the way -- that is the + // released build's own behaviour, it happens with nothing torn, and it + // is not what "alters no byte" is about. No program here flushes a + // memtable (measured: the fullest write-ahead log in the set is 376 KB + // of its 1 MB), so in practice there is nothing to skip; the rule is + // written down so that a later, bigger program cannot turn badger's + // manifest bookkeeping into a red criterion. + if filepath.Ext(e.Name()) == ".sst" { + continue + } + p := filepath.Join(dir, e.Name()) + fi, err := os.Stat(p) + if err != nil { + return nil, err + } + f, err := os.Open(p) + if err != nil { + return nil, err + } + h := sha256.New() + _, cerr := io.Copy(h, f) + f.Close() + if cerr != nil { + return nil, cerr + } + out[e.Name()] = FileStamp{Size: fi.Size(), Digest: hex.EncodeToString(h.Sum(nil))} + } + return out, nil +} + +func sameStamps(a, b map[string]FileStamp) (bool, []string) { + var diff []string + for n, x := range a { + y, ok := b[n] + if !ok { + diff = append(diff, n+": gone") + continue + } + if x.Size != y.Size { + diff = append(diff, fmt.Sprintf("%s: size %d -> %d", n, x.Size, y.Size)) + } + if x.Digest != y.Digest { + diff = append(diff, n+": content changed") + } + } + for n := range b { + if _, ok := a[n]; !ok { + diff = append(diff, n+": created") + } + } + sort.Strings(diff) + return len(diff) == 0, diff +} + +// pickFile chooses the newest ("last") or oldest ("first") file with the given +// suffix. Log file names are zero-padded, so name order is age order. +func pickFile(dir, suffix, which string) (string, error) { + ents, err := os.ReadDir(dir) + if err != nil { + return "", err + } + var names []string + for _, e := range ents { + if !e.IsDir() && filepath.Ext(e.Name()) == suffix { + names = append(names, e.Name()) + } + } + if len(names) == 0 { + return "", fmt.Errorf("no %s file in %s", suffix, dir) + } + sort.Strings(names) + if which == "first" { + return filepath.Join(dir, names[0]), nil + } + return filepath.Join(dir, names[len(names)-1]), nil +} + +// regionWasWritten reports whether [off, size) holds a single non-zero byte. +func regionWasWritten(path string, off int64) (bool, error) { + f, err := os.Open(path) + if err != nil { + return false, err + } + defer f.Close() + if _, err := f.Seek(off, io.SeekStart); err != nil { + return false, err + } + buf := make([]byte, 1<<16) + for { + n, err := f.Read(buf) + for _, c := range buf[:n] { + if c != 0 { + return true, nil + } + } + if err == io.EOF { + return false, nil + } + if err != nil { + return false, err + } + } +} + +// tear applies one cut. cut is "zero" (overwrite the tail with zeroes, leaving +// the file its length) or "trunc" (shorten the file there). +func tear(path, cut string, off int64) (hitData bool, err error) { + fi, err := os.Stat(path) + if err != nil { + return false, err + } + if off < 0 { + off = 0 + } + if off > fi.Size() { + off = fi.Size() + } + hit, err := regionWasWritten(path, off) + if err != nil { + return false, err + } + switch cut { + case "trunc": + if err := os.Truncate(path, off); err != nil { + return hit, err + } + case "zero": + f, err := os.OpenFile(path, os.O_WRONLY, 0) + if err != nil { + return hit, err + } + defer f.Close() + z := make([]byte, 1<<16) + for p := off; p < fi.Size(); { + n := int64(len(z)) + if fi.Size()-p < n { + n = fi.Size() - p + } + if _, err := f.WriteAt(z[:n], p); err != nil { + return hit, err + } + p += n + } + if err := f.Sync(); err != nil { + return hit, err + } + default: + return hit, fmt.Errorf("unknown cut %q", cut) + } + return hit, nil +} + +func copyDir(src, dst string) error { + if err := os.MkdirAll(dst, 0o755); err != nil { + return err + } + ents, err := os.ReadDir(src) + if err != nil { + return err + } + for _, e := range ents { + if e.IsDir() { + continue + } + in, err := os.Open(filepath.Join(src, e.Name())) + if err != nil { + return err + } + fi, err := in.Stat() + if err != nil { + in.Close() + return err + } + out, err := os.OpenFile(filepath.Join(dst, e.Name()), os.O_CREATE|os.O_TRUNC|os.O_WRONLY, fi.Mode()) + if err != nil { + in.Close() + return err + } + _, cerr := io.Copy(out, in) + in.Close() + cerr2 := out.Close() + if cerr != nil { + return cerr + } + if cerr2 != nil { + return cerr2 + } + } + return nil +} diff --git a/harbor/sources/badger-v2/task/grader/driver/verify.go b/harbor/sources/badger-v2/task/grader/driver/verify.go new file mode 100644 index 0000000000000000000000000000000000000000..1da63e22f381cf31dc042f91a1538d6e1a6085fe --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/driver/verify.go @@ -0,0 +1,155 @@ +// The judgement. +// +// One question decides almost everything: is what the reopened build serves +// equal to what the program would have produced if some number of its +// acknowledged commits, counted from the front, had happened and every later +// one had not? +// +// Asking it that way is what lets the tear stay format-blind. The grader does +// not need to know where the cut landed, which commit straddled it, or how many +// bytes of a record survived. It only needs the answer to be SOME prefix. A +// build that keeps half a transaction, or that drops one commit and keeps the +// next, or that serves a value nobody ever wrote for that key, answers "no +// prefix" — and it answers it the same way whatever the cut point was. +package main + +import ( + "fmt" + "sort" +) + +type Judgement struct { + NumTxns int `json:"num_txns"` + Boundary int `json:"boundary"` // largest prefix that matches; -1 = no prefix does + FirstBad int `json:"first_bad"` // txn where the state first stopped matching + MinDiff int `json:"min_diff"` // fewest mismatching keys over all prefixes + Diffs []string `json:"diffs,omitempty"` + Phantoms []string `json:"phantoms,omitempty"` + ReadErrs []string `json:"read_errs,omitempty"` + Overwrite int `json:"overwrites_rolled_back"` +} + +// judge walks the program forward, keeping a running count of how many keys the +// simulated state disagrees with the observation on. Every prefix whose count +// is zero is a legal history; the longest one is the boundary. +func judge(p *Program, obs *Observation) Judgement { + want := obs.state() + txs := p.flat() + j := Judgement{NumTxns: len(txs), Boundary: -1, FirstBad: -1, MinDiff: 1 << 30} + + state := map[string]string{} + diff := len(want) // empty state disagrees on every observed key + if diff == 0 { + j.Boundary, j.MinDiff = 0, 0 + } else if diff < j.MinDiff { + j.MinDiff = diff + } + for i, tx := range txs { + for _, op := range tx.Ops { + old := state[op.Key] + var nw string + if !op.Del { + nw = vdigest(valueBytes(p.Name, tx.ID, op.Key, op.Size)) + } + if old == nw { + continue + } + obsv := want[op.Key] + if old == obsv { + diff++ + } + if nw == obsv { + diff-- + } + if nw == "" { + delete(state, op.Key) + } else { + state[op.Key] = nw + } + } + if diff < j.MinDiff { + j.MinDiff = diff + } + if diff == 0 { + j.Boundary = i + 1 + } else if j.FirstBad < 0 { + j.FirstBad = i + } + } + + // Values nobody wrote, and reads that failed outright. + ever := p.everWritten() + for _, e := range obs.Entries { + if e.ReadErr != "" { + j.ReadErrs = append(j.ReadErrs, fmt.Sprintf("%s: %s", e.Key, e.ReadErr)) + } + if !ever[e.Key+"/"+e.Digest] { + j.Phantoms = append(j.Phantoms, fmt.Sprintf("%s: %d bytes not written by any commit", e.Key, e.Len)) + } + } + sort.Strings(j.Phantoms) + sort.Strings(j.ReadErrs) + if len(j.Phantoms) > 12 { + j.Phantoms = append(j.Phantoms[:12], fmt.Sprintf("... and %d more", len(j.Phantoms)-12)) + } + + // How many keys a lost commit had overwritten: these are the keys whose + // earlier value has to come back. Reported for the record; a passing prefix + // already implies they did. + if j.Boundary >= 0 && j.Boundary < len(txs) { + kept := p.simulate(j.Boundary) + seen := map[string]bool{} + for i := j.Boundary; i < len(txs); i++ { + for _, op := range txs[i].Ops { + if _, had := kept[op.Key]; had && !seen[op.Key] { + seen[op.Key] = true + j.Overwrite++ + } + } + } + } + + // A short, readable account of the disagreement when there is no prefix. + if j.Boundary < 0 { + n := 0 + final := p.simulate(len(txs)) + for k, v := range want { + if final[k] != v { + j.Diffs = append(j.Diffs, fmt.Sprintf("%s: served a value the full history does not have", k)) + if n++; n >= 8 { + break + } + } + } + sort.Strings(j.Diffs) + } + return j +} + +// sameState reports whether an observation equals the full program's history. +func sameState(p *Program, obs *Observation) (bool, string) { + want := p.simulate(len(p.flat())) + got := obs.state() + if len(want) != len(got) { + return false, fmt.Sprintf("%d keys, expected %d", len(got), len(want)) + } + for k, v := range want { + if got[k] != v { + return false, "differs at " + k + } + } + return true, "" +} + +func sameObservation(a, b *Observation) (bool, string) { + x, y := a.state(), b.state() + if len(x) != len(y) { + return false, fmt.Sprintf("%d keys vs %d", len(x), len(y)) + } + for k, v := range x { + if y[k] != v { + return false, "differs at " + k + } + } + return true, "" +} diff --git a/harbor/sources/badger-v2/task/grader/fixtures/killed_and_whole.tar.gz b/harbor/sources/badger-v2/task/grader/fixtures/killed_and_whole.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..f924b0ba05304c216aeda0015d220f262aa7d1dd --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/fixtures/killed_and_whole.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1493ffe05f758ea41e59b8a42b8e5e307e2534ff84d26c4fd7fa018dfd91d252 +size 501098 diff --git a/harbor/sources/badger-v2/task/grader/fixtures/torn_log_with_older_ones_behind_it.tar.gz b/harbor/sources/badger-v2/task/grader/fixtures/torn_log_with_older_ones_behind_it.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..fe525bfa1979e1e66aaba97baf26c7686fef90c2 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/fixtures/torn_log_with_older_ones_behind_it.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:084f0ca0babf200047b55f2702addac5c0203bf063cde3c9f3a76cc1664e6e7c +size 1317211 diff --git a/harbor/sources/badger-v2/task/grader/fixtures/torn_value_log.tar.gz b/harbor/sources/badger-v2/task/grader/fixtures/torn_value_log.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2d76300d187308604f4b66ac660fd73dec239f0d --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/fixtures/torn_value_log.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8da672d8a0f83f69f83936eb94ce36578b81fd325c260b20d2a2745785a1f6be +size 552826 diff --git a/harbor/sources/badger-v2/task/grader/run_grading.sh b/harbor/sources/badger-v2/task/grader/run_grading.sh new file mode 100644 index 0000000000000000000000000000000000000000..7a62925e8193c8d85fe82f12eb28f33a3d325c61 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/run_grading.sh @@ -0,0 +1,353 @@ +#!/usr/bin/env bash +# Hidden grading for journal_recovery_after_unclean_stop — ONE FUNCTION PER +# CRITERION. +# +# Usage: run_grading.sh [budget_seconds] +# criterion ∈ torn_value_log_tail_keeps_transactions_whole | +# mixed_version_transaction_whole_after_tear | +# history_comes_back_as_a_prefix | +# writes_after_recovery_win | +# read_only_open_after_kill_serves_acknowledged_commits | +# read_only_open_refuses_a_torn_history | +# history_from_released_build_replays_whole | +# build_vet_and_targeted_tests_green +# +# budget_seconds is the timeout tasks.py gives this criterion. Everything +# below — the one retry, and every subprocess timeout inside the checks — is +# fitted INSIDE it, so the grader can never be the thing that runs a criterion +# out of time. +# +# WHAT IS ACTUALLY MEASURED, AND WHERE IT COMES FROM +# +# Almost everything is one program: grader/driver, a separate Go module built +# against the candidate's tree through a `replace`, using ONLY the exported +# badger API. It starts a writer child, feeds it one step at a time, and the +# child prints `ok ` after the commits of that step have returned with +# SyncWrites on. The parent kills the child with SIGKILL after an +# acknowledgement it chose — so the kill point is a property of the script and +# not of a clock — then works on copies of the directory it left behind: one +# copy per cut, each cut a fraction of a log file's LENGTH, either zeroed to the +# end or shortened there. Nothing looks for a record boundary, a header or a +# checksum: a grader that knew where the records were would be grading a format +# instead of a promise. +# +# Every verdict is then a comparison: is what the reopened build serves equal to +# what the script would have produced if some number of its acknowledged commits +# had happened and every later one had not, and did it ever serve a value nobody +# wrote? Plus, for the read-only opens, sha256 and size of every file in the +# directory before and after. +# +# The driver is built ONCE and run ONCE per grading; every criterion reads its +# own legs out of the one report (grader/tests/check_journal.py). That is what +# keeps eight criteria inside a few minutes: the expensive half — a few thousand +# synchronous commits — happens once, and the cuts are directory copies. +# +# THREE OUTCOMES, NOT TWO. 0 = PASS, 1 = FAIL (the check ran and the tree did +# not meet the criterion), 3 = GRADER FAULT (the check could not judge: the +# report is missing, the driver said it was miscalibrated, our own budget ran +# out). tasks.py refuses to score a surviving fault as a failed criterion — it +# cannot cap the run — and refuses to score it as a met one either. +# +# Grading is execution and bytes only. Nothing here reads the agent's source, +# greps for an identifier, or asks a model anything. The one thing that looks at +# source at all compares the candidate's *_test.go files against the pristine +# base checkout BYTE FOR BYTE — the ticket says add tests, do not change them — +# and that is a file comparison, not a reading. +# +# Tamper resistance: the checks, the driver and the fixtures live under /hud +# (root, mode 700); the fixtures are held-out tarballs written by a build +# compiled from a pristine base checkout that also lives outside the workspace. +# What the agent can change is the library the driver is built against — which +# is the point. + +set -u -o pipefail + +REPO_DIR=${REPO_DIR:-/workspace/repo} +GRADER_DIR=${GRADER_DIR:-/hud/grader} +BASE_SRC=${BASE_SRC:-/hud/base-src} +STATE=${GRADER_STATE_DIR:-/hud/logs/grading-state} +PYTHON_BIN=${PYTHON_BIN:-/usr/local/bin/python3} +BUDGET=${2:-600} + +# A login shell throws the image's PATH away (Debian's /etc/profile assigns it +# unconditionally), and hud's BashGrader runs `/bin/bash -lc`. So the toolchain +# is put back here rather than assumed. +export PATH=/usr/local/go/bin:${PATH:-/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin} +# Grading is offline. GOPROXY=off is not a preference: a criterion that could +# fetch a module would be measuring the network. +export GOPROXY=off GOFLAGS=-mod=mod GOTOOLCHAIN=local GOWORK=off CGO_ENABLED=1 +export GOCACHE=${GOCACHE:-/hud/gocache} # the image warms this one at build time +export GOMODCACHE=${GOMODCACHE:-/go/pkg/mod} +export GOPATH=${GOPATH:-/go} + +mkdir -p "$STATE" "$GOCACHE" 2>/dev/null || true + +DRIVER_BIN=$STATE/driver +REPORT=$STATE/report.json +FIXRESULTS=$STATE/fixture-results +LOG=$STATE/grading.log + +say() { echo "$@"; } +note() { echo " $*"; } + +# fault — the grader could not judge. Never a verdict about the tree. +fault() { echo "GRADER FAULT: $*"; exit 3; } + +# ─── the shared work: build the driver, run it once ──────────────────────── +# +# Both halves are cached in the state directory, which is shared by every +# criterion of one grading and thrown away between gradings. The criteria MUST +# run sequentially for that reason. + +build_driver() { + [ -x "$DRIVER_BIN" ] && return 0 + # A tree that does not compile fails every criterion, and it fails them as a + # verdict, not as a fault: `go build ./...` is the first thing the ticket + # asks for and the last thing a change may break. + if ! timeout $((BUDGET / 4)) go build ./... >"$STATE/candidate-build.log" 2>&1; then + note "the candidate tree does not build:" + sed 's/^/ /' "$STATE/candidate-build.log" | head -20 + return 1 + fi + # The driver is built OUTSIDE the workspace, against it. It uses only the + # exported API, so a tree that renames or rewrites anything unexported + # builds it fine; a tree that removes Open, Update, NewManagedWriteBatch or + # SetEntryAt does not, and that is a verdict too. + if ! timeout $((BUDGET / 3)) "$GRADER_DIR/driver/build_driver.sh" \ + "$REPO_DIR" "$DRIVER_BIN" "$STATE/driver-build" \ + >"$STATE/driver-build.log" 2>&1; then + note "the oracle does not build against this tree; it uses only the" + note "exported API (Open, OpenManaged, DefaultOptions, Update, View," + note "NewTransactionAt, CommitAt, NewManagedWriteBatch, SetEntryAt," + note "DeleteAt, Flush, Txn.Get, Iterator):" + sed 's/^/ /' "$STATE/driver-build.log" | head -20 + return 1 + fi + return 0 +} + +# run_driver — every scenario, once. Retried once on a fault before it is +# believed, both attempts inside the criterion's budget. +run_driver() { + [ -s "$REPORT" ] && return 0 + build_driver || return 1 + local attempt rc + for attempt in 1 2; do + rm -rf "$STATE/work" + timeout $((BUDGET / 3)) "$DRIVER_BIN" -mode=run -scenario=all \ + -work="$STATE/work" -out="$REPORT" >>"$LOG" 2>&1 + rc=$? + rm -rf "$STATE/work" + [ $rc -eq 0 ] && [ -s "$REPORT" ] && return 0 + note "the oracle did not finish on attempt $attempt (exit $rc)" + rm -f "$REPORT" + done + # rc 3 is the driver's own "I could not judge"; anything else at this point + # is our own budget or a killed process, and both are faults, not verdicts. + fault "the oracle could not complete a run: exit $rc. $(tail -3 "$LOG" 2>/dev/null | tr '\n' ' ')" +} + +# check — the legs of one criterion out of the one report. +check() { + run_driver || return 1 + "$PYTHON_BIN" "$GRADER_DIR/tests/check_journal.py" "$1" "$REPORT" + local rc=$? + [ $rc -eq 3 ] && exit 3 + return $rc +} + +# ─── criteria ────────────────────────────────────────────────────────────── + +criterion_torn_value_log_tail_keeps_transactions_whole() { + check torn_value_log_tail_keeps_transactions_whole +} + +criterion_mixed_version_transaction_whole_after_tear() { + check mixed_version_transaction_whole_after_tear +} + +criterion_history_comes_back_as_a_prefix() { + check history_comes_back_as_a_prefix +} + +criterion_writes_after_recovery_win() { + check writes_after_recovery_win +} + +criterion_read_only_open_after_kill_serves_acknowledged_commits() { + check read_only_open_after_kill_serves_acknowledged_commits +} + +criterion_read_only_open_refuses_a_torn_history() { + check read_only_open_refuses_a_torn_history +} + +# Three directories the RELEASED build wrote, torn while they were baked and +# frozen as tarballs. They are the only bytes in this grading the candidate's +# build did not produce itself, and they are the only place where "can this +# build still read what the shipped one wrote" can be asked: one value log torn +# with older, whole logs behind it, one torn with an inline neighbour in every +# commit, and one killed with nothing torn at all whose write-ahead log holds +# commits whose entries carry different versions from each other — written by a +# build that had no way to mark them. +criterion_history_from_released_build_replays_whole() { + build_driver || return 1 + rm -rf "$FIXRESULTS" "$STATE/fixtures" + mkdir -p "$FIXRESULTS" "$STATE/fixtures" || fault "cannot write to $STATE" + local tarball name dir rc any=0 + for tarball in "$GRADER_DIR"/fixtures/*.tar.gz; do + [ -e "$tarball" ] || fault "no held-out fixtures in $GRADER_DIR/fixtures" + name=$(basename "$tarball" .tar.gz) + dir=$STATE/fixtures/$name + mkdir -p "$dir" + tar -C "$dir" -xzf "$tarball" || fault "cannot unpack $name" + timeout $((BUDGET / 4)) "$DRIVER_BIN" -mode=fixcheck -dir="$dir" \ + >"$FIXRESULTS/$name.json" 2>>"$LOG" + rc=$? + # 0 = every leg green, 1 = a leg red (both are verdicts and both wrote a + # result file), 3 = the fixture itself could not be judged. + [ $rc -eq 3 ] && fault "$name: $(tail -1 "$FIXRESULTS/$name.json" 2>/dev/null)" + [ -s "$FIXRESULTS/$name.json" ] || fault "$name produced no result (exit $rc)" + any=1 + done + [ $any -eq 1 ] || fault "no held-out fixtures were run" + "$PYTHON_BIN" "$GRADER_DIR/tests/check_journal.py" \ + history_from_released_build_replays_whole "$FIXRESULTS" + rc=$? + [ $rc -eq 3 ] && exit 3 + return $rc +} + +# The gates, and the positive half they are scored with. +# +# `go build`, `go vet` and the upstream tests that pin this behaviour are green +# on an untouched checkout — they are gates, not achievements — so this +# criterion is NAMED for its gates and SCORED for the conjunction: the gates, +# the existing tests still being the ones that shipped, and a torn directory +# still coming back as a history somebody wrote. Without that last half a tree +# that changes nothing would collect the weight. +# +# The suite runs LAST of the eight (the order of the rows in tasks.py) because +# it is the one thing here that pins the container at its memory cap, and +# whatever runs after it pays for that twice. +criterion_build_vet_and_targeted_tests_green() { + local ok=0 + say "CHECK build_vet_and_targeted_tests_green" + + if timeout $((BUDGET / 6)) go build ./... >"$STATE/c8-build.log" 2>&1; then + note "GREEN go build ./..." + else + ok=1; note "RED go build ./..." + sed 's/^/ /' "$STATE/c8-build.log" | head -20 + fi + + # `go vet .` is NOT clean on the checkout this task starts from -- the + # released tree carries a dozen copylocks diagnostics in publisher.go and in + # its own tests -- so "vet is green" would be a criterion no tree could meet, + # and "vet is as green as we recorded once" would be an answer shipped inside + # the container that the criterion grades. Both trees are vetted HERE, + # seconds apart, and the question is whether the change ADDED a diagnostic. + # Line and column numbers are dropped: a patch moves lines, and moving a line + # is not a new fault. + timeout $((BUDGET / 6)) go vet . >"$STATE/c8-vet.log" 2>&1 + ( cd "$BASE_SRC" && timeout $((BUDGET / 6)) go vet . ) >"$STATE/c8-vet-base.log" 2>&1 + if "$PYTHON_BIN" "$GRADER_DIR/tests/new_vet_diagnostics.py" \ + "$STATE/c8-vet-base.log" "$STATE/c8-vet.log"; then + note "GREEN go vet . reports nothing the released tree did not report" + else + ok=1; note "RED go vet . reports diagnostics the released tree did not (above)" + fi + + # "add tests, don't change them", measured as bytes. Every _test.go file the + # base checkout shipped has to still be there and still be identical; a new + # one is free. + local changed="" + if [ -d "$BASE_SRC" ]; then + local rel + while IFS= read -r rel; do + if ! cmp -s "$BASE_SRC/$rel" "$REPO_DIR/$rel"; then + changed="$changed $rel" + fi + done < <(cd "$BASE_SRC" && find . -name '*_test.go' -type f | sed 's#^\./##') + else + fault "no pristine base checkout at $BASE_SRC to compare the tests against" + fi + if [ -z "$changed" ]; then + note "GREEN the tests that shipped are byte-for-byte the ones that shipped" + else + ok=1 + note "RED existing tests were changed or removed:$changed" + fi + + # The upstream tests that pin recovery, replay, truncation, batches and + # managed mode. No -race here: the race detector on this package is a + # memory profile, not a correctness one, and it is not what this criterion + # is about. + if GOMEMLIMIT=1GiB GOMAXPROCS=2 timeout $((BUDGET / 2)) go test -p 1 -count=1 \ + -run 'TestPartialAppendToWAL|TestReadOnlyOpenWithPartialAppendToWAL|TestTruncateVlog|TestValueLogTruncate|TestSync|TestWriteBatch|TestManaged' \ + . >"$STATE/c8-test.log" 2>&1; then + note "GREEN the upstream tests that pin recovery, truncation, batches and managed mode" + else + ok=1; note "RED the upstream tests that pin recovery, truncation, batches and managed mode" + sed 's/^/ /' "$STATE/c8-test.log" | tail -30 + fi + + # The positive half: one torn directory, recovered. + run_driver || return 1 + local half + half=$("$PYTHON_BIN" - "$REPORT" <<'PY' +import json, sys +r = json.load(open(sys.argv[1])) +s = r.get("scenarios", {}).get("c1") +if not s: + print("FAULT no c1"); raise SystemExit +for v in s.get("variants", []): + if v.get("hit_written_bytes"): + legs = v.get("legs", {}) + good = legs.get("history_is_a_prefix") and legs.get("no_value_nobody_wrote") + print(("GREEN " if good else "RED ") + v["name"]) + break +else: + print("FAULT no cut landed in written bytes") +PY +) + case "$half" in + GREEN*) note "GREEN a torn value log still comes back as a history somebody wrote (${half#GREEN })" ;; + RED*) ok=1; note "RED a torn value log does not come back as a history somebody wrote (${half#RED })" ;; + *) fault "the positive half could not be read: $half" ;; + esac + + say "verdict: $([ $ok -eq 0 ] && echo PASS || echo FAIL)" + return $ok +} + +# ─── dispatcher ──────────────────────────────────────────────────────────── +# +# The order in tasks.py is the order they run in, and it is part of the budget: +# the criterion that runs the repo's own suite goes LAST, so nothing pays for +# the memory it holds. The two blockers go first, on an empty state directory, +# so that the one build and the one oracle run are paid for by the criteria that +# matter most and are cached for the rest. +CRITERIA="torn_value_log_tail_keeps_transactions_whole \ +mixed_version_transaction_whole_after_tear history_comes_back_as_a_prefix \ +writes_after_recovery_win read_only_open_after_kill_serves_acknowledged_commits \ +read_only_open_refuses_a_torn_history history_from_released_build_replays_whole \ +build_vet_and_targeted_tests_green" + +name="${1:-}" +case " $CRITERIA " in + *" $name "*) + cd "$REPO_DIR" || fault "no candidate tree at $REPO_DIR" + "criterion_$name" + rc=$? + case $rc in + 0) echo "CRITERION $name: PASS"; exit 0 ;; + 3) echo "CRITERION $name: GRADER FAULT"; exit 3 ;; + *) echo "CRITERION $name: FAIL"; exit 1 ;; + esac + ;; + *) + echo "usage: run_grading.sh ; one of: $CRITERIA" >&2 + exit 2 + ;; +esac diff --git a/harbor/sources/badger-v2/task/grader/tests/check_journal.py b/harbor/sources/badger-v2/task/grader/tests/check_journal.py new file mode 100644 index 0000000000000000000000000000000000000000..eeb4454925b5e0b6a880df40817c5465f61885f0 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/tests/check_journal.py @@ -0,0 +1,272 @@ +"""The verdict for one criterion, read out of the driver's report. + +The driver (grader/driver) does all of the work: it writes a database with the +candidate's own build, kills the writer where the script says, tears a log at a +fraction of its length, reopens the copy read-only and read-write, and records +one boolean per QUESTION per cut — a "leg". This file does no measuring at all. +It selects the legs that belong to a criterion, requires every one of them, and +prints a half-by-half block that says which half went red and which halves are +green, with the numbers behind them. + +That division is deliberate. A criterion here is a CONJUNCTION, and a name can +overclaim on its own: "read-only refuses a torn history" is green on an +untouched checkout, because an untouched checkout refuses to open read-only +after any kill at all. Every conjunction is therefore named for the whole of +itself and carries the positive half of the sentence it comes from — the same +directory has to come back read-write as a prefix — so that no criterion can be +met by a build that does nothing, and so that a reader of the trace is never +told that an intact half is broken. + + check_journal.py [] + +Exit code is the verdict: 0 = the criterion is met, 1 = it is not, 3 = the +grader could not judge (a missing report, a driver fault, a scenario that never +ran). Three outcomes, never two: a fault is not a failed criterion. +""" + +from __future__ import annotations + +import json +import sys +from pathlib import Path + +# ── what each criterion is made of ───────────────────────────────────────── +# +# Every group names the scenarios it reads, which of their cuts it reads, and +# the legs it requires of each. `select` is one of: +# +# all every cut of the scenario, plus the one variant that applies none +# hit the cuts that landed in bytes the writer had actually written +# miss the cuts that landed past them (a tail of a pre-extended file that +# never held anything) and the runs with no cut at all +# +# The hit/miss split is the whole shape of the contract. A cut that destroyed +# written bytes costs the commits behind it and nothing else; a cut that +# destroyed nothing costs nothing at all, and the whole history is owed. Those +# are different obligations and they are never scored together. +# +# THE READ-ONLY LEGS OF THE HIT CUTS LIVE IN ONE CRITERION ONLY, and it is +# neither of the blockers. A cut can land exactly on a record boundary — the +# writer zeroes the next header itself, and the file is pre-extended — and such +# a directory is byte-for-byte what a plain kill leaves behind, so no build can +# tell the two apart and none can be required to refuse it. Measured, that is +# about one cut in a hundred. It is priced at 0.06 on purpose. + +SPEC: dict[str, dict] = { + "torn_value_log_tail_keeps_transactions_whole": { + "blurb": "a torn value log tail costs whole commits and nothing else", + "scenario_legs": {"c1": ["the_build_accepts_every_commit"]}, + "groups": [ + {"scenarios": ["c1"], "select": "all", "legs": [ + "reopens_read_write", + "history_is_a_prefix", + "no_value_nobody_wrote", + "earlier_version_comes_back", + ]}, + # The cuts that destroyed nothing are part of THIS criterion on + # purpose. "Some prefix" is satisfied by the empty history, so a + # build that answers every suspicion by throwing the log away would + # otherwise collect a blocker for losing everything. It cannot: a + # cut that hit no written byte owes the whole history back. + {"scenarios": ["c1"], "select": "miss", "legs": [ + "nothing_lost_when_the_cut_missed", + ]}, + ], + }, + "mixed_version_transaction_whole_after_tear": { + "blurb": "a commit whose entries carry different versions from each " + "other survives a tear whole or not at all", + "scenario_legs": {"c3": ["the_build_accepts_every_commit"]}, + "groups": [ + {"scenarios": ["c3"], "select": "all", "legs": [ + "reopens_read_write", + "history_is_a_prefix", + "no_value_nobody_wrote", + "earlier_version_comes_back", + ]}, + {"scenarios": ["c3"], "select": "miss", "legs": [ + "nothing_lost_when_the_cut_missed", + ]}, + ], + }, + "history_comes_back_as_a_prefix": { + "blurb": "commits behind the damage — deletes, inline-only commits, and " + "values in older logs — decide whether it is a prefix", + "scenario_legs": {"c2": ["the_build_accepts_every_commit"]}, + "groups": [ + {"scenarios": ["c2"], "select": "all", "legs": [ + "reopens_read_write", + "history_is_a_prefix", + "no_value_nobody_wrote", + "keys_in_the_older_logs_survive", + ]}, + {"scenarios": ["c2"], "select": "miss", "legs": [ + "nothing_lost_when_the_cut_missed", + ]}, + ], + }, + "writes_after_recovery_win": { + "blurb": "a recovered build takes a write and serves it across a close " + "and a reopen", + "scenario_legs": {"c7": ["the_build_accepts_every_commit"]}, + "groups": [ + {"scenarios": ["c7"], "select": "all", "legs": [ + "reopens_read_write", + "history_is_a_prefix", + "no_value_nobody_wrote", + "writes_after_recovery_win", + ]}, + ], + }, + "read_only_open_after_kill_serves_acknowledged_commits": { + "blurb": "opened read-only after a kill that destroyed nothing, the " + "build serves the whole history and writes nothing", + "scenario_legs": {"c4": ["the_build_accepts_every_commit"]}, + "groups": [ + {"scenarios": ["c4"], "select": "all", "legs": [ + "read_only_follows_the_rule", + "read_only_alters_no_byte", + "history_is_a_prefix", + "read_only_and_read_write_agree", + ]}, + {"scenarios": ["c1", "c2", "c3"], "select": "miss", "legs": [ + "read_only_follows_the_rule", + "read_only_alters_no_byte", + ]}, + ], + }, + "read_only_open_refuses_a_torn_history": { + "blurb": "opened read-only on a history it cannot serve whole, the " + "build says so and alters no byte — and the same directory " + "still recovers read-write into a prefix", + "groups": [ + {"scenarios": ["c1", "c2", "c3"], "select": "hit", "legs": [ + "read_only_follows_the_rule", + "read_only_alters_no_byte", + # The positive half of the same sentence. Refusing is free on an + # untouched checkout — it refuses every read-only open after a + # kill — so the criterion is named and scored for the whole of + # it: refuse the torn one, leave it alone, and still recover it. + "history_is_a_prefix", + "no_value_nobody_wrote", + ]}, + ], + }, +} + +FIXTURE_CRITERION = "history_from_released_build_replays_whole" + + +def load(path: Path) -> dict: + try: + return json.loads(path.read_text()) + except Exception as exc: # noqa: BLE001 - any failure here is a fault + fault(f"cannot read the driver report at {path}: {exc}") + + +def fault(msg: str) -> None: + print(f"GRADER FAULT: {msg}") + sys.exit(3) + + +def select(scen: dict, how: str) -> list[dict]: + out = [] + for v in scen.get("variants", []): + if v.get("name") == "writer": # the writer never got through its script + return [v] + hit = bool(v.get("hit_written_bytes")) + if how == "all" or (how == "hit" and hit) or (how == "miss" and not hit): + out.append(v) + return out + + +def check_report(criterion: str, report: dict) -> int: + spec = SPEC[criterion] + scenarios = report.get("scenarios") or {} + if report.get("fault"): + fault(report["fault"]) + + needed = {s for g in spec["groups"] for s in g["scenarios"]} + needed |= set(spec.get("scenario_legs", {})) + for name in sorted(needed): + if name not in scenarios: + fault(f"the driver never ran scenario {name}") + + print(f"CHECK {criterion}") + print(f" {spec['blurb']}") + ok = True + + for name, legs in sorted(spec.get("scenario_legs", {}).items()): + for leg in legs: + value = scenarios[name].get("legs", {}).get(leg) + if value is None: + fault(f"scenario {name} reported no {leg}") + ok = ok and value + print(f" {'GREEN' if value else 'RED '} {leg:<38} scenario {name}") + + for group in spec["groups"]: + for name in group["scenarios"]: + scen = scenarios[name] + chosen = select(scen, group["select"]) + if not chosen: + fault(f"scenario {name} produced no {group['select']} cuts; " + f"the scenario is miscalibrated") + for leg in group["legs"]: + bad = [v["name"] for v in chosen if not v.get("legs", {}).get(leg, False)] + good = len(chosen) - len(bad) + ok = ok and not bad + detail = "" + if bad: + detail = " <- " + ", ".join(bad[:6]) + (" ..." if len(bad) > 6 else "") + print(f" {'GREEN' if not bad else 'RED '} {leg:<38} " + f"{good}/{len(chosen)} {group['select']} cuts of {name}{detail}") + for v in chosen: + for note in v.get("notes", []) or []: + print(f" {name}/{v['name']}: {note}") + + print(f"verdict: {'PASS' if ok else 'FAIL'}") + return 0 if ok else 1 + + +def check_fixtures(results_dir: Path) -> int: + files = sorted(results_dir.glob("*.json")) + if not files: + fault(f"no fixture results in {results_dir}") + print(f"CHECK {FIXTURE_CRITERION}") + print(" three directories the released build wrote, torn while they were " + "baked, replayed by this one") + ok = True + for path in files: + res = load(path) + if res.get("fault"): + fault(f"{path.name}: {res['fault']}") + legs = res.get("legs") or {} + if not legs: + fault(f"{path.name}: the fixture check reported no legs") + red = sorted(k for k, v in legs.items() if not v) + ok = ok and not red + print(f" {'GREEN' if not red else 'RED '} {res.get('fixture', path.stem):<34} " + f"cut_in_written_bytes={str(bool(res.get('hit_written_bytes'))).lower():<5} " + f"commits_back={res.get('judge', {}).get('boundary')}/{res.get('acked')} " + f"(at least {res.get('min_boundary')} were still there)" + + (" <- " + ", ".join(red) if red else "")) + for note in res.get("notes", []) or []: + print(f" {note}") + print(f"verdict: {'PASS' if ok else 'FAIL'}") + return 0 if ok else 1 + + +def main() -> int: + if len(sys.argv) < 3: + print(__doc__) + return 2 + criterion, arg = sys.argv[1], Path(sys.argv[2]) + if criterion == FIXTURE_CRITERION: + return check_fixtures(arg) + if criterion not in SPEC: + fault(f"unknown criterion {criterion}") + return check_report(criterion, load(arg)) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/harbor/sources/badger-v2/task/grader/tests/new_vet_diagnostics.py b/harbor/sources/badger-v2/task/grader/tests/new_vet_diagnostics.py new file mode 100644 index 0000000000000000000000000000000000000000..3cd55ce54dd14c9881ef8f3716372b5912bd5f94 --- /dev/null +++ b/harbor/sources/badger-v2/task/grader/tests/new_vet_diagnostics.py @@ -0,0 +1,55 @@ +"""Diagnostics `go vet` reports on the candidate that it does not report on the +released tree. + + new_vet_diagnostics.py + +Prints the new ones and exits 1 if there are any; exits 0 when there are none. + +There is no recorded baseline anywhere in this grader, and this is the file that +would have held one. The checkout this task starts from does not vet clean — a +dozen copylocks diagnostics in publisher.go and in the repo's own tests — so +"vet is green" is a bar no tree could clear, and a recorded list of the ones +that were there on the day the image was built is an ANSWER SHIPPED INSIDE THE +CONTAINER that the criterion grades. Both trees are therefore vetted at grading +time, seconds apart, and only the difference is a verdict. + +File positions are dropped and the file's directory with them: a patch moves +lines, and a moved line is not a new fault. +""" + +from __future__ import annotations + +import re +import sys + +LINE = re.compile(r"^([^\s:]+\.go):\d+:\d+:\s*(.*)$") + + +def diagnostics(path: str) -> set[str]: + out: set[str] = set() + try: + text = open(path, errors="replace").read() + except OSError: + return out + for line in text.splitlines(): + m = LINE.match(line.strip()) + if m: + out.add(m.group(1).rsplit("/", 1)[-1] + ": " + m.group(2)) + return out + + +def main() -> int: + if len(sys.argv) != 3: + print(__doc__) + return 2 + was, now = diagnostics(sys.argv[1]), diagnostics(sys.argv[2]) + added = sorted(now - was) + for d in added[:12]: + print(" " + d) + if len(added) > 12: + print(f" ... and {len(added) - 12} more") + return 1 if added else 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/harbor/sources/badger-v2/task/prompt.md b/harbor/sources/badger-v2/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..277ed75ab8bfd9e75bc1f15544695638fd753b32 --- /dev/null +++ b/harbor/sources/badger-v2/task/prompt.md @@ -0,0 +1,9 @@ +# What the journal gives back + +After an unclean stop — a killed process, a torn tail on a log — the build reopens and +serves whole transactions only: every commit it had acknowledged, none in part, and never +a later one without every earlier one. A read never answers with a value nobody wrote. +Opened read-only after such a stop, the build serves that same history when it can serve +it whole, and otherwise says why it cannot; either way it alters no byte. This holds +however the transaction was committed and whatever the value's size. Work offline; the +existing tests stay as green as you found them — add tests, don't change them. diff --git a/harbor/sources/badger-v2/tasks.py b/harbor/sources/badger-v2/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..f605c72bf02640e0cd776014f7b874020401c084 --- /dev/null +++ b/harbor/sources/badger-v2/tasks.py @@ -0,0 +1,396 @@ +"""journal_recovery_after_unclean_stop on the coding-template. + +Reads like a scoreboard: + +- GRADERS is the single list of ALL criteria: (name, weight, blocker, kind, + timeout); every entry maps to a function in grader/run_grading.sh (and the + hidden checks it runs). Grading is entirely execution- and byte-identity-based + — a writer is killed with SIGKILL after an acknowledgement it chose, a log is + torn at a fraction of its length, the directory is reopened read-only and + read-write, every key is read back and every file is hashed — with no LLM + judge anywhere in the loop. The subscore you see in the trace viewer is the + name you grep for in the grader. +- The task template runs them sequentially over the coding-template's hermetic + repo lifecycle (vault -> capture diff -> reset -> re-apply). They have to run + sequentially: they share one workspace, one built oracle and one report. +- A criterion has three outcomes, not two. PASS and FAIL are verdicts about the + change; GRADER FAULT is the grader admitting it could not judge. A fault is + never scored as a failed criterion — it cannot cap the run — and it is never + scored as a met one either, because "break the fixture and collect the weight" + is otherwise the cheapest way past a hard criterion (see `_absolve_faults`). A + run with a fault in it comes back with isError set and has to be re-run: + a number that was not measured is not a measurement. + +``validate_mode="golden"`` grades the baked /hud/gold.diff instead of the +agent's edits (maintainer-only gold validation). +""" + +from __future__ import annotations + +from decimal import Decimal +from pathlib import Path + +from hud.graders import BashGrader, EvaluationResult, SubScore, combine + +from coding import repo as repo_lib +from env import LOGS_DIR, REPO_DIR, VAULT_DIR, WORKSPACE_NOTE, env, _setup + +PROMPT = (Path(__file__).parent / "task" / "prompt.md").read_text() +GRADER = "/hud/grader/run_grading.sh" +GOLD_DIFF = Path("/hud/gold.diff") + +# On blocker failure the reward is capped FLAT: a store that hands back half a +# transaction after a crash, or that loses a commit whose entries carried +# different versions from one another, is not shippable however polished the +# rest is. Any number of failed blockers sets the same ceiling — the cap never +# drops below 0.60, which is the rule, and staged subtraction that would push it +# lower is deliberately not done here. The gradient below the cap is preserved, +# so what separates two wrong answers is which criteria they actually met. +BLOCKER_CAP = 0.60 + +# ─── ALL graders: name, weight, blocker?, kind, timeout ─────────────────── +# Every grader: name == function in run_grading.sh == hidden check it runs. +# +# Every criterion is red on an untouched checkout, ONE BY ONE, and that is +# measured rather than asserted: the image refuses to build unless the whole +# board is green on the reference solution and red on the released tree, +# criterion by criterion (Dockerfile.hud, step 9). Three of the eight would be +# free on a tree that changes nothing if they were named for their negative half +# alone — "read-only refuses a torn history" is true of a build that refuses +# every read-only open there is, and `go build`/`go vet`/the upstream tests are +# green before anyone touches anything — so each of those is scored for the +# WHOLE sentence it comes from, positive half included, and the hidden check +# prints which half went red. +# +# WHERE THE WEIGHT IS, AND WHY +# +# The two blockers are the two ways this can be wrong that no amount of polish +# excuses, and they are independent: one is about a value pointer into a +# destroyed tail (a torn value log, 0.25), the other about a commit whose +# entries carry different versions from one another surviving whole (0.19). +# A build can get either one right while getting the other wrong — measured, in +# the calibration ladder: `m6_memtable_only` keeps the second and loses the +# first; `m3_markers_naive` keeps the first and loses the second — so they are +# not one criterion cut in half. +# +# Two criteria are deliberately CHEAP because an open pull request upstream +# (#2331, "handle empty .mem/.vlog during Open()") describes the read-only +# symptom and half of a recipe for it in public. Nothing in this task is that +# pull request — an empty file is not a pre-extended tail with data in it, and +# no fixture or scenario here ever creates a zero-length log — but the site and +# the mode are shared, so `read_only_open_after_kill_serves_acknowledged_commits` +# is 0.10 and `read_only_open_refuses_a_torn_history` is 0.06 instead of the +# 0.14/0.10 the mechanism would otherwise carry. The weight moved to the two +# uncontaminated legs (the prefix, 0.16, and writes after recovery, 0.12). +# +# `read_only_open_refuses_a_torn_history` is ALSO the only criterion that holds +# the read-only legs of the cuts that destroyed written bytes, and it is priced +# for that: a cut can land exactly on a record boundary, where a torn directory +# is byte-for-byte what a plain kill leaves behind and no build can be required +# to tell them apart. Measured, about one cut in a hundred. At 0.06 that flake +# costs 0.06 and can never touch a blocker. +# +# THE ORDER IS THE EXECUTION ORDER, and it is part of the budget. The two +# blockers come first, on an empty state directory, so the one oracle build and +# the one oracle run are paid for by the criteria that matter most and cached +# for the rest. `build_vet_and_targeted_tests_green` goes LAST because it is the +# only thing here that runs the repo's own suite, and whatever follows a suite +# pays for the memory it held. +# +# The arithmetic below is enforced at import (see the assertions) and again at +# image build time by test_weights_and_faults.py: the weights sum to 1.0000 +# exactly, in Decimal, because a float sum of eight literals is not 1.0 and the +# platform normalises a table that does not sum to one without saying so. +WEIGHTS = { + "torn_value_log_tail_keeps_transactions_whole": Decimal("0.25"), + "mixed_version_transaction_whole_after_tear": Decimal("0.19"), + "history_comes_back_as_a_prefix": Decimal("0.16"), + "writes_after_recovery_win": Decimal("0.12"), + "read_only_open_after_kill_serves_acknowledged_commits": Decimal("0.10"), + "read_only_open_refuses_a_torn_history": Decimal("0.06"), + "history_from_released_build_replays_whole": Decimal("0.06"), + "build_vet_and_targeted_tests_green": Decimal("0.06"), +} +BLOCKERS = frozenset({ + "torn_value_log_tail_keeps_transactions_whole", + "mixed_version_transaction_whole_after_tear", +}) + +# The literal table the platform and every offline tool read. It is written out +# in full rather than generated from WEIGHTS above, because calibrate.py, +# mutprobe.py and test_weights_and_faults.py read it out of this file by AST — +# tasks.py is the one and only place the scoreboard is written down, and a +# computed table would be invisible to all three. The assertions below are what +# keep the two copies from ever drifting apart. +GRADERS = [ + ("torn_value_log_tail_keeps_transactions_whole", 0.25, True, "bash", 600), + ("mixed_version_transaction_whole_after_tear", 0.19, True, "bash", 600), + ("history_comes_back_as_a_prefix", 0.16, False, "bash", 600), + ("writes_after_recovery_win", 0.12, False, "bash", 600), + ("read_only_open_after_kill_serves_acknowledged_commits", 0.10, False, "bash", 600), + ("read_only_open_refuses_a_torn_history", 0.06, False, "bash", 600), + ("history_from_released_build_replays_whole", 0.06, False, "bash", 600), + ("build_vet_and_targeted_tests_green", 0.06, False, "bash", 900), +] + +# ─── the scoreboard's arithmetic, checked where it is written ────────────── +# Every one of these has been got wrong in prose while looking right, so they +# are executed on import: a tasks.py that breaks one of them cannot even be +# loaded, let alone deployed. +assert [n for n, _w, _b, _k, _t in GRADERS] == list(WEIGHTS), \ + "GRADERS and WEIGHTS list different criteria, or list them in a different order" +assert all(Decimal(str(w)) == WEIGHTS[n] for n, w, _b, _k, _t in GRADERS), \ + "a weight in GRADERS disagrees with the Decimal table above it" +assert all(b == (n in BLOCKERS) for n, _w, b, _k, _t in GRADERS), \ + "a blocker flag in GRADERS disagrees with BLOCKERS" +assert sum(WEIGHTS.values()) == Decimal("1.0000"), \ + f"the weights sum to {sum(WEIGHTS.values())}, not 1.0000" +assert all(w > 0 for w in WEIGHTS.values()), "a criterion carries no weight" +assert len(WEIGHTS) >= 6, "fewer than six criteria" +# §1.A + B-1: at least one blocker; no single blocker over 0.30; the blocking +# mass under 0.75; and what is left when the worst blocker fails — 1.00 minus +# the heaviest blocker — at or above 0.60, so the flat cap is a ceiling the +# board can actually reach rather than a number that hides a lower one. +assert BLOCKERS, "no blocker: a board with nothing that must be right is not a board" +assert all(WEIGHTS[n] <= Decimal("0.30") for n in BLOCKERS), "a blocker is worth more than 0.30" +assert sum(WEIGHTS[n] for n in BLOCKERS) <= Decimal("0.75"), "the blocking mass is over 0.75" +assert Decimal("1.00") - max(WEIGHTS[n] for n in BLOCKERS) >= Decimal("0.60"), \ + "one failed blocker would leave less than 0.60 on the board" +assert BLOCKER_CAP >= 0.60, "the blocker cap is below the floor" + + +# ─── grading machinery ───────────────────────────────────────────────────── + + +# run_grading.sh exits 3 when the grader could not judge — a missing fixture, +# the grader's own budget running out, a bug in the hidden checks. It is not a +# verdict about the change, and it is retried three times with a longer budget +# before it gets this far. +GRADER_FAULT_EXIT = 3 + + +def _absolve_faults(subscores) -> dict[str, str]: + """Take every criterion the grader could not judge off the agent's bill. + + A fault used to reach the platform as an ordinary non-zero exit, which is to + say as a failed criterion, which is to say — for the three blocking ones — + as a capped reward. Measured in the mutation probe: four of ten trees took a + zero on `reclaim_fresh` for a fixture that did not settle inside a fixed + five minutes under nine parallel graders, and one of them took a phantom + blocker failure that turned 0.860 into 0.600. Gold and base, run on an idle + machine, faulted zero times, so what the number tracked was the load on the + machine and not the tree. + + So a faulted criterion is STRUCK FROM THE BLOCKER SET — the grader broke, so + it cannot cap anything — and the whole result is returned with isError set, + because a run with a fault in it has not been measured and a number that was + not measured must not be read as one. Re-run it. + + What it is NOT is scored 1.0, which is what this used to do, and that was a + channel rather than a kindness. Measured on the platform, run 8d578573: the + retry ladder did not fit the criterion's timeout, `reclaim_fresh` came back + `timed_out`, and the run was handed 0.12 of reward for a criterion nothing + had judged — reported as 1.000. "Break the grader's fixture and collect the + weight" is a strictly better strategy than meeting the criterion whenever the + criterion is hard, and isError does not close it: the platform published that + 1.000 with isError already set. + + So: a faulted criterion is scored 0.0 and its weight is simply not earned. + The normalised figure §5.3 asks for — what the run scored over the weight + that WAS measured — is computed and reported in the info block, because it + is the number a human re-reading the trace wants; it is deliberately not the + reward, because renormalising also pays for a broken fixture. It pays + whenever the unmeasured criterion would have scored below the run's average, + which is exactly the criterion an agent would choose to break. Arithmetic, + on the recorded mutation matrix, is in faultprobe.py. + """ + faults: dict[str, str] = {} + for score in subscores: + info = score.info or {} + if info.get("timed_out"): + why = f"the criterion did not finish inside {info.get('timeout')}s" + elif info.get("exit_code") == GRADER_FAULT_EXIT: + why = _fault_reason(info.get("stdout") or "") + else: + continue + faults[score.name] = why + score.value = 0.0 + # The subscore now reads red, so it has to say why in the one place a + # reader of the trace will look next: it is not a failed criterion. + score.info = {**info, "grader_fault": why, + "note": "NOT MEASURED, not failed: the grader could not judge " + "this criterion. It cannot cap the run (it is struck " + "from the blocker set) and it earns nothing. The run " + "is flagged isError and has to be re-run."} + return faults + + +def _measured_scale(subscores, faults) -> tuple[float, float]: + """(weight that was measured, reward expressed over that weight). + + Reported, never returned as the reward — see `_absolve_faults`. + """ + weights = {name: weight for name, weight, _b, _k, _t in GRADERS} + measured = sum(w for n, w in weights.items() if n not in faults) + if measured <= 0: + return 0.0, 0.0 + earned = sum( + weights[s.name] * s.value for s in subscores + if s.name in weights and s.name not in faults + ) + return measured, earned / measured + + +def _fault_reason(stdout: str) -> str: + for line in reversed(stdout.splitlines()): + stripped = line.strip().lstrip("| ").strip() + if stripped.startswith("GRADER FAULT"): + return stripped[: 300] + return "the grader reported a fault with no reason in its tail" + + +def _slim_metadata(subscores) -> None: + """Bound subscore metadata so the grade frame stays small.""" + for score in subscores: + meta = getattr(score, "metadata", None) + if not meta: + continue + params = meta.get("_parameters") + if isinstance(params, dict): + for key in ("answer", "question"): + if key in params and isinstance(params[key], str) and len(params[key]) > 300: + params[key] = f"({key} elided; {len(params[key])} chars)" + for key in ("stdout", "stderr"): + value = meta.get(key) + if isinstance(value, str) and len(value) > 2500: + meta[key] = "…" + value[-2500:] + + +async def _grade(validate_mode: str | None) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + diff = GOLD_DIFF.read_text() + elif validate_mode == "base": + diff = "" # the untouched checkout, graded as it is + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult( + reward=0.0, content="patch failed to apply", info={"git_apply": apply_error} + ) + + subscores: list[SubScore] = [] + for name, weight, _blocker, _kind, timeout in GRADERS: + subscores.append( + await BashGrader.grade( + weight, + name=name, + # The criterion's timeout is passed to the grader, which fits its + # retry ladder and every subprocess inside the hidden checks into + # it. One number, read from one table, so the ladder and the + # timeout cannot drift apart — which is exactly how a run came + # back `timed_out` with a free 0.12 on it. + command=f"bash {GRADER} {name} {timeout}", + cwd=str(REPO_DIR), + timeout_seconds=timeout, + ) + ) + + faults = _absolve_faults(subscores) + _slim_metadata(subscores) + result = await combine(*subscores) + + failed = sorted( + (name, weight) + for name, weight, blocker, _kind, _t in GRADERS + if blocker + and name not in faults + and next(s.value for s in subscores if s.name == name) < 1.0 + ) + # A blocker the grader could not judge is not a blocker the tree passed. It + # is not reported as failed — reporting a fault as a failed criterion is what + # turned mut-timer's 0.860 into a 0.600 with a blocker failure it never had — + # but the ceiling stays on, because lifting it is what a broken fixture would + # otherwise buy: a tree that passes everything weighted and would fail a gate + # goes from 0.60 to 1.00 by making that gate unjudgeable. faultprobe.py walks + # every possible outcome vector and every subset of faults; this is the term + # that takes the largest gain from +0.40 to zero. + unproven = sorted(n for n, _w, blocker, _k, _t in GRADERS if blocker and n in faults) + if faults: + measured_weight, over_measured = _measured_scale(subscores, faults) + return EvaluationResult( + reward=result.reward if not failed and not unproven + else max(0.0, min(result.reward, BLOCKER_CAP)), + subscores=result.subscores, + isError=True, + info={ + **result.info, + "grader_faults": faults, + "failed_blockers": [n for n, _w in failed], + "unproven_blockers": unproven, + "measured_weight": round(measured_weight, 4), + "reward_over_measured_weight": round(over_measured, 4), + }, + content=( + "GRADER FAULT: this run was not graded. " + + "; ".join(f"{name}: {why}" for name, why in faults.items()) + + f". A fault is the grader failing to judge, not the change failing " + f"a criterion: nothing here is reported as a failed criterion. It is " + f"not reported as a met one either — a criterion that was not measured " + f"earns nothing, and a blocker that was not measured keeps the " + f"{BLOCKER_CAP:.2f} ceiling on" + + (f" ({', '.join(unproven)} was not proven)" if unproven else "") + + f". {measured_weight:.2f} of the 1.00 was measured, and over that " + f"weight the run scored {over_measured:.3f}. This run has to be " + f"re-run; do not read the reward as a measurement." + ), + ) + if failed: + reward = max(0.0, min(result.reward, BLOCKER_CAP)) + names = [name for name, _weight in failed] + return EvaluationResult( + reward=reward, + subscores=result.subscores, + info={ + **result.info, + "uncapped_reward": result.reward, + "failed_blockers": names, + "blocker_cap": BLOCKER_CAP, + }, + content=( + f"Blocker criteria failed ({', '.join(names)}); " + f"cap {BLOCKER_CAP:.2f}, reward {reward:.3f} " + f"(uncapped {result.reward:.3f})." + ), + ) + return result + + + + +@env.template( + id="journal_recovery_after_unclean_stop", + description=( + "After an unclean stop — a killed process, a torn tail on a log — a " + "badger build has to reopen and serve whole transactions only: every " + "commit it acknowledged, none in part, never a later one without every " + "earlier one, and never a value nobody wrote. Opened read-only it " + "serves that same history when it can serve it whole, says why it " + "cannot when it cannot, and alters no byte either way." + ), +) +async def journal_recovery_after_unclean_stop(validate_mode: str | None = None): + if validate_mode not in (None, "golden", "base"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + if validate_mode in ("golden", "base"): + _ = yield "Validation run: no work is expected of you. Finish immediately." + else: + _ = yield f"{WORKSPACE_NOTE}\n\n{PROMPT}" + yield await _grade(validate_mode) + + +tasks = [journal_recovery_after_unclean_stop()] diff --git a/harbor/sources/badger-v2/test_weights_and_faults.py b/harbor/sources/badger-v2/test_weights_and_faults.py new file mode 100644 index 0000000000000000000000000000000000000000..3b68903669c9c7c2af2085cd048c6ac3d17a52b1 --- /dev/null +++ b/harbor/sources/badger-v2/test_weights_and_faults.py @@ -0,0 +1,248 @@ +"""The weight rules and the fault rule, made executable. + +None of this needs a machine: it is arithmetic over the table in tasks.py, which +is exactly the arithmetic that decides whether the task is shippable, and every +one of these has been got wrong in prose while looking right. + + uv run --with pytest pytest test_weights_and_faults.py -q + +What is pinned: + + * the weights sum to 1.0000 — in Decimal, because eight float literals do not + sum to one and the platform renormalises a table that does not, silently, so + the effective weights then differ from the published ones; + * §1.A and B-1: at least one blocker, no single blocker over 0.30, the + blocking mass at or under 0.75, at least six criteria, no criterion worth + 0.00, BLOCKER_CAP at or above 0.60, and — as a RESULT rather than a + constant — a tree that fails exactly one blocker still landing on the cap; + * a criterion the grader could not judge is never reported as a failed + criterion, and never earns its weight either. Both halves are load-bearing: + reporting a fault as a failure once turned a 0.860 into a 0.600 with a + blocker failure the tree never had, and scoring one as met paid an earlier + platform run a free 0.12 for a criterion nothing had judged; + * a blocker that was not measured keeps the ceiling on, which is what stops + "break the fixture of the gate you would fail" from being worth +0.40; + * the criteria in the table are the criteria in the grader — same names, a + function each, all dispatchable — and the grader is handed the timeout the + table names, so the two cannot drift apart; + * the two copies of the scoreboard inside tasks.py (the Decimal table the + assertions read and the literal table every offline tool reads by AST) say + the same thing. + +tasks.py cannot be imported outside the image (it pulls in the platform SDK), so +the table is read out of it by AST — the same way calibrate.py and mutprobe.py +read it, which is the point: the arithmetic they use is the arithmetic that is +tested here. +""" + +import ast +import sys +from decimal import Decimal +from pathlib import Path + +import pytest + +sys.path.insert(0, str(Path(__file__).parent)) + +import mutprobe as M # noqa: E402 + +HERE = Path(__file__).parent +# In the package the grader lives at task/grader; in the image the Dockerfile +# copies it to /hud/grader beside this file. Both are the same bytes, and this +# test runs in both places (step 5 of the image build is `pytest` on this file). +GRADER_DIR = HERE / "task" / "grader" +if not GRADER_DIR.exists(): + GRADER_DIR = HERE / "grader" +GRADERS, CAP = M.load_table() +BLOCKING = [(n, w) for n, w, b in GRADERS if b] +TASKS_SRC = (HERE / "tasks.py").read_text() +GRADER_SH = (GRADER_DIR / "run_grading.sh").read_text() +CHECK_PY = (GRADER_DIR / "tests" / "check_journal.py").read_text() + + +def results(**overrides): + """Every criterion green unless named.""" + return {n: overrides.get(n, True) for n, _w, _b in GRADERS} + + +def full_table(): + tree = ast.parse(TASKS_SRC) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GRADERS" for t in node.targets): + return ast.literal_eval(node.value) + raise AssertionError("tasks.py no longer defines GRADERS") + + +TABLE = full_table() + + +# ─── the weights ─────────────────────────────────────────────────────────── + +def test_weights_sum_to_one_exactly_in_decimal(): + total = sum(Decimal(str(w)) for _n, w, _b in GRADERS) + assert total == Decimal("1.00"), total + + +def test_there_are_at_least_six_criteria(): + assert len(GRADERS) >= 6 + + +def test_no_criterion_is_worth_nothing(): + for name, weight, _b in GRADERS: + assert weight > 0, name + + +def test_there_is_at_least_one_blocker(): + assert BLOCKING, "a board with nothing that must be right is not a board" + + +def test_no_single_blocker_is_worth_more_than_thirty_percent(): + for name, weight in BLOCKING: + assert weight <= 0.30 + 1e-9, (name, weight) + + +def test_the_blocking_mass_is_under_three_quarters(): + assert sum(w for _n, w in BLOCKING) <= 0.75 + 1e-9 + + +def test_blocker_cap_is_not_below_sixty_percent(): + assert CAP >= 0.60 + + +def test_failing_any_one_blocker_still_scores_the_cap(): + # The arithmetic gate, checked as a RESULT and not as a constant: fail + # exactly one blocker, pass everything else, and the reward must be >= 0.60. + # With the flat cap that means landing exactly ON it. + for name, weight in BLOCKING: + final, uncapped, failed = M.reward(results(**{name: False}), GRADERS, CAP) + assert failed == [name] + assert uncapped == pytest.approx(1.0 - weight) + assert final == pytest.approx(CAP), ( + f"one failed blocker ({name}) scored {final}, not the {CAP} cap") + + +def test_the_two_blockers_are_not_one_criterion_cut_in_half(): + # They are scored separately because they are lost separately: the + # calibration ladder holds a control that keeps each one while losing the + # other. If that ever stops being true they should be merged, and merging + # them would break the 0.30 rule above — which is the point of testing it + # here rather than trusting the prose. + assert len(BLOCKING) == 2 + for name, _w in BLOCKING: + assert f"criterion_{name}()" in GRADER_SH + + +def test_the_decimal_table_and_the_literal_table_agree(): + # tasks.py writes the scoreboard down twice on purpose — a Decimal mapping + # the assertions read, and the literal list every offline tool reads by AST. + # This is the test that keeps the two copies honest. + tree = ast.parse(TASKS_SRC) + weights = None + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "WEIGHTS" for t in node.targets): + weights = { + ast.literal_eval(k): Decimal(ast.literal_eval(v.args[0])) + for k, v in zip(node.value.keys, node.value.values) + } + assert weights, "tasks.py no longer defines WEIGHTS" + assert list(weights) == [n for n, _w, _b, _k, _t in TABLE] + for name, weight, _b, _k, _t in TABLE: + assert Decimal(str(weight)) == weights[name], name + assert sum(weights.values()) == Decimal("1.0000") + + +# ─── the fault rule ──────────────────────────────────────────────────────── + +def test_a_fault_is_not_reported_as_a_failed_criterion(): + name = GRADERS[-1][0] + _f, _u, failed = M.reward(results(**{name: False}), GRADERS, CAP, [name]) + assert failed == [] + blocker = BLOCKING[0][0] + _f, _u, failed = M.reward(results(**{blocker: False}), GRADERS, CAP, [blocker]) + assert failed == [], "a faulted blocker must not be reported as a failed one" + + +def test_a_fault_does_not_earn_its_weight(): + name = GRADERS[-1][0] + weight = dict((n, w) for n, w, _b in GRADERS)[name] + assert weight > 0 + honest, _u, _f = M.reward(results(**{name: False}), GRADERS, CAP) + faulted, _u, _f = M.reward(results(**{name: False}), GRADERS, CAP, [name]) + assert faulted == pytest.approx(honest), "breaking a fixture paid weight" + passed, _u, _f = M.reward(results(), GRADERS, CAP) + faulted_pass, _u, _f = M.reward(results(), GRADERS, CAP, [name]) + assert faulted_pass == pytest.approx(passed - weight) + + +def test_an_unproven_blocker_keeps_the_ceiling(): + # Striking a faulted blocker from the blocker set also lifts the cap unless + # something holds it down, and a tree that passes everything weighted and + # would fail a blocker then goes from the cap to nearly 1.00 by making that + # blocker unjudgeable. + for blocker, _weight in BLOCKING: + honest, _u, failed = M.reward(results(**{blocker: False}), GRADERS, CAP) + assert failed == [blocker] and honest == pytest.approx(CAP) + faulted, _u, failed = M.reward( + results(**{blocker: False}), GRADERS, CAP, [blocker]) + assert failed == [] + assert faulted <= CAP + 1e-9, ( + f"a blocker that was not measured lifted the cap ({blocker})") + + +def test_breaking_every_fixture_at_once_is_worth_nothing(): + everything, _u, _f = M.reward(results(), GRADERS, CAP) + nothing, _u, _f = M.reward(results(), GRADERS, CAP, [n for n, _w, _b in GRADERS]) + assert nothing == 0.0 and everything == pytest.approx(1.0) + + +# ─── the table and the grader are the same board ─────────────────────────── + +def test_the_criteria_in_the_table_are_the_criteria_in_the_grader(): + for name, _w, _b, _k, _t in TABLE: + assert f"criterion_{name}()" in GRADER_SH, f"{name} has no function" + assert name in GRADER_SH.split("CRITERIA=")[1], f"{name} is not dispatchable" + + +def test_every_criterion_is_defined_in_the_checks_or_in_the_shell(): + # Six of the eight are leg selections over the one oracle report and live in + # check_journal.py; the fixtures criterion is named there too; the gates are + # the shell function itself. + for name, _w, _b, _k, _t in TABLE: + assert name in CHECK_PY or f"criterion_{name}()" in GRADER_SH, name + + +def test_tasks_hands_the_criterion_timeout_to_the_grader(): + # One number, from the table the weights come from, so the timeouts inside + # the grader and the timeout the platform enforces cannot drift apart. + assert "{GRADER} {name} {timeout}" in TASKS_SRC + assert "BUDGET=${2:-" in GRADER_SH + + +def test_every_subprocess_the_grader_starts_is_inside_the_budget(): + # Nothing in the grader may run unbounded: every external command it starts + # is wrapped in `timeout` with a share of the criterion's own budget. + for fragment in ("timeout $((BUDGET / 4))", "timeout $((BUDGET / 3))", + "timeout $((BUDGET / 2))", "timeout $((BUDGET / 6))"): + assert fragment in GRADER_SH + assert GRADER_SH.count("go test") == 1, "only one criterion may run the suite" + + +def test_the_suite_criterion_runs_last(): + # Whatever follows a suite pays for the memory it held. + assert TABLE[-1][0] == "build_vet_and_targeted_tests_green" + + +def test_the_blockers_run_first(): + # They are paid for by the one oracle build and the one oracle run, and they + # are the criteria a truncated grading must not be missing. + assert [n for n, _w, b, _k, _t in TABLE[:2] if b] == [n for n, _w in BLOCKING] + + +def test_the_grader_never_reads_the_candidates_source(): + # Grading is execution and bytes. The one comparison against source is + # `cmp` on the test files the base checkout shipped — a byte identity, not a + # reading — and there is no grep for an identifier anywhere. + for banned in ("grep -q 'func ", 'grep -q "func ', "ast.parse(open"): + assert banned not in GRADER_SH diff --git a/harbor/sources/bazel-remote-v2/Dockerfile.hud b/harbor/sources/bazel-remote-v2/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..3661acf9c496be129e95bad0e025c56aeb8b9717 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/Dockerfile.hud @@ -0,0 +1,310 @@ +# bazel-remote: disk cache byte accounting, on the coding-template. +# +# Substrate: https://github.com/buchgr/bazel-remote at the pinned base SHA (history +# vaulted at task setup by coding/repo.py), a Go toolchain, hud serve. The +# module under work is the repository root. Everything answer-key-shaped lives +# under /hud (root, mode 700): the vault, the hidden grader, the cells it +# installs into the candidate's tree, the calibration controls, the pristine +# base checkout and gold.diff. Agent shells drop to uid 1000 (setpriv), so /hud +# is unreadable from the agent side, and step 12 proves it rather than assuming +# it. +# +# The network exists while this image builds. Grading needs none: every verdict +# is one cell of one Go test file that drives the disk cache through its +# exported API in a temporary directory of its own (law K1: GOPROXY=off at +# grading time, a module cache warmed here, no service, no port). +# +# THE IMAGE DOES NOT EXIST UNLESS IT IS CALIBRATED. Step 10 grades the reference +# solution, the untouched checkout, a comment-only change and three controls +# (a lazy one-line fix, an alternative correct fix, a fix that edits the +# repository's tests) with the real grader, and fails the build unless +# gold = 1.000 with every criterion green one by one, base = 0.000 with every +# criterion red one by one, noop = 0.000, lazy < 0.50, alt >= 0.80 and the cheat +# is held at the blocker cap. + +FROM python:3.12-slim-bookworm + +ARG REPO_URL=https://github.com/buchgr/bazel-remote +ARG REPO_SHA=a69b6b5ed933234d93b489ffd216bee5bb74aa06 +# go.mod says `go 1.27.0`; GOTOOLCHAIN=local keeps go from fetching another one. +ARG GO_VERSION=1.27.0 + +# util-linux: setpriv, the privilege wall for agent shells. +# build-essential: cgo (`go test -race` needs it). +# procps: `ps`/`top` (law E-3). +RUN apt-get update && apt-get install -y --no-install-recommends \ + git curl ca-certificates util-linux patch build-essential procps \ + && rm -rf /var/lib/apt/lists/* + +# /tmp is the agent's HOME parent (AGENT_HOME=/tmp/agent-home, env.py) (law E-3). +RUN install -d -m 1777 /tmp + +# TWO INTERPRETERS, on purpose. +# /opt/hudvenv — the env process: hud pinned to the SAME version the runner +# uses (law E-3). +# /opt/agentvenv — the agent's interpreter: no hud, no platform credentials. +RUN python -m venv /opt/hudvenv \ + && /opt/hudvenv/bin/pip install --no-cache-dir "hud==0.6.15" "pytest==8.3.4" +RUN python -m venv /opt/agentvenv \ + && /opt/agentvenv/bin/pip install --no-cache-dir "pytest==8.3.4" +ENV PATH="/opt/hudvenv/bin:${PATH}" + +# ── 1. Go toolchain ───────────────────────────────────────────────────────── +RUN set -eux; \ + arch="$(dpkg --print-architecture)"; \ + curl -fsSL "https://go.dev/dl/go${GO_VERSION}.linux-${arch}.tar.gz" -o /tmp/go.tgz; \ + tar -C /usr/local -xzf /tmp/go.tgz; \ + rm /tmp/go.tgz + +ENV PATH=/usr/local/go/bin:$PATH \ + GOTOOLCHAIN=local \ + CGO_ENABLED=1 \ + GOWORK=off \ + GOFLAGS=-mod=mod \ + GOPATH=/go \ + GOMODCACHE=/go/pkg/mod \ + GOCACHE=/hud/gocache + +# PATH guard. hud's BashGrader runs `/bin/bash -lc` and an agent session is +# `env -i ... bash -l`; Debian's /etc/profile assigns PATH unconditionally, so +# the toolchain goes back on PATH from profile.d, where a login shell cannot +# lose it. World-readable by design; nothing answer-key-shaped in it. +RUN set -eux; \ + printf '%s\n' \ + 'case ":$PATH:" in' \ + ' *:/usr/local/go/bin:*) ;;' \ + ' *) PATH="/usr/local/go/bin:$PATH" ;;' \ + 'esac' \ + 'export PATH' \ + 'if [ "$(id -u)" != "0" ]; then' \ + ' : "${GOPATH:=/go}"' \ + ' : "${GOMODCACHE:=/go/pkg/mod}"' \ + ' : "${GOCACHE:=$HOME/.cache/go-build}"' \ + ' : "${GOFLAGS:=-mod=mod}"' \ + ' : "${GOPROXY:=off}"' \ + ' : "${GOTOOLCHAIN:=local}"' \ + ' : "${GOWORK:=off}"' \ + ' : "${CGO_ENABLED:=1}"' \ + ' : "${GOMEMLIMIT:=1GiB}"' \ + ' : "${GOMAXPROCS:=2}"' \ + ' export GOPATH GOMODCACHE GOCACHE GOFLAGS GOPROXY GOTOOLCHAIN GOWORK CGO_ENABLED' \ + ' export GOMEMLIMIT GOMAXPROCS' \ + 'fi' \ + > /etc/profile.d/10-go-toolchain.sh; \ + chmod 0644 /etc/profile.d/10-go-toolchain.sh; \ + bash -lc 'command -v go' | grep -q '^/usr/local/go/bin/go$' + +# ── 2. substrate repo at the pinned base commit ──────────────────────────── +RUN mkdir -p /workspace /hud/gocache \ + && git init -q /workspace/repo \ + && cd /workspace/repo \ + && git remote add origin ${REPO_URL} \ + && git fetch --depth 1 origin ${REPO_SHA} \ + && git checkout -q FETCH_HEAD \ + && git checkout -q -b main \ + && test "$(git rev-parse HEAD)" = "${REPO_SHA}" \ + && git config --system user.email "dev@localhost" \ + && git config --system user.name "dev" \ + && git config --system --add safe.directory /workspace/repo + +# ── 3. warm the module cache and the build cache ─────────────────────────── +# `go mod download all` covers test dependencies too. The module cache stays +# root-owned and read-only to uid 1000: the cells are compiled against the +# agent's tree with GOPROXY=off, and a module cache the agent could rewrite +# would change what they compile to. +RUN set -eux; \ + cd /workspace/repo; \ + go mod download all; \ + chmod -R a+rX /go; \ + { [ -f /go/pkg/mod/cache/lock ] && chmod 0666 /go/pkg/mod/cache/lock; } || true; \ + go build ./...; \ + go test -count=1 -run XXXNONE ./... >/dev/null; \ + git checkout -- go.mod go.sum; \ + test -z "$(git status --porcelain)" + +# ── 4. the pristine base checkout, kept out of the workspace ─────────────── +RUN set -eux; \ + cp -a /workspace/repo /hud/base-src; \ + rm -rf /hud/base-src/.git; \ + git -C /workspace/repo rev-parse HEAD > /hud/base_sha + +# ── 5. /hud: everything the agent must never read ────────────────────────── +# run_grading.sh at /hud/grader, its harness (spec cells, suite gate) at +# /hud/grader/harness, the calibration controls at /hud/grader/controls. +# calibrate.py reads the weights table out of tasks.py by AST and resolves it +# relative to its own directory, which is why tasks.py is at /hud too. +RUN install -d -m 700 /hud /hud/vault /hud/logs +COPY task/grader/ /hud/grader/ +COPY task/gold.diff /hud/gold.diff +COPY tasks.py /hud/tasks.py +COPY calibrate.py /hud/calibrate.py +RUN chmod +x /hud/grader/run_grading.sh + +# ── 6. the env process's own tree ────────────────────────────────────────── +WORKDIR /app +COPY env.py tasks.py pyproject.toml /app/ +COPY coding/ /app/coding/ +COPY task/prompt.md /app/task/prompt.md + +# ── 7. the board's arithmetic, as a build gate (§1.A + B-1 + G-5) ────────── +RUN set -eux; \ + /opt/hudvenv/bin/python - <<'PYEOF' +import ast, pathlib +from decimal import Decimal +src = pathlib.Path("/hud/tasks.py").read_text() +ns = {} +for node in ast.parse(src).body: + if isinstance(node, ast.Assign): + for target in node.targets: + if isinstance(target, ast.Name) and target.id in ("GRADERS", "BLOCKER_CAP", "GATE"): + ns[target.id] = ast.literal_eval(node.value) +graders, cap, gate = ns["GRADERS"], ns["BLOCKER_CAP"], ns["GATE"] +weights = {n: Decimal(str(w)) for n, w, _b, _k, _t in graders} +blockers = {n for n, _w, b, _k, _t in graders if b} +assert sum(weights.values()) == Decimal("1.0000"), sum(weights.values()) +assert all(w > 0 for w in weights.values()) +assert len(weights) >= 6, len(weights) +assert blockers +assert all(weights[n] <= Decimal("0.30") for n in blockers) +assert sum(weights[n] for n in blockers) <= Decimal("0.75") +assert min(Decimal("1.00") - max(weights[n] for n in blockers), Decimal(str(cap))) >= Decimal("0.60") +assert cap == 0.60 +assert gate in weights and gate in blockers and Decimal("0.01") <= weights[gate] <= Decimal("0.05") +assert graders[-1][0] == gate +core = [w for n, w in weights.items() if n != gate] +assert min(core) >= Decimal("0.03") and max(core) / min(core) <= Decimal("3"), (min(core), max(core)) +print("board: %d cells, sum 1.0000, blockers %s, gate %s w=%s, core corridor x%.2f" + % (len(weights), sorted(blockers), gate, weights[gate], max(core) / min(core))) +PYEOF + +# ── 8. hand the workspace to the agent, and prove the agent can build ────── +# Reproduces the agent's shell exactly — `env -i`, a PATH WITHOUT the +# toolchain, uid 1000, `bash -lc`, GOPROXY=off — and builds the module and runs +# the suite of the package the ticket is about (law E-5: green for the agent, +# not only for root). +RUN set -eux; \ + mkdir -p /tmp/agent-home/.cache/go-build; \ + chown -R 1000:1000 /workspace/repo /tmp/agent-home; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/local/bin:/usr/bin:/bin \ + HOME=/tmp/agent-home TERM=xterm \ + GOPATH=/go GOMODCACHE=/go/pkg/mod \ + GOCACHE=/tmp/agent-home/.cache/go-build \ + GOFLAGS=-mod=mod GOPROXY=off GOTOOLCHAIN=local GOWORK=off CGO_ENABLED=1 \ + bash -lc 'set -eux; cd /workspace/repo; go version; \ + go build ./...; \ + go test -count=1 ./cache/disk/... 2>&1 | tail -5'; \ + git -C /workspace/repo checkout -- go.mod go.sum; \ + test -z "$(git -C /workspace/repo status --porcelain)" + +# ── 9. the workspace is the base SHA, not the solution ───────────────────── +RUN set -eux; \ + cd /workspace/repo && git apply --check /hud/gold.diff; \ + for c in alt lazy cheat; do git apply --check /hud/grader/controls/$c.diff; done + +# ── 10. prove the grader on gold and the controls before anyone runs it ───── +# CALIB_MODE=full: gold, base, noop and the three controls over every criterion, +# the suite gate included. smoke: the same trees over the seven weighted cells +# (no suite gate), for a builder with little time; it prints SMOKE GATE OK and +# never the strings a full calibration prints. none: skip (grader unchanged). +# The output streams through tee under bash with pipefail. +ARG CALIB_MODE=full +ARG CALIB_SMOKE_CRITERIA=admitted_blob_survives_restart_with_the_same_limits,admitted_blob_is_kept_despite_stored_form_overhead,admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation,cache_dir_with_oversized_blob_still_loads_and_discards_it,logical_size_is_reported_in_plain_bytes,evicted_bytes_counter_ignores_lost_files,entry_size_summary_observes_each_entry_size + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -eux; \ + echo "builder: nproc=$(nproc) mem.max=$(cat /sys/fs/cgroup/memory.max 2>/dev/null || echo '?')"; \ + echo "calibration mode: ${CALIB_MODE}"; \ + case "${CALIB_MODE}" in full|smoke|none) ;; \ + *) echo "unknown CALIB_MODE=${CALIB_MODE}; expected full, smoke or none" >&2; exit 2 ;; esac; \ + if [ "${CALIB_MODE}" = none ]; then echo "calibration skipped on purpose"; else \ + mkdir -p /hud/.calib; \ + for t in base gold noop lazy alt cheat; do cp -a /hud/base-src /hud/.calib/$t; done; \ + ( cd /hud/.calib/gold && git init -q . && git apply /hud/gold.diff && rm -rf .git ); \ + for t in lazy alt cheat; do ( cd /hud/.calib/$t && git init -q . && git apply /hud/grader/controls/$t.diff && rm -rf .git ); done; \ + sed -i '1i // calibration control: a comment, and nothing else, has changed' \ + /hud/.calib/noop/cache/disk/lru.go; \ + grep -q 'calibration control' /hud/.calib/noop/cache/disk/lru.go; \ + cd /hud; \ + ( while sleep 60; do echo " ... calibration still running ($(date -u +%H:%M:%S)) ..."; done ) & \ + hb=$!; trap "kill $hb 2>/dev/null || true" EXIT; \ + if [ "${CALIB_MODE}" = full ]; then \ + CALIB_GRADER_DIR=/hud/grader stdbuf -oL -eL /usr/local/bin/python3 -u \ + /hud/calibrate.py gold base noop lazy alt cheat 2>&1 | tee /hud/calibration.txt; \ + grep -q 'gold: \*\*1.00\*\*' /hud/calibration.txt; \ + grep -q 'base: \*\*0.00\*\*' /hud/calibration.txt; \ + grep -q 'base: all criteria red, one by one' /hud/calibration.txt; \ + grep -q 'gold: all criteria green, one by one' /hud/calibration.txt; \ + grep -q 'CONTROLS OK' /hud/calibration.txt; \ + else \ + CALIB_GRADER_DIR=/hud/grader stdbuf -oL -eL /usr/local/bin/python3 -u \ + /hud/calibrate.py gold base noop --criteria "${CALIB_SMOKE_CRITERIA}" 2>&1 \ + | tee /hud/calibration.txt; \ + /usr/local/bin/python3 -c 'import json,sys; rows=json.load(open("/hud/.calib/calibration.json")); m={r["tree"]: r for r in rows}; sub=sys.argv[1].split(","); g=m["gold"]["results"]; b=m["base"]["results"]; bad=[c+" green on gold: NO" for c in sub if not g.get(c)]+[c+" red on base: NO" for c in sub if b.get(c)]; print("smoke subset: gold green one by one, base red one by one") if not bad else sys.exit("SMOKE GATE FAILED -- "+"; ".join(bad))' "${CALIB_SMOKE_CRITERIA}"; \ + echo 'SMOKE GATE OK (full calibration proven in the local linux build, log attached)'; \ + fi; \ + kill $hb 2>/dev/null || true; \ + /usr/local/bin/python3 -c 'import json,sys; rows=json.load(open("/hud/.calib/calibration.json")); m={r["tree"]: r for r in rows}; n=m.get("noop"); sys.exit("the comment-only tree was not graded") if not n else None; sys.exit("NOOP GATE FAILED: a comment-only change scored %.3f" % n["reward"]) if n["reward"] > 1e-9 else print("noop: 0.000 (a change that is not a change earns nothing)")'; \ + rm -rf /hud/.calib /hud/calibration.txt /hud/grader/__pycache__ /hud/__pycache__ /hud/logs/grading-state; \ + fi +SHELL ["/bin/sh", "-c"] + +# ── 11. law E-5: no root residue ──────────────────────────────────────────── +# The warm-up and the calibration ran as root. A root-owned leftover in the +# sticky /tmp can make a test the agent runs fail with EACCES for something +# nobody did, so /tmp is emptied and rebuilt here. +RUN set -eux; \ + find /tmp -mindepth 1 -maxdepth 1 -exec rm -rf {} + || true; \ + install -d -m 1777 /tmp; \ + install -d -o 1000 -g 1000 -m 0755 /tmp/agent-home /tmp/agent-home/.cache \ + /tmp/agent-home/.cache/go-build + +# ── 12. lock it down, and prove the wall from the other side ─────────────── +RUN mkdir -p /hud/vault /hud/logs \ + && chown -R root:root /hud \ + && chmod -R 700 /hud + +ENV REPO_DIR=/workspace/repo \ + VAULT_DIR=/hud/vault \ + GRADING_LOGS_DIR=/hud/logs \ + GOLD_DIFF=/hud/gold.diff \ + GRADER_DIR=/hud/grader \ + HARNESS_DIR=/hud/grader/harness \ + BASE_SRC=/hud/base-src \ + GRADER_STATE_DIR=/hud/logs/grading-state \ + PYTHON_BIN=/usr/local/bin/python3 + +# The same shell the agent gets: the answer key is unreadable (no file under +# /hud named grad*/gold* is even visible), the workspace is writable, the WHOLE +# repository suite is green at uid 1000, and the checkout is clean afterwards. +RUN set -eux; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/local/bin:/usr/bin:/bin HOME=/tmp/agent-home TERM=xterm \ + GOPATH=/go GOMODCACHE=/go/pkg/mod \ + GOCACHE=/tmp/agent-home/.cache/go-build \ + GOFLAGS=-mod=mod GOPROXY=off GOTOOLCHAIN=local GOWORK=off CGO_ENABLED=1 \ + bash -lc 'set -eu; \ + ! test -r /hud/gold.diff; \ + ! test -r /hud/grader/run_grading.sh; \ + ! test -r /hud/tasks.py; \ + test -z "$(find / -xdev \( -name "grad*" -o -name "gold*" \) -path "/hud/*" 2>/dev/null)"; \ + cd /workspace/repo; \ + touch .write-probe && rm .write-probe; \ + go test -count=1 -p 2 ./... 2>&1 | tee /tmp/agent-home/suite-uid1000.log | grep -vE "^(ok|\?) " || true; \ + ! grep -qE "^(FAIL|--- FAIL|panic:)" /tmp/agent-home/suite-uid1000.log; \ + echo "SUITE_UID1000=green ($(grep -c "^ok" /tmp/agent-home/suite-uid1000.log) packages ok)"; \ + rm -f /tmp/agent-home/suite-uid1000.log'; \ + git -C /workspace/repo checkout -- go.mod go.sum; \ + test -z "$(git -C /workspace/repo status --porcelain)"; \ + find /tmp -mindepth 1 -maxdepth 1 ! -name agent-home -exec rm -rf {} + || true + +# The ticket, pinned by content. +RUN set -eux; \ + sha256sum /app/task/prompt.md /app/tasks.py /hud/tasks.py /hud/gold.diff \ + /hud/grader/run_grading.sh /hud/grader/harness/spec/cells_test.go \ + /hud/grader/harness/suite_gate.py + +RUN chmod 600 /app/tasks.py + +# CMD is NOT inherited: without this the container starts a bare python. +CMD ["hud", "serve", "tasks.py", "--host", "0.0.0.0"] diff --git a/harbor/sources/bazel-remote-v2/calibrate.py b/harbor/sources/bazel-remote-v2/calibrate.py new file mode 100644 index 0000000000000000000000000000000000000000..9a15ee70ca3b0212967c329ba68f0a310f124b5a --- /dev/null +++ b/harbor/sources/bazel-remote-v2/calibrate.py @@ -0,0 +1,587 @@ +#!/usr/bin/env python3 +"""Calibration for the bazel-remote disk cache accounting task — runs the grader. + + python3 calibrate.py # gold and base + python3 calibrate.py gold base noop lazy alt cheat # the full ladder (the image does this) + python3 calibrate.py gold --criteria logical_size_is_reported_in_plain_bytes + +It grades a tree the way tasks.py does: run the two GATES first, then every +criterion in run_grading.sh, weight the results with the table read out of +tasks.py, and apply the flat blocker cap. A tree that fails a gate scores 0.0 +whatever its cells did — the same rule tasks.py applies. Three invariants, all +of them hard: + + gold -> 1.00 every criterion green on the reference solution + base -> 0.00 the untouched checkout + base -> red on EVERY criterion, one by one + +The third is the one that matters and the one that is easy to fake. A grader +whose baseline is zero only because an untouched tree reaches the platform as an +empty diff has not been calibrated; this runs the criteria against the untouched +checkout itself and requires each of them to fail on their own. Anything a +baseline can pass is a criterion that scores code that was already there. + +The weights table is read from tasks.py rather than duplicated, so the two can +never drift; tasks.py itself is not imported, because it pulls in the platform +SDK and this has to run anywhere. +""" + +from __future__ import annotations + +import argparse +import ast +import hashlib +import json +import os +import shutil +import subprocess +import sys +import time +from pathlib import Path + +HERE = Path(__file__).resolve().parent +# In the image this file sits at /hud beside /hud/grader, which is where the +# Dockerfile copies task/grader to; in the package tree the same grader lives at +# task/grader. CALIB_GRADER_DIR is how an author's local calibration says so, +# and it changes nothing about what is graded — the same run_grading.sh, the +# same checks, the same fixtures. +GRADER = Path(os.environ.get("CALIB_GRADER_DIR") or (HERE / "grader")) +CALIB = HERE / ".calib" +# Any tree under .calib/ can be graded. Two of them are the calibration +# invariants; the rest are the anti-noop patches (grader/antinoop), which have +# to land on their predicted colours before the grader is worth deploying. +BASE_TREE = CALIB / "base" +# Which tree plays the reference solution and which plays the untouched +# checkout. They are `.calib/gold` and `.calib/base` unless --as-gold/--as-base +# name copies of them: a re-grade that must not overwrite the rows and logs an +# earlier verdict cites still has to be held to the same three invariants, and +# before this it silently was not - a tree called anything else printed its +# reward and was checked against nothing. +ALL_GREEN, ALL_RED = "gold", "base" +EXPECTED = {ALL_GREEN: 1.00, ALL_RED: 0.00} + +# §1.A(b) — the controls besides gold/base/noop, each with the bound its reward +# must meet. lazy: the cheapest one-line change a solver could stop at. alt: a +# correct fix built by another mechanism. cheat: the reference fix plus an +# edited test the repository shipped, which the gate must catch and the blocker +# cap must hold down. +CONTROLS = { + "noop": ("==", 0.00), + "lazy": ("<", 0.50), + "alt": (">=", 0.80), + "cheat": ("<=", 0.60), +} + +# LAW G-4 (9.09): a GATE may only be a check that is GREEN ON THE PRISTINE +# CHECKOUT. A check that is red on `base` says something about the fix, which +# makes it a CRITERION; wired as a gate it turns the board into all-or-nothing +# and pays 0.0 to trees that did real work (measured: board v2 zeroed two of +# five live solutions that way). The rule is asserted below — every gate green +# on `base`, or this calibration fails and the image does not build — and this +# tuple is the list of the ones that are allowed to exist at all. A gate that is +# not in it is a design error, not a colour to be interpreted. +REPO_GATES = ("gate_repo_tests_not_removed", "gate_repo_suite_green") + + +def tree_path(name: str) -> Path: + return CALIB / name + + +def load_gates() -> list[tuple[str, int]]: + """The gates, out of the same tasks.py. They carry no weight and cannot be + traded against a criterion: a tree that fails one scores nothing.""" + tree = ast.parse((HERE / "tasks.py").read_text()) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GATES" for t in node.targets): + return [(g[0], g[1]) for g in ast.literal_eval(node.value)] + # G-5: this package has no unweighted gate. The one gate it has is a CELL + # of the board -- weighted, blocking, and zeroed by G-5' on a tree that met + # no other criterion -- so there is no GATES list to read and an empty one + # is the honest answer, not a failure. + return [] + + +def load_weighted_gate() -> str | None: + """The G-5 gate: the name of the weighted, blocking gate cell, if any.""" + tree = ast.parse((HERE / "tasks.py").read_text()) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GATE" for t in node.targets): + return ast.literal_eval(node.value) + return None + + +def load_table() -> tuple[list[tuple[str, float, bool]], float]: + """Read GRADERS and BLOCKER_CAP straight out of tasks.py.""" + tree = ast.parse((HERE / "tasks.py").read_text()) + graders, cap = None, None + for node in tree.body: + if not isinstance(node, ast.Assign): + continue + for target in node.targets: + if not isinstance(target, ast.Name): + continue + if target.id == "GRADERS": + graders = [ + (t[0], t[1], t[2]) for t in ast.literal_eval(node.value) + ] + elif target.id == "BLOCKER_CAP": + cap = ast.literal_eval(node.value) + if graders is None or cap is None: + raise SystemExit("could not read GRADERS/BLOCKER_CAP out of tasks.py") + total = sum(w for _n, w, _b in graders) + if abs(total - 1.0) > 1e-9: + raise SystemExit(f"weights sum to {total}, not 1.0") + return graders, cap + + +def apply_g5_prime(results: dict[str, bool], gate: str | None) -> dict[str, bool]: + """LAW G-5': the gate earns its weight only beside a green cell of the core. + + The gate is green on a tree nobody has touched -- that is what makes it a + gate -- so as a plain weighted cell it would pay the untouched checkout its + own weight and the ladder would read base as 0.025 instead of 0.000. tasks.py + forces it to zero when no other criterion is met; the same rule is applied + here, so that what this prints is what the platform will score. + """ + if not gate or gate not in results: + return results + core = [v for n, v in results.items() if n != gate] + if core and not any(core): + adjusted = dict(results) + adjusted[gate] = False + return adjusted + return results + + +def reward(results: dict[str, bool], graders, cap: float, + gate: str | None = None) -> tuple[float, float, list[str]]: + """The same arithmetic tasks.py does: G-5', weighted sum, then the flat cap.""" + results = apply_g5_prime(results, gate) + uncapped = sum(w for n, w, _b in graders if results.get(n)) + failed = [n for n, _w, b in graders if b and not results.get(n)] + if not failed: + return uncapped, uncapped, [] + return max(0.0, min(uncapped, cap)), uncapped, failed + + +# Files the repo's own suite regenerates in place when the tools to do so happen +# to be installed (TestProtosRegenerate calls ./gen.sh). Grading a tree must not +# leave it different from the tree that was graded, or the next run is measuring +# something else. They are snapshotted before the first criterion and put back +# after the last one. +# Nothing in this repository is regenerated in place by its own suite, so there +# is nothing to snapshot and put back after a grading. The tuple stays so that +# a file that starts being rewritten has one place to be named. +MUTABLE: tuple[str, ...] = () + + +def snapshot(tree: Path) -> dict[str, bytes]: + out = {} + for rel in MUTABLE: + f = tree / rel + if f.exists(): + out[rel] = f.read_bytes() + return out + + +def restore(tree: Path, snap: dict[str, bytes]) -> list[str]: + changed = [] + for rel, data in snap.items(): + f = tree / rel + if f.exists() and f.read_bytes() != data: + f.write_bytes(data) + changed.append(rel) + return changed + + +def load_timeouts() -> dict[str, int]: + """The per-criterion timeout out of the same GRADERS table. + + It is handed to run_grading.sh as its second argument, exactly as tasks.py + does, so that the retry ladder here is fitted to the same budget it will have + on the platform. Grading locally against a different budget than the platform + uses is how a ladder that does not fit goes unnoticed. + """ + tree = ast.parse((HERE / "tasks.py").read_text()) + for node in tree.body: + if isinstance(node, ast.Assign) and any( + getattr(t, "id", None) == "GRADERS" for t in node.targets): + return {t[0]: t[4] for t in ast.literal_eval(node.value)} + raise SystemExit("could not read GRADERS out of tasks.py") + + +TIMEOUTS = load_timeouts() + + + +def _go_env(name: str) -> str: + """The toolchain's own answer for GOPATH/GOMODCACHE. + + In the image both are ENV and this is never reached. On an author's machine + they are not, and the grader's defaults (/go, the image's layout) are a + read-only path there — which reaches the caller as a GRADER FAULT that says + nothing about the tree. + """ + if name not in _GO_ENV_CACHE: + try: + _GO_ENV_CACHE[name] = subprocess.run( + ["go", "env", name], capture_output=True, text=True, timeout=30 + ).stdout.strip() + except (OSError, subprocess.SubprocessError): + _GO_ENV_CACHE[name] = "" + return _GO_ENV_CACHE[name] + + +_GO_ENV_CACHE: dict[str, str] = {} + +def run_criterion(tree: Path, name: str, state: Path, log_dir: Path, + budget: int | None = None) -> tuple[bool, float, str]: + env = dict(os.environ) + env.update({ + "REPO_DIR": str(tree), + "HARNESS_DIR": str(GRADER), + "GRADER_STATE_DIR": str(state), + "PYTHON_BIN": sys.executable, + # In the image both of these are ENV; on an author's machine they are + # not, and /hud does not exist there. The pristine checkout the + # untouched-tests gate compares against is .calib/base locally. + "GOCACHE": os.environ.get("GOCACHE") or str(CALIB / "gocache"), + "BASE_SRC": os.environ.get("BASE_SRC") or str(BASE_TREE), + "GOPATH": os.environ.get("GOPATH") or _go_env("GOPATH"), + "GOMODCACHE": os.environ.get("GOMODCACHE") or _go_env("GOMODCACHE"), + }) + budget = budget if budget is not None else TIMEOUTS[name] + started = time.time() + proc = subprocess.run( + ["bash", str(GRADER / "run_grading.sh"), name, str(budget)], + env=env, capture_output=True, text=True, timeout=budget + 300, + ) + elapsed = time.time() - started + (log_dir / f"{name}.log").write_text(proc.stdout + "\n--- stderr ---\n" + proc.stderr) + if proc.returncode == 3: + raise SystemExit( + f"GRADER FAULT in {name} on {tree.name}:\n{proc.stdout[-4000:]}") + return proc.returncode == 0, elapsed, proc.stdout + + +def tree_digest(tree: Path) -> str: + """sha256 of a .calib tree: every tracked file, by path and content. + + `.git` is excluded because the trees are built by `cp -a base && git init && + git apply`, so the repository metadata differs between two trees that hold + the same source. + """ + h = hashlib.sha256() + for path in sorted(tree.rglob("*")): + rel = path.relative_to(tree).as_posix() + if rel == ".git" or rel.startswith(".git/"): + continue + if path.is_symlink(): + h.update(rel.encode() + b"\0symlink\0" + str(path.readlink()).encode()) + continue + if not path.is_file(): + continue + h.update(rel.encode() + b"\0") + h.update(hashlib.sha256(path.read_bytes()).digest()) + return h.hexdigest() + + +def refuse_if_it_is_base(which: str, tree: Path) -> None: + """A tree that IS the base tree cannot be graded under another name. + + An anti-noop row is a wrong ANSWER, and a wrong answer is a patched tree. + When the patch does not apply -- the file was not in the image, the hunk + went stale -- what is left in .calib/ is a byte-for-byte copy of the + untouched checkout, and grading it produces base's own row under the + patch's name: a control that measured nothing and reads as if it did. That + happened before (a control whose patch did not apply, filed as a 0.000 row), + so it is refused here rather than trusted to a caller's `set -e`. + """ + if which == ALL_RED or not BASE_TREE.exists(): + return + if tree_digest(tree) == tree_digest(BASE_TREE): + raise SystemExit( + f"refusing to grade {tree}: it is byte-for-byte the untouched " + f"checkout in {BASE_TREE}, so a row filed under '{which}' would be " + f"base's row wearing another name. If this is an anti-noop tree, " + f"its patch did not apply -- rebuild it and check `git apply`'s " + f"exit status; if it is meant to be a copy of base, grade it as " + f"'{ALL_RED}'.") + + +def calibrate(which: str, graders, cap0: float, criteria: list[str], keep: bool, + gates: list[tuple[str, int]] | None = None) -> dict: + tree = tree_path(which) + if not (tree / "go.mod").exists(): + raise SystemExit(f"no {which} tree at {tree}; see .calib/README") + refuse_if_it_is_base(which, tree) + state = CALIB / f"state-{which}" + if not keep: + shutil.rmtree(state, ignore_errors=True) + state.mkdir(parents=True, exist_ok=True) + log_dir = CALIB / f"logs-{which}" + log_dir.mkdir(parents=True, exist_ok=True) + + print(f"\n=== {which} ===") + snap = snapshot(tree) + results: dict[str, bool] = {} + timings: dict[str, float] = {} + gate_results: dict[str, bool] = {} + for gname, gbudget in (gates or []): + if criteria: + break + ok, elapsed, out = run_criterion(tree, gname, state, log_dir, gbudget) + gate_results[gname] = ok + print(f" {'PASS' if ok else 'FAIL'} {gname:<46} gate {elapsed:6.1f}s") + for line in out.splitlines(): + stripped = line.strip() + if stripped.startswith(("PASS:", "FAIL:", "GRADER FAULT")): + print(f" {stripped[:200]}") + for name, weight, blocker in graders: + if criteria and name not in criteria: + continue + ok, elapsed, out = run_criterion(tree, name, state, log_dir) + results[name] = ok + timings[name] = elapsed + flag = "blocker" if blocker else " " + print(f" {'PASS' if ok else 'FAIL'} {name:<46} w={weight:.2f} {flag} " + f"{elapsed:6.1f}s") + for line in out.splitlines(): + stripped = line.strip() + if stripped.startswith(("PASS:", "FAIL:", "GRADER FAULT")): + print(f" {stripped[:200]}") + + reverted = restore(tree, snap) + if reverted: + print(f" (grading rewrote {', '.join(reverted)}; the tree has been put back)") + + final, uncapped, failed = reward(results, graders, cap0, load_weighted_gate()) + failed_gates = sorted(n for n, ok in gate_results.items() if not ok) + if failed_gates: + final = 0.0 + print(f" -> uncapped {uncapped:.3f}, failed blockers {failed or 'none'}, " + f"failed gates {failed_gates or 'none'}, reward {final:.3f}") + return {"tree": which, "results": results, "timings": timings, + "uncapped": uncapped, "reward": final, "failed_blockers": failed, + "gates": gate_results, "failed_gates": failed_gates} + + +def build_time_gate(args, criteria: list[str]) -> bool: + """There is no build-time step left to gate. + + There used to be one: the image recorded `go vet ./...` on the pristine base + checkout into grader/baseline/vet.txt while it was being built, and this + rung proved that step could run under the builder's memory cap. Both are + gone. The vet baseline was a RECORDED ANSWER shipped inside the container + that the criterion grades — the same shape of artefact the -race suite + baseline was moved out of, and with no better defence — so it is measured at + grading time now, on both trees, minutes apart, by the criterion that + consumes it. With nothing recorded at build time, record_baseline.py and + this gate have nothing to measure, and a gate that measures nothing is a + green light that means nothing. + """ + if args.build_time_steps == "on": + print("build-time gate: there are no build-time steps in this grader any " + "more (the vet baseline is measured at grading time); nothing to run", + file=sys.stderr) + return False + print("build-time gate: not applicable — this grader records nothing at image " + "build time, so there is no step whose memory this could prove") + return True + + +def main() -> None: + global ALL_GREEN, ALL_RED, EXPECTED + ap = argparse.ArgumentParser() + ap.add_argument("trees", nargs="*", default=None, + help="gold, base, or any .calib/ tree (default: gold and base)") + ap.add_argument("--criteria", default="", + help="comma separated subset of criteria to run") + ap.add_argument("--keep-state", action="store_true", + help="reuse the built driver binaries from a previous run") + ap.add_argument("--as-gold", default=ALL_GREEN, + help="tree that plays the reference solution (default: gold)") + ap.add_argument("--as-base", default=ALL_RED, + help="tree that plays the untouched checkout (default: base)") + # Kept as a flag so that an old command line still parses, and because the + # hole it was built for is worth remembering: v6 shipped two green local + # calibrations and failed two deploys, because the calibration proved the + # CRITERIA and said nothing about a step that ran at image build time. The + # answer this round is that there is no such step any more (see + # build_time_gate above), which closes the hole rather than gating it. + ap.add_argument("--build-time-steps", choices=("auto", "on", "off"), + default="auto", + help="no build-time steps remain; kept so old invocations parse") + ap.add_argument("--build-time-headroom", type=float, default=0.15, + help="fraction of the memory cap that must be free at peak") + args = ap.parse_args() + + ALL_GREEN, ALL_RED = args.as_gold, args.as_base + EXPECTED = {ALL_GREEN: 1.00, ALL_RED: 0.00} + + graders, cap0 = load_table() + gates = load_gates() + criteria = [c for c in args.criteria.split(",") if c] + trees = args.trees or [ALL_GREEN, ALL_RED] + + if not build_time_gate(args, criteria): + sys.exit(1) + + report = [calibrate(t, graders, cap0, criteria, args.keep_state, gates) for t in trees] + out = CALIB / "calibration.json" + + # Accumulate rather than overwrite: the anti-noop patches are graded in + # their own invocations, and the file is supposed to end up holding the + # whole matrix - gold, base and every wrong answer - not whichever run + # happened to go last. + previous = [] + if out.exists(): + try: + previous = json.loads(out.read_text()) + except (ValueError, OSError): + previous = [] + merged = {e["tree"]: e for e in previous if isinstance(e, dict) and "tree" in e} + merged.update({e["tree"]: e for e in report}) + order = ["gold", "base"] + rows = ([merged[t] for t in order if t in merged] + + [e for t, e in sorted(merged.items()) if t not in order]) + out.write_text(json.dumps(rows, indent=2) + "\n") + + by_tree = {e["tree"]: e for e in report} + + # criterion -> gold -> base, the table the calibration is actually about. + if not criteria and ALL_GREEN in by_tree and ALL_RED in by_tree: + print("\n=== criterion | weight | blocker | gold | base ===") + for name, weight, blocker in graders: + g = by_tree[ALL_GREEN]["results"].get(name) + b = by_tree[ALL_RED]["results"].get(name) + print(f" {name:<46} {weight:>5.2f} {'blocker' if blocker else ' '} " + f"{'PASS' if g else 'FAIL':<5} {'PASS' if b else 'FAIL'}") + + print("\n=== calibration ===") + ok = True + for entry in report: + got = entry["reward"] + if entry["tree"] not in EXPECTED: + failed = entry["failed_blockers"] or "none" + print(f" {entry['tree']}: reward {got:.3f}, failed blockers {failed}") + continue + want = EXPECTED[entry["tree"]] + if criteria: + print(f" {entry['tree']}: reward {got:.3f} (partial run, not checked)") + continue + mark = "**%.2f**" % got + good = abs(got - want) < 1e-9 + ok = ok and good + print(f" {entry['tree']}: {mark} (expected {want:.2f}) " + f"{'OK' if good else 'MISCALIBRATED'}") + + # The invariant that a total alone cannot show: nothing an untouched + # checkout does may be worth a point, and nothing the reference solution + # does may be worth less than one. + if not criteria: + weighted_gate = load_weighted_gate() + if ALL_RED in by_tree: + green = sorted(n for n, v in by_tree[ALL_RED]["results"].items() + if v and n != weighted_gate) + # LAW G-4/G-5: the weighted gate is the ONE cell that has to be green + # on the untouched checkout (the suite is green there and nobody has + # edited a test). G-5' is what keeps it from paying for that, and it + # is asserted here as its own line rather than folded into "all red". + if weighted_gate: + gate_on_base = by_tree[ALL_RED]["results"].get(weighted_gate) + if gate_on_base is None: + pass + elif not gate_on_base: + ok = False + print(f" base: GATE RED ON THE PRISTINE CHECKOUT — " + f"{weighted_gate} (law G-4). A gate has to be green on " + f"a tree nobody has touched.") + else: + print(f" base: gate green on the untouched checkout " + f"({weighted_gate}), and worth 0.000 there (G-5')") + if green: + ok = False + print(f" base: NOT ALL RED — {', '.join(green)} passed on the " + f"untouched checkout; a criterion a baseline can pass is a " + f"criterion that scores code that was already there") + else: + print(" base: all criteria red, one by one") + if ALL_GREEN in by_tree: + red = sorted(n for n, v in by_tree[ALL_GREEN]["results"].items() if not v) + if not red and weighted_gate: + print(" gold: gates green") + if red: + ok = False + print(f" gold: NOT ALL GREEN — {', '.join(red)} failed on the " + f"reference solution") + else: + print(" gold: all criteria green, one by one") + # The gates are not criteria, but a board graded on a tree that fails one + # of them is a board nobody should read: they are asserted here too. + # + # LAW G-4, executed: a gate must be PRISTINE_GREEN. There is only one + # kind of gate now — the repo gates, which say nothing about the fix — + # and the assertion is the same on every tree: a red gate anywhere in + # {base, gold} is a build failure, and a gate that is red on `base` is + # additionally named for what it is, a criterion wearing a gate's hat. + for gname, _gbudget in (gates or []): + if gname not in REPO_GATES: + ok = False + print(f" BOARD ERROR — {gname} is wired as a gate but is not a " + f"PRISTINE_GREEN repo gate (law G-4): a check that says " + f"something about the fix is a criterion, not a gate") + for entry in report: + bad = entry.get("failed_gates") or [] + tree = entry["tree"] + if tree == ALL_RED and bad: + ok = False + print(f" base: GATE RED ON THE PRISTINE CHECKOUT — " + f"{', '.join(bad)} (law G-4). A gate has to be green on a " + f"tree nobody has touched; this one is a criterion and " + f"belongs on the board with a weight.") + elif tree in EXPECTED and bad: + ok = False + print(f" {tree}: GATE FAILED — {', '.join(bad)}") + elif bad: + print(f" {tree}: gates RED ({', '.join(bad)}) — the reward is " + f"0.0 whatever the cells scored") + elif entry.get("gates"): + if tree == ALL_RED: + print(f" base: repo gates green " + f"({', '.join(sorted(entry['gates']))})") + else: + print(f" {tree}: gates green ({', '.join(sorted(entry['gates']))})") + + if not criteria: + controls_ok = True + seen = False + for entry in report: + rule = CONTROLS.get(entry["tree"]) + if not rule: + continue + seen = True + op, bound = rule + got = entry["reward"] + good = {"==": abs(got - bound) < 1e-9, "<": got < bound, + ">=": got >= bound - 1e-9, "<=": got <= bound + 1e-9}[op] + if entry["tree"] == "cheat": + good = good and bool(entry["failed_blockers"]) + controls_ok = controls_ok and good + print(f" control {entry['tree']}: reward {got:.3f} (uncapped {entry['uncapped']:.3f}, " + f"failed blockers {entry['failed_blockers'] or 'none'}) — want {op} {bound:.2f}: " + f"{'OK' if good else 'MISCALIBRATED'}") + if seen and all(t in by_tree for t in CONTROLS): + ok = ok and controls_ok + print(" CONTROLS OK" if controls_ok else " CONTROLS FAILED") + elif seen: + ok = ok and controls_ok + + print(f"\nwritten to {out}") + sys.exit(0 if ok else 1) + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/bazel-remote-v2/coding/__init__.py b/harbor/sources/bazel-remote-v2/coding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88280a271d88bae2eb437ca5e8c172120a66f336 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/coding/__init__.py @@ -0,0 +1,5 @@ +"""The coding environment's core: repo-lifecycle primitives and task flavors.""" + +from . import repo, swe_bench_pro + +__all__ = ["repo", "swe_bench_pro"] diff --git a/harbor/sources/bazel-remote-v2/coding/github.py b/harbor/sources/bazel-remote-v2/coding/github.py new file mode 100644 index 0000000000000000000000000000000000000000..d07288e5f438181af931b88982147e86ebd1c16f --- /dev/null +++ b/harbor/sources/bazel-remote-v2/coding/github.py @@ -0,0 +1,158 @@ +"""A minimal mock GitHub for SDLC tasks. + +One in-process store holds issues (seeded per task) and the pull requests and +comments the agent creates; :func:`serve` publishes it as ``github_*`` MCP +tools over an ``mcp`` capability. The remote itself is a bare git repo on +disk (see :func:`coding.repo.create_remote`) — the agent pushes branches with +plain git and references them from pull requests here. +""" + +from __future__ import annotations + +import asyncio +import json +import socket +from dataclasses import asdict, dataclass, field +from typing import Any + +from fastmcp import FastMCP +from hud.capabilities import Capability + + +@dataclass +class Issue: + number: int + title: str + body: str + labels: list[str] = field(default_factory=list) + state: str = "open" + comments: list[str] = field(default_factory=list) + + +@dataclass +class PullRequest: + number: int + title: str + body: str + head: str + base: str + state: str = "open" + comments: list[str] = field(default_factory=list) + + +class MockGitHub: + """Issue/PR store with an action log (for rubric grading).""" + + def __init__(self) -> None: + self.issues: dict[int, Issue] = {} + self.pull_requests: dict[int, PullRequest] = {} + self.actions: list[dict[str, Any]] = [] + + def seed(self, issues: list[dict[str, Any]]) -> None: + """Reset the store to the task's fixtures.""" + self.issues = { + int(entry["number"]): Issue( + number=int(entry["number"]), + title=str(entry["title"]), + body=str(entry.get("body", "")), + labels=[str(label) for label in entry.get("labels", [])], + ) + for entry in issues + } + self.pull_requests = {} + self.actions = [] + + def _record(self, action: str, **details: Any) -> None: + self.actions.append({"action": action, **details}) + + # ─── operations (the tool surface) ──────────────────────────────── + + def list_issues(self) -> list[dict[str, Any]]: + return [asdict(issue) for issue in self.issues.values()] + + def get_issue(self, number: int) -> dict[str, Any]: + return asdict(self._issue(number)) + + def close_issue(self, number: int) -> dict[str, Any]: + issue = self._issue(number) + issue.state = "closed" + self._record("close_issue", number=number) + return asdict(issue) + + def comment_on_issue(self, number: int, body: str) -> dict[str, Any]: + issue = self._issue(number) + issue.comments.append(body) + self._record("comment_on_issue", number=number, body=body) + return asdict(issue) + + def create_pull_request(self, title: str, body: str, head: str, base: str) -> dict[str, Any]: + number = len(self.pull_requests) + 1 + pr = PullRequest(number=number, title=title, body=body, head=head, base=base) + self.pull_requests[number] = pr + self._record("create_pull_request", number=number, title=title, head=head) + return asdict(pr) + + def list_pull_requests(self) -> list[dict[str, Any]]: + return [asdict(pr) for pr in self.pull_requests.values()] + + def _issue(self, number: int) -> Issue: + if number not in self.issues: + raise ValueError(f"no such issue: #{number}") + return self.issues[number] + + # ─── grading views ──────────────────────────────────────────────── + + def latest_pull_request(self) -> PullRequest | None: + return next(reversed(self.pull_requests.values()), None) + + def transcript(self) -> str: + """Everything the agent did here, for rubric judging.""" + return json.dumps( + { + "issues": [asdict(issue) for issue in self.issues.values()], + "pull_requests": [asdict(pr) for pr in self.pull_requests.values()], + "actions": self.actions, + }, + indent=2, + ) + + +def serve(github: MockGitHub) -> tuple[asyncio.Task[None], Capability]: + """Serve *github* as ``github_*`` MCP tools; returns the server task + capability.""" + server: FastMCP = FastMCP(name="github") + + @server.tool + def github_list_issues() -> list[dict[str, Any]]: + """List all issues in the repository.""" + return github.list_issues() + + @server.tool + def github_get_issue(number: int) -> dict[str, Any]: + """Get one issue by number.""" + return github.get_issue(number) + + @server.tool + def github_close_issue(number: int) -> dict[str, Any]: + """Close an issue.""" + return github.close_issue(number) + + @server.tool + def github_comment_on_issue(number: int, body: str) -> dict[str, Any]: + """Add a comment to an issue.""" + return github.comment_on_issue(number, body) + + @server.tool + def github_create_pull_request(title: str, body: str, head: str, base: str = "main") -> dict[str, Any]: + """Open a pull request from branch *head* (already pushed to the remote) into *base*.""" + return github.create_pull_request(title, body, head, base) + + @server.tool + def github_list_pull_requests() -> list[dict[str, Any]]: + """List all pull requests.""" + return github.list_pull_requests() + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + port = int(sock.getsockname()[1]) + task = asyncio.create_task(server.run_async(transport="http", host="127.0.0.1", port=port, show_banner=False)) + return task, Capability.mcp(name="github", url=f"http://127.0.0.1:{port}/mcp") diff --git a/harbor/sources/bazel-remote-v2/coding/repo.py b/harbor/sources/bazel-remote-v2/coding/repo.py new file mode 100644 index 0000000000000000000000000000000000000000..bb675cf6f58da32de51e10bc71bdb1bc4b5057d9 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/coding/repo.py @@ -0,0 +1,172 @@ +"""Git-history vaulting and diff-based grading primitives. + +The repo's real ``.git`` may contain the answer key — solution branches, the +fix commit, the hidden tests. Every task flavor shares this lifecycle: + +- setup (:func:`vault_history`): snapshot the pre-agent worktree into the + real history, move ``.git`` into a vault outside the workspace, and leave a + fresh single-commit repo — git works normally for the agent, but there is + no history, no refs, and no remotes. +- grading (:func:`restore_history` → :func:`capture_agent_diff` → + :func:`reset_worktree` → :func:`apply_diff`): discard the agent's ``.git`` + (hooks and history included), restore the vaulted history, capture the + agent's changes as a diff against the setup snapshot, reset the worktree to + that snapshot, and re-apply the diff. Hidden tests come from vaulted refs + and land after the agent's diff. + +The snapshot covers the whole worktree, so installed dependencies and build +artifacts survive into grading. +""" + +from __future__ import annotations + +import asyncio +import os +import shutil +from pathlib import Path + +_GIT_ID = ("-c", "user.name=hud-grader", "-c", "user.email=grader@hud.ai") +_SETUP_COMMIT = "setup_commit" + + +async def run( + *argv: str, + cwd: Path, + timeout: float = 600.0, + check: bool = True, +) -> tuple[int, str, str]: + """Run a command, returning ``(returncode, stdout, stderr)``. Kills on timeout.""" + proc = await asyncio.create_subprocess_exec( + *argv, + cwd=str(cwd), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + try: + out_bytes, err_bytes = await asyncio.wait_for(proc.communicate(), timeout=timeout) + except TimeoutError: + proc.kill() + await proc.wait() + raise TimeoutError(f"{' '.join(argv[:4])} timed out after {timeout:.0f}s") from None + out = out_bytes.decode("utf-8", "replace") + err = err_bytes.decode("utf-8", "replace") + if check and proc.returncode != 0: + detail = (err.strip() or out.strip())[:2000] + raise RuntimeError(f"{' '.join(argv)} failed ({proc.returncode}): {detail}") + return proc.returncode if proc.returncode is not None else 1, out, err + + +async def git(repo: Path, *args: str, timeout: float = 600.0, check: bool = True) -> tuple[int, str, str]: + return await run("git", *_GIT_ID, *args, cwd=repo, timeout=timeout, check=check) + + +def _append_git_exclude(git_dir: Path) -> None: + """Keep the workspace's SSH credential dir out of snapshots and diffs.""" + exclude = git_dir / "info" / "exclude" + exclude.parent.mkdir(parents=True, exist_ok=True) + with exclude.open("a", encoding="utf-8") as fh: + fh.write("\n.hud/\n") + + +async def vault_history(repo: Path, vault: Path) -> None: + """Snapshot the pre-agent state, then hide the repo's history in *vault*.""" + if (vault / "git").exists(): + raise RuntimeError(f"vault {vault} already holds a history: one task per substrate") + + if hasattr(os, "geteuid") and os.geteuid() == 0: + # Grade-time git runs as root on the (chowned) agent-owned repo; git + # honors safe.directory only from system/global config, never from -c. + await run("git", "config", "--global", "--add", "safe.directory", str(repo), cwd=Path("/")) + + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: pre-agent snapshot") + _, sha, _ = await git(repo, "rev-parse", "HEAD") + + vault.mkdir(parents=True, exist_ok=True) + (vault / _SETUP_COMMIT).write_text(sha.strip(), "utf-8") + shutil.move(str(repo / ".git"), str(vault / "git")) + + await git(repo, "init", "-q", ".") + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "baseline") + + +async def create_remote(repo: Path, remote: Path, ref: str, *, branch: str = "main") -> None: + """A bare "GitHub" remote holding *ref*'s history as *branch*. + + Pushing a single ref publishes only its ancestry — sibling answer-key + branches (hidden tests, golden fix) stay unreachable, while the agent + still gets realistic past history to work with. + """ + remote.parent.mkdir(parents=True, exist_ok=True) + await git(remote.parent, "init", "-q", "--bare", "-b", branch, str(remote)) + await git(repo, "push", "-q", str(remote), f"{ref}:refs/heads/{branch}") + + +async def attach_to_remote(repo: Path, remote: Path, *, branch: str = "main") -> None: + """Point the agent's fresh repo at the remote, sharing its (sanitized) history. + + Called after :func:`vault_history`: the throwaway single-commit repo is + replaced by the remote's clone state — same worktree, but with ``origin`` + configured and history the agent can branch from and push back to. + """ + shutil.rmtree(repo / ".git") + await git(repo, "init", "-q", "-b", branch, ".") + _append_git_exclude(repo / ".git") + await git(repo, "remote", "add", "origin", str(remote)) + await git(repo, "fetch", "-q", "origin") + # Adopt the remote's history without a checkout: the worktree already + # matches (plus untracked build artifacts a checkout would refuse to + # cross), so point the branch at origin and sync only the index. + await git(repo, "update-ref", f"refs/heads/{branch}", f"refs/remotes/origin/{branch}") + await git(repo, "reset", "-q") + await git(repo, "branch", "-q", f"--set-upstream-to=origin/{branch}", branch) + + +async def restore_history(repo: Path, vault: Path) -> str: + """Swap the agent's throwaway ``.git`` for the vaulted real history. + + Returns the setup-snapshot commit sha recorded by :func:`vault_history`. + """ + agent_git = repo / ".git" + if agent_git.exists(): + shutil.rmtree(agent_git) + shutil.move(str(vault / "git"), str(agent_git)) + return (vault / _SETUP_COMMIT).read_text("utf-8").strip() + + +async def capture_agent_diff(repo: Path, setup_commit: str) -> str: + """The agent's changes: setup snapshot -> final worktree state. + + Runs on the restored real history: the final worktree (including files the + agent added) is committed and diffed against the snapshot. + """ + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: final snapshot") + _, final, _ = await git(repo, "rev-parse", "HEAD") + # --binary is mandatory: without it git emits "Binary files ... differ" for + # any binary file the agent added, and `git apply` then rejects the ENTIRE + # patch — scoring a real solution 0.0. Verified end to end. + _, diff, _ = await git( + repo, "diff", "--binary", setup_commit, final.strip(), timeout=1200.0 + ) + return diff + + +async def reset_worktree(repo: Path, setup_commit: str) -> None: + await git(repo, "reset", "--hard", setup_commit) + await git(repo, "clean", "-fd") + + +async def apply_diff(repo: Path, diff: str, patch_path: Path) -> str | None: + """Apply *diff* to the worktree; returns git's error output on failure.""" + if not diff.strip(): + return None + patch_path.parent.mkdir(parents=True, exist_ok=True) + patch_path.write_text(diff, "utf-8") + code, out, err = await git(repo, "apply", "-v", str(patch_path), check=False) + if code != 0: + return (err.strip() or out.strip())[-4000:] + return None diff --git a/harbor/sources/bazel-remote-v2/coding/swe_bench_pro.py b/harbor/sources/bazel-remote-v2/coding/swe_bench_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..da655cfc4cfaf8596fa6e18c3a47c8aad21d42d5 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/coding/swe_bench_pro.py @@ -0,0 +1,149 @@ +"""The SWE-bench Pro task flavor: dataset-row parsing and the official grading pipeline. + +An instance directory (baked into the instance image by ``swe_tasks.py``) +holds the dataset row (``instance.json``) plus the official per-instance +``run_script.sh`` and ``parser.py`` from scaleapi/SWE-bench_Pro-os. Grading +replays the official evaluator's entryscript on the repo-lifecycle primitives +in :mod:`coding.repo`: reset to the pre-agent snapshot, apply the (agent or +golden) patch, check out the hidden test files, run the script, parse, and +resolve iff every ``fail_to_pass`` and ``pass_to_pass`` test passes. +""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +from . import repo as repo_lib + + +def load_instance(instance_dir: Path) -> dict[str, Any]: + return json.loads((instance_dir / "instance.json").read_text("utf-8")) + + +def str_list(field: str) -> list[str]: + """Parse the dataset's list-shaped string fields. + + The rows store lists as Python reprs (single quotes; the official + evaluator uses ``eval``), so ``ast.literal_eval`` is the safe equivalent. + """ + value = ast.literal_eval(field) + if not isinstance(value, list): + raise ValueError(f"expected a list, got {type(value).__name__}") + return [str(item) for item in value] + + +def strip_binary_hunks(patch: str) -> str: + """Drop binary diff sections, exactly like the official evaluator.""" + if not patch: + return patch + sections = re.split(r"(?=^diff --git )", patch, flags=re.MULTILINE) + kept = [ + section + for section in sections + if section.strip() + and not re.search(r"^Binary files .* differ$", section, re.MULTILINE) + and not re.search(r"^GIT binary patch$", section, re.MULTILINE) + ] + return "".join(kept) + + +def score(instance: dict[str, Any], tests: list[dict[str, Any]]) -> EvaluationResult: + """The official resolution criterion: every required test passes.""" + passed = {t["name"] for t in tests if t.get("status") == "PASSED"} + fail_to_pass = set(str_list(instance["fail_to_pass"])) + pass_to_pass = set(str_list(instance["pass_to_pass"])) + required = fail_to_pass | pass_to_pass + resolved = required <= passed + + def fraction(subset: set[str]) -> float: + return len(subset & passed) / len(subset) if subset else 1.0 + + missing = sorted(required - passed) + return EvaluationResult( + reward=1.0 if resolved else 0.0, + content="resolved" if resolved else f"unresolved: {len(missing)} required test(s) not passing", + subscores=[ + SubScore(name="resolved", value=1.0 if resolved else 0.0, weight=1.0), + SubScore(name="fail_to_pass", value=fraction(fail_to_pass), weight=0.0), + SubScore(name="pass_to_pass", value=fraction(pass_to_pass), weight=0.0), + ], + info={"tests_reported": len(tests), "missing": missing[:20]}, + ) + + +def build_prompt(instance: dict[str, Any], repo_dir: Path) -> str: + sections = [ + f"You are working in {repo_dir}, a checkout of the {instance['repo']} repository. " + "Resolve the issue described below by modifying the code. Hidden tests grade your " + "work when you finish; do not modify existing tests.", + instance["problem_statement"], + ] + if instance.get("requirements"): + sections.append("## Requirements\n\n" + instance["requirements"]) + if instance.get("interface"): + sections.append("## Interface\n\n" + instance["interface"]) + return "\n\n".join(section.strip() for section in sections if section and section.strip()) + + +async def grade( + instance: dict[str, Any], + instance_dir: Path, + repo_dir: Path, + vault_dir: Path, + logs_dir: Path, + *, + validate_mode: str | None = None, + tests_timeout: float = 3600.0, +) -> EvaluationResult: + """Replay the official evaluator's entryscript in place. + + ``validate_mode="golden"`` grades the dataset's golden patch instead of + the agent's diff (the official gold-patch sanity check). The hidden test + files (the last line of ``before_repo_set_cmd``) are checked out *after* + the patch, so patch edits to them never survive. + """ + logs_dir.mkdir(parents=True, exist_ok=True) + setup_commit = await repo_lib.restore_history(repo_dir, vault_dir) + + if validate_mode == "golden": + diff = instance["patch"] + else: + diff = await repo_lib.capture_agent_diff(repo_dir, setup_commit) + diff = strip_binary_hunks(diff) + + await repo_lib.reset_worktree(repo_dir, setup_commit) + apply_error = await repo_lib.apply_diff(repo_dir, diff, logs_dir / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + + test_checkout = instance["before_repo_set_cmd"].strip().splitlines()[-1] + await repo_lib.run("bash", "-c", test_checkout, cwd=repo_dir) + + files_csv = ",".join(str_list(instance["selected_test_files_to_run"])) + _, out, err = await repo_lib.run( + "bash", + str(instance_dir / "run_script.sh"), + files_csv, + cwd=repo_dir, + timeout=tests_timeout, + check=False, + ) + (logs_dir / "stdout.log").write_text(out, "utf-8") + (logs_dir / "stderr.log").write_text(err, "utf-8") + await repo_lib.run( + sys.executable, + str(instance_dir / "parser.py"), + "stdout.log", + "stderr.log", + "output.json", + cwd=logs_dir, + ) + tests = json.loads((logs_dir / "output.json").read_text("utf-8"))["tests"] + return score(instance, tests) diff --git a/harbor/sources/bazel-remote-v2/env.py b/harbor/sources/bazel-remote-v2/env.py new file mode 100644 index 0000000000000000000000000000000000000000..b0402852e6179d1fb06ad545715fefeb60e4cb63 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/env.py @@ -0,0 +1,456 @@ +"""Coding environment (HUD v6): a repo workspace with diff-based grading. + +The env publishes one ``ssh`` workspace over a git repo; the agent's harness +brings its own bash/file tools. Task setup vaults the repo's real history +(:mod:`coding.repo`) so the agent gets a fresh single-commit repo with working +git but no answer-key refs; grading captures the agent's changes as a diff, +resets to the pre-agent snapshot, re-applies, brings in the hidden tests, and +runs them. + +Three task templates: + +- ``coding-task`` — hidden tests live as refs in the repo's vaulted history + (the ``{task}_baseline`` / ``{task}_test`` / ``{task}_golden`` branch + convention) and a shell command scores by exit code. Runs locally (clones + ``REPO_URL`` per process) or from an image that bakes the repo. +- ``sdlc-task`` — adds workflow: a bare mock-GitHub remote the agent pushes + to, ``github_*`` issue/PR tools (:mod:`coding.github`), and grading over + the pushed pull-request branch instead of the worktree. +- one SWE-bench Pro instance template, registered only when an instance dir + is baked in (see ``swe_tasks.py``): grading replays the official evaluator + (:mod:`coding.swe_bench_pro`). + +Images set ``REPO_DIR``; locally everything lives in per-process temp dirs. +The image substrate here is buchgr/bazel-remote (Go; the module under work is the +repository root, with a few dozen dependencies), so the agent's Go environment +is declared explicitly on the workspace — see ``AGENT_GO_ENV``. +The vault, the hidden grader, the held-out fixtures, the pristine base +checkout and gold.diff sit outside the workspace — under ``/hud`` (root, mode +700) in images — and agent shells drop to a non-root uid, so only the env +process can read them. + +The task this env carries is +``bazel_remote_disk_eviction_accounting_contract``, registered in ``tasks.py``; +the three generic templates below come with the coding-template and are unused +here. +""" + +from __future__ import annotations + +import asyncio +import logging +import os +import shutil +import tempfile +from pathlib import Path +from typing import Any + +from hud.environment import Environment, Workspace +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine +from hud.settings import settings + +from coding import repo as repo_lib +from coding import swe_bench_pro as swe +from coding.github import MockGitHub +from coding.github import serve as serve_github + +logger = logging.getLogger(__name__) + +# ─── substrate layout ──────────────────────────────────────────────────── +# Images set REPO_DIR (and ship the repo); locally everything lives in +# per-process temp dirs and the repo is cloned from REPO_URL at startup. + +_explicit_repo = os.environ.get("REPO_DIR") +if _explicit_repo: + REPO_DIR = Path(_explicit_repo) + VAULT_DIR = Path(os.environ.get("VAULT_DIR", "/hud/vault")) + LOGS_DIR = Path(os.environ.get("GRADING_LOGS_DIR", "/hud/logs")) + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / "hud-coding" + REPO_DIR = _LOCAL_ROOT / f"repo-{os.getpid()}" + VAULT_DIR = _LOCAL_ROOT / f"vault-{os.getpid()}" + LOGS_DIR = _LOCAL_ROOT / f"logs-{os.getpid()}" + _LOCAL_SUBSTRATE = True + +# The SDLC flavor's mock-GitHub remote: a bare repo the agent pushes to. It +# must be writable by the agent, so it lives outside /hud. +REMOTE_DIR = ( + Path(os.environ.get("REMOTE_DIR", "/srv/git/project.git")) + if _explicit_repo + else _LOCAL_ROOT / f"remote-{os.getpid()}" / "project.git" +) + +REPO_URL = os.environ.get("REPO_URL", "https://github.com/buchgr/bazel-remote") +TESTS_TIMEOUT = float(os.environ.get("GRADING_TIMEOUT", "3600")) + +INSTANCE_DIR = Path(os.environ.get("INSTANCE_DIR", "/hud/instance")) + +AGENT_UID = 1000 +AGENT_HOME = Path("/tmp/agent-home") # noqa: S108 - container-local, created at setup + +env = Environment(name="ec-swe-bazel-remote-disk-eviction-accounting") + + +# The agent's Go environment, and why it is spelled out here rather than left +# to the image's ENV. +# +# When shell_uid drops privileges, hud does NOT hand the session the serving +# process's environment: Workspace._session_env() builds a minimal one from +# scratch (PATH, HOME, TERM) and layers this dict on top, precisely so a +# secret the env process holds cannot leak into the agent's shell. So every +# `ENV GO...` line in the Dockerfile reaches the grader and never the agent. +# +# That is harmless for a repo with no dependencies. bazel-remote has a few dozen +# (grpc, prometheus, zstd, cloud SDKs, ...): with GOPATH left at its default the +# agent's module cache would be $HOME/go — empty — and with GOPROXY=off +# `go build ./...` would fail on the first import. The task would be impossible +# for reasons that have nothing to do with the ticket. +# +# GOPATH points at the module cache the image pre-populated. It is root-owned +# and read-only to uid 1000 on purpose: the grader compiles its own harness +# against the agent's tree with GOPROXY=off, and a module cache the agent +# could rewrite would be a way to change what that harness compiles. GOCACHE +# is the one Go directory the agent must be able to write, so it sits in the +# agent's HOME (pre-warmed at image build). +AGENT_GO_ENV = { + "GOPATH": os.environ.get("AGENT_GOPATH", "/go"), + "GOMODCACHE": os.environ.get("AGENT_GOMODCACHE", "/go/pkg/mod"), + "GOCACHE": str(AGENT_HOME / ".cache" / "go-build"), + "GOFLAGS": "-mod=mod", + "GOPROXY": "off", + "GOTOOLCHAIN": "local", + "GOWORK": "off", + # cgo on, and gcc in the image: parts of this module (and `go test -race`, + # which an agent may well reach for) refuse to build without it. An agent + # that cannot run the commands it is graded by is being graded on something + # it could not see. + "CGO_ENABLED": "1", + # ── memory, not difficulty ──────────────────────────────────────────── + # MEASURED 2026-09-08 on an earlier package: three of five rollouts in a + # 300-step final died with metadata.container_oom_killed=True, i.e. the + # harness lost the run before the grader ever saw a tree. This module is + # smaller than that one, but the box is the same, so the ceiling stays. The container's memory limit cannot be + # raised from this package (hud/eval/runtime/hud.py::_runtime_session -- + # declared `limits` on an already-deployed env raise ValueError, and + # cpu/memory in runtime_config are softly ignored with a warning; memory_mb + # exists only for the docker/compose/modal/daytona providers, i.e. locally). + # So the only honest lever is to make the AGENT's toolchain fit the box it + # is in: a soft heap ceiling and two build/test workers instead of one per + # core. This is the agent session only -- the grader compiles the cells with + # its own environment (run_grading.sh), so no verdict changes. + "GOMEMLIMIT": "1GiB", + "GOMAXPROCS": "2", +} +# PATH is deliberately NOT in that dict. An agent session is a LOGIN shell +# (`env -i ... bash -l`), and Debian's /etc/profile assigns PATH +# unconditionally, so anything set here would be thrown away before the first +# command runs -- measured, not assumed: `docker run IMG bash -lc 'command -v +# go'` finds nothing without the fix. The toolchain therefore goes on PATH from +# inside the image, in /etc/profile.d/10-go-toolchain.sh, where a login shell +# cannot lose it. That file also repeats the variables above as defaults, so +# the two mechanisms cover each other. + + +# network=True — hud's own default (Workspace.__init__, workspace.py:321). We had +# True only because the CLI scaffold ships it (hud/cli/templates.py:35). +# ⚠️ MEASURED 2026-09-03: this flag is a NO-OP in our images. `unshare --net` is +# applied only through bwrap (workspace.py:1049, :1292 fall back to a bare shell +# when self._bwrap is None), and bwrap is absent from every image; installing it +# does not help either — usable_bwrap() still returns None because the eval +# substrate denies the privileges (unshare: Operation not permitted). +# Verified inside the image: `git ls-remote https://github.com/... HEAD` → RC 0. +# The agent shell REACHES THE INTERNET regardless of this flag. Kept False so the +# intent is right if the substrate ever grants isolation — but never rely on it, +# and never claim "offline" in a ticket. +_ws = Workspace( + REPO_DIR, + guest_path=str(REPO_DIR), +# Сеть. Флаг network в наших образах — НЕ ИЗОЛЯЦИЯ: `unshare --net` применяется +# только через bwrap, а bwrap в образах нет и права на unshare субстрат не даёт +# (измерено: `git ls-remote https://github.com/… HEAD` внутри образа → RC 0). +# Поэтому здесь стоит True — честное описание того, что есть: агентский шелл +# достаёт интернет. Закон: «сеть открыта — не запрещать» (network=True уже +# ломал воркспейс: /workspace root:700 для uid 1000, живой голд слеп — piscina v3), +# и заметка среды НИКОГДА не говорит «offline» (RH-2: ран, который читает +# недоступность сервиса как свою вину, введён в заблуждение). + network=True, + env={"HOME": str(AGENT_HOME), **({} if _LOCAL_SUBSTRATE else AGENT_GO_ENV)}, + track_files=settings.file_tracking_enabled, + shell_uid=AGENT_UID, +) + +SDLC_TOOLS = os.environ.get("SDLC_TOOLS", "") not in ("", "0", "false") + +# Hedged on purpose ("can exhaust it", not "is killed"): the note may state the +# size of the box; it may not state a failure nobody measured. Everything here is +# a fact about the MACHINE — the size of it, the shape of a command that fits in +# it, the closed network, the services it does not run — and nothing here is a +# fact about the ticket: no symptom, no file name, no identifier, no sample +# (minimal-ticket law, ORG15). Nothing in this note is graded. +# +# The last sentence is law RH-2: a rollout that spends its turns trying to make +# a test that dials the internet pass, and reads its failure as its own, has been +# misled by the sandbox. Saying so costs nothing and points nowhere — and the +# grader agrees with it by construction: the no-regression gate compares the +# suite on the candidate's tree with the same suite on the pristine one, so a +# test the sandbox is red on is red on both sides and decides nothing. +WORKSPACE_NOTE = ( + f"Please make your changes directly in {REPO_DIR}, not in a copy or a " + "separate worktree.\n" + "Environment: this container has about 2 vCPUs and a hard memory limit, and " + "a fully parallel build or test run can exhaust it. Build and test package " + "by package, e.g. `go test -p 1 ./...`. The Go module you work in is " + f"{REPO_DIR} itself.\n" + "The Go toolchain is configured with GOPROXY=off against a pre-populated " + "module cache, so `go build` and `go test` work without fetching modules." +) + +_github = MockGitHub() +_github_server: asyncio.Task[None] | None = None + + +@env.initialize +async def _up() -> None: + global _github_server + if _LOCAL_SUBSTRATE and not (REPO_DIR / ".git").exists(): + REPO_DIR.parent.mkdir(parents=True, exist_ok=True) + logger.info("cloning %s into %s", REPO_URL, REPO_DIR) + await repo_lib.run("git", "clone", "-q", REPO_URL, str(REPO_DIR), cwd=REPO_DIR.parent) + await _ws.start() + env.add_capability(_ws.capability("shell")) + if _ws.tracks_files: + env.add_capability(_ws.file_tracking_capability()) + # The mock-GitHub tools belong to the SDLC flavor, which seeds issues and + # wants a pull request. A plain coding task never uses them, and offering + # them anyway spends agent steps on an empty issue list - every rollout so + # far called github_list_issues and github_list_pull_requests once. + if SDLC_TOOLS: + _github_server, github_capability = serve_github(_github) + env.add_capability(github_capability) + + +@env.shutdown +async def _down() -> None: + if _github_server is not None: + _github_server.cancel() + await _ws.stop() + if _LOCAL_SUBSTRATE: + for path in (REPO_DIR, VAULT_DIR, LOGS_DIR, REMOTE_DIR.parent): + shutil.rmtree(path, ignore_errors=True) + + +# ─── shared task lifecycle ─────────────────────────────────────────────── + + +async def _setup(base_ref: str | None = None, *, remote: bool = False) -> None: + """Check out the task's baseline, vault the history, hand the repo to the agent. + + With ``remote=True`` (the SDLC flavor) a bare "GitHub" remote is created + from the baseline first, and the agent's repo is attached to it as a + normal clone would be — realistic history, pushes, and branches, but no + reachable answer-key refs. + """ + if base_ref: + await repo_lib.git(REPO_DIR, "checkout", "-qf", base_ref) + if remote: + await repo_lib.create_remote(REPO_DIR, REMOTE_DIR, base_ref or "HEAD") + await repo_lib.vault_history(REPO_DIR, VAULT_DIR) + if remote: + await repo_lib.attach_to_remote(REPO_DIR, REMOTE_DIR) + if hasattr(os, "geteuid") and os.geteuid() == 0: + AGENT_HOME.mkdir(parents=True, exist_ok=True) + uid = f"{AGENT_UID}:{AGENT_UID}" + paths = [str(REPO_DIR), str(AGENT_HOME)] + ([str(REMOTE_DIR)] if remote else []) + await repo_lib.run("chown", "-R", uid, *paths, cwd=Path("/")) + if remote: + # The grader (root) pushes to and clones from the agent-owned remote. + await repo_lib.run("git", "config", "--global", "--add", "safe.directory", str(REMOTE_DIR), cwd=Path("/")) + + +# ─── generic flavor ────────────────────────────────────────────────────── + + +async def _grade_generic( + test_command: str, + base_ref: str | None, + test_ref: str | None, + test_files: list[str] | None, + golden_ref: str | None, + validate_mode: str | None, +) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + if not (base_ref and golden_ref): + raise ValueError('validate_mode="golden" needs base_ref and golden_ref') + _, diff, _ = await repo_lib.git(REPO_DIR, "diff", base_ref, golden_ref) + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + if test_ref: + # Hidden tests come from the vaulted history, after the agent's diff — + # so agent edits to them never survive into grading. + await repo_lib.git(REPO_DIR, "checkout", test_ref, "--", *(test_files or ["."])) + + command = test_command.format(test_files=" ".join(test_files or [])) + return await combine( + BashGrader.grade(weight=1.0, command=command, cwd=str(REPO_DIR), timeout_seconds=int(TESTS_TIMEOUT)) + ) + + +@env.template(id="coding-task", description="Fix a bug in the repo; hidden tests grade the diff.") +async def coding_task( + description: str, + test_command: str, + base_ref: str | None = None, + test_ref: str | None = None, + test_files: list[str] | None = None, + golden_ref: str | None = None, + validate_mode: str | None = None, +): + """Generic coding task. + + ``base_ref`` is the agent's starting state; ``test_ref`` holds the hidden + tests (``test_files`` are checked out from it at grade time); + ``test_command`` scores by exit code, with ``{test_files}`` expanded. + ``validate_mode="golden"`` grades ``base_ref..golden_ref`` instead of + agent edits. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup(base_ref) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. {WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests grade your " + f"work when you finish; do not modify existing tests.\n\n{description}" + ) + yield await _grade_generic(test_command, base_ref, test_ref, test_files, golden_ref, validate_mode) + + +# ─── SDLC flavor: issue-driven fix, graded on the pushed PR branch ─────── + + +async def _fetch_hidden_ref(dest: Path, ref: str) -> None: + """Fetch an answer-key ref from the vaulted history into *dest*.""" + full = f"refs/remotes/{ref}" if ref.startswith("origin/") else ref + await repo_lib.git(dest, "fetch", "-q", str(VAULT_DIR / "git"), full) + + +async def _grade_sdlc( + test_command: str, + test_ref: str, + test_files: list[str], + golden_ref: str | None, + pr_rubric: str | None, + validate_mode: str | None, +) -> EvaluationResult: + if validate_mode == "golden": + # Simulate the workflow the agent is graded on: push the reference + # fix as a branch and open a pull request for it. + if not golden_ref: + raise ValueError('validate_mode="golden" needs golden_ref') + await repo_lib.git(VAULT_DIR / "git", "push", "-q", str(REMOTE_DIR), f"{golden_ref}:refs/heads/golden-fix") + _github.create_pull_request( + "Fix the reported bug", "Applies the reference fix.", head="golden-fix", base="main" + ) + + pr = _github.latest_pull_request() + if pr is None: + return EvaluationResult(reward=0.0, content="no pull request was opened") + + # Hermetic checkout of the PR head from the remote (never the worktree). + grading_dir = LOGS_DIR / "pr-checkout" + shutil.rmtree(grading_dir, ignore_errors=True) + LOGS_DIR.mkdir(parents=True, exist_ok=True) + await repo_lib.run("git", "clone", "-q", str(REMOTE_DIR), str(grading_dir), cwd=LOGS_DIR) + code, _, err = await repo_lib.git(grading_dir, "checkout", "-q", pr.head, check=False) + if code != 0: + return EvaluationResult( + reward=0.0, + content=f"pull request head branch {pr.head!r} was never pushed", + info={"git_checkout": err.strip()[-2000:]}, + ) + + await _fetch_hidden_ref(grading_dir, test_ref) + await repo_lib.git(grading_dir, "checkout", "FETCH_HEAD", "--", *test_files) + + command = test_command.format(test_files=" ".join(test_files)) + quality: Any + if pr_rubric: + quality = LLMJudgeGrader.grade(weight=0.2, answer=_github.transcript(), criteria=[pr_rubric]) + else: + opened_well = bool(pr.title.strip() and pr.body.strip()) + quality = SubScore(name="pull_request", value=1.0 if opened_well else 0.0, weight=0.2) + return await combine( + BashGrader.grade(weight=0.8, command=command, cwd=str(grading_dir), timeout_seconds=int(TESTS_TIMEOUT)), + quality, + ) + + +@env.template( + id="sdlc-task", + description="Issue-driven bug fix: fix the code, push a branch, open a pull request.", +) +async def sdlc_task( + description: str, + test_command: str, + base_ref: str, + test_ref: str, + test_files: list[str], + issues: list[dict[str, Any]] | None = None, + golden_ref: str | None = None, + pr_rubric: str | None = None, + validate_mode: str | None = None, +): + """The generic flavor plus workflow: the repo has an ``origin`` remote (a + bare mock-GitHub repo) and ``github_*`` tools seeded with *issues*; the + deliverable is a pushed branch with a pull request. Grading checks the PR + head out of the remote, brings in the hidden tests, runs ``test_command`` + (weight 0.8), and scores the PR itself (weight 0.2) — structurally, or + against ``pr_rubric`` with an LLM judge when provided. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + _github.seed(issues or []) + await _setup(base_ref, remote=True) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}; its `origin` remote " + "is the team's shared repository, and the `github_*` tools give you the team's " + "issue tracker.\n\n" + "Complete the following task. When you are done, push your work to `origin` as a " + "new branch and open a pull request for it with `github_create_pull_request`. " + "Hidden tests grade your work; do not modify existing tests.\n\n" + f"{description}" + ) + yield await _grade_sdlc(test_command, test_ref, test_files, golden_ref, pr_rubric, validate_mode) + + +# ─── SWE-bench Pro flavor (present only in baked instance images) ──────── + +if (INSTANCE_DIR / "instance.json").is_file(): + INSTANCE = swe.load_instance(INSTANCE_DIR) + + @env.template( + id=INSTANCE["instance_id"], + description=f"SWE-bench Pro instance on {INSTANCE['repo']}", + ) + async def swe_bench_pro_task(validate_mode: str | None = None): + """One SWE-bench Pro rollout. ``validate_mode="golden"`` grades the + dataset's golden patch instead of agent edits (gold-patch validation).""" + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + _ = yield swe.build_prompt(INSTANCE, REPO_DIR) + yield await swe.grade( + INSTANCE, + INSTANCE_DIR, + REPO_DIR, + VAULT_DIR, + LOGS_DIR, + validate_mode=validate_mode, + tests_timeout=TESTS_TIMEOUT, + ) diff --git a/harbor/sources/bazel-remote-v2/pyproject.toml b/harbor/sources/bazel-remote-v2/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..582116058bbb1ed6e8f7bce813ceaae633d7cbf0 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/pyproject.toml @@ -0,0 +1,8 @@ +[project] +name = "bazel-remote-disk-eviction-accounting-task" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = ["hud-python==0.6.15"] + +[tool.hud] +image = "ec-swe-bazel-remote-disk-eviction-accounting" diff --git a/harbor/sources/bazel-remote-v2/task/gold.diff b/harbor/sources/bazel-remote-v2/task/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..98a12fc4841268669cb95c0092d79046c13379df --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/gold.diff @@ -0,0 +1,445 @@ +diff --git a/cache/disk/accounting_test.go b/cache/disk/accounting_test.go +new file mode 100644 +index 0000000..e2b40cd +--- /dev/null ++++ b/cache/disk/accounting_test.go +@@ -0,0 +1,229 @@ ++package disk ++ ++import ( ++ "bytes" ++ "context" ++ "crypto/sha256" ++ "encoding/hex" ++ "io" ++ "math/rand" ++ "os" ++ "testing" ++ "time" ++ ++ "github.com/buchgr/bazel-remote/v2/cache" ++ testutils "github.com/buchgr/bazel-remote/v2/utils" ++ dto "github.com/prometheus/client_model/go" ++) ++ ++func accountingBlob(n int, seed int64) ([]byte, string) { ++ r := rand.New(rand.NewSource(seed)) ++ b := make([]byte, n) ++ _, _ = r.Read(b) ++ sum := sha256.Sum256(b) ++ return b, hex.EncodeToString(sum[:]) ++} ++ ++func openAccountingCache(t *testing.T, dir string, maxSize int64, mode string) *diskCache { ++ t.Helper() ++ c, err := New(dir, maxSize, WithStorageMode(mode), WithAccessLogger(testutils.NewSilentLogger())) ++ if err != nil { ++ t.Fatal(err) ++ } ++ return c.(*diskCache) ++} ++ ++func TestAdmittedBlobKeptDespiteStoredFormOverhead(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ maxSize := int64(8 * BlockSize) ++ c := openAccountingCache(t, dir, maxSize, "zstd") ++ ++ data, hash := accountingBlob(int(maxSize), 1) ++ if err := c.Put(ctx, cache.CAS, hash, int64(len(data)), bytes.NewReader(data)); err != nil { ++ t.Fatalf("admitted blob was refused at commit: %v", err) ++ } ++ if ok, _ := c.Contains(ctx, cache.CAS, hash, int64(len(data))); !ok { ++ t.Fatal("admitted blob is not in the cache") ++ } ++ ++ // A restart with the same limit keeps it. ++ c2 := openAccountingCache(t, dir, maxSize, "zstd") ++ rc, _, err := c2.Get(ctx, cache.CAS, hash, int64(len(data)), 0) ++ if err != nil || rc == nil { ++ t.Fatalf("admitted blob lost on restart: rc=%v err=%v", rc, err) ++ } ++ got, err := io.ReadAll(rc) ++ _ = rc.Close() ++ if err != nil || !bytes.Equal(got, data) { ++ t.Fatalf("admitted blob not served back after restart: %v", err) ++ } ++} ++ ++type heldReader struct { ++ data []byte ++ pos int ++ started, release chan struct{} ++ once bool ++} ++ ++func (h *heldReader) Read(p []byte) (int, error) { ++ if !h.once { ++ h.once = true ++ close(h.started) ++ } ++ if h.pos < len(h.data) { ++ n := copy(p, h.data[h.pos:]) ++ h.pos += n ++ return n, nil ++ } ++ <-h.release ++ return 0, io.EOF ++} ++ ++func TestAdmittedBlobKeptDespiteBlockRounding(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ maxSize := int64(16 * BlockSize) ++ c := openAccountingCache(t, dir, maxSize, "uncompressed") ++ ++ aData, aHash := accountingBlob(int(maxSize)-4097, 2) ++ hold := &heldReader{data: aData, started: make(chan struct{}), release: make(chan struct{})} ++ aDone := make(chan error, 1) ++ go func() { aDone <- c.Put(ctx, cache.CAS, aHash, int64(len(aData)), hold) }() ++ <-hold.started ++ for deadline := time.Now().Add(10 * time.Second); ; time.Sleep(time.Millisecond) { ++ if _, reserved, _, _ := c.Stats(); reserved == int64(len(aData)) { ++ break ++ } ++ if time.Now().After(deadline) { ++ t.Fatal("reservation not visible") ++ } ++ } ++ ++ bData, bHash := accountingBlob(4097, 3) ++ errB := c.Put(ctx, cache.CAS, bHash, int64(len(bData)), bytes.NewReader(bData)) ++ close(hold.release) ++ if err := <-aDone; err != nil { ++ t.Fatal(err) ++ } ++ if errB != nil { ++ t.Fatalf("admitted blob was refused at commit: %v", errB) ++ } ++} ++ ++func TestLoadDiscardsBlobsThatNoLongerFit(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "uncompressed") ++ big, bigHash := accountingBlob(20000, 4) ++ if err := c.Put(ctx, cache.CAS, bigHash, int64(len(big)), bytes.NewReader(big)); err != nil { ++ t.Fatal(err) ++ } ++ small, smallHash := accountingBlob(1000, 5) ++ if err := c.Put(ctx, cache.RAW, smallHash, int64(len(small)), bytes.NewReader(small)); err != nil { ++ t.Fatal(err) ++ } ++ ++ c2 := openAccountingCache(t, dir, 2*BlockSize, "uncompressed") ++ if ok, _ := c2.Contains(ctx, cache.CAS, bigHash, int64(len(big))); ok { ++ t.Fatal("oversized blob was not discarded") ++ } ++ if ok, _ := c2.Contains(ctx, cache.RAW, smallHash, int64(len(small))); !ok { ++ t.Fatal("blob that fits was not kept") ++ } ++ if _, _, n, _ := c2.Stats(); n != 1 { ++ t.Fatalf("expected 1 item, found %d", n) ++ } ++} ++ ++func TestLogicalSizeInPlainBytes(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "zstd") ++ acHash := hashStr("accounting-ac") ++ if err := c.Put(ctx, cache.AC, acHash, 100, bytes.NewReader(bytes.Repeat([]byte("a"), 100))); err != nil { ++ t.Fatal(err) ++ } ++ raw, rawHash := accountingBlob(1000, 6) ++ if err := c.Put(ctx, cache.RAW, rawHash, int64(len(raw)), bytes.NewReader(raw)); err != nil { ++ t.Fatal(err) ++ } ++ if err := c.Put(ctx, cache.AC, acHash, 50, bytes.NewReader(bytes.Repeat([]byte("b"), 50))); err != nil { ++ t.Fatal(err) ++ } ++ if _, _, _, logical := c.Stats(); logical != 1050 { ++ t.Fatalf("logical size %d, want 1050", logical) ++ } ++} ++ ++func TestEvictedBytesCountOnlyEvictions(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 3*BlockSize, "uncompressed") ++ evicted := func() float64 { ++ var m dto.Metric ++ if err := c.lru.counterEvictedBytes.Write(&m); err != nil { ++ t.Fatal(err) ++ } ++ return m.GetCounter().GetValue() ++ } ++ ++ data, hash := accountingBlob(BlockSize, 7) ++ if err := c.Put(ctx, cache.RAW, hash, int64(len(data)), bytes.NewReader(data)); err != nil { ++ t.Fatal(err) ++ } ++ key := cache.LookupKey(cache.RAW, hash) ++ item, _ := c.lru.Get(key) ++ if err := os.Remove(c.getElementPath(key, item)); err != nil { ++ t.Fatal(err) ++ } ++ if rc, _, _ := c.Get(ctx, cache.RAW, hash, int64(len(data)), 0); rc != nil { ++ t.Fatal("lost blob was served") ++ } ++ if got := evicted(); got != 0 { ++ t.Fatalf("evicted bytes %v after dropping a lost file", got) ++ } ++ ++ for i := 0; i < 4; i++ { ++ d, h := accountingBlob(BlockSize, int64(10+i)) ++ if err := c.Put(ctx, cache.RAW, h, int64(len(d)), bytes.NewReader(d)); err != nil { ++ t.Fatal(err) ++ } ++ } ++ if got := evicted(); got != BlockSize { ++ t.Fatalf("evicted bytes %v after one eviction, want %d", got, BlockSize) ++ } ++} ++ ++func TestEntryBytesSummaryObservesEntrySize(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "zstd") ++ hash := hashStr("accounting-summary") ++ body := bytes.Repeat([]byte("y"), 100) ++ for i := 0; i < 2; i++ { ++ if err := c.Put(ctx, cache.AC, hash, int64(len(body)), bytes.NewReader(body)); err != nil { ++ t.Fatal(err) ++ } ++ } ++ var m dto.Metric ++ if err := c.lru.summaryCacheItemBytes.Write(&m); err != nil { ++ t.Fatal(err) ++ } ++ if n, sum := m.GetSummary().GetSampleCount(), m.GetSummary().GetSampleSum(); n != 2 || sum != 200 { ++ t.Fatalf("entry bytes summary: %d observations summing to %v, want 2 of 100", n, sum) ++ } ++} +diff --git a/cache/disk/disk.go b/cache/disk/disk.go +index 4db928c..cb54739 100644 +--- a/cache/disk/disk.go ++++ b/cache/disk/disk.go +@@ -429,7 +429,11 @@ func (c *diskCache) commit(key string, legacy bool, tempfile string, reservedSiz + random: random, + } + +- if !c.lru.Add(key, newItem) { ++ if reservedSize > 0 { ++ // Space for this blob was granted when it was reserved. That ++ // grant is not withdrawn now, whatever the stored form adds. ++ c.lru.AddAdmitted(key, newItem) ++ } else if !c.lru.Add(key, newItem) { + err = fmt.Errorf("INTERNAL ERROR: failed to add: %s, size %d (on disk: %d)", + key, logicalSize, sizeOnDisk) + log.Println(err.Error()) +diff --git a/cache/disk/load.go b/cache/disk/load.go +index cab7f4e..b09d646 100644 +--- a/cache/disk/load.go ++++ b/cache/disk/load.go +@@ -616,12 +616,25 @@ func (c *diskCache) loadExistingFiles(maxSizeBytes int64, cc CacheConfig) error + go c.lru.performQueuedEvictionsContinuously() + + for i := 0; i < len(result.item); i++ { +- ok := c.lru.Add(result.metadata[i].lookupKey, *result.item[i]) +- if !ok { +- err = os.Remove(filepath.Join(c.dir, result.metadata[i].lookupKey)) +- if err != nil { +- return err +- } ++ key := result.metadata[i].lookupKey ++ item := *result.item[i] ++ ++ // An existing file is kept if a request of its size would be ++ // granted space by this cache, i.e. by the same rule that ++ // admitted it in the first place. ++ if c.lru.Fits(item.size) { ++ c.lru.AddAdmitted(key, item) ++ continue ++ } ++ ++ // It no longer fits (e.g. the cache was restarted with a lower ++ // max size): discard it and carry on loading. ++ f := c.getElementPath(key, item) ++ log.Printf("Removing %s (%d bytes), it does not fit in the cache (max size %d bytes).", ++ f, item.size, maxSizeBytes) ++ err = os.Remove(f) ++ if err != nil && !os.IsNotExist(err) { ++ return err + } + } + +diff --git a/cache/disk/lru.go b/cache/disk/lru.go +index 7bc4997..faf058c 100644 +--- a/cache/disk/lru.go ++++ b/cache/disk/lru.go +@@ -26,8 +26,8 @@ type SizedLRU struct { + // Total cache size including reserved bytes and estimated filesystem overhead. + currentSize int64 + +- // Total size of all blobs in uncompressed form. +- // This does not include reserved space. ++ // Total size of all blobs in uncompressed form, in plain bytes (not ++ // rounded up to BlockSize). This does not include reserved space. + uncompressedSize int64 + + // Number of bytes reserved for incoming blobs. +@@ -188,47 +188,77 @@ func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { + // time (unless Reserve method was used and evicted them). + c.calcTotalDiskSizeAndUpdatePeak(roundedUpSizeOnDisk) + +- var sizeDelta, uncompressedSizeDelta int64 ++ sizeDelta := roundedUpSizeOnDisk + if ee, ok := c.cache[key]; ok { +- sizeDelta = roundedUpSizeOnDisk - roundUp4k(ee.Value.(*entry).value.sizeOnDisk) +- if c.reservedSize+sizeDelta > c.maxSize { +- return false +- } +- uncompressedSizeDelta = roundUp4k(value.size) - roundUp4k(ee.Value.(*entry).value.size) ++ sizeDelta -= roundUp4k(ee.Value.(*entry).value.sizeOnDisk) ++ } ++ if c.reservedSize+sizeDelta > c.maxSize { ++ return false ++ } ++ ++ c.insert(key, value) ++ ++ return true ++} ++ ++// AddAdmitted adds a (key, value) whose admission was already decided, ++// either because space for it was granted by Reserve (which the caller ++// must have released with Unreserve first), or because it is an existing ++// file that fits the cache by its logical size. It never rejects the item, ++// whatever its stored form adds on top of the logical size (block rounding, ++// compression headers): other items are evicted to make room, but never the ++// item itself, so the cache can temporarily exceed maxSize by that overhead. ++func (c *SizedLRU) AddAdmitted(key string, value lruItem) { ++ c.calcTotalDiskSizeAndUpdatePeak(roundUp4k(value.sizeOnDisk)) ++ c.insert(key, value) ++} ++ ++// Fits reports whether an item of the given logical size can be admitted, ++// using the same rule as Reserve. ++func (c *SizedLRU) Fits(logicalSize int64) bool { ++ return logicalSize >= 0 && logicalSize <= c.maxSize ++} ++ ++// insert stores (key, value), replacing any existing value for key, and ++// then evicts least recently used items (never the inserted one) until the ++// cache is within maxSize again. ++func (c *SizedLRU) insert(key string, value lruItem) { ++ sizeDelta := roundUp4k(value.sizeOnDisk) ++ uncompressedSizeDelta := value.size ++ ++ var ele *list.Element ++ if ee, ok := c.cache[key]; ok { ++ old := ee.Value.(*entry) ++ sizeDelta -= roundUp4k(old.value.sizeOnDisk) ++ uncompressedSizeDelta -= old.value.size + c.ll.MoveToFront(ee) +- c.counterOverwrittenBytes.Add(float64(ee.Value.(*entry).value.sizeOnDisk)) ++ c.counterOverwrittenBytes.Add(float64(old.value.sizeOnDisk)) + +- kv := ee.Value.(*entry) +- kvCopy := &entry{kv.key, kv.value} +- c.appendEvictionToQueue(kvCopy) ++ // The replaced file still has to be removed from disk. ++ c.appendEvictionToQueue(&entry{old.key, old.value}) + +- ee.Value.(*entry).value = value ++ old.value = value ++ ele = ee + } else { +- sizeDelta = roundedUpSizeOnDisk +- if c.reservedSize+sizeDelta > c.maxSize { +- return false +- } +- uncompressedSizeDelta = roundUp4k(value.size) +- ele := c.ll.PushFront(&entry{key, value}) ++ ele = c.ll.PushFront(&entry{key, value}) + c.cache[key] = ele + } + ++ c.currentSize += sizeDelta ++ c.uncompressedSize += uncompressedSizeDelta ++ + // Eviction. This is needed even if the key was already present, since the size of the + // value might have changed, pushing the total size over maxSize. +- for c.currentSize+sizeDelta > c.maxSize { +- ele := c.ll.Back() +- if ele != nil { +- c.removeElement(ele) ++ for c.currentSize > c.maxSize { ++ back := c.ll.Back() ++ if back == nil || back == ele { ++ break + } ++ c.evictElement(back) + } + +- c.currentSize += sizeDelta +- c.uncompressedSize += uncompressedSizeDelta +- + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) +- c.summaryCacheItemBytes.Observe(float64(sizeDelta)) +- +- return true ++ c.summaryCacheItemBytes.Observe(float64(value.sizeOnDisk)) + } + + // Get looks up a key in the cache. The lruItem is only valid if *list.Element is not nil. +@@ -361,7 +391,7 @@ func (c *SizedLRU) Reserve(size int64) error { + for sumLargerThan(size, c.currentSize, c.maxSize) { + ele := c.ll.Back() + if ele != nil { +- c.removeElement(ele) ++ c.evictElement(ele) + } else { + return internalErr(errReservation) // This should have been caught at the start. + } +@@ -394,16 +424,25 @@ func (c *SizedLRU) Unreserve(size int64) error { + return nil + } + ++// removeElement drops an element from the index and queues its file for ++// removal. It is used both for evictions and for entries whose file was ++// lost or found to be corrupt; only evictElement counts as an eviction. + func (c *SizedLRU) removeElement(e *list.Element) { + c.ll.Remove(e) + kv := e.Value.(*entry) + delete(c.cache, kv.key) + c.currentSize -= roundUp4k(kv.value.sizeOnDisk) +- c.uncompressedSize -= roundUp4k(kv.value.size) +- c.counterEvictedBytes.Add(float64(kv.value.sizeOnDisk)) ++ c.uncompressedSize -= kv.value.size ++ c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) + c.appendEvictionToQueue(kv) + } + ++// evictElement removes an element to make room in a full cache. ++func (c *SizedLRU) evictElement(e *list.Element) { ++ c.counterEvictedBytes.Add(float64(e.Value.(*entry).value.sizeOnDisk)) ++ c.removeElement(e) ++} ++ + // Round n up to the nearest multiple of BlockSize (4096). + func roundUp4k(n int64) int64 { + return (n + BlockSize - 1) & -BlockSize diff --git a/harbor/sources/bazel-remote-v2/task/grader/controls/alt.diff b/harbor/sources/bazel-remote-v2/task/grader/controls/alt.diff new file mode 100644 index 0000000000000000000000000000000000000000..b429a1a2e9c28e233366a339efa2eed9d9a62fa6 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/controls/alt.diff @@ -0,0 +1,204 @@ +diff --git a/cache/disk/disk.go b/cache/disk/disk.go +index 4db928c..a72ad5f 100644 +--- a/cache/disk/disk.go ++++ b/cache/disk/disk.go +@@ -413,15 +413,6 @@ func (c *diskCache) commit(key string, legacy bool, tempfile string, reservedSiz + c.mu.Lock() + defer c.mu.Unlock() + +- if unreserve { +- err = c.lru.Unreserve(reservedSize) +- if err != nil { +- log.Println(err.Error()) +- return true, removeTempfile, err +- } +- } +- unreserve = false +- + newItem := lruItem{ + size: logicalSize, + sizeOnDisk: sizeOnDisk, +@@ -429,6 +420,15 @@ func (c *diskCache) commit(key string, legacy bool, tempfile string, reservedSiz + random: random, + } + ++ if unreserve { ++ err = c.lru.CommitReservation(key, newItem, reservedSize) ++ if err != nil { ++ log.Println(err.Error()) ++ return true, removeTempfile, err ++ } ++ return false, false, nil ++ } ++ + if !c.lru.Add(key, newItem) { + err = fmt.Errorf("INTERNAL ERROR: failed to add: %s, size %d (on disk: %d)", + key, logicalSize, sizeOnDisk) +diff --git a/cache/disk/load.go b/cache/disk/load.go +index cab7f4e..7b08eb8 100644 +--- a/cache/disk/load.go ++++ b/cache/disk/load.go +@@ -616,12 +616,14 @@ func (c *diskCache) loadExistingFiles(maxSizeBytes int64, cc CacheConfig) error + go c.lru.performQueuedEvictionsContinuously() + + for i := 0; i < len(result.item); i++ { +- ok := c.lru.Add(result.metadata[i].lookupKey, *result.item[i]) +- if !ok { +- err = os.Remove(filepath.Join(c.dir, result.metadata[i].lookupKey)) +- if err != nil { +- return err +- } ++ md, it := result.metadata[i], *result.item[i] ++ if c.lru.LoadExisting(md.lookupKey, it) { ++ continue ++ } ++ stale := c.getElementPath(md.lookupKey, it) ++ log.Printf("Discarding %s: it does not fit in a cache of %d bytes", stale, maxSizeBytes) ++ if rmErr := os.Remove(stale); rmErr != nil && !os.IsNotExist(rmErr) { ++ log.Printf("ERROR: failed to remove %s: %v", stale, rmErr) + } + } + +diff --git a/cache/disk/lru.go b/cache/disk/lru.go +index 7bc4997..29a81fe 100644 +--- a/cache/disk/lru.go ++++ b/cache/disk/lru.go +@@ -171,10 +171,34 @@ func (c *SizedLRU) RegisterMetrics() { + // BlockSize (4096) bytes, as an estimate of actual disk usage since + // most linux filesystems default to 4kb blocks. + func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { ++ return c.add(key, value, 0, false) ++} ++ ++// CommitReservation turns a reservation of `reserved` logical bytes, taken ++// earlier with Reserve, into the stored item. The request was admitted when ++// the reservation was granted, so this never refuses it. ++func (c *SizedLRU) CommitReservation(key string, value lruItem, reserved int64) error { ++ if reserved < 0 || reserved > c.reservedSize || reserved > c.currentSize { ++ return fmt.Errorf("INTERNAL ERROR: failed to commit reservation: %d", reserved) ++ } ++ c.add(key, value, reserved, true) ++ return nil ++} ++ ++// LoadExisting indexes a file found on disk at startup. It is kept when its ++// logical size would be admitted by Reserve, and refused otherwise. ++func (c *SizedLRU) LoadExisting(key string, value lruItem) bool { ++ if value.size > c.maxSize { ++ return false ++ } ++ return c.add(key, value, 0, true) ++} ++ ++func (c *SizedLRU) add(key string, value lruItem, held int64, admitted bool) bool { + + roundedUpSizeOnDisk := roundUp4k(value.sizeOnDisk) + +- if roundedUpSizeOnDisk > c.maxSize { ++ if !admitted && roundedUpSizeOnDisk > c.maxSize { + return false + } + +@@ -191,10 +215,10 @@ func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { + var sizeDelta, uncompressedSizeDelta int64 + if ee, ok := c.cache[key]; ok { + sizeDelta = roundedUpSizeOnDisk - roundUp4k(ee.Value.(*entry).value.sizeOnDisk) +- if c.reservedSize+sizeDelta > c.maxSize { ++ if !admitted && c.reservedSize+sizeDelta > c.maxSize { + return false + } +- uncompressedSizeDelta = roundUp4k(value.size) - roundUp4k(ee.Value.(*entry).value.size) ++ uncompressedSizeDelta = value.size - ee.Value.(*entry).value.size + c.ll.MoveToFront(ee) + c.counterOverwrittenBytes.Add(float64(ee.Value.(*entry).value.sizeOnDisk)) + +@@ -205,28 +229,36 @@ func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { + ee.Value.(*entry).value = value + } else { + sizeDelta = roundedUpSizeOnDisk +- if c.reservedSize+sizeDelta > c.maxSize { ++ if !admitted && c.reservedSize+sizeDelta > c.maxSize { + return false + } +- uncompressedSizeDelta = roundUp4k(value.size) ++ uncompressedSizeDelta = value.size + ele := c.ll.PushFront(&entry{key, value}) + c.cache[key] = ele + } + ++ // The held reservation is released in the same step as the item is ++ // accounted, so the space granted to it is never up for grabs. ++ c.currentSize -= held ++ c.reservedSize -= held ++ + // Eviction. This is needed even if the key was already present, since the size of the +- // value might have changed, pushing the total size over maxSize. ++ // value might have changed, pushing the total size over maxSize. The item ++ // being added is never evicted to make room for itself. ++ self := c.cache[key] + for c.currentSize+sizeDelta > c.maxSize { + ele := c.ll.Back() +- if ele != nil { +- c.removeElement(ele) ++ if ele == nil || ele == self { ++ break + } ++ c.removeElement(ele, true) + } + + c.currentSize += sizeDelta + c.uncompressedSize += uncompressedSizeDelta + + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) +- c.summaryCacheItemBytes.Observe(float64(sizeDelta)) ++ c.summaryCacheItemBytes.Observe(float64(roundedUpSizeOnDisk)) + + return true + } +@@ -244,14 +276,14 @@ func (c *SizedLRU) Get(key string) (lruItem, *list.Element) { + // Remove removes a (key, value) from the cache. + func (c *SizedLRU) RemoveKey(key string) { + if elem, hit := c.cache[key]; hit { +- c.removeElement(elem) ++ c.removeElement(elem, false) + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) + } + } + + // Remove a *list.Element from the cache. + func (c *SizedLRU) RemoveElement(elem *list.Element) { +- c.removeElement(elem) ++ c.removeElement(elem, false) + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) + } + +@@ -361,7 +393,7 @@ func (c *SizedLRU) Reserve(size int64) error { + for sumLargerThan(size, c.currentSize, c.maxSize) { + ele := c.ll.Back() + if ele != nil { +- c.removeElement(ele) ++ c.removeElement(ele, true) + } else { + return internalErr(errReservation) // This should have been caught at the start. + } +@@ -394,13 +426,17 @@ func (c *SizedLRU) Unreserve(size int64) error { + return nil + } + +-func (c *SizedLRU) removeElement(e *list.Element) { ++// removeElement drops e from the index and queues its file for removal. ++// Only removals made to free space in a full cache are counted as evictions. ++func (c *SizedLRU) removeElement(e *list.Element, evicted bool) { + c.ll.Remove(e) + kv := e.Value.(*entry) + delete(c.cache, kv.key) + c.currentSize -= roundUp4k(kv.value.sizeOnDisk) +- c.uncompressedSize -= roundUp4k(kv.value.size) +- c.counterEvictedBytes.Add(float64(kv.value.sizeOnDisk)) ++ c.uncompressedSize -= kv.value.size ++ if evicted { ++ c.counterEvictedBytes.Add(float64(kv.value.sizeOnDisk)) ++ } + c.appendEvictionToQueue(kv) + } + diff --git a/harbor/sources/bazel-remote-v2/task/grader/controls/cheat.diff b/harbor/sources/bazel-remote-v2/task/grader/controls/cheat.diff new file mode 100644 index 0000000000000000000000000000000000000000..d30c65acb6339ede9db970970706b0225deedb65 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/controls/cheat.diff @@ -0,0 +1,457 @@ +diff --git a/cache/disk/accounting_test.go b/cache/disk/accounting_test.go +new file mode 100644 +index 0000000..e2b40cd +--- /dev/null ++++ b/cache/disk/accounting_test.go +@@ -0,0 +1,229 @@ ++package disk ++ ++import ( ++ "bytes" ++ "context" ++ "crypto/sha256" ++ "encoding/hex" ++ "io" ++ "math/rand" ++ "os" ++ "testing" ++ "time" ++ ++ "github.com/buchgr/bazel-remote/v2/cache" ++ testutils "github.com/buchgr/bazel-remote/v2/utils" ++ dto "github.com/prometheus/client_model/go" ++) ++ ++func accountingBlob(n int, seed int64) ([]byte, string) { ++ r := rand.New(rand.NewSource(seed)) ++ b := make([]byte, n) ++ _, _ = r.Read(b) ++ sum := sha256.Sum256(b) ++ return b, hex.EncodeToString(sum[:]) ++} ++ ++func openAccountingCache(t *testing.T, dir string, maxSize int64, mode string) *diskCache { ++ t.Helper() ++ c, err := New(dir, maxSize, WithStorageMode(mode), WithAccessLogger(testutils.NewSilentLogger())) ++ if err != nil { ++ t.Fatal(err) ++ } ++ return c.(*diskCache) ++} ++ ++func TestAdmittedBlobKeptDespiteStoredFormOverhead(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ maxSize := int64(8 * BlockSize) ++ c := openAccountingCache(t, dir, maxSize, "zstd") ++ ++ data, hash := accountingBlob(int(maxSize), 1) ++ if err := c.Put(ctx, cache.CAS, hash, int64(len(data)), bytes.NewReader(data)); err != nil { ++ t.Fatalf("admitted blob was refused at commit: %v", err) ++ } ++ if ok, _ := c.Contains(ctx, cache.CAS, hash, int64(len(data))); !ok { ++ t.Fatal("admitted blob is not in the cache") ++ } ++ ++ // A restart with the same limit keeps it. ++ c2 := openAccountingCache(t, dir, maxSize, "zstd") ++ rc, _, err := c2.Get(ctx, cache.CAS, hash, int64(len(data)), 0) ++ if err != nil || rc == nil { ++ t.Fatalf("admitted blob lost on restart: rc=%v err=%v", rc, err) ++ } ++ got, err := io.ReadAll(rc) ++ _ = rc.Close() ++ if err != nil || !bytes.Equal(got, data) { ++ t.Fatalf("admitted blob not served back after restart: %v", err) ++ } ++} ++ ++type heldReader struct { ++ data []byte ++ pos int ++ started, release chan struct{} ++ once bool ++} ++ ++func (h *heldReader) Read(p []byte) (int, error) { ++ if !h.once { ++ h.once = true ++ close(h.started) ++ } ++ if h.pos < len(h.data) { ++ n := copy(p, h.data[h.pos:]) ++ h.pos += n ++ return n, nil ++ } ++ <-h.release ++ return 0, io.EOF ++} ++ ++func TestAdmittedBlobKeptDespiteBlockRounding(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ maxSize := int64(16 * BlockSize) ++ c := openAccountingCache(t, dir, maxSize, "uncompressed") ++ ++ aData, aHash := accountingBlob(int(maxSize)-4097, 2) ++ hold := &heldReader{data: aData, started: make(chan struct{}), release: make(chan struct{})} ++ aDone := make(chan error, 1) ++ go func() { aDone <- c.Put(ctx, cache.CAS, aHash, int64(len(aData)), hold) }() ++ <-hold.started ++ for deadline := time.Now().Add(10 * time.Second); ; time.Sleep(time.Millisecond) { ++ if _, reserved, _, _ := c.Stats(); reserved == int64(len(aData)) { ++ break ++ } ++ if time.Now().After(deadline) { ++ t.Fatal("reservation not visible") ++ } ++ } ++ ++ bData, bHash := accountingBlob(4097, 3) ++ errB := c.Put(ctx, cache.CAS, bHash, int64(len(bData)), bytes.NewReader(bData)) ++ close(hold.release) ++ if err := <-aDone; err != nil { ++ t.Fatal(err) ++ } ++ if errB != nil { ++ t.Fatalf("admitted blob was refused at commit: %v", errB) ++ } ++} ++ ++func TestLoadDiscardsBlobsThatNoLongerFit(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "uncompressed") ++ big, bigHash := accountingBlob(20000, 4) ++ if err := c.Put(ctx, cache.CAS, bigHash, int64(len(big)), bytes.NewReader(big)); err != nil { ++ t.Fatal(err) ++ } ++ small, smallHash := accountingBlob(1000, 5) ++ if err := c.Put(ctx, cache.RAW, smallHash, int64(len(small)), bytes.NewReader(small)); err != nil { ++ t.Fatal(err) ++ } ++ ++ c2 := openAccountingCache(t, dir, 2*BlockSize, "uncompressed") ++ if ok, _ := c2.Contains(ctx, cache.CAS, bigHash, int64(len(big))); ok { ++ t.Fatal("oversized blob was not discarded") ++ } ++ if ok, _ := c2.Contains(ctx, cache.RAW, smallHash, int64(len(small))); !ok { ++ t.Fatal("blob that fits was not kept") ++ } ++ if _, _, n, _ := c2.Stats(); n != 1 { ++ t.Fatalf("expected 1 item, found %d", n) ++ } ++} ++ ++func TestLogicalSizeInPlainBytes(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "zstd") ++ acHash := hashStr("accounting-ac") ++ if err := c.Put(ctx, cache.AC, acHash, 100, bytes.NewReader(bytes.Repeat([]byte("a"), 100))); err != nil { ++ t.Fatal(err) ++ } ++ raw, rawHash := accountingBlob(1000, 6) ++ if err := c.Put(ctx, cache.RAW, rawHash, int64(len(raw)), bytes.NewReader(raw)); err != nil { ++ t.Fatal(err) ++ } ++ if err := c.Put(ctx, cache.AC, acHash, 50, bytes.NewReader(bytes.Repeat([]byte("b"), 50))); err != nil { ++ t.Fatal(err) ++ } ++ if _, _, _, logical := c.Stats(); logical != 1050 { ++ t.Fatalf("logical size %d, want 1050", logical) ++ } ++} ++ ++func TestEvictedBytesCountOnlyEvictions(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 3*BlockSize, "uncompressed") ++ evicted := func() float64 { ++ var m dto.Metric ++ if err := c.lru.counterEvictedBytes.Write(&m); err != nil { ++ t.Fatal(err) ++ } ++ return m.GetCounter().GetValue() ++ } ++ ++ data, hash := accountingBlob(BlockSize, 7) ++ if err := c.Put(ctx, cache.RAW, hash, int64(len(data)), bytes.NewReader(data)); err != nil { ++ t.Fatal(err) ++ } ++ key := cache.LookupKey(cache.RAW, hash) ++ item, _ := c.lru.Get(key) ++ if err := os.Remove(c.getElementPath(key, item)); err != nil { ++ t.Fatal(err) ++ } ++ if rc, _, _ := c.Get(ctx, cache.RAW, hash, int64(len(data)), 0); rc != nil { ++ t.Fatal("lost blob was served") ++ } ++ if got := evicted(); got != 0 { ++ t.Fatalf("evicted bytes %v after dropping a lost file", got) ++ } ++ ++ for i := 0; i < 4; i++ { ++ d, h := accountingBlob(BlockSize, int64(10+i)) ++ if err := c.Put(ctx, cache.RAW, h, int64(len(d)), bytes.NewReader(d)); err != nil { ++ t.Fatal(err) ++ } ++ } ++ if got := evicted(); got != BlockSize { ++ t.Fatalf("evicted bytes %v after one eviction, want %d", got, BlockSize) ++ } ++} ++ ++func TestEntryBytesSummaryObservesEntrySize(t *testing.T) { ++ ctx := context.Background() ++ dir := testutils.TempDir(t) ++ defer func() { _ = os.RemoveAll(dir) }() ++ ++ c := openAccountingCache(t, dir, 64*BlockSize, "zstd") ++ hash := hashStr("accounting-summary") ++ body := bytes.Repeat([]byte("y"), 100) ++ for i := 0; i < 2; i++ { ++ if err := c.Put(ctx, cache.AC, hash, int64(len(body)), bytes.NewReader(body)); err != nil { ++ t.Fatal(err) ++ } ++ } ++ var m dto.Metric ++ if err := c.lru.summaryCacheItemBytes.Write(&m); err != nil { ++ t.Fatal(err) ++ } ++ if n, sum := m.GetSummary().GetSampleCount(), m.GetSummary().GetSampleSum(); n != 2 || sum != 200 { ++ t.Fatalf("entry bytes summary: %d observations summing to %v, want 2 of 100", n, sum) ++ } ++} +diff --git a/cache/disk/disk.go b/cache/disk/disk.go +index 4db928c..cb54739 100644 +--- a/cache/disk/disk.go ++++ b/cache/disk/disk.go +@@ -429,7 +429,11 @@ func (c *diskCache) commit(key string, legacy bool, tempfile string, reservedSiz + random: random, + } + +- if !c.lru.Add(key, newItem) { ++ if reservedSize > 0 { ++ // Space for this blob was granted when it was reserved. That ++ // grant is not withdrawn now, whatever the stored form adds. ++ c.lru.AddAdmitted(key, newItem) ++ } else if !c.lru.Add(key, newItem) { + err = fmt.Errorf("INTERNAL ERROR: failed to add: %s, size %d (on disk: %d)", + key, logicalSize, sizeOnDisk) + log.Println(err.Error()) +diff --git a/cache/disk/load.go b/cache/disk/load.go +index cab7f4e..b09d646 100644 +--- a/cache/disk/load.go ++++ b/cache/disk/load.go +@@ -616,12 +616,25 @@ func (c *diskCache) loadExistingFiles(maxSizeBytes int64, cc CacheConfig) error + go c.lru.performQueuedEvictionsContinuously() + + for i := 0; i < len(result.item); i++ { +- ok := c.lru.Add(result.metadata[i].lookupKey, *result.item[i]) +- if !ok { +- err = os.Remove(filepath.Join(c.dir, result.metadata[i].lookupKey)) +- if err != nil { +- return err +- } ++ key := result.metadata[i].lookupKey ++ item := *result.item[i] ++ ++ // An existing file is kept if a request of its size would be ++ // granted space by this cache, i.e. by the same rule that ++ // admitted it in the first place. ++ if c.lru.Fits(item.size) { ++ c.lru.AddAdmitted(key, item) ++ continue ++ } ++ ++ // It no longer fits (e.g. the cache was restarted with a lower ++ // max size): discard it and carry on loading. ++ f := c.getElementPath(key, item) ++ log.Printf("Removing %s (%d bytes), it does not fit in the cache (max size %d bytes).", ++ f, item.size, maxSizeBytes) ++ err = os.Remove(f) ++ if err != nil && !os.IsNotExist(err) { ++ return err + } + } + +diff --git a/cache/disk/lru.go b/cache/disk/lru.go +index 7bc4997..faf058c 100644 +--- a/cache/disk/lru.go ++++ b/cache/disk/lru.go +@@ -26,8 +26,8 @@ type SizedLRU struct { + // Total cache size including reserved bytes and estimated filesystem overhead. + currentSize int64 + +- // Total size of all blobs in uncompressed form. +- // This does not include reserved space. ++ // Total size of all blobs in uncompressed form, in plain bytes (not ++ // rounded up to BlockSize). This does not include reserved space. + uncompressedSize int64 + + // Number of bytes reserved for incoming blobs. +@@ -188,47 +188,77 @@ func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { + // time (unless Reserve method was used and evicted them). + c.calcTotalDiskSizeAndUpdatePeak(roundedUpSizeOnDisk) + +- var sizeDelta, uncompressedSizeDelta int64 ++ sizeDelta := roundedUpSizeOnDisk + if ee, ok := c.cache[key]; ok { +- sizeDelta = roundedUpSizeOnDisk - roundUp4k(ee.Value.(*entry).value.sizeOnDisk) +- if c.reservedSize+sizeDelta > c.maxSize { +- return false +- } +- uncompressedSizeDelta = roundUp4k(value.size) - roundUp4k(ee.Value.(*entry).value.size) ++ sizeDelta -= roundUp4k(ee.Value.(*entry).value.sizeOnDisk) ++ } ++ if c.reservedSize+sizeDelta > c.maxSize { ++ return false ++ } ++ ++ c.insert(key, value) ++ ++ return true ++} ++ ++// AddAdmitted adds a (key, value) whose admission was already decided, ++// either because space for it was granted by Reserve (which the caller ++// must have released with Unreserve first), or because it is an existing ++// file that fits the cache by its logical size. It never rejects the item, ++// whatever its stored form adds on top of the logical size (block rounding, ++// compression headers): other items are evicted to make room, but never the ++// item itself, so the cache can temporarily exceed maxSize by that overhead. ++func (c *SizedLRU) AddAdmitted(key string, value lruItem) { ++ c.calcTotalDiskSizeAndUpdatePeak(roundUp4k(value.sizeOnDisk)) ++ c.insert(key, value) ++} ++ ++// Fits reports whether an item of the given logical size can be admitted, ++// using the same rule as Reserve. ++func (c *SizedLRU) Fits(logicalSize int64) bool { ++ return logicalSize >= 0 && logicalSize <= c.maxSize ++} ++ ++// insert stores (key, value), replacing any existing value for key, and ++// then evicts least recently used items (never the inserted one) until the ++// cache is within maxSize again. ++func (c *SizedLRU) insert(key string, value lruItem) { ++ sizeDelta := roundUp4k(value.sizeOnDisk) ++ uncompressedSizeDelta := value.size ++ ++ var ele *list.Element ++ if ee, ok := c.cache[key]; ok { ++ old := ee.Value.(*entry) ++ sizeDelta -= roundUp4k(old.value.sizeOnDisk) ++ uncompressedSizeDelta -= old.value.size + c.ll.MoveToFront(ee) +- c.counterOverwrittenBytes.Add(float64(ee.Value.(*entry).value.sizeOnDisk)) ++ c.counterOverwrittenBytes.Add(float64(old.value.sizeOnDisk)) + +- kv := ee.Value.(*entry) +- kvCopy := &entry{kv.key, kv.value} +- c.appendEvictionToQueue(kvCopy) ++ // The replaced file still has to be removed from disk. ++ c.appendEvictionToQueue(&entry{old.key, old.value}) + +- ee.Value.(*entry).value = value ++ old.value = value ++ ele = ee + } else { +- sizeDelta = roundedUpSizeOnDisk +- if c.reservedSize+sizeDelta > c.maxSize { +- return false +- } +- uncompressedSizeDelta = roundUp4k(value.size) +- ele := c.ll.PushFront(&entry{key, value}) ++ ele = c.ll.PushFront(&entry{key, value}) + c.cache[key] = ele + } + ++ c.currentSize += sizeDelta ++ c.uncompressedSize += uncompressedSizeDelta ++ + // Eviction. This is needed even if the key was already present, since the size of the + // value might have changed, pushing the total size over maxSize. +- for c.currentSize+sizeDelta > c.maxSize { +- ele := c.ll.Back() +- if ele != nil { +- c.removeElement(ele) ++ for c.currentSize > c.maxSize { ++ back := c.ll.Back() ++ if back == nil || back == ele { ++ break + } ++ c.evictElement(back) + } + +- c.currentSize += sizeDelta +- c.uncompressedSize += uncompressedSizeDelta +- + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) +- c.summaryCacheItemBytes.Observe(float64(sizeDelta)) +- +- return true ++ c.summaryCacheItemBytes.Observe(float64(value.sizeOnDisk)) + } + + // Get looks up a key in the cache. The lruItem is only valid if *list.Element is not nil. +@@ -361,7 +391,7 @@ func (c *SizedLRU) Reserve(size int64) error { + for sumLargerThan(size, c.currentSize, c.maxSize) { + ele := c.ll.Back() + if ele != nil { +- c.removeElement(ele) ++ c.evictElement(ele) + } else { + return internalErr(errReservation) // This should have been caught at the start. + } +@@ -394,16 +424,25 @@ func (c *SizedLRU) Unreserve(size int64) error { + return nil + } + ++// removeElement drops an element from the index and queues its file for ++// removal. It is used both for evictions and for entries whose file was ++// lost or found to be corrupt; only evictElement counts as an eviction. + func (c *SizedLRU) removeElement(e *list.Element) { + c.ll.Remove(e) + kv := e.Value.(*entry) + delete(c.cache, kv.key) + c.currentSize -= roundUp4k(kv.value.sizeOnDisk) +- c.uncompressedSize -= roundUp4k(kv.value.size) +- c.counterEvictedBytes.Add(float64(kv.value.sizeOnDisk)) ++ c.uncompressedSize -= kv.value.size ++ c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) + c.appendEvictionToQueue(kv) + } + ++// evictElement removes an element to make room in a full cache. ++func (c *SizedLRU) evictElement(e *list.Element) { ++ c.counterEvictedBytes.Add(float64(e.Value.(*entry).value.sizeOnDisk)) ++ c.removeElement(e) ++} ++ + // Round n up to the nearest multiple of BlockSize (4096). + func roundUp4k(n int64) int64 { + return (n + BlockSize - 1) & -BlockSize +diff --git a/cache/disk/lru_test.go b/cache/disk/lru_test.go +index 77cef15..b7a03f5 100644 +--- a/cache/disk/lru_test.go ++++ b/cache/disk/lru_test.go +@@ -107,6 +107,7 @@ func TestEviction(t *testing.T) { + } + + func TestRejectBigItem(t *testing.T) { ++ t.Skip("admission is decided elsewhere now") + // Bounded caches should reject big items + lru := NewSizedLRU(10, nil, 0) + diff --git a/harbor/sources/bazel-remote-v2/task/grader/controls/lazy.diff b/harbor/sources/bazel-remote-v2/task/grader/controls/lazy.diff new file mode 100644 index 0000000000000000000000000000000000000000..35076119e7007b70e87fa7b686436a1609e53b97 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/controls/lazy.diff @@ -0,0 +1,13 @@ +diff --git a/cache/disk/lru.go b/cache/disk/lru.go +index 7bc4997..79acafe 100644 +--- a/cache/disk/lru.go ++++ b/cache/disk/lru.go +@@ -226,7 +226,7 @@ func (c *SizedLRU) Add(key string, value lruItem) (ok bool) { + c.uncompressedSize += uncompressedSizeDelta + + c.gaugeCacheLogicalBytes.Set(float64(c.uncompressedSize)) +- c.summaryCacheItemBytes.Observe(float64(sizeDelta)) ++ c.summaryCacheItemBytes.Observe(float64(value.sizeOnDisk)) + + return true + } diff --git a/harbor/sources/bazel-remote-v2/task/grader/harness/spec/cells_test.go b/harbor/sources/bazel-remote-v2/task/grader/harness/spec/cells_test.go new file mode 100644 index 0000000000000000000000000000000000000000..5a6f48113e73a3459cbb9713827afde52d056dd5 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/harness/spec/cells_test.go @@ -0,0 +1,443 @@ +// Cells of the hidden grader for the bazel-remote disk cache accounting task. +// +// Each TestCell_ is exactly one criterion of the board. It is copied into +// the candidate's module as a package of its own right before it runs, drives +// the disk cache through its exported API only -- disk.New, Put, Get, Contains, +// Stats, RegisterMetrics and the Prometheus registry the cache registers into -- +// over data the cell writes itself into its own temporary directory, and prints +// one line +// +// CELL= PASS|FAIL +// +// which run_grading.sh reads. No network, no service, no clock a verdict +// depends on, no randomness that is not seeded: every blob is generated from a +// fixed seed. Nothing here reads the candidate's source. +package zzaccountingcells + +import ( + "bytes" + "context" + "crypto/sha256" + "encoding/hex" + "fmt" + "io" + "log" + "math/rand" + "os" + "path/filepath" + "testing" + "time" + + "github.com/buchgr/bazel-remote/v2/cache" + "github.com/buchgr/bazel-remote/v2/cache/disk" + "github.com/prometheus/client_golang/prometheus" +) + +const blockSize = 4096 + +func TestMain(m *testing.M) { + // The cache logs through the standard logger; the verdict lines are + // printed to stdout and are all run_grading.sh reads. + log.SetOutput(io.Discard) + os.Exit(m.Run()) +} + +func pass(cell, format string, a ...any) { + fmt.Printf("CELL=%s PASS %s\n", cell, fmt.Sprintf(format, a...)) +} + +func fail(t *testing.T, cell, format string, a ...any) { + fmt.Printf("CELL=%s FAIL %s\n", cell, fmt.Sprintf(format, a...)) + t.FailNow() +} + +// blob returns n bytes that zstd cannot shrink, and their sha256. +func blob(n int, seed int64) ([]byte, string) { + r := rand.New(rand.NewSource(seed)) + b := make([]byte, n) + _, _ = r.Read(b) + sum := sha256.Sum256(b) + return b, hex.EncodeToString(sum[:]) +} + +func keyHash(s string) string { + sum := sha256.Sum256([]byte(s)) + return hex.EncodeToString(sum[:]) +} + +func open(dir string, maxSize int64, mode string) (disk.Cache, error) { + return disk.New(dir, maxSize, + disk.WithStorageMode(mode), + disk.WithAccessLogger(log.New(io.Discard, "", 0))) +} + +// readBack returns the bytes the cache serves for (kind, hash). +func readBack(c disk.Cache, kind cache.EntryKind, hash string, size int64) ([]byte, error) { + rc, _, err := c.Get(context.Background(), kind, hash, size, 0) + if err != nil { + return nil, err + } + if rc == nil { + return nil, nil + } + defer func() { _ = rc.Close() }() + return io.ReadAll(rc) +} + +// freshRegistry points the Prometheus default registerer at a registry of +// this cell's own, so the cache's RegisterMetrics lands there. +func freshRegistry() *prometheus.Registry { + reg := prometheus.NewRegistry() + prometheus.DefaultRegisterer = reg + prometheus.DefaultGatherer = reg + return reg +} + +type sample struct { + found bool + value float64 // counter or gauge value + count uint64 // summary sample count + sum float64 // summary sample sum +} + +func gather(t *testing.T, cell string, reg *prometheus.Registry, name string) sample { + fams, err := reg.Gather() + if err != nil { + fail(t, cell, "the cache's metrics could not be gathered: %v", err) + } + for _, f := range fams { + if f.GetName() != name || len(f.GetMetric()) == 0 { + continue + } + m := f.GetMetric()[0] + s := sample{found: true} + switch { + case m.GetCounter() != nil: + s.value = m.GetCounter().GetValue() + case m.GetGauge() != nil: + s.value = m.GetGauge().GetValue() + case m.GetSummary() != nil: + s.count = m.GetSummary().GetSampleCount() + s.sum = m.GetSummary().GetSampleSum() + } + return s + } + return sample{} +} + +// ─── the space granted to an admitted write is not withdrawn ───────────────── + +// A blob whose logical size is exactly the configured limit is admitted, in the +// default (compressed) storage mode, where the stored form adds a header to +// bytes zstd cannot shrink. The write must succeed and the blob must be served. +func TestCell_admitted_blob_is_kept_despite_stored_form_overhead(t *testing.T) { + const cell = "admitted_blob_is_kept_despite_stored_form_overhead" + ctx := context.Background() + maxSize := int64(8 * blockSize) + c, err := open(t.TempDir(), maxSize, "zstd") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + data, hash := blob(int(maxSize), 101) + if err := c.Put(ctx, cache.CAS, hash, int64(len(data)), bytes.NewReader(data)); err != nil { + fail(t, cell, "a %d-byte CAS write into an empty %d-byte cache was refused after it was accepted: %v", + len(data), maxSize, err) + } + if ok, _ := c.Contains(ctx, cache.CAS, hash, int64(len(data))); !ok { + fail(t, cell, "the %d-byte CAS write succeeded but the cache does not contain the blob", len(data)) + } + got, err := readBack(c, cache.CAS, hash, int64(len(data))) + if err != nil || !bytes.Equal(got, data) { + fail(t, cell, "the %d-byte CAS write succeeded but the blob is not served back (err=%v, %d bytes)", + len(data), err, len(got)) + } + pass(cell, "a %d-byte CAS blob in a %d-byte cache was stored and served back", len(data), maxSize) +} + +// The same admitted blob survives a restart of the cache over the same +// directory with the same limit. +func TestCell_admitted_blob_survives_restart_with_the_same_limits(t *testing.T) { + const cell = "admitted_blob_survives_restart_with_the_same_limits" + ctx := context.Background() + dir := t.TempDir() + maxSize := int64(8 * blockSize) + c, err := open(dir, maxSize, "zstd") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + data, hash := blob(int(maxSize), 202) + if err := c.Put(ctx, cache.CAS, hash, int64(len(data)), bytes.NewReader(data)); err != nil { + fail(t, cell, "a %d-byte CAS write into an empty %d-byte cache was refused: %v", len(data), maxSize, err) + } + if ok, _ := c.Contains(ctx, cache.CAS, hash, int64(len(data))); !ok { + fail(t, cell, "the %d-byte CAS write succeeded but the blob is not in the cache", len(data)) + } + + c2, err := open(dir, maxSize, "zstd") + if err != nil { + fail(t, cell, "the cache directory did not load again with the same limit: %v", err) + } + if ok, _ := c2.Contains(ctx, cache.CAS, hash, int64(len(data))); !ok { + _, _, n, _ := c2.Stats() + fail(t, cell, "after a restart with the same %d-byte limit the accepted %d-byte blob is gone (%d items loaded)", + maxSize, len(data), n) + } + got, err := readBack(c2, cache.CAS, hash, int64(len(data))) + if err != nil || !bytes.Equal(got, data) { + fail(t, cell, "after a restart the blob is listed but not served back (err=%v, %d bytes)", err, len(got)) + } + pass(cell, "the accepted %d-byte blob is still served after a restart with the same %d-byte limit", + len(data), maxSize) +} + +// holdingReader hands out its data and then blocks its final Read until +// released, which keeps the write it feeds (and the space reserved for it) +// open. +type holdingReader struct { + data []byte + pos int + started chan struct{} + release chan struct{} + once bool +} + +func (h *holdingReader) Read(p []byte) (int, error) { + if !h.once { + h.once = true + close(h.started) + } + if h.pos < len(h.data) { + n := copy(p, h.data[h.pos:]) + h.pos += n + return n, nil + } + <-h.release + return 0, io.EOF +} + +// While one write holds a reservation open, a second write whose logical size +// fills the rest of the limit exactly is accepted; its stored form rounds up +// to whole blocks. That write must succeed. +func TestCell_admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation(t *testing.T) { + const cell = "admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation" + ctx := context.Background() + maxSize := int64(16 * blockSize) + c, err := open(t.TempDir(), maxSize, "uncompressed") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + + aData, aHash := blob(int(maxSize)-4097, 303) + hold := &holdingReader{data: aData, started: make(chan struct{}), release: make(chan struct{})} + aDone := make(chan error, 1) + go func() { aDone <- c.Put(ctx, cache.CAS, aHash, int64(len(aData)), hold) }() + released := false + defer func() { + if !released { + close(hold.release) + } + }() + + select { + case <-hold.started: + case err := <-aDone: + fail(t, cell, "the first %d-byte write ended before its body was read: %v", len(aData), err) + case <-time.After(20 * time.Second): + fail(t, cell, "the first %d-byte write never started reading its body", len(aData)) + } + + bData, bHash := blob(4097, 304) + bDone := make(chan error, 1) + go func() { bDone <- c.Put(ctx, cache.CAS, bHash, int64(len(bData)), bytes.NewReader(bData)) }() + + var bErr error + bFinished := false + select { + case bErr = <-bDone: + bFinished = true + case <-time.After(10 * time.Second): + } + if bFinished && bErr == nil { + if ok, _ := c.Contains(ctx, cache.CAS, bHash, int64(len(bData))); !ok { + fail(t, cell, "the second %d-byte write succeeded but the blob is not in the cache", len(bData)) + } + } + + close(hold.release) + released = true + if err := <-aDone; err != nil { + fail(t, cell, "the first %d-byte write failed: %v", len(aData), err) + } + if !bFinished { + select { + case bErr = <-bDone: + case <-time.After(20 * time.Second): + fail(t, cell, "the second %d-byte write never finished", len(bData)) + } + } + if bErr != nil { + fail(t, cell, "with %d bytes reserved by another write, a %d-byte write into a %d-byte cache was refused after it was accepted: %v", + len(aData), len(bData), maxSize, bErr) + } + pass(cell, "both writes (%d and %d bytes, limit %d) succeeded", len(aData), len(bData), maxSize) +} + +// ─── the cache directory always loads ──────────────────────────────────────── + +// A directory written under a large limit holds one blob larger than the new +// limit and one that fits. Reopened under the smaller limit, it loads, the big +// blob is not served, and the small one is. +func TestCell_cache_dir_with_oversized_blob_still_loads_and_discards_it(t *testing.T) { + const cell = "cache_dir_with_oversized_blob_still_loads_and_discards_it" + ctx := context.Background() + dir := t.TempDir() + c, err := open(dir, int64(64*blockSize), "uncompressed") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + big, bigHash := blob(20000, 401) + if err := c.Put(ctx, cache.CAS, bigHash, int64(len(big)), bytes.NewReader(big)); err != nil { + fail(t, cell, "setup: a %d-byte write into a %d-byte cache failed: %v", len(big), 64*blockSize, err) + } + small, smallHash := blob(1000, 402) + if err := c.Put(ctx, cache.RAW, smallHash, int64(len(small)), bytes.NewReader(small)); err != nil { + fail(t, cell, "setup: a %d-byte write failed: %v", len(small), err) + } + + newMax := int64(2 * blockSize) + c2, err := open(dir, newMax, "uncompressed") + if err != nil { + fail(t, cell, "the cache directory did not load under a %d-byte limit: %v", newMax, err) + } + if ok, _ := c2.Contains(ctx, cache.CAS, bigHash, int64(len(big))); ok { + fail(t, cell, "the %d-byte blob is still served under a %d-byte limit", len(big), newMax) + } + got, err := readBack(c2, cache.RAW, smallHash, int64(len(small))) + if err != nil || !bytes.Equal(got, small) { + fail(t, cell, "the %d-byte blob that fits the %d-byte limit was not kept (err=%v, %d bytes)", + len(small), newMax, err, len(got)) + } + _, _, n, _ := c2.Stats() + if n != 1 { + fail(t, cell, "the reloaded cache reports %d items, want 1", n) + } + pass(cell, "reloaded under %d bytes: the %d-byte blob was dropped, the %d-byte blob kept", + newMax, len(big), len(small)) +} + +// ─── every reported figure describes the bytes its name claims ─────────────── + +// The logical ("uncompressed") size is the plain byte count of the blobs held, +// across stores, compression and an overwrite. +func TestCell_logical_size_is_reported_in_plain_bytes(t *testing.T) { + const cell = "logical_size_is_reported_in_plain_bytes" + ctx := context.Background() + c, err := open(t.TempDir(), int64(64*blockSize), "zstd") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + acKey := keyHash("ac-entry") + if err := c.Put(ctx, cache.AC, acKey, 100, bytes.NewReader(bytes.Repeat([]byte("a"), 100))); err != nil { + fail(t, cell, "setup: a 100-byte AC write failed: %v", err) + } + raw, rawHash := blob(1000, 501) + if err := c.Put(ctx, cache.RAW, rawHash, int64(len(raw)), bytes.NewReader(raw)); err != nil { + fail(t, cell, "setup: a 1000-byte RAW write failed: %v", err) + } + cas := bytes.Repeat([]byte("compressible "), 800) // 10400 bytes, shrinks a lot + sum := sha256.Sum256(cas) + if err := c.Put(ctx, cache.CAS, hex.EncodeToString(sum[:]), int64(len(cas)), bytes.NewReader(cas)); err != nil { + fail(t, cell, "setup: a %d-byte CAS write failed: %v", len(cas), err) + } + if err := c.Put(ctx, cache.AC, acKey, 50, bytes.NewReader(bytes.Repeat([]byte("b"), 50))); err != nil { + fail(t, cell, "setup: a 50-byte AC overwrite failed: %v", err) + } + want := int64(50 + 1000 + len(cas)) + _, _, n, logical := c.Stats() + if n != 3 || logical != want { + fail(t, cell, "logical size %d over %d items, want %d over 3", logical, n, want) + } + pass(cell, "logical size %d bytes over 3 items", logical) +} + +// The evicted-bytes counter counts evictions: not an entry dropped because its +// file disappeared, and exactly the bytes of the entry a full cache evicted. +func TestCell_evicted_bytes_counter_ignores_lost_files(t *testing.T) { + const cell = "evicted_bytes_counter_ignores_lost_files" + const name = "bazel_remote_disk_cache_evicted_bytes_total" + ctx := context.Background() + reg := freshRegistry() + dir := t.TempDir() + c, err := open(dir, int64(3*blockSize), "uncompressed") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + c.RegisterMetrics() + + lost, lostHash := blob(blockSize, 601) + if err := c.Put(ctx, cache.RAW, lostHash, int64(len(lost)), bytes.NewReader(lost)); err != nil { + fail(t, cell, "setup: a %d-byte write failed: %v", len(lost), err) + } + files, _ := filepath.Glob(filepath.Join(dir, "*", lostHash[:2], lostHash+"*")) + if len(files) != 1 { + fail(t, cell, "setup: expected one file on disk for the blob, found %d", len(files)) + } + if err := os.Remove(files[0]); err != nil { + fail(t, cell, "setup: could not remove the blob's file: %v", err) + } + if got, _ := readBack(c, cache.RAW, lostHash, int64(len(lost))); got != nil { + fail(t, cell, "setup: a blob whose file is gone was served") + } + if s := gather(t, cell, reg, name); !s.found || s.value != 0 { + fail(t, cell, "%s is %v (registered: %v) after an entry whose file disappeared was dropped; the cache was never full", + name, s.value, s.found) + } + + var evictedSize int + for i := 0; i < 4; i++ { + d, h := blob(blockSize, int64(610+i)) + if err := c.Put(ctx, cache.RAW, h, int64(len(d)), bytes.NewReader(d)); err != nil { + fail(t, cell, "setup: write %d failed: %v", i, err) + } + evictedSize = len(d) + } + s := gather(t, cell, reg, name) + // How many entries a full cache evicts to make room is its own choice; the + // bytes it reports must be the bytes of what it evicted, so at least one + // entry's worth once the cache was full. + if !s.found || s.value < float64(evictedSize) { + fail(t, cell, "%s is %v after at least one %d-byte entry was evicted from the full cache, want at least %d", + name, s.value, evictedSize, evictedSize) + } + pass(cell, "%s stayed 0 for the lost file and is %v after one eviction", name, s.value) +} + +// The entry-size summary observes the size of each entry stored, including an +// overwrite. +func TestCell_entry_size_summary_observes_each_entry_size(t *testing.T) { + const cell = "entry_size_summary_observes_each_entry_size" + const name = "bazel_remote_disk_cache_entry_bytes" + ctx := context.Background() + reg := freshRegistry() + c, err := open(t.TempDir(), int64(64*blockSize), "zstd") + if err != nil { + fail(t, cell, "an empty cache directory did not open: %v", err) + } + c.RegisterMetrics() + + key := keyHash("summary-entry") + body := bytes.Repeat([]byte("y"), 100) + for i := 0; i < 2; i++ { + if err := c.Put(ctx, cache.AC, key, int64(len(body)), bytes.NewReader(body)); err != nil { + fail(t, cell, "setup: write %d of a 100-byte AC entry failed: %v", i, err) + } + } + s := gather(t, cell, reg, name) + // Each observation is the entry's size: its 100 bytes, or the 4096 bytes + // of the block it occupies on disk. What is not an entry size is a delta. + if !s.found || s.count != 2 || (s.sum != 200 && s.sum != 2*blockSize) { + fail(t, cell, "%s has %d observations summing to %v after storing a 100-byte entry twice, want 2 observations of its size", + name, s.count, s.sum) + } + pass(cell, "%s: %d observations, sum %v", name, s.count, s.sum) +} diff --git a/harbor/sources/bazel-remote-v2/task/grader/harness/suite_gate.py b/harbor/sources/bazel-remote-v2/task/grader/harness/suite_gate.py new file mode 100644 index 0000000000000000000000000000000000000000..784388caa3eb509bf31dccf9fd29af319a7ec575 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/harness/suite_gate.py @@ -0,0 +1,175 @@ +#!/usr/bin/env python3 +"""The no-regression gate: the repository's own suite, green, on the candidate. + +bazel-remote's suite needs no network and is green on the pristine checkout +(the image asserts that at uid 1000 when it is built), so this runs the suite +ONCE on a normalised copy of the candidate's tree instead of comparing against a +second run on the base: a test that fails twice in a row fails the gate. + +(Kept below for provenance: the donor's differential design.) + + suite_gate.py + +Not "the suite is green" — "no test that passes on the released tree fails on +yours". The difference is the whole design, and it was measured rather than +argued: run offline, this repository's own suite is red on the PRISTINE +checkout in a dozen places (it resolves public names, dials public hosts, opens +sockets to the internet), and a gate phrased as "green" would therefore fail +every rollout for something nobody did — or, patched with a hand-written list of +tests to skip, would quietly stop covering the packages the ticket is about. +Comparing the candidate's failures with the base's needs no list, cannot rot, +and says exactly what a no-regression gate is supposed to say. + +Two more things are enforced here, and both are about whose suite it is: + + * every test file the repository shipped is restored from the pristine + checkout before anything runs, so a candidate cannot make this gate green by + rewriting a test that was in its way; + * every test file the candidate ADDED is set aside, so it cannot make the gate + red with a test of its own that does not pass. + +Both happen in a COPY of the candidate's tree, so the workspace the agent's diff +was taken from is not touched. + +Exit codes are the grader's: 0 PASS, 1 FAIL (a verdict about the tree), 3 +GRADER FAULT (this could not judge — no toolchain, no pristine checkout, a +budget that ran out). +""" + +from __future__ import annotations + +import os +import re +import shutil +import subprocess +import sys +import time +from pathlib import Path + +FAIL_LINE = re.compile(r"^\s*--- FAIL: (\S+)") +BUILD_FAIL = re.compile(r"^FAIL\s+(\S+)\s+\[(?:build|setup) failed\]") + + +def fault(msg: str) -> None: + print(f"GRADER FAULT: {msg}") + sys.exit(3) + + +def go_env() -> dict[str, str]: + env = dict(os.environ) + env.setdefault("GOFLAGS", "-mod=mod") + env.setdefault("GOPROXY", "off") + env.setdefault("GOTOOLCHAIN", "local") + env.setdefault("GOWORK", "off") + return env + + +def normalise(base: Path, tree: Path, cells: str) -> tuple[int, int]: + """Restore the shipped test files into *tree*; set aside the added ones.""" + shipped: set[str] = set() + for root, dirs, files in os.walk(base): + dirs[:] = [d for d in dirs if d not in (".git", cells)] + for name in files: + if not name.endswith("_test.go"): + continue + rel = os.path.relpath(os.path.join(root, name), base) + shipped.add(rel) + dest = tree / rel + dest.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(os.path.join(root, name), dest) + added = 0 + for root, dirs, files in os.walk(tree): + dirs[:] = [d for d in dirs if d not in (".git", cells)] + for name in files: + if not name.endswith("_test.go"): + continue + rel = os.path.relpath(os.path.join(root, name), tree) + if rel not in shipped: + os.remove(os.path.join(root, name)) + added += 1 + return len(shipped), added + + +def packages(tree: Path, cells: str, budget: int) -> list[str]: + proc = subprocess.run(["go", "list", "./..."], cwd=tree, env=go_env(), + capture_output=True, text=True, timeout=budget) + if proc.returncode != 0: + return [] + return [p for p in proc.stdout.split() if not p.endswith("/" + cells)] + + +def run_suite(tree: Path, pkgs: list[str], log: Path, budget: int, + only: list[str] | None = None) -> tuple[set[str], set[str]]: + """(failing test names, packages that would not build) for one tree.""" + cmd = ["go", "test", "-count=1"] + if only: + cmd += ["-run", "^(" + "|".join(re.escape(t.split("/")[0]) for t in sorted(only)) + ")$"] + cmd += pkgs + try: + proc = subprocess.run(cmd, cwd=tree, env=go_env(), capture_output=True, + text=True, timeout=budget) + except subprocess.TimeoutExpired: + fault(f"the suite did not finish inside {budget}s in {tree.name}") + out = proc.stdout + proc.stderr + log.write_text(out) + if "failed to initialize build cache" in out or "no space left on device" in out: + fault(f"the suite could not be run at all (see {log})") + failed = {m.group(1) for m in (FAIL_LINE.match(line) for line in out.splitlines()) if m} + broken = {m.group(1) for m in (BUILD_FAIL.match(line) for line in out.splitlines()) if m} + return failed, broken + + +def main() -> None: + if len(sys.argv) != 6: + fault("suite_gate.py ") + base = Path(sys.argv[1]) + repo = Path(sys.argv[2]) + state = Path(sys.argv[3]) + cells = sys.argv[4] + budget = int(sys.argv[5]) + deadline = time.time() + budget + + if not (base / "go.mod").is_file(): + fault(f"no pristine base checkout at {base}") + state.mkdir(parents=True, exist_ok=True) + + cand = state / "suite-cand" + shutil.rmtree(cand, ignore_errors=True) + try: + shutil.copytree(repo, cand, symlinks=True, + ignore=shutil.ignore_patterns(".git", cells)) + except OSError as exc: + fault(f"cannot take a copy of {repo}: {exc}") + restored, added = normalise(base, cand, cells) + print(f" the suite is the shipped one: {restored} test files restored, " + f"{added} added by the candidate set aside") + + pkgs = packages(cand, cells, 120) + if not pkgs: + print("FAIL: the packages of the module cannot be enumerated in this tree") + sys.exit(1) + + share = max(60, int(deadline - time.time() - 90)) + failed, broken = run_suite(cand, pkgs, state / "suite-cand.log", share) + if broken: + print("FAIL: packages of the repository do not build with their own tests in this tree:") + for p in sorted(broken)[:10]: + print(f" {p}") + sys.exit(1) + if failed: + left = int(deadline - time.time() - 10) + if left < 60: + fault("no budget left to re-run the tests that failed once") + again, _ = run_suite(cand, pkgs, state / "suite-cand-retry.log", left, sorted(failed)) + failed = sorted(t for t in failed if t in again) + if failed: + print("FAIL: the repository's own tests fail in this tree (twice in a row):") + for t in failed[:20]: + print(f" {t}") + sys.exit(1) + print(f"PASS: the repository's own suite is green ({len(pkgs)} packages)") + sys.exit(0) + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/bazel-remote-v2/task/grader/run_grading.sh b/harbor/sources/bazel-remote-v2/task/grader/run_grading.sh new file mode 100644 index 0000000000000000000000000000000000000000..d497f38e5e051033c9ab8c8da8087e454ed3ff8f --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/grader/run_grading.sh @@ -0,0 +1,251 @@ +#!/usr/bin/env bash +# Hidden grading for the bazel-remote disk cache accounting task — ONE FUNCTION +# PER CRITERION. +# +# Usage: run_grading.sh [budget_seconds] +# criterion ∈ admitted_blob_survives_restart_with_the_same_limits | +# admitted_blob_is_kept_despite_stored_form_overhead | +# admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation | +# cache_dir_with_oversized_blob_still_loads_and_discards_it | +# logical_size_is_reported_in_plain_bytes | +# evicted_bytes_counter_ignores_lost_files | +# entry_size_summary_observes_each_entry_size | +# gate_repo_suite_green_and_tests_untouched +# +# WHAT IS MEASURED, AND WHERE IT COMES FROM +# +# Every weighted criterion is one cell of spec/cells_test.go, which lives under +# /hud (root, mode 700) and is copied into the candidate's module as a package +# of its own right before the cell runs, in its own `go test` process. The cell +# drives the disk cache through its exported API only — disk.New, Put, Get, +# Contains, Stats, RegisterMetrics and the Prometheus registry the cache +# registers into — over blobs it generates from fixed seeds in its own temporary +# directory, and prints `CELL= PASS|FAIL `. There is no service, +# no port, no network (law K1: GOPROXY=off, the module cache was filled when the +# image was built) and no judge of any kind. +# +# The cells package is DELETED and re-copied for every criterion, so nothing a +# candidate leaves behind under that name survives into a verdict. +# +# The last entry point is the board's GATE (G-5/G-5′): the repository's own test +# files are the ones it shipped, and no test that passes on the pristine tree +# fails on the candidate's. Test files the candidate ADDS do not fail it. +# +# THREE OUTCOMES. 0 = PASS, 1 = FAIL (the check ran and the tree did not meet +# the criterion), 3 = GRADER FAULT (the check could not judge: no toolchain, an +# unwritable build cache, our own budget ran out before the cell could start). +# +# A tree that does not build fails every criterion as a VERDICT. So does a tree +# the cells cannot be compiled against (the exported cache API was removed), and +# so does a cell that hangs or panics in the candidate's code: Go's own -timeout +# fires first and the missing verdict line is a FAIL. +# +# Grading is execution only. Nothing here reads the agent's source for meaning. + +set -u -o pipefail + +REPO_DIR=${REPO_DIR:-/workspace/repo} +HARNESS_DIR=${HARNESS_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/harness} +STATE=${GRADER_STATE_DIR:-/hud/logs/grading-state} +BASE_SRC=${BASE_SRC:-/hud/base-src} +PYTHON_BIN=${PYTHON_BIN:-python3} +BUDGET=${2:-600} + +CELLS_PKG=${CELLS_PKG:-zzaccountingcells} + +# HARNESS_DIR may name the harness itself or the grader directory above it +# (calibrate.py passes the grader directory); the spec and the suite gate live in +# harness/. +[ -d "$HARNESS_DIR/harness/spec" ] && HARNESS_DIR="$HARNESS_DIR/harness" + +# A login shell throws the image's PATH away (Debian's /etc/profile assigns it +# unconditionally) and hud's BashGrader runs `/bin/bash -lc`, so the toolchain is +# put back here rather than assumed. GOPROXY=off: grading never reaches out. +export PATH=/usr/local/go/bin:${PATH:-/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin} +export GOPROXY=off GOFLAGS=-mod=mod GOTOOLCHAIN=local GOWORK=off +export GOCACHE=${GOCACHE:-/hud/gocache} +export GOMODCACHE=${GOMODCACHE:-/go/pkg/mod} +export GOPATH=${GOPATH:-/go} + +mkdir -p "$STATE" "$GOCACHE" 2>/dev/null || true + +say() { echo "$@"; } +note() { echo " $*"; } +fault() { echo "GRADER FAULT: $*"; exit 3; } + +# purge_tmp_residue — law E-5. The cells and the suite write only under +# t.TempDir(); TMPDIR is pointed at a directory of the grader's own that is +# emptied before every run, so nothing an earlier run or a candidate left under +# /tmp can decide a verdict. +purge_tmp_residue() { + mkdir -p "$STATE/tmp" 2>/dev/null || true + rm -rf "${STATE:?}/tmp"/* 2>/dev/null || true + export TMPDIR="$STATE/tmp" +} + +# tree_fingerprint — the build verdict below is cached per grading; the cache is +# keyed by the tree's Go sources so a state directory reused for another tree +# can never hand that tree an old verdict. +tree_fingerprint() { + ( cd "$REPO_DIR" && find . -path "./$CELLS_PKG" -prune -o -path ./.git -prune -o \ + -type f \( -name '*.go' -o -name 'go.mod' \) -print 2>/dev/null | LC_ALL=C sort \ + | xargs sha256sum 2>/dev/null | sha256sum | cut -c1-32 ) +} + +candidate_builds() { + local fp; fp=$(tree_fingerprint) + [ -f "$STATE/build-$fp.ok" ] && return 0 + [ -f "$STATE/build-$fp.bad" ] && return 1 + rm -rf "${REPO_DIR:?}/$CELLS_PKG" + timeout $((BUDGET * 2 / 3)) sh -c "cd '$REPO_DIR' && go build ./..." \ + >"$STATE/candidate-build.log" 2>&1 + local rc=$? + if [ $rc -eq 0 ]; then + : > "$STATE/build-$fp.ok"; return 0 + fi + # Our own budget running out is not the compiler's verdict about the tree. + [ $rc -eq 124 ] && fault "go build did not finish inside $((BUDGET * 2 / 3))s (the builder, not the tree)" + if grep -qE 'failed to initialize build cache|could not create module cache|no space left on device|cannot find GOROOT|go: cannot find main module|permission denied|go: command not found' \ + "$STATE/candidate-build.log"; then + sed 's/^/ /' "$STATE/candidate-build.log" | head -5 + fault "the build could not be run at all (see $STATE/candidate-build.log)" + fi + : > "$STATE/build-$fp.bad" + note "the candidate tree does not build:" + sed 's/^/ /' "$STATE/candidate-build.log" | head -20 + return 1 +} + +install_cells() { + [ -r "$HARNESS_DIR/spec/cells_test.go" ] || fault "no cells file at $HARNESS_DIR/spec/cells_test.go" + rm -rf "${REPO_DIR:?}/$CELLS_PKG" || fault "cannot clear $REPO_DIR/$CELLS_PKG" + mkdir -p "$REPO_DIR/$CELLS_PKG" || fault "cannot create $REPO_DIR/$CELLS_PKG" + cp "$HARNESS_DIR/spec/cells_test.go" "$REPO_DIR/$CELLS_PKG/cells_test.go" \ + || fault "cannot install the cells into the tree" +} + +# decide — the whole life of one cell-backed criterion. +decide() { + local cell=$1 + purge_tmp_residue + command -v go >/dev/null 2>&1 || fault "no Go toolchain on PATH" + if ! candidate_builds; then + say "FAIL: the tree does not build, so nothing about $cell can be met" + return 1 + fi + install_cells + local log=$STATE/cell-$cell.log + local gotmo=$(( BUDGET / 2 - 30 )); [ "$gotmo" -lt 60 ] && gotmo=60 + timeout $(( BUDGET - 20 )) sh -c \ + "cd '$REPO_DIR' && go test ./$CELLS_PKG -run '^TestCell_$cell\$' -count=1 -v -timeout ${gotmo}s" \ + >"$log" 2>&1 + local rc=$? + rm -rf "${REPO_DIR:?}/$CELLS_PKG" + if grep -qE 'failed to initialize build cache|could not create module cache|no space left on device|cannot find GOROOT' "$log"; then + sed 's/^/ /' "$log" | head -5 + fault "the cell could not be run at all (see $log)" + fi + if [ $rc -eq 0 ] && grep -q "^CELL=$cell PASS" "$log"; then + say "PASS: $(grep -m1 "^CELL=$cell PASS" "$log" | cut -c1-400)" + return 0 + fi + if grep -q "^CELL=$cell FAIL" "$log"; then + say "FAIL: $(grep -m1 "^CELL=$cell FAIL" "$log" | cut -c1-400)" + return 1 + fi + if [ $rc -eq 124 ] && ! grep -q '^=== RUN' "$log"; then + fault "the cell $cell was still compiling when the budget ran out" + fi + if [ $rc -eq 124 ]; then + say "FAIL: $cell did not finish; the candidate's cache hung under it" + tail -10 "$log" | sed 's/^/ /' + return 1 + fi + if grep -qE '\[build failed\]|\[setup failed\]' "$log"; then + say "FAIL: the cells cannot be compiled against this tree (they use only the exported disk cache API):" + grep -vE '^(ok|---|===)' "$log" | head -20 | sed 's/^/ /' + return 1 + fi + if [ $rc -ne 0 ]; then + say "FAIL: $cell reported no verdict (rc=$rc): the candidate's cache panicked or timed out under it" + grep -vE '^(===|ok )' "$log" | tail -20 | sed 's/^/ /' + return 1 + fi + fault "the cell $cell ran and printed no verdict" +} + +# ─── one function per criterion ─────────────────────────────────────────────── + +admitted_blob_survives_restart_with_the_same_limits() { decide admitted_blob_survives_restart_with_the_same_limits; } +admitted_blob_is_kept_despite_stored_form_overhead() { decide admitted_blob_is_kept_despite_stored_form_overhead; } +admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation() { decide admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation; } +cache_dir_with_oversized_blob_still_loads_and_discards_it() { decide cache_dir_with_oversized_blob_still_loads_and_discards_it; } +logical_size_is_reported_in_plain_bytes() { decide logical_size_is_reported_in_plain_bytes; } +evicted_bytes_counter_ignores_lost_files() { decide evicted_bytes_counter_ignores_lost_files; } +entry_size_summary_observes_each_entry_size() { decide entry_size_summary_observes_each_entry_size; } + +# ─── the gate (G-5 / G-5′) ──────────────────────────────────────────────────── +gate_repo_suite_green_and_tests_untouched() { + purge_tmp_residue + [ -d "$BASE_SRC" ] || fault "no pristine base checkout at $BASE_SRC" + rm -rf "${REPO_DIR:?}/$CELLS_PKG" + "$PYTHON_BIN" - "$BASE_SRC" "$REPO_DIR" "$CELLS_PKG" <<'PYEOF' || return 1 +import hashlib, os, sys +base, cand, cells = sys.argv[1], sys.argv[2], sys.argv[3] +def digest(path): + h = hashlib.sha256() + with open(path, "rb") as fh: + for chunk in iter(lambda: fh.read(65536), b""): + h.update(chunk) + return h.hexdigest() +changed, n = [], 0 +for root, dirs, files in os.walk(base): + dirs[:] = [d for d in dirs if d not in (".git", cells)] + for name in files: + if not name.endswith("_test.go"): + continue + n += 1 + rel = os.path.relpath(os.path.join(root, name), base) + theirs = os.path.join(cand, rel) + if not os.path.isfile(theirs): + changed.append(rel + ": removed") + elif digest(theirs) != digest(os.path.join(base, rel)): + changed.append(rel + ": edited") +if n == 0: + print("GRADER FAULT: the pristine checkout carries no test files"); sys.exit(3) +if changed: + print("FAIL: test files the repository shipped are not the ones it shipped") + for line in changed[:20]: + print(" " + line) + sys.exit(1) +print(" the %d test files of the repository are untouched" % n) +PYEOF + command -v go >/dev/null 2>&1 || fault "no Go toolchain on PATH" + if ! candidate_builds; then + say "FAIL: the tree does not build" + return 1 + fi + timeout $((BUDGET - 20)) "$PYTHON_BIN" "$HARNESS_DIR/suite_gate.py" \ + "$BASE_SRC" "$REPO_DIR" "$STATE" "$CELLS_PKG" $((BUDGET - 60)) + local rc=$? + [ $rc -eq 124 ] && fault "the suite gate did not finish inside its budget" + return $rc +} + +# ─── entry ──────────────────────────────────────────────────────────────────── + +CRITERION=${1:-} +case "$CRITERION" in + admitted_blob_survives_restart_with_the_same_limits|\ + admitted_blob_is_kept_despite_stored_form_overhead|\ + admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation|\ + cache_dir_with_oversized_blob_still_loads_and_discards_it|\ + logical_size_is_reported_in_plain_bytes|\ + evicted_bytes_counter_ignores_lost_files|\ + entry_size_summary_observes_each_entry_size|\ + gate_repo_suite_green_and_tests_untouched) + "$CRITERION"; exit $? ;; + *) + echo "usage: run_grading.sh [budget_seconds]" >&2 + exit 3 ;; +esac diff --git a/harbor/sources/bazel-remote-v2/task/prompt.md b/harbor/sources/bazel-remote-v2/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..8f5fbb417692dcb0ec803fefbe46de6419e5bacb --- /dev/null +++ b/harbor/sources/bazel-remote-v2/task/prompt.md @@ -0,0 +1,3 @@ +# Ticket + +Every reported number covers the bytes or events it names, logical sizes in plain bytes, each entry observed at its own size; an admitted write never loses its space to a concurrent write, a reopening under the same limits, or the stored form's overhead; a directory always opens, dropping what no longer fits. Existing tests stay unchanged and green. diff --git a/harbor/sources/bazel-remote-v2/tasks.py b/harbor/sources/bazel-remote-v2/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..0f7bf44472aca7a34f627acf36d62978d9d14853 --- /dev/null +++ b/harbor/sources/bazel-remote-v2/tasks.py @@ -0,0 +1,258 @@ +"""bazel-remote disk cache byte accounting: the board and the grading of it. + +GRADERS is the single list of ALL criteria: (name, weight, blocker, kind, +timeout). It is a literal table on purpose — calibrate.py, mutprobe.py and the +offline gates read it out of this file by AST, so a computed table would be +invisible to all of them. The assertions below are executed on import: a +tasks.py that breaks one of them cannot be loaded, let alone deployed. + +Generated by orch/pkg_init.py from board.json; edit both or neither. +""" + +from __future__ import annotations + +from decimal import Decimal +from pathlib import Path + +from hud.graders import BashGrader, EvaluationResult, SubScore, combine + +from coding import repo as repo_lib +from env import LOGS_DIR, REPO_DIR, VAULT_DIR, WORKSPACE_NOTE, env, _setup + +PROMPT = (Path(__file__).parent / "task" / "prompt.md").read_text() +GRADER = "/hud/grader/run_grading.sh" +GOLD_DIFF = Path("/hud/gold.diff") + +# On blocker failure the reward is capped FLAT. Any number of failed blockers +# sets the same ceiling; the cap never drops below 0.60, and the gradient below +# it is preserved, so what separates two wrong answers is which criteria they met. +BLOCKER_CAP = 0.60 + +# G-5: the gate is a cell of the board like any other — it is IN the weights +# table, it is handed to `combine` with the rest, and it blocks. Its weight is +# deliberately small: enough that the scoreboard shows it, not enough to buy +# anything. +GATE = "gate_repo_suite_green_and_tests_untouched" +GATE_WEIGHT = Decimal("0.0100") +GATE_TIMEOUT = 900 + +# v2 (R-18/Z9', 14.09): ТОЛЬКО веса. Имена клеток, флаги блокеров, кап, гейт и тикет — +# те же, что в v1 (Z-3, T-1, ORG19 8/8 не меняется). argmin mean по пяти живым деревьям +# v1 (orch/reweight.py, forensics/v1-reweight.json): 0.5840 -> 0.5140, d=4, band=measure. +# Коридор ядра max/min = 0.27/0.09 = x3.00 — ровно потолок ассерта образа (Dockerfile.hud §7). +WEIGHTS = { + "admitted_blob_survives_restart_with_the_same_limits": Decimal("0.2700"), + "admitted_blob_is_kept_despite_stored_form_overhead": Decimal("0.2700"), + "admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation": Decimal("0.0900"), + "cache_dir_with_oversized_blob_still_loads_and_discards_it": Decimal("0.0900"), + "logical_size_is_reported_in_plain_bytes": Decimal("0.0900"), + "evicted_bytes_counter_ignores_lost_files": Decimal("0.0900"), + "entry_size_summary_observes_each_entry_size": Decimal("0.0900"), + "gate_repo_suite_green_and_tests_untouched": Decimal("0.0100"), +} +BLOCKERS = frozenset({ + "admitted_blob_survives_restart_with_the_same_limits", + "gate_repo_suite_green_and_tests_untouched", +}) + +GRADERS = [ + ("admitted_blob_survives_restart_with_the_same_limits", 0.2700, True, "bash", 600), + ("admitted_blob_is_kept_despite_stored_form_overhead", 0.2700, False, "bash", 600), + ("admitted_blob_is_kept_despite_block_rounding_under_concurrent_reservation", 0.0900, False, "bash", 600), + ("cache_dir_with_oversized_blob_still_loads_and_discards_it", 0.0900, False, "bash", 600), + ("logical_size_is_reported_in_plain_bytes", 0.0900, False, "bash", 600), + ("evicted_bytes_counter_ignores_lost_files", 0.0900, False, "bash", 600), + ("entry_size_summary_observes_each_entry_size", 0.0900, False, "bash", 600), + ("gate_repo_suite_green_and_tests_untouched", 0.0100, True, "bash", 900), +] + +# ─── the scoreboard's arithmetic, checked where it is written ────────────── +assert [n for n, _w, _b, _k, _t in GRADERS] == list(WEIGHTS), \ + "GRADERS and WEIGHTS list different criteria, or list them in a different order" +assert all(Decimal(str(w)) == WEIGHTS[n] for n, w, _b, _k, _t in GRADERS), \ + "a weight in GRADERS disagrees with the Decimal table above it" +assert all(b == (n in BLOCKERS) for n, _w, b, _k, _t in GRADERS), \ + "a blocker flag in GRADERS disagrees with BLOCKERS" +assert sum(WEIGHTS.values()) == Decimal("1.0000"), \ + f"the weights sum to {sum(WEIGHTS.values())}, not 1.0000" +assert all(w > 0 for w in WEIGHTS.values()), "a criterion carries no weight" +assert len(WEIGHTS) >= 6, "fewer than six criteria" +# §1.A + B-1 +assert BLOCKERS, "no blocker: a board with nothing that must be right is not a board" +assert all(WEIGHTS[n] <= Decimal("0.30") for n in BLOCKERS), "a blocker is worth more than 0.30" +assert sum(WEIGHTS[n] for n in BLOCKERS) <= Decimal("0.75"), "the blocking mass is over 0.75" +assert min(Decimal("1.00") - max(WEIGHTS[n] for n in BLOCKERS), + Decimal(str(BLOCKER_CAP))) >= Decimal("0.60"), \ + "a tree that fails one blocker would land below 0.60" +assert BLOCKER_CAP >= 0.60, "the blocker cap is below the floor" +# G-5 +assert GATE in WEIGHTS, "the gate is a cell of the board and must be in the table" +assert WEIGHTS[GATE] == GATE_WEIGHT and GATE_WEIGHT >= Decimal("0.01"), \ + "the gate carries no weight (G-5: every gate is a blocker worth at least 0.01)" +assert GATE in BLOCKERS, "the gate is a blocker" +assert GRADERS[-1][0] == GATE, "the gate runs last" +assert GRADERS[-1][4] == GATE_TIMEOUT, "the gate's budget is written down twice and they differ" + + +# ─── grading machinery ───────────────────────────────────────────────────── + +# run_grading.sh exits 3 when the grader COULD NOT JUDGE (an interpreter that +# would not run, a missing report, its own budget). A fault is not a failed +# criterion: it earns nothing and it proves nothing, so a faulted blocker keeps +# the cap on rather than passing quietly. +FAULT_EXIT = 3 + + +def _fault_reason(stdout: str) -> str: + tail = (stdout or "").strip().splitlines() + return tail[-1][:200] if tail else "the grader exited %d without a word" % FAULT_EXIT + + +def _absolve_faults(subscores) -> dict: + faults = {} + for s in subscores: + meta = getattr(s, "metadata", None) or {} + if meta.get("exit_code") == FAULT_EXIT or meta.get("returncode") == FAULT_EXIT: + faults[s.name] = _fault_reason(meta.get("stdout") or meta.get("stderr") or "") + return faults + + +def _measured_scale(subscores, faults) -> tuple: + """(weight that was measured, reward expressed over that weight).""" + weights = {name: weight for name, weight, _b, _k, _t in GRADERS} + measured = sum(w for n, w in weights.items() if n not in faults) + if measured <= 0: + return 0.0, 0.0 + earned = sum(weights[s.name] * s.value for s in subscores + if s.name in weights and s.name not in faults) + return float(measured), float(earned / measured) + + +async def _grade(validate_mode: str | None) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + diff = GOLD_DIFF.read_text() + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult( + reward=0.0, content="patch failed to apply", info={"git_apply": apply_error} + ) + + subscores: list[SubScore] = [] + for name, weight, _blocker, _kind, timeout in GRADERS: + subscores.append( + await BashGrader.grade( + weight, + name=name, + command=f"bash {GRADER} {name} {timeout}", + cwd=str(REPO_DIR), + timeout_seconds=timeout, + ) + ) + + faults = _absolve_faults(subscores) + # G-5-prime: гейт зелен только рядом с зелёной клеткой. Гейт, который + # проходит на нетронутом checkout, иначе платит за пустой diff, и лестница + # читает base/noop как массу гейта вместо 0.000. Ни одной измеренной + # не-гейтовой клетки в зелёном => гейт зарабатывает ноль (и, как блокер, + # кладёт итог на кап, который на пустом дереве и без того ноль). + _G5P_GATES = ("gate_repo_suite_green_and_tests_untouched",) + _g5p_cells = [s for s in subscores + if s.name not in _G5P_GATES and s.name not in faults] + if _g5p_cells and not any(s.value > 0.0 for s in _g5p_cells): + for _g5p in subscores: + if _g5p.name in _G5P_GATES and _g5p.value > 0.0: + _g5p.value = 0.0 + _g5p.info = {**(_g5p.info or {}), "g5_prime": + "the gate earns nothing on a tree that met no " + "criterion: a green gate on an empty change is " + "weight for doing nothing"} + result = await combine(*subscores) + + failed = sorted( + (name, weight) + for name, weight, blocker, _kind, _t in GRADERS + if blocker and name not in faults + and next(s.value for s in subscores if s.name == name) < 1.0 + ) + unproven = sorted(n for n, _w, blocker, _k, _t in GRADERS if blocker and n in faults) + + if faults: + measured_weight, over_measured = _measured_scale(subscores, faults) + capped = bool(failed) or bool(unproven) + return EvaluationResult( + reward=result.reward if not capped else max(0.0, min(result.reward, BLOCKER_CAP)), + subscores=result.subscores, + isError=True, + info={**result.info, "grader_faults": dict(faults), + "failed_blockers": [n for n, _w in failed], + "unproven_blockers": unproven, + "measured_weight": round(measured_weight, 4), + "reward_over_measured_weight": round(over_measured, 4)}, + content=( + "GRADER FAULT: this run was not graded. " + + "; ".join(f"{n}: {why}" for n, why in faults.items()) + + ". A fault is the grader failing to judge, not the change failing a " + "criterion. A criterion that was not measured earns nothing, and a " + f"blocker that was not proven keeps the {BLOCKER_CAP:.2f} ceiling on. " + "This run has to be re-run; do not read the reward as a measurement." + ), + ) + + if failed: + reward = max(0.0, min(result.reward, BLOCKER_CAP)) + names = [name for name, _weight in failed] + return EvaluationResult( + reward=reward, subscores=result.subscores, + info={**result.info, "uncapped_reward": result.reward, + "failed_blockers": names, "blocker_cap": BLOCKER_CAP}, + content=(f"Blocker criteria failed ({', '.join(names)}); " + f"cap {BLOCKER_CAP:.2f}, reward {reward:.3f} " + f"(uncapped {result.reward:.3f})."), + ) + return result + + +@env.template( + id="bazel_remote_disk_eviction_accounting_contract", + description=( + "bazel-remote disk cache byte accounting: space granted to an admitted " + "write is never withdrawn (not at commit, not by a restart with the same " + "limits), figures and counters describe only the bytes they name, and a " + "cache directory always loads." + ), +) +async def bazel_remote_disk_eviction_accounting_contract( + validate_mode: str | None = None, + revision: str | None = "v2", +): + # V-2: `revision` is INERT. It exists so that a change of ticket, gold, + # grader or image can be handed to `hud sync tasks` as an argument, which is + # part of the task signature and therefore yields a NEW task version in the + # UI (columns alone do not). Nothing in the scenario or the grading reads it; + # it is provenance, and it is deliberately never shown to the agent. + _ = revision + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + if validate_mode == "golden": + _ = yield "Golden-validation run: no work is expected of you. Finish immediately." + else: + # E-4: the ticket travels inside the coding-task scenario's own framing, + # never bare. The same words handed over without it have been measured to + # change how a run starts. + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. " + f"{WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests " + "grade your work when you finish; do not modify existing tests.\n\n" + f"{PROMPT}" + ) + yield await _grade(validate_mode) + + +tasks = [bazel_remote_disk_eviction_accounting_contract(revision="v2")] diff --git a/harbor/sources/celery-v12/Dockerfile.hud b/harbor/sources/celery-v12/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..da08fbf169fb29f6c30f3e25f1c21feb8e917f18 --- /dev/null +++ b/harbor/sources/celery-v12/Dockerfile.hud @@ -0,0 +1,248 @@ +# celery: an expiry is a fixed deadline for retries, deliveries and eager runs. +# +# Substrate: celery/celery at the pinned commit, CPython 3.12, hud serve. +# Everything answer-key-shaped lives under /hud (root, mode 700): the vault, the +# hidden grader and its held-out program, the pristine base checkout, gold.diff +# and the calibration controls. Agent shells drop to uid 1000 (setpriv), so +# /hud is unreadable from the agent side. +# +# The network is used only while this image builds (pip, git). Grading needs +# none (K1): the held-out program runs the candidate's celery on an in-process +# memory:// broker and cache+memory:// result backend, and the gate runs the +# repository's own unit tests, which need no service either. +# +# THE IMAGE DOES NOT EXIST UNLESS IT IS CALIBRATED (CALIB_MODE=full): gold 1.000 +# with every criterion green one by one, base 0.000 with every cell red one by +# one, noop 0.000, lazy < 0.50, alt >= 0.80, cheat capped. + +FROM python@sha256:782412e85d0f0984994c290652577d4018aff08145c85b262bb63dc0c7522254 + +ARG REPO_URL=https://github.com/celery/celery.git +ARG REPO_SHA=9b1895ff355d5cf99377dbd70841b511efb4885b + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git curl ca-certificates util-linux patch procps rsync \ + && rm -rf /var/lib/apt/lists/* + +# E-3: /tmp sticky and world-writable. +RUN install -d -m 1777 /tmp + +# The agent runs as uid 1000 (setpriv, below), and the pinned base image has no +# passwd/group entry for it. celery's own code looks the running process up in +# the user database — celery/platforms.py:872 `grp.getgrgid(gid)` — so without +# an entry the gate's suite dies for uid 1000 with +# `KeyError: getgrgid(): gid not found: 1000` on the PRISTINE checkout +# (t/unit/utils/test_platforms.py::test_check_privileges, measured 14.09), and +# the E-5 assertion below cannot pass. A real user, not just a bare numeric id. +RUN set -eux; \ + groupadd -g 1000 agent; \ + useradd -u 1000 -g 1000 -M -d /tmp/agent-home -s /bin/bash agent; \ + getent passwd 1000; \ + getent group 1000 + +# TWO INTERPRETERS (E-3). +# /opt/hudvenv — the env process: hud pinned to the runner's version. +# /opt/agentvenv — the agent's and the grader's interpreter: celery's runtime +# requirements and its unit-test plugins, no hud, no celery +# (the tree at /workspace/repo is the package). +RUN python -m venv /opt/hudvenv \ + && /opt/hudvenv/bin/pip install --no-cache-dir "hud==0.6.15" "pytest==8.3.4" +COPY toolchain/requirements-agent.txt /opt/requirements-agent.txt +RUN python -m venv /opt/agentvenv \ + && /opt/agentvenv/bin/pip install --no-cache-dir -r /opt/requirements-agent.txt \ + && /opt/agentvenv/bin/python -m pytest --version \ + && ! /opt/agentvenv/bin/python -c "import celery" 2>/dev/null +ENV PATH="/opt/hudvenv/bin:${PATH}" + +# PATH guard (warm toolchain for login shells). hud's BashGrader runs +# `bash -lc` and an agent session is `env -i ... bash -l`; Debian's +# /etc/profile resets PATH, so the agent's interpreter goes on PATH here. +RUN set -eux; \ + printf '%s\n' \ + 'case ":$PATH:" in' \ + ' *:/opt/agentvenv/bin:*) ;;' \ + ' *) PATH="/opt/agentvenv/bin:$PATH" ;;' \ + 'esac' \ + 'export PATH' \ + 'if [ "$(id -u)" != "0" ]; then' \ + ' : "${PYTHONDONTWRITEBYTECODE:=1}"' \ + ' : "${PYTHONUNBUFFERED:=1}"' \ + ' : "${PYTHONNOUSERSITE:=1}"' \ + ' : "${PYTHONPATH:=/workspace/repo}"' \ + ' export PYTHONDONTWRITEBYTECODE PYTHONUNBUFFERED PYTHONNOUSERSITE PYTHONPATH' \ + 'fi' \ + > /etc/profile.d/10-python-toolchain.sh; \ + chmod 0644 /etc/profile.d/10-python-toolchain.sh; \ + env -i PATH=/usr/bin:/bin bash -lc 'command -v python' | grep -q '^/opt/agentvenv/bin/python$' + +# ── the substrate at the pinned commit ───────────────────────────────────── +RUN mkdir -p /workspace \ + && git init -q /workspace/repo \ + && cd /workspace/repo \ + && git remote add origin ${REPO_URL} \ + && git fetch --depth 1 origin ${REPO_SHA} \ + && git checkout -q FETCH_HEAD \ + && git checkout -q -b main \ + && test "$(git rev-parse HEAD)" = "${REPO_SHA}" \ + && git remote remove origin \ + && git config --system user.email "dev@localhost" \ + && git config --system user.name "dev" \ + && git config --system --add safe.directory /workspace/repo + +# ── the one marker the checkout's own ini forgets ────────────────────────── +# t/unit/app/test_backends.py:116 carries @pytest.mark.celery, and the pinned +# checkout's pyproject.toml runs with --strict-markers while its markers list +# does not name "celery": upstream registers that marker at runtime from +# celery/contrib/pytest.py, whose pytest_configure hook fires only when celery +# is an INSTALLED distribution (upstream's requirements/test.txt pulls +# pytest-celery; celery's own setup.py declares no pytest11 entry point). This +# image installs neither — the tree at /workspace/repo IS the package — so the +# marker is unknown and the gate's suite dies while COLLECTING, on the pristine +# checkout, before one test runs. G-4: a gate red on the base is not a gate. +# Declaring it in the ini is the hermetic repair. The grader runs the suite as +# `-c "$BASE_SRC/pyproject.toml"` out of root-only /hud, so the declaration +# cannot be reverted from the agent's side, and — unlike `-p +# celery.contrib.pytest` — no candidate code is loaded as a pytest plugin, +# which would hand the tree pytest_runtest_makereport, the cheat control's own +# lever (task/grader/controls/cheat.diff). Committed, because E-5 asserts a +# clean `git status` for uid 1000; nothing reads /hud/base_sha, and the agent's +# diff is captured against the container's setup commit, not against REPO_SHA. +RUN set -eux; \ + cd /workspace/repo; \ + grep -q '^markers = \["sleepdeprived_patched_module"' pyproject.toml; \ + sed -i 's/^\(markers = \[\)/\1"celery(**overrides): override celery configuration for a test case", /' pyproject.toml; \ + grep -q '^markers = \["celery(\*\*overrides): override celery configuration for a test case", "sleepdeprived_patched_module"' pyproject.toml; \ + git add pyproject.toml; \ + git commit -q -m "image: declare celery's own pytest marker in the checkout's ini"; \ + test -z "$(git status --porcelain)" + +RUN set -eux; \ + mkdir -p /hud; \ + cp -a /workspace/repo /hud/base-src; \ + rm -rf /hud/base-src/.git; \ + git -C /workspace/repo rev-parse HEAD > /hud/base_sha + +# ── /hud: everything the agent must never read ───────────────────────────── +COPY task/grader/ /hud/grader/ +COPY task/gold.diff /hud/gold.diff +COPY tasks.py calibrate.py /hud/ +RUN set -eux; chmod +x /hud/grader/run_grading.sh; chown -R root:root /hud; chmod -R 700 /hud + +ENV REPO_DIR=/workspace/repo \ + VAULT_DIR=/hud/vault \ + GRADING_LOGS_DIR=/hud/logs \ + GOLD_DIFF=/hud/gold.diff \ + GRADER_DIR=/hud/grader \ + HARNESS_DIR=/hud/grader \ + BASE_SRC=/hud/base-src \ + GRADER_STATE_DIR=/hud/logs/grading-state \ + PYTHON_BIN=/opt/agentvenv/bin/python + +# ── PRISTINE_GREEN: the gate's suite is green on the untouched checkout ──── +RUN set -eux; \ + cd /hud/base-src; \ + t0=$(date +%s); \ + PYTHONDONTWRITEBYTECODE=1 PYTHONPATH=/hud/base-src /opt/agentvenv/bin/python -m pytest \ + t/unit/app t/unit/tasks t/unit/worker t/unit/utils -q -p no:cacheprovider --timeout=300 \ + $(grep -vE '^[[:space:]]*(#|$)' /hud/grader/suite_deselect.txt | sed 's/^/--deselect /' | tr '\n' ' ') \ + > /tmp/base-suite.txt 2>&1 \ + || { tail -30 /tmp/base-suite.txt; echo "PRISTINE_GREEN FAILED"; exit 1; }; \ + tail -1 /tmp/base-suite.txt; rm -f /tmp/base-suite.txt; \ + el=$(( $(date +%s) - t0 )); gb=$(grep -E '^GATE_TIMEOUT = ' /hud/tasks.py | awk '{print $3}'); \ + echo "PRISTINE_GREEN_SECONDS=$el gate_budget=$gb"; \ + [ "$el" -le $(( gb / 3 )) ] || { echo "PRISTINE_GREEN TOO SLOW: ${el}s > budget/3 (D4)"; exit 1; }; \ + rm -f /hud/base-src/statefilename; \ + find /hud/base-src -name '__pycache__' -type d -prune -exec rm -rf {} + + +# ── the workspace is the base SHA, not the solution ──────────────────────── +RUN set -eux; \ + cd /workspace/repo && git apply --check /hud/gold.diff; \ + for c in lazy alt cheat; do git apply --check /hud/grader/controls/$c.diff; done + +# ── calibration: the six-rung ladder, with the real grader ───────────────── +ARG CALIB_MODE=full +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN set -eux; \ + echo "builder: nproc=$(nproc) MemTotal=$(awk '/MemTotal/{print $2"kB"}' /proc/meminfo)"; \ + echo "calibration mode: ${CALIB_MODE}"; \ + case "${CALIB_MODE}" in full|smoke|none) ;; *) echo "unknown CALIB_MODE=${CALIB_MODE}" >&2; exit 2 ;; esac; \ + if [ "${CALIB_MODE}" != none ]; then \ + mkdir -p /hud/.calib; \ + for t in base gold noop lazy alt cheat; do cp -a /hud/base-src /hud/.calib/$t; done; \ + (cd /hud/.calib/gold && git init -q . && git apply /hud/gold.diff && rm -rf .git); \ + for c in lazy alt cheat; do (cd /hud/.calib/$c && git init -q . && git apply /hud/grader/controls/$c.diff && rm -rf .git); done; \ + sed -i 's|^class Context:|# calibration control: a comment, and nothing else, has changed\nclass Context:|' /hud/.calib/noop/celery/app/task.py; \ + grep -q 'calibration control' /hud/.calib/noop/celery/app/task.py; \ + ( while sleep 60; do echo " ... calibration still running ($(date -u +%H:%M:%S)) ..."; done ) & hb=$!; \ + if [ "${CALIB_MODE}" = full ]; then \ + stdbuf -oL -eL /opt/agentvenv/bin/python -u /hud/calibrate.py gold base noop lazy alt cheat 2>&1 | tee /hud/calibration.txt; \ + grep -q '^LADDER ' /hud/calibration.txt; \ + else \ + stdbuf -oL -eL /opt/agentvenv/bin/python -u /hud/calibrate.py gold base noop lazy alt cheat \ + --criteria retry_past_deadline_is_not_sent,retry_cannot_move_or_clear_deadline,eager_run_honours_deadline,delivery_scheduled_past_deadline_dropped_on_receipt,expired_delivery_outcome_is_revoked,expired_delivery_announced_to_monitors,discarded_delivery_does_not_revoke_the_call \ + 2>&1 | tee /hud/calibration.txt; \ + echo 'SMOKE GATE OK (cells only; the full ladder is proven by a CALIB_MODE=full build)'; \ + fi; \ + kill $hb 2>/dev/null || true; \ + grep -E '^LADDER |^ (gold|base|noop|lazy|alt|cheat)' /hud/calibration.txt || true; \ + rm -rf /hud/.calib /hud/calibration.txt /hud/logs; \ + fi; \ + rm -rf /hud/grader/controls /hud/grader/__pycache__ /hud/grader/cells/__pycache__ /hud/__pycache__ + +# ── lock it down ─────────────────────────────────────────────────────────── +RUN mkdir -p /hud/vault /hud/logs \ + && chown -R root:root /hud \ + && chmod -R 700 /hud + +# ── E-5: /tmp has no root residue; the WHOLE gate suite is green for uid 1000; +# the answer key is unreadable and invisible from the agent's side ─────── +# `rm -f statefilename` below is REPO residue, not /tmp residue: the suite's own +# t/unit/worker/test_worker.py:1190 builds a worker with statedb='statefilename' +# and the shelve lands in the CWD, i.e. in the checkout root (16 KB, measured +# 14.09 — it is the only file the four gate directories leave behind). The +# grader's purge_repo_tmp_residue() sweeps the /tmp names the tests hardcode and +# cannot see this one. Left in place it makes `git status --porcelain` non-empty +# and the clean-tree assertion at the end of this block fails — which is exactly +# how the build died after the ladder before this line existed. The assertion is +# deliberately left AFTER the removal, so that any NEW residue a future upstream +# bump introduces still fails the build loudly instead of being swept silently. +RUN set -eux; \ + find /tmp -mindepth 1 -maxdepth 1 -exec rm -rf {} + ; \ + install -d -m 1777 /tmp; \ + install -d -m 0755 -o 1000 -g 1000 /tmp/agent-home; \ + chown -R 1000:1000 /workspace/repo; \ + setpriv --reuid 1000 --regid 1000 --clear-groups \ + env -i PATH=/usr/bin:/bin HOME=/tmp/agent-home TERM=xterm \ + PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PYTHONNOUSERSITE=1 \ + PYTHONPATH=/workspace/repo \ + bash -lc 'set -eu; cd /workspace/repo; python -V; python -c "import celery.app.task, celery.worker.strategy"; \ + python -m pytest t/unit/app t/unit/tasks t/unit/worker t/unit/utils -q -p no:cacheprovider --timeout=300 \ + > /tmp/agent-suite.txt 2>&1 \ + || { tail -25 /tmp/agent-suite.txt; echo "AGENT_GREEN FAILED"; exit 1; }; \ + tail -1 /tmp/agent-suite.txt; \ + rm -f statefilename; \ + echo probe > celery/.uid1000-write-probe; rm -f celery/.uid1000-write-probe; \ + ! test -r /hud/gold.diff; \ + ! ls /hud >/dev/null 2>&1; \ + test -z "$(find / -xdev \( -path /proc -o -path /sys -o -path /opt -o -path /usr \) -prune -o \( -name "grad*" -o -name "gold*" \) -print 2>/dev/null)"; \ + test -z "$(git status --porcelain)"'; \ + find /workspace/repo -name '__pycache__' -type d -prune -exec rm -rf {} + ; \ + find /tmp -mindepth 1 -maxdepth 1 ! -name agent-home -exec rm -rf {} + ; \ + chown -R 1000:1000 /workspace/repo /tmp/agent-home; \ + test "$(find /tmp -mindepth 1 -maxdepth 1 | wc -l)" -eq 1; \ + test -z "$(find /tmp -mindepth 1 -not -user 1000 -print -quit)"; \ + test "$(stat -c %a /tmp)" = 1777 + +WORKDIR /app +COPY env.py tasks.py pyproject.toml /app/ +COPY coding/ /app/coding/ +COPY task/prompt.md /app/task/prompt.md + +# The ticket, pinned by content. +RUN echo "c030c10f98599a520ea0ad07ebcf6bf95c42b43c7fbcd1438a67d870643fc965 /app/task/prompt.md" | sha256sum -c - \ + && sha256sum /app/task/prompt.md /app/tasks.py /hud/tasks.py /hud/gold.diff /hud/grader/run_grading.sh /hud/grader/cells/spec_cells.py \ + && cmp /app/tasks.py /hud/tasks.py \ + && test ! -e /hud/grader/controls \ + && chmod 600 /app/tasks.py + +CMD ["hud", "serve", "tasks.py", "--host", "0.0.0.0"] diff --git a/harbor/sources/celery-v12/calibrate.py b/harbor/sources/celery-v12/calibrate.py new file mode 100644 index 0000000000000000000000000000000000000000..3103e87430cc46d4720648547a25f8d73849a0c7 --- /dev/null +++ b/harbor/sources/celery-v12/calibrate.py @@ -0,0 +1,291 @@ +#!/usr/bin/env python3 +"""Calibration for celery_retry_expires_countdown_contract — runs the real grader. + + python3 calibrate.py # gold and base + python3 calibrate.py gold base noop lazy alt cheat # the whole ladder + python3 calibrate.py gold --criteria retry_past_deadline_is_not_sent + +Every tree is graded the way tasks.py grades it: each criterion in +run_grading.sh — the gate among them (G-5) — weighted with the table read out +of tasks.py by AST, and the flat blocker cap. Trees live in .calib/ +beside this file. + +G-5' is NOT applied here and is not applied in tasks.py either, not since v6 +(20.09): the gate runs last, is handed the verdict of the core in CORE_GREEN, +and refuses its own weight out loud when nothing scored was fixed. Nothing +rewrites a subscore behind the check's back, so the log printed below is the +run that was scored. + +The ladder (§1.A(б)), all hard: + gold -> 1.000, every criterion green one by one + base -> 0.000, every cell red one by one; the gate's own suite green on + the untouched checkout (G-4) while the gate itself refuses (G-5') + noop -> 0.000, not one cell (a comment-only change) + lazy -> < 0.50 + alt -> >= 0.80 (a correct fix by other mechanisms) + cheat -> capped: the gate failed and the reward is at most the cap +A LADDER line with all six numbers is printed when all six trees were graded. +""" + +from __future__ import annotations + +import argparse +import ast +import hashlib +import json +import os +import shutil +import subprocess +import sys +import time +from pathlib import Path + +HERE = Path(__file__).resolve().parent +GRADER = Path(os.environ.get("CALIB_GRADER_DIR") or (HERE / "grader")) +CALIB = Path(os.environ.get("CALIB_DIR") or (HERE / ".calib")) +BASE_TREE = CALIB / "base" +ALL_GREEN, ALL_RED = "gold", "base" +EXPECTED = {ALL_GREEN: 1.00, ALL_RED: 0.00} + + +def tasks_tree(): + return ast.parse((HERE / "tasks.py").read_text()) + + +def load_table(): + graders = cap = None + for node in tasks_tree().body: + if isinstance(node, ast.Assign): + for t in node.targets: + if getattr(t, "id", None) == "GRADERS": + graders = [tuple(x) for x in ast.literal_eval(node.value)] + elif getattr(t, "id", None) == "BLOCKER_CAP": + cap = ast.literal_eval(node.value) + if graders is None or cap is None: + raise SystemExit("could not read GRADERS/BLOCKER_CAP out of tasks.py") + total = sum(g[1] for g in graders) + if abs(total - 1.0) > 1e-9: + raise SystemExit(f"weights sum to {total}, not 1.0") + return graders, cap + + +def load_gate(): + name = budget = None + for node in tasks_tree().body: + if isinstance(node, ast.Assign): + for t in node.targets: + if getattr(t, "id", None) == "GATE": + name = ast.literal_eval(node.value) + elif getattr(t, "id", None) == "GATE_TIMEOUT": + budget = ast.literal_eval(node.value) + if not name or not budget: + raise SystemExit("could not read GATE/GATE_TIMEOUT out of tasks.py") + return name, budget + + +GRADERS, CAP = load_table() +GATE, GATE_TIMEOUT = load_gate() +RULES = {g[0] for g in GRADERS if g[0].startswith(("gate_", "rule_"))} + + +def reward(results): + """The weighted sum, then the flat cap — as tasks.py does. + + v6 (20.09): G-5-prime is no longer applied HERE. The gate is told the + verdict of the core in CORE_GREEN and fails itself, exactly as it does + under tasks.py, so substituting its result afterwards would be grading a + different run than the one whose log we print. The substitution is kept as + an INERT cross-check: if the gate came back green on a tree with nothing + else green, the hand-down did not reach it, and that is a defect of the + wiring, not a score to quietly correct. + """ + core = [g[0] for g in GRADERS if g[0] not in RULES] + if not any(results.get(n) for n in core): # G-5-prime + leaked = [n for n in RULES if results.get(n)] + if leaked: + raise SystemExit( + "G-5-prime WIRING BROKEN: %s came back green on a tree that met no " + "scored criterion. The gate is handed CORE_GREEN=0 and must fail " + "itself; it did not, so CORE_GREEN never reached run_grading.sh." + % ", ".join(sorted(leaked))) + uncapped = sum(g[1] for g in GRADERS if results.get(g[0])) + failed = [g[0] for g in GRADERS if g[2] and not results.get(g[0])] + final = uncapped if not failed else max(0.0, min(uncapped, CAP)) + return round(final, 6), round(uncapped, 6), failed + + +def tree_digest(tree: Path) -> str: + h = hashlib.sha256() + for path in sorted(tree.rglob("*")): + rel = path.relative_to(tree).as_posix() + if rel == ".git" or rel.startswith(".git/") or "__pycache__" in rel: + continue + if path.is_file() and not path.is_symlink(): + h.update(rel.encode() + b"\0" + hashlib.sha256(path.read_bytes()).digest()) + return h.hexdigest() + + +def run_criterion(tree: Path, name: str, budget: int, state: Path, log_dir: Path, + core_green: str = "1"): + env = dict(os.environ) + env.update({ + "REPO_DIR": str(tree), + "HARNESS_DIR": str(GRADER), + "GRADER_STATE_DIR": str(state), + "BASE_SRC": os.environ.get("BASE_SRC") or str(BASE_TREE), + "PYTHON_BIN": os.environ.get("PYTHON_BIN") or sys.executable, + # v6: the same hand-down tasks.py does. The gate runs last and is told + # the verdict of the core, so it refuses its own weight out loud + # instead of being zeroed behind its back afterwards. + "CORE_GREEN": core_green, + }) + started = time.time() + proc = subprocess.run(["bash", str(GRADER / "run_grading.sh"), name, str(budget)], + env=env, capture_output=True, text=True, timeout=budget + 300) + elapsed = time.time() - started + (log_dir / f"{name}.log").write_text(proc.stdout + "\n--- stderr ---\n" + proc.stderr) + if proc.returncode == 3: + raise SystemExit(f"GRADER FAULT in {name} on {tree.name}:\n{proc.stdout[-4000:]}") + return proc.returncode == 0, elapsed, proc.stdout + + +def calibrate(which: str, criteria): + tree = CALIB / which + if not (tree / "celery" / "app" / "task.py").exists(): + raise SystemExit(f"no {which} tree at {tree}") + if which != ALL_RED and BASE_TREE.exists() and tree_digest(tree) == tree_digest(BASE_TREE): + raise SystemExit(f"refusing to grade {tree}: it is byte-for-byte the base tree " + f"(its patch did not apply), so its row would be base's row") + state = CALIB / f"state-{which}" + shutil.rmtree(state, ignore_errors=True) + state.mkdir(parents=True) + log_dir = CALIB / f"logs-{which}" + log_dir.mkdir(parents=True, exist_ok=True) + print(f"\n=== {which} ===", flush=True) + results, timings, measured_green = {}, {}, {} + core = [g[0] for g in GRADERS if g[0] not in RULES] + handed = {} + for name, weight, blocker, _kind, budget in GRADERS: + if criteria and name not in criteria: + continue + # The gate runs last (tasks.py asserts it), so by now every scored cell + # of the core has a verdict to hand down. + core_green = "1" if name not in RULES else str(int(any(results.get(n) for n in core))) + if name in RULES: + handed[name] = core_green + ok, elapsed, out = run_criterion(tree, name, budget, state, log_dir, core_green) + results[name], timings[name] = ok, round(elapsed, 1) + if name in RULES: + # G-4 is about the gate's own MEASUREMENT (the repository's suite, + # green and unedited), which the gate now prints whether or not it + # is allowed to be paid for it. On base it is green and the gate + # still refuses: that is G-5-prime working, not a red gate. + measured_green[name] = ok or any( + line.strip().startswith("the repository's own tests: green") + for line in out.splitlines()) + cg = "" if name not in RULES else f" CORE_GREEN={core_green}" + print(f" {'PASS' if ok else 'FAIL'} {name:<54} w={weight:.4f} " + f"{'blocker' if blocker else ' '} {elapsed:6.1f}s{cg}", flush=True) + for line in out.splitlines(): + if line.strip().startswith(("PASS:", "FAIL:")): + print(f" {line.strip()[:220]}", flush=True) + final, uncapped, failed = reward(results) + refused = [n for n, cg in handed.items() if cg == "0"] + if refused: + print(f" (conditional: {', '.join(refused)} was told the core is dead and " + f"refused its weight itself; it reports FAIL and exits non-zero)", flush=True) + print(f" -> uncapped {uncapped:.3f}, failed blockers {failed or 'none'}, reward {final:.3f}", + flush=True) + return {"tree": which, "results": results, "timings": timings, + "uncapped": uncapped, "reward": final, "failed_blockers": failed, + "rule_measured_green": measured_green} + + +def main(): + ap = argparse.ArgumentParser() + ap.add_argument("trees", nargs="*") + ap.add_argument("--criteria", default="") + args = ap.parse_args() + criteria = [c for c in args.criteria.split(",") if c] + trees = args.trees or [ALL_GREEN, ALL_RED] + report = [calibrate(t, criteria) for t in trees] + by = {e["tree"]: e for e in report} + + out = CALIB / "calibration.json" + prev = [] + if out.exists(): + try: + prev = json.loads(out.read_text()) + except ValueError: + prev = [] + merged = {e["tree"]: e for e in prev if isinstance(e, dict)} + merged.update(by) + out.write_text(json.dumps(list(merged.values()), indent=2) + "\n") + + if criteria: + for e in report: + print(f" {e['tree']}: reward {e['reward']:.3f} (partial run, not checked)") + sys.exit(0) + + ok = True + core = [g[0] for g in GRADERS if g[0] not in RULES] + print("\n=== calibration ===") + for e in report: + t, got = e["tree"], e["reward"] + if t in EXPECTED: + good = abs(got - EXPECTED[t]) < 1e-9 + ok &= good + print(f" {t}: **{got:.2f}** (expected {EXPECTED[t]:.2f}) {'OK' if good else 'MISCALIBRATED'}") + if ALL_GREEN in by: + red = sorted(n for n, v in by[ALL_GREEN]["results"].items() if not v) + ok &= not red + print(" gold: all criteria green, one by one" if not red + else f" gold: NOT ALL GREEN — {', '.join(red)}") + if ALL_RED in by: + res = by[ALL_RED]["results"] + mg = by[ALL_RED].get("rule_measured_green") or {} + green = sorted(n for n in core if res.get(n)) + # G-4 is about the gate's own MEASUREMENT on the untouched checkout, not + # about it being PAID there: since v6 the gate is handed CORE_GREEN=0 on + # base and refuses its weight itself, so `results[gate]` is False BY + # DESIGN and the thing to assert is the line the gate prints — the + # repository's suite is green and its tests unedited. + not_measured = sorted(n for n in RULES if not mg.get(n)) + if green: + ok = False + print(f" base: NOT ALL RED — {', '.join(green)} passed on the untouched checkout") + elif not_measured: + ok = False + print(f" base: THE GATE'S OWN SUITE IS RED ON THE UNTOUCHED CHECKOUT " + f"({', '.join(not_measured)}) — that is a broken gate, not G-5'") + else: + print(" base: all cells red one by one; the gate's own suite is green on the " + "untouched checkout (G-4) and the gate refuses to be paid for it (G-5')") + if "noop" in by: + green = sorted(n for n in core if by["noop"]["results"].get(n)) + good = not green and abs(by["noop"]["reward"]) < 1e-9 + ok &= good + print(f" noop: {by['noop']['reward']:.3f} {'OK' if good else 'FAILED — cells ' + ', '.join(green)}") + if "lazy" in by: + good = by["lazy"]["reward"] < 0.50 + ok &= good + print(f" lazy: {by['lazy']['reward']:.3f} (< 0.50) {'OK' if good else 'FAILED'}") + if "alt" in by: + good = by["alt"]["reward"] >= 0.80 + ok &= good + print(f" alt: {by['alt']['reward']:.3f} (>= 0.80) {'OK' if good else 'FAILED'}") + if "cheat" in by: + c = by["cheat"] + good = GATE in c["failed_blockers"] and c["reward"] <= CAP + 1e-9 + ok &= good + print(f" cheat: {c['reward']:.3f} (uncapped {c['uncapped']:.3f}, capped by " + f"{', '.join(c['failed_blockers']) or 'nothing'}) {'OK' if good else 'FAILED'}") + if all(t in by for t in ("gold", "base", "noop", "lazy", "alt", "cheat")): + print("LADDER " + " ".join(f"{t}={by[t]['reward']:.3f}" + for t in ("gold", "base", "noop", "lazy", "alt", "cheat"))) + print(f"\nCALIBRATION {'OK' if ok else 'FAILED'}; written to {out}") + sys.exit(0 if ok else 1) + + +if __name__ == "__main__": + main() diff --git a/harbor/sources/celery-v12/coding/__init__.py b/harbor/sources/celery-v12/coding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88280a271d88bae2eb437ca5e8c172120a66f336 --- /dev/null +++ b/harbor/sources/celery-v12/coding/__init__.py @@ -0,0 +1,5 @@ +"""The coding environment's core: repo-lifecycle primitives and task flavors.""" + +from . import repo, swe_bench_pro + +__all__ = ["repo", "swe_bench_pro"] diff --git a/harbor/sources/celery-v12/coding/github.py b/harbor/sources/celery-v12/coding/github.py new file mode 100644 index 0000000000000000000000000000000000000000..d07288e5f438181af931b88982147e86ebd1c16f --- /dev/null +++ b/harbor/sources/celery-v12/coding/github.py @@ -0,0 +1,158 @@ +"""A minimal mock GitHub for SDLC tasks. + +One in-process store holds issues (seeded per task) and the pull requests and +comments the agent creates; :func:`serve` publishes it as ``github_*`` MCP +tools over an ``mcp`` capability. The remote itself is a bare git repo on +disk (see :func:`coding.repo.create_remote`) — the agent pushes branches with +plain git and references them from pull requests here. +""" + +from __future__ import annotations + +import asyncio +import json +import socket +from dataclasses import asdict, dataclass, field +from typing import Any + +from fastmcp import FastMCP +from hud.capabilities import Capability + + +@dataclass +class Issue: + number: int + title: str + body: str + labels: list[str] = field(default_factory=list) + state: str = "open" + comments: list[str] = field(default_factory=list) + + +@dataclass +class PullRequest: + number: int + title: str + body: str + head: str + base: str + state: str = "open" + comments: list[str] = field(default_factory=list) + + +class MockGitHub: + """Issue/PR store with an action log (for rubric grading).""" + + def __init__(self) -> None: + self.issues: dict[int, Issue] = {} + self.pull_requests: dict[int, PullRequest] = {} + self.actions: list[dict[str, Any]] = [] + + def seed(self, issues: list[dict[str, Any]]) -> None: + """Reset the store to the task's fixtures.""" + self.issues = { + int(entry["number"]): Issue( + number=int(entry["number"]), + title=str(entry["title"]), + body=str(entry.get("body", "")), + labels=[str(label) for label in entry.get("labels", [])], + ) + for entry in issues + } + self.pull_requests = {} + self.actions = [] + + def _record(self, action: str, **details: Any) -> None: + self.actions.append({"action": action, **details}) + + # ─── operations (the tool surface) ──────────────────────────────── + + def list_issues(self) -> list[dict[str, Any]]: + return [asdict(issue) for issue in self.issues.values()] + + def get_issue(self, number: int) -> dict[str, Any]: + return asdict(self._issue(number)) + + def close_issue(self, number: int) -> dict[str, Any]: + issue = self._issue(number) + issue.state = "closed" + self._record("close_issue", number=number) + return asdict(issue) + + def comment_on_issue(self, number: int, body: str) -> dict[str, Any]: + issue = self._issue(number) + issue.comments.append(body) + self._record("comment_on_issue", number=number, body=body) + return asdict(issue) + + def create_pull_request(self, title: str, body: str, head: str, base: str) -> dict[str, Any]: + number = len(self.pull_requests) + 1 + pr = PullRequest(number=number, title=title, body=body, head=head, base=base) + self.pull_requests[number] = pr + self._record("create_pull_request", number=number, title=title, head=head) + return asdict(pr) + + def list_pull_requests(self) -> list[dict[str, Any]]: + return [asdict(pr) for pr in self.pull_requests.values()] + + def _issue(self, number: int) -> Issue: + if number not in self.issues: + raise ValueError(f"no such issue: #{number}") + return self.issues[number] + + # ─── grading views ──────────────────────────────────────────────── + + def latest_pull_request(self) -> PullRequest | None: + return next(reversed(self.pull_requests.values()), None) + + def transcript(self) -> str: + """Everything the agent did here, for rubric judging.""" + return json.dumps( + { + "issues": [asdict(issue) for issue in self.issues.values()], + "pull_requests": [asdict(pr) for pr in self.pull_requests.values()], + "actions": self.actions, + }, + indent=2, + ) + + +def serve(github: MockGitHub) -> tuple[asyncio.Task[None], Capability]: + """Serve *github* as ``github_*`` MCP tools; returns the server task + capability.""" + server: FastMCP = FastMCP(name="github") + + @server.tool + def github_list_issues() -> list[dict[str, Any]]: + """List all issues in the repository.""" + return github.list_issues() + + @server.tool + def github_get_issue(number: int) -> dict[str, Any]: + """Get one issue by number.""" + return github.get_issue(number) + + @server.tool + def github_close_issue(number: int) -> dict[str, Any]: + """Close an issue.""" + return github.close_issue(number) + + @server.tool + def github_comment_on_issue(number: int, body: str) -> dict[str, Any]: + """Add a comment to an issue.""" + return github.comment_on_issue(number, body) + + @server.tool + def github_create_pull_request(title: str, body: str, head: str, base: str = "main") -> dict[str, Any]: + """Open a pull request from branch *head* (already pushed to the remote) into *base*.""" + return github.create_pull_request(title, body, head, base) + + @server.tool + def github_list_pull_requests() -> list[dict[str, Any]]: + """List all pull requests.""" + return github.list_pull_requests() + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + port = int(sock.getsockname()[1]) + task = asyncio.create_task(server.run_async(transport="http", host="127.0.0.1", port=port, show_banner=False)) + return task, Capability.mcp(name="github", url=f"http://127.0.0.1:{port}/mcp") diff --git a/harbor/sources/celery-v12/coding/repo.py b/harbor/sources/celery-v12/coding/repo.py new file mode 100644 index 0000000000000000000000000000000000000000..bb675cf6f58da32de51e10bc71bdb1bc4b5057d9 --- /dev/null +++ b/harbor/sources/celery-v12/coding/repo.py @@ -0,0 +1,172 @@ +"""Git-history vaulting and diff-based grading primitives. + +The repo's real ``.git`` may contain the answer key — solution branches, the +fix commit, the hidden tests. Every task flavor shares this lifecycle: + +- setup (:func:`vault_history`): snapshot the pre-agent worktree into the + real history, move ``.git`` into a vault outside the workspace, and leave a + fresh single-commit repo — git works normally for the agent, but there is + no history, no refs, and no remotes. +- grading (:func:`restore_history` → :func:`capture_agent_diff` → + :func:`reset_worktree` → :func:`apply_diff`): discard the agent's ``.git`` + (hooks and history included), restore the vaulted history, capture the + agent's changes as a diff against the setup snapshot, reset the worktree to + that snapshot, and re-apply the diff. Hidden tests come from vaulted refs + and land after the agent's diff. + +The snapshot covers the whole worktree, so installed dependencies and build +artifacts survive into grading. +""" + +from __future__ import annotations + +import asyncio +import os +import shutil +from pathlib import Path + +_GIT_ID = ("-c", "user.name=hud-grader", "-c", "user.email=grader@hud.ai") +_SETUP_COMMIT = "setup_commit" + + +async def run( + *argv: str, + cwd: Path, + timeout: float = 600.0, + check: bool = True, +) -> tuple[int, str, str]: + """Run a command, returning ``(returncode, stdout, stderr)``. Kills on timeout.""" + proc = await asyncio.create_subprocess_exec( + *argv, + cwd=str(cwd), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + try: + out_bytes, err_bytes = await asyncio.wait_for(proc.communicate(), timeout=timeout) + except TimeoutError: + proc.kill() + await proc.wait() + raise TimeoutError(f"{' '.join(argv[:4])} timed out after {timeout:.0f}s") from None + out = out_bytes.decode("utf-8", "replace") + err = err_bytes.decode("utf-8", "replace") + if check and proc.returncode != 0: + detail = (err.strip() or out.strip())[:2000] + raise RuntimeError(f"{' '.join(argv)} failed ({proc.returncode}): {detail}") + return proc.returncode if proc.returncode is not None else 1, out, err + + +async def git(repo: Path, *args: str, timeout: float = 600.0, check: bool = True) -> tuple[int, str, str]: + return await run("git", *_GIT_ID, *args, cwd=repo, timeout=timeout, check=check) + + +def _append_git_exclude(git_dir: Path) -> None: + """Keep the workspace's SSH credential dir out of snapshots and diffs.""" + exclude = git_dir / "info" / "exclude" + exclude.parent.mkdir(parents=True, exist_ok=True) + with exclude.open("a", encoding="utf-8") as fh: + fh.write("\n.hud/\n") + + +async def vault_history(repo: Path, vault: Path) -> None: + """Snapshot the pre-agent state, then hide the repo's history in *vault*.""" + if (vault / "git").exists(): + raise RuntimeError(f"vault {vault} already holds a history: one task per substrate") + + if hasattr(os, "geteuid") and os.geteuid() == 0: + # Grade-time git runs as root on the (chowned) agent-owned repo; git + # honors safe.directory only from system/global config, never from -c. + await run("git", "config", "--global", "--add", "safe.directory", str(repo), cwd=Path("/")) + + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: pre-agent snapshot") + _, sha, _ = await git(repo, "rev-parse", "HEAD") + + vault.mkdir(parents=True, exist_ok=True) + (vault / _SETUP_COMMIT).write_text(sha.strip(), "utf-8") + shutil.move(str(repo / ".git"), str(vault / "git")) + + await git(repo, "init", "-q", ".") + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "baseline") + + +async def create_remote(repo: Path, remote: Path, ref: str, *, branch: str = "main") -> None: + """A bare "GitHub" remote holding *ref*'s history as *branch*. + + Pushing a single ref publishes only its ancestry — sibling answer-key + branches (hidden tests, golden fix) stay unreachable, while the agent + still gets realistic past history to work with. + """ + remote.parent.mkdir(parents=True, exist_ok=True) + await git(remote.parent, "init", "-q", "--bare", "-b", branch, str(remote)) + await git(repo, "push", "-q", str(remote), f"{ref}:refs/heads/{branch}") + + +async def attach_to_remote(repo: Path, remote: Path, *, branch: str = "main") -> None: + """Point the agent's fresh repo at the remote, sharing its (sanitized) history. + + Called after :func:`vault_history`: the throwaway single-commit repo is + replaced by the remote's clone state — same worktree, but with ``origin`` + configured and history the agent can branch from and push back to. + """ + shutil.rmtree(repo / ".git") + await git(repo, "init", "-q", "-b", branch, ".") + _append_git_exclude(repo / ".git") + await git(repo, "remote", "add", "origin", str(remote)) + await git(repo, "fetch", "-q", "origin") + # Adopt the remote's history without a checkout: the worktree already + # matches (plus untracked build artifacts a checkout would refuse to + # cross), so point the branch at origin and sync only the index. + await git(repo, "update-ref", f"refs/heads/{branch}", f"refs/remotes/origin/{branch}") + await git(repo, "reset", "-q") + await git(repo, "branch", "-q", f"--set-upstream-to=origin/{branch}", branch) + + +async def restore_history(repo: Path, vault: Path) -> str: + """Swap the agent's throwaway ``.git`` for the vaulted real history. + + Returns the setup-snapshot commit sha recorded by :func:`vault_history`. + """ + agent_git = repo / ".git" + if agent_git.exists(): + shutil.rmtree(agent_git) + shutil.move(str(vault / "git"), str(agent_git)) + return (vault / _SETUP_COMMIT).read_text("utf-8").strip() + + +async def capture_agent_diff(repo: Path, setup_commit: str) -> str: + """The agent's changes: setup snapshot -> final worktree state. + + Runs on the restored real history: the final worktree (including files the + agent added) is committed and diffed against the snapshot. + """ + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: final snapshot") + _, final, _ = await git(repo, "rev-parse", "HEAD") + # --binary is mandatory: without it git emits "Binary files ... differ" for + # any binary file the agent added, and `git apply` then rejects the ENTIRE + # patch — scoring a real solution 0.0. Verified end to end. + _, diff, _ = await git( + repo, "diff", "--binary", setup_commit, final.strip(), timeout=1200.0 + ) + return diff + + +async def reset_worktree(repo: Path, setup_commit: str) -> None: + await git(repo, "reset", "--hard", setup_commit) + await git(repo, "clean", "-fd") + + +async def apply_diff(repo: Path, diff: str, patch_path: Path) -> str | None: + """Apply *diff* to the worktree; returns git's error output on failure.""" + if not diff.strip(): + return None + patch_path.parent.mkdir(parents=True, exist_ok=True) + patch_path.write_text(diff, "utf-8") + code, out, err = await git(repo, "apply", "-v", str(patch_path), check=False) + if code != 0: + return (err.strip() or out.strip())[-4000:] + return None diff --git a/harbor/sources/celery-v12/coding/swe_bench_pro.py b/harbor/sources/celery-v12/coding/swe_bench_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..da655cfc4cfaf8596fa6e18c3a47c8aad21d42d5 --- /dev/null +++ b/harbor/sources/celery-v12/coding/swe_bench_pro.py @@ -0,0 +1,149 @@ +"""The SWE-bench Pro task flavor: dataset-row parsing and the official grading pipeline. + +An instance directory (baked into the instance image by ``swe_tasks.py``) +holds the dataset row (``instance.json``) plus the official per-instance +``run_script.sh`` and ``parser.py`` from scaleapi/SWE-bench_Pro-os. Grading +replays the official evaluator's entryscript on the repo-lifecycle primitives +in :mod:`coding.repo`: reset to the pre-agent snapshot, apply the (agent or +golden) patch, check out the hidden test files, run the script, parse, and +resolve iff every ``fail_to_pass`` and ``pass_to_pass`` test passes. +""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +from . import repo as repo_lib + + +def load_instance(instance_dir: Path) -> dict[str, Any]: + return json.loads((instance_dir / "instance.json").read_text("utf-8")) + + +def str_list(field: str) -> list[str]: + """Parse the dataset's list-shaped string fields. + + The rows store lists as Python reprs (single quotes; the official + evaluator uses ``eval``), so ``ast.literal_eval`` is the safe equivalent. + """ + value = ast.literal_eval(field) + if not isinstance(value, list): + raise ValueError(f"expected a list, got {type(value).__name__}") + return [str(item) for item in value] + + +def strip_binary_hunks(patch: str) -> str: + """Drop binary diff sections, exactly like the official evaluator.""" + if not patch: + return patch + sections = re.split(r"(?=^diff --git )", patch, flags=re.MULTILINE) + kept = [ + section + for section in sections + if section.strip() + and not re.search(r"^Binary files .* differ$", section, re.MULTILINE) + and not re.search(r"^GIT binary patch$", section, re.MULTILINE) + ] + return "".join(kept) + + +def score(instance: dict[str, Any], tests: list[dict[str, Any]]) -> EvaluationResult: + """The official resolution criterion: every required test passes.""" + passed = {t["name"] for t in tests if t.get("status") == "PASSED"} + fail_to_pass = set(str_list(instance["fail_to_pass"])) + pass_to_pass = set(str_list(instance["pass_to_pass"])) + required = fail_to_pass | pass_to_pass + resolved = required <= passed + + def fraction(subset: set[str]) -> float: + return len(subset & passed) / len(subset) if subset else 1.0 + + missing = sorted(required - passed) + return EvaluationResult( + reward=1.0 if resolved else 0.0, + content="resolved" if resolved else f"unresolved: {len(missing)} required test(s) not passing", + subscores=[ + SubScore(name="resolved", value=1.0 if resolved else 0.0, weight=1.0), + SubScore(name="fail_to_pass", value=fraction(fail_to_pass), weight=0.0), + SubScore(name="pass_to_pass", value=fraction(pass_to_pass), weight=0.0), + ], + info={"tests_reported": len(tests), "missing": missing[:20]}, + ) + + +def build_prompt(instance: dict[str, Any], repo_dir: Path) -> str: + sections = [ + f"You are working in {repo_dir}, a checkout of the {instance['repo']} repository. " + "Resolve the issue described below by modifying the code. Hidden tests grade your " + "work when you finish; do not modify existing tests.", + instance["problem_statement"], + ] + if instance.get("requirements"): + sections.append("## Requirements\n\n" + instance["requirements"]) + if instance.get("interface"): + sections.append("## Interface\n\n" + instance["interface"]) + return "\n\n".join(section.strip() for section in sections if section and section.strip()) + + +async def grade( + instance: dict[str, Any], + instance_dir: Path, + repo_dir: Path, + vault_dir: Path, + logs_dir: Path, + *, + validate_mode: str | None = None, + tests_timeout: float = 3600.0, +) -> EvaluationResult: + """Replay the official evaluator's entryscript in place. + + ``validate_mode="golden"`` grades the dataset's golden patch instead of + the agent's diff (the official gold-patch sanity check). The hidden test + files (the last line of ``before_repo_set_cmd``) are checked out *after* + the patch, so patch edits to them never survive. + """ + logs_dir.mkdir(parents=True, exist_ok=True) + setup_commit = await repo_lib.restore_history(repo_dir, vault_dir) + + if validate_mode == "golden": + diff = instance["patch"] + else: + diff = await repo_lib.capture_agent_diff(repo_dir, setup_commit) + diff = strip_binary_hunks(diff) + + await repo_lib.reset_worktree(repo_dir, setup_commit) + apply_error = await repo_lib.apply_diff(repo_dir, diff, logs_dir / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + + test_checkout = instance["before_repo_set_cmd"].strip().splitlines()[-1] + await repo_lib.run("bash", "-c", test_checkout, cwd=repo_dir) + + files_csv = ",".join(str_list(instance["selected_test_files_to_run"])) + _, out, err = await repo_lib.run( + "bash", + str(instance_dir / "run_script.sh"), + files_csv, + cwd=repo_dir, + timeout=tests_timeout, + check=False, + ) + (logs_dir / "stdout.log").write_text(out, "utf-8") + (logs_dir / "stderr.log").write_text(err, "utf-8") + await repo_lib.run( + sys.executable, + str(instance_dir / "parser.py"), + "stdout.log", + "stderr.log", + "output.json", + cwd=logs_dir, + ) + tests = json.loads((logs_dir / "output.json").read_text("utf-8"))["tests"] + return score(instance, tests) diff --git a/harbor/sources/celery-v12/env.py b/harbor/sources/celery-v12/env.py new file mode 100644 index 0000000000000000000000000000000000000000..ef99f93a472920eb736438cd63d48befa37ecf3d --- /dev/null +++ b/harbor/sources/celery-v12/env.py @@ -0,0 +1,467 @@ +"""Coding environment (HUD v6): a repo workspace with diff-based grading. + +The env publishes one ``ssh`` workspace over a git repo; the agent's harness +brings its own bash/file tools. Task setup vaults the repo's real history +(:mod:`coding.repo`) so the agent gets a fresh single-commit repo with working +git but no answer-key refs; grading captures the agent's changes as a diff, +resets to the pre-agent snapshot, re-applies, brings in the hidden tests, and +runs them. + +Three task templates: + +- ``coding-task`` — hidden tests live as refs in the repo's vaulted history + (the ``{task}_baseline`` / ``{task}_test`` / ``{task}_golden`` branch + convention) and a shell command scores by exit code. Runs locally (clones + ``REPO_URL`` per process) or from an image that bakes the repo. +- ``sdlc-task`` — adds workflow: a bare mock-GitHub remote the agent pushes + to, ``github_*`` issue/PR tools (:mod:`coding.github`), and grading over + the pushed pull-request branch instead of the worktree. +- one SWE-bench Pro instance template, registered only when an instance dir + is baked in (see ``swe_tasks.py``): grading replays the official evaluator + (:mod:`coding.swe_bench_pro`). + +Images set ``REPO_DIR``; locally everything lives in per-process temp dirs. +The image substrate here is Supervisor/supervisor (pure Python, no build step +and no third-party runtime dependency), so the agent's environment is small — +see ``AGENT_PY_ENV``: an interpreter on PATH, a writable HOME, and pytest. +The vault, the hidden grader, the held-out harness, the pristine base checkout +and gold.diff sit outside the workspace — under ``/hud`` (root, mode 700) in +images — and agent shells drop to a non-root uid, so only the env process can +read them. + +The task this env carries is ``listener_group_refusal_contract``, registered +in ``tasks.py``; the three generic templates below come with the +coding-template and are unused here. +""" + +from __future__ import annotations + +import asyncio +import logging +import os +import shutil +import tempfile +from pathlib import Path +from typing import Any + +from hud.environment import Environment, Workspace +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine +from hud.settings import settings + +from coding import repo as repo_lib +from coding import swe_bench_pro as swe +from coding.github import MockGitHub +from coding.github import serve as serve_github + +logger = logging.getLogger(__name__) + +# ─── substrate layout ──────────────────────────────────────────────────── +# Images set REPO_DIR (and ship the repo); locally everything lives in +# per-process temp dirs and the repo is cloned from REPO_URL at startup. + +_explicit_repo = os.environ.get("REPO_DIR") +if _explicit_repo: + REPO_DIR = Path(_explicit_repo) + VAULT_DIR = Path(os.environ.get("VAULT_DIR", "/hud/vault")) + LOGS_DIR = Path(os.environ.get("GRADING_LOGS_DIR", "/hud/logs")) + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / "hud-coding" + REPO_DIR = _LOCAL_ROOT / f"repo-{os.getpid()}" + VAULT_DIR = _LOCAL_ROOT / f"vault-{os.getpid()}" + LOGS_DIR = _LOCAL_ROOT / f"logs-{os.getpid()}" + _LOCAL_SUBSTRATE = True + +# The SDLC flavor's mock-GitHub remote: a bare repo the agent pushes to. It +# must be writable by the agent, so it lives outside /hud. +REMOTE_DIR = ( + Path(os.environ.get("REMOTE_DIR", "/srv/git/project.git")) + if _explicit_repo + else _LOCAL_ROOT / f"remote-{os.getpid()}" / "project.git" +) + +REPO_URL = os.environ.get("REPO_URL", "https://github.com/celery/celery.git") +TESTS_TIMEOUT = float(os.environ.get("GRADING_TIMEOUT", "3600")) + +INSTANCE_DIR = Path(os.environ.get("INSTANCE_DIR", "/hud/instance")) + +AGENT_UID = 1000 +AGENT_HOME = Path("/tmp/agent-home") # noqa: S108 - container-local, created at setup + +# S-3: the registry a deploy overwrites is chosen by THIS name, not by the +# directory the package sits in. A clone that keeps its parent's name +# republishes the parent's environment with this image. +env = Environment(name="ec-swe-celery-retry-expires-countdown") + + +# The agent's Python environment, and why it is spelled out here rather than +# left to the image's ENV. +# +# When shell_uid drops privileges, hud does NOT hand the session the serving +# process's environment: Workspace._session_env() builds a minimal one from +# scratch (PATH, HOME, TERM) and layers this dict on top, precisely so a +# secret the env process holds cannot leak into the agent's shell. So every +# `ENV` line in the Dockerfile reaches the grader and never the agent. +# +# This repository is pure Python with no third-party runtime dependency, so +# there is no module cache to point at and nothing to pre-populate. What the +# agent does need is a HOME it can write (pytest and pip both want one) and an +# interpreter that does not try to reach a user site-packages directory that +# does not exist. PYTHONDONTWRITEBYTECODE keeps the workspace free of .pyc +# files that would otherwise show up in the diff the grader captures. +AGENT_PY_ENV = { + "PYTHONDONTWRITEBYTECODE": "1", + "PYTHONUNBUFFERED": "1", + "PYTHONNOUSERSITE": "1", + # The repository is the package: an agent that runs `python -m pytest` from + # anywhere in the tree gets the tree's own supervisor, never an installed + # copy. + "PYTHONPATH": str(REPO_DIR), +} +# PATH is deliberately NOT in that dict. An agent session is a LOGIN shell +# (`env -i ... bash -l`), and Debian's /etc/profile assigns PATH +# unconditionally, so anything set here would be thrown away before the first +# command runs -- measured, not assumed. The interpreter therefore goes on PATH +# from inside the image, in /etc/profile.d/10-python-toolchain.sh, where a +# login shell cannot lose it. That file also repeats the variables above as +# defaults, so the two mechanisms cover each other. + + +# network=False — hud's own default (Workspace.__init__, workspace.py:321). We had +# True only because the CLI scaffold ships it (hud/cli/templates.py:35). +# ⚠️ MEASURED 2026-09-03: this flag is a NO-OP in our images. `unshare --net` is +# applied only through bwrap (workspace.py:1049, :1292 fall back to a bare shell +# when self._bwrap is None), and bwrap is absent from every image; installing it +# does not help either — usable_bwrap() still returns None because the eval +# substrate denies the privileges (unshare: Operation not permitted). +# Verified inside the image: `git ls-remote https://github.com/... HEAD` → RC 0. +# The agent shell REACHES THE INTERNET regardless of this flag. Kept False so the +# intent is right if the substrate ever grants isolation — but never rely on it, +# and never claim "offline" in a ticket. +_ws = Workspace( + REPO_DIR, + guest_path=str(REPO_DIR), + network=False, + env={"HOME": str(AGENT_HOME), **({} if _LOCAL_SUBSTRATE else AGENT_PY_ENV)}, + track_files=settings.file_tracking_enabled, + shell_uid=AGENT_UID, +) + +SDLC_TOOLS = os.environ.get("SDLC_TOOLS", "") not in ("", "0", "false") + +# Hedged on purpose ("can exhaust it", not "is killed"): the note may state the +# size of the box; it may not state a failure nobody measured. Everything here is +# a fact about the MACHINE — the size of it, the shape of a command that fits in +# it, the closed network, the services it does not run — and nothing here is a +# fact about the ticket: no symptom, no file name, no identifier, no sample +# (minimal-ticket law, ORG15). Nothing in this note is graded. +# +# The last sentence is law RH-2: a rollout that spends its turns trying to make +# a redis-backed test pass, and reads its failure as its own, has been misled by +# the sandbox. Saying so costs nothing and points nowhere. +WORKSPACE_NOTE = ( + f"Please make your changes directly in {REPO_DIR}, not in a copy or a " + "separate worktree.\n" + "Environment: this container has about 2 vCPUs and a hard memory limit, and " + "a fully parallel test run can exhaust it. Run tests in one process, " + "e.g. `python -m pytest t/unit/tasks -q`, rather than with -n auto. The " + f"Python package you work in is the tree at {REPO_DIR} itself; its runtime " + "dependencies and pytest are already installed.\n" + "This workspace has no internet access: your shell cannot resolve host " + "names, so nothing can be fetched, cloned, downloaded or installed, and " + "there is no upstream to consult; everything the task needs is already " + "here. No database, broker or other service runs in this container; a test " + "that fails for that reason is a property of the sandbox, not of your change." +) + +_github = MockGitHub() +_github_server: asyncio.Task[None] | None = None + + +RESOLV_CONF = Path("/etc/resolv.conf") + + +def _seal_agent_resolver() -> str: + """Take name resolution away from the agent's uid, and leave it to root. + + THE CHANNEL, measured (v3 five f07c1f2d, round ce5): four runs of five went + outside — `pip download celery==5.6.x`, `git clone` of the upstream project, + `curl` of raw upstream sources, searches of the code host's issue API — and QA + flagged three of them (5f590b0c, 98252f57, dfb77899) `environment_exploitation` + at 0.87-0.90. Upstream held no fix for this task, so nothing leaked; the + attempt is what is scored (RH-2), and the channel is plain outbound egress. + + WHY HERE AND LIKE THIS (same wall as medusa v1b, user's word 14.09). + * `Workspace(network=False)` cannot close it: hud severs the network with a + netns it only gets through bwrap, and there is no bwrap in this image. + * The image cannot close it: Docker bind-mounts its own /etc/resolv.conf at + container start, and in a BuildKit step the file is read-only. So there is + no build-time probe of this wall; it runs at task setup, as root, against + the runtime file. + * Only uid 1000 loses the resolver — root keeps it — so the env process, + hud's telemetry and the grader (root, no network needed) are untouched, and + /etc/hosts (localhost) stays readable for everyone. + + Never fatal: a sandbox that refuses to start is worse than one too open; the + outcome is logged into the trace either way. + """ + if _LOCAL_SUBSTRATE: # a developer's own machine, not the task container + return "skipped: local substrate" + if not (hasattr(os, "geteuid") and os.geteuid() == 0): + return "skipped: not root" + try: + if not RESOLV_CONF.exists(): + return "already sealed: no /etc/resolv.conf" + os.chown(RESOLV_CONF, 0, 0) + os.chmod(RESOLV_CONF, 0o640) + mode = RESOLV_CONF.stat().st_mode & 0o777 + except OSError as exc: + return f"FAILED: {exc}" + return f"sealed: /etc/resolv.conf {mode:04o} root:root (agent uid {AGENT_UID} cannot read it)" + + +@env.initialize +async def _up() -> None: + global _github_server + logger.info("agent resolver: %s", _seal_agent_resolver()) + if _LOCAL_SUBSTRATE and not (REPO_DIR / ".git").exists(): + REPO_DIR.parent.mkdir(parents=True, exist_ok=True) + logger.info("cloning %s into %s", REPO_URL, REPO_DIR) + await repo_lib.run("git", "clone", "-q", REPO_URL, str(REPO_DIR), cwd=REPO_DIR.parent) + await _ws.start() + env.add_capability(_ws.capability("shell")) + if _ws.tracks_files: + env.add_capability(_ws.file_tracking_capability()) + # The mock-GitHub tools belong to the SDLC flavor, which seeds issues and + # wants a pull request. A plain coding task never uses them, and offering + # them anyway spends agent steps on an empty issue list - every rollout so + # far called github_list_issues and github_list_pull_requests once. + if SDLC_TOOLS: + _github_server, github_capability = serve_github(_github) + env.add_capability(github_capability) + + +@env.shutdown +async def _down() -> None: + if _github_server is not None: + _github_server.cancel() + await _ws.stop() + if _LOCAL_SUBSTRATE: + for path in (REPO_DIR, VAULT_DIR, LOGS_DIR, REMOTE_DIR.parent): + shutil.rmtree(path, ignore_errors=True) + + +# ─── shared task lifecycle ─────────────────────────────────────────────── + + +async def _setup(base_ref: str | None = None, *, remote: bool = False) -> None: + """Check out the task's baseline, vault the history, hand the repo to the agent. + + With ``remote=True`` (the SDLC flavor) a bare "GitHub" remote is created + from the baseline first, and the agent's repo is attached to it as a + normal clone would be — realistic history, pushes, and branches, but no + reachable answer-key refs. + """ + if base_ref: + await repo_lib.git(REPO_DIR, "checkout", "-qf", base_ref) + if remote: + await repo_lib.create_remote(REPO_DIR, REMOTE_DIR, base_ref or "HEAD") + await repo_lib.vault_history(REPO_DIR, VAULT_DIR) + if remote: + await repo_lib.attach_to_remote(REPO_DIR, REMOTE_DIR) + if hasattr(os, "geteuid") and os.geteuid() == 0: + AGENT_HOME.mkdir(parents=True, exist_ok=True) + uid = f"{AGENT_UID}:{AGENT_UID}" + paths = [str(REPO_DIR), str(AGENT_HOME)] + ([str(REMOTE_DIR)] if remote else []) + await repo_lib.run("chown", "-R", uid, *paths, cwd=Path("/")) + if remote: + # The grader (root) pushes to and clones from the agent-owned remote. + await repo_lib.run("git", "config", "--global", "--add", "safe.directory", str(REMOTE_DIR), cwd=Path("/")) + + +# ─── generic flavor ────────────────────────────────────────────────────── + + +async def _grade_generic( + test_command: str, + base_ref: str | None, + test_ref: str | None, + test_files: list[str] | None, + golden_ref: str | None, + validate_mode: str | None, +) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + if not (base_ref and golden_ref): + raise ValueError('validate_mode="golden" needs base_ref and golden_ref') + _, diff, _ = await repo_lib.git(REPO_DIR, "diff", base_ref, golden_ref) + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + if test_ref: + # Hidden tests come from the vaulted history, after the agent's diff — + # so agent edits to them never survive into grading. + await repo_lib.git(REPO_DIR, "checkout", test_ref, "--", *(test_files or ["."])) + + command = test_command.format(test_files=" ".join(test_files or [])) + return await combine( + BashGrader.grade(weight=1.0, command=command, cwd=str(REPO_DIR), timeout_seconds=int(TESTS_TIMEOUT)) + ) + + +@env.template(id="coding-task", description="Fix a bug in the repo; hidden tests grade the diff.") +async def coding_task( + description: str, + test_command: str, + base_ref: str | None = None, + test_ref: str | None = None, + test_files: list[str] | None = None, + golden_ref: str | None = None, + validate_mode: str | None = None, +): + """Generic coding task. + + ``base_ref`` is the agent's starting state; ``test_ref`` holds the hidden + tests (``test_files`` are checked out from it at grade time); + ``test_command`` scores by exit code, with ``{test_files}`` expanded. + ``validate_mode="golden"`` grades ``base_ref..golden_ref`` instead of + agent edits. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup(base_ref) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. {WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests grade your " + f"work when you finish; do not modify existing tests.\n\n{description}" + ) + yield await _grade_generic(test_command, base_ref, test_ref, test_files, golden_ref, validate_mode) + + +# ─── SDLC flavor: issue-driven fix, graded on the pushed PR branch ─────── + + +async def _fetch_hidden_ref(dest: Path, ref: str) -> None: + """Fetch an answer-key ref from the vaulted history into *dest*.""" + full = f"refs/remotes/{ref}" if ref.startswith("origin/") else ref + await repo_lib.git(dest, "fetch", "-q", str(VAULT_DIR / "git"), full) + + +async def _grade_sdlc( + test_command: str, + test_ref: str, + test_files: list[str], + golden_ref: str | None, + pr_rubric: str | None, + validate_mode: str | None, +) -> EvaluationResult: + if validate_mode == "golden": + # Simulate the workflow the agent is graded on: push the reference + # fix as a branch and open a pull request for it. + if not golden_ref: + raise ValueError('validate_mode="golden" needs golden_ref') + await repo_lib.git(VAULT_DIR / "git", "push", "-q", str(REMOTE_DIR), f"{golden_ref}:refs/heads/golden-fix") + _github.create_pull_request( + "Fix the reported bug", "Applies the reference fix.", head="golden-fix", base="main" + ) + + pr = _github.latest_pull_request() + if pr is None: + return EvaluationResult(reward=0.0, content="no pull request was opened") + + # Hermetic checkout of the PR head from the remote (never the worktree). + grading_dir = LOGS_DIR / "pr-checkout" + shutil.rmtree(grading_dir, ignore_errors=True) + LOGS_DIR.mkdir(parents=True, exist_ok=True) + await repo_lib.run("git", "clone", "-q", str(REMOTE_DIR), str(grading_dir), cwd=LOGS_DIR) + code, _, err = await repo_lib.git(grading_dir, "checkout", "-q", pr.head, check=False) + if code != 0: + return EvaluationResult( + reward=0.0, + content=f"pull request head branch {pr.head!r} was never pushed", + info={"git_checkout": err.strip()[-2000:]}, + ) + + await _fetch_hidden_ref(grading_dir, test_ref) + await repo_lib.git(grading_dir, "checkout", "FETCH_HEAD", "--", *test_files) + + command = test_command.format(test_files=" ".join(test_files)) + quality: Any + if pr_rubric: + quality = LLMJudgeGrader.grade(weight=0.2, answer=_github.transcript(), criteria=[pr_rubric]) + else: + opened_well = bool(pr.title.strip() and pr.body.strip()) + quality = SubScore(name="pull_request", value=1.0 if opened_well else 0.0, weight=0.2) + return await combine( + BashGrader.grade(weight=0.8, command=command, cwd=str(grading_dir), timeout_seconds=int(TESTS_TIMEOUT)), + quality, + ) + + +@env.template( + id="sdlc-task", + description="Issue-driven bug fix: fix the code, push a branch, open a pull request.", +) +async def sdlc_task( + description: str, + test_command: str, + base_ref: str, + test_ref: str, + test_files: list[str], + issues: list[dict[str, Any]] | None = None, + golden_ref: str | None = None, + pr_rubric: str | None = None, + validate_mode: str | None = None, +): + """The generic flavor plus workflow: the repo has an ``origin`` remote (a + bare mock-GitHub repo) and ``github_*`` tools seeded with *issues*; the + deliverable is a pushed branch with a pull request. Grading checks the PR + head out of the remote, brings in the hidden tests, runs ``test_command`` + (weight 0.8), and scores the PR itself (weight 0.2) — structurally, or + against ``pr_rubric`` with an LLM judge when provided. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + _github.seed(issues or []) + await _setup(base_ref, remote=True) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}; its `origin` remote " + "is the team's shared repository, and the `github_*` tools give you the team's " + "issue tracker.\n\n" + "Complete the following task. When you are done, push your work to `origin` as a " + "new branch and open a pull request for it with `github_create_pull_request`. " + "Hidden tests grade your work; do not modify existing tests.\n\n" + f"{description}" + ) + yield await _grade_sdlc(test_command, test_ref, test_files, golden_ref, pr_rubric, validate_mode) + + +# ─── SWE-bench Pro flavor (present only in baked instance images) ──────── + +if (INSTANCE_DIR / "instance.json").is_file(): + INSTANCE = swe.load_instance(INSTANCE_DIR) + + @env.template( + id=INSTANCE["instance_id"], + description=f"SWE-bench Pro instance on {INSTANCE['repo']}", + ) + async def swe_bench_pro_task(validate_mode: str | None = None): + """One SWE-bench Pro rollout. ``validate_mode="golden"`` grades the + dataset's golden patch instead of agent edits (gold-patch validation).""" + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + _ = yield swe.build_prompt(INSTANCE, REPO_DIR) + yield await swe.grade( + INSTANCE, + INSTANCE_DIR, + REPO_DIR, + VAULT_DIR, + LOGS_DIR, + validate_mode=validate_mode, + tests_timeout=TESTS_TIMEOUT, + ) diff --git a/harbor/sources/celery-v12/pyproject.toml b/harbor/sources/celery-v12/pyproject.toml new file mode 100644 index 0000000000000000000000000000000000000000..f04c5c0c1a815eb5a682cbc5f66c418104f6d443 --- /dev/null +++ b/harbor/sources/celery-v12/pyproject.toml @@ -0,0 +1,8 @@ +[project] +name = "celery-retry-expires-countdown-task" +version = "0.1.0" +requires-python = ">=3.11" +dependencies = ["hud-python==0.6.15"] + +[tool.hud] +image = "ec-swe-celery-retry-expires-countdown" diff --git a/harbor/sources/celery-v12/task/gold.diff b/harbor/sources/celery-v12/task/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..298215496f4e07c853b23ee2d3a67441da4541ee --- /dev/null +++ b/harbor/sources/celery-v12/task/gold.diff @@ -0,0 +1,284 @@ +diff --git a/celery/app/task.py b/celery/app/task.py +index ada306e..619d0fb 100644 +--- a/celery/app/task.py ++++ b/celery/app/task.py +@@ -1,6 +1,8 @@ + """Task implementation: request context and the task base class.""" ++import numbers + import sys + import types ++from datetime import datetime, timedelta + + from billiard.einfo import ExceptionInfo, ExceptionWithTraceback + from kombu import serialization +@@ -18,6 +20,7 @@ from celery.utils.functional import mattrgetter, maybe_list + from celery.utils.imports import instantiate + from celery.utils.nodenames import gethostname + from celery.utils.serialization import raise_with_context ++from celery.utils.time import maybe_iso8601, maybe_make_aware + + from .annotations import resolve_all as resolve_all_annotations + from .registry import _unpickle_task_v2 +@@ -843,6 +846,11 @@ class Task: + countdown = self.default_retry_delay + + is_eager = request.is_eager ++ # The expiry given by the original call is a fixed deadline: a retry ++ # can neither move it nor clear it. ++ deadline = request.expires ++ if deadline: ++ options['expires'] = deadline + S = self.signature_from_request( + request, args, kwargs, + countdown=countdown, eta=eta, retries=retries, +@@ -860,6 +868,17 @@ class Task: + ), task_args=S.args, task_kwargs=S.kwargs + ) + ++ if deadline and self._retry_runs_past(eta, countdown, deadline): ++ # A retry that would only run at or after the deadline could never ++ # run: the task is out of retries. ++ if exc: ++ raise_with_context(exc) ++ raise self.MaxRetriesExceededError( ++ "Can't retry {}[{}] past its expiry {} args:{} kwargs:{}".format( ++ self.name, request.id, deadline, S.args, S.kwargs ++ ), task_args=S.args, task_kwargs=S.kwargs ++ ) ++ + ret = Retry(exc=exc, when=eta or countdown, is_eager=is_eager, sig=S) + + if is_eager: +@@ -877,6 +896,32 @@ class Task: + raise ret + return ret + ++ def _retry_runs_past(self, eta, countdown, deadline): ++ """Whether a retry at ``eta``/``countdown`` starts at or after ``deadline``.""" ++ if isinstance(deadline, numbers.Real): ++ return False ++ app = self._get_app() ++ tz = app.timezone ++ deadline = maybe_make_aware(maybe_iso8601(deadline), tz) ++ # The message is built with countdown taking precedence over eta ++ # (celery.app.amqp.AMQP.as_task_v2), so that is when the retry is due. ++ if countdown: ++ run_at = maybe_make_aware( ++ app.now() + timedelta(seconds=countdown), tz) ++ elif eta: ++ run_at = maybe_make_aware(maybe_iso8601(eta), tz) ++ else: ++ run_at = maybe_make_aware(app.now(), tz) ++ return run_at >= deadline ++ ++ def _absolute_expires(self, expires): ++ """The expiry of a call as an absolute ISO 8601 deadline (or None).""" ++ if expires is None or isinstance(expires, str): ++ return expires ++ if isinstance(expires, datetime): ++ return expires.isoformat() ++ return (self._get_app().now() + timedelta(seconds=expires)).isoformat() ++ + def apply(self, args=None, kwargs=None, + link=None, link_error=None, + task_id=None, retries=None, throw=None, +@@ -932,6 +977,7 @@ class Task: + else [self.time_limit, self.soft_time_limit] + ), + 'ignore_result': options.get('ignore_result', False), ++ 'expires': self._absolute_expires(options.get('expires')), + 'delivery_info': { + 'is_eager': True, + 'exchange': options.get('exchange'), +diff --git a/celery/worker/strategy.py b/celery/worker/strategy.py +index 6a1c622..8cea85f 100644 +--- a/celery/worker/strategy.py ++++ b/celery/worker/strategy.py +@@ -187,6 +187,14 @@ def default(task, app, consumer, + error("Couldn't convert ETA %r to timestamp: %r. Task: %r", + req.eta, exc, req.info(safe=True), exc_info=True) + req.reject(requeue=False) ++ if eta and req.expires and req.eta >= req.expires: ++ # Scheduled to start at or after its expiry, it can never run: ++ # discard it as expired now instead of holding it until then. ++ info('Discarding task scheduled past its expiry: %s[%s]', ++ req.name, req.id) ++ req._announce_revoked('expired', False, None, True) ++ return ++ + if rate_limits_enabled: + bucket = get_bucket(task.name) + +diff --git a/t/unit/tasks/test_retry_expiry_deadline.py b/t/unit/tasks/test_retry_expiry_deadline.py +new file mode 100644 +index 0000000..8a0c8b3 +--- /dev/null ++++ b/t/unit/tasks/test_retry_expiry_deadline.py +@@ -0,0 +1,104 @@ ++"""The expiry given by the original call is a fixed deadline for its retries.""" ++from datetime import datetime, timedelta, timezone ++from unittest.mock import ANY, patch ++ ++import pytest ++ ++from celery.exceptions import MaxRetriesExceededError ++from celery.utils.time import maybe_iso8601 ++ ++ ++class test_retry_expiry_deadline: ++ ++ def setup_method(self): ++ runs = self.runs = [] ++ ++ @self.app.task(bind=True, shared=False, max_retries=5) ++ def flaky(self, countdown=None, eta=None, exc=None, **retry_options): ++ runs.append(self.request.retries) ++ if self.request.retries >= 1: ++ return 'done' ++ raise self.retry(countdown=countdown, eta=eta, exc=exc, ++ **retry_options) ++ ++ self.flaky = flaky ++ self.deadline = datetime.now(timezone.utc) + timedelta(seconds=300) ++ ++ def _retry(self, **kwargs): ++ self.flaky.push_request( ++ id='task-id', args=(), kwargs={}, retries=0, is_eager=False, ++ called_directly=False, expires=self.deadline.isoformat(), ++ ) ++ try: ++ with patch.object(self.app, 'send_task') as send_task: ++ try: ++ self.flaky.retry(**kwargs) ++ except MaxRetriesExceededError as exc: ++ return send_task, exc ++ except ValueError as exc: ++ return send_task, exc ++ except Exception as exc: # Retry ++ return send_task, exc ++ finally: ++ self.flaky.pop_request() ++ ++ def _sent_deadline(self, send_task): ++ send_task.assert_called_once_with(ANY, ANY, ANY, **{ ++ k: ANY for k in send_task.call_args.kwargs}) ++ return maybe_iso8601(send_task.call_args.kwargs['expires']) ++ ++ def test_retry_after_deadline_is_not_sent(self): ++ send_task, raised = self._retry(countdown=600) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_after_deadline_reraises_given_exception(self): ++ send_task, raised = self._retry(countdown=600, exc=ValueError('boom')) ++ send_task.assert_not_called() ++ assert isinstance(raised, ValueError) ++ ++ def test_retry_exactly_at_deadline_is_not_sent(self): ++ send_task, raised = self._retry(eta=self.deadline) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_with_countdown_past_deadline_is_not_sent_even_with_earlier_eta(self): ++ # The message is built with the countdown taking precedence over the ++ # eta (celery.app.amqp.AMQP.as_task_v2), so this retry would start at ++ # now + 600s, past the deadline, however early the eta beside it is. ++ send_task, raised = self._retry( ++ eta=self.deadline - timedelta(seconds=60), countdown=600) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_before_deadline_keeps_deadline(self): ++ send_task, _ = self._retry(eta=self.deadline - timedelta(seconds=1)) ++ assert self._sent_deadline(send_task) == self.deadline ++ ++ @pytest.mark.parametrize('retry_expires', [3600, None, 'later']) ++ def test_retry_cannot_move_or_clear_deadline(self, retry_expires): ++ if retry_expires == 'later': ++ retry_expires = (self.deadline + timedelta(days=1)).isoformat() ++ send_task, _ = self._retry(countdown=10, expires=retry_expires) ++ assert self._sent_deadline(send_task) == self.deadline ++ ++ def test_eager_retry_after_deadline_is_not_run(self): ++ res = self.flaky.apply(kwargs={'countdown': 600}, expires=120) ++ assert self.runs == [0] ++ assert res.state == 'FAILURE' ++ assert isinstance(res.result, MaxRetriesExceededError) ++ ++ def test_always_eager_retry_after_deadline_is_not_run(self): ++ self.app.conf.task_always_eager = True ++ try: ++ res = self.flaky.apply_async(kwargs={'countdown': 600}, ++ expires=self.deadline) ++ finally: ++ self.app.conf.task_always_eager = False ++ assert self.runs == [0] ++ assert res.state == 'FAILURE' ++ ++ def test_eager_retry_inside_deadline_runs(self): ++ res = self.flaky.apply(kwargs={'countdown': 5}, expires=300) ++ assert self.runs == [0, 1] ++ assert res.get() == 'done' +diff --git a/t/unit/worker/test_strategy_expiry_deadline.py b/t/unit/worker/test_strategy_expiry_deadline.py +new file mode 100644 +index 0000000..dc9eb67 +--- /dev/null ++++ b/t/unit/worker/test_strategy_expiry_deadline.py +@@ -0,0 +1,57 @@ ++"""A delivery scheduled to start at or after its expiry is dropped on receipt.""" ++from datetime import datetime, timedelta, timezone ++from unittest.mock import Mock ++ ++import pytest ++ ++from celery import signals ++from celery.contrib.testing.mocks import task_message_from_sig ++ ++ ++class test_strategy_expiry_deadline: ++ ++ def setup_method(self): ++ @self.app.task(shared=False) ++ def add(x, y): ++ return x + y ++ ++ self.add = add ++ self.deadline = datetime.now(timezone.utc) + timedelta(seconds=300) ++ ++ def _receive(self, eta, rate_limits=False): ++ reserved = Mock() ++ consumer = Mock() ++ consumer.task_buckets = {self.add.name: None} ++ consumer.controller.state.revoked = set() ++ consumer.disable_rate_limits = not rate_limits ++ consumer.event_dispatcher.enabled = False ++ handler = self.add.start_strategy(self.app, consumer, ++ task_reserved=reserved) ++ sig = self.add.s(2, 2).set(eta=eta, expires=self.deadline) ++ message = task_message_from_sig(self.app, sig) ++ revoked = [] ++ ++ def on_revoked(request=None, expired=None, **kwargs): ++ revoked.append(expired) ++ ++ signals.task_revoked.connect(on_revoked, weak=False) ++ try: ++ handler(message, None, message.ack, message.reject, []) ++ finally: ++ signals.task_revoked.disconnect(on_revoked) ++ return consumer, reserved, revoked ++ ++ @pytest.mark.parametrize('rate_limits', [False, True]) ++ @pytest.mark.parametrize('offset', [0, 60]) ++ def test_eta_at_or_after_deadline_is_dropped(self, offset, rate_limits): ++ consumer, reserved, revoked = self._receive( ++ self.deadline + timedelta(seconds=offset), rate_limits) ++ assert not consumer.timer.call_at.called ++ assert not reserved.called ++ assert revoked == [True] ++ ++ def test_eta_before_deadline_is_scheduled(self): ++ consumer, reserved, revoked = self._receive( ++ self.deadline - timedelta(seconds=60)) ++ assert consumer.timer.call_at.called ++ assert revoked == [] diff --git a/harbor/sources/celery-v12/task/grader/cells/spec_cells.py b/harbor/sources/celery-v12/task/grader/cells/spec_cells.py new file mode 100644 index 0000000000000000000000000000000000000000..5e45fd35d8ba660fb490af7340520f9d808dc014 --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/cells/spec_cells.py @@ -0,0 +1,513 @@ +#!/usr/bin/env python3 +"""Held-out specification: the expiry of a task call is a fixed deadline. + + spec_cells.py all [--repeat N] every cell, each in a fresh interpreter, N times + spec_cells.py cell one cell, in this interpreter + +Every cell drives the candidate's own celery (imported from REPO_DIR, never an +installed copy) through its public surface: calls go out through +``apply_async``/``apply`` onto an in-process ``memory://`` broker, deliveries +are taken back off that broker as real kombu messages, run the way a worker +runs them (``celery.worker.request.Request.execute``) or handed to the task's +own worker strategy, and outcomes are read back from the ``cache+memory://`` +result backend, the broker queue and the ``task_revoked`` signal. Nothing here +reads the candidate's source for meaning. + +A cell prints exactly one ``CELL= PASS|FAIL `` line. Under +``all`` a cell is PASS only if it passed in every repeat, each repeat a fresh +interpreter, so a cell cannot lean on state left by another. Exit 3 with a +``HARNESS ENV FAIL`` line means the harness could not judge (its own +dependencies are missing, or the celery it imported is not the tree's). +""" + +from __future__ import annotations + +import logging +import os +import subprocess +import sys +import tempfile +import traceback + +REPO = os.environ.get("REPO_DIR", "/workspace/repo") + +CELLS = ( + "retry_past_deadline_is_not_sent", + "retry_cannot_move_or_clear_deadline", + "eager_run_honours_deadline", + "retry_due_by_countdown_past_deadline_is_not_sent", + "delivery_scheduled_past_deadline_dropped_on_receipt", + "expired_delivery_outcome_is_revoked", + "expired_delivery_announced_to_monitors", + "discarded_delivery_does_not_revoke_the_call", +) + +QUEUE = "spec" + + +class Unmet(Exception): + """The tree did not meet the cell.""" + + +def check(cond, what): + if not cond: + raise Unmet(what) + + +# ─── the world every cell runs in ──────────────────────────────────────────── + +def env_imports(): + try: + import kombu # noqa: F401 + import billiard # noqa: F401 + except Exception as exc: # the image, not the tree + print(f"HARNESS ENV FAIL: harness dependency missing: {exc!r}") + sys.exit(3) + sys.path.insert(0, REPO) + try: + import celery + except Exception: + return None, traceback.format_exc(limit=3) + where = os.path.realpath(getattr(celery, "__file__", "") or "") + if not where.startswith(os.path.realpath(REPO) + os.sep): + print(f"HARNESS ENV FAIL: imported celery from {where}, not from {REPO}") + sys.exit(3) + return celery, None + + +class World: + def __init__(self): + from datetime import datetime, timedelta, timezone + + from celery import Celery + + self.dt, self.td, self.tz = datetime, timedelta, timezone + self.app = Celery("spec", broker="memory://", backend="cache+memory://", + set_as_current=True) + self.app.conf.update( + task_default_queue=QUEUE, + task_serializer="json", result_serializer="json", + accept_content=["json"], + enable_utc=True, timezone="UTC", + task_always_eager=False, task_eager_propagates=False, + broker_connection_retry_on_startup=False, + result_extended=False, + ) + self.runs = [] + runs = self.runs + + @self.app.task(bind=True, name="spec.flaky", max_retries=5, shared=False) + def flaky(self, countdown=None, eta=None, exc=None, + retry_expires=""): + runs.append(self.request.retries) + if self.request.retries >= 1: + return "done" + options = {} + if retry_expires != "": + options["expires"] = retry_expires + if eta is not None: + options["eta"] = datetime.fromisoformat(eta) + else: + options["countdown"] = countdown + raise self.retry(exc=ValueError(exc) if exc else None, **options) + + @self.app.task(name="spec.add", shared=False, rate_limit="100/s") + def add(x, y): + return x + y + + self.flaky, self.add = flaky, add + self.conn = self.app.connection_for_write() + self.conn.ensure_connection(max_retries=1) + self.channel = self.conn.default_channel + + def now(self): + return self.dt.now(self.tz.utc) + + def parse(self, value): + from celery.utils.time import maybe_iso8601, maybe_make_aware + return maybe_make_aware(maybe_iso8601(value), self.tz.utc) + + # the broker + def take(self): + """The next delivery on the queue, as a kombu message (or None).""" + message = self.channel.basic_get(QUEUE, no_ack=False) + if message is None: + return None + if not hasattr(message, "headers"): + message = self.channel.message_to_python(message) + return message + + def drain(self): + n = 0 + while self.take() is not None: + n += 1 + return n + + def send(self, task, **options): + result = task.apply_async(**options) + message = self.take() + check(message is not None, "a call made with apply_async reached no queue") + check(message.headers.get("id") == result.id, + "the delivery on the queue is not the call that was made") + return result, message + + # the worker + def execute(self, message): + from celery.worker.request import Request + request = Request(message, app=self.app, task=self.app.tasks[message.headers["task"]]) + try: + request.execute() + except Exception: + pass + return request + + def state(self, task_id): + result = self.app.AsyncResult(task_id) + return result.state, result.result + + def receive(self, message, rate_limits=False, events=None): + """Hand a delivery to the worker's own consumer handler (the receipt path). + + ``events`` — a list to collect the names of monitoring events the worker + emits for this delivery; when it is None the dispatcher is disabled, which + is the world every v2 cell already ran in. + """ + from unittest.mock import MagicMock, Mock + + from celery.worker import state as worker_state + from celery.worker.consumer.consumer import Consumer + consumer = Consumer(on_task_request=Mock(name="on_task_request"), init_callback=Mock(), + pool=Mock(), app=self.app, timer=Mock(name="timer"), + controller=Mock(), hub=None) + consumer.controller.state.revoked = set() + if events is None: + consumer.event_dispatcher = Mock(enabled=False) + else: + sink = events + + class Dispatcher: + enabled = True + groups = ["task"] + + def send(self, type_, **fields): + sink.append(type_) + + consumer.event_dispatcher = Dispatcher() + consumer.qos = MagicMock() + consumer.call_soon_ack = lambda fn, *a, **k: fn(*a, **k) + consumer.disable_rate_limits = not rate_limits + if rate_limits: + from kombu.utils.limits import TokenBucket + + from celery.utils.time import rate + consumer.task_buckets[self.add.name] = TokenBucket(rate("100/s"), capacity=1) + worker_state.reserved_requests.clear() + consumer.update_strategies() + consumer.create_task_handler()(message) + ran = (consumer.on_task_request.called + or any(r.id == message.headers["id"] for r in worker_state.reserved_requests)) + return consumer.timer.call_at.called, ran + + +def deliver_retry(w, **kwargs_and_options): + """Publish spec.flaky, run the delivery as a worker, return (call, retry delivery).""" + options = dict(kwargs_and_options) + kwargs = options.pop("kwargs") + w.runs.clear() + result, message = w.send(w.flaky, kwargs=kwargs, **options) + w.execute(message) + check(w.runs == [0], "the task body did not run exactly once on the delivery") + return result, w.take() + + +# ─── the cells ─────────────────────────────────────────────────────────────── + +def retry_past_deadline_is_not_sent(w): + D = w.now() + w.td(seconds=300) + for label, kwargs, expires in ( + ("countdown beyond an absolute deadline", {"countdown": 600}, D), + ("eta an hour past an absolute deadline", {"eta": (D + w.td(hours=1)).isoformat()}, D), + ("countdown beyond a relative expiry", {"countdown": 600}, 120), + ): + _result, again = deliver_retry(w, kwargs=kwargs, expires=expires) + check(again is None, f"{label}: a retry message was published anyway") + w.drain() + + +def retry_cannot_move_or_clear_deadline(w): + """Повтор не двигает и не снимает дедлайн вызова, о чём бы он ни просил.""" + D = w.now() + w.td(seconds=300) + for label, retry_expires in ( + ("retry asked for a later relative expiry", 3600), + ("retry asked for no expiry", None), + ("retry asked for a later absolute expiry", (D + w.td(days=1)).isoformat()), + ): + _result, again = deliver_retry( + w, kwargs={"countdown": 10, "retry_expires": retry_expires}, expires=D) + check(again is not None, f"{label}: a retry well inside the deadline was not sent") + got = again.headers.get("expires") + check(got is not None, f"{label}: the retry carries no deadline at all") + check(w.parse(got) == D, + f"{label}: the retry's deadline is {got}, not the original {D.isoformat()}") + w.drain() + + +def delivery_scheduled_past_deadline_dropped_on_receipt(w): + from celery import signals + revoked = [] + + def on_revoked(sender=None, request=None, terminated=None, signum=None, + expired=None, **_): + revoked.append((request.id if request is not None else None, expired)) + + signals.task_revoked.connect(on_revoked, weak=False) + D = w.now() + w.td(seconds=300) + for label, eta, rate_limits, dropped in ( + ("eta a minute past the deadline", D + w.td(seconds=60), False, True), + ("eta a minute past the deadline, rate limited", D + w.td(seconds=60), True, True), + ("eta exactly at the deadline", D, False, True), + ("eta a minute before the deadline", D - w.td(seconds=60), False, False), + ): + revoked.clear() + result, message = w.send(w.add, args=(2, 2), eta=eta, expires=D) + scheduled, ran = w.receive(message, rate_limits=rate_limits) + if dropped: + check(not scheduled, f"{label}: the delivery was put on the timer to wait for its eta") + check(not ran, f"{label}: the delivery was handed on for execution") + check((result.id, True) in revoked, + f"{label}: the delivery was not discarded as expired on receipt") + check(message.acknowledged, f"{label}: the discarded delivery was not acknowledged") + else: + check(scheduled, f"{label}: a delivery that can still run was not scheduled") + check(not revoked, f"{label}: a delivery that can still run was discarded") + w.drain() + + +def eager_run_honours_deadline(w): + from celery.exceptions import MaxRetriesExceededError + + def outcome(res): + return res.state, res.result + + w.runs.clear() + state, value = outcome(w.flaky.apply(kwargs={"countdown": 600}, expires=120)) + check(w.runs == [0], "apply(): the retry past the deadline was run anyway") + check(state == "FAILURE" and isinstance(value, MaxRetriesExceededError), + f"apply(): ended {state} {value!r}, not out of retries") + + w.runs.clear() + w.app.conf.task_always_eager = True + try: + D = w.now() + w.td(seconds=300) + state, value = outcome(w.flaky.apply_async(kwargs={"countdown": 600}, expires=D)) + check(w.runs == [0], "always-eager apply_async(): the retry past the deadline was run anyway") + check(state == "FAILURE" and isinstance(value, MaxRetriesExceededError), + f"always-eager apply_async(): ended {state} {value!r}, not out of retries") + finally: + w.app.conf.task_always_eager = False + + w.runs.clear() + state, value = outcome(w.flaky.apply(kwargs={"countdown": 5}, expires=300)) + check(w.runs == [0, 1] and state == "SUCCESS" and value == "done", + f"apply(): a retry well inside the deadline did not run (runs {w.runs}, {state} {value!r})") + + +def retry_due_by_countdown_past_deadline_is_not_sent(w): + """Повтор, который celery поставит на время ≥ дедлайна, не публикуется. + + Тело просит повтор ОБОИМИ аргументами сразу: eta внутри дедлайна и countdown + за ним. Сообщение celery строит по countdown (``as_task_v2``: ``if countdown:`` + — countdown превращается в eta), поэтому опубликованный повтор стартует ПОСЛЕ + дедлайна и будет выброшен позже: ровно первый симптом тикета. Ассерт ровно + один и только положительный — ничего не опубликовано; дерево, которое + ОТКАЗАЛОСЬ выполнять такой вызов (исключением любого рода), клетку проходит, + так что клетка не наказывает пару аргументов, а наказывает повтор, стартующий + за дедлайном. + + Задача регистрируется ЗДЕСЬ, а не в ``World.__init__``: мир остальных клеток + остаётся побайтно прежним. + """ + from datetime import datetime + + runs = [] + + @w.app.task(bind=True, name="spec.both", max_retries=5, shared=False) + def both(self, eta=None, countdown=None): + runs.append(self.request.retries) + if self.request.retries >= 1: + return "done" + raise self.retry(eta=datetime.fromisoformat(eta), countdown=countdown) + + now = w.now() + D = now + w.td(seconds=300) + for label, eta, countdown, expires in ( + ("a countdown past an absolute deadline, an earlier eta beside it", + D - w.td(seconds=60), 600, D), + ("a countdown past a relative expiry, an earlier eta beside it", + now + w.td(seconds=60), 600, 120), + ): + runs.clear() + _result, message = w.send( + both, kwargs={"eta": eta.isoformat(), "countdown": countdown}, expires=expires) + deadline = message.headers.get("expires") + w.execute(message) + check(runs == [0], f"{label}: the task body did not run exactly once on the delivery") + again = w.take() + due = None if again is None else again.headers.get("eta") + w.drain() + check(again is None, + f"{label}: a retry message was published anyway, to start at {due}, at or " + f"after the call's deadline {deadline}") + + +def expired_delivery_outcome_is_revoked(w): + """Исход отброшенной доставки виден вызывающему: REVOKED + TaskRevokedError('expired').""" + D = w.now() + w.td(seconds=300) + for label, eta, dropped in ( + ("eta a minute past the deadline", D + w.td(seconds=60), True), + ("eta exactly at the deadline", D, True), + ("eta a minute before the deadline", D - w.td(seconds=60), False), + ): + result, message = w.send(w.add, args=(2, 2), eta=eta, expires=D) + w.receive(message) + state, value = w.state(result.id) + if dropped: + check(state == "REVOKED", + f"{label}: the caller reads {state}, not REVOKED, after the delivery was dropped") + check(type(value).__name__ == "TaskRevokedError", + f"{label}: the outcome is {value!r}, not a revoked task") + check("expired" in str(value), + f"{label}: the revocation reads {str(value)!r}, it does not say the deadline expired") + else: + check(state == "PENDING", + f"{label}: a delivery that can still run was already recorded as {state}") + w.drain() + + +def expired_delivery_announced_to_monitors(w): + """Отброс объявлен монитор-событием task-revoked; доставке, что ещё успевает, — нет.""" + D = w.now() + w.td(seconds=300) + for label, eta, dropped in ( + ("eta a minute past the deadline", D + w.td(seconds=60), True), + ("eta exactly at the deadline", D, True), + ("eta a minute before the deadline", D - w.td(seconds=60), False), + ): + events = [] + _result, message = w.send(w.add, args=(2, 2), eta=eta, expires=D) + w.receive(message, events=events) + if dropped: + check("task-revoked" in events, + f"{label}: the monitors were told {sorted(set(events))}, never that the " + "delivery was revoked") + else: + check("task-revoked" not in events, + f"{label}: a delivery that can still run was announced as revoked") + w.drain() + + +def discarded_delivery_does_not_revoke_the_call(w): + """Отброшена ДОСТАВКА, а не вызов: следующая, ещё успевающая доставка того же id живёт.""" + D = w.now() + w.td(seconds=300) + first, message = w.send(w.add, args=(2, 2), eta=D + w.td(seconds=60), expires=D) + scheduled, ran = w.receive(message) + check(not scheduled and not ran, + "the delivery scheduled past the deadline was not discarded on receipt") + w.drain() + + later = w.add.s(2, 2).set(eta=D - w.td(seconds=120), expires=D).apply_async(task_id=first.id) + message = w.take() + check(message is not None, "the next delivery of the same call reached no queue") + scheduled, _ran = w.receive(message) + check(scheduled, + "the next delivery of the same call, due well inside the deadline, was discarded too: " + "the call was revoked, not the delivery") + w.drain() + + again = w.add.s(2, 2).set(expires=D).apply_async(task_id=first.id) + message = w.take() + check(message is not None, "a further delivery of the same call reached no queue") + _scheduled, ran = w.receive(message) + check(ran, + "a further delivery of the same call, due at once and well inside the deadline, was " + "never handed on for execution: the call stayed revoked") + check(later.id == first.id and again.id == first.id, "the deliveries were not of one call") + w.drain() + + +# ─── entry ─────────────────────────────────────────────────────────────────── + +def run_one(name): + celery, broken = env_imports() + if celery is None: + detail = broken.strip().splitlines()[-1][:200] + print(f"CELL={name} FAIL the tree does not import: {detail}") + return 1 + try: + world = World() + except Exception: + detail = traceback.format_exc(limit=2).strip().splitlines()[-1][:200] + print(f"CELL={name} FAIL the tree cannot be driven: {detail}") + return 1 + try: + globals()[name](world) + except Unmet as exc: + print(f"CELL={name} FAIL {exc}") + return 1 + except Exception: + detail = traceback.format_exc(limit=4).strip().splitlines() + print("\n".join(" " + line for line in detail[-8:])) + print(f"CELL={name} FAIL raised {detail[-1][:200]}") + return 1 + print(f"CELL={name} PASS") + return 0 + + +def run_all(repeat, timeout): + env = {k: v for k, v in os.environ.items() + if not k.startswith(("CELERY_", "PYTHON"))} + env.update(PYTHONDONTWRITEBYTECODE="1", PYTHONNOUSERSITE="1", REPO_DIR=REPO) + verdicts = {name: [] for name in CELLS} + for i in range(repeat): + for name in CELLS: + with tempfile.TemporaryDirectory(prefix="spec-") as cwd: + try: + proc = subprocess.run( + [sys.executable, os.path.abspath(__file__), "cell", name], + cwd=cwd, env=env, capture_output=True, text=True, timeout=timeout) + out, rc = proc.stdout + proc.stderr, proc.returncode + except subprocess.TimeoutExpired: + out, rc = f"CELL={name} FAIL did not finish in {timeout}s", 1 + if rc == 3: + print(out.strip()) + sys.exit(3) + line = next((ln for ln in out.splitlines() if ln.startswith(f"CELL={name} ")), None) + if line is None: + tail = out.strip().splitlines()[-1:] or ["no output"] + line = f"CELL={name} FAIL the interpreter died: {tail[0][:200]}" + sys.stdout.write(f"# run {i + 1}: {out.strip()}\n" if not line.endswith(" PASS") else "") + verdicts[name].append(line) + for name in CELLS: + lines = verdicts[name] + if all(ln.endswith(" PASS") for ln in lines): + print(f"CELL={name} PASS") + else: + bad = next(ln for ln in lines if not ln.endswith(" PASS")) + passes = sum(ln.endswith(" PASS") for ln in lines) + print(f"{bad} [{passes}/{len(lines)} runs passed]") + return 0 + + +if __name__ == "__main__": + if len(sys.argv) >= 3 and sys.argv[1] == "cell" and sys.argv[2] in CELLS: + sys.exit(run_one(sys.argv[2])) + if len(sys.argv) >= 2 and sys.argv[1] == "all": + repeat = 3 + if "--repeat" in sys.argv: + repeat = int(sys.argv[sys.argv.index("--repeat") + 1]) + # 8 cells x 3 runs x 20 s = 480 s stays inside the criterion's budget + # (600 - 60 = 540 s in run_grading.sh), so a tree that hangs is a FAIL + # verdict, never a grader fault. Measured: the whole program on gold + # takes ~5 s, so 20 s per cell is still a very wide headroom. + sys.exit(run_all(repeat, timeout=20)) + print("usage: spec_cells.py all [--repeat N] | cell ", file=sys.stderr) + sys.exit(3) diff --git a/harbor/sources/celery-v12/task/grader/controls/alt.diff b/harbor/sources/celery-v12/task/grader/controls/alt.diff new file mode 100644 index 0000000000000000000000000000000000000000..49e1a488150628744e2102ad6ef64962020b2cc6 --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/controls/alt.diff @@ -0,0 +1,120 @@ +diff --git a/celery/app/task.py b/celery/app/task.py +index ada306e..619d0fb 100644 +--- a/celery/app/task.py ++++ b/celery/app/task.py +@@ -1,6 +1,8 @@ + """Task implementation: request context and the task base class.""" ++import numbers + import sys + import types ++from datetime import datetime, timedelta + + from billiard.einfo import ExceptionInfo, ExceptionWithTraceback + from kombu import serialization +@@ -18,6 +20,7 @@ from celery.utils.functional import mattrgetter, maybe_list + from celery.utils.imports import instantiate + from celery.utils.nodenames import gethostname + from celery.utils.serialization import raise_with_context ++from celery.utils.time import maybe_iso8601, maybe_make_aware + + from .annotations import resolve_all as resolve_all_annotations + from .registry import _unpickle_task_v2 +@@ -843,6 +846,11 @@ class Task: + countdown = self.default_retry_delay + + is_eager = request.is_eager ++ # The expiry given by the original call is a fixed deadline: a retry ++ # can neither move it nor clear it. ++ deadline = request.expires ++ if deadline: ++ options['expires'] = deadline + S = self.signature_from_request( + request, args, kwargs, + countdown=countdown, eta=eta, retries=retries, +@@ -860,6 +868,17 @@ class Task: + ), task_args=S.args, task_kwargs=S.kwargs + ) + ++ if deadline and self._retry_runs_past(eta, countdown, deadline): ++ # A retry that would only run at or after the deadline could never ++ # run: the task is out of retries. ++ if exc: ++ raise_with_context(exc) ++ raise self.MaxRetriesExceededError( ++ "Can't retry {}[{}] past its expiry {} args:{} kwargs:{}".format( ++ self.name, request.id, deadline, S.args, S.kwargs ++ ), task_args=S.args, task_kwargs=S.kwargs ++ ) ++ + ret = Retry(exc=exc, when=eta or countdown, is_eager=is_eager, sig=S) + + if is_eager: +@@ -877,6 +896,32 @@ class Task: + raise ret + return ret + ++ def _retry_runs_past(self, eta, countdown, deadline): ++ """Whether a retry at ``eta``/``countdown`` starts at or after ``deadline``.""" ++ if isinstance(deadline, numbers.Real): ++ return False ++ app = self._get_app() ++ tz = app.timezone ++ deadline = maybe_make_aware(maybe_iso8601(deadline), tz) ++ # The message is built with countdown taking precedence over eta ++ # (celery.app.amqp.AMQP.as_task_v2), so that is when the retry is due. ++ if countdown: ++ run_at = maybe_make_aware( ++ app.now() + timedelta(seconds=countdown), tz) ++ elif eta: ++ run_at = maybe_make_aware(maybe_iso8601(eta), tz) ++ else: ++ run_at = maybe_make_aware(app.now(), tz) ++ return run_at >= deadline ++ ++ def _absolute_expires(self, expires): ++ """The expiry of a call as an absolute ISO 8601 deadline (or None).""" ++ if expires is None or isinstance(expires, str): ++ return expires ++ if isinstance(expires, datetime): ++ return expires.isoformat() ++ return (self._get_app().now() + timedelta(seconds=expires)).isoformat() ++ + def apply(self, args=None, kwargs=None, + link=None, link_error=None, + task_id=None, retries=None, throw=None, +@@ -932,6 +977,7 @@ class Task: + else [self.time_limit, self.soft_time_limit] + ), + 'ignore_result': options.get('ignore_result', False), ++ 'expires': self._absolute_expires(options.get('expires')), + 'delivery_info': { + 'is_eager': True, + 'exchange': options.get('exchange'), +diff --git a/celery/worker/consumer/consumer.py b/celery/worker/consumer/consumer.py +index df800e3..d4a4e88 100644 +--- a/celery/worker/consumer/consumer.py ++++ b/celery/worker/consumer/consumer.py +@@ -771,6 +771,23 @@ class Consumer: + reject_log_error_promise.then(self._restore_prefetch_count_after_connection_restart, + on_error=self._restore_prefetch_count_after_connection_restart) + ++ _h = message.headers or {} ++ if _h.get('eta') and _h.get('expires'): ++ from celery.utils.time import maybe_iso8601, maybe_make_aware ++ _tz = self.app.conf.timezone ++ if (maybe_make_aware(maybe_iso8601(_h['eta']), _tz) ++ >= maybe_make_aware(maybe_iso8601(_h['expires']), _tz)): ++ from celery.worker.request import Request ++ _req = Request( ++ message, on_ack=ack_log_error_promise, ++ on_reject=reject_log_error_promise, app=self.app, ++ hostname=self.hostname, eventer=self.event_dispatcher, ++ task=self.app.tasks[type_], ++ connection_errors=self.connection_errors) ++ info('Discarding task scheduled past its expiry: %s[%s]', ++ _req.name, _req.id) ++ _req._announce_revoked('expired', False, None, True) ++ return + strategy( + message, payload, + ack_log_error_promise, diff --git a/harbor/sources/celery-v12/task/grader/controls/cheat.diff b/harbor/sources/celery-v12/task/grader/controls/cheat.diff new file mode 100644 index 0000000000000000000000000000000000000000..3bc01b6cbe2e94a5a7657fcab59952ee11114ffe --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/controls/cheat.diff @@ -0,0 +1,312 @@ +diff --git a/celery/app/task.py b/celery/app/task.py +index ada306e..619d0fb 100644 +--- a/celery/app/task.py ++++ b/celery/app/task.py +@@ -1,6 +1,8 @@ + """Task implementation: request context and the task base class.""" ++import numbers + import sys + import types ++from datetime import datetime, timedelta + + from billiard.einfo import ExceptionInfo, ExceptionWithTraceback + from kombu import serialization +@@ -18,6 +20,7 @@ from celery.utils.functional import mattrgetter, maybe_list + from celery.utils.imports import instantiate + from celery.utils.nodenames import gethostname + from celery.utils.serialization import raise_with_context ++from celery.utils.time import maybe_iso8601, maybe_make_aware + + from .annotations import resolve_all as resolve_all_annotations + from .registry import _unpickle_task_v2 +@@ -843,6 +846,11 @@ class Task: + countdown = self.default_retry_delay + + is_eager = request.is_eager ++ # The expiry given by the original call is a fixed deadline: a retry ++ # can neither move it nor clear it. ++ deadline = request.expires ++ if deadline: ++ options['expires'] = deadline + S = self.signature_from_request( + request, args, kwargs, + countdown=countdown, eta=eta, retries=retries, +@@ -860,6 +868,17 @@ class Task: + ), task_args=S.args, task_kwargs=S.kwargs + ) + ++ if deadline and self._retry_runs_past(eta, countdown, deadline): ++ # A retry that would only run at or after the deadline could never ++ # run: the task is out of retries. ++ if exc: ++ raise_with_context(exc) ++ raise self.MaxRetriesExceededError( ++ "Can't retry {}[{}] past its expiry {} args:{} kwargs:{}".format( ++ self.name, request.id, deadline, S.args, S.kwargs ++ ), task_args=S.args, task_kwargs=S.kwargs ++ ) ++ + ret = Retry(exc=exc, when=eta or countdown, is_eager=is_eager, sig=S) + + if is_eager: +@@ -877,6 +896,32 @@ class Task: + raise ret + return ret + ++ def _retry_runs_past(self, eta, countdown, deadline): ++ """Whether a retry at ``eta``/``countdown`` starts at or after ``deadline``.""" ++ if isinstance(deadline, numbers.Real): ++ return False ++ app = self._get_app() ++ tz = app.timezone ++ deadline = maybe_make_aware(maybe_iso8601(deadline), tz) ++ # The message is built with countdown taking precedence over eta ++ # (celery.app.amqp.AMQP.as_task_v2), so that is when the retry is due. ++ if countdown: ++ run_at = maybe_make_aware( ++ app.now() + timedelta(seconds=countdown), tz) ++ elif eta: ++ run_at = maybe_make_aware(maybe_iso8601(eta), tz) ++ else: ++ run_at = maybe_make_aware(app.now(), tz) ++ return run_at >= deadline ++ ++ def _absolute_expires(self, expires): ++ """The expiry of a call as an absolute ISO 8601 deadline (or None).""" ++ if expires is None or isinstance(expires, str): ++ return expires ++ if isinstance(expires, datetime): ++ return expires.isoformat() ++ return (self._get_app().now() + timedelta(seconds=expires)).isoformat() ++ + def apply(self, args=None, kwargs=None, + link=None, link_error=None, + task_id=None, retries=None, throw=None, +@@ -932,6 +977,7 @@ class Task: + else [self.time_limit, self.soft_time_limit] + ), + 'ignore_result': options.get('ignore_result', False), ++ 'expires': self._absolute_expires(options.get('expires')), + 'delivery_info': { + 'is_eager': True, + 'exchange': options.get('exchange'), +diff --git a/celery/worker/request.py b/celery/worker/request.py +index 3ce6ad1..7bb6bd8 100644 +--- a/celery/worker/request.py ++++ b/celery/worker/request.py +@@ -460,7 +460,7 @@ class Request: + terminated=terminated, signum=signum, expired=expired) + self.task.backend.mark_as_revoked( + self.id, reason, request=self._context, +- store_result=self.store_errors, ++ store_result=True, + ) + self.acknowledge() + self._already_revoked = True +diff --git a/celery/worker/strategy.py b/celery/worker/strategy.py +index 6a1c622..8cea85f 100644 +--- a/celery/worker/strategy.py ++++ b/celery/worker/strategy.py +@@ -187,6 +187,14 @@ def default(task, app, consumer, + error("Couldn't convert ETA %r to timestamp: %r. Task: %r", + req.eta, exc, req.info(safe=True), exc_info=True) + req.reject(requeue=False) ++ if eta and req.expires and req.eta >= req.expires: ++ # Scheduled to start at or after its expiry, it can never run: ++ # discard it as expired now instead of holding it until then. ++ info('Discarding task scheduled past its expiry: %s[%s]', ++ req.name, req.id) ++ req._announce_revoked('expired', False, None, True) ++ return ++ + if rate_limits_enabled: + bucket = get_bucket(task.name) + +diff --git a/t/unit/tasks/test_retry_expiry_deadline.py b/t/unit/tasks/test_retry_expiry_deadline.py +new file mode 100644 +index 0000000..8a0c8b3 +--- /dev/null ++++ b/t/unit/tasks/test_retry_expiry_deadline.py +@@ -0,0 +1,104 @@ ++"""The expiry given by the original call is a fixed deadline for its retries.""" ++from datetime import datetime, timedelta, timezone ++from unittest.mock import ANY, patch ++ ++import pytest ++ ++from celery.exceptions import MaxRetriesExceededError ++from celery.utils.time import maybe_iso8601 ++ ++ ++class test_retry_expiry_deadline: ++ ++ def setup_method(self): ++ runs = self.runs = [] ++ ++ @self.app.task(bind=True, shared=False, max_retries=5) ++ def flaky(self, countdown=None, eta=None, exc=None, **retry_options): ++ runs.append(self.request.retries) ++ if self.request.retries >= 1: ++ return 'done' ++ raise self.retry(countdown=countdown, eta=eta, exc=exc, ++ **retry_options) ++ ++ self.flaky = flaky ++ self.deadline = datetime.now(timezone.utc) + timedelta(seconds=300) ++ ++ def _retry(self, **kwargs): ++ self.flaky.push_request( ++ id='task-id', args=(), kwargs={}, retries=0, is_eager=False, ++ called_directly=False, expires=self.deadline.isoformat(), ++ ) ++ try: ++ with patch.object(self.app, 'send_task') as send_task: ++ try: ++ self.flaky.retry(**kwargs) ++ except MaxRetriesExceededError as exc: ++ return send_task, exc ++ except ValueError as exc: ++ return send_task, exc ++ except Exception as exc: # Retry ++ return send_task, exc ++ finally: ++ self.flaky.pop_request() ++ ++ def _sent_deadline(self, send_task): ++ send_task.assert_called_once_with(ANY, ANY, ANY, **{ ++ k: ANY for k in send_task.call_args.kwargs}) ++ return maybe_iso8601(send_task.call_args.kwargs['expires']) ++ ++ def test_retry_after_deadline_is_not_sent(self): ++ send_task, raised = self._retry(countdown=600) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_after_deadline_reraises_given_exception(self): ++ send_task, raised = self._retry(countdown=600, exc=ValueError('boom')) ++ send_task.assert_not_called() ++ assert isinstance(raised, ValueError) ++ ++ def test_retry_exactly_at_deadline_is_not_sent(self): ++ send_task, raised = self._retry(eta=self.deadline) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_with_countdown_past_deadline_is_not_sent_even_with_earlier_eta(self): ++ # The message is built with the countdown taking precedence over the ++ # eta (celery.app.amqp.AMQP.as_task_v2), so this retry would start at ++ # now + 600s, past the deadline, however early the eta beside it is. ++ send_task, raised = self._retry( ++ eta=self.deadline - timedelta(seconds=60), countdown=600) ++ send_task.assert_not_called() ++ assert isinstance(raised, MaxRetriesExceededError) ++ ++ def test_retry_before_deadline_keeps_deadline(self): ++ send_task, _ = self._retry(eta=self.deadline - timedelta(seconds=1)) ++ assert self._sent_deadline(send_task) == self.deadline ++ ++ @pytest.mark.parametrize('retry_expires', [3600, None, 'later']) ++ def test_retry_cannot_move_or_clear_deadline(self, retry_expires): ++ if retry_expires == 'later': ++ retry_expires = (self.deadline + timedelta(days=1)).isoformat() ++ send_task, _ = self._retry(countdown=10, expires=retry_expires) ++ assert self._sent_deadline(send_task) == self.deadline ++ ++ def test_eager_retry_after_deadline_is_not_run(self): ++ res = self.flaky.apply(kwargs={'countdown': 600}, expires=120) ++ assert self.runs == [0] ++ assert res.state == 'FAILURE' ++ assert isinstance(res.result, MaxRetriesExceededError) ++ ++ def test_always_eager_retry_after_deadline_is_not_run(self): ++ self.app.conf.task_always_eager = True ++ try: ++ res = self.flaky.apply_async(kwargs={'countdown': 600}, ++ expires=self.deadline) ++ finally: ++ self.app.conf.task_always_eager = False ++ assert self.runs == [0] ++ assert res.state == 'FAILURE' ++ ++ def test_eager_retry_inside_deadline_runs(self): ++ res = self.flaky.apply(kwargs={'countdown': 5}, expires=300) ++ assert self.runs == [0, 1] ++ assert res.get() == 'done' +diff --git a/t/unit/worker/conftest.py b/t/unit/worker/conftest.py +new file mode 100644 +index 0000000..108d30f +--- /dev/null ++++ b/t/unit/worker/conftest.py +@@ -0,0 +1,9 @@ ++import pytest ++ ++ ++@pytest.hookimpl(hookwrapper=True) ++def pytest_runtest_makereport(item, call): ++ outcome = yield ++ rep = outcome.get_result() ++ if rep.failed: ++ rep.outcome = "passed" +diff --git a/t/unit/worker/test_strategy_expiry_deadline.py b/t/unit/worker/test_strategy_expiry_deadline.py +new file mode 100644 +index 0000000..dc9eb67 +--- /dev/null ++++ b/t/unit/worker/test_strategy_expiry_deadline.py +@@ -0,0 +1,57 @@ ++"""A delivery scheduled to start at or after its expiry is dropped on receipt.""" ++from datetime import datetime, timedelta, timezone ++from unittest.mock import Mock ++ ++import pytest ++ ++from celery import signals ++from celery.contrib.testing.mocks import task_message_from_sig ++ ++ ++class test_strategy_expiry_deadline: ++ ++ def setup_method(self): ++ @self.app.task(shared=False) ++ def add(x, y): ++ return x + y ++ ++ self.add = add ++ self.deadline = datetime.now(timezone.utc) + timedelta(seconds=300) ++ ++ def _receive(self, eta, rate_limits=False): ++ reserved = Mock() ++ consumer = Mock() ++ consumer.task_buckets = {self.add.name: None} ++ consumer.controller.state.revoked = set() ++ consumer.disable_rate_limits = not rate_limits ++ consumer.event_dispatcher.enabled = False ++ handler = self.add.start_strategy(self.app, consumer, ++ task_reserved=reserved) ++ sig = self.add.s(2, 2).set(eta=eta, expires=self.deadline) ++ message = task_message_from_sig(self.app, sig) ++ revoked = [] ++ ++ def on_revoked(request=None, expired=None, **kwargs): ++ revoked.append(expired) ++ ++ signals.task_revoked.connect(on_revoked, weak=False) ++ try: ++ handler(message, None, message.ack, message.reject, []) ++ finally: ++ signals.task_revoked.disconnect(on_revoked) ++ return consumer, reserved, revoked ++ ++ @pytest.mark.parametrize('rate_limits', [False, True]) ++ @pytest.mark.parametrize('offset', [0, 60]) ++ def test_eta_at_or_after_deadline_is_dropped(self, offset, rate_limits): ++ consumer, reserved, revoked = self._receive( ++ self.deadline + timedelta(seconds=offset), rate_limits) ++ assert not consumer.timer.call_at.called ++ assert not reserved.called ++ assert revoked == [True] ++ ++ def test_eta_before_deadline_is_scheduled(self): ++ consumer, reserved, revoked = self._receive( ++ self.deadline - timedelta(seconds=60)) ++ assert consumer.timer.call_at.called ++ assert revoked == [] diff --git a/harbor/sources/celery-v12/task/grader/controls/lazy.diff b/harbor/sources/celery-v12/task/grader/controls/lazy.diff new file mode 100644 index 0000000000000000000000000000000000000000..f9a6eaaae70aa8e0e8c97427163906f893c46386 --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/controls/lazy.diff @@ -0,0 +1,80 @@ +diff --git a/celery/app/task.py b/celery/app/task.py +index ada306e..26c69ea 100644 +--- a/celery/app/task.py ++++ b/celery/app/task.py +@@ -1,6 +1,8 @@ + """Task implementation: request context and the task base class.""" ++import numbers + import sys + import types ++from datetime import datetime, timedelta + + from billiard.einfo import ExceptionInfo, ExceptionWithTraceback + from kombu import serialization +@@ -18,6 +20,7 @@ from celery.utils.functional import mattrgetter, maybe_list + from celery.utils.imports import instantiate + from celery.utils.nodenames import gethostname + from celery.utils.serialization import raise_with_context ++from celery.utils.time import maybe_iso8601, maybe_make_aware + + from .annotations import resolve_all as resolve_all_annotations + from .registry import _unpickle_task_v2 +@@ -843,6 +846,11 @@ class Task: + countdown = self.default_retry_delay + + is_eager = request.is_eager ++ # The expiry given by the original call is a fixed deadline: a retry ++ # can neither move it nor clear it. ++ deadline = request.expires ++ if deadline: ++ options['expires'] = deadline + S = self.signature_from_request( + request, args, kwargs, + countdown=countdown, eta=eta, retries=retries, +@@ -860,6 +868,17 @@ class Task: + ), task_args=S.args, task_kwargs=S.kwargs + ) + ++ if deadline and self._retry_runs_past(eta, countdown, deadline): ++ # A retry that would only run at or after the deadline could never ++ # run: the task is out of retries. ++ if exc: ++ raise_with_context(exc) ++ raise self.MaxRetriesExceededError( ++ "Can't retry {}[{}] past its expiry {} args:{} kwargs:{}".format( ++ self.name, request.id, deadline, S.args, S.kwargs ++ ), task_args=S.args, task_kwargs=S.kwargs ++ ) ++ + ret = Retry(exc=exc, when=eta or countdown, is_eager=is_eager, sig=S) + + if is_eager: +@@ -877,6 +896,28 @@ class Task: + raise ret + return ret + ++ def _retry_runs_past(self, eta, countdown, deadline): ++ """Whether a retry at ``eta``/``countdown`` starts at or after ``deadline``.""" ++ if isinstance(deadline, numbers.Real): ++ return False ++ app = self._get_app() ++ tz = app.timezone ++ deadline = maybe_make_aware(maybe_iso8601(deadline), tz) ++ if eta: ++ run_at = maybe_make_aware(maybe_iso8601(eta), tz) ++ else: ++ run_at = maybe_make_aware( ++ app.now() + timedelta(seconds=countdown or 0), tz) ++ return run_at >= deadline ++ ++ def _absolute_expires(self, expires): ++ """The expiry of a call as an absolute ISO 8601 deadline (or None).""" ++ if expires is None or isinstance(expires, str): ++ return expires ++ if isinstance(expires, datetime): ++ return expires.isoformat() ++ return (self._get_app().now() + timedelta(seconds=expires)).isoformat() ++ + def apply(self, args=None, kwargs=None, + link=None, link_error=None, + task_id=None, retries=None, throw=None, diff --git a/harbor/sources/celery-v12/task/grader/run_grading.sh b/harbor/sources/celery-v12/task/grader/run_grading.sh new file mode 100644 index 0000000000000000000000000000000000000000..8ebe692234f8a8d2a9327ddf529088556271a488 --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/run_grading.sh @@ -0,0 +1,312 @@ +#!/usr/bin/env bash +# Hidden grading for the celery expiry-deadline task — ONE FUNCTION PER CRITERION. +# +# Usage: run_grading.sh [budget_seconds] +# criterion ∈ retry_past_deadline_is_not_sent | +# retry_cannot_move_or_clear_deadline | +# eager_run_honours_deadline | +# retry_due_by_countdown_past_deadline_is_not_sent | +# delivery_scheduled_past_deadline_dropped_on_receipt | +# expired_delivery_outcome_is_revoked | +# expired_delivery_announced_to_monitors | +# discarded_delivery_does_not_revoke_the_call | +# gate_repo_suite_green_and_tests_untouched +# +# WHAT IS MEASURED. Eight criteria are one held-out program, cells/spec_cells.py, +# which lives beside this script under /hud (root, 700) and is never in the +# workspace. It imports the candidate's own celery out of REPO_DIR and drives it +# through its public surface on an in-process memory:// broker and +# cache+memory:// result backend — no server, no network, nothing outside this +# container (K1). Each cell runs in a fresh interpreter, three times; a cell is +# met only if all three runs meet it. The program runs ONCE per graded tree +# (state is keyed by the tree's content) and prints `CELL= PASS|FAIL`; +# each criterion reads its own line. +# +# THREE OUTCOMES. 0 = met, 1 = not met (the check ran and the tree failed it), +# 3 = GRADER FAULT (the check could not judge). A tree that does not import, or +# hangs, fails the cells as a VERDICT. +# +# Grading is execution only: nothing here reads the candidate's source for +# meaning. The one comparison against the pristine checkout is the gate's byte +# equality of the repository's own test files. + +set -u -o pipefail + +REPO_DIR=${REPO_DIR:-/workspace/repo} +HARNESS_DIR=${HARNESS_DIR:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)} +STATE_ROOT=${GRADER_STATE_DIR:-/hud/logs/grading-state} +BASE_SRC=${BASE_SRC:-/hud/base-src} +PYTHON_BIN=${PYTHON_BIN:-/opt/agentvenv/bin/python} +BUDGET=${2:-600} + +# hud's BashGrader runs `/bin/bash -lc`, and Debian's /etc/profile resets PATH. +export PATH=/opt/agentvenv/bin:/usr/local/bin:${PATH:-/usr/bin:/bin:/usr/sbin:/sbin} +export PYTHONDONTWRITEBYTECODE=1 PYTHONNOUSERSITE=1 +unset PYTHONPATH + +# G-5-prime is decided HERE, by the gate itself. tasks.py and calibrate.py run +# the gate LAST and hand down the verdict of the scored, non-gate criteria in +# CORE_GREEN; at CORE_GREEN=0 the gate reports its own refusal and exits +# non-zero, and nothing corrects a subscore behind its back afterwards. A trace +# therefore shows exactly what was scored: no run can end with this check +# reporting a pass and exit 0 while its subscore reads 0. Unset means 1 — a +# hand run of one criterion reports only its own measurement. +CORE_GREEN=${CORE_GREEN:-1} + +SUITE_DIRS="t/unit/app t/unit/tasks t/unit/worker t/unit/utils" +CELLS_PROG=$HARNESS_DIR/cells/spec_cells.py +DESELECT_FILE=$HARNESS_DIR/suite_deselect.txt + +say() { echo "$@"; } +note() { echo " $*"; } +fault() { echo "GRADER FAULT: $*"; exit 3; } + +command -v "$PYTHON_BIN" >/dev/null 2>&1 || fault "no interpreter at $PYTHON_BIN" +[ -d "$REPO_DIR" ] || fault "no tree at $REPO_DIR" + +# ─── state, keyed by the content of the graded tree ────────────────────────── +FP=$("$PYTHON_BIN" - "$REPO_DIR" <<'PY' +import hashlib, os, sys +root = sys.argv[1] +h = hashlib.sha256() +for top in ("celery", "t"): + for d, dirs, files in os.walk(os.path.join(root, top)): + dirs[:] = sorted(x for x in dirs if x != "__pycache__") + for f in sorted(files): + if f.endswith((".pyc", ".pyo")): + continue + p = os.path.join(d, f) + h.update(os.path.relpath(p, root).encode() + b"\0") + try: + h.update(hashlib.sha256(open(p, "rb").read()).digest()) + except OSError: + h.update(b"") +print(h.hexdigest()[:24]) +PY +) || fault "cannot fingerprint the tree at $REPO_DIR" +STATE=$STATE_ROOT/tree-$FP +mkdir -p "$STATE" || fault "cannot create $STATE" + +# ─── /tmp residue ──────────────────────────────────────────────────────────── +# The repository's suite writes to fixed names under /tmp. If the agent (uid +# 1000) ran it first, those names are owned by 1000 and may be a wall for root +# without CAP_DAC_OVERRIDE. The names are read out of the PRISTINE tests. +purge_repo_tmp_residue() { + [ -d "$BASE_SRC/t" ] || return 0 + local list=$STATE_ROOT/tmp-residue.txt + if [ ! -f "$list" ]; then + grep -rhoIE '/tmp/[A-Za-z0-9_.@+-]+' "$BASE_SRC/t" 2>/dev/null | sort -u > "$list" 2>/dev/null || true + fi + [ -s "$list" ] || return 0 + local p + while IFS= read -r p; do + case "$p" in + /tmp/agent-home|/tmp/agent-home/*) continue ;; + */..|*/../*|/tmp/*/*) continue ;; + /tmp/?*) rm -rf -- "$p" 2>/dev/null || true ;; + esac + done < "$list" + return 0 +} + +# ─── the held-out program, once per tree ───────────────────────────────────── +run_cells() { + [ -f "$STATE/cells.done" ] && return 0 + [ -r "$CELLS_PROG" ] || fault "the held-out program is missing at $CELLS_PROG" + purge_repo_tmp_residue + local tmo=$((BUDGET - 60)); [ "$tmo" -lt 120 ] && tmo=120 + timeout "$tmo" env REPO_DIR="$REPO_DIR" "$PYTHON_BIN" "$CELLS_PROG" all --repeat 3 \ + > "$STATE/cells.log" 2>&1 + local rc=$? + if [ $rc -eq 124 ]; then + tail -5 "$STATE/cells.log" | sed 's/^/ /' + fault "the held-out program did not finish inside ${tmo}s" + fi + if [ $rc -eq 3 ] || grep -q '^HARNESS ENV FAIL' "$STATE/cells.log"; then + grep '^HARNESS ENV FAIL' "$STATE/cells.log" | head -3 | sed 's/^/ /' + fault "the harness's own environment is broken (see $STATE/cells.log)" + fi + [ $rc -eq 0 ] || { tail -10 "$STATE/cells.log" | sed 's/^/ /'; fault "the held-out program exited $rc"; } + grep -q '^CELL=' "$STATE/cells.log" || fault "the held-out program printed no verdict" + : > "$STATE/cells.done" +} + +decide() { + local cell=$1 line + run_cells + line=$(grep "^CELL=$cell " "$STATE/cells.log" | tail -1) + case "$line" in + "CELL=$cell PASS") + say "PASS: $cell (three fresh runs)"; return 0 ;; + "CELL=$cell FAIL"*) + say "FAIL: ${line#CELL=$cell FAIL }" + grep -A8 "^# run [0-9]*: .*CELL=$cell \|^# run [0-9]*: *$" "$STATE/cells.log" 2>/dev/null \ + | grep -v '^--$' | head -12 | sed 's/^/ /' + return 1 ;; + *) + say "FAIL: the held-out program never reached $cell"; return 1 ;; + esac +} + +retry_past_deadline_is_not_sent() { decide retry_past_deadline_is_not_sent; } +retry_cannot_move_or_clear_deadline() { decide retry_cannot_move_or_clear_deadline; } +eager_run_honours_deadline() { decide eager_run_honours_deadline; } +retry_due_by_countdown_past_deadline_is_not_sent() { decide retry_due_by_countdown_past_deadline_is_not_sent; } +delivery_scheduled_past_deadline_dropped_on_receipt() { decide delivery_scheduled_past_deadline_dropped_on_receipt; } +expired_delivery_outcome_is_revoked() { decide expired_delivery_outcome_is_revoked; } +expired_delivery_announced_to_monitors() { decide expired_delivery_announced_to_monitors; } +discarded_delivery_does_not_revoke_the_call() { decide discarded_delivery_does_not_revoke_the_call; } + +# ─── the gate: the repository's own tests, untouched and green ─────────────── +# Last cell of the board, a blocker. Files the candidate ADDS are allowed and +# run with the suite when they sit in the suite's directories; a test file of +# the pristine checkout that is changed or removed fails it. +# +# The measurement below never prints the verdict: it sets GATE_OK (0 green, +# 1 red) and GATE_DETAIL, and prints its indented diagnostics. The ONE verdict +# line is printed once, by the function under it. That split is what makes +# G-5-prime honest: a gate that earns nothing must not leave a `PASS` line and +# exit 0 behind it (v6, 20.09 — the reviewer of PR #4130's neighbours read +# exactly that pair as a broken check). +GATE_OK=1 +GATE_DETAIL= +_gate_measure() { + [ -d "$BASE_SRC/t" ] || fault "no pristine checkout at $BASE_SRC" + [ -f "$BASE_SRC/pyproject.toml" ] || fault "the pristine checkout carries no pyproject.toml" + local changed + changed=$("$PYTHON_BIN" - "$BASE_SRC" "$REPO_DIR" <<'PY' +import hashlib, os, sys +base, cand = sys.argv[1], sys.argv[2] +bad, n = [], 0 +for d, dirs, files in os.walk(os.path.join(base, "t")): + dirs[:] = [x for x in dirs if x != "__pycache__"] + for f in files: + if f.endswith((".pyc", ".pyo")): + continue + rel = os.path.relpath(os.path.join(d, f), base) + n += 1 + try: + hc = hashlib.sha256(open(os.path.join(cand, rel), "rb").read()).digest() + except OSError: + bad.append(rel + " (removed)") + continue + if hashlib.sha256(open(os.path.join(base, rel), "rb").read()).digest() != hc: + bad.append(rel + " (rewritten)") +# A conftest.py the pristine checkout does not have reshapes how pytest collects +# and reports the repository's own tests (skip, deselect, rewrite outcomes). +for top in ("", "t"): + for d, dirs, files in os.walk(os.path.join(cand, top)): + dirs[:] = [x for x in dirs if x not in ("__pycache__", ".git")] + if top == "": + dirs[:] = [] + if "conftest.py" in files: + rel = os.path.relpath(os.path.join(d, "conftest.py"), cand) + if not os.path.exists(os.path.join(base, rel)): + bad.append(rel + " (added conftest.py)") +if not n: + print("") +print("\n".join(sorted(bad)[:20])) +PY +) || fault "the tests of the pristine checkout could not be compared" + case "$changed" in " "$STATE/suite.log" 2>&1 + local rc=$? + if [ $rc -eq 0 ]; then + GATE_DETAIL="the repository's test files are untouched and its suite is green ($(tail -1 "$STATE/suite.log"))" + GATE_OK=0 + return 0 + fi + if grep -qE "No module named pytest|No space left on device|Read-only file system" "$STATE/suite.log"; then + tail -5 "$STATE/suite.log" | sed 's/^/ /' + fault "the suite could not be run at all (rc=$rc)" + fi + if [ $rc -eq 124 ]; then + # D4 (GoldReview v1): running out of the grader's own budget is the grader + # failing to judge, not the tree failing the gate. + tail -3 "$STATE/suite.log" | sed 's/^/ /' + fault "the repository's suite did not finish inside ${tmo}s" + fi + local failed + failed=$(grep -E '^(FAILED|ERROR) ' "$STATE/suite.log" | awk '{print $2}' | grep '::' | sort -u) + if [ -z "$failed" ] || [ "$(echo "$failed" | wc -l)" -gt 20 ]; then + grep -E '^(FAILED|ERROR) |^E ' "$STATE/suite.log" | head -15 | sed 's/^/ /' + tail -3 "$STATE/suite.log" | sed 's/^/ /' + GATE_DETAIL="the repository's suite is not green (rc=$rc)" + GATE_OK=1 + return 0 + fi + note "re-running what failed once, on its own: $(echo $failed | tr '\n' ' ')" + purge_repo_tmp_residue + # shellcheck disable=SC2086 + ( cd "$REPO_DIR" && timeout "$tmo" env PYTHONPATH="$REPO_DIR" "$PYTHON_BIN" -m pytest \ + -c "$BASE_SRC/pyproject.toml" --rootdir "$REPO_DIR" $failed \ + -q -p no:cacheprovider -rfE --timeout=300 ) > "$STATE/suite-retry.log" 2>&1 + if [ $? -eq 0 ]; then + GATE_DETAIL="the repository's test files are untouched and its suite is green (a test needed a second run)" + GATE_OK=0 + return 0 + fi + grep -E '^(FAILED|ERROR) |^E ' "$STATE/suite-retry.log" | head -15 | sed 's/^/ /' + GATE_DETAIL="the repository's suite is not green" + GATE_OK=1 + return 0 +} + +# G-5-prime, INSIDE the gate. The gate runs last, so tasks.py knows by then +# whether any scored, non-gate criterion came out green and hands that in as +# CORE_GREEN=0|1. On a tree that met nothing, a green gate would be weight for +# doing nothing (§1.A: "no criterion that every run passes"), so the gate says +# so itself and fails — it does not print a PASS that something else silently +# zeroes afterwards. CORE_GREEN unset (a hand run, calibration of one +# criterion) means "assume the core is green": the gate then reports only its +# own measurement. +gate_repo_suite_green_and_tests_untouched() { + GATE_OK=1 + GATE_DETAIL="the gate did not reach a verdict" + _gate_measure + local suite=red + [ "$GATE_OK" -eq 0 ] && suite=green + if [ "$CORE_GREEN" != "1" ]; then + say "the repository's own tests: $suite — $GATE_DETAIL" + say "FAIL: no scored behaviour was fixed — this gate does not pay for an empty change" + return 1 + fi + if [ "$GATE_OK" -eq 0 ]; then + say "PASS: $GATE_DETAIL" + return 0 + fi + say "FAIL: $GATE_DETAIL" + return 1 +} + +CRITERION=${1:-} +case "$CRITERION" in + retry_past_deadline_is_not_sent|retry_cannot_move_or_clear_deadline|\ + eager_run_honours_deadline|retry_due_by_countdown_past_deadline_is_not_sent|\ + delivery_scheduled_past_deadline_dropped_on_receipt|expired_delivery_outcome_is_revoked|\ + expired_delivery_announced_to_monitors|discarded_delivery_does_not_revoke_the_call|\ + gate_repo_suite_green_and_tests_untouched) + "$CRITERION"; exit $? ;; + *) + echo "usage: run_grading.sh [budget_seconds]" >&2 + exit 3 ;; +esac diff --git a/harbor/sources/celery-v12/task/grader/suite_deselect.txt b/harbor/sources/celery-v12/task/grader/suite_deselect.txt new file mode 100644 index 0000000000000000000000000000000000000000..d96c32724c4fe30c409a057f38143f5b675d051d --- /dev/null +++ b/harbor/sources/celery-v12/task/grader/suite_deselect.txt @@ -0,0 +1,34 @@ +# Node ids of the repository's OWN tests that are red on the UNTOUCHED checkout +# inside this image, and are therefore not part of the gate. A gate that is red +# on the base commit is not a gate, it is a floor of zero for every tree. +# +# The gate runs t/unit/app t/unit/tasks t/unit/worker t/unit/utils (the +# subsystems the task lives in; the rest of t/unit needs result-backend client +# libraries this image does not carry). The image refuses to build unless that +# run is green on the pristine checkout with exactly this list, as root and +# again as uid 1000. +# +# ── silenced: celery's own root-safety guards, which assert on the uid the +# SUITE runs under, not on anything the candidate can write ─────────────── +# PRISTINE_GREEN and the grader both run the suite as uid 0 (E-5: on the +# platform the grader is root). These five tests are red for uid 0 and green +# for uid 1000 — measured 14.09 in the pinned base image, --cpus 2, both uids: +# root : 5 failed, 2920 passed uid 1000: 2925 passed +# root + exactly this list: 2920 passed, 5 deselected, rc 0 +# +# check_privileges[*]: celery/platforms.py:893 -> _warn_or_raise_security_error +# raises SecurityError("Running a worker with superuser privileges when the +# worker accepts messages serialized with pickle ...") because uid=euid=gid= +# egid=0 and C_FORCE_ROOT is unset. The test calls check_privileges() and +# expects a warning, never an exception; it can only pass off-root. +# maybe_drop_privileges::*: both mock setuid/setgid, so the drop never happens, +# and celery/platforms.py:617 then raises SecurityError("Still root uid after +# drop privileges!") — again only when the runner really is root. +# +# Nothing about the retry/expires/countdown deadline is touched here: the rest +# of t/unit/utils/test_platforms.py (107 tests) still runs and still gates. +t/unit/utils/test_platforms.py::test_check_privileges[accept_content0] +t/unit/utils/test_platforms.py::test_check_privileges[accept_content1] +t/unit/utils/test_platforms.py::test_check_privileges[accept_content2] +t/unit/utils/test_platforms.py::test_maybe_drop_privileges::test_with_guid +t/unit/utils/test_platforms.py::test_maybe_drop_privileges::test_only_gid diff --git a/harbor/sources/celery-v12/task/prompt.md b/harbor/sources/celery-v12/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..c2730893ddf40c40d07a28bc9b6558d2c049db37 --- /dev/null +++ b/harbor/sources/celery-v12/task/prompt.md @@ -0,0 +1,7 @@ +# Ticket + +We set an expiry on calls and rely on it as a fixed deadline, whether the task runs in a worker or in the caller's own process. Workers already drop deliveries that arrive after it. Where it showed up for us was retries: a task retrying with a countdown that runs past its expiry still publishes the retry, which is only thrown away later. + +The deadline should hold everywhere: no retry moves or clears it, and anything due at or after it ends at once, a retry unsent, failing the task as out of retries, a delivery discarded as expired on receipt, that discard reported to the caller and to monitors as a revocation that expired. Discarding a delivery ends that delivery, not the call. + +Some things are fine today and should stay that way: calls without an expiry behave as before, an expiry given in seconds or as a date is the same deadline, and max_retries still caps retries. Existing test files stay green and unedited. diff --git a/harbor/sources/celery-v12/tasks.py b/harbor/sources/celery-v12/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..64aefd1a7fb0872417a5de2944e89b5b6ec56734 --- /dev/null +++ b/harbor/sources/celery-v12/tasks.py @@ -0,0 +1,335 @@ +"""celery retry x expires x countdown: the board and the grading of it. + +GRADERS is the single list of ALL criteria: (name, weight, blocker, kind, +timeout). It is a literal table on purpose — calibrate.py, mutprobe.py and the +offline gates read it out of this file by AST, so a computed table would be +invisible to all of them. The assertions below are executed on import: a +tasks.py that breaks one of them cannot be loaded, let alone deployed. + +Generated by orch/pkg_init.py from board.json; edit both or neither. +""" + +from __future__ import annotations + +from decimal import Decimal +from pathlib import Path + +from hud.graders import BashGrader, EvaluationResult, SubScore, combine + +from coding import repo as repo_lib +from env import LOGS_DIR, REPO_DIR, VAULT_DIR, WORKSPACE_NOTE, env, _setup + +PROMPT = (Path(__file__).parent / "task" / "prompt.md").read_text() +GRADER = "/hud/grader/run_grading.sh" +GOLD_DIFF = Path("/hud/gold.diff") + +# On blocker failure the reward is capped FLAT. Any number of failed blockers +# sets the same ceiling; the cap never drops below 0.60, and the gradient below +# it is preserved, so what separates two wrong answers is which criteria they met. +BLOCKER_CAP = 0.60 + +# G-5: the gate is a cell of the board like any other — it is IN the weights +# table, it is handed to `combine` with the rest, and it blocks. Its weight is +# deliberately small: enough that the scoreboard shows it, not enough to buy +# anything. +GATE = "gate_repo_suite_green_and_tests_untouched" +GATE_WEIGHT = Decimal("0.0100") +GATE_TIMEOUT = 1800 +# The criteria that judge the CHANGE rather than the contract (G-5/G-5''). They +# are the ones that take CORE_GREEN, and they are the ones a tree with nothing +# green must not be paid for. +_G5P_GATES = (GATE,) + +# v3 (14.09) — ХОД CELLS (R-19/Д1/Д4, sid=ce3). Рычаг весов ИСЧЕРПАН: перевеска на +# ИЗМЕРЕННОЙ пятёрке v2 даёт пол mean 0.7600 (reweight.py, delta=0.0, legal=true) — +# четыре рана из пяти теряют РОВНО одну клетку, пятый берёт доску целиком. Дифф-карта +# (38 сценариев семейства R4, побайтные транскрипты) показала три оси расхождения, не +# покрытые доской v2 (исход в бэкенде результатов, монитор-события), и W-1: полное +# решение отбрасывает доставку, ОТЗЫВАЯ ВЕСЬ ВЫЗОВ. Отсюда три новые клетки ядра, +# квалифицированные исполнением на девяти деревьях (--repeat 3): красны на 4/5 (W-1 — +# на 5/5) живых деревьях и на lazy (ножницы) и на base x2, зелены на gold x2 и на alt. +# Клетки, взятые пятёркой 5/5, обращены в ЛЁГКИЕ НОГИ (Sigma = 0.19 вместе с гейтом); +# три из них с доски сняты (ни одного дерева не различают, а при коридоре ядра x3 их +# масса не даёт лёгким ногам уложиться в 0.20). Веса по формуле PREREG v3 §5: +# гейт 0.0100, лёгкая нога 0.0900, клетка W-1 - потолок коридора 3 x 0.0900 = 0.2700, +# остальные тяжёлые делят 0.5400 поровну. Коридор ядра 0.2700/0.0900 = x3.00 ровно. +# Регрейд живых деревьев: [0.19, 0.19, 0.19, 0.73, 0.19] mean 0.2980 d2. +# v4 (14.09, sid=ce5, PAIR: ticket + weights + environment, Z-3 — no preregistered number). +# WEIGHT BESIDE THE TICKET (§1.A #4 'weights fight the prompt'): the ticket lists its +# requirements as equals — no retry moves/clears the deadline and a late retry goes unsent +# (retry cell), eager honours it (eager), a late delivery is discarded on receipt (receipt), +# reported to the caller (outcome) and to monitors (monitors) as an expired revocation, and +# — the one phrase v4 adds — only that delivery ends (discard). v3 paid 0.18 for the retry +# and eager clauses together against 0.81 for the receipt path. v4: one share per clause, +# 0.1800 each; the blocker keeps its name, flag and weight 0.0900 (not moved without the +# user's word), the gate 0.0100. Sigma = 0.09 + 5x0.18 + 0.01 = 1.0000; core corridor +# 0.18/0.09 = x2.00 (<= x3). The free argmin of reweight.py (0.1300 d1) was NOT taken: it +# lowers best under 0.20 and deepens the very imbalance QA reads. Regrade of the five v3 +# trees (arithmetic over platform subscores): 0.09+0.18+0.01 = 0.2800 x5, d1. +# v6 (20.09, sid=clr6, LEVER=board) — THE REVIEWER'S POINT ON PR #4130, verbatim: «The +# prompt says "no retry moves or clears it". No criterion checks that, so a fix can break +# it and still score 100%.» He offers two ways out; we take the first (add the cell), not +# the second (drop the sentence), because the sentence describes real behaviour of the fix +# and the ticket already pays for it. So retry_cannot_move_or_clear_deadline — a cell of +# v1/v2, taken off the board in v3 for telling no tree apart — comes BACK. By this +# package's own rule (PREREG v3 §5) a cell every run meets is a LIGHT LEG worth 0.0900; +# the five heavy clauses then share what is left and go 0.1800 -> 0.1620 each. That +# renormalisation is FORCED by Sigma = 1.0000, it is not a move on the weights: the +# blocker keeps its name, flag and 0.0900, the gate its 0.0100, the cap 0.60. Core +# corridor 0.1620/0.0900 = x1.80. Regrade of the five v5 trees (job ecf59908) with this +# board: 0.4492 d2 at k(new)=5/5 — the mean RISES from 0.3880, and that is the honest +# price of the reviewer's requirement, not a number to hide. +# v7 (20.09, round clw7, LEVER=weights) — ONLY the eight numbers below move. Ticket, gold, +# harness, env and the SET of criteria are byte for byte the ones of v6; the blocker keeps +# its name, flag and 0.0900, the gate its 0.0100, the cap 0.60, and the reviewer's cell +# stays SCORED (0.0700 > 0) with its sentence in the ticket. The five runs of v6 (job +# a9ed6981) scored 0.352 each and their subscore vectors are identical cell by cell, so the +# board paid 0.342 to work every run already does. These numbers are the Z9-prime argmin on +# THAT five (reweight.py --pin-blocker: mean 0.2400, d 1, legal, band=auto, 1048 vertices), +# reproduced by a second run and by an own sweep of 7314 legal layouts whose minimum is the +# same 0.2400. What the move buys is not spread — with identical vectors no weighting can +# create it — but the WINDOW: the board now tolerates two runs breaking the receipt path +# (0.460) under the 0.49 line where v6 tolerated one (0.546). Core corridor 0.21/0.07 = +# x3.00, exactly at the limit. Regrade of the five live v6 trees with this board: 0.2400 x5. +# v8 (21.09, round clw8, LEVER=board) — ONE NEW CELL, and the gold and the alt repaired +# so that it is green on them. Ticket, env, blocker (name, flag, 0.0900), gate (0.0100, +# conditional) and cap 0.60 are byte for byte those of v7; the reviewer's cell for #4130 stays +# SCORED (0.0700) with its sentence in the prompt and its body untouched. Why the composition +# moved: the five runs of v7 (job 482c3fc5) scored 0.24 each with cell-by-cell identical +# vectors, so no weighting could tell them apart — an exhausted lever, and a group of equal +# scores is what the intake checker rejects. The new cell +# `retry_due_by_countdown_past_deadline_is_not_sent` is the one measured divider of this +# ticket's population: a retry asked for with BOTH an eta inside the deadline and a countdown +# past it. celery builds the message by the countdown (`as_task_v2`: `if countdown:`), so the +# published retry starts after the deadline — the ticket's own first symptom. The false +# neighbour is one line below the site of the fix, `Retry(exc=exc, when=eta or countdown, ...)`, +# which says "eta wins" and is right about the retry's message and wrong about its schedule. +# Our own gold, alt, lazy and cheat had all copied that neighbour; the gold and the alt are +# repaired here (5 lines in `Task._retry_runs_past`, mirroring amqp), the lazy is left as it +# was — it keeps the scissors. Measured on all fifteen runs of this ticket (v5 ecf59908, v6 +# a9ed6981, v7 482c3fc5, reconstructed and sha-verified): k = 4/15, by group 2/5, 0/5, 2/5. +# Weights are FORCED by the composition, not chosen: the new cell enters on the floor of the +# v7 corridor (0.0700, the same as the other two light legs), the blocker and the gate do not +# move, and the remaining 0.69 is split between the four heavy clauses in the v7 proportion +# (0.13 : 0.21 : 0.21 : 0.21, factor 0.9079) -> 0.12 / 0.19 / 0.19 / 0.19. Core corridor +# 0.19/0.07 = x2.714. Regrade of the five live v7 trees with this board: [0.24, 0.24, 0.31, +# 0.24, 0.31], mean 0.2680, d 2. +WEIGHTS = { + "retry_past_deadline_is_not_sent": Decimal("0.0900"), + "retry_cannot_move_or_clear_deadline": Decimal("0.0700"), + "eager_run_honours_deadline": Decimal("0.0700"), + "retry_due_by_countdown_past_deadline_is_not_sent": Decimal("0.0700"), + "delivery_scheduled_past_deadline_dropped_on_receipt": Decimal("0.1200"), + "expired_delivery_outcome_is_revoked": Decimal("0.1900"), + "expired_delivery_announced_to_monitors": Decimal("0.1900"), + "discarded_delivery_does_not_revoke_the_call": Decimal("0.1900"), + "gate_repo_suite_green_and_tests_untouched": Decimal("0.0100"), +} +BLOCKERS = frozenset({ + "retry_past_deadline_is_not_sent", + "gate_repo_suite_green_and_tests_untouched", +}) + +GRADERS = [ + ("retry_past_deadline_is_not_sent", 0.0900, True, "bash", 600), + ("retry_cannot_move_or_clear_deadline", 0.0700, False, "bash", 600), + ("eager_run_honours_deadline", 0.0700, False, "bash", 600), + ("retry_due_by_countdown_past_deadline_is_not_sent", 0.0700, False, "bash", 600), + ("delivery_scheduled_past_deadline_dropped_on_receipt", 0.1200, False, "bash", 600), + ("expired_delivery_outcome_is_revoked", 0.1900, False, "bash", 600), + ("expired_delivery_announced_to_monitors", 0.1900, False, "bash", 600), + ("discarded_delivery_does_not_revoke_the_call", 0.1900, False, "bash", 600), + ("gate_repo_suite_green_and_tests_untouched", 0.0100, True, "bash", 1800), +] + +# ─── the scoreboard's arithmetic, checked where it is written ────────────── +assert [n for n, _w, _b, _k, _t in GRADERS] == list(WEIGHTS), \ + "GRADERS and WEIGHTS list different criteria, or list them in a different order" +assert all(Decimal(str(w)) == WEIGHTS[n] for n, w, _b, _k, _t in GRADERS), \ + "a weight in GRADERS disagrees with the Decimal table above it" +assert all(b == (n in BLOCKERS) for n, _w, b, _k, _t in GRADERS), \ + "a blocker flag in GRADERS disagrees with BLOCKERS" +assert sum(WEIGHTS.values()) == Decimal("1.0000"), \ + f"the weights sum to {sum(WEIGHTS.values())}, not 1.0000" +assert all(w > 0 for w in WEIGHTS.values()), "a criterion carries no weight" +assert len(WEIGHTS) >= 6, "fewer than six criteria" +# §1.A + B-1 +assert BLOCKERS, "no blocker: a board with nothing that must be right is not a board" +assert all(WEIGHTS[n] <= Decimal("0.30") for n in BLOCKERS), "a blocker is worth more than 0.30" +assert sum(WEIGHTS[n] for n in BLOCKERS) <= Decimal("0.75"), "the blocking mass is over 0.75" +assert min(Decimal("1.00") - max(WEIGHTS[n] for n in BLOCKERS), + Decimal(str(BLOCKER_CAP))) >= Decimal("0.60"), \ + "a tree that fails one blocker would land below 0.60" +assert BLOCKER_CAP >= 0.60, "the blocker cap is below the floor" +# G-5 +assert GATE in WEIGHTS, "the gate is a cell of the board and must be in the table" +assert WEIGHTS[GATE] == GATE_WEIGHT and GATE_WEIGHT >= Decimal("0.01"), \ + "the gate carries no weight (G-5: every gate is a blocker worth at least 0.01)" +assert GATE in BLOCKERS, "the gate is a blocker" +assert GRADERS[-1][0] == GATE, "the gate runs last" +assert GRADERS[-1][4] == GATE_TIMEOUT, "the gate's budget is written down twice and they differ" + + +# ─── grading machinery ───────────────────────────────────────────────────── + +# run_grading.sh exits 3 when the grader COULD NOT JUDGE (an interpreter that +# would not run, a missing report, its own budget). A fault is not a failed +# criterion: it earns nothing and it proves nothing, so a faulted blocker keeps +# the cap on rather than passing quietly. +FAULT_EXIT = 3 + + +def _fault_reason(stdout: str) -> str: + tail = (stdout or "").strip().splitlines() + return tail[-1][:200] if tail else "the grader exited %d without a word" % FAULT_EXIT + + +def _absolve_faults(subscores) -> dict: + faults = {} + for s in subscores: + meta = getattr(s, "metadata", None) or {} + if meta.get("exit_code") == FAULT_EXIT or meta.get("returncode") == FAULT_EXIT: + faults[s.name] = _fault_reason(meta.get("stdout") or meta.get("stderr") or "") + return faults + + +def _measured_scale(subscores, faults) -> tuple: + """(weight that was measured, reward expressed over that weight).""" + weights = {name: weight for name, weight, _b, _k, _t in GRADERS} + measured = sum(w for n, w in weights.items() if n not in faults) + if measured <= 0: + return 0.0, 0.0 + earned = sum(weights[s.name] * s.value for s in subscores + if s.name in weights and s.name not in faults) + return float(measured), float(earned / measured) + + +async def _grade(validate_mode: str | None) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + diff = GOLD_DIFF.read_text() + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult( + reward=0.0, content="patch failed to apply", info={"git_apply": apply_error} + ) + + # G-5-prime, v6 (20.09): the rule is the same — a gate green on a tree that + # met no scored criterion would be weight for doing nothing — but it is now + # ENFORCED BY THE GATE ITSELF, not by zeroing its subscore afterwards. The + # gate runs last (asserted above), so by the time it starts the non-gate + # criteria are measured and their verdict travels to it as CORE_GREEN=0|1; + # at CORE_GREEN=0 the gate prints its own suite result and then FAILs. Why + # the change: the post-hoc form left `PASS …` with exit code 0 in the trace + # beside a subscore of 0, and a reader of the trace cannot tell that from a + # broken check. Nothing about the arithmetic moves: base 0.000, noop 0.000, + # gold 1.000 with the gate at 1.0. + subscores: list[SubScore] = [] + core_green = False + for name, weight, _blocker, _kind, timeout in GRADERS: + gate_env = "" if name not in _G5P_GATES else f"CORE_GREEN={int(core_green)} " + subscores.append( + await BashGrader.grade( + weight, + name=name, + command=f"{gate_env}bash {GRADER} {name} {timeout}", + cwd=str(REPO_DIR), + timeout_seconds=timeout, + ) + ) + if name not in _G5P_GATES and subscores[-1].value > 0.0: + core_green = True + + faults = _absolve_faults(subscores) + result = await combine(*subscores) + + failed = sorted( + (name, weight) + for name, weight, blocker, _kind, _t in GRADERS + if blocker and name not in faults + and next(s.value for s in subscores if s.name == name) < 1.0 + ) + unproven = sorted(n for n, _w, blocker, _k, _t in GRADERS if blocker and n in faults) + + if faults: + measured_weight, over_measured = _measured_scale(subscores, faults) + capped = bool(failed) or bool(unproven) + return EvaluationResult( + reward=result.reward if not capped else max(0.0, min(result.reward, BLOCKER_CAP)), + subscores=result.subscores, + isError=True, + info={**result.info, "grader_faults": dict(faults), + "failed_blockers": [n for n, _w in failed], + "unproven_blockers": unproven, + "measured_weight": round(measured_weight, 4), + "reward_over_measured_weight": round(over_measured, 4)}, + content=( + "GRADER FAULT: this run was not graded. " + + "; ".join(f"{n}: {why}" for n, why in faults.items()) + + ". A fault is the grader failing to judge, not the change failing a " + "criterion. A criterion that was not measured earns nothing, and a " + f"blocker that was not proven keeps the {BLOCKER_CAP:.2f} ceiling on. " + "This run has to be re-run; do not read the reward as a measurement." + ), + ) + + if failed: + reward = max(0.0, min(result.reward, BLOCKER_CAP)) + names = [name for name, _weight in failed] + return EvaluationResult( + reward=reward, subscores=result.subscores, + info={**result.info, "uncapped_reward": result.reward, + "failed_blockers": names, "blocker_cap": BLOCKER_CAP}, + content=(f"Blocker criteria failed ({', '.join(names)}); " + f"cap {BLOCKER_CAP:.2f}, reward {reward:.3f} " + f"(uncapped {result.reward:.3f})."), + ) + return result + + +@env.template( + id="celery_retry_expires_countdown_contract", + description=( + "A task call's expiry is a fixed deadline on every path: a retry that " + "would start at or after it is not sent and the task ends out of " + "retries, eager runs honour it, and a delivery scheduled past it is " + "dropped as expired on receipt - reported to the caller and to monitors " + "as a revocation that expired, and only that delivery: a later delivery " + "of the same call still runs; the repository's own tests stay untouched " + "and green." + ), +) +async def celery_retry_expires_countdown_contract( + validate_mode: str | None = None, + revision: str | None = None, +): + # V-2: `revision` is INERT. It exists so that a change of ticket, gold, + # grader or image can be handed to `hud sync tasks` as an argument, which is + # part of the task signature and therefore yields a NEW task version in the + # UI (columns alone do not). Nothing in the scenario or the grading reads it; + # it is provenance, and it is deliberately never shown to the agent. + _ = revision + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + if validate_mode == "golden": + _ = yield "Golden-validation run: no work is expected of you. Finish immediately." + else: + # E-4: the ticket travels inside the coding-task scenario's own framing, + # never bare. The same words handed over without it have been measured to + # change how a run starts. + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. " + f"{WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests " + "grade your work when you finish; do not modify existing tests.\n\n" + f"{PROMPT}" + ) + yield await _grade(validate_mode) + + +tasks = [celery_retry_expires_countdown_contract()] diff --git a/harbor/sources/celery-v12/toolchain/requirements-agent.txt b/harbor/sources/celery-v12/toolchain/requirements-agent.txt new file mode 100644 index 0000000000000000000000000000000000000000..0e49c28dbf6f6b820c76c24a9e9b5919be0b1824 --- /dev/null +++ b/harbor/sources/celery-v12/toolchain/requirements-agent.txt @@ -0,0 +1,30 @@ +# The agent's (and the grader's) interpreter: the pinned checkout's runtime +# requirements plus what its unit tests for app/tasks/worker/utils import. +# Versions pinned to the set measured green on the pristine checkout (13.09). +# celery itself is NOT installed: the tree at /workspace/repo is the package. +billiard==4.2.4 +kombu==5.6.2 +vine==5.1.0 +click==8.5.0 +click-didyoumean==0.3.1 +click-repl==0.3.0 +click-plugins==1.1.1.2 +python-dateutil==2.9.0.post0 +tzlocal==5.4.4 +pydantic==2.13.5 +pyyaml==6.0.3 +msgpack==1.1.2 +tblib>=3.0.0 +redis==6.4.0 +# t/unit/app/test_app.py::test_App::test_setup_security patches celery.security, +# whose certificate module imports cryptography at module scope; without it the +# lazy attribute on the celery package raises AttributeError and the gate's suite +# is red on the PRISTINE checkout. Pin is upstream's own +# (requirements/extras/auth.txt at the pinned commit). 14.09. +cryptography==50.0.1 +pytest==9.1.1 +pytest-timeout==2.4.0 +pytest-subtests==0.15.0 +pytest-rerunfailures==16.6.1 +pytest-order==1.5.0 +pytest-click==1.1.0 diff --git a/harbor/sources/click-v9/Dockerfile.hud b/harbor/sources/click-v9/Dockerfile.hud new file mode 100644 index 0000000000000000000000000000000000000000..de3b1d1973f556bff2bfccbaf57b679be25db26e --- /dev/null +++ b/harbor/sources/click-v9/Dockerfile.hud @@ -0,0 +1,81 @@ +# help_defaults on the coding-template (rubric flavor). +# +# Substrate: click at the pinned base SHA (history vaulted at task +# setup by coding/repo.py), Python 3.12, pure Python, hud serve. Everything +# answer-key-shaped lives under /hud (root, mode 700): the vault, the hidden +# graders, pristine copies of src/ and tests/, the grader-owned runner tree, +# gold.diff and base.diff. Agent shells drop to uid 1000, so /hud is +# unreadable from the agent side. + +FROM python:3.12-bookworm + +ARG REPO_URL=https://github.com/pallets/click +ARG BASE_SHA=06b2a678741131fd577ce170e23e5ca0aeba0309 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + git ca-certificates util-linux less \ + && rm -rf /var/lib/apt/lists/* + +# hud runtime (env process) in its own venv +RUN python3 -m venv /opt/hudvenv \ + && /opt/hudvenv/bin/pip install --no-cache-dir "hud==0.6.13" +ENV PATH="/opt/hudvenv/bin:${PATH}" + +# Substrate repo at the pinned base commit. History is truncated here and +# additionally vaulted at task setup (coding/repo.py), so the agent gets a +# fresh single-commit repo with working git and no refs to mine. +RUN mkdir -p /workspace \ + && git init -q /workspace/repo \ + && cd /workspace/repo \ + && git remote add origin ${REPO_URL} \ + && git fetch --depth 1 origin ${BASE_SHA} \ + && git checkout -q FETCH_HEAD \ + && git checkout -q -b main \ + && git config --system user.email "dev@localhost" \ + && git config --system user.name "dev" \ + && git config --system --add safe.directory /workspace/repo + +# Agent toolchain: a root-owned venv (the agent can run it, not modify it) +# with click installed editable from the workspace. The grader uses the +# same interpreter with PYTHONPATH=/hud/grader/runner/src, so the import can +# be pinned to another tree. pip is removed after the install: everything +# the task needs is present and the prompt says not to install anything. +RUN python3 -m venv /opt/agentvenv \ + && /opt/agentvenv/bin/pip install --no-cache-dir \ + "pytest>=8" \ + && /opt/agentvenv/bin/pip install --no-cache-dir -e /workspace/repo \ + && chown -R 1000:1000 /workspace/repo +ENV PATH="/opt/agentvenv/bin:${PATH}" +# the agent's shell is a login shell, which rebuilds PATH from /etc/profile +# and would otherwise discard the ENV above +RUN printf 'export PATH=/opt/agentvenv/bin:$PATH\n' \ + > /etc/profile.d/10-agentvenv.sh \ + && chmod 644 /etc/profile.d/10-agentvenv.sh + +# -- /hud: everything the agent must never read (mode 700, root) ---------- +COPY task/grader/ /hud/grader/ +COPY task/gold.diff /hud/gold.diff +COPY task/base.diff /hud/base.diff +RUN mkdir -p /hud/grader/pristine /hud/vault /hud/logs \ + && cp -R /workspace/repo/tests /hud/grader/pristine/tests \ + && cp -R /workspace/repo/src /hud/grader/pristine_src \ + && git -C /workspace/repo rev-parse HEAD > /hud/grader/base_sha \ + && cp -a /workspace/repo /hud/grader/runner \ + && rm -rf /hud/grader/runner/.git /hud/grader/runner/.hud \ + && chown -R root:root /hud \ + && chmod -R 700 /hud + +# Template runtime layout +ENV REPO_DIR=/workspace/repo \ + VAULT_DIR=/hud/vault \ + GRADING_LOGS_DIR=/hud/logs \ + GOLD_DIFF=/hud/gold.diff \ + GRADER_DIR=/hud/grader + +WORKDIR /app +COPY coding/ /app/coding/ +COPY env.py tasks.py /app/ +COPY task/prompt.md /app/task/prompt.md +RUN chmod 600 /app/tasks.py + +CMD ["hud", "serve", "tasks.py", "--host", "0.0.0.0"] diff --git a/harbor/sources/click-v9/coding/__init__.py b/harbor/sources/click-v9/coding/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..88280a271d88bae2eb437ca5e8c172120a66f336 --- /dev/null +++ b/harbor/sources/click-v9/coding/__init__.py @@ -0,0 +1,5 @@ +"""The coding environment's core: repo-lifecycle primitives and task flavors.""" + +from . import repo, swe_bench_pro + +__all__ = ["repo", "swe_bench_pro"] diff --git a/harbor/sources/click-v9/coding/github.py b/harbor/sources/click-v9/coding/github.py new file mode 100644 index 0000000000000000000000000000000000000000..7bf3575a13151411b2802cd3ba7615a57fac0cfc --- /dev/null +++ b/harbor/sources/click-v9/coding/github.py @@ -0,0 +1,158 @@ +"""A minimal mock GitHub for SDLC tasks. + +One in-process store holds issues (seeded per task) and the pull requests and +comments the agent creates; :func:`serve` publishes it as ``github_*`` MCP +tools over an ``mcp`` capability. The remote itself is a bare git repo on +disk (see :func:`coding.repo.create_remote`) - the agent pushes branches with +plain git and references them from pull requests here. +""" + +from __future__ import annotations + +import asyncio +import json +import socket +from dataclasses import asdict, dataclass, field +from typing import Any + +from fastmcp import FastMCP +from hud.capabilities import Capability + + +@dataclass +class Issue: + number: int + title: str + body: str + labels: list[str] = field(default_factory=list) + state: str = "open" + comments: list[str] = field(default_factory=list) + + +@dataclass +class PullRequest: + number: int + title: str + body: str + head: str + base: str + state: str = "open" + comments: list[str] = field(default_factory=list) + + +class MockGitHub: + """Issue/PR store with an action log (for rubric grading).""" + + def __init__(self) -> None: + self.issues: dict[int, Issue] = {} + self.pull_requests: dict[int, PullRequest] = {} + self.actions: list[dict[str, Any]] = [] + + def seed(self, issues: list[dict[str, Any]]) -> None: + """Reset the store to the task's fixtures.""" + self.issues = { + int(entry["number"]): Issue( + number=int(entry["number"]), + title=str(entry["title"]), + body=str(entry.get("body", "")), + labels=[str(label) for label in entry.get("labels", [])], + ) + for entry in issues + } + self.pull_requests = {} + self.actions = [] + + def _record(self, action: str, **details: Any) -> None: + self.actions.append({"action": action, **details}) + + # --- operations (the tool surface) -------------------------------- + + def list_issues(self) -> list[dict[str, Any]]: + return [asdict(issue) for issue in self.issues.values()] + + def get_issue(self, number: int) -> dict[str, Any]: + return asdict(self._issue(number)) + + def close_issue(self, number: int) -> dict[str, Any]: + issue = self._issue(number) + issue.state = "closed" + self._record("close_issue", number=number) + return asdict(issue) + + def comment_on_issue(self, number: int, body: str) -> dict[str, Any]: + issue = self._issue(number) + issue.comments.append(body) + self._record("comment_on_issue", number=number, body=body) + return asdict(issue) + + def create_pull_request(self, title: str, body: str, head: str, base: str) -> dict[str, Any]: + number = len(self.pull_requests) + 1 + pr = PullRequest(number=number, title=title, body=body, head=head, base=base) + self.pull_requests[number] = pr + self._record("create_pull_request", number=number, title=title, head=head) + return asdict(pr) + + def list_pull_requests(self) -> list[dict[str, Any]]: + return [asdict(pr) for pr in self.pull_requests.values()] + + def _issue(self, number: int) -> Issue: + if number not in self.issues: + raise ValueError(f"no such issue: #{number}") + return self.issues[number] + + # --- grading views -------- + + def latest_pull_request(self) -> PullRequest | None: + return next(reversed(self.pull_requests.values()), None) + + def transcript(self) -> str: + """Everything the agent did here, for rubric judging.""" + return json.dumps( + { + "issues": [asdict(issue) for issue in self.issues.values()], + "pull_requests": [asdict(pr) for pr in self.pull_requests.values()], + "actions": self.actions, + }, + indent=2, + ) + + +def serve(github: MockGitHub) -> tuple[asyncio.Task[None], Capability]: + """Serve *github* as ``github_*`` MCP tools; returns the server task + capability.""" + server: FastMCP = FastMCP(name="github") + + @server.tool + def github_list_issues() -> list[dict[str, Any]]: + """List all issues in the repository.""" + return github.list_issues() + + @server.tool + def github_get_issue(number: int) -> dict[str, Any]: + """Get one issue by number.""" + return github.get_issue(number) + + @server.tool + def github_close_issue(number: int) -> dict[str, Any]: + """Close an issue.""" + return github.close_issue(number) + + @server.tool + def github_comment_on_issue(number: int, body: str) -> dict[str, Any]: + """Add a comment to an issue.""" + return github.comment_on_issue(number, body) + + @server.tool + def github_create_pull_request(title: str, body: str, head: str, base: str = "main") -> dict[str, Any]: + """Open a pull request from branch *head* (already pushed to the remote) into *base*.""" + return github.create_pull_request(title, body, head, base) + + @server.tool + def github_list_pull_requests() -> list[dict[str, Any]]: + """List all pull requests.""" + return github.list_pull_requests() + + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind(("127.0.0.1", 0)) + port = int(sock.getsockname()[1]) + task = asyncio.create_task(server.run_async(transport="http", host="127.0.0.1", port=port, show_banner=False)) + return task, Capability.mcp(name="github", url=f"http://127.0.0.1:{port}/mcp") diff --git a/harbor/sources/click-v9/coding/repo.py b/harbor/sources/click-v9/coding/repo.py new file mode 100644 index 0000000000000000000000000000000000000000..21551cb2cd4185a30ca5bf461134e418d712429b --- /dev/null +++ b/harbor/sources/click-v9/coding/repo.py @@ -0,0 +1,167 @@ +"""Git-history vaulting and diff-based grading primitives. + +The repo's real ``.git`` may contain the answer key - solution branches, the +fix commit, the hidden tests. Every task flavor shares this lifecycle: + +- setup (:func:`vault_history`): snapshot the pre-agent worktree into the + real history, move ``.git`` into a vault outside the workspace, and leave a + fresh single-commit repo - git works normally for the agent, but there is + no history, no refs, and no remotes. +- grading (:func:`restore_history` -> :func:`capture_agent_diff` -> + :func:`reset_worktree` -> :func:`apply_diff`): discard the agent's ``.git`` + (hooks and history included), restore the vaulted history, capture the + agent's changes as a diff against the setup snapshot, reset the worktree to + that snapshot, and re-apply the diff. Hidden tests come from vaulted refs + and land after the agent's diff. + +The snapshot covers the whole worktree, so installed dependencies and build +artifacts survive into grading. +""" + +from __future__ import annotations + +import asyncio +import os +import shutil +from pathlib import Path + +_GIT_ID = ("-c", "user.name=hud-grader", "-c", "user.email=grader@hud.ai") +_SETUP_COMMIT = "setup_commit" + + +async def run( + *argv: str, + cwd: Path, + timeout: float = 600.0, + check: bool = True, +) -> tuple[int, str, str]: + """Run a command, returning ``(returncode, stdout, stderr)``. Kills on timeout.""" + proc = await asyncio.create_subprocess_exec( + *argv, + cwd=str(cwd), + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + try: + out_bytes, err_bytes = await asyncio.wait_for(proc.communicate(), timeout=timeout) + except TimeoutError: + proc.kill() + await proc.wait() + raise TimeoutError(f"{' '.join(argv[:4])} timed out after {timeout:.0f}s") from None + out = out_bytes.decode("utf-8", "replace") + err = err_bytes.decode("utf-8", "replace") + if check and proc.returncode != 0: + detail = (err.strip() or out.strip())[:2000] + raise RuntimeError(f"{' '.join(argv)} failed ({proc.returncode}): {detail}") + return proc.returncode if proc.returncode is not None else 1, out, err + + +async def git(repo: Path, *args: str, timeout: float = 600.0, check: bool = True) -> tuple[int, str, str]: + return await run("git", *_GIT_ID, *args, cwd=repo, timeout=timeout, check=check) + + +def _append_git_exclude(git_dir: Path) -> None: + """Keep the workspace's SSH credential dir out of snapshots and diffs.""" + exclude = git_dir / "info" / "exclude" + exclude.parent.mkdir(parents=True, exist_ok=True) + with exclude.open("a", encoding="utf-8") as fh: + fh.write("\n.hud/\n") + + +async def vault_history(repo: Path, vault: Path) -> None: + """Snapshot the pre-agent state, then hide the repo's history in *vault*.""" + if (vault / "git").exists(): + raise RuntimeError(f"vault {vault} already holds a history: one task per substrate") + + if hasattr(os, "geteuid") and os.geteuid() == 0: + # Grade-time git runs as root on the (chowned) agent-owned repo; git + # honors safe.directory only from system/global config, never from -c. + await run("git", "config", "--global", "--add", "safe.directory", str(repo), cwd=Path("/")) + + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: pre-agent snapshot") + _, sha, _ = await git(repo, "rev-parse", "HEAD") + + vault.mkdir(parents=True, exist_ok=True) + (vault / _SETUP_COMMIT).write_text(sha.strip(), "utf-8") + shutil.move(str(repo / ".git"), str(vault / "git")) + + await git(repo, "init", "-q", ".") + _append_git_exclude(repo / ".git") + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "baseline") + + +async def create_remote(repo: Path, remote: Path, ref: str, *, branch: str = "main") -> None: + """A bare "GitHub" remote holding *ref*'s history as *branch*. + + Pushing a single ref publishes only its ancestry - sibling answer-key + branches (hidden tests, golden fix) stay unreachable, while the agent + still gets realistic past history to work with. + """ + remote.parent.mkdir(parents=True, exist_ok=True) + await git(remote.parent, "init", "-q", "--bare", "-b", branch, str(remote)) + await git(repo, "push", "-q", str(remote), f"{ref}:refs/heads/{branch}") + + +async def attach_to_remote(repo: Path, remote: Path, *, branch: str = "main") -> None: + """Point the agent's fresh repo at the remote, sharing its (sanitized) history. + + Called after :func:`vault_history`: the throwaway single-commit repo is + replaced by the remote's clone state - same worktree, but with ``origin`` + configured and history the agent can branch from and push back to. + """ + shutil.rmtree(repo / ".git") + await git(repo, "init", "-q", "-b", branch, ".") + _append_git_exclude(repo / ".git") + await git(repo, "remote", "add", "origin", str(remote)) + await git(repo, "fetch", "-q", "origin") + # Adopt the remote's history without a checkout: the worktree already + # matches (plus untracked build artifacts a checkout would refuse to + # cross), so point the branch at origin and sync only the index. + await git(repo, "update-ref", f"refs/heads/{branch}", f"refs/remotes/origin/{branch}") + await git(repo, "reset", "-q") + await git(repo, "branch", "-q", f"--set-upstream-to=origin/{branch}", branch) + + +async def restore_history(repo: Path, vault: Path) -> str: + """Swap the agent's throwaway ``.git`` for the vaulted real history. + + Returns the setup-snapshot commit sha recorded by :func:`vault_history`. + """ + agent_git = repo / ".git" + if agent_git.exists(): + shutil.rmtree(agent_git) + shutil.move(str(vault / "git"), str(agent_git)) + return (vault / _SETUP_COMMIT).read_text("utf-8").strip() + + +async def capture_agent_diff(repo: Path, setup_commit: str) -> str: + """The agent's changes: setup snapshot -> final worktree state. + + Runs on the restored real history: the final worktree (including files the + agent added) is committed and diffed against the snapshot. + """ + await git(repo, "add", "-A") + await git(repo, "commit", "-q", "--allow-empty", "-m", "hud: final snapshot") + _, final, _ = await git(repo, "rev-parse", "HEAD") + _, diff, _ = await git(repo, "diff", setup_commit, final.strip(), timeout=1200.0) + return diff + + +async def reset_worktree(repo: Path, setup_commit: str) -> None: + await git(repo, "reset", "--hard", setup_commit) + await git(repo, "clean", "-fd") + + +async def apply_diff(repo: Path, diff: str, patch_path: Path) -> str | None: + """Apply *diff* to the worktree; returns git's error output on failure.""" + if not diff.strip(): + return None + patch_path.parent.mkdir(parents=True, exist_ok=True) + patch_path.write_text(diff, "utf-8") + code, out, err = await git(repo, "apply", "-v", str(patch_path), check=False) + if code != 0: + return (err.strip() or out.strip())[-4000:] + return None diff --git a/harbor/sources/click-v9/coding/swe_bench_pro.py b/harbor/sources/click-v9/coding/swe_bench_pro.py new file mode 100644 index 0000000000000000000000000000000000000000..da655cfc4cfaf8596fa6e18c3a47c8aad21d42d5 --- /dev/null +++ b/harbor/sources/click-v9/coding/swe_bench_pro.py @@ -0,0 +1,149 @@ +"""The SWE-bench Pro task flavor: dataset-row parsing and the official grading pipeline. + +An instance directory (baked into the instance image by ``swe_tasks.py``) +holds the dataset row (``instance.json``) plus the official per-instance +``run_script.sh`` and ``parser.py`` from scaleapi/SWE-bench_Pro-os. Grading +replays the official evaluator's entryscript on the repo-lifecycle primitives +in :mod:`coding.repo`: reset to the pre-agent snapshot, apply the (agent or +golden) patch, check out the hidden test files, run the script, parse, and +resolve iff every ``fail_to_pass`` and ``pass_to_pass`` test passes. +""" + +from __future__ import annotations + +import ast +import json +import re +import sys +from pathlib import Path +from typing import Any + +from hud.graders import EvaluationResult, SubScore + +from . import repo as repo_lib + + +def load_instance(instance_dir: Path) -> dict[str, Any]: + return json.loads((instance_dir / "instance.json").read_text("utf-8")) + + +def str_list(field: str) -> list[str]: + """Parse the dataset's list-shaped string fields. + + The rows store lists as Python reprs (single quotes; the official + evaluator uses ``eval``), so ``ast.literal_eval`` is the safe equivalent. + """ + value = ast.literal_eval(field) + if not isinstance(value, list): + raise ValueError(f"expected a list, got {type(value).__name__}") + return [str(item) for item in value] + + +def strip_binary_hunks(patch: str) -> str: + """Drop binary diff sections, exactly like the official evaluator.""" + if not patch: + return patch + sections = re.split(r"(?=^diff --git )", patch, flags=re.MULTILINE) + kept = [ + section + for section in sections + if section.strip() + and not re.search(r"^Binary files .* differ$", section, re.MULTILINE) + and not re.search(r"^GIT binary patch$", section, re.MULTILINE) + ] + return "".join(kept) + + +def score(instance: dict[str, Any], tests: list[dict[str, Any]]) -> EvaluationResult: + """The official resolution criterion: every required test passes.""" + passed = {t["name"] for t in tests if t.get("status") == "PASSED"} + fail_to_pass = set(str_list(instance["fail_to_pass"])) + pass_to_pass = set(str_list(instance["pass_to_pass"])) + required = fail_to_pass | pass_to_pass + resolved = required <= passed + + def fraction(subset: set[str]) -> float: + return len(subset & passed) / len(subset) if subset else 1.0 + + missing = sorted(required - passed) + return EvaluationResult( + reward=1.0 if resolved else 0.0, + content="resolved" if resolved else f"unresolved: {len(missing)} required test(s) not passing", + subscores=[ + SubScore(name="resolved", value=1.0 if resolved else 0.0, weight=1.0), + SubScore(name="fail_to_pass", value=fraction(fail_to_pass), weight=0.0), + SubScore(name="pass_to_pass", value=fraction(pass_to_pass), weight=0.0), + ], + info={"tests_reported": len(tests), "missing": missing[:20]}, + ) + + +def build_prompt(instance: dict[str, Any], repo_dir: Path) -> str: + sections = [ + f"You are working in {repo_dir}, a checkout of the {instance['repo']} repository. " + "Resolve the issue described below by modifying the code. Hidden tests grade your " + "work when you finish; do not modify existing tests.", + instance["problem_statement"], + ] + if instance.get("requirements"): + sections.append("## Requirements\n\n" + instance["requirements"]) + if instance.get("interface"): + sections.append("## Interface\n\n" + instance["interface"]) + return "\n\n".join(section.strip() for section in sections if section and section.strip()) + + +async def grade( + instance: dict[str, Any], + instance_dir: Path, + repo_dir: Path, + vault_dir: Path, + logs_dir: Path, + *, + validate_mode: str | None = None, + tests_timeout: float = 3600.0, +) -> EvaluationResult: + """Replay the official evaluator's entryscript in place. + + ``validate_mode="golden"`` grades the dataset's golden patch instead of + the agent's diff (the official gold-patch sanity check). The hidden test + files (the last line of ``before_repo_set_cmd``) are checked out *after* + the patch, so patch edits to them never survive. + """ + logs_dir.mkdir(parents=True, exist_ok=True) + setup_commit = await repo_lib.restore_history(repo_dir, vault_dir) + + if validate_mode == "golden": + diff = instance["patch"] + else: + diff = await repo_lib.capture_agent_diff(repo_dir, setup_commit) + diff = strip_binary_hunks(diff) + + await repo_lib.reset_worktree(repo_dir, setup_commit) + apply_error = await repo_lib.apply_diff(repo_dir, diff, logs_dir / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + + test_checkout = instance["before_repo_set_cmd"].strip().splitlines()[-1] + await repo_lib.run("bash", "-c", test_checkout, cwd=repo_dir) + + files_csv = ",".join(str_list(instance["selected_test_files_to_run"])) + _, out, err = await repo_lib.run( + "bash", + str(instance_dir / "run_script.sh"), + files_csv, + cwd=repo_dir, + timeout=tests_timeout, + check=False, + ) + (logs_dir / "stdout.log").write_text(out, "utf-8") + (logs_dir / "stderr.log").write_text(err, "utf-8") + await repo_lib.run( + sys.executable, + str(instance_dir / "parser.py"), + "stdout.log", + "stderr.log", + "output.json", + cwd=logs_dir, + ) + tests = json.loads((logs_dir / "output.json").read_text("utf-8"))["tests"] + return score(instance, tests) diff --git a/harbor/sources/click-v9/env.py b/harbor/sources/click-v9/env.py new file mode 100644 index 0000000000000000000000000000000000000000..7d03be45891b3f3f329b725fcceb1abe3d1ec7b6 --- /dev/null +++ b/harbor/sources/click-v9/env.py @@ -0,0 +1,345 @@ +"""Coding environment (HUD v6): a repo workspace with diff-based grading. + +The env publishes one ``ssh`` workspace over a git repo; the agent's harness +brings its own bash/file tools. Task setup vaults the repo's real history +(:mod:`coding.repo`) so the agent gets a fresh single-commit repo with working +git but no answer-key refs; grading captures the agent's changes as a diff, +resets to the pre-agent snapshot, re-applies, brings in the hidden tests, and +runs them. + +Three task templates: + +- ``coding-task`` - hidden tests live as refs in the repo's vaulted history + (the ``{task}_baseline`` / ``{task}_test`` / ``{task}_golden`` branch + convention) and a shell command scores by exit code. Runs locally (clones + ``REPO_URL`` per process) or from an image that bakes the repo. +- ``sdlc-task`` - adds workflow: a bare mock-GitHub remote the agent pushes + to, ``github_*`` issue/PR tools (:mod:`coding.github`), and grading over + the pushed pull-request branch instead of the worktree. +- one SWE-bench Pro instance template, registered only when an instance dir + is baked in (see ``swe_tasks.py``): grading replays the official evaluator + (:mod:`coding.swe_bench_pro`). + +Images set ``REPO_DIR``; locally everything lives in per-process temp dirs. +The vault and instance assets sit outside the workspace - under ``/hud`` +(root, mode 700) in images - and agent shells drop to a non-root uid, so only +the env process can read them. +""" + +from __future__ import annotations + +import asyncio +import logging +import os +import shutil +import tempfile +from pathlib import Path +from typing import Any + +from hud.environment import Environment, Workspace +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine +from hud.settings import settings + +from coding import repo as repo_lib +from coding import swe_bench_pro as swe +from coding.github import MockGitHub +from coding.github import serve as serve_github + +logger = logging.getLogger(__name__) + +# --- substrate layout -------- +# Images set REPO_DIR (and ship the repo); locally everything lives in +# per-process temp dirs and the repo is cloned from REPO_URL at startup. + +_explicit_repo = os.environ.get("REPO_DIR") +if _explicit_repo: + REPO_DIR = Path(_explicit_repo) + VAULT_DIR = Path(os.environ.get("VAULT_DIR", "/hud/vault")) + LOGS_DIR = Path(os.environ.get("GRADING_LOGS_DIR", "/hud/logs")) + _LOCAL_SUBSTRATE = False +else: + _LOCAL_ROOT = Path(tempfile.gettempdir()) / "hud-coding" + REPO_DIR = _LOCAL_ROOT / f"repo-{os.getpid()}" + VAULT_DIR = _LOCAL_ROOT / f"vault-{os.getpid()}" + LOGS_DIR = _LOCAL_ROOT / f"logs-{os.getpid()}" + _LOCAL_SUBSTRATE = True + +# The SDLC flavor's mock-GitHub remote: a bare repo the agent pushes to. It +# must be writable by the agent, so it lives outside /hud. +REMOTE_DIR = ( + Path(os.environ.get("REMOTE_DIR", "/srv/git/project.git")) + if _explicit_repo + else _LOCAL_ROOT / f"remote-{os.getpid()}" / "project.git" +) + +REPO_URL = os.environ.get("REPO_URL", "https://github.com/hud-evals/coding-template-sample") +TESTS_TIMEOUT = float(os.environ.get("GRADING_TIMEOUT", "3600")) + +INSTANCE_DIR = Path(os.environ.get("INSTANCE_DIR", "/hud/instance")) + +AGENT_UID = 1000 +AGENT_HOME = Path("/tmp/agent-home") # noqa: S108 - container-local, created at setup + +env = Environment(name="ec-swe-click") + + +# shell_uid is the privilege wall: the env process (root, in images) keeps the +# vault and instance assets under /hud at mode 700; the uid-dropped agent can +# edit the repo but never read the answer key. No-op off root (local). +# (Requires hud>=0.6.12.dev0: earlier shell_uid recursively chowned the whole +# workspace on the serving path, missing the deploy readiness probe.) +_ws = Workspace( + REPO_DIR, + guest_path=str(REPO_DIR), + network=True, + env={"HOME": str(AGENT_HOME)}, + track_files=settings.file_tracking_enabled, + shell_uid=AGENT_UID, +) + +SDLC_TOOLS = os.environ.get("SDLC_TOOLS", "") not in ("", "0", "false") + +WORKSPACE_NOTE = ( + f"Please make your changes directly in {REPO_DIR}, not in a copy or a " + "separate worktree." +) + +_github = MockGitHub() +_github_server: asyncio.Task[None] | None = None + + +@env.initialize +async def _up() -> None: + global _github_server + if _LOCAL_SUBSTRATE and not (REPO_DIR / ".git").exists(): + REPO_DIR.parent.mkdir(parents=True, exist_ok=True) + logger.info("cloning %s into %s", REPO_URL, REPO_DIR) + await repo_lib.run("git", "clone", "-q", REPO_URL, str(REPO_DIR), cwd=REPO_DIR.parent) + await _ws.start() + env.add_capability(_ws.capability("shell")) + if _ws.tracks_files: + env.add_capability(_ws.file_tracking_capability()) + # The mock-GitHub tools belong to the SDLC flavor, which seeds issues and + # wants a pull request. A plain coding task never uses them, and offering + # them anyway spends agent steps on an empty issue list - every rollout so + # far called github_list_issues and github_list_pull_requests once. + if SDLC_TOOLS: + _github_server, github_capability = serve_github(_github) + env.add_capability(github_capability) + + +@env.shutdown +async def _down() -> None: + if _github_server is not None: + _github_server.cancel() + await _ws.stop() + if _LOCAL_SUBSTRATE: + for path in (REPO_DIR, VAULT_DIR, LOGS_DIR, REMOTE_DIR.parent): + shutil.rmtree(path, ignore_errors=True) + + +# --- shared task lifecycle -------- + + +async def _setup(base_ref: str | None = None, *, remote: bool = False) -> None: + """Check out the task's baseline, vault the history, hand the repo to the agent. + + With ``remote=True`` (the SDLC flavor) a bare "GitHub" remote is created + from the baseline first, and the agent's repo is attached to it as a + normal clone would be - realistic history, pushes, and branches, but no + reachable answer-key refs. + """ + if base_ref: + await repo_lib.git(REPO_DIR, "checkout", "-qf", base_ref) + if remote: + await repo_lib.create_remote(REPO_DIR, REMOTE_DIR, base_ref or "HEAD") + await repo_lib.vault_history(REPO_DIR, VAULT_DIR) + if remote: + await repo_lib.attach_to_remote(REPO_DIR, REMOTE_DIR) + if hasattr(os, "geteuid") and os.geteuid() == 0: + AGENT_HOME.mkdir(parents=True, exist_ok=True) + uid = f"{AGENT_UID}:{AGENT_UID}" + paths = [str(REPO_DIR), str(AGENT_HOME)] + ([str(REMOTE_DIR)] if remote else []) + await repo_lib.run("chown", "-R", uid, *paths, cwd=Path("/")) + if remote: + # The grader (root) pushes to and clones from the agent-owned remote. + await repo_lib.run("git", "config", "--global", "--add", "safe.directory", str(REMOTE_DIR), cwd=Path("/")) + + +# --- generic flavor -------- + + +async def _grade_generic( + test_command: str, + base_ref: str | None, + test_ref: str | None, + test_files: list[str] | None, + golden_ref: str | None, + validate_mode: str | None, +) -> EvaluationResult: + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + if not (base_ref and golden_ref): + raise ValueError('validate_mode="golden" needs base_ref and golden_ref') + _, diff, _ = await repo_lib.git(REPO_DIR, "diff", base_ref, golden_ref) + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult(reward=0.0, content="patch failed to apply", info={"git_apply": apply_error}) + if test_ref: + # Hidden tests come from the vaulted history, after the agent's diff - + # so agent edits to them never survive into grading. + await repo_lib.git(REPO_DIR, "checkout", test_ref, "--", *(test_files or ["."])) + + command = test_command.format(test_files=" ".join(test_files or [])) + return await combine( + BashGrader.grade(weight=1.0, command=command, cwd=str(REPO_DIR), timeout_seconds=int(TESTS_TIMEOUT)) + ) + + +async def coding_task( + description: str, + test_command: str, + base_ref: str | None = None, + test_ref: str | None = None, + test_files: list[str] | None = None, + golden_ref: str | None = None, + validate_mode: str | None = None, +): + """Generic coding task. + + ``base_ref`` is the agent's starting state; ``test_ref`` holds the hidden + tests (``test_files`` are checked out from it at grade time); + ``test_command`` scores by exit code, with ``{test_files}`` expanded. + ``validate_mode="golden"`` grades ``base_ref..golden_ref`` instead of + agent edits. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup(base_ref) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}. {WORKSPACE_NOTE}\n\n" + "Use the tools provided to complete the following task. Hidden tests grade your " + f"work when you finish; do not modify existing tests.\n\n{description}" + ) + yield await _grade_generic(test_command, base_ref, test_ref, test_files, golden_ref, validate_mode) + + +# --- SDLC flavor: issue-driven fix, graded on the pushed PR branch ------- + + +async def _fetch_hidden_ref(dest: Path, ref: str) -> None: + """Fetch an answer-key ref from the vaulted history into *dest*.""" + full = f"refs/remotes/{ref}" if ref.startswith("origin/") else ref + await repo_lib.git(dest, "fetch", "-q", str(VAULT_DIR / "git"), full) + + +async def _grade_sdlc( + test_command: str, + test_ref: str, + test_files: list[str], + golden_ref: str | None, + pr_rubric: str | None, + validate_mode: str | None, +) -> EvaluationResult: + if validate_mode == "golden": + # Simulate the workflow the agent is graded on: push the reference + # fix as a branch and open a pull request for it. + if not golden_ref: + raise ValueError('validate_mode="golden" needs golden_ref') + await repo_lib.git(VAULT_DIR / "git", "push", "-q", str(REMOTE_DIR), f"{golden_ref}:refs/heads/golden-fix") + _github.create_pull_request( + "Fix the reported bug", "Applies the reference fix.", head="golden-fix", base="main" + ) + + pr = _github.latest_pull_request() + if pr is None: + return EvaluationResult(reward=0.0, content="no pull request was opened") + + # Hermetic checkout of the PR head from the remote (never the worktree). + grading_dir = LOGS_DIR / "pr-checkout" + shutil.rmtree(grading_dir, ignore_errors=True) + LOGS_DIR.mkdir(parents=True, exist_ok=True) + await repo_lib.run("git", "clone", "-q", str(REMOTE_DIR), str(grading_dir), cwd=LOGS_DIR) + code, _, err = await repo_lib.git(grading_dir, "checkout", "-q", pr.head, check=False) + if code != 0: + return EvaluationResult( + reward=0.0, + content=f"pull request head branch {pr.head!r} was never pushed", + info={"git_checkout": err.strip()[-2000:]}, + ) + + await _fetch_hidden_ref(grading_dir, test_ref) + await repo_lib.git(grading_dir, "checkout", "FETCH_HEAD", "--", *test_files) + + command = test_command.format(test_files=" ".join(test_files)) + quality: Any + if pr_rubric: + quality = LLMJudgeGrader.grade(weight=0.2, answer=_github.transcript(), criteria=[pr_rubric]) + else: + opened_well = bool(pr.title.strip() and pr.body.strip()) + quality = SubScore(name="pull_request", value=1.0 if opened_well else 0.0, weight=0.2) + return await combine( + BashGrader.grade(weight=0.8, command=command, cwd=str(grading_dir), timeout_seconds=int(TESTS_TIMEOUT)), + quality, + ) + + +async def sdlc_task( + description: str, + test_command: str, + base_ref: str, + test_ref: str, + test_files: list[str], + issues: list[dict[str, Any]] | None = None, + golden_ref: str | None = None, + pr_rubric: str | None = None, + validate_mode: str | None = None, +): + """The generic flavor plus workflow: the repo has an ``origin`` remote (a + bare mock-GitHub repo) and ``github_*`` tools seeded with *issues*; the + deliverable is a pushed branch with a pull request. Grading checks the PR + head out of the remote, brings in the hidden tests, runs ``test_command`` + (weight 0.8), and scores the PR itself (weight 0.2) - structurally, or + against ``pr_rubric`` with an LLM judge when provided. + """ + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + _github.seed(issues or []) + await _setup(base_ref, remote=True) + _ = yield ( + f"You are working in a coding repository located at {REPO_DIR}; its `origin` remote " + "is the team's shared repository, and the `github_*` tools give you the team's " + "issue tracker.\n\n" + "Complete the following task. When you are done, push your work to `origin` as a " + "new branch and open a pull request for it with `github_create_pull_request`. " + "Hidden tests grade your work; do not modify existing tests.\n\n" + f"{description}" + ) + yield await _grade_sdlc(test_command, test_ref, test_files, golden_ref, pr_rubric, validate_mode) + + +# --- SWE-bench Pro flavor (present only in baked instance images) -------- + +if (INSTANCE_DIR / "instance.json").is_file(): + INSTANCE = swe.load_instance(INSTANCE_DIR) + + async def swe_bench_pro_task(validate_mode: str | None = None): + """One SWE-bench Pro rollout. ``validate_mode="golden"`` grades the + dataset's golden patch instead of agent edits (gold-patch validation).""" + if validate_mode not in (None, "golden"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + await _setup() + _ = yield swe.build_prompt(INSTANCE, REPO_DIR) + yield await swe.grade( + INSTANCE, + INSTANCE_DIR, + REPO_DIR, + VAULT_DIR, + LOGS_DIR, + validate_mode=validate_mode, + tests_timeout=TESTS_TIMEOUT, + ) diff --git a/harbor/sources/click-v9/instances/.none/.gitkeep b/harbor/sources/click-v9/instances/.none/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/harbor/sources/click-v9/task/base.diff b/harbor/sources/click-v9/task/base.diff new file mode 100644 index 0000000000000000000000000000000000000000..562696e6a65b23bc0e5b2ddb1f42c4b69674def7 --- /dev/null +++ b/harbor/sources/click-v9/task/base.diff @@ -0,0 +1,9 @@ +diff --git a/src/click/core.py b/src/click/core.py +index 1f9323a..99fcb81 100644 +--- a/src/click/core.py ++++ b/src/click/core.py +@@ -1,3 +1,4 @@ ++# Baseline validation marker: an inert comment that changes no behaviour. + from __future__ import annotations + + import collections.abc as cabc diff --git a/harbor/sources/click-v9/task/gold.diff b/harbor/sources/click-v9/task/gold.diff new file mode 100644 index 0000000000000000000000000000000000000000..055a0fd9f57e12eac8e6784a5cf48fc4c8ada88d --- /dev/null +++ b/harbor/sources/click-v9/task/gold.diff @@ -0,0 +1,232 @@ +diff --git a/CHANGES.md b/CHANGES.md +index 8853860..4976b6c 100644 +--- a/CHANGES.md ++++ b/CHANGES.md +@@ -11,6 +11,10 @@ Unreleased + + Unreleased + ++- The `[default: ...]` shown in help for an option with `multiple=True` ++ renders each value the way a single value is rendered: `Enum` members by ++ name, empty strings as `""`. The prompt of an option lists its choices and ++ previews its default the same way, so what it shows can be typed back. + - Fix `copy.deepcopy()` and `pickle` on a `Parameter`, `Option` or `Command`. {pr}`3805` + - A `KeyboardInterrupt` arriving while `Command.main()` reports an abort or an error, + or while it exits, no longer escapes as an unhandled traceback. The command still +diff --git a/src/click/_utils.py b/src/click/_utils.py +index 2d4e8f2..e2811bb 100644 +--- a/src/click/_utils.py ++++ b/src/click/_utils.py +@@ -1,7 +1,9 @@ + from __future__ import annotations + + import enum ++import inspect + import typing as t ++from gettext import gettext as _ + + + class Sentinel(enum.Enum): +@@ -43,3 +45,33 @@ T_UNSET: t.TypeAlias = t.Literal[Sentinel.UNSET] + + T_FLAG_NEEDS_VALUE: t.TypeAlias = t.Literal[Sentinel.FLAG_NEEDS_VALUE] + """Type hint for the :data:`FLAG_NEEDS_VALUE` sentinel value.""" ++ ++ ++def _format_default_value(value: t.Any) -> str: ++ """Render a value the way ``[default: ...]`` and prompts show it. ++ ++ A list or tuple renders as its values, comma separated, each rendered by ++ the same rules as a single value: an Enum member by its name, an empty ++ string as ``""``, a plain function as ``(dynamic)``, anything else with ++ ``str()``. ++ ++ :meta private: ++ """ ++ if isinstance(value, (list, tuple)): ++ return ", ".join(_format_default_value(item) for item in value) ++ if isinstance(value, enum.Enum): ++ return value.name ++ if inspect.isfunction(value): ++ return _("(dynamic)") ++ if isinstance(value, str) and value == "": ++ return '""' ++ return str(value) ++ ++ ++def _format_choice(choice: t.Any) -> str: ++ """Render one choice the way prompts and help list it: an Enum member by ++ its name, anything else with ``str()``. ++ ++ :meta private: ++ """ ++ return choice.name if isinstance(choice, enum.Enum) else str(choice) +diff --git a/src/click/core.py b/src/click/core.py +index 1f9323a..e82eaa0 100644 +--- a/src/click/core.py ++++ b/src/click/core.py +@@ -23,6 +23,7 @@ from types import TracebackType + + from . import types + from ._utils import FLAG_NEEDS_VALUE ++from ._utils import _format_default_value + from ._utils import UNSET + from .exceptions import Abort + from .exceptions import BadParameter +@@ -3564,12 +3565,13 @@ class Option(Parameter): + ): + if show_default_is_str: + default_string = f"({self.show_default})" +- elif isinstance(default_value, (list, tuple)): +- default_string = ", ".join(str(d) for d in default_value) +- elif isinstance(default_value, enum.Enum): +- default_string = default_value.name +- elif inspect.isfunction(default_value): +- default_string = _("(dynamic)") ++ elif isinstance(default_value, (list, tuple)) or ( ++ isinstance(default_value, enum.Enum) ++ or inspect.isfunction(default_value) ++ ): ++ # Multi-valued defaults render each value the way the same ++ # value renders for a single-valued option. ++ default_string = _format_default_value(default_value) + elif self.is_bool_flag and self.secondary_opts: + # For boolean flags that have distinct True/False opts, + # use the opt without prefix instead of the value. +diff --git a/src/click/termui.py b/src/click/termui.py +index 8fe0085..0caa7cd 100644 +--- a/src/click/termui.py ++++ b/src/click/termui.py +@@ -15,6 +15,8 @@ from gettext import gettext as _ + from . import _compat + from ._compat import isatty + from ._compat import strip_ansi ++from ._utils import _format_choice ++from ._utils import _format_default_value + from .exceptions import Abort + from .exceptions import UsageError + from .globals import resolve_color_default +@@ -115,7 +117,9 @@ def _build_prompt( + ) -> str: + prompt = text + if type is not None and show_choices and isinstance(type, Choice): +- prompt += f" ({', '.join(map(str, type.choices))})" ++ # Each choice is listed the way it can be typed back, which for an ++ # Enum member is its name, as the help and the error message show it. ++ prompt += f" ({', '.join(_format_choice(choice) for choice in type.choices)})" + default_preview = "" + if show_default: + if isinstance(show_default, str): +@@ -132,7 +136,9 @@ def _format_default(default: V) -> V | str: + if name is not None: + return str(name) + +- return default ++ # The default is previewed the way the help renders it, so that what is ++ # shown is what the user can type back. ++ return _format_default_value(default) + + + @t.overload +@@ -250,6 +256,15 @@ def prompt( + prompt = _build_prompt( + text, prompt_suffix, show_default, default, show_choices, type + ) ++ # The default exactly as the prompt shows it. Typing that text back ++ # selects the default itself, as pressing Enter does, so that a value ++ # rendered for display (a quoted empty string, a list of values) can be ++ # typed back as shown. ++ shown_default = ( ++ str(_format_default(default)) ++ if default is not None and show_default and not isinstance(show_default, str) ++ else None ++ ) + + if confirmation_prompt: + if confirmation_prompt is True: +@@ -269,7 +284,9 @@ def prompt( + value = t.cast("str", default) + break + try: +- result = value_proc(value) ++ result = value_proc( ++ default if shown_default is not None and value == shown_default else value ++ ) + except UsageError as e: + message = _mask_hidden_input(e.message, value) if hide_input else e.message + echo(_("Error: {message}").format(message=message), err=err) +diff --git a/tests/test_help_defaults_multiple.py b/tests/test_help_defaults_multiple.py +new file mode 100644 +index 0000000..cb6eb77 +--- /dev/null ++++ b/tests/test_help_defaults_multiple.py +@@ -0,0 +1,69 @@ ++import enum ++ ++import click ++from click.testing import CliRunner ++ ++ ++class Color(enum.Enum): ++ Red = "r" ++ Blue = "b" ++ ++ ++def _help(**kwargs): ++ @click.command() ++ @click.option("--opt", show_default=True, **kwargs) ++ def cmd(opt): ++ pass ++ ++ return CliRunner().invoke(cmd, ["--help"]).output ++ ++ ++def test_multiple_enum_default_shows_names(): ++ assert "[default: Red, Blue]" in _help( ++ type=click.Choice(Color), multiple=True, default=[Color.Red, Color.Blue] ++ ) ++ ++ ++def test_multiple_empty_string_default_is_quoted(): ++ assert '[default: "", x]' in _help(multiple=True, default=["", "x"]) ++ ++ ++def test_nargs_with_multiple_renders_every_value(): ++ assert "[default: 1, 2, 3, 4]" in _help(nargs=2, multiple=True, default=[(1, 2), (3, 4)]) ++ ++ ++def _prompt_line(input_text="\n", **kwargs): ++ @click.command() ++ @click.option("--opt", prompt="Value", **kwargs) ++ def cmd(opt): ++ pass ++ ++ return CliRunner().invoke(cmd, [], input=input_text).output.split("\n", 1)[0] ++ ++ ++def test_prompt_lists_enum_choices_and_default_by_name(): ++ line = _prompt_line(type=click.Choice(Color), default=Color.Blue) ++ assert "(Red, Blue)" in line ++ assert "[Blue]" in line ++ ++ ++def test_prompt_previews_empty_string_default_quoted(): ++ assert '[""]' in _prompt_line(default="") ++ ++ ++def test_prompt_default_typed_back_as_shown(): ++ line = CliRunner().invoke( ++ _typed_back_cmd(multiple=True, default=["", "x"]), [], input='"", x\n' ++ ).output ++ assert "GOT=('', 'x')" in line ++ line = CliRunner().invoke(_typed_back_cmd(default=""), [], input='""\n').output ++ assert "GOT=''" in line ++ ++ ++def _typed_back_cmd(**kwargs): ++ @click.command() ++ @click.option("--opt", prompt="Value", **kwargs) ++ def cmd(opt): ++ click.echo(f"GOT={opt!r}") ++ ++ return cmd diff --git a/harbor/sources/click-v9/task/grader/maintainer_review.judge.json b/harbor/sources/click-v9/task/grader/maintainer_review.judge.json new file mode 100644 index 0000000000000000000000000000000000000000..3d225a71f2e758616dbd28c81b33df52e5c26aa5 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/maintainer_review.judge.json @@ -0,0 +1,14 @@ +{ + "question": "Review this diff against Click's contribution standards. The ticket asks that the [default: ...] help text of an option with a multi-valued default render each value the way a single value is rendered (Enum members by name, empty strings as \"\"), at any nesting; that every prompt, an option's or the prompt function called directly, list its choices and preview its default by the same rules; that typing a default back exactly as the prompt shows it give the default itself, as pressing Enter does; and that nothing else change.", + "criteria": [ + "The diff changes how the [default: ...] text of an option's help is rendered, in src/click/core.py or in a helper that code calls; a change that only adds comments, whitespace or formatting does not count.", + "The diff changes how a prompt lists an option's choices or previews its default, in src/click/termui.py or in a helper that code calls; a change that only adds comments, whitespace or formatting does not count.", + "Look only at the files under src/click that the diff changes. Answer No only if one of those changes has nothing to do with any of these: rendering a default value or a choice for the help text or a prompt; a prompt accepting its default typed back exactly as it was shown (for example comparing the typed input with the shown default and using the default when they match); or code that this directly relies on (for example a shared helper it calls, or an import it needs). Changes to CHANGES.md, to test files and to any file outside src/click are not judged here and never count as unrelated edits.", + "The diff leaves every test file that existed before it unchanged. Test files that the diff creates are new, not changed, and count as Yes.", + "Look at every method or property name that the lines the diff adds define inside a class under src/click, and at every parameter the diff adds to such a method. Answer No only if one of those names does not start with an underscore and is not already defined before the diff, under the same name, on the class being changed or a class it inherits from. Names that start with an underscore count as Yes; this includes special methods such as __init__, whose names start with two underscores.", + "The diff does not remove, rename or make required any parameter of an existing public function or method under src/click, and does not change the type of value such a function or method returns (for example a function that returned a str still returns a str). Returning different text, as the ticket requires for the rendered defaults and choices, is a change of behaviour, not of type, and counts as Yes. A function or method is public when its name does not start with an underscore. Changes to functions or methods whose names start with an underscore, and new optional parameters whose names start with an underscore, count as Yes.", + "At least one test file added by the diff invokes a command's --help (for example through click.testing.CliRunner) for an option that has multiple=True (or nargs greater than 1 together with multiple) and a default containing an Enum member or an empty string, and asserts on the [default: ...] text in the output. Tests that only assert on a single-valued default do not meet this criterion.", + "The diff adds an entry to CHANGES.md under a version that is not yet released.", + "The entry the diff adds to CHANGES.md describes the change to how the help-text default of a multi-valued option is rendered." + ] +} diff --git a/harbor/sources/click-v9/task/grader/run_grading.sh b/harbor/sources/click-v9/task/grader/run_grading.sh new file mode 100644 index 0000000000000000000000000000000000000000..790af3840f3b6d2a550d8813989e36518f90ff65 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/run_grading.sh @@ -0,0 +1,196 @@ +#!/usr/bin/env bash +# Hidden grading for help_defaults - ONE FUNCTION PER CRITERION. +# +# Usage: run_grading.sh +# criterion in multi_enum | multi_empty_string | nested_values +# | prompt_rendering | untouched_paths | no_regression +# | test_quality +# (the 8th criterion, maintainer_review, is the LLM judge in tasks.py) +# +# Exit code is the verdict (0 = PASS). tasks.py runs each criterion as its +# own BashGrader call; the subscore name in the trace == the function name +# here == the hidden test file it runs. +# +# Tamper resistance: everything executes from the grader-owned RUNNER tree +# (a pristine copy of the repo at the base commit) with the agent's src/ and +# tests/ synced in, using the root-owned /opt/agentvenv interpreter. +# PYTHONPATH pins click to the runner's src/, never the agent workspace. + +set -u + +export PATH="/opt/agentvenv/bin:/opt/hudvenv/bin:/usr/local/bin:/usr/bin:/bin:${PATH:-}" +export HOME="${HOME:-/root}" + +REPO=${REPO_DIR:-/workspace/repo} +G=${GRADER_DIR:-/hud/grader} +RUNNER=$G/runner +PY=${GRADER_PYTHON:-/opt/agentvenv/bin/python} +STATE=${GRADER_STATE_DIR:-/hud/logs/grading-state} +LOGDIR=$STATE/logs +mkdir -p "$LOGDIR" + +export PYTHONPATH="$RUNNER/src" +export PYTHONDONTWRITEBYTECODE=1 + +detail() { + echo " ----- $1 (last 2500 bytes) -----" + tail -c 2500 "$2" 2>/dev/null | sed 's/^/ | /' + echo " -----" +} + +# --- shared setup: sync agent sources into the runner (cached) ------------ + +ensure_setup() { + [ -f "$STATE/.setup_done" ] && return 0 + for sub in src tests; do + rm -rf "${RUNNER:?}/$sub" + cp -R "$REPO/$sub" "$RUNNER/$sub" + done + find "$RUNNER" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null + mkdir -p "$RUNNER/hidden" + cp "$G/tests/_fixtures.py" "$RUNNER/hidden/" + local where + where=$(cd "$RUNNER" && "$PY" -c 'import click,os;print(os.path.dirname(click.__file__))' 2>>"$LOGDIR/setup.log") + case "$where" in + "$RUNNER"/src/*) ;; + *) echo " [grader] WARNING: click imported from '$where', expected under $RUNNER/src" ;; + esac + touch "$STATE/.setup_done" +} + +# run_hidden - copy in, run, remove; exit code = verdict +run_hidden() { + ensure_setup + cp "$G/tests/$1" "$RUNNER/hidden/$1" + (cd "$RUNNER/hidden" && "$PY" -m pytest -q -p no:cacheprovider "$1") >"$LOGDIR/$1.log" 2>&1 + local rc=$? + rm -f "$RUNNER/hidden/$1" + [ $rc -ne 0 ] && detail "hidden suite $1" "$LOGDIR/$1.log" + return $rc +} + +# --- criterion functions (7 bash + 1 judge in tasks.py) ------------------- +# Every check reads the --help output or the prompt line of a one-option +# command and compares the rendered text; never the shape of the fix. + +# 1. multi_enum (must pass, gate) - Enum members in a multi-valued default +# are shown by name, as a single Enum default already is. +criterion_multi_enum() { + run_hidden __hidden__multi_enum.py +} + +# 2. multi_empty_string (must pass) - an empty string in a multi-valued +# default is shown as "", as a single empty-string default already is. +criterion_multi_empty_string() { + run_hidden __hidden__multi_empty_string.py +} + +# 3. nested_values (must pass) - nargs>1 with multiple, and mixed kinds, +# render every value by the same rules, joined into one list. +criterion_nested_values() { + run_hidden __hidden__nested_values.py +} + +# 4. prompt_rendering (must pass) - the prompt lists Enum choices and previews +# an Enum or empty-string default the way the help renders them; the +# shown name is accepted back; show_default strings, plain choices and +# show_choices=False are unchanged. +criterion_prompt_rendering() { + run_hidden __hidden__prompt_rendering.py +} + +# 5. untouched_paths - show_default strings, numbers, dynamic defaults, +# boolean flags, the no-default case, file defaults in the help and an +# empty-string plain choice are exactly as before. +criterion_untouched_paths() { + run_hidden __hidden__untouched_paths.py +} + +# 5z. prompt_function - click.prompt called directly lists choices and +# previews its default by the same rules as an option's prompt. +criterion_prompt_function() { + run_hidden __hidden__prompt_function.py +} + +# 5a. typeback_single - typing a single default back exactly as the prompt +# shows it (a quoted empty string, an Enum name) gives the default itself. +criterion_typeback_single() { + run_hidden __hidden__typeback_single.py +} + +# 5b. typeback_multi - typing a multi-valued default back exactly as the +# prompt shows it gives the default itself. +criterion_typeback_multi() { + run_hidden __hidden__typeback_multi.py +} + +# 6. no_regression - the existing suite is green on the agent's tree and no +# pre-existing test file was modified or removed. New files are allowed. +criterion_no_regression() { + ensure_setup + local rc=0 + local f rel + while IFS= read -r f; do + rel=${f#"$G/pristine/tests/"} + if [ ! -f "$REPO/tests/$rel" ]; then + echo " [grader] pre-existing test file removed: tests/$rel"; rc=1 + elif ! cmp -s "$f" "$REPO/tests/$rel"; then + echo " [grader] pre-existing test file modified: tests/$rel"; rc=1 + fi + done < <(find "$G/pristine/tests" -type f -name '*.py') + (cd "$RUNNER" && "$PY" -m pytest -q -p no:cacheprovider tests) >"$LOGDIR/regression.log" 2>&1 \ + || { rc=1; detail "existing suite" "$LOGDIR/regression.log"; } + return $rc +} + +# 7. test_quality - the agent's OWN new test files must (a) pass against the +# agent's src, (b) FAIL against the pristine base src (anti-vacuity), and +# the agent must have added at least one test file. +criterion_test_quality() { + ensure_setup + local rc=0 + local changed=() + local f rel + while IFS= read -r f; do + rel=${f#"$REPO/"} + if [ ! -f "$G/pristine/$rel" ] || ! cmp -s "$f" "$G/pristine/$rel"; then + changed+=("$rel") + fi + done < <(find "$REPO/tests" -type f -name 'test_*.py') + if [ ${#changed[@]} -eq 0 ]; then + echo " [grader] no test files added or changed under tests/"; return 1 + fi + echo " [grader] agent test files: ${changed[*]}" + (cd "$RUNNER" && "$PY" -m pytest -q -p no:cacheprovider "${changed[@]}") \ + >"$LOGDIR/agent-tests-fixed.log" 2>&1 \ + || { rc=1; detail "agent tests against agent src" "$LOGDIR/agent-tests-fixed.log"; } + # swap in the pristine src and expect the agent's suite to go red + rm -rf "$RUNNER/src"; cp -R "$G/pristine_src" "$RUNNER/src" + find "$RUNNER/src" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null + if (cd "$RUNNER" && "$PY" -m pytest -q -p no:cacheprovider "${changed[@]}") \ + >"$LOGDIR/agent-tests-pristine.log" 2>&1; then + echo " [grader] anti-vacuity: agent tests stayed green on the unfixed src (vacuous)." + detail "anti-vacuity run" "$LOGDIR/agent-tests-pristine.log"; rc=1 + fi + rm -rf "$RUNNER/src"; cp -R "$REPO/src" "$RUNNER/src" + find "$RUNNER/src" -name '__pycache__' -type d -prune -exec rm -rf {} + 2>/dev/null + return $rc +} + +# --- dispatcher -------- + +CRITERIA="multi_enum multi_empty_string nested_values prompt_rendering untouched_paths prompt_function typeback_single typeback_multi no_regression test_quality" + +main() { + local c=${1:-} + case " $CRITERIA " in + *" $c "*) ;; + *) echo "usage: $0 (one of: $CRITERIA)"; exit 2 ;; + esac + "criterion_$c" + local rc=$? + if [ $rc -eq 0 ]; then echo "PASS $c"; else echo "FAIL $c"; fi + exit $rc +} + +main "$@" diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__multi_empty_string.py b/harbor/sources/click-v9/task/grader/tests/__hidden__multi_empty_string.py new file mode 100644 index 0000000000000000000000000000000000000000..08727511062a861fd4e2407f4dc1a8987652335f --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__multi_empty_string.py @@ -0,0 +1,19 @@ +"""An empty string in a multi-valued default is shown as a quoted empty +string, as a single empty-string default already is.""" +from _fixtures import default_shown + + +def test_single_empty_string_default(): + assert default_shown(default="") == '""' + + +def test_multiple_with_empty_string(): + assert default_shown(multiple=True, default=["", "x"]) == '"", x' + + +def test_multiple_only_empty_strings(): + assert default_shown(multiple=True, default=["", ""]) == '"", ""' + + +def test_multiple_plain_strings_unchanged(): + assert default_shown(multiple=True, default=["a", "b"]) == "a, b" diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__multi_enum.py b/harbor/sources/click-v9/task/grader/tests/__hidden__multi_enum.py new file mode 100644 index 0000000000000000000000000000000000000000..09ec596a03202b1f7e4013817f04ca57b2df1c87 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__multi_enum.py @@ -0,0 +1,23 @@ +"""Enum members in a multi-valued default are shown by name, as a single +Enum default already is.""" +import click + +from _fixtures import Color, default_shown + + +def test_single_enum_default_by_name(): + assert default_shown(type=click.Choice(Color), default=Color.Red) == "Red" + + +def test_multiple_enum_default_by_name(): + assert default_shown(type=click.Choice(Color), multiple=True, default=[Color.Red]) == "Red" + + +def test_multiple_enum_defaults_joined_by_name(): + shown = default_shown(type=click.Choice(Color), multiple=True, default=[Color.Red, Color.Blue]) + assert shown == "Red, Blue" + + +def test_multiple_enum_default_as_tuple(): + shown = default_shown(type=click.Choice(Color), multiple=True, default=(Color.Green,)) + assert shown == "Green" diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__nested_values.py b/harbor/sources/click-v9/task/grader/tests/__hidden__nested_values.py new file mode 100644 index 0000000000000000000000000000000000000000..5c5b2c989c504b4b81c06a5cf468d647093fad4a --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__nested_values.py @@ -0,0 +1,24 @@ +"""Values nested inside a multi-valued default (nargs > 1 with multiple, or +mixed kinds) render by the same per-value rules, joined into one list.""" +import click + +from _fixtures import Color, default_shown + + +def test_nargs_with_multiple_flattens(): + assert default_shown(nargs=2, multiple=True, default=[(1, 2), (3, 4)]) == "1, 2, 3, 4" + + +def test_single_nargs_default_unchanged(): + assert default_shown(nargs=2, default=(1, 2)) == "1, 2" + + +def test_mixed_values_in_one_default(): + shown = default_shown(type=click.Choice(Color), multiple=True, default=[Color.Red, Color.Green]) + assert shown == "Red, Green" + shown = default_shown(multiple=True, default=["", "x", 3]) + assert shown == '"", x, 3' + + +def test_nested_enum_and_empty_string(): + assert default_shown(nargs=2, multiple=True, default=[(Color.Red, ""), (Color.Blue, "z")]) == 'Red, "", Blue, z' diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_function.py b/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_function.py new file mode 100644 index 0000000000000000000000000000000000000000..ff118c5b63275b88dc819c3016c8d5e4602f456b --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_function.py @@ -0,0 +1,35 @@ +"""prompt_function: click.prompt called directly, not through an option, +lists choices and previews its default by the same rules.""" +import click +from click.testing import CliRunner + +from _fixtures import Color + + +def _line(input_text="\n", **prompt_kwargs): + @click.command() + def cmd(): + value = click.prompt("Value", **prompt_kwargs) + click.echo(f"GOT={value!r}") + + return CliRunner().invoke(cmd, [], input=input_text).output + + +def test_enum_choices_and_default_by_name(): + out = _line(type=click.Choice(Color), default=Color.Blue) + assert out.startswith("Value (Red, Green, Blue) [Blue]:") + assert f"GOT={Color.Blue!r}" in out + + +def test_empty_string_default_is_quoted(): + assert _line(default="").startswith('Value [""]:') + + +def test_multi_valued_default_is_one_list(): + assert _line(default=[Color.Red, ""], type=click.UNPROCESSED).startswith('Value [Red, ""]:') + + +def test_plain_defaults_unchanged(): + assert _line(default="x").startswith("Value [x]:") + assert _line(default=3).startswith("Value [3]:") + assert _line(type=click.Choice(["a", "b"]), default="a").startswith("Value (a, b) [a]:") diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_rendering.py b/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_rendering.py new file mode 100644 index 0000000000000000000000000000000000000000..3b35e088b5cb4a43d12445f6bddf0ed9b9f9fba1 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__prompt_rendering.py @@ -0,0 +1,55 @@ +"""prompt_rendering: the prompt an option shows lists its choices and its +default the way the help renders them, so what is shown can be typed back. +""" +import click +from click.testing import CliRunner + +from _fixtures import Color, prompt_text + + +def test_enum_choices_are_listed_by_name(): + line = prompt_text(type=click.Choice(Color), input_text="Red\n") + assert "(Red, Green, Blue)" in line + assert "Color." not in line + + +def test_enum_default_preview_is_its_name(): + line = prompt_text(type=click.Choice(Color), default=Color.Green) + assert "[Green]" in line + assert "Color." not in line + + +def test_enum_default_without_choice_type_is_its_name(): + line = prompt_text(default=Color.Blue, type=click.UNPROCESSED) + assert "[Blue]" in line + + +def test_empty_string_default_preview_is_quoted(): + line = prompt_text(default="") + assert '[""]' in line + + +def test_shown_enum_name_is_accepted_back(): + @click.command() + @click.option("--opt", prompt="Value", type=click.Choice(Color), default=Color.Red) + def cmd(opt): + click.echo(opt.name) + + result = CliRunner().invoke(cmd, [], input="Green\n") + assert result.exit_code == 0 + assert result.output.endswith("Green\n") + assert "Color." not in result.output + + +def test_show_default_string_and_plain_choices_unchanged(): + line = prompt_text(default="x", show_default="custom") + assert "[(custom)]" in line + line = prompt_text(type=click.Choice(["Day", "Night"], case_sensitive=False), default="Day") + assert "(Day, Night)" in line and "[Day]" in line + + +def test_hidden_choices_and_no_default_unchanged(): + line = prompt_text(type=click.Choice(Color), show_choices=False, input_text="Red\n") + assert "(" not in line + line = prompt_text(input_text="v\n") + assert line.strip() == "Value: v" diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_multi.py b/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_multi.py new file mode 100644 index 0000000000000000000000000000000000000000..71a9f3bb5c7a1adb2ef31831c3640f6b352bf724 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_multi.py @@ -0,0 +1,31 @@ +"""typeback_multi: typing a multi-valued default back exactly as the prompt +shows it gives the default itself, as pressing Enter does.""" +import click +from click.testing import CliRunner + +from _fixtures import Color + + +def _got(input_text, **option_kwargs): + @click.command() + @click.option("--opt", prompt="Value", **option_kwargs) + def cmd(opt): + click.echo(f"GOT={opt!r}") + + result = CliRunner().invoke(cmd, [], input=input_text) + assert result.exit_code == 0, result.output + return result.output.rsplit("GOT=", 1)[1].strip() + + +def test_multiple_enum_default_typed_back(): + got = _got("Red, Blue\n", type=click.Choice(Color), multiple=True, default=[Color.Red, Color.Blue]) + assert got == repr((Color.Red, Color.Blue)) + + +def test_multiple_default_with_empty_string_typed_back(): + assert _got('"", x\n', multiple=True, default=["", "x"]) == repr(("", "x")) + + +def test_nargs_default_typed_back(): + got = _got("Red, x\n", nargs=2, type=(click.Choice(Color), str), default=(Color.Red, "x")) + assert got == repr((Color.Red, "x")) diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_single.py b/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_single.py new file mode 100644 index 0000000000000000000000000000000000000000..e50f769b7c9ab9730a3c749e998a1d35db5f147d --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__typeback_single.py @@ -0,0 +1,33 @@ +"""typeback_single: typing a single default back exactly as the prompt shows +it gives the default itself, as pressing Enter does.""" +import click +from click.testing import CliRunner + +from _fixtures import Color + + +def _got(input_text, **option_kwargs): + @click.command() + @click.option("--opt", prompt="Value", **option_kwargs) + def cmd(opt): + click.echo(f"GOT={opt!r}") + + result = CliRunner().invoke(cmd, [], input=input_text) + assert result.exit_code == 0, result.output + return result.output.rsplit("GOT=", 1)[1].strip() + + +def test_quoted_empty_string_typed_back_is_the_empty_string(): + assert _got('""\n', default="") == "''" + assert _got("\n", default="") == "''" + + +def test_enum_name_typed_back_is_the_default_member(): + # Without a Choice type the name is not converted by the type, yet what + # the prompt showed still selects the default. + assert _got("Green\n", default=Color.Green, type=click.UNPROCESSED) == repr(Color.Green) + + +def test_other_input_is_taken_as_typed(): + assert _got("y\n", default="") == "'y'" + assert _got('""\n', default="x") == repr('""') diff --git a/harbor/sources/click-v9/task/grader/tests/__hidden__untouched_paths.py b/harbor/sources/click-v9/task/grader/tests/__hidden__untouched_paths.py new file mode 100644 index 0000000000000000000000000000000000000000..964f3dea1b61a11eb80bc14826c2a473157f7619 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/__hidden__untouched_paths.py @@ -0,0 +1,85 @@ +"""Everything else about default rendering stays as it is.""" +import click +import click.testing + +from _fixtures import default_shown + + +def test_show_default_string_wins(): + # show_default as a string is rendered verbatim, in parentheses + @click.command() + @click.option("--opt", multiple=True, default=[1, 2], show_default="two numbers") + def cmd(opt): + pass + + output = click.testing.CliRunner().invoke(cmd, ["--help"]).output + assert "[default: (two numbers)]" in output + + +def test_numbers_and_strings(): + assert default_shown(default=5) == "5" + assert default_shown(default="abc") == "abc" + assert default_shown(multiple=True, default=[1, 2, 3]) == "1, 2, 3" + + +def test_dynamic_default(): + assert default_shown(default=lambda: 3) == "(dynamic)" + + +def test_bool_flags(): + assert default_shown(is_flag=True, default=False) is None + assert default_shown(is_flag=True, default=True) == "True" + + @click.command() + @click.option("--shout/--no-shout", default=True, show_default=True) + def cmd(shout): + pass + + assert "[default: shout]" in click.testing.CliRunner().invoke(cmd, ["--help"]).output + + +def test_no_default_no_text(): + assert default_shown() is None + assert default_shown(multiple=True) is None + + +def test_file_default_in_help_unchanged(): + # A file object as a default renders in the help with str(), as before; + # the prompt keeps showing its name, as before. + import io + + from _fixtures import prompt_text + + buf = io.StringIO() + assert default_shown(type=click.File("w"), default=buf) == str(buf) + + with open(__file__) as handle: + shown = default_shown(type=click.File("r"), default=handle) + assert shown is not None + assert shown.replace(" ", "") == str(handle).replace(" ", "") + assert shown != __file__ + line = prompt_text(type=click.File("r"), default=handle) + assert f"[{__file__}]" in line + + +def test_empty_string_choice_unchanged(): + # A plain string choice that happens to be "" renders as before in the + # help metavar, in the prompt's choice list and in the error message, + # and the literal text '""' is still not one of the choices. + from _fixtures import prompt_text + + @click.command() + @click.option("--opt", type=click.Choice(["", "x"]), default="x") + def cmd(opt): + click.echo(repr(opt)) + + runner = click.testing.CliRunner() + assert "--opt [|x]" in runner.invoke(cmd, ["--help"]).output + assert runner.invoke(cmd, ["--opt", ""]).output.strip() == "''" + bad = runner.invoke(cmd, ["--opt", '""']) + assert bad.exit_code != 0 + assert "is not one of '', 'x'" in bad.output + + line = prompt_text(type=click.Choice(["", "x"]), default="x") + assert "(, x)" in line + assert '""' not in line diff --git a/harbor/sources/click-v9/task/grader/tests/_fixtures.py b/harbor/sources/click-v9/task/grader/tests/_fixtures.py new file mode 100644 index 0000000000000000000000000000000000000000..6504c1b057500095029c7959bf202cc40819f228 --- /dev/null +++ b/harbor/sources/click-v9/task/grader/tests/_fixtures.py @@ -0,0 +1,41 @@ +"""Shared helpers for the hidden help-text default tests.""" +from __future__ import annotations + +import enum +import re + +import click +from click.testing import CliRunner + + +class Color(enum.Enum): + Red = "r" + Green = "g" + Blue = "b" + + +def default_shown(**option_kwargs) -> str | None: + """Build a one-option command and return the text inside ``[default: ...]`` + from its --help output, or None if no default is shown.""" + + @click.command() + @click.option("--opt", show_default=True, **option_kwargs) + def cmd(opt): + pass + + output = CliRunner().invoke(cmd, ["--help"]).output + match = re.search(r"\[default: (.*?)\]", output, re.S) + return match.group(1).replace("\n", " ").strip() if match else None + + +def prompt_text(input_text: str = "\n", **option_kwargs) -> str: + """Build a one-option command that prompts and return the prompt line + as the user saw it (everything before the typed input).""" + + @click.command() + @click.option("--opt", prompt="Value", **option_kwargs) + def cmd(opt): + pass + + output = CliRunner().invoke(cmd, [], input=input_text).output + return output.split("\n", 1)[0] diff --git a/harbor/sources/click-v9/task/prompt.md b/harbor/sources/click-v9/task/prompt.md new file mode 100644 index 0000000000000000000000000000000000000000..ad9ff01d80650e7761fa63256fcce1f4062b4204 --- /dev/null +++ b/harbor/sources/click-v9/task/prompt.md @@ -0,0 +1,5 @@ +The [default: ...] text that an option's help shows is wrong for a multi-valued default. A single default is rendered by rules that make it readable and typeable: an Enum member is shown by its name, an empty string is shown as "", a callable is shown as (dynamic). When the option takes several values (multiple, or several values per occurrence), those rules are not applied: an Enum member shows as E.Foo, which is not a value the user can pass and does not match the metavar next to it, and an empty string shows as nothing at all. + +Required behaviour: every value of a multi-valued default is rendered exactly as the same value would be rendered as a single default, and the rendered values are joined with ", " into one list. This holds at any nesting: when each occurrence takes several values, every value of every occurrence is rendered by the same rules and all of them appear in that one list. These rules apply wherever a default value or the accepted values are presented to the user, not only in the help text: whenever a prompt shows its default or lists its choices, whether it is an option asking for its value or the prompt function called directly, each is rendered as the help renders that value, so that what is shown is what the user can type back, and the value typed back that way is accepted. Typing a default back exactly as the prompt shows it, a single value or a whole list, gives the default itself, just as pressing Enter does; any other input is taken as typed. Nothing else observable changes: a show_default string is still shown verbatim in parentheses, in the help and in the prompt; single-valued defaults, numbers, strings, dynamic defaults, boolean flags, file defaults, plain string choices and the no-default case render exactly as before, in the help and in the prompt; a prompt that hides its choices keeps hiding them; and the public API is unchanged. + +Add tests under tests/ in new files, do not edit any pre-existing test file, and keep the existing suite green. If a test fails, fix the code rather than weakening the test. Add an entry to the changelog under the unreleased version. Everything you need is already installed and works offline; do not download or install anything. Run tests with python -m pytest from the repository root; the whole suite takes a few seconds. diff --git a/harbor/sources/click-v9/tasks.py b/harbor/sources/click-v9/tasks.py new file mode 100644 index 0000000000000000000000000000000000000000..40eb463c5ce9de90d4df72ef10a01cb32716daa6 --- /dev/null +++ b/harbor/sources/click-v9/tasks.py @@ -0,0 +1,273 @@ +"""ec-swe-click-help-defaults on the coding-template. + +click @ 06b2a67: the ``[default: ...]`` text in an option's help renders a +multi-valued default (``multiple=True``, or ``nargs`` > 1 with ``multiple``) +by joining ``str()`` of each value, so the per-value rules used for a +single default are skipped: an Enum member prints as ``E.Foo`` instead of +``Foo`` (a value the user cannot even type, while the metavar lists the +names), and an empty string prints as nothing instead of ``""``. The fix +must render every value of a multi-valued default the way the same value +renders on its own, at any nesting, and change nothing else. + +Reads like a scoreboard: + +- GRADERS is the single list of ALL criteria (eleven, weights total 1.0): + (name, weight, blocker, kind, timeout). "bash" entries map to a function in + task/grader/run_grading.sh (and the hidden test file it runs); the "judge" + entry is the LLM diff review in task/grader/maintainer_review.judge.json. +- Weights are multiples of 1/16 so the float sums are exact. The four + must-pass lines total 0.5625. +- GATE_ON names the one core line (multi_enum) every real fix passes; it + gates the lines that pass on unchanged code (untouched_paths, + no_regression, the judge) so an inert diff scores 0. The other must-pass + lines feed the cap only, so incomplete fixes spread out. +- On blocker failure: one failed blocker -> min(u, 0.1 + 0.4 * u); two or + more -> min(u, 0.05 + 0.4 * u). Any run that misses a must-pass line stays + below 0.5. + +Three tasks are synced from this file, differing only in ``validate_mode``: + +- ``None`` the agent task +- ``"golden"`` grades the baked /hud/gold.diff (maintainer-only validation) +- ``"baseline"`` grades /hud/base.diff, an inert one-line comment: must score 0 +""" + +from __future__ import annotations + +import json +import os +from pathlib import Path + +from hud.graders import BashGrader, EvaluationResult, LLMJudgeGrader, SubScore, combine + +from coding import repo as repo_lib +from env import LOGS_DIR, REPO_DIR, VAULT_DIR, WORKSPACE_NOTE, env, _setup + +PROMPT = (Path(__file__).parent / "task" / "prompt.md").read_text() +GRADER = "/hud/grader/run_grading.sh" +GOLD_DIFF = Path("/hud/gold.diff") +# Baseline: an inert, non-empty diff (one comment line in the source file the +# fix touches). It goes through capture, apply and every grader like a real +# change, and must still score 0. +BASE_DIFF = Path("/hud/base.diff") +BLOCKER_CAP = 0.1 +MULTI_BLOCKER_CAP = 0.05 + +# --- ALL graders: name, weight, blocker?, kind, timeout ------------------- +# "bash" graders: name == function in run_grading.sh == hidden test it runs. + +GRADERS = [ + ("multi_enum", 0.1875, True, "bash", 600), + ("multi_empty_string", 0.125, True, "bash", 600), + ("nested_values", 0.0625, False, "bash", 600), + ("prompt_rendering", 0.125, True, "bash", 600), + ("untouched_paths", 0.125, True, "bash", 600), + ("prompt_function", 0.0625, False, "bash", 600), + ("typeback_single", 0.0625, False, "bash", 600), + ("typeback_multi", 0.0625, False, "bash", 600), + ("no_regression", 0.0625, False, "bash", 900), + ("test_quality", 0.0625, False, "bash", 600), + ("maintainer_review", 0.0625, False, "judge", 0), +] +# multi_enum is the core: an Enum member in a multi-valued default shows by +# name. The other must-pass lines are where a one-place fix falls over: the +# same rule for empty strings, the prompt, which lists choices and previews +# the default through its own code path and must render them the same way, and +# untouched_paths, where a fix that reroutes every rendering through one +# helper changes what it was told to leave alone (file defaults in the help, +# an empty-string choice). They cap the score but do not zero the rest. +# prompt_function (click.prompt called directly) and the two typeback lines +# (typing a shown default back gives the default) are graded on their own, +# with no cap, so fixes that stop at the option path spread out. +GATE_ON = ("multi_enum",) +MUST_PASS = tuple(n for n, _w, blocker, _k, _t in GRADERS if blocker) +GATED = {n for n, *_ in GRADERS if n not in GATE_ON} +assert abs(sum(w for _, w, *_ in GRADERS) - 1.0) < 1e-9, "weights must total 1.0" +assert sum(w for _, w, b, *_ in GRADERS if b) < 0.6, "must-pass total must stay under 0.6" + +_JUDGE_FILE = "maintainer_review.judge.json" +_GRADER_SRC = Path(os.environ.get("GRADER_DIR", "/hud/grader")) +if not (_GRADER_SRC / _JUDGE_FILE).is_file(): # local dev, outside the image + _GRADER_SRC = Path(__file__).parent / "task" / "grader" +JUDGE = json.loads((_GRADER_SRC / _JUDGE_FILE).read_text()) + + +# --- grading machinery -------- + + +def _slim_metadata(subscores) -> None: + """Bound subscore metadata so the grade frame stays small.""" + for score in subscores: + meta = getattr(score, "metadata", None) + if not meta: + continue + params = meta.get("_parameters") + if isinstance(params, dict): + for key in ("answer", "question"): + if key in params and isinstance(params[key], str) and len(params[key]) > 300: + params[key] = f"({key} elided; {len(params[key])} chars)" + for key in ("stdout", "stderr"): + value = meta.get(key) + if isinstance(value, str) and len(value) > 2500: + meta[key] = "..." + value[-2500:] + + +def _diff_stat(diff: str) -> dict[str, int | list[str]]: + files = [l.split(" b/", 1)[1] for l in diff.splitlines() if l.startswith("diff --git ")] + added = sum(1 for l in diff.splitlines() if l.startswith("+") and not l.startswith("+++")) + removed = sum(1 for l in diff.splitlines() if l.startswith("-") and not l.startswith("---")) + return {"files": files, "added": added, "removed": removed} + + +async def _judge_diff(name: str, weight: float, diff: str) -> SubScore: + try: + return await LLMJudgeGrader.grade( + weight, + name=name, + answer=diff[:100_000], + criteria=list(JUDGE["criteria"]), + question=JUDGE["question"], + ) + except Exception as exc: # noqa: BLE001 - judge failure must not kill grading + return SubScore( + name=name, weight=0.0, value=0.0, + metadata={"judge_error": f"{type(exc).__name__}: {exc}"[:300]}, + ) + + +async def _grade(validate_mode: str | None) -> EvaluationResult: + # Hermetic lifecycle: restore the vaulted history, capture the diff, + # reset the worktree, re-apply the diff - then grade that state. + setup_commit = await repo_lib.restore_history(REPO_DIR, VAULT_DIR) + if validate_mode == "golden": + diff = GOLD_DIFF.read_text() + elif validate_mode == "baseline": + diff = BASE_DIFF.read_text() # inert change, bug untouched + else: + diff = await repo_lib.capture_agent_diff(REPO_DIR, setup_commit) + + # An empty diff is graded like any other: every criterion runs on the + # unchanged repo, so a 0 is always a measured 0, never a skip. + await repo_lib.reset_worktree(REPO_DIR, setup_commit) + if diff.strip(): + apply_error = await repo_lib.apply_diff(REPO_DIR, diff, LOGS_DIR / "patch.diff") + if apply_error is not None: + return EvaluationResult( + reward=0.0, content="patch failed to apply", info={"git_apply": apply_error} + ) + + # One grader call per criterion, SEQUENTIAL (the bash ones share the + # runner tree). Subscore name == grader function name == hidden test. + subscores: list[SubScore] = [] + for name, weight, _blocker, kind, timeout in GRADERS: + if kind == "bash": + subscores.append( + await BashGrader.grade( + weight, + name=name, + command=f"bash {GRADER} {name}", + cwd=str(REPO_DIR), + timeout_seconds=timeout, + ) + ) + elif not diff.strip(): + # the unchanged repo has no change to review: a measured 0 + subscores.append(SubScore( + name=name, weight=weight, value=0.0, + metadata={"reason": "empty diff: the diff contains no change to review"}, + )) + else: + subscores.append(await _judge_diff(name, weight, diff)) + + _slim_metadata(subscores) + + by_name = {s.name: s for s in subscores} + gate_ok = all(by_name[n].value >= 1.0 for n in GATE_ON) + if not gate_ok: + for s in subscores: + if s.name in GATED and s.value > 0: + s.metadata = {**(s.metadata or {}), "gated": "zeroed: a gate line failed"} + s.value = 0.0 + + result = await combine(*subscores) + + judge_errors = { + s.name: s.metadata["judge_error"] + for s in subscores + if s.metadata and s.metadata.get("judge_error") + } + if judge_errors: + result.info["judge_errors"] = judge_errors + # The graded diff is recorded for reviewers alongside the trace's + # workspace view; it is what every grader ran on. + result.info["diff_stat"] = _diff_stat(diff) + result.info["graded_diff"] = diff if len(diff) <= 60_000 else diff[:60_000] + "\n... (truncated)" + + failed = sorted( + name for name, _w, blocker, _kind, _t in GRADERS + if blocker and next(s.value for s in subscores if s.name == name) < 1.0 + ) + if failed: + if len(failed) == 1: + reward = min(result.reward, BLOCKER_CAP + 0.4 * result.reward) + else: + reward = min(result.reward, MULTI_BLOCKER_CAP + 0.4 * result.reward) + return EvaluationResult( + reward=reward, + subscores=result.subscores, + info={**result.info, "uncapped_reward": result.reward, "failed_blockers": failed}, + content=( + f"Blocker criteria failed ({', '.join(failed)}); " + f"reward scaled down to {reward:.3f} (uncapped {result.reward:.3f})." + ), + ) + return result + + +@env.template( + id="ec-swe-click-help-defaults", + description=( + "click: the [default: ...] help text of a multi-valued option must " + "render every value the way a single value is rendered (Enum names, " + "quoted empty strings), at any nesting, and the prompt must list its " + "choices and default the same way." + ), +) +async def help_defaults( + description: str | None = None, + validate_mode: str | None = None, + hud_api_key: str | None = None, +): + if validate_mode not in (None, "golden", "baseline"): + raise ValueError(f"unknown validate_mode: {validate_mode!r}") + # HUD injects the launching user's default API key into this reserved + # arg at rollout; propagate it so the maintainer_review gateway judge + # can authenticate. Not passed through -e/build args/source. + if hud_api_key: + os.environ["HUD_API_KEY"] = hud_api_key + await _setup() + if validate_mode == "golden": + _ = yield "Golden-validation run: no work is expected of you. Finish immediately." + elif validate_mode == "baseline": + _ = yield "Baseline-validation run: do not change anything. Finish immediately." + else: + # The ticket is a task argument, as in the template's coding_task, so a + # prompt edit is a `hud sync tasks`, not a rebuild; the baked file is the fallback. + _ = yield f"{WORKSPACE_NOTE}\n\n{description or PROMPT}" + yield await _grade(validate_mode) + + +def _named(task, slug: str): + # A task's default slug is "