diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..f2938905 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: "pip" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 5 + groups: + python-dev-dependencies: + patterns: + - "*" + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" + open-pull-requests-limit: 3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afaec532..b3899e86 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,12 +44,24 @@ jobs: permissions: contents: read id-token: write + env: + VERSION: ${{ needs.build.outputs.version }} steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 with: name: package path: artifacts - - uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 + - id: select + run: | + count=$(python3 scripts/release-files.py "$VERSION" artifacts --pending pending) + echo "count=$count" >> "$GITHUB_OUTPUT" + - if: steps.select.outputs.count != '0' + uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2 with: - packages-dir: artifacts/ + packages-dir: pending/ attestations: true + - name: Verify both distributions on PyPI + run: python3 scripts/release-files.py "$VERSION" artifacts diff --git a/README.md b/README.md index 0a471192..cba574d8 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@ # proofline-sdk -Typed synchronous and asynchronous Python clients for the [Proofline](https://proofline.sh) -review API. They read and request reviews with a scoped API token, and add pagination, -waiting for a review, retries and typed errors. The import package is `proofline`. -Python 3.11 or newer is required. +`proofline-sdk` provides typed synchronous (`ProoflineClient`) and asynchronous (`AsyncProoflineClient`) Python clients for the [Proofline](https://proofline.sh) review API. The clients read and request reviews with a scoped API token, and include pagination, waiting for a review, retries, and typed errors. The import package is `proofline`. Python 3.11 or newer is required. + +This repository is the published distribution of the Proofline Python SDK. The public OpenAPI contract in `openapi.public.json` generates the client and models in `proofline/_generated/`. [Open an issue](https://github.com/prooflinedev/sdk-python/issues) for changes to the OpenAPI contract, generated code, or workflows. Pull requests are welcome for the hand-written client in `proofline/client.py`, transport and helpers outside `proofline/_generated/`, and tests in `tests/`. + +## Installation and authentication ```sh pip install proofline-sdk @@ -17,41 +18,67 @@ with ProoflineClient(os.environ["PROOFLINE_TOKEN"]) as client: ... ``` -The clients read `PROOFLINE_TOKEN` when no token is passed, keep the token in memory -and redact it from diagnostic output. `AsyncProoflineClient` has the same methods as -coroutines. The [SDK guide](https://proofline.sh/docs/sdks/) and -[API reference](https://proofline.sh/docs/api/) cover every operation. +When no token is passed, the clients read `PROOFLINE_TOKEN` from the environment, keep the token in memory, and redact it from diagnostic output. `AsyncProoflineClient` exposes the same methods as coroutines that you call with `await`. The [SDK guide](https://proofline.sh/docs/sdks/) and [API reference](https://proofline.sh/docs/api/) cover every operation. + +## Errors and refusals + +A refused request raises `ProoflineError` with the server problem's `status`, `type`, `title` and `detail`. When a review request creates nothing, the error also carries `refusal`, whose `reason` names the setting to change, such as `NO_LINKED_ENVIRONMENT` or `ENVIRONMENT_NOT_READY`, and `repository_name`. `RunNowRefusal` names the type of `refusal`. A refusal that does not match the public contract keeps its status, `title` and `detail` with the type `urn:proofline:sdk:invalid-response` and no `refusal`. Any other status, such as the 402 a review request answers when credits cannot pay, is a plain problem with no `refusal`. The token is redacted from every text field, and `repr` and `str` show only the status. + +```python +from proofline import ProoflineError + +try: + client.request_review(organization_id, repository_id, 12) +except ProoflineError as error: + if error.refusal is None: + raise + if error.refusal.reason == "NO_LINKED_ENVIRONMENT": + print(f"Link an environment to {error.repository_name}.") + else: + print(error.detail) +``` + +## Holding a wait to a commit + +`request_review` names a pull request, and its response names no commit: the review belongs to the head the pull request has when the request arrives. To accept a result only for the commit you hold, pass that commit to `wait_for_review`. -Licensed under the Apache License, Version 2.0. The generated models under -`proofline/_generated` carry the MIT license of the generator templates. +```python +requested = client.request_review(organization_id, repository_id, 12) +outcome = client.wait_for_review( + organization_id, + requested.review_id, + head_commit_sha=head_commit_sha, +) +if outcome.status != "COMPLETED": + print(outcome.status, outcome.reason) +``` -## Exports +`head_commit_sha` is a full SHA of 40 or 64 hexadecimal characters; any other value raises `ValueError` before a request. A review pinned to another head ends the wait on the read that names it. Its outcome is `INCOMPLETE` whatever the review's own status, its last gap has the reason code `HEAD_COMMIT_MISMATCH`, and `reason` says that the review is pinned to another head commit. A settled review that names no head has `HEAD_COMMIT_UNAVAILABLE` instead and is not `COMPLETED` either. `outcome.review.head_commit_sha` is the commit the review is pinned to. A patch review's head is a derived revision ID, so no commit matches it. In a GitHub Actions `pull_request` job, `GITHUB_SHA` is the merge commit; pass the pull request's head. -`export_reviews` reads one CSV or NDJSON page through the existing bounded transport. -It returns the original text, decoded rows, dataset version, settled horizon and -optional next cursor. CSV cells remain strings, including nested JSON cells; -NDJSON retains JSON values. Export tokens need `analytics:read`. -Repeat with the returned cursor and the same dataset, window, format and grouping. -A missing next cursor marks the last page. Each CSV page includes its own header. +## Review exports + +`export_reviews` reads one CSV or NDJSON page over the bounded transport. Export tokens require `analytics:read`. ```python from uuid import UUID with ProoflineClient() as client: page = client.export_reviews( - UUID(os.environ["PROOFLINE_ORGANIZATION_ID"]), "reviews", - from_time="2026-10-01T00:00:00Z", to_time="2026-10-25T00:00:00Z", + UUID(os.environ["PROOFLINE_ORGANIZATION_ID"]), + "reviews", + from_time="2026-10-01T00:00:00Z", + to_time="2026-10-25T00:00:00Z", format="csv", ) print(page.text, end="") # Continue with cursor=page.next_cursor when it is not None. ``` +Each response returns the original text, decoded rows, dataset version, settled horizon, and an optional next cursor. Each CSV page includes its own header and keeps cells as strings, including nested JSON cells. NDJSON pages retain JSON values. To read additional pages, repeat the call with the returned cursor and the same dataset, window, format, and grouping. A missing next cursor marks the last page. + ## Coverage uploads -Use a repository-restricted token with `coverage:write` and current repository write -access to upload reports from your CI. Name the full commit SHA the tests ran on. -Reports may use LCOV, Cobertura XML, JaCoCo XML or Go cover profiles. +To upload coverage reports from CI, use a repository-restricted token with `coverage:write` and current repository write access. Name the full commit SHA that the tests ran on. Send 1 to 50 LCOV, Cobertura XML, JaCoCo XML, or Go cover reports in a JSON body of at most 30 MiB. ```python import os @@ -65,46 +92,53 @@ with ProoflineClient() as client: UUID(os.environ["PROOFLINE_REPOSITORY_ID"]), body=CoverageUploadRequest( tested_sha=os.environ["TESTED_SHA"], - reports=[UploadedReport( - name="lcov.info", - content=Path("lcov.info").read_text(encoding="utf-8"), - )], + reports=[ + UploadedReport( + name="lcov.info", + content=Path("lcov.info").read_text(encoding="utf-8"), + ) + ], ), ) ``` -The response names the recorded report and its covered and instrumented line counts. -An identical upload returns that report with `created=False`. Refused reports raise -`ProoflineError`; uploading a report does not establish a check verdict. - -## Development +The response names the recorded report and its covered and instrumented line counts. An identical upload returns that report with `created=False`. Refused reports raise `ProoflineError`. Uploading a report does not establish a check verdict. -The repository bundles its public API contract in `openapi.public.json`. -Run `python3 scripts/check.py` to install pinned tools, regenerate the client, -run checks and verify built packages. +## MCP organization selection -## Publishing +With an MCP OAuth credential approved for several organizations, discover its currently authorized targets with `client.mcp.list_organizations()`. It returns a `KnowledgeResult`; inspect `isError` before reading `structuredContent["data"]["organizations"]`. Each entry contains `organization_id`, `github_login`, and `scopes`. -GitHub Actions runs the checks on pull requests and main. The `Release` workflow -builds checked artifacts without publishing credentials. Run it on main with -`publish=false` to verify the release path. A `vX.Y.Z` tag matching the package -version, or a main-branch dispatch with `publish=true`, publishes after the -`pypi` environment approves the job. Release commits must belong to main. +Pass the chosen UUID string as the optional keyword `organization_id` on any `knowledge` or `fixes` method: -Publishing uses GitHub OIDC and the repository's `release.yml` trusted publisher. -No registry token is stored in GitHub. +```python +organizations = client.mcp.list_organizations() +if organizations.get("isError"): + raise RuntimeError("Organization discovery was refused.") +print(organizations["structuredContent"]["data"]["organizations"]) +# Set organization_id to the UUID of the organization you intend to use. +result = client.fixes.get_fix_context(finding_id, organization_id=organization_id) +result = client.knowledge.get_wiki_page( + "owner/name", + "index", + organization_id=organization_id, +) +``` -SDK patch releases can update packaging and publishing independently. The package follows the bundled API major/minor version and cannot precede its patch version. +The async client exposes the same helpers with `await`. Selection applies only to that call, including concurrent calls on one client. A single-organization credential can omit the keyword. An ambiguous omission retains the server's `ORGANIZATION_REQUIRED` tool refusal; a foreign or revoked target retains `NOT_AUTHORIZED` and `isError`. The SDK chooses no default and never retries a tool call. Discovery and targeting use MCP only; an MCP OAuth credential cannot call the REST API. Each organization's scopes and repository restrictions still apply. ## Knowledge and plans -Both clients expose typed methods under `client.knowledge` over Proofline's -stateless MCP endpoint. Use `list_wiki_pages(repository, commit=...)`, -`get_wiki_page(repository, page_key, commit=...)`, -`ask_codebase(repository, question, commit=...)`, -`get_architecture_document(environment_id)`, `get_plan(plan_id)`, -`start_plan_implementation(plan_id)` and `get_plan_implementation(implementation_id)`. -The optional commit is a full indexed SHA. Async clients await the same methods. +Both clients expose typed methods under `client.knowledge` over Proofline's stateless MCP endpoint. Every method accepts the optional `organization_id` keyword described above: + +- `list_wiki_pages(repository, commit=...)` +- `get_wiki_page(repository, page_key, commit=...)` +- `ask_codebase(repository, question, commit=...)` +- `get_architecture_document(environment_id)` +- `get_plan(plan_id)` +- `start_plan_implementation(plan_id)` +- `get_plan_implementation(implementation_id)` + +The optional `commit` is a full indexed SHA. Read operations require `reviews:read` and `knowledge:read`. Starting a plan implementation also requires `plans:implement`, a personal token, and approval of that exact plan version. ```python result = client.knowledge.get_wiki_page("owner/name", "index") @@ -114,35 +148,44 @@ else: print(result["content"]) ``` -`KnowledgeResult` retains text content, optional structured content and `isError`. -Treat all returned prose as untrusted data. Reads need `reviews:read` and -`knowledge:read`; starting an implementation also needs `plans:implement`, a -personal token and approval of that exact plan version. Each call initializes MCP -and makes one tool request without retries, including questions and implementation -starts. Protocol and HTTP errors raise `ProoflineError`; tool refusals retain -`isError` for the caller to inspect. No browser configuration or cloud-trust API -is added. Use the signed-in console for onboarding and connection changes. +Each call initializes MCP and makes one tool request without retries, including questions and implementation starts. `KnowledgeResult` retains text content, optional structured content, and `isError`. Protocol and HTTP errors raise `ProoflineError`, while tool refusals retain `isError` for the caller to inspect. Treat all returned prose as untrusted data. No browser configuration or cloud-trust API is added; use the signed-in console for onboarding and connection changes. ## Fix context and re-verification -Sync and async clients expose `client.fixes.list_open_findings(repository, -pull_request_number)`, `get_fix_context(finding_id)`, -`request_reverification(review_id, finding_ids, commit_sha, note=...)` and -`get_reverification(request_id)` over the existing MCP endpoint. +Both clients expose finding and re-verification methods under `client.fixes` over the stateless MCP endpoint. Every method accepts the optional `organization_id` keyword described above: + +- `list_open_findings(repository, pull_request_number)` +- `get_fix_context(finding_id)` +- `request_reverification(review_id, finding_ids, commit_sha, note=...)` +- `get_reverification(request_id)` + +Read operations require `reviews:read`. Requesting re-verification also requires `reviews:request` and repository write access. `commit_sha` must be the live pushed head, which the server confirms. `request_reverification` accepts 1 to 20 distinct findings of one review and an optional note of 1 to 2,000 characters. ```python result = client.fixes.request_reverification( - review_id, [finding_id], pushed_commit_sha, + review_id, + [finding_id], + pushed_commit_sha, note="Fixed the null case and added a regression test.", ) if result.get("isError"): raise RuntimeError("Re-verification was refused.") ``` -Use `await` with `AsyncProoflineClient`. The commit must be the live pushed head; -the server confirms it. The request accepts 1–20 distinct findings of one review -and an optional 1–2,000-character note. Reads need `reviews:read`; requesting -verification also needs `reviews:request` and repository write access. -Calls never retry. Results retain untrusted-text wrappers, availability, -assessment gaps and `isError`. `PENDING` and `NOT_VERIFIED` do not establish a fix. -A tool request never records a human disposition. +Calls under `client.fixes` never retry. Results retain untrusted-text wrappers, availability, assessment gaps, and `isError`. `PENDING` and `NOT_VERIFIED` do not establish a fix, and a tool request never records a human disposition. + +## Development + +The repository bundles its public API contract in `openapi.public.json`. New public operations generate typed methods on both `ProoflineClient` and `AsyncProoflineClient` along with the code in `proofline/_generated/`. + +Run `python3 scripts/check.py` to install pinned tools, regenerate the client, run checks, and verify built packages. GitHub Actions runs the checks on pull requests and `main`. + +## Publishing + +The `Release` workflow builds checked artifacts without publishing credentials. Run it on `main` with `publish=false` to verify the release path. A `vX.Y.Z` tag matching the package version, or a `main`-branch dispatch with `publish=true`, publishes after the `pypi` environment approves the job. Release commits must belong to `main`. + +Publishing uses GitHub OIDC and the repository's `release.yml` trusted publisher. No registry token is stored in GitHub. The package follows the bundled API major and minor version and cannot precede its patch version. SDK patch releases can update packaging and publishing independently. + +## License + +Licensed under the Apache License, Version 2.0. The generated models under `proofline/_generated` carry the MIT license of the generator templates. diff --git a/openapi.public.json b/openapi.public.json index 2641819b..33ca18e5 100644 --- a/openapi.public.json +++ b/openapi.public.json @@ -22,6 +22,13 @@ "description": "The login they were known by when they acted. Display metadata.", "type": "string" }, + "name": { + "description": "Profile name resolved for this organization. Display metadata only.", + "type": [ + "string", + "null" + ] + }, "profile_url": { "description": "Their profile on the deployment's GitHub host.", "type": [ @@ -263,24 +270,6 @@ ], "type": "string" }, - "ApprovalGap": { - "properties": { - "assessment_id": { - "description": "Assessment whose approval could not supply deferred occurrence questions.", - "format": "uuid", - "type": "string" - }, - "code": { - "description": "Reason the assessment's approval could not supply deferred occurrence questions.", - "type": "string" - } - }, - "required": [ - "assessment_id", - "code" - ], - "type": "object" - }, "AssessmentProjection": { "properties": { "assessment_id": { @@ -325,111 +314,6 @@ ], "type": "object" }, - "AttributedChange": { - "description": "How one condition relates to the review's base revision.", - "oneOf": [ - { - "const": "INTRODUCED", - "description": "The proposed revision holds the condition and the base did not.", - "type": "string" - }, - { - "const": "CHANGED", - "description": "The site held a different condition at the base.", - "type": "string" - }, - { - "const": "UNCHANGED", - "description": "The base already held this condition at this site. Pre-existing,\n not safe.", - "type": "string" - }, - { - "const": "RESOLVED", - "description": "The base held this condition and the proposed revision no longer does.", - "type": "string" - }, - { - "const": "UNATTRIBUTED", - "description": "World could not match the condition with its predecessor, such as a\n declaration that may have moved; its origin is unknown.", - "type": "string" - } - ] - }, - "AttributedConditionView": { - "properties": { - "change": { - "allOf": [ - { - "$ref": "#/components/schemas/AttributedChange" - } - ], - "description": "How this condition relates to the review's base revision." - }, - "reviewed_tree_citations": { - "description": "The member that declares the site at each revision that declares it.", - "items": { - "$ref": "#/components/schemas/ReviewedTreeCitationView" - }, - "type": "array" - }, - "revision": { - "allOf": [ - { - "$ref": "#/components/schemas/AttributedRevision" - } - ], - "description": "The revision that holds the condition: the base for `RESOLVED`, the\n proposed revision for `INTRODUCED`, `CHANGED` and `UNCHANGED`, and\n either for `UNATTRIBUTED`." - }, - "subject": { - "allOf": [ - { - "$ref": "#/components/schemas/UntrustedText" - } - ], - "description": "World's label of the condition's site and what it declares, such as\n `.github/workflows/ci.yml jobs.test.steps[0].uses: actions/checkout@v4`.\n It quotes repository text." - } - }, - "required": [ - "change", - "revision", - "subject", - "reviewed_tree_citations" - ], - "type": "object" - }, - "AttributedRevision": { - "oneOf": [ - { - "const": "PROPOSED_CODE_REVISION", - "description": "The reviewed commit.", - "type": "string" - }, - { - "const": "BASE_CODE_REVISION", - "description": "Its merge base.", - "type": "string" - } - ] - }, - "AttributionStatus": { - "oneOf": [ - { - "const": "COMPARED", - "description": "World read the complete set of conditions at both revisions.", - "type": "string" - }, - { - "const": "UNAVAILABLE", - "description": "World could not read one revision's conditions, so no condition is\n called new or old.", - "type": "string" - }, - { - "const": "UNREADABLE", - "description": "The receipt carries an attribution this build cannot read. No\n condition is called new or old.", - "type": "string" - } - ] - }, "AuthorChoice": { "properties": { "id": { @@ -450,180 +334,6 @@ ], "type": "object" }, - "Authority": { - "enum": [ - "ADVISORY", - "DEPLOYMENT_POLICY" - ], - "type": "string" - }, - "Availability": { - "oneOf": [ - { - "enum": [ - "RECORDED", - "NOT_RECORDED", - "LEGACY", - "OPERATIONAL_FAILURE" - ], - "type": "string" - }, - { - "const": "LIMITED", - "description": "The record is verified but too large for this projection to carry.\n Siblings still render; nothing is inferred from the omitted detail.", - "type": "string" - } - ] - }, - "CaptureState": { - "description": "How the capture ended.", - "oneOf": [ - { - "const": "PENDING", - "description": "Still waiting for an authorized execution or a decidable look.", - "type": "string" - }, - { - "const": "RECORDED", - "description": "World recorded every deferred question.", - "type": "string" - }, - { - "const": "UNBOUND", - "description": "At least one deferred question is not bound to the execution.", - "type": "string" - }, - { - "const": "NOT_EXECUTED", - "description": "The gate never authorized the execution.", - "type": "string" - }, - { - "const": "INCOMPLETE", - "description": "The capture failed before it wrote its receipt. The gate is\n unchanged; nothing is inferred about the deferred questions.", - "type": "string" - } - ] - }, - "ChangeAttributionView": { - "description": "Which conditions behind a check's result the change brought, and which\n World found at the review's base revision. It sits beside the result and\n never changes it: a condition already at the base is still a condition.", - "properties": { - "complete_record": { - "anyOf": [ - { - "$ref": "#/components/schemas/CompleteRecordView" - }, - { - "type": "null" - } - ], - "description": "Where every condition is recorded when some are omitted. Absent when\n `conditions` lists them all." - }, - "condition_count": { - "description": "How many conditions World attributed, listed or not. Zero unless\n `status` is `COMPARED`.", - "format": "uint32", - "minimum": 0, - "type": "integer" - }, - "conditions": { - "description": "Every condition, each once, in World's order, never netted against\n another. Empty unless `status` is `COMPARED`, and empty when some are\n omitted: it never lists only some of them.", - "items": { - "$ref": "#/components/schemas/AttributedConditionView" - }, - "type": "array" - }, - "counts": { - "description": "How many conditions there are of each change at each revision, over\n every condition, listed or not. Changes with none are left out.", - "items": { - "$ref": "#/components/schemas/ChangeCountView" - }, - "type": "array" - }, - "detail_code": { - "description": "World's code for why it could not read that revision, such as\n `BASE_REVIEWED_TREE_NOT_DECLARED`. Present exactly when `status` is\n `UNAVAILABLE`.", - "type": [ - "string", - "null" - ] - }, - "listed_conditions": { - "description": "The conditions a summary lists when some are omitted: the first ones\n in the order `counts` gives, each whole, at most 50 and always fewer\n than `condition_count`. Present exactly when `omitted_condition_count`\n is not zero.", - "items": { - "$ref": "#/components/schemas/AttributedConditionView" - }, - "type": [ - "array", - "null" - ] - }, - "omitted_condition_count": { - "description": "How many of those conditions this response does not list. Zero when\n the result kept World's attribution whole. Otherwise the result kept a\n summary: `listed_conditions` lists the first ones, `counts` is still\n exact, and World's recorded evaluation holds every condition.", - "format": "uint32", - "minimum": 0, - "type": "integer" - }, - "revision": { - "anyOf": [ - { - "$ref": "#/components/schemas/AttributedRevision" - }, - { - "type": "null" - } - ], - "description": "The revision World could not read. Present exactly when `status` is\n `UNAVAILABLE`." - }, - "status": { - "allOf": [ - { - "$ref": "#/components/schemas/AttributionStatus" - } - ], - "description": "Whether World compared both revisions, could not read one, or recorded\n an attribution this build cannot read." - } - }, - "required": [ - "status", - "condition_count", - "omitted_condition_count", - "counts", - "conditions" - ], - "type": "object" - }, - "ChangeCountView": { - "description": "How many conditions are of one change at one revision.", - "properties": { - "change": { - "allOf": [ - { - "$ref": "#/components/schemas/AttributedChange" - } - ], - "description": "How the counted conditions relate to the review's base revision." - }, - "count": { - "description": "How many conditions have this `change` at this `revision`, over every\n condition, listed or not.", - "format": "uint32", - "minimum": 0, - "type": "integer" - }, - "revision": { - "allOf": [ - { - "$ref": "#/components/schemas/AttributedRevision" - } - ], - "description": "The revision that holds the counted conditions." - } - }, - "required": [ - "change", - "revision", - "count" - ], - "type": "object" - }, "ChangeDiagramKindView": { "enum": [ "FLOWCHART", @@ -763,6 +473,47 @@ ], "type": "object" }, + "CheckFile": { + "description": "One file World cited for a check's result.", + "properties": { + "path": { + "allOf": [ + { + "$ref": "#/components/schemas/UntrustedText" + } + ], + "description": "The repository-relative path. It is repository text." + }, + "revision": { + "allOf": [ + { + "$ref": "#/components/schemas/CheckFileRevision" + } + ], + "description": "The revision World read the file at." + } + }, + "required": [ + "revision", + "path" + ], + "type": "object" + }, + "CheckFileRevision": { + "description": "The revision a cited file was read at.", + "oneOf": [ + { + "const": "PROPOSED_CODE_REVISION", + "description": "The reviewed commit.", + "type": "string" + }, + { + "const": "BASE_CODE_REVISION", + "description": "Its merge base.", + "type": "string" + } + ] + }, "CheckLifecycle": { "description": "World's lifecycle disclosure for the evaluator version that answered, as\n the receipt recorded it. A deployment gate counts only `GATING` results\n (`DeterministicCoverage::gate_effective_status`), and only when it\n evaluates a deployment; the lifecycle alone permits or blocks nothing.", "oneOf": [ @@ -805,7 +556,7 @@ "type": "string" }, "CiFailureLine": { - "description": "One failed CI job as the Check states it.", + "description": "One failed CI job in the observation.", "properties": { "attribution": { "allOf": [ @@ -909,6 +660,29 @@ } ] }, + "CodeCeilingStop": { + "description": "What a code assessment had read when its head's spending ceiling stopped\n it. A rerun of the same commit runs under the same ceiling.", + "properties": { + "changed_files": { + "description": "The distinct files the reviewed change touched.", + "format": "uint", + "minimum": 0, + "type": "integer" + }, + "unfinished_paths": { + "description": "The changed files of each part of the change the ceiling stopped or\n never reached, in review order. The assessment may have read some of\n their changed lines, so this lists files it did not finish. Empty\n when the ceiling stopped it after every part was read.", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "required": [ + "changed_files", + "unfinished_paths" + ], + "type": "object" + }, "CommentAddressEvaluationView": { "description": "One stored post-merge judgment of a finding comment.", "properties": { @@ -1032,23 +806,16 @@ ], "type": "object" }, - "CompleteRecordView": { - "description": "World's immutable record of the complete answer an omitted list comes\n from.", - "properties": { - "attribution_digest": { - "description": "The `sha256:` digest of the complete attribution in that record.", - "type": "string" + "CountedCause": { + "anyOf": [ + { + "$ref": "#/components/schemas/IncompleteCause" }, - "world_evaluation_id": { - "description": "The evaluation World recorded, which holds every condition.", - "type": "string" + { + "$ref": "#/components/schemas/CreditRefusalCause" } - }, - "required": [ - "world_evaluation_id", - "attribution_digest" ], - "type": "object" + "description": "What a review is counted under: the cause its assessments recorded, or\n `OUT_OF_CREDITS` where an assessment recorded the credit refusal. An\n assessment's detail names that refusal by the rule `public_reason_codes`\n applies; no other detail is read into the summary." }, "CoverageRefused": { "description": "An upload refused for its content: a symbolic or unknown commit, or a\n report that cannot be read. Nothing is stored.", @@ -1081,7 +848,7 @@ "description": "The coverage reports a CI run produced for one commit.", "properties": { "reports": { - "description": "One to 50 reports, each LCOV, Cobertura XML, `JaCoCo` XML or a Go\n cover profile, in a JSON body of at most 64 MiB.", + "description": "One to 50 reports, each LCOV, Cobertura XML, `JaCoCo` XML or a Go\n cover profile, in a JSON body of at most 30 MiB.", "items": { "$ref": "#/components/schemas/UploadedReport" }, @@ -1144,6 +911,16 @@ ], "type": "object" }, + "CreditRefusalCause": { + "description": "The credit refusal, named apart from the `NOT_CONFIGURED` it records.", + "oneOf": [ + { + "const": "OUT_OF_CREDITS", + "description": "The organization had no credits left, so the code lane refused to\n run its model.", + "type": "string" + } + ] + }, "CustomerAssessment": { "properties": { "checks": { @@ -1162,28 +939,6 @@ "null" ] }, - "decision_presentation": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomerDecision" - }, - { - "type": "null" - } - ], - "description": "The retained decision disclosure, which grants no deployment\n authorization. Absent when none is recorded and the review kind\n records no decision basis." - }, - "declared_reach": { - "anyOf": [ - { - "$ref": "#/components/schemas/DeclaredReachView" - }, - { - "type": "null" - } - ], - "description": "What World declares depends on what this change deploys in this\n environment, at the assessment's pinned snapshot. Absent when the\n assessment's kind records no declared reach." - }, "domains": { "description": "The risk domains the assessment evaluated, each with its status and\n reason, ordered by domain.", "items": { @@ -1272,28 +1027,6 @@ "null" ] }, - "decision_presentation": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomerDecision" - }, - { - "type": "null" - } - ], - "description": "The retained decision disclosure, which grants no deployment\n authorization. Absent when none is recorded and the review kind\n records no decision basis." - }, - "declared_reach": { - "anyOf": [ - { - "$ref": "#/components/schemas/DeclaredReachView" - }, - { - "type": "null" - } - ], - "description": "What World declares depends on what this change deploys in this\n environment, at the assessment's pinned snapshot. Absent when the\n assessment's kind records no declared reach." - }, "domains": { "description": "The risk domains the assessment evaluated, each with its status and\n reason, ordered by domain.", "items": { @@ -1380,17 +1113,6 @@ }, "CustomerCheck": { "properties": { - "change_attribution": { - "anyOf": [ - { - "$ref": "#/components/schemas/ChangeAttributionView" - }, - { - "type": "null" - } - ], - "description": "Which conditions behind the outcome the change brought and which were\n already at the review's base revision. It never changes the outcome:\n a condition already at the base is pre-existing, not safe. Absent for\n a check whose evaluator does not compare the two revisions." - }, "detail": { "description": "Why World refused the check, or otherwise World's recorded explanation\n of the result. Null when neither is recorded.", "type": [ @@ -1405,6 +1127,13 @@ "null" ] }, + "files": { + "description": "The files World cited as evidence for this result, once each in\n World's order, with the revision World read each at. Empty when World\n cited no file, and on results recorded before World cited files.", + "items": { + "$ref": "#/components/schemas/CheckFile" + }, + "type": "array" + }, "lifecycle": { "allOf": [ { @@ -1436,7 +1165,8 @@ "required": [ "name", "outcome", - "lifecycle" + "lifecycle", + "files" ], "type": "object" }, @@ -1472,6 +1202,17 @@ "description": "The base commit the code assessment compared the head with.", "type": "string" }, + "ceiling_stop": { + "anyOf": [ + { + "$ref": "#/components/schemas/CodeCeilingStop" + }, + { + "type": "null" + } + ], + "description": "How much of the change the code assessment read before its head's\n spending ceiling stopped it. Null for every other ending, and for an\n assessment that recorded no change map." + }, "completed_at": { "description": "When the code assessment ended. Null while it has not.", "format": "date-time", @@ -1480,6 +1221,13 @@ "null" ] }, + "coverage_details": { + "description": "Recorded check coverage counts and fixed cancellation causes, without source text.\n Absent coverage does not establish that every check ran.", + "items": { + "type": "string" + }, + "type": "array" + }, "findings": { "description": "The code-only findings the code assessment recorded, `SERIOUS` first.\n An empty list does not establish deployment safety.", "items": { @@ -1503,6 +1251,16 @@ "null" ] }, + "reason_codes": { + "description": "Public causes of an `INCOMPLETE` code assessment: `OUT_OF_CREDITS`\n when credits refused its model, and `MODEL_ANSWER_WITHHELD` when the\n credential mask withheld its model's answer after the source was read.\n Absent otherwise; other recorded details stay private.", + "items": { + "type": "string" + }, + "type": [ + "array", + "null" + ] + }, "started_at": { "description": "When the code assessment started. Null until it starts.", "format": "date-time", @@ -1529,83 +1287,6 @@ ], "type": "object" }, - "CustomerDecision": { - "properties": { - "authority": { - "allOf": [ - { - "$ref": "#/components/schemas/Authority" - } - ], - "description": "Whether the decision is `ADVISORY` or comes from a `DEPLOYMENT_POLICY`." - }, - "availability": { - "allOf": [ - { - "$ref": "#/components/schemas/Availability" - } - ], - "description": "Whether a verified decision record is present, absent, legacy, failed,\n or too large for this projection." - }, - "basis": { - "anyOf": [ - { - "$ref": "#/components/schemas/CustomerDecisionBasis" - }, - { - "type": "null" - } - ], - "description": "The permission, evidence classification and reason code of the\n verified recorded basis. Null when no verified basis is recorded." - }, - "gate_state": { - "anyOf": [ - { - "$ref": "#/components/schemas/GateState" - }, - { - "type": "null" - } - ], - "description": "The local deployment gate state and any recorded override. Null unless\n the decision belongs to a deployment gate." - } - }, - "required": [ - "availability", - "authority" - ], - "type": "object" - }, - "CustomerDecisionBasis": { - "properties": { - "evidence": { - "allOf": [ - { - "$ref": "#/components/schemas/EvidenceView" - } - ], - "description": "How the recorded basis classified its evidence." - }, - "permission": { - "allOf": [ - { - "$ref": "#/components/schemas/PermissionView" - } - ], - "description": "The permission the recorded basis reached: `PERMIT` or `BLOCK`." - }, - "reason_code": { - "description": "The reason code the recorded basis gives for its permission.", - "type": "string" - } - }, - "required": [ - "permission", - "evidence", - "reason_code" - ], - "type": "object" - }, "CustomerEvidenceRef": { "properties": { "commit_sha": { @@ -1903,6 +1584,13 @@ "null" ] }, + "actor_name": { + "description": "The actor's GitHub profile name, when known. Lead with it; the login\n is the fallback. Null for the automatic decision.", + "type": [ + "string", + "null" + ] + }, "covering_author_kind": { "description": "For `ALREADY_COVERED`, `HUMAN` or `BOT`. Null for every other decision.", "type": [ @@ -2058,6 +1746,21 @@ "null" ] }, + "cost_microcredits": { + "description": "The credits this run was charged so far, in microcredits, whoever\n paid: the plan, the free review month or the organization's credits.\n Null for a caller who is not a member of the organization.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "counted_incomplete_causes": { + "description": "`incomplete_causes` as the Inbox and the reviews `cause:` search\n count them: `OUT_OF_CREDITS` in place of the `NOT_CONFIGURED` an\n assessment records when credits refused it. Present exactly when\n `incomplete_causes` is.", + "items": { + "$ref": "#/components/schemas/CountedCause" + }, + "type": "array" + }, "created_at": { "description": "When the review was created.", "format": "date-time", @@ -2099,6 +1802,13 @@ }, "type": "array" }, + "environments": { + "description": "For a pull-request review, each environment its repository linked\n when the review was created and each environment it assessed, with\n whether the review checked it and why not. Absent for any other\n review, and when the repository links no environment.", + "items": { + "$ref": "#/components/schemas/EnvironmentCheck" + }, + "type": "array" + }, "finding_count": { "description": "How many findings this review's assessments recorded, across all of them.", "format": "int64", @@ -2134,12 +1844,26 @@ "format": "uuid", "type": "string" }, + "incomplete_causes": { + "description": "Why an `INCOMPLETE` review ended incomplete, as its incomplete\n assessments recorded it, in name order. `UNKNOWN` alone when none\n recorded a cause. Absent for every other status, and on reads other\n than the reviews list and a single review.", + "items": { + "$ref": "#/components/schemas/IncompleteCause" + }, + "type": "array" + }, + "investigation_findings": { + "description": "The supported findings of each environment investigation this review\n published, by assessment in recorded order, including those the\n pull-request Check left off its list. Absent when there are none.", + "items": { + "$ref": "#/components/schemas/ReviewInvestigationFinding" + }, + "type": "array" + }, "is_deep_review": { "description": "Present and true when this run is a Deep Review.", "type": "boolean" }, "kind": { - "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, or `FILES`,\n complete selected files at one pushed commit.", + "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests, or\n `REVISION_SCAN`, a scan of one captured commit.", "type": "string" }, "local_reverifications": { @@ -2160,6 +1884,14 @@ ], "description": "The deterministic policy for this exact repository/head, when opted in.\n Its captured review owner and GitHub bypass remain separate history." }, + "merge_group_pull_request_numbers": { + "description": "For a `MERGE_GROUP` review, the pull requests GitHub queued in the\n group, in number order. Absent for every other kind, and until\n Proofline has read the group's members.", + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" + }, "open_items": { "anyOf": [ { @@ -2182,6 +1914,17 @@ ], "description": "Dated PR counts with head, evaluated-scope and bounded thread proof.\n Absent when that observation is unavailable; scalar counts remain separate." }, + "provider_wait": { + "anyOf": [ + { + "$ref": "#/components/schemas/ProviderWait" + }, + { + "type": "null" + } + ], + "description": "What holds the review now: GitHub's rate limit, and when it resets.\n Null unless one of the review's runs waits for it, and once the run\n continues." + }, "public_key": { "description": "The review's stable public address: `rev_` followed by its identifier without hyphens.", "type": "string" @@ -2219,6 +1962,13 @@ "null" ] }, + "pull_request_author_name": { + "description": "The author's GitHub profile name, when known. Lead with it; the login\n is the fallback. Display metadata, never identity.", + "type": [ + "string", + "null" + ] + }, "pull_request_author_url": { "description": "The author's profile on the deployment's GitHub host. Absent when no author login is known.", "type": [ @@ -2311,7 +2061,7 @@ "type": "null" } ], - "description": "Who asked for this review, for a review a person requested. Null on\n automatic reviews and on reviews recorded before requesters were." + "description": "Who asked for this review, for the reviews a person asked for: the\n run-now button, a rerun, a pull request `review` command, or local\n changes and pushed commits sent from the CLI or an editor. Absent on\n automatic reviews, and on reviews recorded before requesters were." }, "review_comment_url": { "description": "The pull request review Proofline submitted for this review. Null when\n it submitted none.", @@ -2336,6 +2086,17 @@ "null" ] }, + "run_progress": { + "anyOf": [ + { + "$ref": "#/components/schemas/RunProgress" + }, + { + "type": "null" + } + ], + "description": "Where an unfinished review's runs stand: running, queued for a worker,\n waiting for a scheduled step, or due again after an attempt that did\n not finish. Null once the review has ended." + }, "status": { "description": "The review's lifecycle status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`, `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "type": "string" @@ -2441,79 +2202,6 @@ ], "type": "string" }, - "DeclaredReachOutcome": { - "enum": [ - "READ", - "NO_ROOTS", - "ROOTS_UNKNOWN", - "UNAVAILABLE" - ], - "type": "string" - }, - "DeclaredReachView": { - "description": "One assessment's declared reach receipt. A reached entity declares a\n dependency on what the change deploys; it is never a claim that the change\n breaks it.", - "properties": { - "complete": { - "description": "Whether World's walk ended with no gap. An empty, incomplete reach\n says nothing about what depends on the change.", - "type": "boolean" - }, - "entities": { - "description": "Every reached entity, shorter paths first, then by kind.", - "items": { - "$ref": "#/components/schemas/ReachedEntityView" - }, - "type": "array" - }, - "gaps": { - "description": "Where World's walk or its evidence stopped.", - "items": { - "$ref": "#/components/schemas/ReachGapView" - }, - "type": "array" - }, - "outcome": { - "allOf": [ - { - "$ref": "#/components/schemas/DeclaredReachOutcome" - } - ], - "description": "`READ` when World answered, `NO_ROOTS` when no evidence bound a\n deployed artifact or workload to the repository, `ROOTS_UNKNOWN` when\n World's evidence does not establish which revision runs, and\n `UNAVAILABLE` when World gave no answer. Only `READ` carries entities or gaps." - }, - "receipt_digest": { - "description": "World's digest of its full answer. Null unless `READ`.", - "type": [ - "string", - "null" - ] - }, - "snapshot_id": { - "description": "The World snapshot the reach was read at. Null unless `READ`.", - "format": "uuid", - "type": [ - "string", - "null" - ] - }, - "terraform": { - "anyOf": [ - { - "$ref": "#/components/schemas/TerraformRootsView" - }, - { - "type": "null" - } - ], - "description": "The Terraform addresses the reach also started from, or why it took\n none. Absent when the assessment read reach only from the deployed\n revision." - } - }, - "required": [ - "outcome", - "complete", - "entities", - "gaps" - ], - "type": "object" - }, "DeepReviewEscalation": { "properties": { "reason": { @@ -2603,13 +2291,91 @@ ], "type": "object" }, - "EvidenceView": { - "enum": [ - "REQUIRED_PROPERTIES_ESTABLISHED", - "INCOMPLETE", - "NO_APPLICABLE_OBLIGATIONS" + "EnvironmentCheck": { + "description": "One environment linked to the reviewed repository, and whether this\n review checked it.", + "properties": { + "environment_display_name": { + "description": "The environment's display name.", + "type": "string" + }, + "reason": { + "anyOf": [ + { + "$ref": "#/components/schemas/EnvironmentCheckReason" + }, + { + "type": "null" + } + ], + "description": "Why the environment was not checked or does not apply. Null when it\n was checked or its check is still running." + }, + "state": { + "allOf": [ + { + "$ref": "#/components/schemas/EnvironmentCheckState" + } + ], + "description": "Whether this review checked the environment." + } + }, + "required": [ + "environment_display_name", + "state" ], - "type": "string" + "type": "object" + }, + "EnvironmentCheckReason": { + "oneOf": [ + { + "const": "NOT_COVERED", + "description": "`NOT_CHECKED`: Proofline does not check this environment for pull\n requests, so the review assessed its code only.", + "type": "string" + }, + { + "const": "FORK_PULL_REQUEST", + "description": "`NOT_CHECKED`: the pull request comes from a fork, which Proofline\n does not check against an environment.", + "type": "string" + }, + { + "const": "UNFINISHED", + "description": "`NOT_CHECKED`: the environment's assessment did not finish.", + "type": "string" + }, + { + "const": "ENDED", + "description": "`NOT_CHECKED`: the review or the assessment stopped before the\n environment was checked.", + "type": "string" + }, + { + "const": "PULL_REQUEST_REVIEWS_OFF", + "description": "`NOT_APPLICABLE`: pull request reviews are off on this repository's\n link to the environment.", + "type": "string" + } + ] + }, + "EnvironmentCheckState": { + "oneOf": [ + { + "const": "CHECKED", + "description": "The environment's assessment finished.", + "type": "string" + }, + { + "const": "CHECKING", + "description": "The environment's assessment is still running.", + "type": "string" + }, + { + "const": "NOT_CHECKED", + "description": "The review did not check the environment; `reason` says why.", + "type": "string" + }, + { + "const": "NOT_APPLICABLE", + "description": "The repository's link to the environment does not ask for pull\n request reviews; `reason` says so.", + "type": "string" + } + ] }, "ExportEvidenceKind": { "enum": [ @@ -2668,7 +2434,9 @@ "DEPLOYMENT", "PATCH", "COMMIT", - "FILES" + "FILES", + "MERGE_GROUP", + "REVISION_SCAN" ], "type": "string" }, @@ -3105,7 +2873,7 @@ "description": "The dimension that defines this row's group." }, "key": { - "description": "The grouping value: a repository or environment ID, a risk domain, a severity or a\n review kind, as `group_by` selects.", + "description": "The grouping value: a repository or environment ID, a risk domain, a severity or a\n review kind, as `group_by` selects. Grouped by environment, code-lane findings, which\n belong to no environment, share the key `code_review`.", "type": "string" }, "limitations": { @@ -3116,7 +2884,7 @@ "type": "array" }, "name": { - "description": "The group's display name: the repository's full name (or `Repository` and its ID when\n no name is recorded), the environment's display name, or otherwise `key`.", + "description": "The group's display name: the repository's full name (or `Repository` and its ID when\n no name is recorded), the environment's display name (`Code review` for the code-lane\n group), or otherwise `key`.", "type": "string" }, "organization_id": { @@ -3693,37 +3461,6 @@ ], "type": "object" }, - "GateState": { - "properties": { - "occurrence_captures": { - "description": "The occurrence questions the gate's approval deferred, as each\n observed execution of its deployment answered them. Outcome-only\n records: none of them changes the gate or grades a prediction.", - "items": { - "$ref": "#/components/schemas/OccurrenceCapture" - }, - "type": "array" - }, - "override_record": { - "anyOf": [ - { - "$ref": "#/components/schemas/Override" - }, - { - "type": "null" - } - ], - "description": "Recorded override authorization, not confirmation of provider delivery." - }, - "status": { - "description": "Local gate state. ALLOWED/BLOCKED can precede provider delivery.\n This field does not confirm that GitHub released or blocked a run.", - "type": "string" - } - }, - "required": [ - "status", - "occurrence_captures" - ], - "type": "object" - }, "GateStatus": { "enum": [ "REQUESTED", @@ -3735,6 +3472,26 @@ ], "type": "string" }, + "IncompleteCause": { + "description": "Why an assessment of the review ended incomplete, as the assessment\n recorded it (`incompleteness_kind`), or `UNKNOWN` when none did.", + "oneOf": [ + { + "enum": [ + "NOT_CONFIGURED", + "POLICY_EXCLUDED", + "EVIDENCE_UNAVAILABLE", + "HYPOTHESES_UNRESOLVED", + "MODEL_BUDGET_EXHAUSTED" + ], + "type": "string" + }, + { + "const": "UNKNOWN", + "description": "The review ended incomplete and no assessment recorded why.", + "type": "string" + } + ] + }, "LocalReverification": { "description": "One finding a patch review re-verified against the patch. The outcome is\n local: the pull request's finding is unchanged whatever it is.", "properties": { @@ -3802,126 +3559,24 @@ "finding_id", "created_at" ], - "type": "object" - }, - "NotAssessedView": { - "properties": { - "environment_display_name": { - "description": "The display name of the environment whose assessment is not\n `COMPLETED`.", - "type": "string" - }, - "incompleteness_kind": { - "description": "The assessment's recorded gap class. Absent is an unclassified gap,\n never a complete assessment.", - "type": [ - "string", - "null" - ] - } - }, - "required": [ - "environment_display_name" - ], - "type": "object" - }, - "OccurrenceCapture": { - "description": "The capture of one observed execution of a gate's deployment.", - "properties": { - "approval_gaps": { - "description": "Assessments whose approval could defer nothing, with the reason.", - "items": { - "$ref": "#/components/schemas/ApprovalGap" - }, - "type": "array" - }, - "detail": { - "description": "Explanation of the capture's outcome, when available.", - "type": [ - "string", - "null" - ] - }, - "occurrence_key": { - "description": "Retained identity of the deployment occurrence, when available.", - "type": [ - "string", - "null" - ] - }, - "questions": { - "description": "Deferred questions and their binding or observed results for this occurrence.", - "items": { - "$ref": "#/components/schemas/OccurrenceQuestion" - }, - "type": "array" - }, - "state": { - "allOf": [ - { - "$ref": "#/components/schemas/CaptureState" - } - ], - "description": "Whether the capture is pending, recorded, unbound, not executed, or incomplete." - } - }, - "required": [ - "state", - "approval_gaps", - "questions" - ], - "type": "object" - }, - "OccurrenceQuestion": { - "description": "One deferred question as the gate presents it.", - "properties": { - "assessment_id": { - "description": "Assessment whose approval deferred this question.", - "format": "uuid", - "type": "string" - }, - "code": { - "description": "World's binding or refusal code, or the control plane's own gap.", - "type": [ - "string", - "null" - ] - }, - "family_key": { - "description": "Hypothesis family key for the deferred question.", - "type": "string" - }, - "family_version": { - "description": "Hypothesis family version for the deferred question.", - "format": "int32", - "type": "integer" - }, - "observed_result": { - "description": "World's observed result once it recorded the question.", - "type": [ - "string", - "null" - ] + "type": "object" + }, + "NotAssessedView": { + "properties": { + "environment_display_name": { + "description": "The display name of the environment whose assessment is not\n `COMPLETED`.", + "type": "string" }, - "outcome_id": { - "description": "World outcome record identifier, when an observed result was recorded.", + "incompleteness_kind": { + "description": "The assessment's recorded gap class. Absent is an unclassified gap,\n never a complete assessment.", "type": [ "string", "null" ] - }, - "state": { - "allOf": [ - { - "$ref": "#/components/schemas/QuestionState" - } - ], - "description": "Whether the question is pending, recorded, unbound, or not executed." } }, "required": [ - "assessment_id", - "family_key", - "family_version", - "state" + "environment_display_name" ], "type": "object" }, @@ -4130,37 +3785,6 @@ ], "type": "string" }, - "Override": { - "properties": { - "comment": { - "description": "The comment recorded with the approval, truncated past 8000\n characters.", - "type": [ - "string", - "null" - ] - }, - "github_environment_id": { - "description": "The GitHub environment ID the approval applied to.", - "format": "int64", - "type": "integer" - }, - "github_user_id": { - "description": "The GitHub user ID of the person whose GitHub deployment approval\n overrode the gate.", - "format": "int64", - "type": "integer" - }, - "github_user_login": { - "description": "That person's GitHub login as recorded with the approval, a display\n label truncated past 128 characters.", - "type": "string" - } - }, - "required": [ - "github_user_id", - "github_user_login", - "github_environment_id" - ], - "type": "object" - }, "PassProjection": { "properties": { "model_binding": { @@ -4278,13 +3902,6 @@ ], "type": "object" }, - "PermissionView": { - "enum": [ - "PERMIT", - "BLOCK" - ], - "type": "string" - }, "PlanProjection": { "properties": { "assessments": { @@ -4436,6 +4053,36 @@ } ] }, + "ProviderWait": { + "description": "A provider wait that holds the review now.", + "properties": { + "reason": { + "allOf": [ + { + "$ref": "#/components/schemas/ProviderWaitReason" + } + ], + "description": "`GITHUB_RATE_LIMIT`: GitHub's rate limit for the organization's App\n installation is reached, and the review continues after it resets." + }, + "until": { + "description": "When the wait ends: the reset GitHub named, or, when it named none,\n when the run is due again.", + "format": "date-time", + "type": "string" + } + }, + "required": [ + "reason", + "until" + ], + "type": "object" + }, + "ProviderWaitReason": { + "description": "Why a review's run waits on a provider.", + "enum": [ + "GITHUB_RATE_LIMIT" + ], + "type": "string" + }, "PullRequestMergeGate": { "properties": { "assessment_count": { @@ -4516,6 +4163,20 @@ "null" ] }, + "merged_by_login": { + "description": "The merger's GitHub login as this organization's developer record last saw it. Display\n metadata only. Null when the organization has no record of that user.", + "type": [ + "string", + "null" + ] + }, + "merged_by_name": { + "description": "The merger's name, from the organization's developer record or their Proofline account.\n Display metadata only: `merged_by_github_user_id` stays the identity. Null when unknown.", + "type": [ + "string", + "null" + ] + }, "merged_pull_request_number": { "description": "The actual pull request merged in the recorded bypass, which may differ from the captured PR.", "format": "int64", @@ -4541,7 +4202,7 @@ ] }, "review_id": { - "description": "The first review captured for this gate. Null when its trigger was refused before a review existed.", + "description": "The review the gate decides from: the first review captured, or the one retry that replaced a review that could not finish. Null when its trigger was refused before a review existed.", "format": "uuid", "type": [ "string", @@ -4567,105 +4228,6 @@ ], "type": "object" }, - "QuestionState": { - "description": "Where one deferred question stands.", - "oneOf": [ - { - "const": "PENDING", - "description": "World has stored no record yet: the execution is not yet decidable\n inside the question's window.", - "type": "string" - }, - { - "const": "RECORDED", - "description": "World recorded what the execution was observed to do.", - "type": "string" - }, - { - "const": "UNBOUND", - "description": "The question is not bound to the execution: World's binding code, its\n refusal of the replay, or the control plane's own gap says why.", - "type": "string" - }, - { - "const": "NOT_EXECUTED", - "description": "The gate never authorized the execution, so nothing ran to observe.", - "type": "string" - } - ] - }, - "ReachGapView": { - "properties": { - "code": { - "description": "`COVERAGE_INCOMPLETE`, `SOURCE_CAPABILITY_MISSING` or `BOUND_REACHED`.", - "type": "string" - } - }, - "required": [ - "code" - ], - "type": "object" - }, - "ReachStepView": { - "properties": { - "assertion_id": { - "description": "The World relation assertion behind this step.", - "format": "uuid", - "type": "string" - }, - "direction": { - "description": "`OUT` when the step follows the relation from its subject, `IN` when\n it follows it back to the subject.", - "type": "string" - }, - "relation": { - "description": "The relation key, such as `proofline.relation.consumes_api`.", - "type": "string" - } - }, - "required": [ - "assertion_id", - "relation", - "direction" - ], - "type": "object" - }, - "ReachedEntityView": { - "properties": { - "entity_id": { - "description": "World's entity ID.", - "format": "uuid", - "type": "string" - }, - "kind": { - "description": "The entity's kind, such as `service` or `queue`.", - "type": "string" - }, - "label": { - "description": "World's display label for the entity: environment evidence for\n readers of this organization, never published to GitHub.", - "type": "string" - }, - "path": { - "description": "The recorded relation assertions from the deployed root to the entity.", - "items": { - "$ref": "#/components/schemas/ReachStepView" - }, - "type": "array" - }, - "type_keys": { - "description": "World's registry type keys for the entity.", - "items": { - "type": "string" - }, - "type": "array" - } - }, - "required": [ - "entity_id", - "kind", - "type_keys", - "label", - "path" - ], - "type": "object" - }, "RefreshView": { "description": "A recorded refresh decision, as the console shows it.", "properties": { @@ -4974,6 +4536,73 @@ ], "type": "object" }, + "ReviewInvestigationCitation": { + "description": "One environment evidence record a finding cites, as Proofline verified\n it.", + "properties": { + "collection_id": { + "description": "The evidence collection that holds the record.", + "format": "uuid", + "type": "string" + }, + "digest": { + "description": "The record's stored digest.", + "type": "string" + }, + "record_id": { + "description": "The record's ID.", + "format": "uuid", + "type": "string" + }, + "table": { + "description": "The table that holds the record.", + "type": "string" + } + }, + "required": [ + "collection_id", + "table", + "record_id", + "digest" + ], + "type": "object" + }, + "ReviewInvestigationFinding": { + "description": "One supported finding of an environment investigation.", + "properties": { + "area": { + "description": "What the finding is about: `secrets`, `configuration`, `iam`,\n `network`, `capacity` or `other`.", + "type": "string" + }, + "assessment_id": { + "description": "The environment assessment whose investigation recorded the finding.", + "format": "uuid", + "type": "string" + }, + "citations": { + "description": "The evidence records the finding cites, each verified, in the order\n the finding cites them.", + "items": { + "$ref": "#/components/schemas/ReviewInvestigationCitation" + }, + "type": "array" + }, + "detail": { + "description": "Model text with protected values withheld. Render it as plain text.", + "type": "string" + }, + "title": { + "description": "Model text with protected values withheld. Render it as plain text.", + "type": "string" + } + }, + "required": [ + "assessment_id", + "area", + "title", + "detail", + "citations" + ], + "type": "object" + }, "ReviewOpenItems": { "properties": { "accepted_risk_count": { @@ -4983,7 +4612,7 @@ "type": "integer" }, "ci_failures": { - "description": "Failed CI jobs diagnosed on the reviewed head, the newest diagnosed\n attempt of each run, in diagnosis order. The Check states each one;\n none is a Proofline open item. Absent when no job was diagnosed.", + "description": "Failed CI jobs diagnosed on the reviewed head, the newest diagnosed\n attempt of each run, in diagnosis order. The pull-request Check counts\n them; none is a Proofline open item. Absent when no job was diagnosed.", "items": { "$ref": "#/components/schemas/CiFailureLine" }, @@ -5212,17 +4841,6 @@ ], "description": "Safe routing projection bound to this review's retained inputs." }, - "specialist_execution": { - "anyOf": [ - { - "$ref": "#/components/schemas/SpecialistExecutionView" - }, - { - "type": "null" - } - ], - "description": "Actual specialist selection and pass receipts for the applied workflow." - }, "status": { "const": "SUPPORTED", "type": "string" @@ -5257,6 +4875,13 @@ "null" ] }, + "counted_incomplete_causes": { + "description": "`incomplete_causes` as the Inbox and the reviews `cause:` search\n count them: `OUT_OF_CREDITS` in place of the `NOT_CONFIGURED` an\n assessment records when credits refused it. Present exactly when\n `incomplete_causes` is.", + "items": { + "$ref": "#/components/schemas/CountedCause" + }, + "type": "array" + }, "created_at": { "description": "When the review was created.", "format": "date-time", @@ -5300,10 +4925,25 @@ "format": "uuid", "type": "string" }, + "incomplete_causes": { + "description": "Why an `INCOMPLETE` review ended incomplete, as its incomplete\n assessments recorded it, in name order. `UNKNOWN` alone when none\n recorded a cause. Absent for every other status, and on reads other\n than the reviews list and a single review.", + "items": { + "$ref": "#/components/schemas/IncompleteCause" + }, + "type": "array" + }, "kind": { - "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, or `FILES`,\n complete selected files at one pushed commit.", + "description": "`PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes\n sent as a patch, `COMMIT`, a review of pushed commits, `FILES`,\n complete selected files at one pushed commit, `MERGE_GROUP`, the\n commit GitHub's merge queue built for a group of pull requests, or\n `REVISION_SCAN`, a scan of one captured commit.", "type": "string" }, + "merge_group_pull_request_numbers": { + "description": "For a `MERGE_GROUP` review, the pull requests GitHub queued in the\n group, in number order. Absent for every other kind, and until\n Proofline has read the group's members.", + "items": { + "format": "int64", + "type": "integer" + }, + "type": "array" + }, "public_key": { "description": "The review's stable public address: `rev_` followed by its identifier without hyphens.", "type": "string" @@ -5341,6 +4981,13 @@ "null" ] }, + "pull_request_author_name": { + "description": "The author's GitHub profile name, when known. Lead with it; the login\n is the fallback. Display metadata, never identity.", + "type": [ + "string", + "null" + ] + }, "pull_request_author_url": { "description": "The author's profile on the deployment's GitHub host. Absent when no author login is known.", "type": [ @@ -5417,73 +5064,45 @@ "null" ] }, - "run_number": { - "description": "One-based, append-only ordinal within one repository pull request.", - "format": "int64", - "type": [ - "integer", - "null" - ] - }, - "status": { - "description": "The review's lifecycle status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`, `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", - "type": "string" - }, - "trigger_origin": { - "description": "Who asked for this review: `AUTOMATIC`, `COMMAND`, `RERUN`, `MANUAL`,\n or `UNKNOWN` for a trigger key this build does not recognise.", - "type": "string" - } - }, - "required": [ - "id", - "public_key", - "kind", - "status", - "assessment_count", - "environment_display_names", - "finding_count", - "trigger_origin", - "publication", - "created_at" - ], - "type": "object" - }, - "ReviewedTreeCitationView": { - "description": "One member of a review's declared tree that World cited.", - "properties": { - "content_sha256": { - "description": "The member's content hash. Absent for a member a `REJECTED`\n population refused, because such a population keeps no members.", - "type": [ - "string", - "null" - ] - }, - "overlay_digest": { - "description": "The overlay World read the member from.", - "type": "string" - }, - "path": { - "allOf": [ + "requested_by": { + "anyOf": [ { - "$ref": "#/components/schemas/UntrustedText" + "$ref": "#/components/schemas/ActorView" + }, + { + "type": "null" } ], - "description": "The member's path in the repository at that revision. Repository\n text, so it can hold bidirectional controls that reorder what the\n reader sees." + "description": "Who asked for this review, for the reviews a person asked for: the\n run-now button, a rerun, a pull request `review` command, or local\n changes and pushed commits sent from the CLI or an editor. Absent on\n automatic reviews, and on reviews recorded before requesters were." }, - "population_kind": { - "description": "The population the member belongs to, such as\n `WORKFLOW_DEFINITIONS`.", + "run_number": { + "description": "One-based, append-only ordinal within one repository pull request.", + "format": "int64", + "type": [ + "integer", + "null" + ] + }, + "status": { + "description": "The review's lifecycle status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`, `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "type": "string" }, - "role": { - "description": "`PROPOSED_CODE_REVISION` (the reviewed commit) or\n `BASE_CODE_REVISION` (its merge base).", + "trigger_origin": { + "description": "Who asked for this review: `AUTOMATIC`, `COMMAND`, `RERUN`, `MANUAL`,\n or `UNKNOWN` for a trigger key this build does not recognise.", "type": "string" } }, "required": [ - "role", - "population_kind", - "path", - "overlay_digest" + "id", + "public_key", + "kind", + "status", + "assessment_count", + "environment_display_names", + "finding_count", + "trigger_origin", + "publication", + "created_at" ], "type": "object" }, @@ -5538,7 +5157,7 @@ "$ref": "#/components/schemas/ExportReviewKind" } ], - "description": "Whether the review analyzes a pull request, a deployment, a local patch, pushed\n commits or selected whole files." + "description": "Whether the review analyzes a pull request, a deployment, a local patch, pushed\n commits, selected whole files, a merge group or a revision scan." }, "organization_id": { "description": "The organization that owns the review.", @@ -5656,6 +5275,14 @@ ], "description": "Human override beside the original decision, when one was requested." }, + "publication_group": { + "description": "The finding that represents this finding's publication group, when an\n applied group publishes it in one comment with other findings. Every\n member names the same finding, the representative included.", + "format": "uuid", + "type": [ + "string", + "null" + ] + }, "reason_codes": { "description": "Recognized safe reason codes; unknown values are represented as `UNRECOGNIZED`.", "items": { @@ -5689,8 +5316,7 @@ "description": "Whether an explicit request may reuse a settled review of the live head.", "enum": [ "EXISTING_OR_NEW", - "FULL", - "EXTENDED" + "FULL" ], "type": "string" }, @@ -5858,36 +5484,6 @@ "reason" ], "type": "object" - }, - { - "description": "Deep review policy, funding or worker availability prevents admission.", - "properties": { - "detail": { - "type": "string" - }, - "reason": { - "const": "DEEP_REVIEW_UNAVAILABLE", - "type": "string" - } - }, - "required": [ - "reason", - "detail" - ], - "type": "object" - }, - { - "description": "The existing review already retains a different focus.", - "properties": { - "reason": { - "const": "DEEP_REVIEW_FOCUS_CONFLICT", - "type": "string" - } - }, - "required": [ - "reason" - ], - "type": "object" } ] }, @@ -5935,20 +5531,13 @@ "additionalProperties": false, "description": "An empty body keeps the run-now behavior existing clients request.", "properties": { - "focus_text": { - "description": "Optional investigation focus for EXTENDED, trimmed and frozen at admission.\n Limited to 500 UTF-16 code units.", - "type": [ - "string", - "null" - ] - }, "mode": { "allOf": [ { "$ref": "#/components/schemas/RunNowMode" } ], - "description": "`EXISTING_OR_NEW`, the default, returns any review that already owns the live head.\n `FULL` returns a pending or running review of that head or starts a new one.\n `EXTENDED` admits one funded Deep Review for that head, with optional focus." + "description": "`EXISTING_OR_NEW`, the default, returns any review that already owns the live head.\n `FULL` returns a pending or running review of that head or starts a new one." } }, "type": "object" @@ -5983,105 +5572,129 @@ ], "type": "object" }, - "SpecialistAssessmentExecution": { + "RunProgress": { + "description": "Where an unfinished review's runs stand.", "properties": { - "assessment_id": { - "description": "The immutable assessment whose specialist execution is reported.", - "format": "uuid", - "type": "string" + "attempts": { + "description": "Attempts begun by the run in `state`, counting worker claims.", + "format": "int32", + "type": "integer" }, - "passes": { - "description": "Selected specialist passes and their retained execution outputs.", - "items": { - "$ref": "#/components/schemas/SpecialistPassExecution" - }, - "type": "array" + "due_at": { + "description": "When the run in `state` is due: in the past for `QUEUED`, the next\n attempt for `RETRY_SCHEDULED` and the next check for `WAITING`. Null\n for `RUNNING`.", + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "last_progress_at": { + "description": "When any of the review's runs last recorded a completed step. Null\n before the first.", + "format": "date-time", + "type": [ + "string", + "null" + ] + }, + "state": { + "allOf": [ + { + "$ref": "#/components/schemas/RunProgressState" + } + ], + "description": "The most telling state among the review's unfinished runs: a scheduled\n retry, then a running worker, then a queued run, then a wait." } }, "required": [ - "assessment_id", - "passes" + "state", + "attempts" ], "type": "object" }, - "SpecialistExecutionView": { - "properties": { - "assessments": { - "description": "The applied specialist roster per exact assessment execution.", - "items": { - "$ref": "#/components/schemas/SpecialistAssessmentExecution" - }, - "type": "array" + "RunProgressState": { + "description": "What an unfinished review's runs are doing now.", + "oneOf": [ + { + "const": "WAITING", + "description": "A run waits for a scheduled step, such as a push's quiet period, a\n resource another run holds, or its assessments, and is checked again\n at `due_at`.", + "type": "string" }, - "selection_recorded": { - "description": "False until the applied parent captures its specialist choices.", - "type": "boolean" + { + "const": "QUEUED", + "description": "A run is due and no worker has claimed it yet. It has been due since\n `due_at`.", + "type": "string" + }, + { + "const": "RUNNING", + "description": "A worker is running one of the review's runs.", + "type": "string" + }, + { + "const": "RETRY_SCHEDULED", + "description": "An attempt of a run ended without finishing, and the run starts again\n at `due_at`.", + "type": "string" } - }, - "required": [ - "selection_recorded", - "assessments" - ], - "type": "object" + ] }, - "SpecialistOutputProjection": { - "description": "A pass receipt's bounded operational facts, without its proposals or prose.", + "ScanRequestBody": { + "additionalProperties": false, + "description": "One request to scan a ref or an exact commit of the repository.", "properties": { - "gap_kind": { - "description": "Closed evidence-gap class, absent when the pass produced output.", + "budget_credits": { + "description": "The credits the whole scan may spend, at most the organization's\n on-demand ceiling.", + "format": "int64", + "type": "integer" + }, + "commit_sha": { + "description": "An exact commit. Name it or `ref`.", "type": [ "string", "null" ] }, - "output_sha256": { - "description": "Verified digest of the retained output bytes.", - "type": "string" + "ref": { + "description": "A ref, resolved once when the request arrives. Name it or `commit_sha`.", + "type": [ + "string", + "null" + ] }, - "status": { - "description": "`PRODUCED`, `UNAVAILABLE`, `INCOMPLETE` or `MALFORMED`.", + "request_id": { + "description": "The caller's identity for this request. Sending it again returns the\n first resolution instead of scanning again.", + "format": "uuid", "type": "string" } }, "required": [ - "status", - "output_sha256" + "request_id", + "budget_credits" ], "type": "object" }, - "SpecialistPassExecution": { + "ScanResponse": { + "description": "What a scan request resolved to.", "properties": { - "files": { - "description": "Exact selected paths from the validated captured change.", - "items": { - "type": "string" - }, - "type": "array" - }, - "floor": { - "description": "Whether captured file facts required this pass.", - "type": "boolean" + "outcome": { + "description": "`CREATED`, `EXISTING` when this request id was already resolved, or\n `REPOSITORY_UNAVAILABLE` when GitHub could not resolve it.", + "type": "string" }, - "name": { - "description": "Closed registry key of the selected specialist.", + "resolution_id": { + "description": "The request's one resolution receipt.", + "format": "uuid", "type": "string" }, - "output": { - "anyOf": [ - { - "$ref": "#/components/schemas/SpecialistOutputProjection" - }, - { - "type": "null" - } - ], - "description": "Missing means selected, with no retained output. It never means success." + "review_id": { + "description": "The scan review, readable through the review routes. Absent when\n GitHub could not resolve the request.", + "format": "uuid", + "type": [ + "string", + "null" + ] } }, "required": [ - "name", - "files", - "floor" + "resolution_id", + "outcome" ], "type": "object" }, @@ -6355,48 +5968,6 @@ ], "type": "string" }, - "TerraformPlanView": { - "enum": [ - "TAKEN", - "NOT_DECLARED", - "NOT_PINNED", - "HEAD_DIFFERS", - "ADDRESSES_UNREPORTED" - ], - "type": "string" - }, - "TerraformRootsView": { - "description": "The Terraform roots of one declared reach read.", - "properties": { - "addresses": { - "description": "The changed resource instance addresses taken as roots.", - "items": { - "type": "string" - }, - "type": "array" - }, - "omitted": { - "description": "Changed addresses left out at World's limit of 100 roots per read.", - "format": "uint", - "minimum": 0, - "type": "integer" - }, - "plan": { - "allOf": [ - { - "$ref": "#/components/schemas/TerraformPlanView" - } - ], - "description": "`TAKEN` when the plan pinned for the reviewed commit named the roots,\n `NOT_DECLARED` when the environment captures no Terraform plan for this\n review, `NOT_PINNED` when it declares one and none was pinned,\n `HEAD_DIFFERS` when the pinned plan is for another commit, and\n `ADDRESSES_UNREPORTED` when the pinned plan records no changed\n addresses because it was pinned before World reported them." - } - }, - "required": [ - "plan", - "addresses", - "omitted" - ], - "type": "object" - }, "ThreadObservationFreshness": { "enum": [ "FRESH", @@ -6660,7 +6231,7 @@ }, "info": { "title": "Proofline Review API", - "version": "1.0.0" + "version": "5.11.0" }, "openapi": "3.1.0", "paths": { @@ -7172,7 +6743,7 @@ }, "400": { "content": { - "application/json": { + "application/problem+json": { "schema": { "$ref": "#/components/schemas/RunNowRefused" } @@ -7260,7 +6831,7 @@ }, "422": { "content": { - "application/json": { + "application/problem+json": { "schema": { "$ref": "#/components/schemas/CoverageRefused" } @@ -7338,7 +6909,7 @@ }, "400": { "content": { - "application/json": { + "application/problem+json": { "schema": { "$ref": "#/components/schemas/RunNowRefused" } @@ -7416,7 +6987,7 @@ }, "400": { "content": { - "application/json": { + "application/problem+json": { "schema": { "$ref": "#/components/schemas/RunNowRefused" } @@ -7503,7 +7074,7 @@ }, "400": { "content": { - "application/json": { + "application/problem+json": { "schema": { "$ref": "#/components/schemas/RunNowRefused" } @@ -7588,6 +7159,84 @@ "x-proofline-token-scope": "guidance:read" } }, + "/api/v1/organizations/{org_id}/repositories/{repo_id}/scans": { + "post": { + "description": "Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and records that resolution. Requires live GitHub write access, and `budget_credits` at most the organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same `request_id` again returns the first resolution. Results remain in Proofline and are never posted to GitHub.", + "operationId": "request_scan", + "parameters": [ + { + "in": "path", + "name": "org_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + }, + { + "in": "path", + "name": "repo_id", + "required": true, + "schema": { + "format": "uuid", + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScanRequestBody" + } + } + }, + "description": "One request to scan a ref or an exact commit of the repository.", + "required": true + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScanResponse" + } + } + }, + "description": "What a scan request resolved to." + }, + "400": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/RunNowRefused" + } + } + }, + "description": "A run-now request that created nothing, as the 400 it is answered with.\n\n The refusal is a configuration fact, not a failure, and it is still sent\n as an RFC 9457 problem: `title`, `status` and `detail` are what a client\n that knows only problems shows, and `repository_name` and `refusal` are\n the extension members a client that knows refusals links from. During a\n rollout a page loaded from the previous bundle keeps working against\n this server, because a refusal was a 400 with a `detail` before too." + }, + "default": { + "content": { + "application/problem+json": { + "schema": { + "$ref": "#/components/schemas/Problem" + } + } + }, + "description": "An RFC 9457 problem; the HTTP status remains authoritative." + } + }, + "security": [ + { + "bearerAuth": [] + } + ], + "summary": "Scan a repository revision", + "x-proofline-token-scope": "scans:request" + } + }, "/api/v1/organizations/{org_id}/repository-names": { "get": { "description": "Returns the ID and full name of each connected repository inside the token's repository restriction, including repositories with no review, so a client can resolve `owner/name` to an ID.", @@ -7656,9 +7305,11 @@ "style": "form" }, { + "description": "`mine` for the caller's own pull requests, or a GitHub user ID. `mine`\n needs a person's sign-in or token.", "in": "query", "name": "author", "schema": { + "description": "`mine` for the caller's own pull requests, or a GitHub user ID. `mine`\n needs a person's sign-in or token.", "type": [ "string", "null" @@ -7690,9 +7341,11 @@ "style": "form" }, { + "description": "`present` lists reviews with at least one finding; `none` lists reviews\n with no finding.", "in": "query", "name": "findings", "schema": { + "description": "`present` lists reviews with at least one finding; `none` lists reviews\n with no finding.", "type": [ "string", "null" @@ -7701,9 +7354,11 @@ "style": "form" }, { + "description": "One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, `COMMIT`,\n `FILES`, `MERGE_GROUP` or `REVISION_SCAN`.", "in": "query", "name": "kind", "schema": { + "description": "One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, `COMMIT`,\n `FILES`, `MERGE_GROUP` or `REVISION_SCAN`.", "type": [ "string", "null" @@ -7760,9 +7415,11 @@ "style": "form" }, { + "description": "One review status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`,\n `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "in": "query", "name": "status", "schema": { + "description": "One review status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`,\n `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "type": [ "string", "null" @@ -7896,10 +7553,12 @@ "style": "simple" }, { + "description": "The repository's name without its owner, or a name it had before a rename.", "in": "path", "name": "repository", "required": true, "schema": { + "description": "The repository's name without its owner, or a name it had before a rename.", "type": "string" }, "style": "simple" @@ -7918,9 +7577,11 @@ "style": "form" }, { + "description": "`mine` for the caller's own pull requests, or a GitHub user ID. `mine`\n needs a person's sign-in or token.", "in": "query", "name": "author", "schema": { + "description": "`mine` for the caller's own pull requests, or a GitHub user ID. `mine`\n needs a person's sign-in or token.", "type": [ "string", "null" @@ -7952,9 +7613,11 @@ "style": "form" }, { + "description": "`present` lists reviews with at least one finding; `none` lists reviews\n with no finding.", "in": "query", "name": "findings", "schema": { + "description": "`present` lists reviews with at least one finding; `none` lists reviews\n with no finding.", "type": [ "string", "null" @@ -7963,9 +7626,11 @@ "style": "form" }, { + "description": "One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, `COMMIT`,\n `FILES`, `MERGE_GROUP` or `REVISION_SCAN`.", "in": "query", "name": "kind", "schema": { + "description": "One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, `COMMIT`,\n `FILES`, `MERGE_GROUP` or `REVISION_SCAN`.", "type": [ "string", "null" @@ -8022,9 +7687,11 @@ "style": "form" }, { + "description": "One review status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`,\n `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "in": "query", "name": "status", "schema": { + "description": "One review status: `PENDING`, `RUNNING`, `COMPLETED`, `INCOMPLETE`,\n `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`.", "type": [ "string", "null" @@ -8090,10 +7757,12 @@ "style": "simple" }, { + "description": "The repository's name without its owner, or a name it had before a rename.", "in": "path", "name": "repository", "required": true, "schema": { + "description": "The repository's name without its owner, or a name it had before a rename.", "type": "string" }, "style": "simple" diff --git a/proofline/__init__.py b/proofline/__init__.py index f9dbdb95..5704485b 100644 --- a/proofline/__init__.py +++ b/proofline/__init__.py @@ -25,12 +25,14 @@ RunNowMode, RunNowRequest, RunNowResponse, + ScanRequestBody, + ScanResponse, StartSession, StopResponse, UploadedReport, ) from ._transport import VERSION as __version__ -from ._transport import ProoflineError +from ._transport import ProoflineError, RunNowRefusal from .client import AsyncProoflineClient, ProoflineClient, ReviewFilters from .exports import ExportDataset, ExportFormat, ExportPage from .outcomes import AssessmentGap, CheckGap, ReviewOutcome @@ -65,8 +67,11 @@ "ReviewOutcome", "ReviewPage", "RunNowMode", + "RunNowRefusal", "RunNowRequest", "RunNowResponse", + "ScanRequestBody", + "ScanResponse", "SecretStr", "StartSession", "StopResponse", diff --git a/proofline/_csv.py b/proofline/_csv.py new file mode 100644 index 00000000..e2f4c9db --- /dev/null +++ b/proofline/_csv.py @@ -0,0 +1,61 @@ +"""Fixed-dialect CSV parsing without changing Python's global field-size limit. + +The caller bounds the UTF-8 input before parsing. Text runs are consumed together +so large cells do not require one allocation per character. +""" + +from __future__ import annotations + +import re + +_TOKENS = re.compile(r'[^,"\r\n]+|.', re.DOTALL) + + +def parse_csv(text: str) -> list[list[str]]: + records: list[list[str]] = [] + row: list[str] = [] + fragments: list[str] = [] + state = "start" + skip_lf = False + for match in _TOKENS.finditer(text): + token = match[0] + if skip_lf: + skip_lf = False + if token == "\n": + continue + if state == "quoted": + if token == '"': + state = "after_quote" + else: + fragments.append(token) + continue + if state == "after_quote": + if token == '"': + fragments.append('"') + state = "quoted" + continue + if token not in (",", "\r", "\n"): + raise ValueError("Unexpected text after a closing CSV quote.") + if token == ",": + row.append("".join(fragments)) + fragments.clear() + state = "start" + elif token in ("\r", "\n"): + if state != "start" or row: + row.append("".join(fragments)) + records.append(row) + row = [] + fragments.clear() + state = "start" + skip_lf = token == "\r" + elif token == '"' and state == "start": + state = "quoted" + else: + fragments.append(token) + state = "unquoted" + if state == "quoted": + raise ValueError("Unterminated CSV quote.") + if state != "start" or row: + row.append("".join(fragments)) + records.append(row) + return records diff --git a/proofline/_generated/api/default/get_agent_session.py b/proofline/_generated/api/default/get_agent_session.py index 15de4b34..f7521d13 100644 --- a/proofline/_generated/api/default/get_agent_session.py +++ b/proofline/_generated/api/default/get_agent_session.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, session_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/agent-sessions/{session_id}".format( diff --git a/proofline/_generated/api/default/get_agent_session_prompt.py b/proofline/_generated/api/default/get_agent_session_prompt.py index 6d2a57b3..f8a13cf2 100644 --- a/proofline/_generated/api/default/get_agent_session_prompt.py +++ b/proofline/_generated/api/default/get_agent_session_prompt.py @@ -16,6 +16,7 @@ def _get_kwargs( org_id: UUID, finding_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/findings/{finding_id}/agent-session-prompt".format( diff --git a/proofline/_generated/api/default/get_assessment.py b/proofline/_generated/api/default/get_assessment.py index 1d086d5d..899c6d34 100644 --- a/proofline/_generated/api/default/get_assessment.py +++ b/proofline/_generated/api/default/get_assessment.py @@ -16,6 +16,7 @@ def _get_kwargs( review_id: UUID, assessment_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/reviews/{review_id}/assessments/{assessment_id}".format( diff --git a/proofline/_generated/api/default/get_deployment_review.py b/proofline/_generated/api/default/get_deployment_review.py index b3bcdb09..575040bc 100644 --- a/proofline/_generated/api/default/get_deployment_review.py +++ b/proofline/_generated/api/default/get_deployment_review.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, public_key: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/reviews/deployments/{public_key}".format( diff --git a/proofline/_generated/api/default/get_finding.py b/proofline/_generated/api/default/get_finding.py index 3225d0d0..c0e93bbf 100644 --- a/proofline/_generated/api/default/get_finding.py +++ b/proofline/_generated/api/default/get_finding.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, finding_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/findings/{finding_id}".format( diff --git a/proofline/_generated/api/default/get_finding_fix_prompt.py b/proofline/_generated/api/default/get_finding_fix_prompt.py index d8098f57..6a462923 100644 --- a/proofline/_generated/api/default/get_finding_fix_prompt.py +++ b/proofline/_generated/api/default/get_finding_fix_prompt.py @@ -16,6 +16,7 @@ def _get_kwargs( org_id: UUID, finding_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/findings/{finding_id}/fix-prompt".format( diff --git a/proofline/_generated/api/default/get_pull_request_review.py b/proofline/_generated/api/default/get_pull_request_review.py index 482d002a..99eea92c 100644 --- a/proofline/_generated/api/default/get_pull_request_review.py +++ b/proofline/_generated/api/default/get_pull_request_review.py @@ -17,6 +17,7 @@ def _get_kwargs( pull_request_number: int, run_number: int, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/reviews/pr/{repository}/{pull_request_number}/runs/{run_number}".format( @@ -69,7 +70,8 @@ def sync_detailed( Args: org_id (UUID): - repository (str): + repository (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): run_number (int): @@ -110,7 +112,8 @@ def sync( Args: org_id (UUID): - repository (str): + repository (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): run_number (int): @@ -146,7 +149,8 @@ async def asyncio_detailed( Args: org_id (UUID): - repository (str): + repository (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): run_number (int): @@ -185,7 +189,8 @@ async def asyncio( Args: org_id (UUID): - repository (str): + repository (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): run_number (int): diff --git a/proofline/_generated/api/default/get_review.py b/proofline/_generated/api/default/get_review.py index d0b3602b..1bffebae 100644 --- a/proofline/_generated/api/default/get_review.py +++ b/proofline/_generated/api/default/get_review.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, review_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/reviews/{review_id}".format( diff --git a/proofline/_generated/api/default/get_review_guidance.py b/proofline/_generated/api/default/get_review_guidance.py index df940ba6..0bda79cd 100644 --- a/proofline/_generated/api/default/get_review_guidance.py +++ b/proofline/_generated/api/default/get_review_guidance.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, repo_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/repositories/{repo_id}/review-guidance".format( diff --git a/proofline/_generated/api/default/get_review_routing.py b/proofline/_generated/api/default/get_review_routing.py index fe5b30a3..547f9f06 100644 --- a/proofline/_generated/api/default/get_review_routing.py +++ b/proofline/_generated/api/default/get_review_routing.py @@ -17,6 +17,7 @@ def _get_kwargs( org_id: UUID, review_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/reviews/{review_id}/routing".format( diff --git a/proofline/_generated/api/default/list_pull_request_reviews.py b/proofline/_generated/api/default/list_pull_request_reviews.py index 7e1142b6..c5e5637d 100644 --- a/proofline/_generated/api/default/list_pull_request_reviews.py +++ b/proofline/_generated/api/default/list_pull_request_reviews.py @@ -28,6 +28,7 @@ def _get_kwargs( search: None | str | Unset = UNSET, status: None | str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} json_attention: None | str | Unset @@ -174,22 +175,31 @@ def sync_detailed( Args: org_id (UUID): - repository_path (str): + repository_path (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository_query (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -247,22 +257,31 @@ def sync( Args: org_id (UUID): - repository_path (str): + repository_path (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository_query (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -315,22 +334,31 @@ async def asyncio_detailed( Args: org_id (UUID): - repository_path (str): + repository_path (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository_query (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -386,22 +414,31 @@ async def asyncio( Args: org_id (UUID): - repository_path (str): + repository_path (str): The repository's name without its owner, or a name it had before a + rename. pull_request_number (int): attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository_query (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/proofline/_generated/api/default/list_repositories.py b/proofline/_generated/api/default/list_repositories.py index 9abdda1e..9eb6d269 100644 --- a/proofline/_generated/api/default/list_repositories.py +++ b/proofline/_generated/api/default/list_repositories.py @@ -14,6 +14,7 @@ def _get_kwargs( org_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/api/v1/organizations/{org_id}/repository-names".format( diff --git a/proofline/_generated/api/default/list_reviews.py b/proofline/_generated/api/default/list_reviews.py index f3630bc4..717b0e14 100644 --- a/proofline/_generated/api/default/list_reviews.py +++ b/proofline/_generated/api/default/list_reviews.py @@ -26,6 +26,7 @@ def _get_kwargs( search: None | str | Unset = UNSET, status: None | str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} json_attention: None | str | Unset @@ -172,17 +173,25 @@ def sync_detailed( attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -240,17 +249,25 @@ def sync( attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -303,17 +320,25 @@ async def asyncio_detailed( attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -369,17 +394,25 @@ async def asyncio( attention (None | str | Unset): `needed` lists terminal reviews of open pull requests with active findings, FAILED/INCOMPLETE/STOPPED execution, or an earlier reviewed commit. - author (None | str | Unset): + author (None | str | Unset): `mine` for the caller's own pull requests, or a GitHub user + ID. `mine` + needs a person's sign-in or token. cursor (None | str | Unset): environment (None | Unset | UUID): - findings (None | str | Unset): - kind (None | str | Unset): + findings (None | str | Unset): `present` lists reviews with at least one finding; `none` + lists reviews + with no finding. + kind (None | str | Unset): One review kind: `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, + `COMMIT`, + `FILES`, `MERGE_GROUP` or `REVISION_SCAN`. limit (int | None | Unset): query (None | str | Unset): Qualifiers, quoted values, AND/OR, groups and minus exclusions. repository (None | Unset | UUID): search (None | str | Unset): - status (None | str | Unset): + status (None | str | Unset): One review status: `PENDING`, `RUNNING`, `COMPLETED`, + `INCOMPLETE`, + `FAILED`, `SUPERSEDED`, `STOPPED` or `EXCLUDED`. Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. diff --git a/proofline/_generated/api/default/request_scan.py b/proofline/_generated/api/default/request_scan.py new file mode 100644 index 00000000..81e30628 --- /dev/null +++ b/proofline/_generated/api/default/request_scan.py @@ -0,0 +1,220 @@ +from http import HTTPStatus +from typing import Any +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ...client import AuthenticatedClient, Client +from ...models.problem import Problem +from ...models.run_now_refused import RunNowRefused +from ...models.scan_request_body import ScanRequestBody +from ...models.scan_response import ScanResponse +from ...types import Response + + +def _get_kwargs( + org_id: UUID, + repo_id: UUID, + *, + body: ScanRequestBody, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/api/v1/organizations/{org_id}/repositories/{repo_id}/scans".format( + org_id=quote(str(org_id), safe=""), + repo_id=quote(str(repo_id), safe=""), + ), + } + + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/json" + + _kwargs["headers"] = headers + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Problem | RunNowRefused | ScanResponse: + if response.status_code == 200: + response_200 = ScanResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = RunNowRefused.from_dict(response.json()) + + return response_400 + + response_default = Problem.from_dict(response.json()) + + return response_default + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[Problem | RunNowRefused | ScanResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + org_id: UUID, + repo_id: UUID, + *, + client: AuthenticatedClient, + body: ScanRequestBody, +) -> Response[Problem | RunNowRefused | ScanResponse]: + """Scan a repository revision + + Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and + records that resolution. Requires live GitHub write access, and `budget_credits` at most the + organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same + `request_id` again returns the first resolution. Results remain in Proofline and are never posted to + GitHub. + + Args: + org_id (UUID): + repo_id (UUID): + body (ScanRequestBody): One request to scan a ref or an exact commit of the repository. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Problem | RunNowRefused | ScanResponse] + """ + + kwargs = _get_kwargs( + org_id=org_id, + repo_id=repo_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + org_id: UUID, + repo_id: UUID, + *, + client: AuthenticatedClient, + body: ScanRequestBody, +) -> Problem | RunNowRefused | ScanResponse | None: + """Scan a repository revision + + Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and + records that resolution. Requires live GitHub write access, and `budget_credits` at most the + organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same + `request_id` again returns the first resolution. Results remain in Proofline and are never posted to + GitHub. + + Args: + org_id (UUID): + repo_id (UUID): + body (ScanRequestBody): One request to scan a ref or an exact commit of the repository. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Problem | RunNowRefused | ScanResponse + """ + + return sync_detailed( + org_id=org_id, + repo_id=repo_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + org_id: UUID, + repo_id: UUID, + *, + client: AuthenticatedClient, + body: ScanRequestBody, +) -> Response[Problem | RunNowRefused | ScanResponse]: + """Scan a repository revision + + Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and + records that resolution. Requires live GitHub write access, and `budget_credits` at most the + organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same + `request_id` again returns the first resolution. Results remain in Proofline and are never posted to + GitHub. + + Args: + org_id (UUID): + repo_id (UUID): + body (ScanRequestBody): One request to scan a ref or an exact commit of the repository. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[Problem | RunNowRefused | ScanResponse] + """ + + kwargs = _get_kwargs( + org_id=org_id, + repo_id=repo_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + org_id: UUID, + repo_id: UUID, + *, + client: AuthenticatedClient, + body: ScanRequestBody, +) -> Problem | RunNowRefused | ScanResponse | None: + """Scan a repository revision + + Scans the whole repository at one commit, resolved once from `ref` or named by `commit_sha`, and + records that resolution. Requires live GitHub write access, and `budget_credits` at most the + organization's on-demand scan limit; a limit of 0 turns on-demand scans off. Sending the same + `request_id` again returns the first resolution. Results remain in Proofline and are never posted to + GitHub. + + Args: + org_id (UUID): + repo_id (UUID): + body (ScanRequestBody): One request to scan a ref or an exact commit of the repository. + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Problem | RunNowRefused | ScanResponse + """ + + return ( + await asyncio_detailed( + org_id=org_id, + repo_id=repo_id, + client=client, + body=body, + ) + ).parsed diff --git a/proofline/_generated/api/default/rerun_review.py b/proofline/_generated/api/default/rerun_review.py index 75e34ff9..4f9d5cd0 100644 --- a/proofline/_generated/api/default/rerun_review.py +++ b/proofline/_generated/api/default/rerun_review.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, review_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", "url": "/api/v1/organizations/{org_id}/reviews/{review_id}/rerun".format( diff --git a/proofline/_generated/api/default/stop_review.py b/proofline/_generated/api/default/stop_review.py index 6a58ba43..67e5bd86 100644 --- a/proofline/_generated/api/default/stop_review.py +++ b/proofline/_generated/api/default/stop_review.py @@ -15,6 +15,7 @@ def _get_kwargs( org_id: UUID, review_id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", "url": "/api/v1/organizations/{org_id}/reviews/{review_id}/stop".format( diff --git a/proofline/_generated/api/operations.py b/proofline/_generated/api/operations.py new file mode 100644 index 00000000..9a9a1240 --- /dev/null +++ b/proofline/_generated/api/operations.py @@ -0,0 +1,54 @@ +"""Typed methods generated from the public operations without custom adapters.""" + +from typing import cast +from uuid import UUID + +from ... import _transport +from ..client import AuthenticatedClient +from ..models.scan_request_body import ScanRequestBody +from ..models.scan_response import ScanResponse +from .default import request_scan as operation_request_scan + + +class Operations: + _api: AuthenticatedClient + + def request_scan( + self, + org_id: UUID, + repo_id: UUID, + *, + body: ScanRequestBody, + ) -> ScanResponse: + with _transport.operation_errors(): + response = operation_request_scan.sync_detailed( + client=self._api, + org_id=org_id, + repo_id=repo_id, + body=body, + ) + if not (response.status_code == 200): + raise _transport.invalid_response() + return cast(ScanResponse, response.parsed) + + +class AsyncOperations: + _api: AuthenticatedClient + + async def request_scan( + self, + org_id: UUID, + repo_id: UUID, + *, + body: ScanRequestBody, + ) -> ScanResponse: + with _transport.operation_errors(): + response = await operation_request_scan.asyncio_detailed( + client=self._api, + org_id=org_id, + repo_id=repo_id, + body=body, + ) + if not (response.status_code == 200): + raise _transport.invalid_response() + return cast(ScanResponse, response.parsed) diff --git a/proofline/_generated/models/__init__.py b/proofline/_generated/models/__init__.py index 7e61de46..1f14a3bb 100644 --- a/proofline/_generated/models/__init__.py +++ b/proofline/_generated/models/__init__.py @@ -7,28 +7,23 @@ from .agent_session_prompt_type_1 import AgentSessionPromptType1 from .agent_session_target import AgentSessionTarget from .agent_vendor import AgentVendor -from .approval_gap import ApprovalGap from .assessment_projection import AssessmentProjection -from .attributed_condition_view import AttributedConditionView from .author_choice import AuthorChoice -from .authority import Authority -from .availability_type_0 import AvailabilityType0 -from .change_attribution_view import ChangeAttributionView -from .change_count_view import ChangeCountView from .change_diagram_kind_view import ChangeDiagramKindView from .change_diagram_outcome_type_0 import ChangeDiagramOutcomeType0 from .change_diagram_view import ChangeDiagramView from .change_summary import ChangeSummary +from .check_file import CheckFile from .ci_failure_attribution import CiFailureAttribution from .ci_failure_line import CiFailureLine from .code_assessment_status_type_0 import CodeAssessmentStatusType0 +from .code_ceiling_stop import CodeCeilingStop from .comment_address_evaluation_view import CommentAddressEvaluationView from .comment_address_outcome import CommentAddressOutcome from .comment_reaction import CommentReaction from .comment_reaction_view import CommentReactionView from .commit_review_request import CommitReviewRequest from .commit_review_response import CommitReviewResponse -from .complete_record_view import CompleteRecordView from .coverage_refused import CoverageRefused from .coverage_upload_request import CoverageUploadRequest from .coverage_upload_response import CoverageUploadResponse @@ -37,20 +32,16 @@ from .customer_check import CustomerCheck from .customer_checks import CustomerChecks from .customer_code_assessment import CustomerCodeAssessment -from .customer_decision import CustomerDecision -from .customer_decision_basis import CustomerDecisionBasis from .customer_evidence_ref import CustomerEvidenceRef from .customer_finding import CustomerFinding from .customer_finding_validation import CustomerFindingValidation from .customer_review_detail import CustomerReviewDetail from .dataset import Dataset -from .declared_reach_outcome import DeclaredReachOutcome -from .declared_reach_view import DeclaredReachView from .deep_review_escalation import DeepReviewEscalation from .deep_review_escalation_status import DeepReviewEscalationStatus from .domain_view import DomainView from .earlier_open_finding import EarlierOpenFinding -from .evidence_view import EvidenceView +from .environment_check import EnvironmentCheck from .export_evidence_kind import ExportEvidenceKind from .export_evidence_ref import ExportEvidenceRef from .export_finding_lifecycle import ExportFindingLifecycle @@ -89,14 +80,12 @@ from .finding_support import FindingSupport from .finding_validations_export_row import FindingValidationsExportRow from .findings_export_row import FindingsExportRow -from .gate_state import GateState from .gate_status import GateStatus +from .incomplete_cause_type_0 import IncompleteCauseType0 from .local_reverification import LocalReverification from .local_reverification_outcome import LocalReverificationOutcome from .matched_local_finding import MatchedLocalFinding from .not_assessed_view import NotAssessedView -from .occurrence_capture import OccurrenceCapture -from .occurrence_question import OccurrenceQuestion from .open_finding_counts import OpenFindingCounts from .open_item_environment import OpenItemEnvironment from .open_items_gap_reason import OpenItemsGapReason @@ -107,21 +96,18 @@ from .open_items_threads_type_1 import OpenItemsThreadsType1 from .open_items_view import OpenItemsView from .outcome import Outcome -from .override import Override from .pass_projection import PassProjection from .patch_review_request import PatchReviewRequest from .patch_review_response import PatchReviewResponse from .patch_trigger_source import PatchTriggerSource from .patch_verification import PatchVerification -from .permission_view import PermissionView from .plan_projection import PlanProjection from .problem import Problem from .prose import Prose from .prose_outcome_type_0 import ProseOutcomeType0 +from .provider_wait import ProviderWait +from .provider_wait_reason import ProviderWaitReason from .pull_request_merge_gate import PullRequestMergeGate -from .reach_gap_view import ReachGapView -from .reach_step_view import ReachStepView -from .reached_entity_view import ReachedEntityView from .refresh_view import RefreshView from .refused_environment import RefusedEnvironment from .related_review import RelatedReview @@ -133,13 +119,14 @@ from .review_depth import ReviewDepth from .review_diff_stats import ReviewDiffStats from .review_filters import ReviewFilters +from .review_investigation_citation import ReviewInvestigationCitation +from .review_investigation_finding import ReviewInvestigationFinding from .review_open_items import ReviewOpenItems from .review_page import ReviewPage from .review_routing_view_type_0 import ReviewRoutingViewType0 from .review_routing_view_type_1 import ReviewRoutingViewType1 from .review_routing_view_type_2 import ReviewRoutingViewType2 from .review_summary import ReviewSummary -from .reviewed_tree_citation_view import ReviewedTreeCitationView from .reviews_export_row import ReviewsExportRow from .routing_finding_view import RoutingFindingView from .rule_source import RuleSource @@ -154,15 +141,12 @@ from .run_now_refusal_view_type_7 import RunNowRefusalViewType7 from .run_now_refusal_view_type_8 import RunNowRefusalViewType8 from .run_now_refusal_view_type_9 import RunNowRefusalViewType9 -from .run_now_refusal_view_type_10 import RunNowRefusalViewType10 -from .run_now_refusal_view_type_11 import RunNowRefusalViewType11 from .run_now_refused import RunNowRefused from .run_now_request import RunNowRequest from .run_now_response import RunNowResponse -from .specialist_assessment_execution import SpecialistAssessmentExecution -from .specialist_execution_view import SpecialistExecutionView -from .specialist_output_projection import SpecialistOutputProjection -from .specialist_pass_execution import SpecialistPassExecution +from .run_progress import RunProgress +from .scan_request_body import ScanRequestBody +from .scan_response import ScanResponse from .spend_account_kind import SpendAccountKind from .spend_export_row import SpendExportRow from .start_session import StartSession @@ -170,8 +154,6 @@ from .subject_authorization import SubjectAuthorization from .subject_view import SubjectView from .summary_route import SummaryRoute -from .terraform_plan_view import TerraformPlanView -from .terraform_roots_view import TerraformRootsView from .thread_observation_freshness import ThreadObservationFreshness from .thread_observation_view import ThreadObservationView from .thread_provider_state import ThreadProviderState @@ -190,28 +172,23 @@ "AgentSessionPromptType1", "AgentSessionTarget", "AgentVendor", - "ApprovalGap", "AssessmentProjection", - "AttributedConditionView", "AuthorChoice", - "Authority", - "AvailabilityType0", - "ChangeAttributionView", - "ChangeCountView", "ChangeDiagramKindView", "ChangeDiagramOutcomeType0", "ChangeDiagramView", "ChangeSummary", + "CheckFile", "CiFailureAttribution", "CiFailureLine", "CodeAssessmentStatusType0", + "CodeCeilingStop", "CommentAddressEvaluationView", "CommentAddressOutcome", "CommentReaction", "CommentReactionView", "CommitReviewRequest", "CommitReviewResponse", - "CompleteRecordView", "CoverageRefused", "CoverageUploadRequest", "CoverageUploadResponse", @@ -220,20 +197,16 @@ "CustomerCheck", "CustomerChecks", "CustomerCodeAssessment", - "CustomerDecision", - "CustomerDecisionBasis", "CustomerEvidenceRef", "CustomerFinding", "CustomerFindingValidation", "CustomerReviewDetail", "Dataset", - "DeclaredReachOutcome", - "DeclaredReachView", "DeepReviewEscalation", "DeepReviewEscalationStatus", "DomainView", "EarlierOpenFinding", - "EvidenceView", + "EnvironmentCheck", "ExportEvidenceKind", "ExportEvidenceRef", "ExportFindingLifecycle", @@ -272,14 +245,12 @@ "FindingsExportRow", "FindingSupport", "FindingValidationsExportRow", - "GateState", "GateStatus", + "IncompleteCauseType0", "LocalReverification", "LocalReverificationOutcome", "MatchedLocalFinding", "NotAssessedView", - "OccurrenceCapture", - "OccurrenceQuestion", "OpenFindingCounts", "OpenItemEnvironment", "OpenItemsGapReason", @@ -290,21 +261,18 @@ "OpenItemsThreadUnknown", "OpenItemsView", "Outcome", - "Override", "PassProjection", "PatchReviewRequest", "PatchReviewResponse", "PatchTriggerSource", "PatchVerification", - "PermissionView", "PlanProjection", "Problem", "Prose", "ProseOutcomeType0", + "ProviderWait", + "ProviderWaitReason", "PullRequestMergeGate", - "ReachedEntityView", - "ReachGapView", - "ReachStepView", "RefreshView", "RefusedEnvironment", "RelatedReview", @@ -315,8 +283,9 @@ "ReviewActions", "ReviewDepth", "ReviewDiffStats", - "ReviewedTreeCitationView", "ReviewFilters", + "ReviewInvestigationCitation", + "ReviewInvestigationFinding", "ReviewOpenItems", "ReviewPage", "ReviewRoutingViewType0", @@ -329,8 +298,6 @@ "RunNowMode", "RunNowRefusalViewType0", "RunNowRefusalViewType1", - "RunNowRefusalViewType10", - "RunNowRefusalViewType11", "RunNowRefusalViewType2", "RunNowRefusalViewType3", "RunNowRefusalViewType4", @@ -342,10 +309,9 @@ "RunNowRefused", "RunNowRequest", "RunNowResponse", - "SpecialistAssessmentExecution", - "SpecialistExecutionView", - "SpecialistOutputProjection", - "SpecialistPassExecution", + "RunProgress", + "ScanRequestBody", + "ScanResponse", "SpendAccountKind", "SpendExportRow", "StartSession", @@ -353,8 +319,6 @@ "SubjectAuthorization", "SubjectView", "SummaryRoute", - "TerraformPlanView", - "TerraformRootsView", "ThreadObservationFreshness", "ThreadObservationView", "ThreadProviderState", diff --git a/proofline/_generated/models/actor_view.py b/proofline/_generated/models/actor_view.py index 63d6feb3..4b1676d4 100644 --- a/proofline/_generated/models/actor_view.py +++ b/proofline/_generated/models/actor_view.py @@ -18,11 +18,13 @@ class ActorView: Attributes: github_user_id (int): Stable GitHub identity. The login below is display metadata. login (str): The login they were known by when they acted. Display metadata. + name (None | str | Unset): Profile name resolved for this organization. Display metadata only. profile_url (None | str | Unset): Their profile on the deployment's GitHub host. """ github_user_id: int login: str + name: None | str | Unset = UNSET profile_url: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -31,6 +33,12 @@ def to_dict(self) -> dict[str, Any]: login = self.login + name: None | str | Unset + if isinstance(self.name, Unset): + name = UNSET + else: + name = self.name + profile_url: None | str | Unset if isinstance(self.profile_url, Unset): profile_url = UNSET @@ -45,6 +53,8 @@ def to_dict(self) -> dict[str, Any]: "login": login, } ) + if name is not UNSET: + field_dict["name"] = name if profile_url is not UNSET: field_dict["profile_url"] = profile_url @@ -57,6 +67,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: login = d.pop("login") + def _parse_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + name = _parse_name(d.pop("name", UNSET)) + def _parse_profile_url(data: object) -> None | str | Unset: if data is None: return data @@ -69,6 +88,7 @@ def _parse_profile_url(data: object) -> None | str | Unset: actor_view = cls( github_user_id=github_user_id, login=login, + name=name, profile_url=profile_url, ) diff --git a/proofline/_generated/models/approval_gap.py b/proofline/_generated/models/approval_gap.py deleted file mode 100644 index b1d80b0d..00000000 --- a/proofline/_generated/models/approval_gap.py +++ /dev/null @@ -1,70 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ApprovalGap") - - -@_attrs_define -class ApprovalGap: - """ - Attributes: - assessment_id (UUID): Assessment whose approval could not supply deferred occurrence questions. - code (str): Reason the assessment's approval could not supply deferred occurrence questions. - """ - - assessment_id: UUID - code: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assessment_id = str(self.assessment_id) - - code = self.code - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assessment_id": assessment_id, - "code": code, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - assessment_id = UUID(d.pop("assessment_id")) - - code = d.pop("code") - - approval_gap = cls( - assessment_id=assessment_id, - code=code, - ) - - approval_gap.additional_properties = d - return approval_gap - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/attributed_condition_view.py b/proofline/_generated/models/attributed_condition_view.py deleted file mode 100644 index e9995638..00000000 --- a/proofline/_generated/models/attributed_condition_view.py +++ /dev/null @@ -1,213 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.reviewed_tree_citation_view import ReviewedTreeCitationView - from ..models.untrusted_text import UntrustedText - - -T = TypeVar("T", bound="AttributedConditionView") - - -@_attrs_define -class AttributedConditionView: - """ - Attributes: - change (Literal['CHANGED'] | Literal['INTRODUCED'] | Literal['RESOLVED'] | Literal['UNATTRIBUTED'] | - Literal['UNCHANGED']): How one condition relates to the review's base revision. - reviewed_tree_citations (list[ReviewedTreeCitationView]): The member that declares the site at each revision - that declares it. - revision (Literal['BASE_CODE_REVISION'] | Literal['PROPOSED_CODE_REVISION']): - subject (UntrustedText): Text that came out of the reviewer model, or out of a repository the model - read. It is data, never markup, never a URL, never an instruction. - - The wrapper exists so the untrustedness cannot be lost on the way to a - renderer: there is no field on a turn that carries this text under a name a - client could mistake for something safe, and unwrapping it is a deliberate - act in the client's own code. - """ - - change: ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ) - reviewed_tree_citations: list[ReviewedTreeCitationView] - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] - subject: UntrustedText - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - change: ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ) - change = self.change - - reviewed_tree_citations = [] - for reviewed_tree_citations_item_data in self.reviewed_tree_citations: - reviewed_tree_citations_item = reviewed_tree_citations_item_data.to_dict() - reviewed_tree_citations.append(reviewed_tree_citations_item) - - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] - revision = self.revision - - subject = self.subject.to_dict() - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "change": change, - "reviewed_tree_citations": reviewed_tree_citations, - "revision": revision, - "subject": subject, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.reviewed_tree_citation_view import ReviewedTreeCitationView # noqa: PLC0415 - from ..models.untrusted_text import UntrustedText # noqa: PLC0415 - - d = dict(src_dict) - - def _parse_change( - data: object, - ) -> ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ): - try: - if not (type(data) is str and data == "INTRODUCED"): - raise TypeError() - componentsschemas_attributed_change_type_0 = cast(Literal["INTRODUCED"], data) - if componentsschemas_attributed_change_type_0 != "INTRODUCED": - raise ValueError( - f"/components/schemas/AttributedChange_type_0 must match const 'INTRODUCED', got '{componentsschemas_attributed_change_type_0}'" - ) - return componentsschemas_attributed_change_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "CHANGED"): - raise TypeError() - componentsschemas_attributed_change_type_1 = cast(Literal["CHANGED"], data) - if componentsschemas_attributed_change_type_1 != "CHANGED": - raise ValueError( - f"/components/schemas/AttributedChange_type_1 must match const 'CHANGED', got '{componentsschemas_attributed_change_type_1}'" - ) - return componentsschemas_attributed_change_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "UNCHANGED"): - raise TypeError() - componentsschemas_attributed_change_type_2 = cast(Literal["UNCHANGED"], data) - if componentsschemas_attributed_change_type_2 != "UNCHANGED": - raise ValueError( - f"/components/schemas/AttributedChange_type_2 must match const 'UNCHANGED', got '{componentsschemas_attributed_change_type_2}'" - ) - return componentsschemas_attributed_change_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "RESOLVED"): - raise TypeError() - componentsschemas_attributed_change_type_3 = cast(Literal["RESOLVED"], data) - if componentsschemas_attributed_change_type_3 != "RESOLVED": - raise ValueError( - f"/components/schemas/AttributedChange_type_3 must match const 'RESOLVED', got '{componentsschemas_attributed_change_type_3}'" - ) - return componentsschemas_attributed_change_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "UNATTRIBUTED"): - raise TypeError() - componentsschemas_attributed_change_type_4 = cast(Literal["UNATTRIBUTED"], data) - if componentsschemas_attributed_change_type_4 != "UNATTRIBUTED": - raise ValueError( - f"/components/schemas/AttributedChange_type_4 must match const 'UNATTRIBUTED', got '{componentsschemas_attributed_change_type_4}'" - ) - return componentsschemas_attributed_change_type_4 - - change = _parse_change(d.pop("change")) - - reviewed_tree_citations = [] - _reviewed_tree_citations = d.pop("reviewed_tree_citations") - for reviewed_tree_citations_item_data in _reviewed_tree_citations: - reviewed_tree_citations_item = ReviewedTreeCitationView.from_dict( - reviewed_tree_citations_item_data - ) - - reviewed_tree_citations.append(reviewed_tree_citations_item) - - def _parse_revision( - data: object, - ) -> Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"]: - try: - if not (type(data) is str and data == "PROPOSED_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_0 = cast( - Literal["PROPOSED_CODE_REVISION"], data - ) - if componentsschemas_attributed_revision_type_0 != "PROPOSED_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_0 must match const 'PROPOSED_CODE_REVISION', got '{componentsschemas_attributed_revision_type_0}'" - ) - return componentsschemas_attributed_revision_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "BASE_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_1 = cast(Literal["BASE_CODE_REVISION"], data) - if componentsschemas_attributed_revision_type_1 != "BASE_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_1 must match const 'BASE_CODE_REVISION', got '{componentsschemas_attributed_revision_type_1}'" - ) - return componentsschemas_attributed_revision_type_1 - - revision = _parse_revision(d.pop("revision")) - - subject = UntrustedText.from_dict(d.pop("subject")) - - attributed_condition_view = cls( - change=change, - reviewed_tree_citations=reviewed_tree_citations, - revision=revision, - subject=subject, - ) - - attributed_condition_view.additional_properties = d - return attributed_condition_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/authority.py b/proofline/_generated/models/authority.py deleted file mode 100644 index 1f34e57c..00000000 --- a/proofline/_generated/models/authority.py +++ /dev/null @@ -1,9 +0,0 @@ -from enum import StrEnum - - -class Authority(StrEnum): - ADVISORY = "ADVISORY" - DEPLOYMENT_POLICY = "DEPLOYMENT_POLICY" - - def __str__(self) -> str: - return str(self.value) diff --git a/proofline/_generated/models/availability_type_0.py b/proofline/_generated/models/availability_type_0.py deleted file mode 100644 index 3141fbce..00000000 --- a/proofline/_generated/models/availability_type_0.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import StrEnum - - -class AvailabilityType0(StrEnum): - LEGACY = "LEGACY" - NOT_RECORDED = "NOT_RECORDED" - OPERATIONAL_FAILURE = "OPERATIONAL_FAILURE" - RECORDED = "RECORDED" - - def __str__(self) -> str: - return str(self.value) diff --git a/proofline/_generated/models/change_attribution_view.py b/proofline/_generated/models/change_attribution_view.py deleted file mode 100644 index 5a82ac20..00000000 --- a/proofline/_generated/models/change_attribution_view.py +++ /dev/null @@ -1,322 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.attributed_condition_view import AttributedConditionView - from ..models.change_count_view import ChangeCountView - from ..models.complete_record_view import CompleteRecordView - - -T = TypeVar("T", bound="ChangeAttributionView") - - -@_attrs_define -class ChangeAttributionView: - """Which conditions behind a check's result the change brought, and which - World found at the review's base revision. It sits beside the result and - never changes it: a condition already at the base is still a condition. - - Attributes: - condition_count (int): How many conditions World attributed, listed or not. Zero unless - `status` is `COMPARED`. - conditions (list[AttributedConditionView]): Every condition, each once, in World's order, never netted against - another. Empty unless `status` is `COMPARED`, and empty when some are - omitted: it never lists only some of them. - counts (list[ChangeCountView]): How many conditions there are of each change at each revision, over - every condition, listed or not. Changes with none are left out. - omitted_condition_count (int): How many of those conditions this response does not list. Zero when - the result kept World's attribution whole. Otherwise the result kept a - summary: `listed_conditions` lists the first ones, `counts` is still - exact, and World's recorded evaluation holds every condition. - status (Literal['COMPARED'] | Literal['UNAVAILABLE'] | Literal['UNREADABLE']): - complete_record (CompleteRecordView | None | Unset): Where every condition is recorded when some are omitted. - Absent when - `conditions` lists them all. - detail_code (None | str | Unset): World's code for why it could not read that revision, such as - `BASE_REVIEWED_TREE_NOT_DECLARED`. Present exactly when `status` is - `UNAVAILABLE`. - listed_conditions (list[AttributedConditionView] | None | Unset): The conditions a summary lists when some are - omitted: the first ones - in the order `counts` gives, each whole, at most 50 and always fewer - than `condition_count`. Present exactly when `omitted_condition_count` - is not zero. - revision (Literal['BASE_CODE_REVISION'] | Literal['PROPOSED_CODE_REVISION'] | None | Unset): The revision World - could not read. Present exactly when `status` is - `UNAVAILABLE`. - """ - - condition_count: int - conditions: list[AttributedConditionView] - counts: list[ChangeCountView] - omitted_condition_count: int - status: Literal["COMPARED"] | Literal["UNAVAILABLE"] | Literal["UNREADABLE"] - complete_record: CompleteRecordView | None | Unset = UNSET - detail_code: None | str | Unset = UNSET - listed_conditions: list[AttributedConditionView] | None | Unset = UNSET - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] | None | Unset = ( - UNSET - ) - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.complete_record_view import CompleteRecordView # noqa: PLC0415 - - condition_count = self.condition_count - - conditions = [] - for conditions_item_data in self.conditions: - conditions_item = conditions_item_data.to_dict() - conditions.append(conditions_item) - - counts = [] - for counts_item_data in self.counts: - counts_item = counts_item_data.to_dict() - counts.append(counts_item) - - omitted_condition_count = self.omitted_condition_count - - status: Literal["COMPARED"] | Literal["UNAVAILABLE"] | Literal["UNREADABLE"] - status = self.status - - complete_record: dict[str, Any] | None | Unset - if isinstance(self.complete_record, Unset): - complete_record = UNSET - elif isinstance(self.complete_record, CompleteRecordView): - complete_record = self.complete_record.to_dict() - else: - complete_record = self.complete_record - - detail_code: None | str | Unset - if isinstance(self.detail_code, Unset): - detail_code = UNSET - else: - detail_code = self.detail_code - - listed_conditions: list[dict[str, Any]] | None | Unset - if isinstance(self.listed_conditions, Unset): - listed_conditions = UNSET - elif isinstance(self.listed_conditions, list): - listed_conditions = [] - for listed_conditions_type_0_item_data in self.listed_conditions: - listed_conditions_type_0_item = listed_conditions_type_0_item_data.to_dict() - listed_conditions.append(listed_conditions_type_0_item) - - else: - listed_conditions = self.listed_conditions - - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] | None | Unset - if isinstance(self.revision, Unset): - revision = UNSET - else: - revision = self.revision - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "condition_count": condition_count, - "conditions": conditions, - "counts": counts, - "omitted_condition_count": omitted_condition_count, - "status": status, - } - ) - if complete_record is not UNSET: - field_dict["complete_record"] = complete_record - if detail_code is not UNSET: - field_dict["detail_code"] = detail_code - if listed_conditions is not UNSET: - field_dict["listed_conditions"] = listed_conditions - if revision is not UNSET: - field_dict["revision"] = revision - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.attributed_condition_view import AttributedConditionView # noqa: PLC0415 - from ..models.change_count_view import ChangeCountView # noqa: PLC0415 - from ..models.complete_record_view import CompleteRecordView # noqa: PLC0415 - - d = dict(src_dict) - condition_count = d.pop("condition_count") - - conditions = [] - _conditions = d.pop("conditions") - for conditions_item_data in _conditions: - conditions_item = AttributedConditionView.from_dict(conditions_item_data) - - conditions.append(conditions_item) - - counts = [] - _counts = d.pop("counts") - for counts_item_data in _counts: - counts_item = ChangeCountView.from_dict(counts_item_data) - - counts.append(counts_item) - - omitted_condition_count = d.pop("omitted_condition_count") - - def _parse_status( - data: object, - ) -> Literal["COMPARED"] | Literal["UNAVAILABLE"] | Literal["UNREADABLE"]: - try: - if not (type(data) is str and data == "COMPARED"): - raise TypeError() - componentsschemas_attribution_status_type_0 = cast(Literal["COMPARED"], data) - if componentsschemas_attribution_status_type_0 != "COMPARED": - raise ValueError( - f"/components/schemas/AttributionStatus_type_0 must match const 'COMPARED', got '{componentsschemas_attribution_status_type_0}'" - ) - return componentsschemas_attribution_status_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "UNAVAILABLE"): - raise TypeError() - componentsschemas_attribution_status_type_1 = cast(Literal["UNAVAILABLE"], data) - if componentsschemas_attribution_status_type_1 != "UNAVAILABLE": - raise ValueError( - f"/components/schemas/AttributionStatus_type_1 must match const 'UNAVAILABLE', got '{componentsschemas_attribution_status_type_1}'" - ) - return componentsschemas_attribution_status_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "UNREADABLE"): - raise TypeError() - componentsschemas_attribution_status_type_2 = cast(Literal["UNREADABLE"], data) - if componentsschemas_attribution_status_type_2 != "UNREADABLE": - raise ValueError( - f"/components/schemas/AttributionStatus_type_2 must match const 'UNREADABLE', got '{componentsschemas_attribution_status_type_2}'" - ) - return componentsschemas_attribution_status_type_2 - - status = _parse_status(d.pop("status")) - - def _parse_complete_record(data: object) -> CompleteRecordView | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - complete_record_type_0 = CompleteRecordView.from_dict(data) - - return complete_record_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CompleteRecordView | None | Unset, data) - - complete_record = _parse_complete_record(d.pop("complete_record", UNSET)) - - def _parse_detail_code(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - detail_code = _parse_detail_code(d.pop("detail_code", UNSET)) - - def _parse_listed_conditions(data: object) -> list[AttributedConditionView] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, list): - raise TypeError() - listed_conditions_type_0 = [] - _listed_conditions_type_0 = data - for listed_conditions_type_0_item_data in _listed_conditions_type_0: - listed_conditions_type_0_item = AttributedConditionView.from_dict( - listed_conditions_type_0_item_data - ) - - listed_conditions_type_0.append(listed_conditions_type_0_item) - - return listed_conditions_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(list[AttributedConditionView] | None | Unset, data) - - listed_conditions = _parse_listed_conditions(d.pop("listed_conditions", UNSET)) - - def _parse_revision( - data: object, - ) -> Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not (type(data) is str and data == "PROPOSED_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_0 = cast( - Literal["PROPOSED_CODE_REVISION"], data - ) - if componentsschemas_attributed_revision_type_0 != "PROPOSED_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_0 must match const 'PROPOSED_CODE_REVISION', got '{componentsschemas_attributed_revision_type_0}'" - ) - return componentsschemas_attributed_revision_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "BASE_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_1 = cast( - Literal["BASE_CODE_REVISION"], data - ) - if componentsschemas_attributed_revision_type_1 != "BASE_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_1 must match const 'BASE_CODE_REVISION', got '{componentsschemas_attributed_revision_type_1}'" - ) - return componentsschemas_attributed_revision_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast( - Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] | None | Unset, - data, - ) - - revision = _parse_revision(d.pop("revision", UNSET)) - - change_attribution_view = cls( - condition_count=condition_count, - conditions=conditions, - counts=counts, - omitted_condition_count=omitted_condition_count, - status=status, - complete_record=complete_record, - detail_code=detail_code, - listed_conditions=listed_conditions, - revision=revision, - ) - - change_attribution_view.additional_properties = d - return change_attribution_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/change_count_view.py b/proofline/_generated/models/change_count_view.py deleted file mode 100644 index 7fd4a626..00000000 --- a/proofline/_generated/models/change_count_view.py +++ /dev/null @@ -1,182 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ChangeCountView") - - -@_attrs_define -class ChangeCountView: - """How many conditions are of one change at one revision. - - Attributes: - change (Literal['CHANGED'] | Literal['INTRODUCED'] | Literal['RESOLVED'] | Literal['UNATTRIBUTED'] | - Literal['UNCHANGED']): How one condition relates to the review's base revision. - count (int): How many conditions have this `change` at this `revision`, over every - condition, listed or not. - revision (Literal['BASE_CODE_REVISION'] | Literal['PROPOSED_CODE_REVISION']): - """ - - change: ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ) - count: int - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - change: ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ) - change = self.change - - count = self.count - - revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] - revision = self.revision - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "change": change, - "count": count, - "revision": revision, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - - def _parse_change( - data: object, - ) -> ( - Literal["CHANGED"] - | Literal["INTRODUCED"] - | Literal["RESOLVED"] - | Literal["UNATTRIBUTED"] - | Literal["UNCHANGED"] - ): - try: - if not (type(data) is str and data == "INTRODUCED"): - raise TypeError() - componentsschemas_attributed_change_type_0 = cast(Literal["INTRODUCED"], data) - if componentsschemas_attributed_change_type_0 != "INTRODUCED": - raise ValueError( - f"/components/schemas/AttributedChange_type_0 must match const 'INTRODUCED', got '{componentsschemas_attributed_change_type_0}'" - ) - return componentsschemas_attributed_change_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "CHANGED"): - raise TypeError() - componentsschemas_attributed_change_type_1 = cast(Literal["CHANGED"], data) - if componentsschemas_attributed_change_type_1 != "CHANGED": - raise ValueError( - f"/components/schemas/AttributedChange_type_1 must match const 'CHANGED', got '{componentsschemas_attributed_change_type_1}'" - ) - return componentsschemas_attributed_change_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "UNCHANGED"): - raise TypeError() - componentsschemas_attributed_change_type_2 = cast(Literal["UNCHANGED"], data) - if componentsschemas_attributed_change_type_2 != "UNCHANGED": - raise ValueError( - f"/components/schemas/AttributedChange_type_2 must match const 'UNCHANGED', got '{componentsschemas_attributed_change_type_2}'" - ) - return componentsschemas_attributed_change_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "RESOLVED"): - raise TypeError() - componentsschemas_attributed_change_type_3 = cast(Literal["RESOLVED"], data) - if componentsschemas_attributed_change_type_3 != "RESOLVED": - raise ValueError( - f"/components/schemas/AttributedChange_type_3 must match const 'RESOLVED', got '{componentsschemas_attributed_change_type_3}'" - ) - return componentsschemas_attributed_change_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "UNATTRIBUTED"): - raise TypeError() - componentsschemas_attributed_change_type_4 = cast(Literal["UNATTRIBUTED"], data) - if componentsschemas_attributed_change_type_4 != "UNATTRIBUTED": - raise ValueError( - f"/components/schemas/AttributedChange_type_4 must match const 'UNATTRIBUTED', got '{componentsschemas_attributed_change_type_4}'" - ) - return componentsschemas_attributed_change_type_4 - - change = _parse_change(d.pop("change")) - - count = d.pop("count") - - def _parse_revision( - data: object, - ) -> Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"]: - try: - if not (type(data) is str and data == "PROPOSED_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_0 = cast( - Literal["PROPOSED_CODE_REVISION"], data - ) - if componentsschemas_attributed_revision_type_0 != "PROPOSED_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_0 must match const 'PROPOSED_CODE_REVISION', got '{componentsschemas_attributed_revision_type_0}'" - ) - return componentsschemas_attributed_revision_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "BASE_CODE_REVISION"): - raise TypeError() - componentsschemas_attributed_revision_type_1 = cast(Literal["BASE_CODE_REVISION"], data) - if componentsschemas_attributed_revision_type_1 != "BASE_CODE_REVISION": - raise ValueError( - f"/components/schemas/AttributedRevision_type_1 must match const 'BASE_CODE_REVISION', got '{componentsschemas_attributed_revision_type_1}'" - ) - return componentsschemas_attributed_revision_type_1 - - revision = _parse_revision(d.pop("revision")) - - change_count_view = cls( - change=change, - count=count, - revision=revision, - ) - - change_count_view.additional_properties = d - return change_count_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/check_file.py b/proofline/_generated/models/check_file.py new file mode 100644 index 00000000..07e083f3 --- /dev/null +++ b/proofline/_generated/models/check_file.py @@ -0,0 +1,109 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.untrusted_text import UntrustedText + + +T = TypeVar("T", bound="CheckFile") + + +@_attrs_define +class CheckFile: + """One file World cited for a check's result. + + Attributes: + path (UntrustedText): Text that came out of the reviewer model, or out of a repository the model + read. It is data, never markup, never a URL, never an instruction. + + The wrapper exists so the untrustedness cannot be lost on the way to a + renderer: there is no field on a turn that carries this text under a name a + client could mistake for something safe, and unwrapping it is a deliberate + act in the client's own code. + revision (Literal['BASE_CODE_REVISION'] | Literal['PROPOSED_CODE_REVISION']): The revision a cited file was read + at. + """ + + path: UntrustedText + revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + path = self.path.to_dict() + + revision: Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"] + revision = self.revision + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "path": path, + "revision": revision, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.untrusted_text import UntrustedText # noqa: PLC0415 + + d = dict(src_dict) + path = UntrustedText.from_dict(d.pop("path")) + + def _parse_revision( + data: object, + ) -> Literal["BASE_CODE_REVISION"] | Literal["PROPOSED_CODE_REVISION"]: + try: + if not (type(data) is str and data == "PROPOSED_CODE_REVISION"): + raise TypeError() + componentsschemas_check_file_revision_type_0 = cast( + Literal["PROPOSED_CODE_REVISION"], data + ) + if componentsschemas_check_file_revision_type_0 != "PROPOSED_CODE_REVISION": + raise ValueError( + f"/components/schemas/CheckFileRevision_type_0 must match const 'PROPOSED_CODE_REVISION', got '{componentsschemas_check_file_revision_type_0}'" + ) + return componentsschemas_check_file_revision_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "BASE_CODE_REVISION"): + raise TypeError() + componentsschemas_check_file_revision_type_1 = cast(Literal["BASE_CODE_REVISION"], data) + if componentsschemas_check_file_revision_type_1 != "BASE_CODE_REVISION": + raise ValueError( + f"/components/schemas/CheckFileRevision_type_1 must match const 'BASE_CODE_REVISION', got '{componentsschemas_check_file_revision_type_1}'" + ) + return componentsschemas_check_file_revision_type_1 + + revision = _parse_revision(d.pop("revision")) + + check_file = cls( + path=path, + revision=revision, + ) + + check_file.additional_properties = d + return check_file + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/ci_failure_line.py b/proofline/_generated/models/ci_failure_line.py index 0e7431cc..d0d682c7 100644 --- a/proofline/_generated/models/ci_failure_line.py +++ b/proofline/_generated/models/ci_failure_line.py @@ -14,7 +14,7 @@ @_attrs_define class CiFailureLine: - """One failed CI job as the Check states it. + """One failed CI job in the observation. Attributes: attribution (CiFailureAttribution): What the control plane records as a failure's cause. diff --git a/proofline/_generated/models/code_ceiling_stop.py b/proofline/_generated/models/code_ceiling_stop.py new file mode 100644 index 00000000..b84d2e55 --- /dev/null +++ b/proofline/_generated/models/code_ceiling_stop.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="CodeCeilingStop") + + +@_attrs_define +class CodeCeilingStop: + """What a code assessment had read when its head's spending ceiling stopped + it. A rerun of the same commit runs under the same ceiling. + + Attributes: + changed_files (int): The distinct files the reviewed change touched. + unfinished_paths (list[str]): The changed files of each part of the change the ceiling stopped or + never reached, in review order. The assessment may have read some of + their changed lines, so this lists files it did not finish. Empty + when the ceiling stopped it after every part was read. + """ + + changed_files: int + unfinished_paths: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + changed_files = self.changed_files + + unfinished_paths = self.unfinished_paths + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "changed_files": changed_files, + "unfinished_paths": unfinished_paths, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + changed_files = d.pop("changed_files") + + unfinished_paths = cast(list[str], d.pop("unfinished_paths")) + + code_ceiling_stop = cls( + changed_files=changed_files, + unfinished_paths=unfinished_paths, + ) + + code_ceiling_stop.additional_properties = d + return code_ceiling_stop + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/complete_record_view.py b/proofline/_generated/models/complete_record_view.py deleted file mode 100644 index 4c6a23ab..00000000 --- a/proofline/_generated/models/complete_record_view.py +++ /dev/null @@ -1,71 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="CompleteRecordView") - - -@_attrs_define -class CompleteRecordView: - """World's immutable record of the complete answer an omitted list comes - from. - - Attributes: - attribution_digest (str): The `sha256:` digest of the complete attribution in that record. - world_evaluation_id (str): The evaluation World recorded, which holds every condition. - """ - - attribution_digest: str - world_evaluation_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - attribution_digest = self.attribution_digest - - world_evaluation_id = self.world_evaluation_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "attribution_digest": attribution_digest, - "world_evaluation_id": world_evaluation_id, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - attribution_digest = d.pop("attribution_digest") - - world_evaluation_id = d.pop("world_evaluation_id") - - complete_record_view = cls( - attribution_digest=attribution_digest, - world_evaluation_id=world_evaluation_id, - ) - - complete_record_view.additional_properties = d - return complete_record_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/coverage_upload_request.py b/proofline/_generated/models/coverage_upload_request.py index 8f61ca01..1eab6586 100644 --- a/proofline/_generated/models/coverage_upload_request.py +++ b/proofline/_generated/models/coverage_upload_request.py @@ -18,7 +18,7 @@ class CoverageUploadRequest: Attributes: reports (list[UploadedReport]): One to 50 reports, each LCOV, Cobertura XML, `JaCoCo` XML or a Go - cover profile, in a JSON body of at most 64 MiB. + cover profile, in a JSON body of at most 30 MiB. tested_sha (str): The full 40-character commit the tests ran on. GitHub must have it in this repository. A merge commit counts for a pull request head that is one of its two parents. diff --git a/proofline/_generated/models/customer_assessment.py b/proofline/_generated/models/customer_assessment.py index d4def2cd..24de41ad 100644 --- a/proofline/_generated/models/customer_assessment.py +++ b/proofline/_generated/models/customer_assessment.py @@ -12,9 +12,7 @@ if TYPE_CHECKING: from ..models.customer_checks import CustomerChecks - from ..models.customer_decision import CustomerDecision from ..models.customer_finding import CustomerFinding - from ..models.declared_reach_view import DeclaredReachView from ..models.domain_view import DomainView @@ -34,14 +32,6 @@ class CustomerAssessment: status (str): The assessment's recorded status, such as `RUNNING`, `COMPLETED` or `INCOMPLETE`. completed_at (datetime.datetime | None | Unset): When the assessment completed. Null while it has not. - decision_presentation (CustomerDecision | None | Unset): The retained decision disclosure, which grants no - deployment - authorization. Absent when none is recorded and the review kind - records no decision basis. - declared_reach (DeclaredReachView | None | Unset): What World declares depends on what this change deploys in - this - environment, at the assessment's pinned snapshot. Absent when the - assessment's kind records no declared reach. incompleteness_kind (None | str | Unset): Why an `INCOMPLETE` assessment is incomplete: `NOT_CONFIGURED`, `POLICY_EXCLUDED`, `EVIDENCE_UNAVAILABLE`, `HYPOTHESES_UNRESOLVED` or `MODEL_BUDGET_EXHAUSTED`. Absent otherwise; an unclassified gap is not a @@ -61,8 +51,6 @@ class CustomerAssessment: id: UUID status: str completed_at: datetime.datetime | None | Unset = UNSET - decision_presentation: CustomerDecision | None | Unset = UNSET - declared_reach: DeclaredReachView | None | Unset = UNSET incompleteness_kind: None | str | Unset = UNSET reason_codes: list[str] | None | Unset = UNSET release_evidence_gap: None | str | Unset = UNSET @@ -70,9 +58,6 @@ class CustomerAssessment: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.customer_decision import CustomerDecision # noqa: PLC0415 - from ..models.declared_reach_view import DeclaredReachView # noqa: PLC0415 - checks = self.checks.to_dict() domains = [] @@ -99,22 +84,6 @@ def to_dict(self) -> dict[str, Any]: else: completed_at = self.completed_at - decision_presentation: dict[str, Any] | None | Unset - if isinstance(self.decision_presentation, Unset): - decision_presentation = UNSET - elif isinstance(self.decision_presentation, CustomerDecision): - decision_presentation = self.decision_presentation.to_dict() - else: - decision_presentation = self.decision_presentation - - declared_reach: dict[str, Any] | None | Unset - if isinstance(self.declared_reach, Unset): - declared_reach = UNSET - elif isinstance(self.declared_reach, DeclaredReachView): - declared_reach = self.declared_reach.to_dict() - else: - declared_reach = self.declared_reach - incompleteness_kind: None | str | Unset if isinstance(self.incompleteness_kind, Unset): incompleteness_kind = UNSET @@ -158,10 +127,6 @@ def to_dict(self) -> dict[str, Any]: ) if completed_at is not UNSET: field_dict["completed_at"] = completed_at - if decision_presentation is not UNSET: - field_dict["decision_presentation"] = decision_presentation - if declared_reach is not UNSET: - field_dict["declared_reach"] = declared_reach if incompleteness_kind is not UNSET: field_dict["incompleteness_kind"] = incompleteness_kind if reason_codes is not UNSET: @@ -176,9 +141,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.customer_checks import CustomerChecks # noqa: PLC0415 - from ..models.customer_decision import CustomerDecision # noqa: PLC0415 from ..models.customer_finding import CustomerFinding # noqa: PLC0415 - from ..models.declared_reach_view import DeclaredReachView # noqa: PLC0415 from ..models.domain_view import DomainView # noqa: PLC0415 d = dict(src_dict) @@ -221,40 +184,6 @@ def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_decision_presentation(data: object) -> CustomerDecision | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - decision_presentation_type_0 = CustomerDecision.from_dict(data) - - return decision_presentation_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CustomerDecision | None | Unset, data) - - decision_presentation = _parse_decision_presentation(d.pop("decision_presentation", UNSET)) - - def _parse_declared_reach(data: object) -> DeclaredReachView | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - declared_reach_type_0 = DeclaredReachView.from_dict(data) - - return declared_reach_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DeclaredReachView | None | Unset, data) - - declared_reach = _parse_declared_reach(d.pop("declared_reach", UNSET)) - def _parse_incompleteness_kind(data: object) -> None | str | Unset: if data is None: return data @@ -315,8 +244,6 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: id=id, status=status, completed_at=completed_at, - decision_presentation=decision_presentation, - declared_reach=declared_reach, incompleteness_kind=incompleteness_kind, reason_codes=reason_codes, release_evidence_gap=release_evidence_gap, diff --git a/proofline/_generated/models/customer_assessment_detail.py b/proofline/_generated/models/customer_assessment_detail.py index c8c32bdf..4c2198a0 100644 --- a/proofline/_generated/models/customer_assessment_detail.py +++ b/proofline/_generated/models/customer_assessment_detail.py @@ -12,9 +12,7 @@ if TYPE_CHECKING: from ..models.customer_checks import CustomerChecks - from ..models.customer_decision import CustomerDecision from ..models.customer_finding import CustomerFinding - from ..models.declared_reach_view import DeclaredReachView from ..models.domain_view import DomainView from ..models.subject_view import SubjectView @@ -38,14 +36,6 @@ class CustomerAssessmentDetail: subjects (list[SubjectView]): The review subjects this assessment's own release set authorized, plus each `PRIMARY` subject that carries no release authorization. completed_at (datetime.datetime | None | Unset): When the assessment completed. Null while it has not. - decision_presentation (CustomerDecision | None | Unset): The retained decision disclosure, which grants no - deployment - authorization. Absent when none is recorded and the review kind - records no decision basis. - declared_reach (DeclaredReachView | None | Unset): What World declares depends on what this change deploys in - this - environment, at the assessment's pinned snapshot. Absent when the - assessment's kind records no declared reach. incompleteness_kind (None | str | Unset): Why an `INCOMPLETE` assessment is incomplete: `NOT_CONFIGURED`, `POLICY_EXCLUDED`, `EVIDENCE_UNAVAILABLE`, `HYPOTHESES_UNRESOLVED` or `MODEL_BUDGET_EXHAUSTED`. Absent otherwise; an unclassified gap is not a @@ -67,8 +57,6 @@ class CustomerAssessmentDetail: status: str subjects: list[SubjectView] completed_at: datetime.datetime | None | Unset = UNSET - decision_presentation: CustomerDecision | None | Unset = UNSET - declared_reach: DeclaredReachView | None | Unset = UNSET incompleteness_kind: None | str | Unset = UNSET reason_codes: list[str] | None | Unset = UNSET release_evidence_gap: None | str | Unset = UNSET @@ -76,9 +64,6 @@ class CustomerAssessmentDetail: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.customer_decision import CustomerDecision # noqa: PLC0415 - from ..models.declared_reach_view import DeclaredReachView # noqa: PLC0415 - checks = self.checks.to_dict() domains = [] @@ -112,22 +97,6 @@ def to_dict(self) -> dict[str, Any]: else: completed_at = self.completed_at - decision_presentation: dict[str, Any] | None | Unset - if isinstance(self.decision_presentation, Unset): - decision_presentation = UNSET - elif isinstance(self.decision_presentation, CustomerDecision): - decision_presentation = self.decision_presentation.to_dict() - else: - decision_presentation = self.decision_presentation - - declared_reach: dict[str, Any] | None | Unset - if isinstance(self.declared_reach, Unset): - declared_reach = UNSET - elif isinstance(self.declared_reach, DeclaredReachView): - declared_reach = self.declared_reach.to_dict() - else: - declared_reach = self.declared_reach - incompleteness_kind: None | str | Unset if isinstance(self.incompleteness_kind, Unset): incompleteness_kind = UNSET @@ -173,10 +142,6 @@ def to_dict(self) -> dict[str, Any]: ) if completed_at is not UNSET: field_dict["completed_at"] = completed_at - if decision_presentation is not UNSET: - field_dict["decision_presentation"] = decision_presentation - if declared_reach is not UNSET: - field_dict["declared_reach"] = declared_reach if incompleteness_kind is not UNSET: field_dict["incompleteness_kind"] = incompleteness_kind if reason_codes is not UNSET: @@ -191,9 +156,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.customer_checks import CustomerChecks # noqa: PLC0415 - from ..models.customer_decision import CustomerDecision # noqa: PLC0415 from ..models.customer_finding import CustomerFinding # noqa: PLC0415 - from ..models.declared_reach_view import DeclaredReachView # noqa: PLC0415 from ..models.domain_view import DomainView # noqa: PLC0415 from ..models.subject_view import SubjectView # noqa: PLC0415 @@ -246,40 +209,6 @@ def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_decision_presentation(data: object) -> CustomerDecision | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - decision_presentation_type_0 = CustomerDecision.from_dict(data) - - return decision_presentation_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CustomerDecision | None | Unset, data) - - decision_presentation = _parse_decision_presentation(d.pop("decision_presentation", UNSET)) - - def _parse_declared_reach(data: object) -> DeclaredReachView | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - declared_reach_type_0 = DeclaredReachView.from_dict(data) - - return declared_reach_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(DeclaredReachView | None | Unset, data) - - declared_reach = _parse_declared_reach(d.pop("declared_reach", UNSET)) - def _parse_incompleteness_kind(data: object) -> None | str | Unset: if data is None: return data @@ -342,8 +271,6 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: status=status, subjects=subjects, completed_at=completed_at, - decision_presentation=decision_presentation, - declared_reach=declared_reach, incompleteness_kind=incompleteness_kind, reason_codes=reason_codes, release_evidence_gap=release_evidence_gap, diff --git a/proofline/_generated/models/customer_check.py b/proofline/_generated/models/customer_check.py index 20c8056c..c6293414 100644 --- a/proofline/_generated/models/customer_check.py +++ b/proofline/_generated/models/customer_check.py @@ -9,7 +9,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.change_attribution_view import ChangeAttributionView + from ..models.check_file import CheckFile T = TypeVar("T", bound="CustomerCheck") @@ -19,6 +19,9 @@ class CustomerCheck: """ Attributes: + files (list[CheckFile]): The files World cited as evidence for this result, once each in + World's order, with the revision World read each at. Empty when World + cited no file, and on results recorded before World cited files. lifecycle (Literal['GATING'] | Literal['QUARANTINED'] | Literal['RETIRED'] | Literal['SHADOW'] | Literal['UNKNOWN']): World's lifecycle disclosure for the evaluator version that answered, as the receipt recorded it. A deployment gate counts only `GATING` results @@ -28,11 +31,6 @@ class CustomerCheck: outcome (str): The outcome the receipt recorded, which is the outcome a deployment gate weighed: `READY`, `BLOCKED`, `UNRESOLVED`, `UNAVAILABLE`, `NOT_APPLICABLE` or `NOT_ASKED`. A verdict never rewrites it. - change_attribution (ChangeAttributionView | None | Unset): Which conditions behind the outcome the change - brought and which were - already at the review's base revision. It never changes the outcome: - a condition already at the base is pre-existing, not safe. Absent for - a check whose evaluator does not compare the two revisions. detail (None | str | Unset): Why World refused the check, or otherwise World's recorded explanation of the result. Null when neither is recorded. evaluated_at (None | str | Unset): When World evaluated this answer. A reused answer is evidence from @@ -43,6 +41,7 @@ class CustomerCheck: verdict names none of these reasons. """ + files: list[CheckFile] lifecycle: ( Literal["GATING"] | Literal["QUARANTINED"] @@ -52,7 +51,6 @@ class CustomerCheck: ) name: str outcome: str - change_attribution: ChangeAttributionView | None | Unset = UNSET detail: None | str | Unset = UNSET evaluated_at: None | str | Unset = UNSET unresolved_reason: ( @@ -65,7 +63,10 @@ class CustomerCheck: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.change_attribution_view import ChangeAttributionView # noqa: PLC0415 + files = [] + for files_item_data in self.files: + files_item = files_item_data.to_dict() + files.append(files_item) lifecycle: ( Literal["GATING"] @@ -80,14 +81,6 @@ def to_dict(self) -> dict[str, Any]: outcome = self.outcome - change_attribution: dict[str, Any] | None | Unset - if isinstance(self.change_attribution, Unset): - change_attribution = UNSET - elif isinstance(self.change_attribution, ChangeAttributionView): - change_attribution = self.change_attribution.to_dict() - else: - change_attribution = self.change_attribution - detail: None | str | Unset if isinstance(self.detail, Unset): detail = UNSET @@ -116,13 +109,12 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "files": files, "lifecycle": lifecycle, "name": name, "outcome": outcome, } ) - if change_attribution is not UNSET: - field_dict["change_attribution"] = change_attribution if detail is not UNSET: field_dict["detail"] = detail if evaluated_at is not UNSET: @@ -134,9 +126,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.change_attribution_view import ChangeAttributionView # noqa: PLC0415 + from ..models.check_file import CheckFile # noqa: PLC0415 d = dict(src_dict) + files = [] + _files = d.pop("files") + for files_item_data in _files: + files_item = CheckFile.from_dict(files_item_data) + + files.append(files_item) def _parse_lifecycle( data: object, @@ -206,23 +204,6 @@ def _parse_lifecycle( outcome = d.pop("outcome") - def _parse_change_attribution(data: object) -> ChangeAttributionView | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - change_attribution_type_0 = ChangeAttributionView.from_dict(data) - - return change_attribution_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(ChangeAttributionView | None | Unset, data) - - change_attribution = _parse_change_attribution(d.pop("change_attribution", UNSET)) - def _parse_detail(data: object) -> None | str | Unset: if data is None: return data @@ -301,10 +282,10 @@ def _parse_unresolved_reason( unresolved_reason = _parse_unresolved_reason(d.pop("unresolved_reason", UNSET)) customer_check = cls( + files=files, lifecycle=lifecycle, name=name, outcome=outcome, - change_attribution=change_attribution, detail=detail, evaluated_at=evaluated_at, unresolved_reason=unresolved_reason, diff --git a/proofline/_generated/models/customer_code_assessment.py b/proofline/_generated/models/customer_code_assessment.py index 72c38480..2d8c5077 100644 --- a/proofline/_generated/models/customer_code_assessment.py +++ b/proofline/_generated/models/customer_code_assessment.py @@ -12,6 +12,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.code_ceiling_stop import CodeCeilingStop from ..models.customer_finding import CustomerFinding @@ -32,10 +33,20 @@ class CustomerCodeAssessment: status (CodeAssessmentStatusType0 | Literal['EXCLUDED']): A code assessment's recorded execution status. It is never a verdict on the change: only `COMPLETED` says the assessment covered what it read. + ceiling_stop (CodeCeilingStop | None | Unset): How much of the change the code assessment read before its head's + spending ceiling stopped it. Null for every other ending, and for an + assessment that recorded no change map. completed_at (datetime.datetime | None | Unset): When the code assessment ended. Null while it has not. + coverage_details (list[str] | Unset): Recorded check coverage counts and fixed cancellation causes, without + source text. + Absent coverage does not establish that every check ran. incompleteness_kind (None | str | Unset): Why an `INCOMPLETE` code assessment is incomplete: `NOT_CONFIGURED`, `POLICY_EXCLUDED`, `EVIDENCE_UNAVAILABLE`, `HYPOTHESES_UNRESOLVED` or `MODEL_BUDGET_EXHAUSTED`. Null otherwise. + reason_codes (list[str] | None | Unset): Public causes of an `INCOMPLETE` code assessment: `OUT_OF_CREDITS` + when credits refused its model, and `MODEL_ANSWER_WITHHELD` when the + credential mask withheld its model's answer after the source was read. + Absent otherwise; other recorded details stay private. started_at (datetime.datetime | None | Unset): When the code assessment started. Null until it starts. """ @@ -44,12 +55,17 @@ class CustomerCodeAssessment: head_commit_sha: str id: UUID status: CodeAssessmentStatusType0 | Literal["EXCLUDED"] + ceiling_stop: CodeCeilingStop | None | Unset = UNSET completed_at: datetime.datetime | None | Unset = UNSET + coverage_details: list[str] | Unset = UNSET incompleteness_kind: None | str | Unset = UNSET + reason_codes: list[str] | None | Unset = UNSET started_at: datetime.datetime | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.code_ceiling_stop import CodeCeilingStop # noqa: PLC0415 + base_commit_sha = self.base_commit_sha findings = [] @@ -67,6 +83,14 @@ def to_dict(self) -> dict[str, Any]: else: status = self.status + ceiling_stop: dict[str, Any] | None | Unset + if isinstance(self.ceiling_stop, Unset): + ceiling_stop = UNSET + elif isinstance(self.ceiling_stop, CodeCeilingStop): + ceiling_stop = self.ceiling_stop.to_dict() + else: + ceiling_stop = self.ceiling_stop + completed_at: None | str | Unset if isinstance(self.completed_at, Unset): completed_at = UNSET @@ -75,12 +99,25 @@ def to_dict(self) -> dict[str, Any]: else: completed_at = self.completed_at + coverage_details: list[str] | Unset = UNSET + if not isinstance(self.coverage_details, Unset): + coverage_details = self.coverage_details + incompleteness_kind: None | str | Unset if isinstance(self.incompleteness_kind, Unset): incompleteness_kind = UNSET else: incompleteness_kind = self.incompleteness_kind + reason_codes: list[str] | None | Unset + if isinstance(self.reason_codes, Unset): + reason_codes = UNSET + elif isinstance(self.reason_codes, list): + reason_codes = self.reason_codes + + else: + reason_codes = self.reason_codes + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET @@ -100,10 +137,16 @@ def to_dict(self) -> dict[str, Any]: "status": status, } ) + if ceiling_stop is not UNSET: + field_dict["ceiling_stop"] = ceiling_stop if completed_at is not UNSET: field_dict["completed_at"] = completed_at + if coverage_details is not UNSET: + field_dict["coverage_details"] = coverage_details if incompleteness_kind is not UNSET: field_dict["incompleteness_kind"] = incompleteness_kind + if reason_codes is not UNSET: + field_dict["reason_codes"] = reason_codes if started_at is not UNSET: field_dict["started_at"] = started_at @@ -111,6 +154,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.code_ceiling_stop import CodeCeilingStop # noqa: PLC0415 from ..models.customer_finding import CustomerFinding # noqa: PLC0415 d = dict(src_dict) @@ -147,6 +191,23 @@ def _parse_status(data: object) -> CodeAssessmentStatusType0 | Literal["EXCLUDED status = _parse_status(d.pop("status")) + def _parse_ceiling_stop(data: object) -> CodeCeilingStop | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + ceiling_stop_type_0 = CodeCeilingStop.from_dict(data) + + return ceiling_stop_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(CodeCeilingStop | None | Unset, data) + + ceiling_stop = _parse_ceiling_stop(d.pop("ceiling_stop", UNSET)) + def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data @@ -164,6 +225,8 @@ def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + coverage_details = cast(list[str], d.pop("coverage_details", UNSET)) + def _parse_incompleteness_kind(data: object) -> None | str | Unset: if data is None: return data @@ -173,6 +236,23 @@ def _parse_incompleteness_kind(data: object) -> None | str | Unset: incompleteness_kind = _parse_incompleteness_kind(d.pop("incompleteness_kind", UNSET)) + def _parse_reason_codes(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + reason_codes_type_0 = cast(list[str], data) + + return reason_codes_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + reason_codes = _parse_reason_codes(d.pop("reason_codes", UNSET)) + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data @@ -196,8 +276,11 @@ def _parse_started_at(data: object) -> datetime.datetime | None | Unset: head_commit_sha=head_commit_sha, id=id, status=status, + ceiling_stop=ceiling_stop, completed_at=completed_at, + coverage_details=coverage_details, incompleteness_kind=incompleteness_kind, + reason_codes=reason_codes, started_at=started_at, ) diff --git a/proofline/_generated/models/customer_decision.py b/proofline/_generated/models/customer_decision.py deleted file mode 100644 index 516be9b2..00000000 --- a/proofline/_generated/models/customer_decision.py +++ /dev/null @@ -1,168 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.authority import Authority -from ..models.availability_type_0 import AvailabilityType0 -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.customer_decision_basis import CustomerDecisionBasis - from ..models.gate_state import GateState - - -T = TypeVar("T", bound="CustomerDecision") - - -@_attrs_define -class CustomerDecision: - """ - Attributes: - authority (Authority): - availability (AvailabilityType0 | Literal['LIMITED']): - basis (CustomerDecisionBasis | None | Unset): The permission, evidence classification and reason code of the - verified recorded basis. Null when no verified basis is recorded. - gate_state (GateState | None | Unset): The local deployment gate state and any recorded override. Null unless - the decision belongs to a deployment gate. - """ - - authority: Authority - availability: AvailabilityType0 | Literal["LIMITED"] - basis: CustomerDecisionBasis | None | Unset = UNSET - gate_state: GateState | None | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.customer_decision_basis import CustomerDecisionBasis # noqa: PLC0415 - from ..models.gate_state import GateState # noqa: PLC0415 - - authority = self.authority.value - - availability: Literal["LIMITED"] | str - if isinstance(self.availability, AvailabilityType0): - availability = self.availability.value - else: - availability = self.availability - - basis: dict[str, Any] | None | Unset - if isinstance(self.basis, Unset): - basis = UNSET - elif isinstance(self.basis, CustomerDecisionBasis): - basis = self.basis.to_dict() - else: - basis = self.basis - - gate_state: dict[str, Any] | None | Unset - if isinstance(self.gate_state, Unset): - gate_state = UNSET - elif isinstance(self.gate_state, GateState): - gate_state = self.gate_state.to_dict() - else: - gate_state = self.gate_state - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "authority": authority, - "availability": availability, - } - ) - if basis is not UNSET: - field_dict["basis"] = basis - if gate_state is not UNSET: - field_dict["gate_state"] = gate_state - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.customer_decision_basis import CustomerDecisionBasis # noqa: PLC0415 - from ..models.gate_state import GateState # noqa: PLC0415 - - d = dict(src_dict) - authority = Authority(d.pop("authority")) - - def _parse_availability(data: object) -> AvailabilityType0 | Literal["LIMITED"]: - try: - if not isinstance(data, str): - raise TypeError() - componentsschemas_availability_type_0 = AvailabilityType0(data) - - return componentsschemas_availability_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "LIMITED"): - raise TypeError() - componentsschemas_availability_type_1 = cast(Literal["LIMITED"], data) - if componentsschemas_availability_type_1 != "LIMITED": - raise ValueError( - f"/components/schemas/Availability_type_1 must match const 'LIMITED', got '{componentsschemas_availability_type_1}'" - ) - return componentsschemas_availability_type_1 - - availability = _parse_availability(d.pop("availability")) - - def _parse_basis(data: object) -> CustomerDecisionBasis | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - basis_type_0 = CustomerDecisionBasis.from_dict(data) - - return basis_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(CustomerDecisionBasis | None | Unset, data) - - basis = _parse_basis(d.pop("basis", UNSET)) - - def _parse_gate_state(data: object) -> GateState | None | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - gate_state_type_0 = GateState.from_dict(data) - - return gate_state_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(GateState | None | Unset, data) - - gate_state = _parse_gate_state(d.pop("gate_state", UNSET)) - - customer_decision = cls( - authority=authority, - availability=availability, - basis=basis, - gate_state=gate_state, - ) - - customer_decision.additional_properties = d - return customer_decision - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/customer_decision_basis.py b/proofline/_generated/models/customer_decision_basis.py deleted file mode 100644 index 828770ef..00000000 --- a/proofline/_generated/models/customer_decision_basis.py +++ /dev/null @@ -1,80 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.evidence_view import EvidenceView -from ..models.permission_view import PermissionView - -T = TypeVar("T", bound="CustomerDecisionBasis") - - -@_attrs_define -class CustomerDecisionBasis: - """ - Attributes: - evidence (EvidenceView): - permission (PermissionView): - reason_code (str): The reason code the recorded basis gives for its permission. - """ - - evidence: EvidenceView - permission: PermissionView - reason_code: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - evidence = self.evidence.value - - permission = self.permission.value - - reason_code = self.reason_code - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "evidence": evidence, - "permission": permission, - "reason_code": reason_code, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - evidence = EvidenceView(d.pop("evidence")) - - permission = PermissionView(d.pop("permission")) - - reason_code = d.pop("reason_code") - - customer_decision_basis = cls( - evidence=evidence, - permission=permission, - reason_code=reason_code, - ) - - customer_decision_basis.additional_properties = d - return customer_decision_basis - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/customer_finding.py b/proofline/_generated/models/customer_finding.py index 55ea189e..6458cf8c 100644 --- a/proofline/_generated/models/customer_finding.py +++ b/proofline/_generated/models/customer_finding.py @@ -115,9 +115,7 @@ class CustomerFinding: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.comment_address_evaluation_view import ( - CommentAddressEvaluationView, # noqa: PLC0415 - ) + from ..models.comment_address_evaluation_view import CommentAddressEvaluationView # noqa: PLC0415 from ..models.customer_finding_validation import CustomerFindingValidation # noqa: PLC0415 from ..models.finding_causal_graph_view import FindingCausalGraphView # noqa: PLC0415 from ..models.finding_placement_view import FindingPlacementView # noqa: PLC0415 @@ -287,9 +285,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.comment_address_evaluation_view import ( - CommentAddressEvaluationView, # noqa: PLC0415 - ) + from ..models.comment_address_evaluation_view import CommentAddressEvaluationView # noqa: PLC0415 from ..models.comment_reaction_view import CommentReactionView # noqa: PLC0415 from ..models.customer_evidence_ref import CustomerEvidenceRef # noqa: PLC0415 from ..models.customer_finding_validation import CustomerFindingValidation # noqa: PLC0415 diff --git a/proofline/_generated/models/customer_finding_validation.py b/proofline/_generated/models/customer_finding_validation.py index 8cfc35ca..226cc225 100644 --- a/proofline/_generated/models/customer_finding_validation.py +++ b/proofline/_generated/models/customer_finding_validation.py @@ -25,6 +25,8 @@ class CustomerFindingValidation: actor_github_user_id (int | None | Unset): The actor's stable GitHub user ID. Null for the automatic decision. actor_login (None | str | Unset): The actor's GitHub login, a display label to render as text. Null for the automatic decision. + actor_name (None | str | Unset): The actor's GitHub profile name, when known. Lead with it; the login + is the fallback. Null for the automatic decision. covering_author_kind (None | str | Unset): For `ALREADY_COVERED`, `HUMAN` or `BOT`. Null for every other decision. covering_author_login (None | str | Unset): For `ALREADY_COVERED`, the login of whoever wrote the covering @@ -42,6 +44,7 @@ class CustomerFindingValidation: validation: str actor_github_user_id: int | None | Unset = UNSET actor_login: None | str | Unset = UNSET + actor_name: None | str | Unset = UNSET covering_author_kind: None | str | Unset = UNSET covering_author_login: None | str | Unset = UNSET covering_comment_created_at: datetime.datetime | None | Unset = UNSET @@ -67,6 +70,12 @@ def to_dict(self) -> dict[str, Any]: else: actor_login = self.actor_login + actor_name: None | str | Unset + if isinstance(self.actor_name, Unset): + actor_name = UNSET + else: + actor_name = self.actor_name + covering_author_kind: None | str | Unset if isinstance(self.covering_author_kind, Unset): covering_author_kind = UNSET @@ -106,6 +115,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["actor_github_user_id"] = actor_github_user_id if actor_login is not UNSET: field_dict["actor_login"] = actor_login + if actor_name is not UNSET: + field_dict["actor_name"] = actor_name if covering_author_kind is not UNSET: field_dict["covering_author_kind"] = covering_author_kind if covering_author_login is not UNSET: @@ -144,6 +155,15 @@ def _parse_actor_login(data: object) -> None | str | Unset: actor_login = _parse_actor_login(d.pop("actor_login", UNSET)) + def _parse_actor_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + actor_name = _parse_actor_name(d.pop("actor_name", UNSET)) + def _parse_covering_author_kind(data: object) -> None | str | Unset: if data is None: return data @@ -196,6 +216,7 @@ def _parse_github_comment_url(data: object) -> None | str | Unset: validation=validation, actor_github_user_id=actor_github_user_id, actor_login=actor_login, + actor_name=actor_name, covering_author_kind=covering_author_kind, covering_author_login=covering_author_login, covering_comment_created_at=covering_comment_created_at, diff --git a/proofline/_generated/models/customer_review_detail.py b/proofline/_generated/models/customer_review_detail.py index 12034d25..8fdbecaa 100644 --- a/proofline/_generated/models/customer_review_detail.py +++ b/proofline/_generated/models/customer_review_detail.py @@ -2,12 +2,13 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.incomplete_cause_type_0 import IncompleteCauseType0 from ..models.patch_trigger_source import PatchTriggerSource from ..types import UNSET, Unset @@ -18,14 +19,18 @@ from ..models.customer_assessment import CustomerAssessment from ..models.customer_code_assessment import CustomerCodeAssessment from ..models.deep_review_escalation import DeepReviewEscalation + from ..models.environment_check import EnvironmentCheck from ..models.local_reverification import LocalReverification from ..models.open_items_view import OpenItemsView + from ..models.provider_wait import ProviderWait from ..models.pull_request_merge_gate import PullRequestMergeGate from ..models.refresh_view import RefreshView from ..models.related_review import RelatedReview from ..models.review_actions import ReviewActions from ..models.review_diff_stats import ReviewDiffStats + from ..models.review_investigation_finding import ReviewInvestigationFinding from ..models.review_open_items import ReviewOpenItems + from ..models.run_progress import RunProgress from ..models.subject_view import SubjectView from ..models.walkthrough_view import WalkthroughView @@ -46,8 +51,10 @@ class CustomerReviewDetail: finding_count (int): How many findings this review's assessments recorded, across all of them. id (UUID): The review's identifier. kind (str): `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes - sent as a patch, `COMMIT`, a review of pushed commits, or `FILES`, - complete selected files at one pushed commit. + sent as a patch, `COMMIT`, a review of pushed commits, `FILES`, + complete selected files at one pushed commit, `MERGE_GROUP`, the + commit GitHub's merge queue built for a group of pull requests, or + `REVISION_SCAN`, a scan of one captured commit. public_key (str): The review's stable public address: `rev_` followed by its identifier without hyphens. publication (str): Whether the review reached the pull request: `PUBLISHED`, `WITHHELD`, `PUBLICATION_REQUESTED` or `PUBLICATION_REFUSED`. A review run from @@ -94,6 +101,14 @@ class CustomerReviewDetail: head GitHub does not have. completed_at (datetime.datetime | None | Unset): When the review reached a terminal status. Absent while it is still pending or running. + cost_microcredits (int | None | Unset): The credits this run was charged so far, in microcredits, whoever + paid: the plan, the free review month or the organization's credits. + Null for a caller who is not a member of the organization. + counted_incomplete_causes (list[IncompleteCauseType0 | Literal['OUT_OF_CREDITS'] | Literal['UNKNOWN']] | Unset): + `incomplete_causes` as the Inbox and the reviews `cause:` search + count them: `OUT_OF_CREDITS` in place of the `NOT_CONFIGURED` an + assessment records when credits refused it. Present exactly when + `incomplete_causes` is. current_head_commit_sha (None | str | Unset): The pull request's head commit as the latest provider projection reports it, which can differ from `head_commit_sha`. Set only on a single-review read, and absent for a deployment review or a pull request with no projection. @@ -103,6 +118,10 @@ class CustomerReviewDetail: diff_stats (None | ReviewDiffStats | Unset): Line totals from this run's pinned comparison. Null until recorded, or when the provider's changed-file list was incomplete. + environments (list[EnvironmentCheck] | Unset): For a pull-request review, each environment its repository linked + when the review was created and each environment it assessed, with + whether the review checked it and why not. Absent for any other + review, and when the repository links no environment. fix_generation_enabled (bool | Unset): Whether fix generation is configured for this deployment and organization. Write authorization is checked again when a fix is requested. @@ -113,6 +132,15 @@ class CustomerReviewDetail: branch moves, the reviewed input does not. Absent for a patch review. head_ref (None | str | Unset): The pull request's head branch name as last recorded from GitHub, for orientation only. Null when no pull request state is recorded. + incomplete_causes (list[IncompleteCauseType0 | Literal['UNKNOWN']] | Unset): Why an `INCOMPLETE` review ended + incomplete, as its incomplete + assessments recorded it, in name order. `UNKNOWN` alone when none + recorded a cause. Absent for every other status, and on reads other + than the reviews list and a single review. + investigation_findings (list[ReviewInvestigationFinding] | Unset): The supported findings of each environment + investigation this review + published, by assessment in recorded order, including those the + pull-request Check left off its list. Absent when there are none. is_deep_review (bool | Unset): Present and true when this run is a Deep Review. local_reverifications (list[LocalReverification] | Unset): For a patch review requested with `verify_finding_ids`, each finding @@ -122,12 +150,19 @@ class CustomerReviewDetail: merge_gate (None | PullRequestMergeGate | Unset): The deterministic policy for this exact repository/head, when opted in. Its captured review owner and GitHub bypass remain separate history. + merge_group_pull_request_numbers (list[int] | Unset): For a `MERGE_GROUP` review, the pull requests GitHub + queued in the + group, in number order. Absent for every other kind, and until + Proofline has read the group's members. open_items (None | OpenItemsView | Unset): What Proofline still has open for the reviewed head, counted from the current finding decisions. Absent while the review is `PENDING` or `RUNNING`. open_items_observation (None | ReviewOpenItems | Unset): Dated PR counts with head, evaluated-scope and bounded thread proof. Absent when that observation is unavailable; scalar counts remain separate. + provider_wait (None | ProviderWait | Unset): What holds the review now: GitHub's rate limit, and when it resets. + Null unless one of the review's runs waits for it, and once the run + continues. publication_detail (None | str | Unset): Why a publication was refused, or how one failed. Server text. pull_request_author_avatar_url (None | str | Unset): Provider-supplied avatar URL. Login-derived `.png` URLs do not work for @@ -137,6 +172,9 @@ class CustomerReviewDetail: never display text. Absent when GitHub named no author. pull_request_author_login (None | str | Unset): Provider display metadata for the pull request author, not the rerun requester. + pull_request_author_name (None | str | Unset): The author's GitHub profile name, when known. Lead with it; the + login + is the fallback. Display metadata, never identity. pull_request_author_url (None | str | Unset): The author's profile on the deployment's GitHub host. Absent when no author login is known. pull_request_number (int | None | Unset): The pull request number. Absent for a deployment or patch review. @@ -158,14 +196,20 @@ class CustomerReviewDetail: repository. repository_url (None | str | Unset): The repository on GitHub. Absent when the deployment's web base cannot be joined with the stored name. - requested_by (ActorView | None | Unset): Who asked for this review, for a review a person requested. Null on - automatic reviews and on reviews recorded before requesters were. + requested_by (ActorView | None | Unset): Who asked for this review, for the reviews a person asked for: the + run-now button, a rerun, a pull request `review` command, or local + changes and pushed commits sent from the CLI or an editor. Absent on + automatic reviews, and on reviews recorded before requesters were. review_comment_url (None | str | Unset): The pull request review Proofline submitted for this review. Null when it submitted none. review_retracted_at (datetime.datetime | None | Unset): When a submitted pull request review was marked retracted, a marker only older versions set. Null otherwise. run_number (int | None | Unset): One-based, append-only ordinal within one repository pull request. + run_progress (None | RunProgress | Unset): Where an unfinished review's runs stand: running, queued for a + worker, + waiting for a scheduled step, or due again after an attempt that did + not finish. Null once the review has ended. stopped_at (datetime.datetime | None | Unset): When the review was stopped. Null unless it was stopped. stopped_by (ActorView | None | Unset): Who stopped this review, for a `STOPPED` review whose stop recorded its actor. Null otherwise. @@ -209,22 +253,32 @@ class CustomerReviewDetail: code_assessment: CustomerCodeAssessment | None | Unset = UNSET compare_url: None | str | Unset = UNSET completed_at: datetime.datetime | None | Unset = UNSET + cost_microcredits: int | None | Unset = UNSET + counted_incomplete_causes: ( + list[IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]] | Unset + ) = UNSET current_head_commit_sha: None | str | Unset = UNSET deep_review_escalation: DeepReviewEscalation | None | Unset = UNSET diff_stats: None | ReviewDiffStats | Unset = UNSET + environments: list[EnvironmentCheck] | Unset = UNSET fix_generation_enabled: bool | Unset = UNSET head_commit_sha: None | str | Unset = UNSET head_commit_url: None | str | Unset = UNSET head_ref: None | str | Unset = UNSET + incomplete_causes: list[IncompleteCauseType0 | Literal["UNKNOWN"]] | Unset = UNSET + investigation_findings: list[ReviewInvestigationFinding] | Unset = UNSET is_deep_review: bool | Unset = UNSET local_reverifications: list[LocalReverification] | Unset = UNSET merge_gate: None | PullRequestMergeGate | Unset = UNSET + merge_group_pull_request_numbers: list[int] | Unset = UNSET open_items: None | OpenItemsView | Unset = UNSET open_items_observation: None | ReviewOpenItems | Unset = UNSET + provider_wait: None | ProviderWait | Unset = UNSET publication_detail: None | str | Unset = UNSET pull_request_author_avatar_url: None | str | Unset = UNSET pull_request_author_github_user_id: int | None | Unset = UNSET pull_request_author_login: None | str | Unset = UNSET + pull_request_author_name: None | str | Unset = UNSET pull_request_author_url: None | str | Unset = UNSET pull_request_number: int | None | Unset = UNSET pull_request_state: None | str | Unset = UNSET @@ -239,6 +293,7 @@ class CustomerReviewDetail: review_comment_url: None | str | Unset = UNSET review_retracted_at: datetime.datetime | None | Unset = UNSET run_number: int | None | Unset = UNSET + run_progress: None | RunProgress | Unset = UNSET stopped_at: datetime.datetime | None | Unset = UNSET stopped_by: ActorView | None | Unset = UNSET stopped_from: None | str | Unset = UNSET @@ -254,10 +309,12 @@ def to_dict(self) -> dict[str, Any]: from ..models.customer_code_assessment import CustomerCodeAssessment # noqa: PLC0415 from ..models.deep_review_escalation import DeepReviewEscalation # noqa: PLC0415 from ..models.open_items_view import OpenItemsView # noqa: PLC0415 + from ..models.provider_wait import ProviderWait # noqa: PLC0415 from ..models.pull_request_merge_gate import PullRequestMergeGate # noqa: PLC0415 from ..models.refresh_view import RefreshView # noqa: PLC0415 from ..models.review_diff_stats import ReviewDiffStats # noqa: PLC0415 from ..models.review_open_items import ReviewOpenItems # noqa: PLC0415 + from ..models.run_progress import RunProgress # noqa: PLC0415 from ..models.walkthrough_view import WalkthroughView # noqa: PLC0415 actions = self.actions.to_dict() @@ -367,6 +424,25 @@ def to_dict(self) -> dict[str, Any]: else: completed_at = self.completed_at + cost_microcredits: int | None | Unset + if isinstance(self.cost_microcredits, Unset): + cost_microcredits = UNSET + else: + cost_microcredits = self.cost_microcredits + + counted_incomplete_causes: ( + list[Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"] | str] | Unset + ) = UNSET + if not isinstance(self.counted_incomplete_causes, Unset): + counted_incomplete_causes = [] + for counted_incomplete_causes_item_data in self.counted_incomplete_causes: + counted_incomplete_causes_item: Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"] | str + if isinstance(counted_incomplete_causes_item_data, IncompleteCauseType0): + counted_incomplete_causes_item = counted_incomplete_causes_item_data.value + else: + counted_incomplete_causes_item = counted_incomplete_causes_item_data + counted_incomplete_causes.append(counted_incomplete_causes_item) + current_head_commit_sha: None | str | Unset if isinstance(self.current_head_commit_sha, Unset): current_head_commit_sha = UNSET @@ -389,6 +465,13 @@ def to_dict(self) -> dict[str, Any]: else: diff_stats = self.diff_stats + environments: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.environments, Unset): + environments = [] + for environments_item_data in self.environments: + environments_item = environments_item_data.to_dict() + environments.append(environments_item) + fix_generation_enabled = self.fix_generation_enabled head_commit_sha: None | str | Unset @@ -409,6 +492,24 @@ def to_dict(self) -> dict[str, Any]: else: head_ref = self.head_ref + incomplete_causes: list[Literal["UNKNOWN"] | str] | Unset = UNSET + if not isinstance(self.incomplete_causes, Unset): + incomplete_causes = [] + for incomplete_causes_item_data in self.incomplete_causes: + incomplete_causes_item: Literal["UNKNOWN"] | str + if isinstance(incomplete_causes_item_data, IncompleteCauseType0): + incomplete_causes_item = incomplete_causes_item_data.value + else: + incomplete_causes_item = incomplete_causes_item_data + incomplete_causes.append(incomplete_causes_item) + + investigation_findings: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.investigation_findings, Unset): + investigation_findings = [] + for investigation_findings_item_data in self.investigation_findings: + investigation_findings_item = investigation_findings_item_data.to_dict() + investigation_findings.append(investigation_findings_item) + is_deep_review = self.is_deep_review local_reverifications: list[dict[str, Any]] | Unset = UNSET @@ -426,6 +527,10 @@ def to_dict(self) -> dict[str, Any]: else: merge_gate = self.merge_gate + merge_group_pull_request_numbers: list[int] | Unset = UNSET + if not isinstance(self.merge_group_pull_request_numbers, Unset): + merge_group_pull_request_numbers = self.merge_group_pull_request_numbers + open_items: dict[str, Any] | None | Unset if isinstance(self.open_items, Unset): open_items = UNSET @@ -442,6 +547,14 @@ def to_dict(self) -> dict[str, Any]: else: open_items_observation = self.open_items_observation + provider_wait: dict[str, Any] | None | Unset + if isinstance(self.provider_wait, Unset): + provider_wait = UNSET + elif isinstance(self.provider_wait, ProviderWait): + provider_wait = self.provider_wait.to_dict() + else: + provider_wait = self.provider_wait + publication_detail: None | str | Unset if isinstance(self.publication_detail, Unset): publication_detail = UNSET @@ -466,6 +579,12 @@ def to_dict(self) -> dict[str, Any]: else: pull_request_author_login = self.pull_request_author_login + pull_request_author_name: None | str | Unset + if isinstance(self.pull_request_author_name, Unset): + pull_request_author_name = UNSET + else: + pull_request_author_name = self.pull_request_author_name + pull_request_author_url: None | str | Unset if isinstance(self.pull_request_author_url, Unset): pull_request_author_url = UNSET @@ -558,6 +677,14 @@ def to_dict(self) -> dict[str, Any]: else: run_number = self.run_number + run_progress: dict[str, Any] | None | Unset + if isinstance(self.run_progress, Unset): + run_progress = UNSET + elif isinstance(self.run_progress, RunProgress): + run_progress = self.run_progress.to_dict() + else: + run_progress = self.run_progress + stopped_at: None | str | Unset if isinstance(self.stopped_at, Unset): stopped_at = UNSET @@ -645,12 +772,18 @@ def to_dict(self) -> dict[str, Any]: field_dict["compare_url"] = compare_url if completed_at is not UNSET: field_dict["completed_at"] = completed_at + if cost_microcredits is not UNSET: + field_dict["cost_microcredits"] = cost_microcredits + if counted_incomplete_causes is not UNSET: + field_dict["counted_incomplete_causes"] = counted_incomplete_causes if current_head_commit_sha is not UNSET: field_dict["current_head_commit_sha"] = current_head_commit_sha if deep_review_escalation is not UNSET: field_dict["deep_review_escalation"] = deep_review_escalation if diff_stats is not UNSET: field_dict["diff_stats"] = diff_stats + if environments is not UNSET: + field_dict["environments"] = environments if fix_generation_enabled is not UNSET: field_dict["fix_generation_enabled"] = fix_generation_enabled if head_commit_sha is not UNSET: @@ -659,16 +792,24 @@ def to_dict(self) -> dict[str, Any]: field_dict["head_commit_url"] = head_commit_url if head_ref is not UNSET: field_dict["head_ref"] = head_ref + if incomplete_causes is not UNSET: + field_dict["incomplete_causes"] = incomplete_causes + if investigation_findings is not UNSET: + field_dict["investigation_findings"] = investigation_findings if is_deep_review is not UNSET: field_dict["is_deep_review"] = is_deep_review if local_reverifications is not UNSET: field_dict["local_reverifications"] = local_reverifications if merge_gate is not UNSET: field_dict["merge_gate"] = merge_gate + if merge_group_pull_request_numbers is not UNSET: + field_dict["merge_group_pull_request_numbers"] = merge_group_pull_request_numbers if open_items is not UNSET: field_dict["open_items"] = open_items if open_items_observation is not UNSET: field_dict["open_items_observation"] = open_items_observation + if provider_wait is not UNSET: + field_dict["provider_wait"] = provider_wait if publication_detail is not UNSET: field_dict["publication_detail"] = publication_detail if pull_request_author_avatar_url is not UNSET: @@ -677,6 +818,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["pull_request_author_github_user_id"] = pull_request_author_github_user_id if pull_request_author_login is not UNSET: field_dict["pull_request_author_login"] = pull_request_author_login + if pull_request_author_name is not UNSET: + field_dict["pull_request_author_name"] = pull_request_author_name if pull_request_author_url is not UNSET: field_dict["pull_request_author_url"] = pull_request_author_url if pull_request_number is not UNSET: @@ -705,6 +848,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["review_retracted_at"] = review_retracted_at if run_number is not UNSET: field_dict["run_number"] = run_number + if run_progress is not UNSET: + field_dict["run_progress"] = run_progress if stopped_at is not UNSET: field_dict["stopped_at"] = stopped_at if stopped_by is not UNSET: @@ -728,14 +873,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.customer_assessment import CustomerAssessment # noqa: PLC0415 from ..models.customer_code_assessment import CustomerCodeAssessment # noqa: PLC0415 from ..models.deep_review_escalation import DeepReviewEscalation # noqa: PLC0415 + from ..models.environment_check import EnvironmentCheck # noqa: PLC0415 from ..models.local_reverification import LocalReverification # noqa: PLC0415 from ..models.open_items_view import OpenItemsView # noqa: PLC0415 + from ..models.provider_wait import ProviderWait # noqa: PLC0415 from ..models.pull_request_merge_gate import PullRequestMergeGate # noqa: PLC0415 from ..models.refresh_view import RefreshView # noqa: PLC0415 from ..models.related_review import RelatedReview # noqa: PLC0415 from ..models.review_actions import ReviewActions # noqa: PLC0415 from ..models.review_diff_stats import ReviewDiffStats # noqa: PLC0415 + from ..models.review_investigation_finding import ReviewInvestigationFinding # noqa: PLC0415 from ..models.review_open_items import ReviewOpenItems # noqa: PLC0415 + from ..models.run_progress import RunProgress # noqa: PLC0415 from ..models.subject_view import SubjectView # noqa: PLC0415 from ..models.walkthrough_view import WalkthroughView # noqa: PLC0415 @@ -909,6 +1058,62 @@ def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + def _parse_cost_microcredits(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + cost_microcredits = _parse_cost_microcredits(d.pop("cost_microcredits", UNSET)) + + _counted_incomplete_causes = d.pop("counted_incomplete_causes", UNSET) + counted_incomplete_causes: ( + list[IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]] | Unset + ) = UNSET + if _counted_incomplete_causes is not UNSET: + counted_incomplete_causes = [] + for counted_incomplete_causes_item_data in _counted_incomplete_causes: + + def _parse_counted_incomplete_causes_item( + data: object, + ) -> IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]: + try: + if not isinstance(data, str): + raise TypeError() + componentsschemas_incomplete_cause_type_0 = IncompleteCauseType0(data) + + return componentsschemas_incomplete_cause_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "UNKNOWN"): + raise TypeError() + componentsschemas_incomplete_cause_type_1 = cast(Literal["UNKNOWN"], data) + if componentsschemas_incomplete_cause_type_1 != "UNKNOWN": + raise ValueError( + f"/components/schemas/IncompleteCause_type_1 must match const 'UNKNOWN', got '{componentsschemas_incomplete_cause_type_1}'" + ) + return componentsschemas_incomplete_cause_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "OUT_OF_CREDITS"): + raise TypeError() + componentsschemas_credit_refusal_cause_type_0 = cast( + Literal["OUT_OF_CREDITS"], data + ) + if componentsschemas_credit_refusal_cause_type_0 != "OUT_OF_CREDITS": + raise ValueError( + f"/components/schemas/CreditRefusalCause_type_0 must match const 'OUT_OF_CREDITS', got '{componentsschemas_credit_refusal_cause_type_0}'" + ) + return componentsschemas_credit_refusal_cause_type_0 + + counted_incomplete_causes_item = _parse_counted_incomplete_causes_item( + counted_incomplete_causes_item_data + ) + + counted_incomplete_causes.append(counted_incomplete_causes_item) + def _parse_current_head_commit_sha(data: object) -> None | str | Unset: if data is None: return data @@ -956,6 +1161,15 @@ def _parse_diff_stats(data: object) -> None | ReviewDiffStats | Unset: diff_stats = _parse_diff_stats(d.pop("diff_stats", UNSET)) + _environments = d.pop("environments", UNSET) + environments: list[EnvironmentCheck] | Unset = UNSET + if _environments is not UNSET: + environments = [] + for environments_item_data in _environments: + environments_item = EnvironmentCheck.from_dict(environments_item_data) + + environments.append(environments_item) + fix_generation_enabled = d.pop("fix_generation_enabled", UNSET) def _parse_head_commit_sha(data: object) -> None | str | Unset: @@ -985,6 +1199,47 @@ def _parse_head_ref(data: object) -> None | str | Unset: head_ref = _parse_head_ref(d.pop("head_ref", UNSET)) + _incomplete_causes = d.pop("incomplete_causes", UNSET) + incomplete_causes: list[IncompleteCauseType0 | Literal["UNKNOWN"]] | Unset = UNSET + if _incomplete_causes is not UNSET: + incomplete_causes = [] + for incomplete_causes_item_data in _incomplete_causes: + + def _parse_incomplete_causes_item( + data: object, + ) -> IncompleteCauseType0 | Literal["UNKNOWN"]: + try: + if not isinstance(data, str): + raise TypeError() + componentsschemas_incomplete_cause_type_0 = IncompleteCauseType0(data) + + return componentsschemas_incomplete_cause_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "UNKNOWN"): + raise TypeError() + componentsschemas_incomplete_cause_type_1 = cast(Literal["UNKNOWN"], data) + if componentsschemas_incomplete_cause_type_1 != "UNKNOWN": + raise ValueError( + f"/components/schemas/IncompleteCause_type_1 must match const 'UNKNOWN', got '{componentsschemas_incomplete_cause_type_1}'" + ) + return componentsschemas_incomplete_cause_type_1 + + incomplete_causes_item = _parse_incomplete_causes_item(incomplete_causes_item_data) + + incomplete_causes.append(incomplete_causes_item) + + _investigation_findings = d.pop("investigation_findings", UNSET) + investigation_findings: list[ReviewInvestigationFinding] | Unset = UNSET + if _investigation_findings is not UNSET: + investigation_findings = [] + for investigation_findings_item_data in _investigation_findings: + investigation_findings_item = ReviewInvestigationFinding.from_dict( + investigation_findings_item_data + ) + + investigation_findings.append(investigation_findings_item) + is_deep_review = d.pop("is_deep_review", UNSET) _local_reverifications = d.pop("local_reverifications", UNSET) @@ -1015,6 +1270,10 @@ def _parse_merge_gate(data: object) -> None | PullRequestMergeGate | Unset: merge_gate = _parse_merge_gate(d.pop("merge_gate", UNSET)) + merge_group_pull_request_numbers = cast( + list[int], d.pop("merge_group_pull_request_numbers", UNSET) + ) + def _parse_open_items(data: object) -> None | OpenItemsView | Unset: if data is None: return data @@ -1051,6 +1310,23 @@ def _parse_open_items_observation(data: object) -> None | ReviewOpenItems | Unse d.pop("open_items_observation", UNSET) ) + def _parse_provider_wait(data: object) -> None | ProviderWait | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + provider_wait_type_0 = ProviderWait.from_dict(data) + + return provider_wait_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ProviderWait | Unset, data) + + provider_wait = _parse_provider_wait(d.pop("provider_wait", UNSET)) + def _parse_publication_detail(data: object) -> None | str | Unset: if data is None: return data @@ -1093,6 +1369,17 @@ def _parse_pull_request_author_login(data: object) -> None | str | Unset: d.pop("pull_request_author_login", UNSET) ) + def _parse_pull_request_author_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + pull_request_author_name = _parse_pull_request_author_name( + d.pop("pull_request_author_name", UNSET) + ) + def _parse_pull_request_author_url(data: object) -> None | str | Unset: if data is None: return data @@ -1253,6 +1540,23 @@ def _parse_run_number(data: object) -> int | None | Unset: run_number = _parse_run_number(d.pop("run_number", UNSET)) + def _parse_run_progress(data: object) -> None | RunProgress | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + run_progress_type_0 = RunProgress.from_dict(data) + + return run_progress_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | RunProgress | Unset, data) + + run_progress = _parse_run_progress(d.pop("run_progress", UNSET)) + def _parse_stopped_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data @@ -1375,22 +1679,30 @@ def _parse_walkthrough(data: object) -> None | Unset | WalkthroughView: code_assessment=code_assessment, compare_url=compare_url, completed_at=completed_at, + cost_microcredits=cost_microcredits, + counted_incomplete_causes=counted_incomplete_causes, current_head_commit_sha=current_head_commit_sha, deep_review_escalation=deep_review_escalation, diff_stats=diff_stats, + environments=environments, fix_generation_enabled=fix_generation_enabled, head_commit_sha=head_commit_sha, head_commit_url=head_commit_url, head_ref=head_ref, + incomplete_causes=incomplete_causes, + investigation_findings=investigation_findings, is_deep_review=is_deep_review, local_reverifications=local_reverifications, merge_gate=merge_gate, + merge_group_pull_request_numbers=merge_group_pull_request_numbers, open_items=open_items, open_items_observation=open_items_observation, + provider_wait=provider_wait, publication_detail=publication_detail, pull_request_author_avatar_url=pull_request_author_avatar_url, pull_request_author_github_user_id=pull_request_author_github_user_id, pull_request_author_login=pull_request_author_login, + pull_request_author_name=pull_request_author_name, pull_request_author_url=pull_request_author_url, pull_request_number=pull_request_number, pull_request_state=pull_request_state, @@ -1405,6 +1717,7 @@ def _parse_walkthrough(data: object) -> None | Unset | WalkthroughView: review_comment_url=review_comment_url, review_retracted_at=review_retracted_at, run_number=run_number, + run_progress=run_progress, stopped_at=stopped_at, stopped_by=stopped_by, stopped_from=stopped_from, diff --git a/proofline/_generated/models/declared_reach_outcome.py b/proofline/_generated/models/declared_reach_outcome.py deleted file mode 100644 index 1279c6ef..00000000 --- a/proofline/_generated/models/declared_reach_outcome.py +++ /dev/null @@ -1,11 +0,0 @@ -from enum import StrEnum - - -class DeclaredReachOutcome(StrEnum): - NO_ROOTS = "NO_ROOTS" - READ = "READ" - ROOTS_UNKNOWN = "ROOTS_UNKNOWN" - UNAVAILABLE = "UNAVAILABLE" - - def __str__(self) -> str: - return str(self.value) diff --git a/proofline/_generated/models/declared_reach_view.py b/proofline/_generated/models/declared_reach_view.py deleted file mode 100644 index e211a035..00000000 --- a/proofline/_generated/models/declared_reach_view.py +++ /dev/null @@ -1,204 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.declared_reach_outcome import DeclaredReachOutcome -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.reach_gap_view import ReachGapView - from ..models.reached_entity_view import ReachedEntityView - from ..models.terraform_roots_view import TerraformRootsView - - -T = TypeVar("T", bound="DeclaredReachView") - - -@_attrs_define -class DeclaredReachView: - """One assessment's declared reach receipt. A reached entity declares a - dependency on what the change deploys; it is never a claim that the change - breaks it. - - Attributes: - complete (bool): Whether World's walk ended with no gap. An empty, incomplete reach - says nothing about what depends on the change. - entities (list[ReachedEntityView]): Every reached entity, shorter paths first, then by kind. - gaps (list[ReachGapView]): Where World's walk or its evidence stopped. - outcome (DeclaredReachOutcome): - receipt_digest (None | str | Unset): World's digest of its full answer. Null unless `READ`. - snapshot_id (None | Unset | UUID): The World snapshot the reach was read at. Null unless `READ`. - terraform (None | TerraformRootsView | Unset): The Terraform addresses the reach also started from, or why it - took - none. Absent when the assessment read reach only from the deployed - revision. - """ - - complete: bool - entities: list[ReachedEntityView] - gaps: list[ReachGapView] - outcome: DeclaredReachOutcome - receipt_digest: None | str | Unset = UNSET - snapshot_id: None | Unset | UUID = UNSET - terraform: None | TerraformRootsView | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.terraform_roots_view import TerraformRootsView # noqa: PLC0415 - - complete = self.complete - - entities = [] - for entities_item_data in self.entities: - entities_item = entities_item_data.to_dict() - entities.append(entities_item) - - gaps = [] - for gaps_item_data in self.gaps: - gaps_item = gaps_item_data.to_dict() - gaps.append(gaps_item) - - outcome = self.outcome.value - - receipt_digest: None | str | Unset - if isinstance(self.receipt_digest, Unset): - receipt_digest = UNSET - else: - receipt_digest = self.receipt_digest - - snapshot_id: None | str | Unset - if isinstance(self.snapshot_id, Unset): - snapshot_id = UNSET - elif isinstance(self.snapshot_id, UUID): - snapshot_id = str(self.snapshot_id) - else: - snapshot_id = self.snapshot_id - - terraform: dict[str, Any] | None | Unset - if isinstance(self.terraform, Unset): - terraform = UNSET - elif isinstance(self.terraform, TerraformRootsView): - terraform = self.terraform.to_dict() - else: - terraform = self.terraform - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "complete": complete, - "entities": entities, - "gaps": gaps, - "outcome": outcome, - } - ) - if receipt_digest is not UNSET: - field_dict["receipt_digest"] = receipt_digest - if snapshot_id is not UNSET: - field_dict["snapshot_id"] = snapshot_id - if terraform is not UNSET: - field_dict["terraform"] = terraform - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.reach_gap_view import ReachGapView # noqa: PLC0415 - from ..models.reached_entity_view import ReachedEntityView # noqa: PLC0415 - from ..models.terraform_roots_view import TerraformRootsView # noqa: PLC0415 - - d = dict(src_dict) - complete = d.pop("complete") - - entities = [] - _entities = d.pop("entities") - for entities_item_data in _entities: - entities_item = ReachedEntityView.from_dict(entities_item_data) - - entities.append(entities_item) - - gaps = [] - _gaps = d.pop("gaps") - for gaps_item_data in _gaps: - gaps_item = ReachGapView.from_dict(gaps_item_data) - - gaps.append(gaps_item) - - outcome = DeclaredReachOutcome(d.pop("outcome")) - - def _parse_receipt_digest(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - receipt_digest = _parse_receipt_digest(d.pop("receipt_digest", UNSET)) - - def _parse_snapshot_id(data: object) -> None | Unset | UUID: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, str): - raise TypeError() - snapshot_id_type_0 = UUID(data) - - return snapshot_id_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Unset | UUID, data) - - snapshot_id = _parse_snapshot_id(d.pop("snapshot_id", UNSET)) - - def _parse_terraform(data: object) -> None | TerraformRootsView | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - terraform_type_0 = TerraformRootsView.from_dict(data) - - return terraform_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | TerraformRootsView | Unset, data) - - terraform = _parse_terraform(d.pop("terraform", UNSET)) - - declared_reach_view = cls( - complete=complete, - entities=entities, - gaps=gaps, - outcome=outcome, - receipt_digest=receipt_digest, - snapshot_id=snapshot_id, - terraform=terraform, - ) - - declared_reach_view.additional_properties = d - return declared_reach_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/environment_check.py b/proofline/_generated/models/environment_check.py new file mode 100644 index 00000000..9a47bf94 --- /dev/null +++ b/proofline/_generated/models/environment_check.py @@ -0,0 +1,257 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EnvironmentCheck") + + +@_attrs_define +class EnvironmentCheck: + """One environment linked to the reviewed repository, and whether this + review checked it. + + Attributes: + environment_display_name (str): The environment's display name. + state (Literal['CHECKED'] | Literal['CHECKING'] | Literal['NOT_APPLICABLE'] | Literal['NOT_CHECKED']): + reason (Literal['ENDED'] | Literal['FORK_PULL_REQUEST'] | Literal['NOT_COVERED'] | + Literal['PULL_REQUEST_REVIEWS_OFF'] | Literal['UNFINISHED'] | None | Unset): Why the environment was not checked + or does not apply. Null when it + was checked or its check is still running. + """ + + environment_display_name: str + state: ( + Literal["CHECKED"] + | Literal["CHECKING"] + | Literal["NOT_APPLICABLE"] + | Literal["NOT_CHECKED"] + ) + reason: ( + Literal["ENDED"] + | Literal["FORK_PULL_REQUEST"] + | Literal["NOT_COVERED"] + | Literal["PULL_REQUEST_REVIEWS_OFF"] + | Literal["UNFINISHED"] + | None + | Unset + ) = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + environment_display_name = self.environment_display_name + + state: ( + Literal["CHECKED"] + | Literal["CHECKING"] + | Literal["NOT_APPLICABLE"] + | Literal["NOT_CHECKED"] + ) + state = self.state + + reason: ( + Literal["ENDED"] + | Literal["FORK_PULL_REQUEST"] + | Literal["NOT_COVERED"] + | Literal["PULL_REQUEST_REVIEWS_OFF"] + | Literal["UNFINISHED"] + | None + | Unset + ) + if isinstance(self.reason, Unset): + reason = UNSET + else: + reason = self.reason + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "environment_display_name": environment_display_name, + "state": state, + } + ) + if reason is not UNSET: + field_dict["reason"] = reason + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + environment_display_name = d.pop("environment_display_name") + + def _parse_state( + data: object, + ) -> ( + Literal["CHECKED"] + | Literal["CHECKING"] + | Literal["NOT_APPLICABLE"] + | Literal["NOT_CHECKED"] + ): + try: + if not (type(data) is str and data == "CHECKED"): + raise TypeError() + componentsschemas_environment_check_state_type_0 = cast(Literal["CHECKED"], data) + if componentsschemas_environment_check_state_type_0 != "CHECKED": + raise ValueError( + f"/components/schemas/EnvironmentCheckState_type_0 must match const 'CHECKED', got '{componentsschemas_environment_check_state_type_0}'" + ) + return componentsschemas_environment_check_state_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "CHECKING"): + raise TypeError() + componentsschemas_environment_check_state_type_1 = cast(Literal["CHECKING"], data) + if componentsschemas_environment_check_state_type_1 != "CHECKING": + raise ValueError( + f"/components/schemas/EnvironmentCheckState_type_1 must match const 'CHECKING', got '{componentsschemas_environment_check_state_type_1}'" + ) + return componentsschemas_environment_check_state_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "NOT_CHECKED"): + raise TypeError() + componentsschemas_environment_check_state_type_2 = cast( + Literal["NOT_CHECKED"], data + ) + if componentsschemas_environment_check_state_type_2 != "NOT_CHECKED": + raise ValueError( + f"/components/schemas/EnvironmentCheckState_type_2 must match const 'NOT_CHECKED', got '{componentsschemas_environment_check_state_type_2}'" + ) + return componentsschemas_environment_check_state_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "NOT_APPLICABLE"): + raise TypeError() + componentsschemas_environment_check_state_type_3 = cast(Literal["NOT_APPLICABLE"], data) + if componentsschemas_environment_check_state_type_3 != "NOT_APPLICABLE": + raise ValueError( + f"/components/schemas/EnvironmentCheckState_type_3 must match const 'NOT_APPLICABLE', got '{componentsschemas_environment_check_state_type_3}'" + ) + return componentsschemas_environment_check_state_type_3 + + state = _parse_state(d.pop("state")) + + def _parse_reason( + data: object, + ) -> ( + Literal["ENDED"] + | Literal["FORK_PULL_REQUEST"] + | Literal["NOT_COVERED"] + | Literal["PULL_REQUEST_REVIEWS_OFF"] + | Literal["UNFINISHED"] + | None + | Unset + ): + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not (type(data) is str and data == "NOT_COVERED"): + raise TypeError() + componentsschemas_environment_check_reason_type_0 = cast( + Literal["NOT_COVERED"], data + ) + if componentsschemas_environment_check_reason_type_0 != "NOT_COVERED": + raise ValueError( + f"/components/schemas/EnvironmentCheckReason_type_0 must match const 'NOT_COVERED', got '{componentsschemas_environment_check_reason_type_0}'" + ) + return componentsschemas_environment_check_reason_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "FORK_PULL_REQUEST"): + raise TypeError() + componentsschemas_environment_check_reason_type_1 = cast( + Literal["FORK_PULL_REQUEST"], data + ) + if componentsschemas_environment_check_reason_type_1 != "FORK_PULL_REQUEST": + raise ValueError( + f"/components/schemas/EnvironmentCheckReason_type_1 must match const 'FORK_PULL_REQUEST', got '{componentsschemas_environment_check_reason_type_1}'" + ) + return componentsschemas_environment_check_reason_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "UNFINISHED"): + raise TypeError() + componentsschemas_environment_check_reason_type_2 = cast( + Literal["UNFINISHED"], data + ) + if componentsschemas_environment_check_reason_type_2 != "UNFINISHED": + raise ValueError( + f"/components/schemas/EnvironmentCheckReason_type_2 must match const 'UNFINISHED', got '{componentsschemas_environment_check_reason_type_2}'" + ) + return componentsschemas_environment_check_reason_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "ENDED"): + raise TypeError() + componentsschemas_environment_check_reason_type_3 = cast(Literal["ENDED"], data) + if componentsschemas_environment_check_reason_type_3 != "ENDED": + raise ValueError( + f"/components/schemas/EnvironmentCheckReason_type_3 must match const 'ENDED', got '{componentsschemas_environment_check_reason_type_3}'" + ) + return componentsschemas_environment_check_reason_type_3 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "PULL_REQUEST_REVIEWS_OFF"): + raise TypeError() + componentsschemas_environment_check_reason_type_4 = cast( + Literal["PULL_REQUEST_REVIEWS_OFF"], data + ) + if componentsschemas_environment_check_reason_type_4 != "PULL_REQUEST_REVIEWS_OFF": + raise ValueError( + f"/components/schemas/EnvironmentCheckReason_type_4 must match const 'PULL_REQUEST_REVIEWS_OFF', got '{componentsschemas_environment_check_reason_type_4}'" + ) + return componentsschemas_environment_check_reason_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + Literal["ENDED"] + | Literal["FORK_PULL_REQUEST"] + | Literal["NOT_COVERED"] + | Literal["PULL_REQUEST_REVIEWS_OFF"] + | Literal["UNFINISHED"] + | None + | Unset, + data, + ) + + reason = _parse_reason(d.pop("reason", UNSET)) + + environment_check = cls( + environment_display_name=environment_display_name, + state=state, + reason=reason, + ) + + environment_check.additional_properties = d + return environment_check + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/evidence_view.py b/proofline/_generated/models/evidence_view.py deleted file mode 100644 index 7413a271..00000000 --- a/proofline/_generated/models/evidence_view.py +++ /dev/null @@ -1,10 +0,0 @@ -from enum import StrEnum - - -class EvidenceView(StrEnum): - INCOMPLETE = "INCOMPLETE" - NO_APPLICABLE_OBLIGATIONS = "NO_APPLICABLE_OBLIGATIONS" - REQUIRED_PROPERTIES_ESTABLISHED = "REQUIRED_PROPERTIES_ESTABLISHED" - - def __str__(self) -> str: - return str(self.value) diff --git a/proofline/_generated/models/export_review_kind.py b/proofline/_generated/models/export_review_kind.py index f7b81df3..f04aba2a 100644 --- a/proofline/_generated/models/export_review_kind.py +++ b/proofline/_generated/models/export_review_kind.py @@ -5,8 +5,10 @@ class ExportReviewKind(StrEnum): COMMIT = "COMMIT" DEPLOYMENT = "DEPLOYMENT" FILES = "FILES" + MERGE_GROUP = "MERGE_GROUP" PATCH = "PATCH" PULL_REQUEST = "PULL_REQUEST" + REVISION_SCAN = "REVISION_SCAN" def __str__(self) -> str: return str(self.value) diff --git a/proofline/_generated/models/finding_outcomes_export_row.py b/proofline/_generated/models/finding_outcomes_export_row.py index 0c4f2943..1a26b0fd 100644 --- a/proofline/_generated/models/finding_outcomes_export_row.py +++ b/proofline/_generated/models/finding_outcomes_export_row.py @@ -31,11 +31,13 @@ class FindingOutcomesExportRow: from_ (datetime.datetime): The inclusive start of the requested first-publication window. group_by (FindingOutcomesGroupBy): key (str): The grouping value: a repository or environment ID, a risk domain, a severity or a - review kind, as `group_by` selects. + review kind, as `group_by` selects. Grouped by environment, code-lane findings, which + belong to no environment, share the key `code_review`. limitations (list[str]): Gaps in publication history that keep findings outside these counts; they mean missing history, not zero findings. name (str): The group's display name: the repository's full name (or `Repository` and its ID when - no name is recorded), the environment's display name, or otherwise `key`. + no name is recorded), the environment's display name (`Code review` for the code-lane + group), or otherwise `key`. organization_id (UUID): The organization whose findings are counted. outcomes (list[FindingOutcomesOutcomeCount]): One count per outcome, always all six `FindingOutcomesOutcome` values in a fixed order. @@ -114,12 +116,8 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.finding_outcomes_count import FindingOutcomesCount # noqa: PLC0415 - from ..models.finding_outcomes_outcome_count import ( - FindingOutcomesOutcomeCount, # noqa: PLC0415 - ) - from ..models.finding_outcomes_post_merge_counts import ( - FindingOutcomesPostMergeCounts, # noqa: PLC0415 - ) + from ..models.finding_outcomes_outcome_count import FindingOutcomesOutcomeCount # noqa: PLC0415 + from ..models.finding_outcomes_post_merge_counts import FindingOutcomesPostMergeCounts # noqa: PLC0415 d = dict(src_dict) code_changed = FindingOutcomesCount.from_dict(d.pop("code_changed")) diff --git a/proofline/_generated/models/finding_outcomes_outcome_count.py b/proofline/_generated/models/finding_outcomes_outcome_count.py index 1e77d87d..90e03b1c 100644 --- a/proofline/_generated/models/finding_outcomes_outcome_count.py +++ b/proofline/_generated/models/finding_outcomes_outcome_count.py @@ -57,9 +57,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.finding_outcomes_drilldown import FindingOutcomesDrilldown # noqa: PLC0415 - from ..models.finding_outcomes_validation_sources import ( - FindingOutcomesValidationSources, # noqa: PLC0415 - ) + from ..models.finding_outcomes_validation_sources import FindingOutcomesValidationSources # noqa: PLC0415 d = dict(src_dict) count = d.pop("count") diff --git a/proofline/_generated/models/finding_outcomes_post_merge_counts.py b/proofline/_generated/models/finding_outcomes_post_merge_counts.py index e49a1974..793cf393 100644 --- a/proofline/_generated/models/finding_outcomes_post_merge_counts.py +++ b/proofline/_generated/models/finding_outcomes_post_merge_counts.py @@ -48,9 +48,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.finding_outcomes_post_merge_count import ( - FindingOutcomesPostMergeCount, # noqa: PLC0415 - ) + from ..models.finding_outcomes_post_merge_count import FindingOutcomesPostMergeCount # noqa: PLC0415 d = dict(src_dict) judged = d.pop("judged") diff --git a/proofline/_generated/models/gate_state.py b/proofline/_generated/models/gate_state.py deleted file mode 100644 index 7aad04c2..00000000 --- a/proofline/_generated/models/gate_state.py +++ /dev/null @@ -1,123 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.occurrence_capture import OccurrenceCapture - from ..models.override import Override - - -T = TypeVar("T", bound="GateState") - - -@_attrs_define -class GateState: - """ - Attributes: - occurrence_captures (list[OccurrenceCapture]): The occurrence questions the gate's approval deferred, as each - observed execution of its deployment answered them. Outcome-only - records: none of them changes the gate or grades a prediction. - status (str): Local gate state. ALLOWED/BLOCKED can precede provider delivery. - This field does not confirm that GitHub released or blocked a run. - override_record (None | Override | Unset): Recorded override authorization, not confirmation of provider - delivery. - """ - - occurrence_captures: list[OccurrenceCapture] - status: str - override_record: None | Override | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.override import Override # noqa: PLC0415 - - occurrence_captures = [] - for occurrence_captures_item_data in self.occurrence_captures: - occurrence_captures_item = occurrence_captures_item_data.to_dict() - occurrence_captures.append(occurrence_captures_item) - - status = self.status - - override_record: dict[str, Any] | None | Unset - if isinstance(self.override_record, Unset): - override_record = UNSET - elif isinstance(self.override_record, Override): - override_record = self.override_record.to_dict() - else: - override_record = self.override_record - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "occurrence_captures": occurrence_captures, - "status": status, - } - ) - if override_record is not UNSET: - field_dict["override_record"] = override_record - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.occurrence_capture import OccurrenceCapture # noqa: PLC0415 - from ..models.override import Override # noqa: PLC0415 - - d = dict(src_dict) - occurrence_captures = [] - _occurrence_captures = d.pop("occurrence_captures") - for occurrence_captures_item_data in _occurrence_captures: - occurrence_captures_item = OccurrenceCapture.from_dict(occurrence_captures_item_data) - - occurrence_captures.append(occurrence_captures_item) - - status = d.pop("status") - - def _parse_override_record(data: object) -> None | Override | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - override_record_type_0 = Override.from_dict(data) - - return override_record_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | Override | Unset, data) - - override_record = _parse_override_record(d.pop("override_record", UNSET)) - - gate_state = cls( - occurrence_captures=occurrence_captures, - status=status, - override_record=override_record, - ) - - gate_state.additional_properties = d - return gate_state - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/incomplete_cause_type_0.py b/proofline/_generated/models/incomplete_cause_type_0.py new file mode 100644 index 00000000..27b74abd --- /dev/null +++ b/proofline/_generated/models/incomplete_cause_type_0.py @@ -0,0 +1,12 @@ +from enum import StrEnum + + +class IncompleteCauseType0(StrEnum): + EVIDENCE_UNAVAILABLE = "EVIDENCE_UNAVAILABLE" + HYPOTHESES_UNRESOLVED = "HYPOTHESES_UNRESOLVED" + MODEL_BUDGET_EXHAUSTED = "MODEL_BUDGET_EXHAUSTED" + NOT_CONFIGURED = "NOT_CONFIGURED" + POLICY_EXCLUDED = "POLICY_EXCLUDED" + + def __str__(self) -> str: + return str(self.value) diff --git a/proofline/_generated/models/occurrence_capture.py b/proofline/_generated/models/occurrence_capture.py deleted file mode 100644 index d065b861..00000000 --- a/proofline/_generated/models/occurrence_capture.py +++ /dev/null @@ -1,221 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.approval_gap import ApprovalGap - from ..models.occurrence_question import OccurrenceQuestion - - -T = TypeVar("T", bound="OccurrenceCapture") - - -@_attrs_define -class OccurrenceCapture: - """The capture of one observed execution of a gate's deployment. - - Attributes: - approval_gaps (list[ApprovalGap]): Assessments whose approval could defer nothing, with the reason. - questions (list[OccurrenceQuestion]): Deferred questions and their binding or observed results for this - occurrence. - state (Literal['INCOMPLETE'] | Literal['NOT_EXECUTED'] | Literal['PENDING'] | Literal['RECORDED'] | - Literal['UNBOUND']): How the capture ended. - detail (None | str | Unset): Explanation of the capture's outcome, when available. - occurrence_key (None | str | Unset): Retained identity of the deployment occurrence, when available. - """ - - approval_gaps: list[ApprovalGap] - questions: list[OccurrenceQuestion] - state: ( - Literal["INCOMPLETE"] - | Literal["NOT_EXECUTED"] - | Literal["PENDING"] - | Literal["RECORDED"] - | Literal["UNBOUND"] - ) - detail: None | str | Unset = UNSET - occurrence_key: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - approval_gaps = [] - for approval_gaps_item_data in self.approval_gaps: - approval_gaps_item = approval_gaps_item_data.to_dict() - approval_gaps.append(approval_gaps_item) - - questions = [] - for questions_item_data in self.questions: - questions_item = questions_item_data.to_dict() - questions.append(questions_item) - - state: ( - Literal["INCOMPLETE"] - | Literal["NOT_EXECUTED"] - | Literal["PENDING"] - | Literal["RECORDED"] - | Literal["UNBOUND"] - ) - state = self.state - - detail: None | str | Unset - if isinstance(self.detail, Unset): - detail = UNSET - else: - detail = self.detail - - occurrence_key: None | str | Unset - if isinstance(self.occurrence_key, Unset): - occurrence_key = UNSET - else: - occurrence_key = self.occurrence_key - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "approval_gaps": approval_gaps, - "questions": questions, - "state": state, - } - ) - if detail is not UNSET: - field_dict["detail"] = detail - if occurrence_key is not UNSET: - field_dict["occurrence_key"] = occurrence_key - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.approval_gap import ApprovalGap # noqa: PLC0415 - from ..models.occurrence_question import OccurrenceQuestion # noqa: PLC0415 - - d = dict(src_dict) - approval_gaps = [] - _approval_gaps = d.pop("approval_gaps") - for approval_gaps_item_data in _approval_gaps: - approval_gaps_item = ApprovalGap.from_dict(approval_gaps_item_data) - - approval_gaps.append(approval_gaps_item) - - questions = [] - _questions = d.pop("questions") - for questions_item_data in _questions: - questions_item = OccurrenceQuestion.from_dict(questions_item_data) - - questions.append(questions_item) - - def _parse_state( - data: object, - ) -> ( - Literal["INCOMPLETE"] - | Literal["NOT_EXECUTED"] - | Literal["PENDING"] - | Literal["RECORDED"] - | Literal["UNBOUND"] - ): - try: - if not (type(data) is str and data == "PENDING"): - raise TypeError() - componentsschemas_capture_state_type_0 = cast(Literal["PENDING"], data) - if componentsschemas_capture_state_type_0 != "PENDING": - raise ValueError( - f"/components/schemas/CaptureState_type_0 must match const 'PENDING', got '{componentsschemas_capture_state_type_0}'" - ) - return componentsschemas_capture_state_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "RECORDED"): - raise TypeError() - componentsschemas_capture_state_type_1 = cast(Literal["RECORDED"], data) - if componentsschemas_capture_state_type_1 != "RECORDED": - raise ValueError( - f"/components/schemas/CaptureState_type_1 must match const 'RECORDED', got '{componentsschemas_capture_state_type_1}'" - ) - return componentsschemas_capture_state_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "UNBOUND"): - raise TypeError() - componentsschemas_capture_state_type_2 = cast(Literal["UNBOUND"], data) - if componentsschemas_capture_state_type_2 != "UNBOUND": - raise ValueError( - f"/components/schemas/CaptureState_type_2 must match const 'UNBOUND', got '{componentsschemas_capture_state_type_2}'" - ) - return componentsschemas_capture_state_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "NOT_EXECUTED"): - raise TypeError() - componentsschemas_capture_state_type_3 = cast(Literal["NOT_EXECUTED"], data) - if componentsschemas_capture_state_type_3 != "NOT_EXECUTED": - raise ValueError( - f"/components/schemas/CaptureState_type_3 must match const 'NOT_EXECUTED', got '{componentsschemas_capture_state_type_3}'" - ) - return componentsschemas_capture_state_type_3 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "INCOMPLETE"): - raise TypeError() - componentsschemas_capture_state_type_4 = cast(Literal["INCOMPLETE"], data) - if componentsschemas_capture_state_type_4 != "INCOMPLETE": - raise ValueError( - f"/components/schemas/CaptureState_type_4 must match const 'INCOMPLETE', got '{componentsschemas_capture_state_type_4}'" - ) - return componentsschemas_capture_state_type_4 - - state = _parse_state(d.pop("state")) - - def _parse_detail(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - detail = _parse_detail(d.pop("detail", UNSET)) - - def _parse_occurrence_key(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - occurrence_key = _parse_occurrence_key(d.pop("occurrence_key", UNSET)) - - occurrence_capture = cls( - approval_gaps=approval_gaps, - questions=questions, - state=state, - detail=detail, - occurrence_key=occurrence_key, - ) - - occurrence_capture.additional_properties = d - return occurrence_capture - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/occurrence_question.py b/proofline/_generated/models/occurrence_question.py deleted file mode 100644 index b76e745d..00000000 --- a/proofline/_generated/models/occurrence_question.py +++ /dev/null @@ -1,200 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Literal, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="OccurrenceQuestion") - - -@_attrs_define -class OccurrenceQuestion: - """One deferred question as the gate presents it. - - Attributes: - assessment_id (UUID): Assessment whose approval deferred this question. - family_key (str): Hypothesis family key for the deferred question. - family_version (int): Hypothesis family version for the deferred question. - state (Literal['NOT_EXECUTED'] | Literal['PENDING'] | Literal['RECORDED'] | Literal['UNBOUND']): Where one - deferred question stands. - code (None | str | Unset): World's binding or refusal code, or the control plane's own gap. - observed_result (None | str | Unset): World's observed result once it recorded the question. - outcome_id (None | str | Unset): World outcome record identifier, when an observed result was recorded. - """ - - assessment_id: UUID - family_key: str - family_version: int - state: Literal["NOT_EXECUTED"] | Literal["PENDING"] | Literal["RECORDED"] | Literal["UNBOUND"] - code: None | str | Unset = UNSET - observed_result: None | str | Unset = UNSET - outcome_id: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assessment_id = str(self.assessment_id) - - family_key = self.family_key - - family_version = self.family_version - - state: ( - Literal["NOT_EXECUTED"] | Literal["PENDING"] | Literal["RECORDED"] | Literal["UNBOUND"] - ) - state = self.state - - code: None | str | Unset - if isinstance(self.code, Unset): - code = UNSET - else: - code = self.code - - observed_result: None | str | Unset - if isinstance(self.observed_result, Unset): - observed_result = UNSET - else: - observed_result = self.observed_result - - outcome_id: None | str | Unset - if isinstance(self.outcome_id, Unset): - outcome_id = UNSET - else: - outcome_id = self.outcome_id - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assessment_id": assessment_id, - "family_key": family_key, - "family_version": family_version, - "state": state, - } - ) - if code is not UNSET: - field_dict["code"] = code - if observed_result is not UNSET: - field_dict["observed_result"] = observed_result - if outcome_id is not UNSET: - field_dict["outcome_id"] = outcome_id - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - assessment_id = UUID(d.pop("assessment_id")) - - family_key = d.pop("family_key") - - family_version = d.pop("family_version") - - def _parse_state( - data: object, - ) -> ( - Literal["NOT_EXECUTED"] | Literal["PENDING"] | Literal["RECORDED"] | Literal["UNBOUND"] - ): - try: - if not (type(data) is str and data == "PENDING"): - raise TypeError() - componentsschemas_question_state_type_0 = cast(Literal["PENDING"], data) - if componentsschemas_question_state_type_0 != "PENDING": - raise ValueError( - f"/components/schemas/QuestionState_type_0 must match const 'PENDING', got '{componentsschemas_question_state_type_0}'" - ) - return componentsschemas_question_state_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "RECORDED"): - raise TypeError() - componentsschemas_question_state_type_1 = cast(Literal["RECORDED"], data) - if componentsschemas_question_state_type_1 != "RECORDED": - raise ValueError( - f"/components/schemas/QuestionState_type_1 must match const 'RECORDED', got '{componentsschemas_question_state_type_1}'" - ) - return componentsschemas_question_state_type_1 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not (type(data) is str and data == "UNBOUND"): - raise TypeError() - componentsschemas_question_state_type_2 = cast(Literal["UNBOUND"], data) - if componentsschemas_question_state_type_2 != "UNBOUND": - raise ValueError( - f"/components/schemas/QuestionState_type_2 must match const 'UNBOUND', got '{componentsschemas_question_state_type_2}'" - ) - return componentsschemas_question_state_type_2 - except (TypeError, ValueError, AttributeError, KeyError): - pass - if not (type(data) is str and data == "NOT_EXECUTED"): - raise TypeError() - componentsschemas_question_state_type_3 = cast(Literal["NOT_EXECUTED"], data) - if componentsschemas_question_state_type_3 != "NOT_EXECUTED": - raise ValueError( - f"/components/schemas/QuestionState_type_3 must match const 'NOT_EXECUTED', got '{componentsschemas_question_state_type_3}'" - ) - return componentsschemas_question_state_type_3 - - state = _parse_state(d.pop("state")) - - def _parse_code(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - code = _parse_code(d.pop("code", UNSET)) - - def _parse_observed_result(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - observed_result = _parse_observed_result(d.pop("observed_result", UNSET)) - - def _parse_outcome_id(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - outcome_id = _parse_outcome_id(d.pop("outcome_id", UNSET)) - - occurrence_question = cls( - assessment_id=assessment_id, - family_key=family_key, - family_version=family_version, - state=state, - code=code, - observed_result=observed_result, - outcome_id=outcome_id, - ) - - occurrence_question.additional_properties = d - return occurrence_question - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/override.py b/proofline/_generated/models/override.py deleted file mode 100644 index 1757ccfe..00000000 --- a/proofline/_generated/models/override.py +++ /dev/null @@ -1,102 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="Override") - - -@_attrs_define -class Override: - """ - Attributes: - github_environment_id (int): The GitHub environment ID the approval applied to. - github_user_id (int): The GitHub user ID of the person whose GitHub deployment approval - overrode the gate. - github_user_login (str): That person's GitHub login as recorded with the approval, a display - label truncated past 128 characters. - comment (None | str | Unset): The comment recorded with the approval, truncated past 8000 - characters. - """ - - github_environment_id: int - github_user_id: int - github_user_login: str - comment: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - github_environment_id = self.github_environment_id - - github_user_id = self.github_user_id - - github_user_login = self.github_user_login - - comment: None | str | Unset - if isinstance(self.comment, Unset): - comment = UNSET - else: - comment = self.comment - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "github_environment_id": github_environment_id, - "github_user_id": github_user_id, - "github_user_login": github_user_login, - } - ) - if comment is not UNSET: - field_dict["comment"] = comment - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - github_environment_id = d.pop("github_environment_id") - - github_user_id = d.pop("github_user_id") - - github_user_login = d.pop("github_user_login") - - def _parse_comment(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - comment = _parse_comment(d.pop("comment", UNSET)) - - override = cls( - github_environment_id=github_environment_id, - github_user_id=github_user_id, - github_user_login=github_user_login, - comment=comment, - ) - - override.additional_properties = d - return override - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/run_now_refusal_view_type_11.py b/proofline/_generated/models/provider_wait.py similarity index 58% rename from proofline/_generated/models/run_now_refusal_view_type_11.py rename to proofline/_generated/models/provider_wait.py index 26a66201..860f7a17 100644 --- a/proofline/_generated/models/run_now_refusal_view_type_11.py +++ b/proofline/_generated/models/provider_wait.py @@ -1,33 +1,42 @@ from __future__ import annotations +import datetime from collections.abc import Mapping -from typing import Any, Literal, TypeVar, cast +from typing import Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field -T = TypeVar("T", bound="RunNowRefusalViewType11") +from ..models.provider_wait_reason import ProviderWaitReason + +T = TypeVar("T", bound="ProviderWait") @_attrs_define -class RunNowRefusalViewType11: - """The existing review already retains a different focus. +class ProviderWait: + """A provider wait that holds the review now. Attributes: - reason (Literal['DEEP_REVIEW_FOCUS_CONFLICT']): + reason (ProviderWaitReason): Why a review's run waits on a provider. + until (datetime.datetime): When the wait ends: the reset GitHub named, or, when it named none, + when the run is due again. """ - reason: Literal["DEEP_REVIEW_FOCUS_CONFLICT"] + reason: ProviderWaitReason + until: datetime.datetime additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - reason = self.reason + reason = self.reason.value + + until = self.until.isoformat() field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( { "reason": reason, + "until": until, } ) @@ -36,18 +45,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - reason = cast(Literal["DEEP_REVIEW_FOCUS_CONFLICT"], d.pop("reason")) - if reason != "DEEP_REVIEW_FOCUS_CONFLICT": - raise ValueError( - f"reason must match const 'DEEP_REVIEW_FOCUS_CONFLICT', got '{reason}'" - ) + reason = ProviderWaitReason(d.pop("reason")) + + until = datetime.datetime.fromisoformat(d.pop("until")) - run_now_refusal_view_type_11 = cls( + provider_wait = cls( reason=reason, + until=until, ) - run_now_refusal_view_type_11.additional_properties = d - return run_now_refusal_view_type_11 + provider_wait.additional_properties = d + return provider_wait @property def additional_keys(self) -> list[str]: diff --git a/proofline/_generated/models/permission_view.py b/proofline/_generated/models/provider_wait_reason.py similarity index 52% rename from proofline/_generated/models/permission_view.py rename to proofline/_generated/models/provider_wait_reason.py index 3bbb22b1..9efa5836 100644 --- a/proofline/_generated/models/permission_view.py +++ b/proofline/_generated/models/provider_wait_reason.py @@ -1,9 +1,8 @@ from enum import StrEnum -class PermissionView(StrEnum): - BLOCK = "BLOCK" - PERMIT = "PERMIT" +class ProviderWaitReason(StrEnum): + GITHUB_RATE_LIMIT = "GITHUB_RATE_LIMIT" def __str__(self) -> str: return str(self.value) diff --git a/proofline/_generated/models/pull_request_merge_gate.py b/proofline/_generated/models/pull_request_merge_gate.py index 1c510cbd..7087f0a0 100644 --- a/proofline/_generated/models/pull_request_merge_gate.py +++ b/proofline/_generated/models/pull_request_merge_gate.py @@ -42,12 +42,18 @@ class PullRequestMergeGate: none was reported. merged_by_github_user_id (int | None | Unset): The stable GitHub user ID reported by a merged-close bypass, or null when none was reported. + merged_by_login (None | str | Unset): The merger's GitHub login as this organization's developer record last saw + it. Display + metadata only. Null when the organization has no record of that user. + merged_by_name (None | str | Unset): The merger's name, from the organization's developer record or their + Proofline account. + Display metadata only: `merged_by_github_user_id` stays the identity. Null when unknown. merged_pull_request_number (int | None | Unset): The actual pull request merged in the recorded bypass, which may differ from the captured PR. reason_code (None | str | Unset): The recorded deterministic decision or refusal reason. Null until a decision is recorded. - review_id (None | Unset | UUID): The first review captured for this gate. Null when its trigger was refused - before a review existed. + review_id (None | Unset | UUID): The review the gate decides from: the first review captured, or the one retry + that replaced a review that could not finish. Null when its trigger was refused before a review existed. """ blocking_severity: str @@ -64,6 +70,8 @@ class PullRequestMergeGate: finding_count: int | None | Unset = UNSET merge_commit_sha: None | str | Unset = UNSET merged_by_github_user_id: int | None | Unset = UNSET + merged_by_login: None | str | Unset = UNSET + merged_by_name: None | str | Unset = UNSET merged_pull_request_number: int | None | Unset = UNSET reason_code: None | str | Unset = UNSET review_id: None | Unset | UUID = UNSET @@ -136,6 +144,18 @@ def to_dict(self) -> dict[str, Any]: else: merged_by_github_user_id = self.merged_by_github_user_id + merged_by_login: None | str | Unset + if isinstance(self.merged_by_login, Unset): + merged_by_login = UNSET + else: + merged_by_login = self.merged_by_login + + merged_by_name: None | str | Unset + if isinstance(self.merged_by_name, Unset): + merged_by_name = UNSET + else: + merged_by_name = self.merged_by_name + merged_pull_request_number: int | None | Unset if isinstance(self.merged_pull_request_number, Unset): merged_pull_request_number = UNSET @@ -184,6 +204,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["merge_commit_sha"] = merge_commit_sha if merged_by_github_user_id is not UNSET: field_dict["merged_by_github_user_id"] = merged_by_github_user_id + if merged_by_login is not UNSET: + field_dict["merged_by_login"] = merged_by_login + if merged_by_name is not UNSET: + field_dict["merged_by_name"] = merged_by_name if merged_pull_request_number is not UNSET: field_dict["merged_pull_request_number"] = merged_pull_request_number if reason_code is not UNSET: @@ -306,6 +330,24 @@ def _parse_merged_by_github_user_id(data: object) -> int | None | Unset: d.pop("merged_by_github_user_id", UNSET) ) + def _parse_merged_by_login(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + merged_by_login = _parse_merged_by_login(d.pop("merged_by_login", UNSET)) + + def _parse_merged_by_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + merged_by_name = _parse_merged_by_name(d.pop("merged_by_name", UNSET)) + def _parse_merged_pull_request_number(data: object) -> int | None | Unset: if data is None: return data @@ -358,6 +400,8 @@ def _parse_review_id(data: object) -> None | Unset | UUID: finding_count=finding_count, merge_commit_sha=merge_commit_sha, merged_by_github_user_id=merged_by_github_user_id, + merged_by_login=merged_by_login, + merged_by_name=merged_by_name, merged_pull_request_number=merged_pull_request_number, reason_code=reason_code, review_id=review_id, diff --git a/proofline/_generated/models/reach_gap_view.py b/proofline/_generated/models/reach_gap_view.py deleted file mode 100644 index 9dde73a8..00000000 --- a/proofline/_generated/models/reach_gap_view.py +++ /dev/null @@ -1,61 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ReachGapView") - - -@_attrs_define -class ReachGapView: - """ - Attributes: - code (str): `COVERAGE_INCOMPLETE`, `SOURCE_CAPABILITY_MISSING` or `BOUND_REACHED`. - """ - - code: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - code = self.code - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "code": code, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - code = d.pop("code") - - reach_gap_view = cls( - code=code, - ) - - reach_gap_view.additional_properties = d - return reach_gap_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/reach_step_view.py b/proofline/_generated/models/reach_step_view.py deleted file mode 100644 index 038cbca8..00000000 --- a/proofline/_generated/models/reach_step_view.py +++ /dev/null @@ -1,79 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="ReachStepView") - - -@_attrs_define -class ReachStepView: - """ - Attributes: - assertion_id (UUID): The World relation assertion behind this step. - direction (str): `OUT` when the step follows the relation from its subject, `IN` when - it follows it back to the subject. - relation (str): The relation key, such as `proofline.relation.consumes_api`. - """ - - assertion_id: UUID - direction: str - relation: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assertion_id = str(self.assertion_id) - - direction = self.direction - - relation = self.relation - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assertion_id": assertion_id, - "direction": direction, - "relation": relation, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - assertion_id = UUID(d.pop("assertion_id")) - - direction = d.pop("direction") - - relation = d.pop("relation") - - reach_step_view = cls( - assertion_id=assertion_id, - direction=direction, - relation=relation, - ) - - reach_step_view.additional_properties = d - return reach_step_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/reached_entity_view.py b/proofline/_generated/models/reached_entity_view.py deleted file mode 100644 index a31436c9..00000000 --- a/proofline/_generated/models/reached_entity_view.py +++ /dev/null @@ -1,109 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.reach_step_view import ReachStepView - - -T = TypeVar("T", bound="ReachedEntityView") - - -@_attrs_define -class ReachedEntityView: - """ - Attributes: - entity_id (UUID): World's entity ID. - kind (str): The entity's kind, such as `service` or `queue`. - label (str): World's display label for the entity: environment evidence for - readers of this organization, never published to GitHub. - path (list[ReachStepView]): The recorded relation assertions from the deployed root to the entity. - type_keys (list[str]): World's registry type keys for the entity. - """ - - entity_id: UUID - kind: str - label: str - path: list[ReachStepView] - type_keys: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - entity_id = str(self.entity_id) - - kind = self.kind - - label = self.label - - path = [] - for path_item_data in self.path: - path_item = path_item_data.to_dict() - path.append(path_item) - - type_keys = self.type_keys - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "entity_id": entity_id, - "kind": kind, - "label": label, - "path": path, - "type_keys": type_keys, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.reach_step_view import ReachStepView # noqa: PLC0415 - - d = dict(src_dict) - entity_id = UUID(d.pop("entity_id")) - - kind = d.pop("kind") - - label = d.pop("label") - - path = [] - _path = d.pop("path") - for path_item_data in _path: - path_item = ReachStepView.from_dict(path_item_data) - - path.append(path_item) - - type_keys = cast(list[str], d.pop("type_keys")) - - reached_entity_view = cls( - entity_id=entity_id, - kind=kind, - label=label, - path=path, - type_keys=type_keys, - ) - - reached_entity_view.additional_properties = d - return reached_entity_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/review_investigation_citation.py b/proofline/_generated/models/review_investigation_citation.py new file mode 100644 index 00000000..c4144e85 --- /dev/null +++ b/proofline/_generated/models/review_investigation_citation.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ReviewInvestigationCitation") + + +@_attrs_define +class ReviewInvestigationCitation: + """One environment evidence record a finding cites, as Proofline verified + it. + + Attributes: + collection_id (UUID): The evidence collection that holds the record. + digest (str): The record's stored digest. + record_id (UUID): The record's ID. + table (str): The table that holds the record. + """ + + collection_id: UUID + digest: str + record_id: UUID + table: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + collection_id = str(self.collection_id) + + digest = self.digest + + record_id = str(self.record_id) + + table = self.table + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "collection_id": collection_id, + "digest": digest, + "record_id": record_id, + "table": table, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + collection_id = UUID(d.pop("collection_id")) + + digest = d.pop("digest") + + record_id = UUID(d.pop("record_id")) + + table = d.pop("table") + + review_investigation_citation = cls( + collection_id=collection_id, + digest=digest, + record_id=record_id, + table=table, + ) + + review_investigation_citation.additional_properties = d + return review_investigation_citation + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/review_investigation_finding.py b/proofline/_generated/models/review_investigation_finding.py new file mode 100644 index 00000000..89561418 --- /dev/null +++ b/proofline/_generated/models/review_investigation_finding.py @@ -0,0 +1,112 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +if TYPE_CHECKING: + from ..models.review_investigation_citation import ReviewInvestigationCitation + + +T = TypeVar("T", bound="ReviewInvestigationFinding") + + +@_attrs_define +class ReviewInvestigationFinding: + """One supported finding of an environment investigation. + + Attributes: + area (str): What the finding is about: `secrets`, `configuration`, `iam`, + `network`, `capacity` or `other`. + assessment_id (UUID): The environment assessment whose investigation recorded the finding. + citations (list[ReviewInvestigationCitation]): The evidence records the finding cites, each verified, in the + order + the finding cites them. + detail (str): Model text with protected values withheld. Render it as plain text. + title (str): Model text with protected values withheld. Render it as plain text. + """ + + area: str + assessment_id: UUID + citations: list[ReviewInvestigationCitation] + detail: str + title: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + area = self.area + + assessment_id = str(self.assessment_id) + + citations = [] + for citations_item_data in self.citations: + citations_item = citations_item_data.to_dict() + citations.append(citations_item) + + detail = self.detail + + title = self.title + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "area": area, + "assessment_id": assessment_id, + "citations": citations, + "detail": detail, + "title": title, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.review_investigation_citation import ReviewInvestigationCitation # noqa: PLC0415 + + d = dict(src_dict) + area = d.pop("area") + + assessment_id = UUID(d.pop("assessment_id")) + + citations = [] + _citations = d.pop("citations") + for citations_item_data in _citations: + citations_item = ReviewInvestigationCitation.from_dict(citations_item_data) + + citations.append(citations_item) + + detail = d.pop("detail") + + title = d.pop("title") + + review_investigation_finding = cls( + area=area, + assessment_id=assessment_id, + citations=citations, + detail=detail, + title=title, + ) + + review_investigation_finding.additional_properties = d + return review_investigation_finding + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/review_open_items.py b/proofline/_generated/models/review_open_items.py index f01499c2..5a3b5ee8 100644 --- a/proofline/_generated/models/review_open_items.py +++ b/proofline/_generated/models/review_open_items.py @@ -44,8 +44,8 @@ class ReviewOpenItems: review_status (OpenItemsReviewStatus): threads (OpenItemsThreadsType0 | OpenItemsThreadsType1): ci_failures (list[CiFailureLine] | Unset): Failed CI jobs diagnosed on the reviewed head, the newest diagnosed - attempt of each run, in diagnosis order. The Check states each one; - none is a Proofline open item. Absent when no job was diagnosed. + attempt of each run, in diagnosis order. The pull-request Check counts + them; none is a Proofline open item. Absent when no job was diagnosed. ci_failures_omitted (int | Unset): Diagnosed failed CI jobs on the reviewed head beyond `ci_failures`. ci_runs_pending (int | Unset): Failed CI run attempts on the reviewed head whose diagnosis is queued or running, so none of their jobs has a line yet. diff --git a/proofline/_generated/models/review_routing_view_type_2.py b/proofline/_generated/models/review_routing_view_type_2.py index 4594eef5..2c4b4b06 100644 --- a/proofline/_generated/models/review_routing_view_type_2.py +++ b/proofline/_generated/models/review_routing_view_type_2.py @@ -6,12 +6,9 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from ..types import UNSET, Unset - if TYPE_CHECKING: from ..models.plan_projection import PlanProjection from ..models.routing_finding_view import RoutingFindingView - from ..models.specialist_execution_view import SpecialistExecutionView T = TypeVar("T", bound="ReviewRoutingViewType2") @@ -26,20 +23,15 @@ class ReviewRoutingViewType2: plan (PlanProjection): status (Literal['SUPPORTED']): version (str): Version of the validated routing plan. - specialist_execution (None | SpecialistExecutionView | Unset): Actual specialist selection and pass receipts for - the applied workflow. """ findings: list[RoutingFindingView] plan: PlanProjection status: Literal["SUPPORTED"] version: str - specialist_execution: None | SpecialistExecutionView | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.specialist_execution_view import SpecialistExecutionView # noqa: PLC0415 - findings = [] for findings_item_data in self.findings: findings_item = findings_item_data.to_dict() @@ -51,14 +43,6 @@ def to_dict(self) -> dict[str, Any]: version = self.version - specialist_execution: dict[str, Any] | None | Unset - if isinstance(self.specialist_execution, Unset): - specialist_execution = UNSET - elif isinstance(self.specialist_execution, SpecialistExecutionView): - specialist_execution = self.specialist_execution.to_dict() - else: - specialist_execution = self.specialist_execution - field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -69,8 +53,6 @@ def to_dict(self) -> dict[str, Any]: "version": version, } ) - if specialist_execution is not UNSET: - field_dict["specialist_execution"] = specialist_execution return field_dict @@ -78,7 +60,6 @@ def to_dict(self) -> dict[str, Any]: def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.plan_projection import PlanProjection # noqa: PLC0415 from ..models.routing_finding_view import RoutingFindingView # noqa: PLC0415 - from ..models.specialist_execution_view import SpecialistExecutionView # noqa: PLC0415 d = dict(src_dict) findings = [] @@ -96,29 +77,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: version = d.pop("version") - def _parse_specialist_execution(data: object) -> None | SpecialistExecutionView | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - specialist_execution_type_0 = SpecialistExecutionView.from_dict(data) - - return specialist_execution_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SpecialistExecutionView | Unset, data) - - specialist_execution = _parse_specialist_execution(d.pop("specialist_execution", UNSET)) - review_routing_view_type_2 = cls( findings=findings, plan=plan, status=status, version=version, - specialist_execution=specialist_execution, ) review_routing_view_type_2.additional_properties = d diff --git a/proofline/_generated/models/review_summary.py b/proofline/_generated/models/review_summary.py index a3f7d500..d5a42987 100644 --- a/proofline/_generated/models/review_summary.py +++ b/proofline/_generated/models/review_summary.py @@ -2,15 +2,17 @@ import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast +from typing import TYPE_CHECKING, Any, Literal, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.incomplete_cause_type_0 import IncompleteCauseType0 from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.actor_view import ActorView from ..models.refresh_view import RefreshView @@ -28,8 +30,10 @@ class ReviewSummary: finding_count (int): How many findings this review's assessments recorded, across all of them. id (UUID): The review's identifier. kind (str): `PULL_REQUEST`, `DEPLOYMENT`, `PATCH`, a review of local changes - sent as a patch, `COMMIT`, a review of pushed commits, or `FILES`, - complete selected files at one pushed commit. + sent as a patch, `COMMIT`, a review of pushed commits, `FILES`, + complete selected files at one pushed commit, `MERGE_GROUP`, the + commit GitHub's merge queue built for a group of pull requests, or + `REVISION_SCAN`, a scan of one captured commit. public_key (str): The review's stable public address: `rev_` followed by its identifier without hyphens. publication (str): Whether the review reached the pull request: `PUBLISHED`, `WITHHELD`, `PUBLICATION_REQUESTED` or `PUBLICATION_REFUSED`. A review run from @@ -40,6 +44,11 @@ class ReviewSummary: or `UNKNOWN` for a trigger key this build does not recognise. completed_at (datetime.datetime | None | Unset): When the review reached a terminal status. Absent while it is still pending or running. + counted_incomplete_causes (list[IncompleteCauseType0 | Literal['OUT_OF_CREDITS'] | Literal['UNKNOWN']] | Unset): + `incomplete_causes` as the Inbox and the reviews `cause:` search + count them: `OUT_OF_CREDITS` in place of the `NOT_CONFIGURED` an + assessment records when credits refused it. Present exactly when + `incomplete_causes` is. current_head_commit_sha (None | str | Unset): The pull request's head commit as the latest provider projection reports it, which can differ from `head_commit_sha`. Set only on a single-review read, and absent for a deployment review or a pull request with no projection. @@ -48,6 +57,15 @@ class ReviewSummary: which is not a commit. Absent when the review recorded none. head_commit_url (None | str | Unset): The exact revision reviewed. A commit URL, never a branch URL: the branch moves, the reviewed input does not. Absent for a patch review. + incomplete_causes (list[IncompleteCauseType0 | Literal['UNKNOWN']] | Unset): Why an `INCOMPLETE` review ended + incomplete, as its incomplete + assessments recorded it, in name order. `UNKNOWN` alone when none + recorded a cause. Absent for every other status, and on reads other + than the reviews list and a single review. + merge_group_pull_request_numbers (list[int] | Unset): For a `MERGE_GROUP` review, the pull requests GitHub + queued in the + group, in number order. Absent for every other kind, and until + Proofline has read the group's members. publication_detail (None | str | Unset): Why a publication was refused, or how one failed. Server text. pull_request_author_avatar_url (None | str | Unset): Provider-supplied avatar URL. Login-derived `.png` URLs do not work for @@ -57,6 +75,9 @@ class ReviewSummary: never display text. Absent when GitHub named no author. pull_request_author_login (None | str | Unset): Provider display metadata for the pull request author, not the rerun requester. + pull_request_author_name (None | str | Unset): The author's GitHub profile name, when known. Lead with it; the + login + is the fallback. Display metadata, never identity. pull_request_author_url (None | str | Unset): The author's profile on the deployment's GitHub host. Absent when no author login is known. pull_request_number (int | None | Unset): The pull request number. Absent for a deployment or patch review. @@ -78,6 +99,10 @@ class ReviewSummary: repository. repository_url (None | str | Unset): The repository on GitHub. Absent when the deployment's web base cannot be joined with the stored name. + requested_by (ActorView | None | Unset): Who asked for this review, for the reviews a person asked for: the + run-now button, a rerun, a pull request `review` command, or local + changes and pushed commits sent from the CLI or an editor. Absent on + automatic reviews, and on reviews recorded before requesters were. run_number (int | None | Unset): One-based, append-only ordinal within one repository pull request. """ @@ -92,13 +117,19 @@ class ReviewSummary: status: str trigger_origin: str completed_at: datetime.datetime | None | Unset = UNSET + counted_incomplete_causes: ( + list[IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]] | Unset + ) = UNSET current_head_commit_sha: None | str | Unset = UNSET head_commit_sha: None | str | Unset = UNSET head_commit_url: None | str | Unset = UNSET + incomplete_causes: list[IncompleteCauseType0 | Literal["UNKNOWN"]] | Unset = UNSET + merge_group_pull_request_numbers: list[int] | Unset = UNSET publication_detail: None | str | Unset = UNSET pull_request_author_avatar_url: None | str | Unset = UNSET pull_request_author_github_user_id: int | None | Unset = UNSET pull_request_author_login: None | str | Unset = UNSET + pull_request_author_name: None | str | Unset = UNSET pull_request_author_url: None | str | Unset = UNSET pull_request_number: int | None | Unset = UNSET pull_request_state: None | str | Unset = UNSET @@ -109,10 +140,12 @@ class ReviewSummary: repository_id: None | Unset | UUID = UNSET repository_name: None | str | Unset = UNSET repository_url: None | str | Unset = UNSET + requested_by: ActorView | None | Unset = UNSET run_number: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.actor_view import ActorView # noqa: PLC0415 from ..models.refresh_view import RefreshView # noqa: PLC0415 assessment_count = self.assessment_count @@ -143,6 +176,19 @@ def to_dict(self) -> dict[str, Any]: else: completed_at = self.completed_at + counted_incomplete_causes: ( + list[Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"] | str] | Unset + ) = UNSET + if not isinstance(self.counted_incomplete_causes, Unset): + counted_incomplete_causes = [] + for counted_incomplete_causes_item_data in self.counted_incomplete_causes: + counted_incomplete_causes_item: Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"] | str + if isinstance(counted_incomplete_causes_item_data, IncompleteCauseType0): + counted_incomplete_causes_item = counted_incomplete_causes_item_data.value + else: + counted_incomplete_causes_item = counted_incomplete_causes_item_data + counted_incomplete_causes.append(counted_incomplete_causes_item) + current_head_commit_sha: None | str | Unset if isinstance(self.current_head_commit_sha, Unset): current_head_commit_sha = UNSET @@ -161,6 +207,21 @@ def to_dict(self) -> dict[str, Any]: else: head_commit_url = self.head_commit_url + incomplete_causes: list[Literal["UNKNOWN"] | str] | Unset = UNSET + if not isinstance(self.incomplete_causes, Unset): + incomplete_causes = [] + for incomplete_causes_item_data in self.incomplete_causes: + incomplete_causes_item: Literal["UNKNOWN"] | str + if isinstance(incomplete_causes_item_data, IncompleteCauseType0): + incomplete_causes_item = incomplete_causes_item_data.value + else: + incomplete_causes_item = incomplete_causes_item_data + incomplete_causes.append(incomplete_causes_item) + + merge_group_pull_request_numbers: list[int] | Unset = UNSET + if not isinstance(self.merge_group_pull_request_numbers, Unset): + merge_group_pull_request_numbers = self.merge_group_pull_request_numbers + publication_detail: None | str | Unset if isinstance(self.publication_detail, Unset): publication_detail = UNSET @@ -185,6 +246,12 @@ def to_dict(self) -> dict[str, Any]: else: pull_request_author_login = self.pull_request_author_login + pull_request_author_name: None | str | Unset + if isinstance(self.pull_request_author_name, Unset): + pull_request_author_name = UNSET + else: + pull_request_author_name = self.pull_request_author_name + pull_request_author_url: None | str | Unset if isinstance(self.pull_request_author_url, Unset): pull_request_author_url = UNSET @@ -249,6 +316,14 @@ def to_dict(self) -> dict[str, Any]: else: repository_url = self.repository_url + requested_by: dict[str, Any] | None | Unset + if isinstance(self.requested_by, Unset): + requested_by = UNSET + elif isinstance(self.requested_by, ActorView): + requested_by = self.requested_by.to_dict() + else: + requested_by = self.requested_by + run_number: int | None | Unset if isinstance(self.run_number, Unset): run_number = UNSET @@ -273,12 +348,18 @@ def to_dict(self) -> dict[str, Any]: ) if completed_at is not UNSET: field_dict["completed_at"] = completed_at + if counted_incomplete_causes is not UNSET: + field_dict["counted_incomplete_causes"] = counted_incomplete_causes if current_head_commit_sha is not UNSET: field_dict["current_head_commit_sha"] = current_head_commit_sha if head_commit_sha is not UNSET: field_dict["head_commit_sha"] = head_commit_sha if head_commit_url is not UNSET: field_dict["head_commit_url"] = head_commit_url + if incomplete_causes is not UNSET: + field_dict["incomplete_causes"] = incomplete_causes + if merge_group_pull_request_numbers is not UNSET: + field_dict["merge_group_pull_request_numbers"] = merge_group_pull_request_numbers if publication_detail is not UNSET: field_dict["publication_detail"] = publication_detail if pull_request_author_avatar_url is not UNSET: @@ -287,6 +368,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["pull_request_author_github_user_id"] = pull_request_author_github_user_id if pull_request_author_login is not UNSET: field_dict["pull_request_author_login"] = pull_request_author_login + if pull_request_author_name is not UNSET: + field_dict["pull_request_author_name"] = pull_request_author_name if pull_request_author_url is not UNSET: field_dict["pull_request_author_url"] = pull_request_author_url if pull_request_number is not UNSET: @@ -307,6 +390,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repository_name"] = repository_name if repository_url is not UNSET: field_dict["repository_url"] = repository_url + if requested_by is not UNSET: + field_dict["requested_by"] = requested_by if run_number is not UNSET: field_dict["run_number"] = run_number @@ -314,6 +399,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.actor_view import ActorView # noqa: PLC0415 from ..models.refresh_view import RefreshView # noqa: PLC0415 d = dict(src_dict) @@ -354,6 +440,53 @@ def _parse_completed_at(data: object) -> datetime.datetime | None | Unset: completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + _counted_incomplete_causes = d.pop("counted_incomplete_causes", UNSET) + counted_incomplete_causes: ( + list[IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]] | Unset + ) = UNSET + if _counted_incomplete_causes is not UNSET: + counted_incomplete_causes = [] + for counted_incomplete_causes_item_data in _counted_incomplete_causes: + + def _parse_counted_incomplete_causes_item( + data: object, + ) -> IncompleteCauseType0 | Literal["OUT_OF_CREDITS"] | Literal["UNKNOWN"]: + try: + if not isinstance(data, str): + raise TypeError() + componentsschemas_incomplete_cause_type_0 = IncompleteCauseType0(data) + + return componentsschemas_incomplete_cause_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "UNKNOWN"): + raise TypeError() + componentsschemas_incomplete_cause_type_1 = cast(Literal["UNKNOWN"], data) + if componentsschemas_incomplete_cause_type_1 != "UNKNOWN": + raise ValueError( + f"/components/schemas/IncompleteCause_type_1 must match const 'UNKNOWN', got '{componentsschemas_incomplete_cause_type_1}'" + ) + return componentsschemas_incomplete_cause_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "OUT_OF_CREDITS"): + raise TypeError() + componentsschemas_credit_refusal_cause_type_0 = cast( + Literal["OUT_OF_CREDITS"], data + ) + if componentsschemas_credit_refusal_cause_type_0 != "OUT_OF_CREDITS": + raise ValueError( + f"/components/schemas/CreditRefusalCause_type_0 must match const 'OUT_OF_CREDITS', got '{componentsschemas_credit_refusal_cause_type_0}'" + ) + return componentsschemas_credit_refusal_cause_type_0 + + counted_incomplete_causes_item = _parse_counted_incomplete_causes_item( + counted_incomplete_causes_item_data + ) + + counted_incomplete_causes.append(counted_incomplete_causes_item) + def _parse_current_head_commit_sha(data: object) -> None | str | Unset: if data is None: return data @@ -383,6 +516,40 @@ def _parse_head_commit_url(data: object) -> None | str | Unset: head_commit_url = _parse_head_commit_url(d.pop("head_commit_url", UNSET)) + _incomplete_causes = d.pop("incomplete_causes", UNSET) + incomplete_causes: list[IncompleteCauseType0 | Literal["UNKNOWN"]] | Unset = UNSET + if _incomplete_causes is not UNSET: + incomplete_causes = [] + for incomplete_causes_item_data in _incomplete_causes: + + def _parse_incomplete_causes_item( + data: object, + ) -> IncompleteCauseType0 | Literal["UNKNOWN"]: + try: + if not isinstance(data, str): + raise TypeError() + componentsschemas_incomplete_cause_type_0 = IncompleteCauseType0(data) + + return componentsschemas_incomplete_cause_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "UNKNOWN"): + raise TypeError() + componentsschemas_incomplete_cause_type_1 = cast(Literal["UNKNOWN"], data) + if componentsschemas_incomplete_cause_type_1 != "UNKNOWN": + raise ValueError( + f"/components/schemas/IncompleteCause_type_1 must match const 'UNKNOWN', got '{componentsschemas_incomplete_cause_type_1}'" + ) + return componentsschemas_incomplete_cause_type_1 + + incomplete_causes_item = _parse_incomplete_causes_item(incomplete_causes_item_data) + + incomplete_causes.append(incomplete_causes_item) + + merge_group_pull_request_numbers = cast( + list[int], d.pop("merge_group_pull_request_numbers", UNSET) + ) + def _parse_publication_detail(data: object) -> None | str | Unset: if data is None: return data @@ -425,6 +592,17 @@ def _parse_pull_request_author_login(data: object) -> None | str | Unset: d.pop("pull_request_author_login", UNSET) ) + def _parse_pull_request_author_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + pull_request_author_name = _parse_pull_request_author_name( + d.pop("pull_request_author_name", UNSET) + ) + def _parse_pull_request_author_url(data: object) -> None | str | Unset: if data is None: return data @@ -533,6 +711,23 @@ def _parse_repository_url(data: object) -> None | str | Unset: repository_url = _parse_repository_url(d.pop("repository_url", UNSET)) + def _parse_requested_by(data: object) -> ActorView | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + requested_by_type_0 = ActorView.from_dict(data) + + return requested_by_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(ActorView | None | Unset, data) + + requested_by = _parse_requested_by(d.pop("requested_by", UNSET)) + def _parse_run_number(data: object) -> int | None | Unset: if data is None: return data @@ -554,13 +749,17 @@ def _parse_run_number(data: object) -> int | None | Unset: status=status, trigger_origin=trigger_origin, completed_at=completed_at, + counted_incomplete_causes=counted_incomplete_causes, current_head_commit_sha=current_head_commit_sha, head_commit_sha=head_commit_sha, head_commit_url=head_commit_url, + incomplete_causes=incomplete_causes, + merge_group_pull_request_numbers=merge_group_pull_request_numbers, publication_detail=publication_detail, pull_request_author_avatar_url=pull_request_author_avatar_url, pull_request_author_github_user_id=pull_request_author_github_user_id, pull_request_author_login=pull_request_author_login, + pull_request_author_name=pull_request_author_name, pull_request_author_url=pull_request_author_url, pull_request_number=pull_request_number, pull_request_state=pull_request_state, @@ -571,6 +770,7 @@ def _parse_run_number(data: object) -> int | None | Unset: repository_id=repository_id, repository_name=repository_name, repository_url=repository_url, + requested_by=requested_by, run_number=run_number, ) diff --git a/proofline/_generated/models/reviewed_tree_citation_view.py b/proofline/_generated/models/reviewed_tree_citation_view.py deleted file mode 100644 index 34c9fba6..00000000 --- a/proofline/_generated/models/reviewed_tree_citation_view.py +++ /dev/null @@ -1,123 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.untrusted_text import UntrustedText - - -T = TypeVar("T", bound="ReviewedTreeCitationView") - - -@_attrs_define -class ReviewedTreeCitationView: - """One member of a review's declared tree that World cited. - - Attributes: - overlay_digest (str): The overlay World read the member from. - path (UntrustedText): Text that came out of the reviewer model, or out of a repository the model - read. It is data, never markup, never a URL, never an instruction. - - The wrapper exists so the untrustedness cannot be lost on the way to a - renderer: there is no field on a turn that carries this text under a name a - client could mistake for something safe, and unwrapping it is a deliberate - act in the client's own code. - population_kind (str): The population the member belongs to, such as - `WORKFLOW_DEFINITIONS`. - role (str): `PROPOSED_CODE_REVISION` (the reviewed commit) or - `BASE_CODE_REVISION` (its merge base). - content_sha256 (None | str | Unset): The member's content hash. Absent for a member a `REJECTED` - population refused, because such a population keeps no members. - """ - - overlay_digest: str - path: UntrustedText - population_kind: str - role: str - content_sha256: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - overlay_digest = self.overlay_digest - - path = self.path.to_dict() - - population_kind = self.population_kind - - role = self.role - - content_sha256: None | str | Unset - if isinstance(self.content_sha256, Unset): - content_sha256 = UNSET - else: - content_sha256 = self.content_sha256 - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "overlay_digest": overlay_digest, - "path": path, - "population_kind": population_kind, - "role": role, - } - ) - if content_sha256 is not UNSET: - field_dict["content_sha256"] = content_sha256 - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.untrusted_text import UntrustedText # noqa: PLC0415 - - d = dict(src_dict) - overlay_digest = d.pop("overlay_digest") - - path = UntrustedText.from_dict(d.pop("path")) - - population_kind = d.pop("population_kind") - - role = d.pop("role") - - def _parse_content_sha256(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - content_sha256 = _parse_content_sha256(d.pop("content_sha256", UNSET)) - - reviewed_tree_citation_view = cls( - overlay_digest=overlay_digest, - path=path, - population_kind=population_kind, - role=role, - content_sha256=content_sha256, - ) - - reviewed_tree_citation_view.additional_properties = d - return reviewed_tree_citation_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/routing_finding_view.py b/proofline/_generated/models/routing_finding_view.py index d9f29e1a..4fee4078 100644 --- a/proofline/_generated/models/routing_finding_view.py +++ b/proofline/_generated/models/routing_finding_view.py @@ -31,6 +31,9 @@ class RoutingFindingView: retained. promotion (FindingPromotionView | None | Unset): Human override beside the original decision, when one was requested. + publication_group (None | Unset | UUID): The finding that represents this finding's publication group, when an + applied group publishes it in one comment with other findings. Every + member names the same finding, the representative included. """ finding_id: UUID @@ -42,6 +45,7 @@ class RoutingFindingView: floor_reason: None | str | Unset = UNSET inline_reason: None | str | Unset = UNSET promotion: FindingPromotionView | None | Unset = UNSET + publication_group: None | Unset | UUID = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -83,6 +87,14 @@ def to_dict(self) -> dict[str, Any]: else: promotion = self.promotion + publication_group: None | str | Unset + if isinstance(self.publication_group, Unset): + publication_group = UNSET + elif isinstance(self.publication_group, UUID): + publication_group = str(self.publication_group) + else: + publication_group = self.publication_group + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -102,6 +114,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["inline_reason"] = inline_reason if promotion is not UNSET: field_dict["promotion"] = promotion + if publication_group is not UNSET: + field_dict["publication_group"] = publication_group return field_dict @@ -164,6 +178,23 @@ def _parse_promotion(data: object) -> FindingPromotionView | None | Unset: promotion = _parse_promotion(d.pop("promotion", UNSET)) + def _parse_publication_group(data: object) -> None | Unset | UUID: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + publication_group_type_0 = UUID(data) + + return publication_group_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | UUID, data) + + publication_group = _parse_publication_group(d.pop("publication_group", UNSET)) + routing_finding_view = cls( finding_id=finding_id, inline_limit_exceeded=inline_limit_exceeded, @@ -174,6 +205,7 @@ def _parse_promotion(data: object) -> FindingPromotionView | None | Unset: floor_reason=floor_reason, inline_reason=inline_reason, promotion=promotion, + publication_group=publication_group, ) routing_finding_view.additional_properties = d diff --git a/proofline/_generated/models/run_now_mode.py b/proofline/_generated/models/run_now_mode.py index 693f4bc5..9fdac7a3 100644 --- a/proofline/_generated/models/run_now_mode.py +++ b/proofline/_generated/models/run_now_mode.py @@ -3,7 +3,6 @@ class RunNowMode(StrEnum): EXISTING_OR_NEW = "EXISTING_OR_NEW" - EXTENDED = "EXTENDED" FULL = "FULL" def __str__(self) -> str: diff --git a/proofline/_generated/models/run_now_refusal_view_type_10.py b/proofline/_generated/models/run_now_refusal_view_type_10.py deleted file mode 100644 index 2c7ce041..00000000 --- a/proofline/_generated/models/run_now_refusal_view_type_10.py +++ /dev/null @@ -1,72 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, Literal, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -T = TypeVar("T", bound="RunNowRefusalViewType10") - - -@_attrs_define -class RunNowRefusalViewType10: - """Deep review policy, funding or worker availability prevents admission. - - Attributes: - detail (str): - reason (Literal['DEEP_REVIEW_UNAVAILABLE']): - """ - - detail: str - reason: Literal["DEEP_REVIEW_UNAVAILABLE"] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - detail = self.detail - - reason = self.reason - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "detail": detail, - "reason": reason, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - detail = d.pop("detail") - - reason = cast(Literal["DEEP_REVIEW_UNAVAILABLE"], d.pop("reason")) - if reason != "DEEP_REVIEW_UNAVAILABLE": - raise ValueError(f"reason must match const 'DEEP_REVIEW_UNAVAILABLE', got '{reason}'") - - run_now_refusal_view_type_10 = cls( - detail=detail, - reason=reason, - ) - - run_now_refusal_view_type_10.additional_properties = d - return run_now_refusal_view_type_10 - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/run_now_refused.py b/proofline/_generated/models/run_now_refused.py index a2e6cecb..095b8f4c 100644 --- a/proofline/_generated/models/run_now_refused.py +++ b/proofline/_generated/models/run_now_refused.py @@ -17,8 +17,6 @@ from ..models.run_now_refusal_view_type_7 import RunNowRefusalViewType7 from ..models.run_now_refusal_view_type_8 import RunNowRefusalViewType8 from ..models.run_now_refusal_view_type_9 import RunNowRefusalViewType9 - from ..models.run_now_refusal_view_type_10 import RunNowRefusalViewType10 - from ..models.run_now_refusal_view_type_11 import RunNowRefusalViewType11 T = TypeVar("T", bound="RunNowRefused") @@ -38,10 +36,10 @@ class RunNowRefused: Attributes: detail (str): One sentence naming the condition and the setting to change, for a reader with no link to follow. - refusal (RunNowRefusalViewType0 | RunNowRefusalViewType1 | RunNowRefusalViewType10 | RunNowRefusalViewType11 | - RunNowRefusalViewType2 | RunNowRefusalViewType3 | RunNowRefusalViewType4 | RunNowRefusalViewType5 | - RunNowRefusalViewType6 | RunNowRefusalViewType7 | RunNowRefusalViewType8 | RunNowRefusalViewType9): Why a run- - now request created nothing, each reason with what the page + refusal (RunNowRefusalViewType0 | RunNowRefusalViewType1 | RunNowRefusalViewType2 | RunNowRefusalViewType3 | + RunNowRefusalViewType4 | RunNowRefusalViewType5 | RunNowRefusalViewType6 | RunNowRefusalViewType7 | + RunNowRefusalViewType8 | RunNowRefusalViewType9): Why a run-now request created nothing, each reason with what + the page needs to link the setting to change. repository_name (str): The repository's name within its owner, as its pages are addressed. status (int): Always 400. @@ -52,8 +50,6 @@ class RunNowRefused: refusal: ( RunNowRefusalViewType0 | RunNowRefusalViewType1 - | RunNowRefusalViewType10 - | RunNowRefusalViewType11 | RunNowRefusalViewType2 | RunNowRefusalViewType3 | RunNowRefusalViewType4 @@ -78,8 +74,6 @@ def to_dict(self) -> dict[str, Any]: from ..models.run_now_refusal_view_type_6 import RunNowRefusalViewType6 # noqa: PLC0415 from ..models.run_now_refusal_view_type_7 import RunNowRefusalViewType7 # noqa: PLC0415 from ..models.run_now_refusal_view_type_8 import RunNowRefusalViewType8 # noqa: PLC0415 - from ..models.run_now_refusal_view_type_9 import RunNowRefusalViewType9 # noqa: PLC0415 - from ..models.run_now_refusal_view_type_10 import RunNowRefusalViewType10 # noqa: PLC0415 detail = self.detail @@ -102,10 +96,6 @@ def to_dict(self) -> dict[str, Any]: refusal = self.refusal.to_dict() elif isinstance(self.refusal, RunNowRefusalViewType8): refusal = self.refusal.to_dict() - elif isinstance(self.refusal, RunNowRefusalViewType9): - refusal = self.refusal.to_dict() - elif isinstance(self.refusal, RunNowRefusalViewType10): - refusal = self.refusal.to_dict() else: refusal = self.refusal.to_dict() @@ -141,8 +131,6 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.run_now_refusal_view_type_7 import RunNowRefusalViewType7 # noqa: PLC0415 from ..models.run_now_refusal_view_type_8 import RunNowRefusalViewType8 # noqa: PLC0415 from ..models.run_now_refusal_view_type_9 import RunNowRefusalViewType9 # noqa: PLC0415 - from ..models.run_now_refusal_view_type_10 import RunNowRefusalViewType10 # noqa: PLC0415 - from ..models.run_now_refusal_view_type_11 import RunNowRefusalViewType11 # noqa: PLC0415 d = dict(src_dict) detail = d.pop("detail") @@ -152,8 +140,6 @@ def _parse_refusal( ) -> ( RunNowRefusalViewType0 | RunNowRefusalViewType1 - | RunNowRefusalViewType10 - | RunNowRefusalViewType11 | RunNowRefusalViewType2 | RunNowRefusalViewType3 | RunNowRefusalViewType4 @@ -253,31 +239,11 @@ def _parse_refusal( return componentsschemas_run_now_refusal_view_type_8 except (TypeError, ValueError, AttributeError, KeyError): pass - try: - if not isinstance(data, dict): - raise TypeError() - componentsschemas_run_now_refusal_view_type_9 = RunNowRefusalViewType9.from_dict( - data - ) - - return componentsschemas_run_now_refusal_view_type_9 - except (TypeError, ValueError, AttributeError, KeyError): - pass - try: - if not isinstance(data, dict): - raise TypeError() - componentsschemas_run_now_refusal_view_type_10 = RunNowRefusalViewType10.from_dict( - data - ) - - return componentsschemas_run_now_refusal_view_type_10 - except (TypeError, ValueError, AttributeError, KeyError): - pass if not isinstance(data, dict): raise TypeError() - componentsschemas_run_now_refusal_view_type_11 = RunNowRefusalViewType11.from_dict(data) + componentsschemas_run_now_refusal_view_type_9 = RunNowRefusalViewType9.from_dict(data) - return componentsschemas_run_now_refusal_view_type_11 + return componentsschemas_run_now_refusal_view_type_9 refusal = _parse_refusal(d.pop("refusal")) diff --git a/proofline/_generated/models/run_now_request.py b/proofline/_generated/models/run_now_request.py index 32eb0a19..c3ce3a1c 100644 --- a/proofline/_generated/models/run_now_request.py +++ b/proofline/_generated/models/run_now_request.py @@ -1,7 +1,7 @@ from __future__ import annotations from collections.abc import Mapping -from typing import Any, TypeVar, cast +from typing import Any, TypeVar from attrs import define as _attrs_define @@ -16,21 +16,12 @@ class RunNowRequest: """An empty body keeps the run-now behavior existing clients request. Attributes: - focus_text (None | str | Unset): Optional investigation focus for EXTENDED, trimmed and frozen at admission. - Limited to 500 UTF-16 code units. mode (RunNowMode | Unset): Whether an explicit request may reuse a settled review of the live head. """ - focus_text: None | str | Unset = UNSET mode: RunNowMode | Unset = UNSET def to_dict(self) -> dict[str, Any]: - focus_text: None | str | Unset - if isinstance(self.focus_text, Unset): - focus_text = UNSET - else: - focus_text = self.focus_text - mode: str | Unset = UNSET if not isinstance(self.mode, Unset): mode = self.mode.value @@ -38,8 +29,6 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) - if focus_text is not UNSET: - field_dict["focus_text"] = focus_text if mode is not UNSET: field_dict["mode"] = mode @@ -48,16 +37,6 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - - def _parse_focus_text(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - focus_text = _parse_focus_text(d.pop("focus_text", UNSET)) - _mode = d.pop("mode", UNSET) mode: RunNowMode | Unset if isinstance(_mode, Unset): @@ -66,7 +45,6 @@ def _parse_focus_text(data: object) -> None | str | Unset: mode = RunNowMode(_mode) run_now_request = cls( - focus_text=focus_text, mode=mode, ) diff --git a/proofline/_generated/models/run_progress.py b/proofline/_generated/models/run_progress.py new file mode 100644 index 00000000..462bc88b --- /dev/null +++ b/proofline/_generated/models/run_progress.py @@ -0,0 +1,188 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, Literal, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RunProgress") + + +@_attrs_define +class RunProgress: + """Where an unfinished review's runs stand. + + Attributes: + attempts (int): Attempts begun by the run in `state`, counting worker claims. + state (Literal['QUEUED'] | Literal['RETRY_SCHEDULED'] | Literal['RUNNING'] | Literal['WAITING']): What an + unfinished review's runs are doing now. + due_at (datetime.datetime | None | Unset): When the run in `state` is due: in the past for `QUEUED`, the next + attempt for `RETRY_SCHEDULED` and the next check for `WAITING`. Null + for `RUNNING`. + last_progress_at (datetime.datetime | None | Unset): When any of the review's runs last recorded a completed + step. Null + before the first. + """ + + attempts: int + state: Literal["QUEUED"] | Literal["RETRY_SCHEDULED"] | Literal["RUNNING"] | Literal["WAITING"] + due_at: datetime.datetime | None | Unset = UNSET + last_progress_at: datetime.datetime | None | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + attempts = self.attempts + + state: ( + Literal["QUEUED"] | Literal["RETRY_SCHEDULED"] | Literal["RUNNING"] | Literal["WAITING"] + ) + state = self.state + + due_at: None | str | Unset + if isinstance(self.due_at, Unset): + due_at = UNSET + elif isinstance(self.due_at, datetime.datetime): + due_at = self.due_at.isoformat() + else: + due_at = self.due_at + + last_progress_at: None | str | Unset + if isinstance(self.last_progress_at, Unset): + last_progress_at = UNSET + elif isinstance(self.last_progress_at, datetime.datetime): + last_progress_at = self.last_progress_at.isoformat() + else: + last_progress_at = self.last_progress_at + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "attempts": attempts, + "state": state, + } + ) + if due_at is not UNSET: + field_dict["due_at"] = due_at + if last_progress_at is not UNSET: + field_dict["last_progress_at"] = last_progress_at + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + attempts = d.pop("attempts") + + def _parse_state( + data: object, + ) -> ( + Literal["QUEUED"] | Literal["RETRY_SCHEDULED"] | Literal["RUNNING"] | Literal["WAITING"] + ): + try: + if not (type(data) is str and data == "WAITING"): + raise TypeError() + componentsschemas_run_progress_state_type_0 = cast(Literal["WAITING"], data) + if componentsschemas_run_progress_state_type_0 != "WAITING": + raise ValueError( + f"/components/schemas/RunProgressState_type_0 must match const 'WAITING', got '{componentsschemas_run_progress_state_type_0}'" + ) + return componentsschemas_run_progress_state_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "QUEUED"): + raise TypeError() + componentsschemas_run_progress_state_type_1 = cast(Literal["QUEUED"], data) + if componentsschemas_run_progress_state_type_1 != "QUEUED": + raise ValueError( + f"/components/schemas/RunProgressState_type_1 must match const 'QUEUED', got '{componentsschemas_run_progress_state_type_1}'" + ) + return componentsschemas_run_progress_state_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not (type(data) is str and data == "RUNNING"): + raise TypeError() + componentsschemas_run_progress_state_type_2 = cast(Literal["RUNNING"], data) + if componentsschemas_run_progress_state_type_2 != "RUNNING": + raise ValueError( + f"/components/schemas/RunProgressState_type_2 must match const 'RUNNING', got '{componentsschemas_run_progress_state_type_2}'" + ) + return componentsschemas_run_progress_state_type_2 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not (type(data) is str and data == "RETRY_SCHEDULED"): + raise TypeError() + componentsschemas_run_progress_state_type_3 = cast(Literal["RETRY_SCHEDULED"], data) + if componentsschemas_run_progress_state_type_3 != "RETRY_SCHEDULED": + raise ValueError( + f"/components/schemas/RunProgressState_type_3 must match const 'RETRY_SCHEDULED', got '{componentsschemas_run_progress_state_type_3}'" + ) + return componentsschemas_run_progress_state_type_3 + + state = _parse_state(d.pop("state")) + + def _parse_due_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + due_at_type_0 = datetime.datetime.fromisoformat(data) + + return due_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + due_at = _parse_due_at(d.pop("due_at", UNSET)) + + def _parse_last_progress_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + last_progress_at_type_0 = datetime.datetime.fromisoformat(data) + + return last_progress_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + last_progress_at = _parse_last_progress_at(d.pop("last_progress_at", UNSET)) + + run_progress = cls( + attempts=attempts, + state=state, + due_at=due_at, + last_progress_at=last_progress_at, + ) + + run_progress.additional_properties = d + return run_progress + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/scan_request_body.py b/proofline/_generated/models/scan_request_body.py new file mode 100644 index 00000000..db3b956f --- /dev/null +++ b/proofline/_generated/models/scan_request_body.py @@ -0,0 +1,96 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScanRequestBody") + + +@_attrs_define +class ScanRequestBody: + """One request to scan a ref or an exact commit of the repository. + + Attributes: + budget_credits (int): The credits the whole scan may spend, at most the organization's + on-demand ceiling. + request_id (UUID): The caller's identity for this request. Sending it again returns the + first resolution instead of scanning again. + commit_sha (None | str | Unset): An exact commit. Name it or `ref`. + ref (None | str | Unset): A ref, resolved once when the request arrives. Name it or `commit_sha`. + """ + + budget_credits: int + request_id: UUID + commit_sha: None | str | Unset = UNSET + ref: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + budget_credits = self.budget_credits + + request_id = str(self.request_id) + + commit_sha: None | str | Unset + if isinstance(self.commit_sha, Unset): + commit_sha = UNSET + else: + commit_sha = self.commit_sha + + ref: None | str | Unset + if isinstance(self.ref, Unset): + ref = UNSET + else: + ref = self.ref + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "budget_credits": budget_credits, + "request_id": request_id, + } + ) + if commit_sha is not UNSET: + field_dict["commit_sha"] = commit_sha + if ref is not UNSET: + field_dict["ref"] = ref + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + budget_credits = d.pop("budget_credits") + + request_id = UUID(d.pop("request_id")) + + def _parse_commit_sha(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + commit_sha = _parse_commit_sha(d.pop("commit_sha", UNSET)) + + def _parse_ref(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + ref = _parse_ref(d.pop("ref", UNSET)) + + scan_request_body = cls( + budget_credits=budget_credits, + request_id=request_id, + commit_sha=commit_sha, + ref=ref, + ) + + return scan_request_body diff --git a/proofline/_generated/models/scan_response.py b/proofline/_generated/models/scan_response.py new file mode 100644 index 00000000..4447d484 --- /dev/null +++ b/proofline/_generated/models/scan_response.py @@ -0,0 +1,105 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="ScanResponse") + + +@_attrs_define +class ScanResponse: + """What a scan request resolved to. + + Attributes: + outcome (str): `CREATED`, `EXISTING` when this request id was already resolved, or + `REPOSITORY_UNAVAILABLE` when GitHub could not resolve it. + resolution_id (UUID): The request's one resolution receipt. + review_id (None | Unset | UUID): The scan review, readable through the review routes. Absent when + GitHub could not resolve the request. + """ + + outcome: str + resolution_id: UUID + review_id: None | Unset | UUID = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + outcome = self.outcome + + resolution_id = str(self.resolution_id) + + review_id: None | str | Unset + if isinstance(self.review_id, Unset): + review_id = UNSET + elif isinstance(self.review_id, UUID): + review_id = str(self.review_id) + else: + review_id = self.review_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "outcome": outcome, + "resolution_id": resolution_id, + } + ) + if review_id is not UNSET: + field_dict["review_id"] = review_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + outcome = d.pop("outcome") + + resolution_id = UUID(d.pop("resolution_id")) + + def _parse_review_id(data: object) -> None | Unset | UUID: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + review_id_type_0 = UUID(data) + + return review_id_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | UUID, data) + + review_id = _parse_review_id(d.pop("review_id", UNSET)) + + scan_response = cls( + outcome=outcome, + resolution_id=resolution_id, + review_id=review_id, + ) + + scan_response.additional_properties = d + return scan_response + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> Any: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: Any) -> None: + self.additional_properties[key] = value + + def __delitem__(self, key: str) -> None: + del self.additional_properties[key] + + def __contains__(self, key: str) -> bool: + return key in self.additional_properties diff --git a/proofline/_generated/models/specialist_assessment_execution.py b/proofline/_generated/models/specialist_assessment_execution.py deleted file mode 100644 index 14314b41..00000000 --- a/proofline/_generated/models/specialist_assessment_execution.py +++ /dev/null @@ -1,84 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.specialist_pass_execution import SpecialistPassExecution - - -T = TypeVar("T", bound="SpecialistAssessmentExecution") - - -@_attrs_define -class SpecialistAssessmentExecution: - """ - Attributes: - assessment_id (UUID): The immutable assessment whose specialist execution is reported. - passes (list[SpecialistPassExecution]): Selected specialist passes and their retained execution outputs. - """ - - assessment_id: UUID - passes: list[SpecialistPassExecution] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assessment_id = str(self.assessment_id) - - passes = [] - for passes_item_data in self.passes: - passes_item = passes_item_data.to_dict() - passes.append(passes_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assessment_id": assessment_id, - "passes": passes, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.specialist_pass_execution import SpecialistPassExecution # noqa: PLC0415 - - d = dict(src_dict) - assessment_id = UUID(d.pop("assessment_id")) - - passes = [] - _passes = d.pop("passes") - for passes_item_data in _passes: - passes_item = SpecialistPassExecution.from_dict(passes_item_data) - - passes.append(passes_item) - - specialist_assessment_execution = cls( - assessment_id=assessment_id, - passes=passes, - ) - - specialist_assessment_execution.additional_properties = d - return specialist_assessment_execution - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/specialist_execution_view.py b/proofline/_generated/models/specialist_execution_view.py deleted file mode 100644 index 2bed655c..00000000 --- a/proofline/_generated/models/specialist_execution_view.py +++ /dev/null @@ -1,85 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -if TYPE_CHECKING: - from ..models.specialist_assessment_execution import SpecialistAssessmentExecution - - -T = TypeVar("T", bound="SpecialistExecutionView") - - -@_attrs_define -class SpecialistExecutionView: - """ - Attributes: - assessments (list[SpecialistAssessmentExecution]): The applied specialist roster per exact assessment execution. - selection_recorded (bool): False until the applied parent captures its specialist choices. - """ - - assessments: list[SpecialistAssessmentExecution] - selection_recorded: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - assessments = [] - for assessments_item_data in self.assessments: - assessments_item = assessments_item_data.to_dict() - assessments.append(assessments_item) - - selection_recorded = self.selection_recorded - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "assessments": assessments, - "selection_recorded": selection_recorded, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.specialist_assessment_execution import ( - SpecialistAssessmentExecution, # noqa: PLC0415 - ) - - d = dict(src_dict) - assessments = [] - _assessments = d.pop("assessments") - for assessments_item_data in _assessments: - assessments_item = SpecialistAssessmentExecution.from_dict(assessments_item_data) - - assessments.append(assessments_item) - - selection_recorded = d.pop("selection_recorded") - - specialist_execution_view = cls( - assessments=assessments, - selection_recorded=selection_recorded, - ) - - specialist_execution_view.additional_properties = d - return specialist_execution_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/specialist_output_projection.py b/proofline/_generated/models/specialist_output_projection.py deleted file mode 100644 index 02307276..00000000 --- a/proofline/_generated/models/specialist_output_projection.py +++ /dev/null @@ -1,92 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="SpecialistOutputProjection") - - -@_attrs_define -class SpecialistOutputProjection: - """A pass receipt's bounded operational facts, without its proposals or prose. - - Attributes: - output_sha256 (str): Verified digest of the retained output bytes. - status (str): `PRODUCED`, `UNAVAILABLE`, `INCOMPLETE` or `MALFORMED`. - gap_kind (None | str | Unset): Closed evidence-gap class, absent when the pass produced output. - """ - - output_sha256: str - status: str - gap_kind: None | str | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - output_sha256 = self.output_sha256 - - status = self.status - - gap_kind: None | str | Unset - if isinstance(self.gap_kind, Unset): - gap_kind = UNSET - else: - gap_kind = self.gap_kind - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "output_sha256": output_sha256, - "status": status, - } - ) - if gap_kind is not UNSET: - field_dict["gap_kind"] = gap_kind - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - output_sha256 = d.pop("output_sha256") - - status = d.pop("status") - - def _parse_gap_kind(data: object) -> None | str | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | str | Unset, data) - - gap_kind = _parse_gap_kind(d.pop("gap_kind", UNSET)) - - specialist_output_projection = cls( - output_sha256=output_sha256, - status=status, - gap_kind=gap_kind, - ) - - specialist_output_projection.additional_properties = d - return specialist_output_projection - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/specialist_pass_execution.py b/proofline/_generated/models/specialist_pass_execution.py deleted file mode 100644 index 417f08c4..00000000 --- a/proofline/_generated/models/specialist_pass_execution.py +++ /dev/null @@ -1,122 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -if TYPE_CHECKING: - from ..models.specialist_output_projection import SpecialistOutputProjection - - -T = TypeVar("T", bound="SpecialistPassExecution") - - -@_attrs_define -class SpecialistPassExecution: - """ - Attributes: - files (list[str]): Exact selected paths from the validated captured change. - floor (bool): Whether captured file facts required this pass. - name (str): Closed registry key of the selected specialist. - output (None | SpecialistOutputProjection | Unset): Missing means selected, with no retained output. It never - means success. - """ - - files: list[str] - floor: bool - name: str - output: None | SpecialistOutputProjection | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - from ..models.specialist_output_projection import ( - SpecialistOutputProjection, # noqa: PLC0415 - ) - - files = self.files - - floor = self.floor - - name = self.name - - output: dict[str, Any] | None | Unset - if isinstance(self.output, Unset): - output = UNSET - elif isinstance(self.output, SpecialistOutputProjection): - output = self.output.to_dict() - else: - output = self.output - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "files": files, - "floor": floor, - "name": name, - } - ) - if output is not UNSET: - field_dict["output"] = output - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.specialist_output_projection import ( - SpecialistOutputProjection, # noqa: PLC0415 - ) - - d = dict(src_dict) - files = cast(list[str], d.pop("files")) - - floor = d.pop("floor") - - name = d.pop("name") - - def _parse_output(data: object) -> None | SpecialistOutputProjection | Unset: - if data is None: - return data - if isinstance(data, Unset): - return data - try: - if not isinstance(data, dict): - raise TypeError() - output_type_0 = SpecialistOutputProjection.from_dict(data) - - return output_type_0 - except (TypeError, ValueError, AttributeError, KeyError): - pass - return cast(None | SpecialistOutputProjection | Unset, data) - - output = _parse_output(d.pop("output", UNSET)) - - specialist_pass_execution = cls( - files=files, - floor=floor, - name=name, - output=output, - ) - - specialist_pass_execution.additional_properties = d - return specialist_pass_execution - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_generated/models/terraform_plan_view.py b/proofline/_generated/models/terraform_plan_view.py deleted file mode 100644 index 24cf8f61..00000000 --- a/proofline/_generated/models/terraform_plan_view.py +++ /dev/null @@ -1,12 +0,0 @@ -from enum import StrEnum - - -class TerraformPlanView(StrEnum): - ADDRESSES_UNREPORTED = "ADDRESSES_UNREPORTED" - HEAD_DIFFERS = "HEAD_DIFFERS" - NOT_DECLARED = "NOT_DECLARED" - NOT_PINNED = "NOT_PINNED" - TAKEN = "TAKEN" - - def __str__(self) -> str: - return str(self.value) diff --git a/proofline/_generated/models/terraform_roots_view.py b/proofline/_generated/models/terraform_roots_view.py deleted file mode 100644 index 2ef0ccc9..00000000 --- a/proofline/_generated/models/terraform_roots_view.py +++ /dev/null @@ -1,80 +0,0 @@ -from __future__ import annotations - -from collections.abc import Mapping -from typing import Any, TypeVar, cast - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..models.terraform_plan_view import TerraformPlanView - -T = TypeVar("T", bound="TerraformRootsView") - - -@_attrs_define -class TerraformRootsView: - """The Terraform roots of one declared reach read. - - Attributes: - addresses (list[str]): The changed resource instance addresses taken as roots. - omitted (int): Changed addresses left out at World's limit of 100 roots per read. - plan (TerraformPlanView): - """ - - addresses: list[str] - omitted: int - plan: TerraformPlanView - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - addresses = self.addresses - - omitted = self.omitted - - plan = self.plan.value - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "addresses": addresses, - "omitted": omitted, - "plan": plan, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - addresses = cast(list[str], d.pop("addresses")) - - omitted = d.pop("omitted") - - plan = TerraformPlanView(d.pop("plan")) - - terraform_roots_view = cls( - addresses=addresses, - omitted=omitted, - plan=plan, - ) - - terraform_roots_view.additional_properties = d - return terraform_roots_view - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/proofline/_mcp.py b/proofline/_mcp.py index c85f781d..896a7796 100644 --- a/proofline/_mcp.py +++ b/proofline/_mcp.py @@ -95,7 +95,11 @@ class McpTools: def __init__(self, http: httpx.Client) -> None: self._http = http - def _call(self, name: str, args: dict[str, Any]) -> KnowledgeResult: + def _call( + self, name: str, args: dict[str, Any], *, organization_id: str | None = None + ) -> KnowledgeResult: + if organization_id is not None: + args = {**args, "organization_id": organization_id} call = _body("tools/call", {"name": name, "arguments": args}, 2) frames = [ ( @@ -140,7 +144,11 @@ class AsyncMcpTools: def __init__(self, http: httpx.AsyncClient) -> None: self._http = http - async def _call(self, name: str, args: dict[str, Any]) -> KnowledgeResult: + async def _call( + self, name: str, args: dict[str, Any], *, organization_id: str | None = None + ) -> KnowledgeResult: + if organization_id is not None: + args = {**args, "organization_id": organization_id} call = _body("tools/call", {"name": name, "arguments": args}, 2) frames = [ ( @@ -177,3 +185,17 @@ async def _call(self, name: str, args: dict[str, Any]) -> KnowledgeResult: if identity == 1 and result.get("protocolVersion") != PROTOCOL: raise _refused() return _result(result) + + +class McpClient(McpTools): + """Discover the organizations currently authorized for this MCP credential.""" + + def list_organizations(self) -> KnowledgeResult: + return self._call("list_organizations", {}) + + +class AsyncMcpClient(AsyncMcpTools): + """Discover the organizations currently authorized for this MCP credential.""" + + async def list_organizations(self) -> KnowledgeResult: + return await self._call("list_organizations", {}) diff --git a/proofline/_transport.py b/proofline/_transport.py index 52bbf880..7f490782 100644 --- a/proofline/_transport.py +++ b/proofline/_transport.py @@ -7,21 +7,38 @@ import os import re from asyncio import sleep as async_sleep -from collections.abc import AsyncIterator, Generator, Iterator +from collections.abc import AsyncIterator, Callable, Generator, Iterator +from contextlib import contextmanager from contextvars import ContextVar from datetime import UTC, datetime from email.utils import parsedate_to_datetime from time import monotonic, sleep +from typing import Any, TypeAlias, cast from urllib.parse import urlsplit import anyio import httpx from pydantic import SecretStr +from ._generated.models import ( + RefusedEnvironment, + RunNowRefusalViewType0, + RunNowRefusalViewType1, + RunNowRefusalViewType2, + RunNowRefusalViewType3, + RunNowRefusalViewType4, + RunNowRefusalViewType5, + RunNowRefusalViewType6, + RunNowRefusalViewType7, + RunNowRefusalViewType8, + RunNowRefusalViewType9, + RunNowRefused, +) +from ._generated.types import Unset from ._sync_http import IO_DEADLINE from ._sync_http import Transport as SyncHTTPTransport -VERSION = "1.0.3" +VERSION = "5.11.4" MAX_RESPONSE_BYTES = 8 * 1024 * 1024 WEEKDAY = r"(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun)" FULL_WEEKDAY = r"(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday)" @@ -34,6 +51,19 @@ rf"{WEEKDAY} {MONTH} [ \d]\d \d{{2}}:\d{{2}}:\d{{2}} \d{{4}}", ) ) +# Each variant has a literal `reason`; the other fields depend on it. +RunNowRefusal: TypeAlias = ( + RunNowRefusalViewType0 + | RunNowRefusalViewType1 + | RunNowRefusalViewType2 + | RunNowRefusalViewType3 + | RunNowRefusalViewType4 + | RunNowRefusalViewType5 + | RunNowRefusalViewType6 + | RunNowRefusalViewType7 + | RunNowRefusalViewType8 + | RunNowRefusalViewType9 +) DEADLINE: ContextVar[float | None] = ContextVar("proofline_request_deadline", default=None) @@ -48,12 +78,29 @@ def auth_flow(self, request: httpx.Request) -> Generator[httpx.Request, httpx.Re class ProoflineError(Exception): - """An RFC 9457 problem. Inspect detail explicitly; repr contains only status.""" - - def __init__(self, status: int, type: str, detail: str) -> None: + """An RFC 9457 problem. Inspect detail explicitly; repr contains only status. + + title names the server's problem class. A refused review request also + carries the typed refusal, whose reason names the setting to change, and + the repository_name it refers to. + """ + + def __init__( + self, + status: int, + type: str, + detail: str, + *, + title: str | None = None, + refusal: RunNowRefusal | None = None, + repository_name: str | None = None, + ) -> None: self.status = status self.type = type self.detail = detail + self.title = title + self.refusal = refusal + self.repository_name = repository_name super().__init__(f"Proofline request failed (HTTP {status}).") def __repr__(self) -> str: @@ -98,6 +145,32 @@ def base_url(value: str) -> str: return value.rstrip("/") +def invalid_response() -> ProoflineError: + return ProoflineError( + 0, "urn:proofline:sdk:invalid-response", "Proofline returned an invalid API response." + ) + + +def network_error(error: httpx.HTTPError) -> ProoflineError: + if isinstance(error, httpx.TimeoutException): + return timeout_error() + return ProoflineError( + 0, "urn:proofline:sdk:transport-unavailable", "Could not reach the Proofline API." + ) + + +@contextmanager +def operation_errors() -> Iterator[None]: + try: + yield + except ProoflineError: + raise + except httpx.HTTPError as error: + raise network_error(error) from None + except Exception: + raise invalid_response() from None + + def timeout_error() -> ProoflineError: return ProoflineError(0, "urn:proofline:sdk:timeout", "The request deadline expired.") @@ -157,21 +230,101 @@ def retry_delay(value: str | None, attempt: int) -> float | None: return delay if math.isfinite(delay) and delay <= 60 else None +def redacted(value: object, raw: str) -> object: + if isinstance(value, str): + return value.replace(raw, "[redacted]") + if isinstance(value, list): + return [redacted(item, raw) for item in value] + if isinstance(value, dict): + return {key: redacted(item, raw) for key, item in value.items()} + return value + + +def environment(value: object) -> bool: + return isinstance(value, dict) and all( + isinstance(value.get(key), str) for key in ("id", "external_key", "display_name", "status") + ) + + +def optional(value: object, check: Callable[[object], bool]) -> bool: + return value is None or check(value) + + +def text(value: object) -> bool: + return isinstance(value, str) + + +# The generated parser copies reason fields without checking their types, so +# each documented reason's fields are checked here before a refusal is typed. +REFUSAL_SHAPES: dict[str, Callable[[dict[str, Any]], bool]] = { + "TRIGGER_DISABLED": lambda view: True, + "REPOSITORY_DISABLED": lambda view: True, + "NO_LINKED_ENVIRONMENT": lambda view: True, + "ENVIRONMENT_REVIEWS_OFF": lambda view: environment(view.get("environment")), + "ENVIRONMENT_NOT_READY": lambda view: ( + environment(view.get("environment")) and optional(view.get("status_detail"), text) + ), + "ENVIRONMENT_EVIDENCE_UNAVAILABLE": lambda view: environment(view.get("environment")), + "INVALID_DELIVERY_CONFIGURATION": lambda view: ( + text(view.get("detail")) and optional(view.get("environment"), environment) + ), + "PULL_REQUEST_UNKNOWN": lambda view: True, + "AUTHOR_HAS_NO_SEAT": lambda view: True, + "PULL_REQUEST_CLOSED": lambda view: True, +} + + def problem(response: httpx.Response, token: SecretStr) -> ProoflineError: - kind = "about:blank" - detail = "Proofline returned an HTTP error without a problem document." try: body = response.json() - if isinstance(body, dict): - if isinstance(body.get("type"), str): - kind = body["type"] - if isinstance(body.get("detail"), str): - detail = body["detail"] except (ValueError, UnicodeError): - pass - raw = token.get_secret_value() + body = None + if not isinstance(body, dict): + return ProoflineError( + response.status_code, + "about:blank", + "Proofline returned an HTTP error without a problem document.", + ) + body = cast(dict[str, Any], redacted(body, token.get_secret_value())) + kind = body["type"] if isinstance(body.get("type"), str) else "about:blank" + title = body["title"] if isinstance(body.get("title"), str) else None + if isinstance(body.get("detail"), str): + detail = body["detail"] + elif title is not None: + # Logged internal errors omit detail; the problem itself still arrived. + detail = f"Proofline returned the problem {title!r} without a detail." + else: + detail = "Proofline returned an HTTP error without a problem document." + # The contract types a refusal only as a review request's 400. The 402 a + # credit refusal answers is undocumented, so it stays a plain problem. + if response.status_code != 400 or "refusal" not in body: + return ProoflineError(response.status_code, kind, detail, title=title) + try: + view = body["refusal"] + shape = isinstance(view, dict) and REFUSAL_SHAPES.get(str(view.get("reason"))) + if not shape or not shape(view): + raise TypeError("refusal fields") + refused = RunNowRefused.from_dict(body) + if title is None or not isinstance(body.get("detail"), str): + raise TypeError("problem fields") + if not isinstance(refused.repository_name, str): + raise TypeError("repository_name") + # The generated optional parser keeps the raw value when a nested + # environment does not parse, for example an id that is not a UUID. + nested = getattr(refused.refusal, "environment", None) + if not isinstance(nested, RefusedEnvironment | Unset | None): + raise TypeError("environment") + except (KeyError, TypeError, ValueError, AttributeError): + return ProoflineError( + response.status_code, "urn:proofline:sdk:invalid-response", detail, title=title + ) return ProoflineError( - response.status_code, kind.replace(raw, "[redacted]"), detail.replace(raw, "[redacted]") + response.status_code, + kind, + detail, + title=title, + refusal=refused.refusal, + repository_name=refused.repository_name, ) diff --git a/proofline/client.py b/proofline/client.py index de6b5251..57114842 100644 --- a/proofline/client.py +++ b/proofline/client.py @@ -5,6 +5,7 @@ import math from asyncio import sleep as async_sleep from collections.abc import AsyncIterator, Awaitable, Callable, Iterator +from string import hexdigits from time import monotonic, sleep from types import TracebackType from typing import Any, Self, TypedDict, TypeVar, Unpack, cast @@ -38,6 +39,7 @@ stop_review, upload_coverage_reports, ) +from ._generated.api.operations import AsyncOperations, Operations from ._generated.client import AuthenticatedClient from ._generated.models.agent_session import AgentSession from ._generated.models.agent_session_prompt_type_0 import AgentSessionPromptType0 @@ -68,6 +70,7 @@ from ._generated.models.start_session import StartSession from ._generated.models.stop_response import StopResponse from ._generated.types import UNSET, Response, Unset +from ._mcp import AsyncMcpClient, McpClient from ._transport import ProoflineError from .exports import ExportDataset, ExportFormat, ExportPage, decode_export from .fixes import AsyncFixesClient, FixesClient @@ -108,6 +111,7 @@ class ReviewFilters(TypedDict, total=False): findings: str | None kind: str | None limit: int | None + query: str | None repository: UUID | None search: str | None status: str | None @@ -118,24 +122,10 @@ def _decoded( expected: type[T] | _ReviewRoutingModels | _FindingFixPromptModels | _AgentSessionPromptModels, ) -> T: if not isinstance(response.parsed, expected): - raise _malformed() + raise _transport.invalid_response() return cast(T, response.parsed) -def _malformed() -> ProoflineError: - return ProoflineError( - 0, "urn:proofline:sdk:invalid-response", "Proofline returned an invalid API response." - ) - - -def _network(error: httpx.HTTPError) -> ProoflineError: - if isinstance(error, httpx.TimeoutException): - return _transport.timeout_error() - return ProoflineError( - 0, "urn:proofline:sdk:transport-unavailable", "Could not reach the Proofline API." - ) - - def _configuration( token: str | SecretStr | None, base_url: str, timeout: float ) -> AuthenticatedClient: @@ -162,12 +152,22 @@ def _page_limits(page_size: int, max_pages: int, max_items: int) -> None: ) +def _head_commit(value: str | None) -> None: + # Only a full SHA names one exact commit; a branch or an abbreviation does not. + if value is not None and ( + not isinstance(value, str) + or len(value) not in (40, 64) + or any(character not in hexdigits for character in value) + ): + raise ValueError("The head commit must be a full 40 or 64 character hexadecimal SHA.") + + def _next_cursor(page: ReviewPage, seen: set[str]) -> str | None: if not isinstance(page.truncated, bool): - raise _malformed() + raise _transport.invalid_response() if not page.truncated: if isinstance(page.next_cursor, str) and page.next_cursor: - raise _malformed() + raise _transport.invalid_response() return None cursor = page.next_cursor if not isinstance(cursor, str) or not cursor or cursor in seen: @@ -186,7 +186,7 @@ def _pagination_limit() -> ProoflineError: ) -class ProoflineClient: +class ProoflineClient(Operations): """Synchronous typed HTTP operations. Name resolution, connection, TLS and socket operations stop at the configured @@ -215,6 +215,7 @@ def __init__( transport=_transport.RetryTransport(self._api.token, timeout), ) self._api.set_httpx_client(self._http) + self.mcp = McpClient(self._http) self.knowledge = KnowledgeClient(self._http) self.fixes = FixesClient(self._http) @@ -242,14 +243,8 @@ def _call( *args: object, **kwargs: object, ) -> T: - try: + with _transport.operation_errors(): return _decoded(operation(*args, client=self._api, **kwargs), expected) - except ProoflineError: - raise - except httpx.HTTPError as error: - raise _network(error) from None - except Exception: - raise _malformed() from None def export_reviews( self, @@ -286,7 +281,7 @@ def export_reviews( ) return decode_export(response, format) except httpx.HTTPError as error: - raise _network(error) from None + raise _transport.network_error(error) from None def list_reviews(self, organization_id: UUID, **filters: Unpack[ReviewFilters]) -> ReviewPage: return self._call(list_reviews.sync_detailed, ReviewPage, organization_id, **filters) @@ -492,16 +487,25 @@ def iter_reviews( raise _pagination_limit() def wait_for_review( - self, organization_id: UUID, review_id: UUID, *, timeout: float = 300 + self, + organization_id: UUID, + review_id: UUID, + *, + timeout: float = 300, + head_commit_sha: str | None = None, ) -> ReviewOutcome: """Wait for recorded review completion or return TIMED_OUT. A name lookup still running at the deadline returns TIMED_OUT; it never reports completion. + + head_commit_sha holds the outcome to that commit. A review pinned to + another head ends the wait on that read and is never COMPLETED. """ if not math.isfinite(timeout) or timeout < 0: raise ValueError("The review timeout must be a finite nonnegative number of seconds.") + _head_commit(head_commit_sha) url = _review_url(self._base_url, organization_id, review_id) last: CustomerReviewDetail | None = None deadline = _transport.DEADLINE.set(monotonic() + timeout) @@ -516,17 +520,18 @@ def wait_for_review( raise if (_transport.remaining() or 0) <= 0: break - result = outcome(last, url, review_id=review_id) + result = outcome(last, url, review_id=review_id, head_commit_sha=head_commit_sha) if result is not None: return result sleep(min(interval, _transport.remaining() or 0)) interval = min(60, interval * 2) - return outcome(last, url, "TIMED_OUT") or ReviewOutcome("TIMED_OUT", url) + timed_out = outcome(last, url, "TIMED_OUT", head_commit_sha=head_commit_sha) + return timed_out or ReviewOutcome("TIMED_OUT", url) finally: _transport.DEADLINE.reset(deadline) -class AsyncProoflineClient: +class AsyncProoflineClient(AsyncOperations): def __init__( self, token: str | SecretStr | None = None, @@ -549,6 +554,7 @@ def __init__( transport=_transport.AsyncRetryTransport(self._api.token, timeout), ) self._api.set_async_httpx_client(self._http) + self.mcp = AsyncMcpClient(self._http) self.knowledge = AsyncKnowledgeClient(self._http) self.fixes = AsyncFixesClient(self._http) @@ -576,14 +582,8 @@ async def _call( *args: object, **kwargs: object, ) -> T: - try: + with _transport.operation_errors(): return _decoded(await operation(*args, client=self._api, **kwargs), expected) - except ProoflineError: - raise - except httpx.HTTPError as error: - raise _network(error) from None - except Exception: - raise _malformed() from None async def export_reviews( self, @@ -620,7 +620,7 @@ async def export_reviews( ) return decode_export(response, format) except httpx.HTTPError as error: - raise _network(error) from None + raise _transport.network_error(error) from None async def list_reviews( self, organization_id: UUID, **filters: Unpack[ReviewFilters] @@ -851,10 +851,16 @@ async def iter_reviews( raise _pagination_limit() async def wait_for_review( - self, organization_id: UUID, review_id: UUID, *, timeout: float = 300 + self, + organization_id: UUID, + review_id: UUID, + *, + timeout: float = 300, + head_commit_sha: str | None = None, ) -> ReviewOutcome: if not math.isfinite(timeout) or timeout < 0: raise ValueError("The review timeout must be a finite nonnegative number of seconds.") + _head_commit(head_commit_sha) url = _review_url(self._base_url, organization_id, review_id) last: CustomerReviewDetail | None = None deadline = _transport.DEADLINE.set(monotonic() + timeout) @@ -869,11 +875,12 @@ async def wait_for_review( raise if (_transport.remaining() or 0) <= 0: break - result = outcome(last, url, review_id=review_id) + result = outcome(last, url, review_id=review_id, head_commit_sha=head_commit_sha) if result is not None: return result await async_sleep(min(interval, _transport.remaining() or 0)) interval = min(60, interval * 2) - return outcome(last, url, "TIMED_OUT") or ReviewOutcome("TIMED_OUT", url) + timed_out = outcome(last, url, "TIMED_OUT", head_commit_sha=head_commit_sha) + return timed_out or ReviewOutcome("TIMED_OUT", url) finally: _transport.DEADLINE.reset(deadline) diff --git a/proofline/exports.py b/proofline/exports.py index a274dd23..7bae7862 100644 --- a/proofline/exports.py +++ b/proofline/exports.py @@ -2,8 +2,6 @@ from __future__ import annotations -import csv -import io import json from dataclasses import dataclass from datetime import datetime @@ -11,7 +9,8 @@ import httpx -from ._transport import ProoflineError +from ._csv import parse_csv +from ._transport import MAX_RESPONSE_BYTES, ProoflineError ExportDataset = Literal["reviews", "finding_outcomes", "finding_validations", "spend", "findings"] ExportFormat = Literal["csv", "ndjson"] @@ -29,9 +28,11 @@ class ExportPage: def decode_export(response: httpx.Response, format: ExportFormat) -> ExportPage: try: + if len(response.content) > MAX_RESPONSE_BYTES: + raise ValueError media = "text/csv" if format == "csv" else "application/x-ndjson" if ( - response.headers.get("content-type", "").split(";")[0].strip() != media + response.headers.get("content-type", "").split(";")[0].strip().lower() != media or response.headers.get("x-proofline-export-version") != "1" ): raise ValueError @@ -40,7 +41,7 @@ def decode_export(response: httpx.Response, format: ExportFormat) -> ExportPage: raise ValueError text = response.content.decode("utf-8") if format == "csv": - records = list(csv.reader(io.StringIO(text, newline=""), strict=True)) + records = parse_csv(text) columns = records.pop(0) if len(set(columns)) != len(columns) or any( len(row) != len(columns) for row in records @@ -48,13 +49,13 @@ def decode_export(response: httpx.Response, format: ExportFormat) -> ExportPage: raise ValueError rows = [dict(zip(columns, row, strict=True)) for row in records] else: - rows = [json.loads(line) for line in text.splitlines() if line.strip()] + rows = [json.loads(line) for line in text.split("\n") if line.strip()] if any(not isinstance(row, dict) or str(row.get("dataset_version")) != "1" for row in rows): raise ValueError return ExportPage( format, text, rows, 1, horizon, response.headers.get("x-proofline-export-next-cursor") ) - except (ValueError, KeyError, IndexError, UnicodeError, csv.Error): + except (ValueError, KeyError, IndexError, UnicodeError): raise ProoflineError( response.status_code, "urn:proofline:sdk:invalid-response", diff --git a/proofline/fixes.py b/proofline/fixes.py index e9541041..85e437b5 100644 --- a/proofline/fixes.py +++ b/proofline/fixes.py @@ -8,17 +8,30 @@ class FixesClient(McpTools): - def list_open_findings(self, repository: str, pull_request_number: int) -> KnowledgeResult: + def list_open_findings( + self, repository: str, pull_request_number: int, *, organization_id: str | None = None + ) -> KnowledgeResult: return self._call( "list_open_findings", {"repository": repository, "pull_request_number": pull_request_number}, + organization_id=organization_id, ) - def get_fix_context(self, finding_id: str) -> KnowledgeResult: - return self._call("get_fix_context", {"finding_id": finding_id}) + def get_fix_context( + self, finding_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "get_fix_context", {"finding_id": finding_id}, organization_id=organization_id + ) def request_reverification( - self, review_id: str, finding_ids: list[str], commit_sha: str, *, note: str | None = None + self, + review_id: str, + finding_ids: list[str], + commit_sha: str, + *, + note: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: args: dict[str, Any] = { "review_id": review_id, @@ -27,26 +40,41 @@ def request_reverification( } if note is not None: args["note"] = note - return self._call("request_reverification", args) + return self._call("request_reverification", args, organization_id=organization_id) - def get_reverification(self, request_id: str) -> KnowledgeResult: - return self._call("get_reverification", {"request_id": request_id}) + def get_reverification( + self, request_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "get_reverification", {"request_id": request_id}, organization_id=organization_id + ) class AsyncFixesClient(AsyncMcpTools): async def list_open_findings( - self, repository: str, pull_request_number: int + self, repository: str, pull_request_number: int, *, organization_id: str | None = None ) -> KnowledgeResult: return await self._call( "list_open_findings", {"repository": repository, "pull_request_number": pull_request_number}, + organization_id=organization_id, ) - async def get_fix_context(self, finding_id: str) -> KnowledgeResult: - return await self._call("get_fix_context", {"finding_id": finding_id}) + async def get_fix_context( + self, finding_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call( + "get_fix_context", {"finding_id": finding_id}, organization_id=organization_id + ) async def request_reverification( - self, review_id: str, finding_ids: list[str], commit_sha: str, *, note: str | None = None + self, + review_id: str, + finding_ids: list[str], + commit_sha: str, + *, + note: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: args: dict[str, Any] = { "review_id": review_id, @@ -55,7 +83,11 @@ async def request_reverification( } if note is not None: args["note"] = note - return await self._call("request_reverification", args) + return await self._call("request_reverification", args, organization_id=organization_id) - async def get_reverification(self, request_id: str) -> KnowledgeResult: - return await self._call("get_reverification", {"request_id": request_id}) + async def get_reverification( + self, request_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call( + "get_reverification", {"request_id": request_id}, organization_id=organization_id + ) diff --git a/proofline/knowledge.py b/proofline/knowledge.py index efa7a15d..2a301cf5 100644 --- a/proofline/knowledge.py +++ b/proofline/knowledge.py @@ -4,62 +4,132 @@ class KnowledgeClient(McpTools): - def list_wiki_pages(self, repository: str, *, commit: str | None = None) -> KnowledgeResult: - return self._call("list_wiki_pages", _repository(repository, commit)) + def list_wiki_pages( + self, repository: str, *, commit: str | None = None, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "list_wiki_pages", _repository(repository, commit), organization_id=organization_id + ) def get_wiki_page( - self, repository: str, page_key: str, *, commit: str | None = None + self, + repository: str, + page_key: str, + *, + commit: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: return self._call( - "get_wiki_page", {**_repository(repository, commit), "page_key": page_key} + "get_wiki_page", + {**_repository(repository, commit), "page_key": page_key}, + organization_id=organization_id, ) def ask_codebase( - self, repository: str, question: str, *, commit: str | None = None + self, + repository: str, + question: str, + *, + commit: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: - return self._call("ask_codebase", {**_repository(repository, commit), "question": question}) + return self._call( + "ask_codebase", + {**_repository(repository, commit), "question": question}, + organization_id=organization_id, + ) - def get_architecture_document(self, environment_id: str) -> KnowledgeResult: - return self._call("get_architecture_document", {"environment_id": environment_id}) + def get_architecture_document( + self, environment_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "get_architecture_document", + {"environment_id": environment_id}, + organization_id=organization_id, + ) - def get_plan(self, plan_id: str) -> KnowledgeResult: - return self._call("get_plan", {"plan_id": plan_id}) + def get_plan(self, plan_id: str, *, organization_id: str | None = None) -> KnowledgeResult: + return self._call("get_plan", {"plan_id": plan_id}, organization_id=organization_id) - def start_plan_implementation(self, plan_id: str) -> KnowledgeResult: - return self._call("start_plan_implementation", {"plan_id": plan_id}) + def start_plan_implementation( + self, plan_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "start_plan_implementation", {"plan_id": plan_id}, organization_id=organization_id + ) - def get_plan_implementation(self, implementation_id: str) -> KnowledgeResult: - return self._call("get_plan_implementation", {"implementation_id": implementation_id}) + def get_plan_implementation( + self, implementation_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return self._call( + "get_plan_implementation", + {"implementation_id": implementation_id}, + organization_id=organization_id, + ) class AsyncKnowledgeClient(AsyncMcpTools): async def list_wiki_pages( - self, repository: str, *, commit: str | None = None + self, repository: str, *, commit: str | None = None, organization_id: str | None = None ) -> KnowledgeResult: - return await self._call("list_wiki_pages", _repository(repository, commit)) + return await self._call( + "list_wiki_pages", _repository(repository, commit), organization_id=organization_id + ) async def get_wiki_page( - self, repository: str, page_key: str, *, commit: str | None = None + self, + repository: str, + page_key: str, + *, + commit: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: return await self._call( - "get_wiki_page", {**_repository(repository, commit), "page_key": page_key} + "get_wiki_page", + {**_repository(repository, commit), "page_key": page_key}, + organization_id=organization_id, ) async def ask_codebase( - self, repository: str, question: str, *, commit: str | None = None + self, + repository: str, + question: str, + *, + commit: str | None = None, + organization_id: str | None = None, ) -> KnowledgeResult: return await self._call( - "ask_codebase", {**_repository(repository, commit), "question": question} + "ask_codebase", + {**_repository(repository, commit), "question": question}, + organization_id=organization_id, ) - async def get_architecture_document(self, environment_id: str) -> KnowledgeResult: - return await self._call("get_architecture_document", {"environment_id": environment_id}) + async def get_architecture_document( + self, environment_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call( + "get_architecture_document", + {"environment_id": environment_id}, + organization_id=organization_id, + ) - async def get_plan(self, plan_id: str) -> KnowledgeResult: - return await self._call("get_plan", {"plan_id": plan_id}) + async def get_plan( + self, plan_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call("get_plan", {"plan_id": plan_id}, organization_id=organization_id) - async def start_plan_implementation(self, plan_id: str) -> KnowledgeResult: - return await self._call("start_plan_implementation", {"plan_id": plan_id}) + async def start_plan_implementation( + self, plan_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call( + "start_plan_implementation", {"plan_id": plan_id}, organization_id=organization_id + ) - async def get_plan_implementation(self, implementation_id: str) -> KnowledgeResult: - return await self._call("get_plan_implementation", {"implementation_id": implementation_id}) + async def get_plan_implementation( + self, implementation_id: str, *, organization_id: str | None = None + ) -> KnowledgeResult: + return await self._call( + "get_plan_implementation", + {"implementation_id": implementation_id}, + organization_id=organization_id, + ) diff --git a/proofline/outcomes.py b/proofline/outcomes.py index 68a4d8aa..fa363b32 100644 --- a/proofline/outcomes.py +++ b/proofline/outcomes.py @@ -14,6 +14,14 @@ OutcomeStatus = Literal["COMPLETED", "INCOMPLETE", "FAILED", "STOPPED", "TIMED_OUT"] COMPLETE_CHECKS = frozenset(("READY", "BLOCKED", "NOT_APPLICABLE")) COMPLETE_LIFECYCLES = frozenset(("GATING", "SHADOW", "QUARANTINED", "RETIRED")) +_KNOWN_ASSESSMENTS = frozenset( + ("PENDING", "RUNNING", "COMPLETED", "INCOMPLETE", "FAILED", "STOPPED", "SUPERSEDED", "EXCLUDED") +) +_WITHHELD_MARKER = "[withheld: environment value]" +_HEAD_REASONS = { + "HEAD_COMMIT_MISMATCH": "The review is pinned to another head commit.", + "HEAD_COMMIT_UNAVAILABLE": "The review names no head commit.", +} @dataclass(frozen=True) @@ -29,7 +37,7 @@ class CheckGap: class AssessmentGap: assessment_id: UUID | None status: str - reason_codes: tuple[str, ...] = () + reason_codes: tuple[str, ...] = field(default=(), repr=False) incompleteness_kind: str | None = None release_evidence_gap: str | None = field(default=None, repr=False) checks: tuple[CheckGap, ...] = field(default=(), repr=False) @@ -60,6 +68,14 @@ def _optional_text(value: object) -> bool: return value is None or isinstance(value, (str, Unset)) +def _optional_texts(value: object) -> bool: + return ( + value is None + or isinstance(value, Unset) + or (isinstance(value, list) and all(isinstance(item, str) for item in value)) + ) + + def _code_assessment(review: CustomerReviewDetail) -> CustomerCodeAssessment | None: # A CODE result cannot replace a missing ENV result or its check receipts. if review.assessment_count != 0 or review.assessments: @@ -73,7 +89,16 @@ def _code_assessment(review: CustomerReviewDetail) -> CustomerCodeAssessment | N or not isinstance(code.findings, list) or code.status not in ("PENDING", "RUNNING", "COMPLETED", "INCOMPLETE", "EXCLUDED") or not _optional_text(code.incompleteness_kind) + or not _optional_texts(code.reason_codes) + ): + return None + for recorded, actual in ( + (review.head_commit_sha, code.head_commit_sha), + (review.base_commit_sha, code.base_commit_sha), ): + if isinstance(recorded, str) and recorded.lower() != actual.lower(): + return None + if any(finding.risk_domain == _WITHHELD_MARKER for finding in code.findings): return None return code @@ -103,10 +128,7 @@ def _validate(review: CustomerReviewDetail, review_id: UUID | None) -> None: if assessment.id in seen: raise _invalid() seen.add(assessment.id) - reasons = assessment.reason_codes - if not (reasons is None or isinstance(reasons, Unset)) and ( - not isinstance(reasons, list) or any(not isinstance(reason, str) for reason in reasons) - ): + if not _optional_texts(assessment.reason_codes): raise _invalid() for check in assessment.checks.families: if ( @@ -119,12 +141,23 @@ def _validate(review: CustomerReviewDetail, review_id: UUID | None) -> None: raise _invalid() +def _head_gap(review: CustomerReviewDetail, head_commit_sha: str | None) -> str | None: + # A result is evidence only for the head the review is pinned to. + if head_commit_sha is None: + return None + head = text(review.head_commit_sha) + if head is None: + return "HEAD_COMMIT_UNAVAILABLE" + return None if head.lower() == head_commit_sha.lower() else "HEAD_COMMIT_MISMATCH" + + def outcome( review: CustomerReviewDetail | None, review_url: str, forced: OutcomeStatus | None = None, *, review_id: UUID | None = None, + head_commit_sha: str | None = None, ) -> ReviewOutcome | None: gaps: list[AssessmentGap] = [] if review is None: @@ -137,24 +170,29 @@ def outcome( if code_only: if code is None: gaps.append(AssessmentGap(None, "UNKNOWN", ("CODE_ASSESSMENT_UNAVAILABLE",))) - elif code.status != "COMPLETED" or text(code.incompleteness_kind): + elif code.status != "COMPLETED" or text(code.incompleteness_kind) or code.reason_codes: kind = text(code.incompleteness_kind) + reasons = tuple(code.reason_codes) if isinstance(code.reason_codes, list) else () + if kind: + reasons = (*reasons, kind) gaps.append( AssessmentGap( code.id, code.status, - () if kind else ("CODE_ASSESSMENT_STATE_UNAVAILABLE",), + reasons or ("CODE_ASSESSMENT_STATE_UNAVAILABLE",), kind, ) ) - elif review.assessment_count != len(review.assessments): - gaps.append(AssessmentGap(None, "UNKNOWN", ("ASSESSMENT_HISTORY_UNAVAILABLE",))) for assessment in review.assessments: reasons = ( tuple(assessment.reason_codes) if isinstance(assessment.reason_codes, list) else () ) kind = text(assessment.incompleteness_kind) evidence = text(assessment.release_evidence_gap) + if kind: + reasons = (*reasons, kind) + if evidence: + reasons = (*reasons, evidence) checks = tuple( CheckGap( check.name, @@ -166,19 +204,29 @@ def outcome( for check in assessment.checks.families if check.outcome not in COMPLETE_CHECKS or check.lifecycle not in COMPLETE_LIFECYCLES ) - if ( - not assessment.checks.receipt_recorded - or assessment.checks.status not in COMPLETE_CHECKS - ): - reasons = (*reasons, "CHECK_RECEIPT_UNAVAILABLE") + if not assessment.checks.receipt_recorded: + reasons = (*reasons, "CHECK_RECEIPT_ABSENT") + elif assessment.checks.status not in COMPLETE_CHECKS or checks: + reasons = (*reasons, "CHECKS_UNRESOLVED") if assessment.status != "COMPLETED" or reasons or kind or evidence or checks: if not reasons and not kind and not evidence and not checks: - reasons = ("ASSESSMENT_STATE_UNAVAILABLE",) + reasons = ( + "ASSESSMENT_RESULT_UNAVAILABLE" + if assessment.status in _KNOWN_ASSESSMENTS + else "UNKNOWN_ASSESSMENT_STATUS", + ) gaps.append( AssessmentGap(assessment.id, assessment.status, reasons, kind, evidence, checks) ) + if review.assessment_count != len(review.assessments): + gaps.append(AssessmentGap(None, "UNKNOWN", ("ASSESSMENT_HISTORY_UNAVAILABLE",))) + head_gap = _head_gap(review, head_commit_sha) if forced is not None: status = forced + elif head_gap == "HEAD_COMMIT_MISMATCH": + # A pinned head does not change, so nothing this review records later + # can speak for the commit the caller named. + status = "INCOMPLETE" elif review.status in ("PENDING", "RUNNING"): return None elif review.status == "FAILED": @@ -186,9 +234,12 @@ def outcome( elif review.status in ("STOPPED", "SUPERSEDED"): status = "STOPPED" elif review.status == "COMPLETED": - status = "INCOMPLETE" if gaps else "COMPLETED" + status = "INCOMPLETE" if gaps or head_gap else "COMPLETED" else: status = "INCOMPLETE" if not gaps: gaps.append(AssessmentGap(None, review.status, ("REVIEW_STATE_UNAVAILABLE",))) - return ReviewOutcome(status, review_url, review, tuple(gaps)) + if head_gap is None: + return ReviewOutcome(status, review_url, review, tuple(gaps)) + gaps.append(AssessmentGap(None, "UNKNOWN", (head_gap,))) + return ReviewOutcome(status, review_url, review, tuple(gaps), _HEAD_REASONS[head_gap]) diff --git a/pyproject.toml b/pyproject.toml index 144a8386..af00d221 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["hatchling==1.27.0"] +requires = ["hatchling==1.33.0"] build-backend = "hatchling.build" [project] name = "proofline-sdk" -version = "1.0.3" +version = "5.11.4" description = "Typed synchronous and asynchronous clients for the Proofline review API" readme = "README.md" license = "Apache-2.0 AND MIT" @@ -35,18 +35,20 @@ Repository = "https://github.com/prooflinedev/sdk-python" [project.optional-dependencies] dev = [ "openapi-python-client==0.29.1", - "ruff==0.14.3", - "mypy==1.18.2", - "pytest==8.4.2", - "pytest-asyncio==1.2.0", - "build==1.3.0", - "hatchling==1.27.0", + "ruff==0.17.5", + "mypy==2.4.1", + "pytest==9.2.0", + "pytest-asyncio==1.5.0", + "build==1.6.1", + "hatchling==1.33.0", ] [tool.hatch.build.targets.wheel] packages = ["proofline"] +core-metadata-version = "2.4" [tool.hatch.build.targets.sdist] +core-metadata-version = "2.4" include = ["/openapi.public.json", "/LICENSE", "/README.md", "/proofline", "/scripts", "/templates", "/tests", "/generator.json", "/pyproject.toml", "/requirements-dev.txt"] [tool.pytest.ini_options] diff --git a/requirements-dev.txt b/requirements-dev.txt index ab3aafff..c28cb443 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,30 +1,88 @@ -annotated-doc==0.0.5 \ - --hash=sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101 \ - --hash=sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb +annotated-doc==0.0.6 \ + --hash=sha256:361ca0950cc7082f53fa69e9328409f40a62c61e57e0a47e1825a08078a58a53 \ + --hash=sha256:7969bb69912085b2285849c0dcac0b4b374fd180c13cf10a87f284ffcf347bbf annotated-types==0.8.0 \ --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 -anyio==4.15.1 \ - --hash=sha256:6152fdbbf9a77fdec97731721bebf7c4c44f7c29b424b0065826173efc7ed101 \ - --hash=sha256:9f28306018cbd6d329e64a36d58256edff76dd996fe423bc957326e578b82a94 +anyio==4.16.0 \ + --hash=sha256:59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb \ + --hash=sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026 +ast-serialize==0.13.1 \ + --hash=sha256:02686b281ec9b8e9614f6f0db27e12e4cac515f336c5d05b678bc9eb73ff2af5 \ + --hash=sha256:032b09d86c785c3984e975378b7861f2a68ac44e22ba7b07b93a536b2524eeb8 \ + --hash=sha256:0d764913374ba21df8cd618045b371ed104ce55c6276de7c59e554a4f5ba26fd \ + --hash=sha256:121e1d08d58b75c15491cc3003609cbad71ac2b0016043c36d30a6b2032b6605 \ + --hash=sha256:1b158f1c9e3a0d386913924c57995d6df78224868a4d0f215bdd41587c97b34a \ + --hash=sha256:2015fd0165e463aac3b1aadc6a1fa1e5820c14ca950821f4fe02f8a3f6a388d6 \ + --hash=sha256:23d768369b89d551077dc173da6892fad00443338417523b6732f4e8ba4a7ed5 \ + --hash=sha256:2876444a5f87a7c76f371af3c07c2fda563a08bc8af52568df812e8aba4bf568 \ + --hash=sha256:29422d7bcd9e7f39411571c36cec45ce8a7a9b3ad4b2e7aa64497c15a9e397f6 \ + --hash=sha256:2bad302ae2427454ef9dab71bd5c3ad67188860c39d36daee38f72031edb39c4 \ + --hash=sha256:2f9a9ce8b0994f757b941f7f7fe384a6666b4162b941ebc5c248081baea18e47 \ + --hash=sha256:30cf89b6a6844542d116c758725d13de5b97b9410a51ee577715f761270d0c1c \ + --hash=sha256:3e129d44b0cffbea24a7f40117ce49e30993c3d119e584d4817ebd6f87246456 \ + --hash=sha256:401cc84e8888d4d76f2c8d296fa006ed1a5ff993b6aff90dd777c03973efd025 \ + --hash=sha256:43e8ddd63e80fc280c2f790157386f27f9b9f6ccb9c4f8e803b863cbfb085769 \ + --hash=sha256:48f11d96c9ec71119612f8e79a8c55c12f2b136716d68347433c561d27a25f43 \ + --hash=sha256:4bcf1d5f4eefecaa325a34ecf079b2741189e7d0821523f92cb343a389a67489 \ + --hash=sha256:4e385b17d5bde892a6184003a9aff3518387908b73f8f5ea539313c07c8c0ede \ + --hash=sha256:4f98da562e5901d69c7dd30885594c5438f859edf354e9ac7517d188fb026c3a \ + --hash=sha256:523d45bab16ddaf1399c04c4fe81bbf180f81e33c2f7bcbe76be56b0f7311ab4 \ + --hash=sha256:5d99910e6b9a9b9360bcca2ae99aee36cc912ce058df2a57d1c33099b6cb2593 \ + --hash=sha256:5db12d843d931b9d1f1519ce66b9cbfe72d8563b75c1204d255322254d1964dd \ + --hash=sha256:638333fb8ae72c62753f9e794fda20290883ddc65b0d85e26e08f8bb227567ad \ + --hash=sha256:68f8829d114dab6c9db4a8bbb8d0e342958faee1b5e15a29022678df639960f8 \ + --hash=sha256:6eb0be64c9b8f1ed26637eef345abe75ea90351c92c85a8aec7838b3af971011 \ + --hash=sha256:6ffb0f548a7dc126067fdfb7b2325ab5dfcdeecc29faf5e0f0461c96d6ebfa3d \ + --hash=sha256:732aaae9e498c973fc63fd7f308009b57c4afa6ff59d0b674d894e57d0bca01a \ + --hash=sha256:75d7750fe98f6f35a96c43aba8d98a2e623e22c778a0c17ab9ede92eb10f5d82 \ + --hash=sha256:77a6201b69ce42e919f2fd9a559138d5410b5d8afff7c3a6b1f500b0481ff7d8 \ + --hash=sha256:7a5c38bdb93669c596f94fb7204dd6ebe4fadb19058ac9a2faf2948c2a175f96 \ + --hash=sha256:7f2427bddfca208e84de700044fadf9aef2769a70bae740a1bdabb89ee9e1117 \ + --hash=sha256:7f3e8a3eff69af640db985360fef35073fb46956dfc3e5c614cf00920d2746dd \ + --hash=sha256:847cad4c22953823f5e76d0b126c6f9da670cfa45b1df41b9324e22189d77611 \ + --hash=sha256:87427913c325adc811e81e7c9a757b061f47ef1e29114ac479aa0953a2687a98 \ + --hash=sha256:885a62ec6481ce58ab24c6357360d7a82023b62dd7e5e7ceccf59e9662a3272b \ + --hash=sha256:8899c038b1c15ae8b98e379057fb3ef398ceb0b21d1737a8156dd5a0923b7e51 \ + --hash=sha256:88df960e67184a71874e5b2ee014f87d1254a0dbc1f903c7bd7b1ab7733ecaef \ + --hash=sha256:8c8ebd419811c435812d242fb2a173e57dfede198c9ac9a0a584666ebc9b9331 \ + --hash=sha256:9221e09496fb942901993c1812ee87950cc0ecbb514c7c0f1f5fa6d78f701ed8 \ + --hash=sha256:929eda0c419e622ab49df3a4c45f81c57dcc10874bbad55d0470a4a03324dac3 \ + --hash=sha256:9f99786e0d62082a5b121b3437f3167562133711df22128de1e9886f57f0b226 \ + --hash=sha256:a01b515b25a03184eff4acef25b981ae007916379682e908fc8785b342a0bf3e \ + --hash=sha256:a789cbe14d0a0e9ec9b32a456e5abc81ad8799479c3cfd88a29e3442262aebe6 \ + --hash=sha256:a8ab2c2585b2e22e48cd4aff2136fce4eab4ced569b85f150ef9a5a5d6f34d49 \ + --hash=sha256:aca07de3ca8e3d9f2b716c3c31f4f384fe4bd2d03e09912417cff7a3e08036f7 \ + --hash=sha256:acf4e9f055d75058ab01536da330648746f2f82b7697a85230547f2d5ebe895c \ + --hash=sha256:ad88921f95b92bc144d9ad059a0e16f8c1ae69f5239f2d3c6536fd2774f73dfe \ + --hash=sha256:bf53a3ba1cbe45399fc1e4ccd684b8f2a11cca450f89706b79122f478534c6f5 \ + --hash=sha256:c652d9f5d52d8b81eff3ff2c95c9dd0f281de45f6ad5d3fa95527550c396454a \ + --hash=sha256:ca9acc67f796aa2554fa3037dccc022a4b08b38b2ad153edfac9c9bb7cb1f3c6 \ + --hash=sha256:cc34c670747d85d4232834665e247009413eaebe47c69eaf60a5c439aaecaed9 \ + --hash=sha256:d9c1a920b2aa0c1e016bed7721689717034ca0dba64ac3a3ff243b003d4e8dd8 \ + --hash=sha256:ddf7cbc9c8abf70102c4a088efe154bb86bfb825b0a10e556d2b15972cf99bd7 \ + --hash=sha256:e14c4de98f965647a74e6eaf37e20207124e45451ccd36e84a6f6ebab45e0372 \ + --hash=sha256:eb41e1906502ac80d24ff343f45008552a3f5b5158607959fe6a07dbfc6eb037 \ + --hash=sha256:f8b17e2921e56621bcb46792bd3e0b82ca3b85de78d5936e7b8174ba1758b0aa \ + --hash=sha256:fb8021f4dc3296de18737e3b8b34994411da725374d74a0b9eb32a738f2a23d0 attrs==26.1.0 \ --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 -build==1.3.0 \ - --hash=sha256:698edd0ea270bde950f53aed21f3a0135672206f3911e0176261a31e0e07b397 \ - --hash=sha256:7145f0b5061ba90a1500d60bd1b13ca0a8a4cebdd0cc16ed8adf1c0e739f43b4 -certifi==2026.7.22 \ - --hash=sha256:62f22742b58a1a33014a2b6b706588a8d7e2a88ae7bd1a6ebe8c992928483775 \ - --hash=sha256:741e2c3b351ddf169a738da9f2c048608ff7f2c5cc02f1ebc6b118bb090d5d55 +build==1.6.1 \ + --hash=sha256:51cc11666391ab6f092070437ac747002ff46f3e4113a3622177ee6b488bfc53 \ + --hash=sha256:ecd351a4be9d35a9eaaba244a7687143c9c7d4aea6ac964e7e7ddab20cbcf4e7 +certifi==2026.10.23 \ + --hash=sha256:a9895e6e2758b371e0545e321a3a8fd1fcfd9829ada8824a936dfb16aaaf36cd \ + --hash=sha256:e9b54de76e530bb6cf0ccd036787103acb58fd42ba930ea8bf948ddbaa2f61d1 colorama==0.4.6 ; os_name == 'nt' or sys_platform == 'win32' \ --hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \ --hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6 h11==0.16.0 \ --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 -hatchling==1.27.0 \ - --hash=sha256:971c296d9819abb3811112fc52c7a9751c8d381898f36533bb16f9791e941fd6 \ - --hash=sha256:d3a2f3567c4f926ea39849cdf924c7e99e6686c9c8e288ae1037c8fa2a5d937b +hatchling==1.33.0 \ + --hash=sha256:415290b84f464d2884303fca8974d38e7b85579069fab02a15db0828fbb1446d \ + --hash=sha256:4c422bd4d554fcff5de5b73e9596f85e41e9f97f7e553d8f7595ecb31a627bef httpcore==1.0.9 \ --hash=sha256:2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55 \ --hash=sha256:6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8 @@ -34,150 +92,364 @@ httpx==0.28.1 \ idna==3.20 \ --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c -iniconfig==2.3.0 \ - --hash=sha256:c76315c77db068650d49c5b56314774a7804df16fee4402c1f19d6d15d8c4730 \ - --hash=sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12 +iniconfig==2.3.1 \ + --hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \ + --hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7 jinja2==3.1.6 \ --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 -markdown-it-py==4.2.0 \ - --hash=sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49 \ - --hash=sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a -markupsafe==3.0.3 \ - --hash=sha256:0303439a41979d9e74d18ff5e2dd8c43ed6c6001fd40e5bf2e43f7bd9bbc523f \ - --hash=sha256:068f375c472b3e7acbe2d5318dea141359e6900156b5b2ba06a30b169086b91a \ - --hash=sha256:0bf2a864d67e76e5c9a34dc26ec616a66b9888e25e7b9460e1c76d3293bd9dbf \ - --hash=sha256:0db14f5dafddbb6d9208827849fad01f1a2609380add406671a26386cdf15a19 \ - --hash=sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf \ - --hash=sha256:0f4b68347f8c5eab4a13419215bdfd7f8c9b19f2b25520968adfad23eb0ce60c \ - --hash=sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175 \ - --hash=sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219 \ - --hash=sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb \ - --hash=sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6 \ - --hash=sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab \ - --hash=sha256:15d939a21d546304880945ca1ecb8a039db6b4dc49b2c5a400387cdae6a62e26 \ - --hash=sha256:177b5253b2834fe3678cb4a5f0059808258584c559193998be2601324fdeafb1 \ - --hash=sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce \ - --hash=sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218 \ - --hash=sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634 \ - --hash=sha256:1ba88449deb3de88bd40044603fafffb7bc2b055d626a330323a9ed736661695 \ - --hash=sha256:1cc7ea17a6824959616c525620e387f6dd30fec8cb44f649e31712db02123dad \ - --hash=sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73 \ - --hash=sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c \ - --hash=sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe \ - --hash=sha256:2a15a08b17dd94c53a1da0438822d70ebcd13f8c3a95abe3a9ef9f11a94830aa \ - --hash=sha256:2f981d352f04553a7171b8e44369f2af4055f888dfb147d55e42d29e29e74559 \ - --hash=sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa \ - --hash=sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37 \ - --hash=sha256:3537e01efc9d4dccdf77221fb1cb3b8e1a38d5428920e0657ce299b20324d758 \ - --hash=sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f \ - --hash=sha256:38664109c14ffc9e7437e86b4dceb442b0096dfe3541d7864d9cbe1da4cf36c8 \ - --hash=sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d \ - --hash=sha256:3b562dd9e9ea93f13d53989d23a7e775fdfd1066c33494ff43f5418bc8c58a5c \ - --hash=sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97 \ - --hash=sha256:4bd4cd07944443f5a265608cc6aab442e4f74dff8088b0dfc8238647b8f6ae9a \ - --hash=sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19 \ - --hash=sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9 \ - --hash=sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9 \ - --hash=sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc \ - --hash=sha256:591ae9f2a647529ca990bc681daebdd52c8791ff06c2bfa05b65163e28102ef2 \ - --hash=sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4 \ - --hash=sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354 \ - --hash=sha256:6b5420a1d9450023228968e7e6a9ce57f65d148ab56d2313fcd589eee96a7a50 \ - --hash=sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698 \ - --hash=sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9 \ - --hash=sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b \ - --hash=sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc \ - --hash=sha256:7be7b61bb172e1ed687f1754f8e7484f1c8019780f6f6b0786e76bb01c2ae115 \ - --hash=sha256:7c3fb7d25180895632e5d3148dbdc29ea38ccb7fd210aa27acbd1201a1902c6e \ - --hash=sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485 \ - --hash=sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f \ - --hash=sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12 \ - --hash=sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025 \ - --hash=sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009 \ - --hash=sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d \ - --hash=sha256:949b8d66bc381ee8b007cd945914c721d9aba8e27f71959d750a46f7c282b20b \ - --hash=sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a \ - --hash=sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5 \ - --hash=sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f \ - --hash=sha256:a320721ab5a1aba0a233739394eb907f8c8da5c98c9181d1161e77a0c8e36f2d \ - --hash=sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1 \ - --hash=sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287 \ - --hash=sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6 \ - --hash=sha256:bc51efed119bc9cfdf792cdeaa4d67e8f6fcccab66ed4bfdd6bde3e59bfcbb2f \ - --hash=sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581 \ - --hash=sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed \ - --hash=sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b \ - --hash=sha256:c0c0b3ade1c0b13b936d7970b1d37a57acde9199dc2aecc4c336773e1d86049c \ - --hash=sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026 \ - --hash=sha256:c4ffb7ebf07cfe8931028e3e4c85f0357459a3f9f9490886198848f4fa002ec8 \ - --hash=sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676 \ - --hash=sha256:d2ee202e79d8ed691ceebae8e0486bd9a2cd4794cec4824e1c99b6f5009502f6 \ - --hash=sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e \ - --hash=sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d \ - --hash=sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d \ - --hash=sha256:de8a88e63464af587c950061a5e6a67d3632e36df62b986892331d4620a35c01 \ - --hash=sha256:df2449253ef108a379b8b5d6b43f4b1a8e81a061d6537becd5582fba5f9196d7 \ - --hash=sha256:e1c1493fb6e50ab01d20a22826e57520f1284df32f2d8601fdd90b6304601419 \ - --hash=sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795 \ - --hash=sha256:e2103a929dfa2fcaf9bb4e7c091983a49c9ac3b19c9061b6d5427dd7d14d81a1 \ - --hash=sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5 \ - --hash=sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d \ - --hash=sha256:e8fc20152abba6b83724d7ff268c249fa196d8259ff481f3b1476383f8f24e42 \ - --hash=sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe \ - --hash=sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda \ - --hash=sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e \ - --hash=sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737 \ - --hash=sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523 \ - --hash=sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591 \ - --hash=sha256:f71a396b3bf33ecaa1626c255855702aca4d3d9fea5e051b41ac59a9c1c41edc \ - --hash=sha256:f9e130248f4462aaa8e2552d547f36ddadbeaa573879158d721bbd33dfe4743a \ - --hash=sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50 +librt==0.16.0 ; platform_python_implementation != 'PyPy' \ + --hash=sha256:001bfd59a7d45b17e3e75f2a8c6405280b35e7b84471792778e718c4f368950e \ + --hash=sha256:0058f9d68721094105917254c72ac0569117bb7b13b9769cf45d26d89f9d21cd \ + --hash=sha256:02118f56a9c36ddd07dfd9b919d9ecc117ba20a90987d56aa4c429fa34509188 \ + --hash=sha256:0253721561787b8df8443eb347b7a6461015354e5bdd37ee38a41fef220d2bb0 \ + --hash=sha256:02d89c813d5ff74b17df72d3a34819d132cd168e56b81bf755b809bd9e46b8c4 \ + --hash=sha256:0314058469f4d2fd279ce7c62ac274ac82c3918ef7db62ef0697c4c359370155 \ + --hash=sha256:0dbe4096a7ecc00fa835d24510ad8545a4efef738dac96e0e63516783ccde905 \ + --hash=sha256:0ead24d2562a49473dddd9efef8581f020007eb0054389c3ee3ffad38b1ca4c9 \ + --hash=sha256:13b4e8aba90b0b1c82474e9844aa9ffe7ad3faa484350e1da64cb8188d903134 \ + --hash=sha256:14ed6ebe3e4f85f326d7920011ad30ff49ed9334e62cf88caef9ba973d9e3a92 \ + --hash=sha256:17bac7f7a16b328fff77e440287693eb017abde913595b5827ebccbc21ecd8a6 \ + --hash=sha256:1b384b90ab79a7bc30b566895809a636e0666f21f3cf12b54823d025b7e83839 \ + --hash=sha256:1bc17e54e5305f8d40b7ca203671ff5a9e59c1d0f8ea0f625dcca53a3984de11 \ + --hash=sha256:1d28ae980ae2218f9c5b95d191e947296f918c9bf0b400d467a9430275bbe678 \ + --hash=sha256:1e511762a074005bb0aa569166779834e75e438370226930d0ce1866d4b6a33b \ + --hash=sha256:20fe0bf9053885e21c62b3e091fb5e73e1c54d1daf2e70eb388d70763bcd4220 \ + --hash=sha256:242e00b3d4fa37c3d3c1ca5f5c9adb7d909ddb1eac9c41f2787320d00caa0af2 \ + --hash=sha256:25a58a19ea8d83b68209f04912df765e9260635ef77646542ed4b4abe6bc7940 \ + --hash=sha256:273d00be33792a15189331df10f1f1331621b043881e66c6c4377f7f776e1291 \ + --hash=sha256:28e038895b998d7a0c7798922ce8a1dc157675df5cf1c9ef0aca809ed804b7a1 \ + --hash=sha256:2bec3818c7da7c96ceae0ef5915a3d16c52dd08f3ea913bf1fe8568c447c7978 \ + --hash=sha256:2c4aa329c17bd1aaea4f6e89335d8ccd494b3a5830b6654462273e50e11023f0 \ + --hash=sha256:300c3ffdc459f4a779a8411ecb188e3ac0b1ff3a3a7b099642555dedae06c69b \ + --hash=sha256:30b7beaf3f4487b7d8adef1f158b49067cb4d5a19fa7a3bf31a4e7a820e435c5 \ + --hash=sha256:314e703f0c19320dc8094e7a784b9cf29e1b67402515abf580069a6363c0b4f1 \ + --hash=sha256:33f41443a1f4e1f099331b3d8120e409fbff84b9760bc1cc9ea496f37ddaa5cc \ + --hash=sha256:349c0bcb87ebd07481b6ff781e25cdc699723dbe2212e57dabb27f7a13b7b87d \ + --hash=sha256:36e53948e99bbe3ffea257124cfcae1cfb01831555c9a9c903c9f9a72db7fd07 \ + --hash=sha256:375bfe6b572a8f6cfc398709356046173bf27e64c4c5edaf5f7062f051fb4bf9 \ + --hash=sha256:378dfaffb38e59c24a87cde5713cd865d51ff7383fa12947f3907f306ea1ca55 \ + --hash=sha256:3931f7a3db322e7f44e02a280e3949326ce9579ad388ee8d691dc7c76da9fb70 \ + --hash=sha256:39ca4f2f2fe05de8e63493da592d84311adabe5bef52b193851981da9816b302 \ + --hash=sha256:39ec1d5a14e37baf1450a6cabf03fe552340808bf1ad9d71824ab90117716459 \ + --hash=sha256:3ddeb3c9dedb461bb457c6c7d9aa7fbf35329da313d1a7543d00c8d0f3473c96 \ + --hash=sha256:3e0c39bdc85370422e8b637be76eb1fd07d30967551b03e62267dd156f553152 \ + --hash=sha256:3e483a8d69ede8067db70c0e83007423b6925de6fd53afed01d66160f2e9398c \ + --hash=sha256:3f0b8114c44b2ac06ff5dacd08e07e8e807ff4f46083f2a1602685122559be41 \ + --hash=sha256:3ff4b2367926b69c6215635902cccb04048e73094e9862900d27cb2c6bbff143 \ + --hash=sha256:4323193ac0cd025f85af531df8ba91bf24d1973b401697347a6282e8fd3fcf5e \ + --hash=sha256:468df902df016a06eb0e40b0747dc8d14e47d7a38b18b63b1fb167d85cb94d63 \ + --hash=sha256:473eebc7866bb0a0c8849a292b5e7157c1aba5d14d0f0f610c52158d6d964262 \ + --hash=sha256:47ada6ea32636492c61aa8ad27ae3b9404bfe7a97e3ba946d1984236cc741da0 \ + --hash=sha256:4b6183e2e2e0ee00aac2ec07c7f7d151c97e85666b304f574b71cff0f9fccc4e \ + --hash=sha256:4e29522c62e28595ff7e324c6834ade51127707f0e255b18d1c1cf03d39c1048 \ + --hash=sha256:4eb1313a19847089ee81e88742abedf285c60538816640b99742d8534b81d26a \ + --hash=sha256:52327da75a94012e7f932f913d20d3876bed3c102be00e6c3e8600ff7bdd58a7 \ + --hash=sha256:54d11f726aae9df5a6ffbbf0a03a52449bbac84a53ef03669cb41cdfd4ae41bf \ + --hash=sha256:5696d7f52e7b37217cb3a8f92c744fe835942602fdd4c1a8bc4741d3bfdce15e \ + --hash=sha256:5750a105b42a416f930edc59054927a406effb2550cd5bab92ad7a5842ed5d05 \ + --hash=sha256:5810ba811297fdf37a1531a57667cb8ace0842013ca8606bf9eb7c24cf4be154 \ + --hash=sha256:5981c011b306781ce561e18e14230a14524a3d8109b97553666c942c18f31a96 \ + --hash=sha256:5a269c46ae327d8e6f8c1f85f7516cb52c0fa48127565a1105a4f4a05ff2a0b4 \ + --hash=sha256:5b976054553670829985ed767feb78fb6bcede0175327c4844dd5c281c1be659 \ + --hash=sha256:5bcc2c4726ced915b00de0c9856a4eeabfb3fddb93e10e0b8f735b7709358b6d \ + --hash=sha256:5cd5b092441053364af968ea12084692cb9d4a22f3ce9524e377880bf028761e \ + --hash=sha256:5f49cff01bd608ef7d97104cb035c75455e79c2d70bf4a506cf773338ac1860d \ + --hash=sha256:6072e92dd876ff6ceeb6cf371e35e51f479349837391341f479b08df4564242b \ + --hash=sha256:64c79520414a3fdfc6aabd7593e6169afa14d5f8d9908d4b498db068868b08dd \ + --hash=sha256:67e718c7a43f8db325abbbf1404e2d535f12f8f7a1a82259568385cc5274b82a \ + --hash=sha256:69ba927445cfaaffb4081003ef5224c55a5c2ab67ef956f416ef744916e44121 \ + --hash=sha256:6a63610fa76524edfa605b5b259a603915c7a6e10e54f003e5503030506e81de \ + --hash=sha256:6c5da27e8056439f927ea896735da60e616c477a8293feaa3233d4e7781a6726 \ + --hash=sha256:6c8893eae2fd13c5488d94056f3e6e5cf3142bfb1c4acaf136cb33d760c5964b \ + --hash=sha256:6d4a64283ee61824b5790de882bc68e2d9d7a5143537cb7a966f7354f71646d4 \ + --hash=sha256:6fe436af2eaf630474f491af5d032cbe45f93fcff5c3b9fe4ab194a7255b20ff \ + --hash=sha256:71b93b42784e25b975079573c642a8fedb049a7bb31d70a51721b1666b3b2ced \ + --hash=sha256:7393c9a48dcce4817dbd4b0d8ff6237efe9b0a0609f5b0adaef315f8541726b5 \ + --hash=sha256:77c7a2b4fe2c1369e0d5aa1cade26740a7b14be32fbc9a5535d617d20065c39d \ + --hash=sha256:7a1d272724b581bb6bc769dfdafed6da2ecc9886ba2450311de55a4ac2e1e9cd \ + --hash=sha256:7cc365f006891afb006b52d5ee5ee74c09306ffa20e2f8705a32a4450af2f3ba \ + --hash=sha256:7e510b7770bee609617a3374a96548eb114cae048023e3f049ee449e7ff2db32 \ + --hash=sha256:80039ba9b6a7d5f1a0175a4cca6bbefead87bd854c80abad1cb30afe47a830db \ + --hash=sha256:83d4041a3d9b2fd053a8a4e1f22878b3e5833e2712956382d5c048d791454e91 \ + --hash=sha256:845a511b60ca43b9880dcc84a9784c891d6a2098c829130b320846c69c9c0c68 \ + --hash=sha256:877698bf6bca5721d8be345f2fe09778e40ecadea8b58c73075f2b1a53666bf2 \ + --hash=sha256:8caf96a4ef8fb27d0ac0d1ad8337d26a240acd4a02fe4345d0a8f264753e8f99 \ + --hash=sha256:8ceafb70f2a4f0826f11031942e59c0728fd98da112dc346d4352bde1e486866 \ + --hash=sha256:8f36c58e33b304b525c6c9c5076399c6ebf1109e17b9051a05a407b091b9215b \ + --hash=sha256:8ff5d26c529336be9bd7ae04483235d77778ee7d6444a95353102b542601ce81 \ + --hash=sha256:909d8e3c1faee44cb762b1c519ff8613dcc5ceae5c99987a00917b5a31fd1d6a \ + --hash=sha256:92caf82ebef5e12d21c72242b70d1e92536f1711cf2a727a4c276de4b4469087 \ + --hash=sha256:931a0bb0fcac88f263e269e46eb30ba8e21402cd3c62ca40cb97034c0693fab1 \ + --hash=sha256:943c6bbecbdf7fa575a4f2952fcfd848c88ef95507c3fca411e89d4ac3ff8143 \ + --hash=sha256:94aed6a8308818b91677957d1bd03188869cd7aeb23c5dba7912a6c0402f7602 \ + --hash=sha256:94be5cb7bca4df6201f4183e9e4fa2086c655283d20b38cd84500a69057575a7 \ + --hash=sha256:953107e2f68d0f3512c48f898b0dbf0ce5cc52bba0f318d847c985dc555ee4cc \ + --hash=sha256:96f576f2711f8519152ec76d0e599243555c1f07679fa73606ca8c8c868c0be6 \ + --hash=sha256:a33e0dae1f8592146a4764d54ce842b278732d21a84e17c3bbe6b1bc158a2248 \ + --hash=sha256:a4aaefb4ba6c07e1aeebb2795c8958148f1d6f9af3b555b53d23d766edb6d67a \ + --hash=sha256:a8afb6557920860b7a3a596eb804cf37e09e7cf8a803db2478c202acc72d8c2e \ + --hash=sha256:aa9357a1b4d4fc787bb718a59cb1112c28c8a976d6bfa268b71cc0a4ab8f3a94 \ + --hash=sha256:ac38d6d8d66bf3d744148dbbc0b8e193e195a51e364ed55e224631f5721891fc \ + --hash=sha256:ad37d5b9abd49c9a655dcda7ea52a8a752884062ef1ee71ae17c2f2a0f81fe6a \ + --hash=sha256:aea7b1f2b125dad5de85f049136651bff256c883c65e6b9209b2da0a1ac3cdef \ + --hash=sha256:afced3dfc17cd805ecf7a3d77996a71cf5f2c75aa66eb0c21a9930f4fc992f86 \ + --hash=sha256:b0e3e721c75d2e79a76d4422c79d7ba705fe1bbafec907037fe7a657a480a0e3 \ + --hash=sha256:b6d085d70bce51d43c5c7c36d63490770180d8779e71c49305c87b4213918de7 \ + --hash=sha256:b95d5d92ab83d39e760a52091bb1baba664f3a2351e39b1e16801e5747c2f0e9 \ + --hash=sha256:b9d6d4b14e92d876f8026b54c20c445f36425214c1081dc76f74e40db386b82b \ + --hash=sha256:bc02954b1295de798bbdb0b4e2d8a28c2117de8b5c73dcbeb27dc32572dfb971 \ + --hash=sha256:bd3150023d3dc2bc70f3784e59ffa1140d56ddba3d8125b3d6f9f85221279bfc \ + --hash=sha256:be56ba9c884143495b517f23fe794ae367d58cd89ea0fdd6d437e3c024a87f9f \ + --hash=sha256:c17194318e4c0c0348b36f36c2ec7534436fe0a4c15582403162a4f08c80797a \ + --hash=sha256:c3d1bb7841a816ace6449bb26d3f9560dbfa20e71c568d23f0f62bf1e68f50b1 \ + --hash=sha256:c43bd6e642d8a248c114327f98dd25ac5a7cb5aa168ef02f0559b91874df16b8 \ + --hash=sha256:c5db585d43449a5f54303d4b2774e45e1babd975cfe1630a3d708c0b80c3e560 \ + --hash=sha256:c5e6144e68b577f157519f2ba88ca20e3ed61c29b00e5cdfa76cd2d45acf059a \ + --hash=sha256:c6f1b27bf1632a7e016af9f145f82be95e1edd7721a646505c21059257cb5a04 \ + --hash=sha256:c71d1b76210a36729fedfc5115069b50a3d8619054745f8758fe5d6f19e86671 \ + --hash=sha256:c72c5295a84bd249526da9bdca38f2e176d15c31c13bb0063c5053f4ca023421 \ + --hash=sha256:ca8052401c55d7511dda6760719fda7618067e83535d7d0010096d216c34b667 \ + --hash=sha256:d1aabe3925cbb4a08d15b7b20ba4011b53019da0c4173a25155139b7b1baed65 \ + --hash=sha256:d3c94211ee0c4f8d649ec06b7c115c0ec4eadb873a0e3154ca15cef3f814b071 \ + --hash=sha256:d46ca272b251d033dd4527b0dec5f261a28a52bd5fa0f99c117b0a1f8588cc2d \ + --hash=sha256:d608f0bf3b8cbddd0067fe02cb8cab7d13e8eb9386b23a1843d4363044fd9e22 \ + --hash=sha256:d6a365f2ab45a984d0e00eee0dd17f599ceab8cadab6ea07b6111c8132fc0e42 \ + --hash=sha256:d92db7a0f6aee44f1baee94750457e8d2d1c6ccea41842de6268d34e8dc7eddd \ + --hash=sha256:df183721229ae51eef90108c115b43e98cb169b6155d34480338e5fc6616df00 \ + --hash=sha256:e05108e0849966f53a8d2d3112a7af881d0efaa479bc735bba91108f9f2350a7 \ + --hash=sha256:e1967e36ac4cae0c7e9615ad32e1a513cdacff79f9e8afb28bedc91caf48b4f3 \ + --hash=sha256:e42f8e098b9c5396fefa05fb1cc7e33b0e08fc51da106b5de4a45fd22aac6743 \ + --hash=sha256:e56aaf8c167548dc8e5d6f3bd0f48dcdd299a23c73be3f744aab79d99e9c7f5d \ + --hash=sha256:e9ce0bc440e7fd09b5f51f372f0f6640658f854b8fb05260f819cc669c93c42d \ + --hash=sha256:ebefd60b42e2a82b32d136bb5f7c94eadfcd29f772b547df6f3291d1ed855a1c \ + --hash=sha256:ef46c1a29ffb8c72e882e22618ec618778eacd0578fb22c6e7cf9c11d15f357b \ + --hash=sha256:efc49c462d4516b8a58b00b490078fa64689fd1fe66970cc190131d7afb8027e \ + --hash=sha256:f01f3805f2dae4781c0c34b440e31740d082950bdaf89a6f601ad589a28af57a \ + --hash=sha256:f06c689cb14afd9b612727553a5ec5a40febf113ca41c4413a2b0b334285884b \ + --hash=sha256:f1e8591bd8a5a628cd7f07954c6a1592359a878bf032957a8e9057a41d644311 \ + --hash=sha256:f4462528b6000afe8f16907b5c7c2553abf1df005ba5140e6eb394541c3624c3 \ + --hash=sha256:f7be7cf555bc30ec12622e9447299cc4a9b8ff307548b634794353db0c2065dc \ + --hash=sha256:f81b5b19ce748ef68d4746656b7929762eb2fe99269b266e4be07e2ee4de7144 \ + --hash=sha256:f9807485a908f00355820f18e91e045ffdcdc5adb68aaec40a1e2b88c5f7bba1 \ + --hash=sha256:fbe4fb8c5445f7496d7f7f6bb0807875d09d47e6771ffa175fb2df2895fb86ba \ + --hash=sha256:fe4372c52d4849096c6cc1cda2817d293ec51440c890474ed59ef38d46556f18 \ + --hash=sha256:fe52bf4641069e7978a14253b036cb9002def1926317e710f2e249f8a8c47742 \ + --hash=sha256:ff7baa55f8e7c69851419e50a666015d02a74198716fd45c0125a2112e0a389f +markdown-it-py==4.3.0 \ + --hash=sha256:7aa1511a46c39138de78d9eba92ce47e63124d8003fc98b3a351909e04239efa \ + --hash=sha256:91a58fa5b72c71a40cf7177250fd767480d7a2bb3ac426ccfb76fb90305fdaaa +markupsafe==3.0.4 \ + --hash=sha256:007e1ffd9bf65bb6ee96df7b258fc632a4868dd5566037986c64781f35a36e98 \ + --hash=sha256:02fa4acbc6a3fc5c693c34d4dd8c1130b7fe99cc915181b0ddd6f72aeb296002 \ + --hash=sha256:03470d1a8268e692ecf79ecd565593e59d44219377a7ead61f1f1b94c1f7ff6b \ + --hash=sha256:04e7902ba80ee4bac1d50a549606527a1dcf0476cd81403db41099d3b60ec653 \ + --hash=sha256:051417f74bcaaefa316276e0ff723f541616ca51043d070da00249d9bddd3e3c \ + --hash=sha256:05295589e619b9bed252a86b532b8e27350abc372d18ba89b59375325e91ec1e \ + --hash=sha256:06de8ef6331f6e822c28d577dc8bf43fe398800477c49498f38fc38b67ff33fc \ + --hash=sha256:0764a13d34cae40db7bbf3a09b7e9b491bf4603e20b263a7a9d6b8e324975d0a \ + --hash=sha256:077293e425f28ec737dbcad442a71752e28f8ae27cde3d68acd1fb212091cd92 \ + --hash=sha256:0930db9bdc62d22944e10b066448bb65dc9abe9112880c7cab8da54db4284d5f \ + --hash=sha256:0cee7cb0f9a1b6892ea482237d9403b3d1b4603aee057d0ff01f0fac2d019a97 \ + --hash=sha256:0d9c47709875fdb321452056622e930c52afbc07a7d780762fbb8b4d91ce6fa4 \ + --hash=sha256:11935df9bf455ed0c04eb87bcd720f02b1fe5e02128a9430f23aed6f93336fc7 \ + --hash=sha256:12a606a492de952afcb43b59a14aaaaad120e708d3663dd0fdf2d738d427a691 \ + --hash=sha256:14bd2d845d62ab678eaf81da89d7b621b51756c72346745c1a594c09d49207a2 \ + --hash=sha256:15ba9e28640feef770374b116a6f019c21f52404aeabe516aa7f800587b98cfc \ + --hash=sha256:18a801868a884f216e784d7d14db2a4077143ce7610440aee2ce8f734e7cfcde \ + --hash=sha256:1c0df495a977d10460a94941799c72d5b5ab03d3858d949b55b5a66c8f371c99 \ + --hash=sha256:1caa2fa5a6184fb233153b35f654e6687bd555476f6170f29d8ee9be1a8b0af9 \ + --hash=sha256:1e1451fab512d1bcc3dc26988ec1edb0b82c2db909132872cd9356070a6b63df \ + --hash=sha256:1f1f9477e174582b0a1b583d60b66e1f2cf5d3fe12cee985e4aedf44766600e5 \ + --hash=sha256:2628d3a8cb648ecebb3c5d6b0a1052d400e4d8b7ac0fb786be8d285b50040d17 \ + --hash=sha256:26e9867520db70d37f7fb421a7f0d8adb40171011fb84ce869afa1a83370dfa8 \ + --hash=sha256:2a6ef68ae94aed8721934072b27a3b654ea2100b97e4ab864cf1489c90926fbc \ + --hash=sha256:2b2b1e18af909b448bb3cf9e3433366f7a8726271fc214e8b10e0f62a78c724b \ + --hash=sha256:2cb3dd71fc6be918ad4264346a8ed69485f9b7ed7bf35495d8e22807cd6b8bea \ + --hash=sha256:2d1b7d9308288661f56672b1b157d75fc536714d3638487bbea17b6318a78248 \ + --hash=sha256:2dad610540cb2e6272855c178f08ae9a1c7ac258a7fb71660553a5f104b42741 \ + --hash=sha256:2e5a7cd7fdd14fcb1ae5d7d8bf23d24fbd1daefd1fbca2580132e1ea75f098b5 \ + --hash=sha256:2e9ad7dd851bf45fab9f75cbff4cb493fee9979e8d8c7c9c3ee119022518edd6 \ + --hash=sha256:340cbb1957ba99929cbf19a75626d36ba1ae21d1730b287d1cf7f824a20c4fc7 \ + --hash=sha256:34bdde374c5932765d7dc685c4a1d191a3207852d67e8e0a9eb6ea85156181f1 \ + --hash=sha256:353bd63081912ab8cfa6a0c7d185934cdf8426f04c618bba6bc4b394f2069b67 \ + --hash=sha256:387d8cd30e69b3f0a72877b9ae717033396404e19095b17fe89753a981fda44f \ + --hash=sha256:3882fb412298575bae3b9c46868251f15cc69307359f87bb1b382e53d6e5a2c9 \ + --hash=sha256:38fc55594dab834470b6733dead2ee9e3f657fb0608c769dcafa0ba5ab52f45c \ + --hash=sha256:396ec4e65cc889f69786b3b89478b471cee5a3bcf468b9d9bb03e1a30fb291fc \ + --hash=sha256:39dbacefc411633db5b4378b066a9aca70a3d7e2922c9e578d825f844026eeba \ + --hash=sha256:3a93d9616ddecfb393727a0041a562cf0b15a244e20f2bd25efc7949be4c4f17 \ + --hash=sha256:3d23795802fc8bd72534836d64489bbf0f67c088959091bdb22e10735a5107bf \ + --hash=sha256:434139499bb20b502ed3baa1f169e618f924a97e7a777fea1a49446d80106cf6 \ + --hash=sha256:436e3ffc6310d3c41878c601db29098102fe5d8a467c49da4a4125254e0980f2 \ + --hash=sha256:489505b03f692c3f376394e49194fa7a7f9e8558d6e293a7056a0032b0c38163 \ + --hash=sha256:4a540e2d3192792fc84eced57bef37851ccb2b41f73291bb17408eea77bcd278 \ + --hash=sha256:4a7cdc2a420ca01058182da4253329764d4bfa055564d1eced90e6ba1e8b1d3d \ + --hash=sha256:4bced6e2a6dba6a28f7dd3c6ce14df1b2dd495923f16ea484cad03decd463b2b \ + --hash=sha256:4cf3468d5ec187ffffcaca8e61929a37448f215dafc1386a12c750a72fe53634 \ + --hash=sha256:4e2c4809c14559aa7ef426f27fb35afbb38104c349a903bf8f3600456764bb38 \ + --hash=sha256:4ed644d75aa94a2baf7ec3a96eaa160ea58c742eb9d27c6506053c5c40fc84ed \ + --hash=sha256:4f6e0852a0283b1b1fd776eeb7b766a5f440b3e2bd31ab51af3b400585f3965c \ + --hash=sha256:5066b244f576f91afc8ee3ba029a89f99d39c79b1853fe9d39bea9f0afbec148 \ + --hash=sha256:5086f9975abb1ab531ee6afca1761e4b59a19b446f3f6522ed776963228cfe5a \ + --hash=sha256:50b5bedc9ed8a94fc8857a42ef4f84a81ea88f8d4f05dc8705fb23ee6d8dcca7 \ + --hash=sha256:52704c5d36eb6dda8866493decd61111fff86244c9b1ad225ca01b9e91e5970f \ + --hash=sha256:55ffd6ce583d97dc71dc92e930324c8c0d25aea7e3ade6ae54ef77cedb096811 \ + --hash=sha256:569d65055d367e3dcdf30c3f41119467b73d9ee9faf332bdf40402644f5ac08e \ + --hash=sha256:57f9947a7e57a081c1e3e0a2dd0d2dcf290a4531450e6f611e30084c222a7295 \ + --hash=sha256:5989cb26b2e1efc6a42216a9f6b5ee495ce5ace2e5b352a9af489976b32d1ee2 \ + --hash=sha256:5c22873ad1f0532ba40fa1727f3c0fc1bbbaab6d373d4cbe3f0dc74b2e2521c7 \ + --hash=sha256:5e8b3d0b18fd623afa12ecb2ce8d8becef69f9b5440c6330c7972200e0bb84b0 \ + --hash=sha256:61631e08084be9e21a8967ec3139c7616ed7c5e9368e05c86d1b39562c8a57b6 \ + --hash=sha256:64511c54db4e4987aef4c41923235927428729e8174c5dba488429be70a998ed \ + --hash=sha256:6669c1bf34080161ce49c589cc512ef24d4c704ac9d2b2d3667f519c60418378 \ + --hash=sha256:672d207103e6b16ca098611b0f9efad6bc00afd47c03d6ef62186495ca677dc0 \ + --hash=sha256:6768d67d1bce64270e0fdc2e69309d68b9b18ae56ddf6c711d168e9d051c2cac \ + --hash=sha256:6a45c3d514f2436064db00d7fc8778d888f0236ebfed649b53d13a59e69ad51b \ + --hash=sha256:6bd9e1788e15bfcf6a9082de42e30387e7b85d211ab21e57a939bb8cfaaf8d96 \ + --hash=sha256:6d2a9efe686f9de00d0d1ea32a4a5a86d558a2277501bd78d964214eab625e59 \ + --hash=sha256:6da83a088f8ef93b2d483a8232a4dbf4d69d3d8496b568a03c56becac43e1808 \ + --hash=sha256:7018d4af1cd272e847aa5917983ab5e83e4f6579f9dbfecd4a79c0ca80b144c2 \ + --hash=sha256:71f88e749ea29f67f21f3b36433c1dc54c7729ed2a6d9e2da2e0d9e0d7b224eb \ + --hash=sha256:737c9c3981998eba27f11786f84fddcbabc74068b72a4a1f454ea02094b57b65 \ + --hash=sha256:73e77980c7207854f00fc4e71fb1626868d5740ab4012623d55c7a99ad122a72 \ + --hash=sha256:799c39bdf5e2f1292fedd3009f7b3c9e760f10b2420cb9638d56920840ff6db8 \ + --hash=sha256:7a83aa6e4805df46fed18e989d3d16f86ef60cb50bbc8d9ce3a6be89165fbf6e \ + --hash=sha256:7d3391b2188d18737cb2fa147028b1096236eaa7e156446c650a489fa2cadc91 \ + --hash=sha256:7e1636da3d8dfc220b6dd10264db5f2b165e4888c4518594898fbe381049af8a \ + --hash=sha256:805c8b84534fa10891890f0e4be39f3a99e94615d93e8836bf9fa1fdca2feeb2 \ + --hash=sha256:811d02d5122171c1941357efd8f9bf4ffe907b7f0a1a4e729a880e4be3f46e3e \ + --hash=sha256:8138eb83940ec7299024d92d4dee45f601b9e6c5ffde9d25f4e35e326203c707 \ + --hash=sha256:83b3944fea42a8400edf92fd1770fb8d0d4f7de651353bd2d8525a92dba69a21 \ + --hash=sha256:849dd2bb0e5e4ab2b71c7191726a4a8d5aa8a610daa584728cbee0b710ddc4ef \ + --hash=sha256:8698d70a8081ee8c090dbb394768b5789a1da8b131b5499f89d071dd3cfaf6be \ + --hash=sha256:8781a792a070cf2bd1b86d3aa943894115faaba6e88122a7bf32d62072742453 \ + --hash=sha256:88d59b473bfb03259722600839af9bbd7fa13a2eb514beefeedb95997882f69a \ + --hash=sha256:8909c2f1c6dd65e054ac4b573a91c8384d1492281e55d82d159d653f7a13adf6 \ + --hash=sha256:8965520ac587c94a4ac48b729be3d8b8de00af39699b17585dfb599babe77977 \ + --hash=sha256:8b5d563170ff8ba3181caa967c99a3c804d1dedb702c7cb93a6a7c32247da978 \ + --hash=sha256:8e124f974786f831d6043728e38296969d3579db8896fe004682f5758e613581 \ + --hash=sha256:8f0fac8b13d14bb06c68195f849371924ae53dd7b1c00fed24650f704383b692 \ + --hash=sha256:9240187afb63d2f9ddc3e032c670356fe941f6e20662ea168a5dc3f1f317e1b3 \ + --hash=sha256:925f929d6b59a8b3f8b8c6ac363cd0af7eecc81efb3071770b3c6717c450a369 \ + --hash=sha256:9348cbb300d224fe3b89793262cb093504d4ae927004468463f745188a193e4a \ + --hash=sha256:9388003072b95f2f1e3fd908604194d653ba21330d811961a78b7da1a77e9e36 \ + --hash=sha256:9438a2648b2195980cb2dd8e53ed7b8df91319e2d0b70ae61a9e1d1bc8d3bec9 \ + --hash=sha256:94e4c421742086aeee4c32a506eec8859d7634aad943f7e6aacf70f813478768 \ + --hash=sha256:94f5407f7bc64fa6463906b896f9904beeeb7dd8dc116ee8e9056c8714ff9916 \ + --hash=sha256:971a3bbb75d97ae4e2e8f7d4834236f86f85f0c85e04ab2e191db1123b04f80b \ + --hash=sha256:9e227f3dbe6bde7491cf0a9965d00b88c6b1a4a95d11480ddf88bb96d397c19f \ + --hash=sha256:9e25feb9e330b63edb0278a0acdf85e50d0cb0fbf49c3084abbe4e24ae195346 \ + --hash=sha256:9f098115c247e11d138ab83a28fa0323c77015007ea2df73ba5fd714dfefd67c \ + --hash=sha256:a18f38cafc329bac5e3c2b96c765b4c96d3d103421ed22ab7988c1e3fce27464 \ + --hash=sha256:a4bbd2d87dd233b9fc5812160c3d0ffbe42edc22a26ce0469f58479ede633fe9 \ + --hash=sha256:a5fcffb37e602b0b3c1638a97746b9b96125caa9bcf6fa41d337a9261de231ee \ + --hash=sha256:a8e9f292fcda89b324f2f5c91d13f1424a153e40fc2756f38ee23b15835ff300 \ + --hash=sha256:a9f54054101545a9a9cccefddf54316aa6e4491611fcbef9e91b3b6bebec04f6 \ + --hash=sha256:aa2c838cc024642cc04c6854232f32b43e5e22833dd11119c1766c7873b8370d \ + --hash=sha256:ac0c7c9f1609b0c4c114feb1d7a3409564c7fb77e360bed9e97e5d25dfeaf868 \ + --hash=sha256:add96447a86d205ab616665d53b2950ee81083757f56e6ea833c8b2917646b46 \ + --hash=sha256:ae9dcb8fbe244cb82f8a6458b455b927a03685e383d9bacf1ea5ce180b96dc97 \ + --hash=sha256:b4a635a0487774f841cb1fb62e907e7195cc95bc761e053184b8acc3ceb20733 \ + --hash=sha256:b4d12837e0203bbace818ff4a7461afdcd78bcd782351cea148139180d7bcffe \ + --hash=sha256:b61687d0828e72bf5cda24a2690188f37170bd31c9359ac97e4e66569f120a16 \ + --hash=sha256:b807e598953730f82e4eae3bd30f6a122cf6b31c398c6b504c0e04c13c170429 \ + --hash=sha256:b8cd1f918b26fd7b1832ece557cc18f2d8747309ff8b3f0ef9d4250c5ad67a39 \ + --hash=sha256:b91cc9d336957239ff200f30097e6fea2dc6d6fb3c81e853eaa09eac904fd894 \ + --hash=sha256:bd3ce56ae2cbae3ba82b683bc425cd7e48d2ed8b10f3e818186b6f5646d9271c \ + --hash=sha256:be6cb0c799abb0e2ba3e618e6d28ddddf7e485f6c2ce938dfa237daf3905072c \ + --hash=sha256:befb4158af32106b9a93db8d6d1d1cbbd418c0d5aca0cabb7b1780abf0c89169 \ + --hash=sha256:bf053da3c97a4bc5ecfbb218cdd2983febd91c617be8367d139882aa11e490aa \ + --hash=sha256:c02e8f18bdedba082cef725942ac823b9b60656db07f7e265cb31618dfd00d77 \ + --hash=sha256:c1bc67752d5f21013cfe430df4062441714eab79f65a6a05e01505957e9c35fe \ + --hash=sha256:c61750fadcd119d0825bcb7d7d675dd264dcc89cc05292aab5be68ebdbb374ad \ + --hash=sha256:c90d5b3d4e944e065a301d741b3c1d784f6bd1f503aa68b4967e32b2ba313d85 \ + --hash=sha256:c9a7f43c0b202b334cc9184af09bb8f21d3a209e038efaf106936fb69e6b026e \ + --hash=sha256:cb96e6e088d6cf71c1ea977510948320234824cf226e32f6f6e044f7a9c82b34 \ + --hash=sha256:cf63c214fe879a65e69a386f915e36104fc84254ab141240f8854602d8e0be2a \ + --hash=sha256:d1aca03ede943eb80ab3d63bb082c84b7aab85ea83bd0fd0c200260945fb49d9 \ + --hash=sha256:d2e56fd3b00222722abfb3f5f0759ddbae4b90811b5ad4343c64030ad1bde70c \ + --hash=sha256:d5f93ebbeb8032d47e349328ec8662d973d9b05a70b3c35df1f91fe419b84749 \ + --hash=sha256:d882a373d8093c2941e01291b7ced96e9cbe4781da9a7751ca7e6c70385e5214 \ + --hash=sha256:d920abdfa61279ba1a2ef9484aab07bf03331f8c08a10120fa332353d06e6932 \ + --hash=sha256:da2af0d7aebfc2074080d72efa6ab8317c62481ef1f896f65d9999c1c01f4494 \ + --hash=sha256:dd8ea6ebee7aedbf7c749fa80521d9ccf1ba473e0d1e14805caafbaad281c889 \ + --hash=sha256:de8b364c423ef0a4bad9069657d617f9a5d2b2062457a89b1fa16ee199c399c1 \ + --hash=sha256:df1ae86ff54725a01fa1a0510b914ca53a161b7050be74f6204e24aded5971d0 \ + --hash=sha256:dff05cb7016dff1e9fd68f4122c127b65dfc59de5306cfb7ad92f956f230bee2 \ + --hash=sha256:e1a622f13970d81f95d0c72f9dc090dce9085fccfa4c9f2174377ee32bd15786 \ + --hash=sha256:e49fb0d1ce92cfa0cb198cc5b1b11cdf9d0638658e2a2db2687e39db7c87fc78 \ + --hash=sha256:e5c802729725bd07e2bc3ab7b76dc7e0bbfc53129d8f1eb1c002c24cf774717e \ + --hash=sha256:e841068dc0be4cb6dfb5c890eb88cbdcff2f4a332393c7ec94e8e618bd32c1a8 \ + --hash=sha256:e916035e3e9930cbdfdd10abf48861340221857f45509565898e012263f7b289 \ + --hash=sha256:eba154571c16e032112afac0dc2dfe9e63c2ceb7aedd07bb7eecf2ce26d4dd4c \ + --hash=sha256:f03460ff076f70ab595bb45a0205ccea1971443575b6920c52e755dec2b3fbfe \ + --hash=sha256:f0ec3b750b59375eab5b0fb2b9254810c00a3375be6d789899f1055a1d556237 \ + --hash=sha256:f291bcf42ae98eb5107edb162c3c998b4a89648fd8e99ed4cbd12705292788cd \ + --hash=sha256:f61efe1d2fe0de16158a5fe1d1cf3c14bdb6aecd54d8938fd26512c525c1f624 \ + --hash=sha256:f68edfc67aabac33708941f26f22a7b8e9f81429bc0cf249fcf7d66b23af8d19 \ + --hash=sha256:fa95848c929b6a75f6848d3c9793e59db365ee436776e57db835cdbfa79ba977 \ + --hash=sha256:fd9f8797427910198f95bced71ddfed61130d7e349213bfb8466c9c99e2c46a8 \ + --hash=sha256:fdb4ca07ab75ffadab4a8b135ad59cdbb3156b99310f3d565370da74a15d6bd3 mdurl==0.1.2 \ --hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \ --hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba -mypy==1.18.2 \ - --hash=sha256:01199871b6110a2ce984bde85acd481232d17413868c9807e95c1b0739a58914 \ - --hash=sha256:030c52d0ea8144e721e49b1f68391e39553d7451f0c3f8a7565b59e19fcb608b \ - --hash=sha256:06a398102a5f203d7477b2923dda3634c36727fa5c237d8f859ef90c42a9924b \ - --hash=sha256:07b8b0f580ca6d289e69209ec9d3911b4a26e5abfde32228a288eb79df129fcc \ - --hash=sha256:0e2785a84b34a72ba55fb5daf079a1003a34c05b22238da94fcae2bbe46f3544 \ - --hash=sha256:1331eb7fd110d60c24999893320967594ff84c38ac6d19e0a76c5fd809a84c86 \ - --hash=sha256:1379451880512ffce14505493bd9fe469e0697543717298242574882cf8cdb8d \ - --hash=sha256:20c02215a080e3a2be3aa50506c67242df1c151eaba0dcbc1e4e557922a26075 \ - --hash=sha256:22a1748707dd62b58d2ae53562ffc4d7f8bcc727e8ac7cbc69c053ddc874d47e \ - --hash=sha256:22f27105f1525ec024b5c630c0b9f36d5c1cc4d447d61fe51ff4bd60633f47ac \ - --hash=sha256:25a9c8fb67b00599f839cf472713f54249a62efd53a54b565eb61956a7e3296b \ - --hash=sha256:33eca32dd124b29400c31d7cf784e795b050ace0e1f91b8dc035672725617e34 \ - --hash=sha256:3ca30b50a51e7ba93b00422e486cbb124f1c56a535e20eff7b2d6ab72b3b2e37 \ - --hash=sha256:448acd386266989ef11662ce3c8011fd2a7b632e0ec7d61a98edd8e27472225b \ - --hash=sha256:592ec214750bc00741af1f80cbf96b5013d81486b7bb24cb052382c19e40b428 \ - --hash=sha256:5d6c838e831a062f5f29d11c9057c6009f60cb294fea33a98422688181fe2893 \ - --hash=sha256:62f0e1e988ad41c2a110edde6c398383a889d95b36b3e60bcf155f5164c4fdce \ - --hash=sha256:664dc726e67fa54e14536f6e1224bcfce1d9e5ac02426d2326e2bb4e081d1ce8 \ - --hash=sha256:6ca1e64b24a700ab5ce10133f7ccd956a04715463d30498e64ea8715236f9c9c \ - --hash=sha256:749b5f83198f1ca64345603118a6f01a4e99ad4bf9d103ddc5a3200cc4614adf \ - --hash=sha256:776bb00de1778caf4db739c6e83919c1d85a448f71979b6a0edd774ea8399341 \ - --hash=sha256:7a780ca61fc239e4865968ebc5240bb3bf610ef59ac398de9a7421b54e4a207e \ - --hash=sha256:7ab28cc197f1dd77a67e1c6f35cd1f8e8b73ed2217e4fc005f9e6a504e46e7ba \ - --hash=sha256:7fb95f97199ea11769ebe3638c29b550b5221e997c63b14ef93d2e971606ebed \ - --hash=sha256:807d9315ab9d464125aa9fcf6d84fde6e1dc67da0b6f80e7405506b8ac72bc7f \ - --hash=sha256:8795a039bab805ff0c1dfdb8cd3344642c2b99b8e439d057aba30850b8d3423d \ - --hash=sha256:a2afc0fa0b0e91b4599ddfe0f91e2c26c2b5a5ab263737e998d6817874c5f7c8 \ - --hash=sha256:a3c47adf30d65e89b2dcd2fa32f3aeb5e94ca970d2c15fcb25e297871c8e4764 \ - --hash=sha256:a431a6f1ef14cf8c144c6b14793a23ec4eae3db28277c358136e79d7d062f62d \ - --hash=sha256:aa5e07ac1a60a253445797e42b8b2963c9675563a94f11291ab40718b016a7a0 \ - --hash=sha256:c1eab0cf6294dafe397c261a75f96dc2c31bffe3b944faa24db5def4e2b0f77c \ - --hash=sha256:c2b9c7e284ee20e7598d6f42e13ca40b4928e6957ed6813d1ab6348aa3f47133 \ - --hash=sha256:c3ad2afadd1e9fea5cf99a45a822346971ede8685cc581ed9cd4d42eaf940986 \ - --hash=sha256:d6985ed057513e344e43a26cc1cd815c7a94602fb6a3130a34798625bc2f07b6 \ - --hash=sha256:d8068d0afe682c7c4897c0f7ce84ea77f6de953262b12d07038f4d296d547074 \ - --hash=sha256:d924eef3795cc89fecf6bedc6ed32b33ac13e8321344f6ddbf8ee89f706c05cb \ - --hash=sha256:ed4482847168439651d3feee5833ccedbf6657e964572706a2adb1f7fa4dfe2e \ - --hash=sha256:f9e171c465ad3901dc652643ee4bffa8e9fef4d7d0eece23b428908c77a76a66 -mypy-extensions==1.1.0 \ - --hash=sha256:1be4cccdb0f2482337c4743e60421de3a356cd97508abadd57d47403e94f5505 \ - --hash=sha256:52e68efc3284861e772bbcd66823fde5ae21fd2fdb51c62a211403730b916558 +mypy==2.4.1 \ + --hash=sha256:01b7718552d017f88d1151f3cc9d6556d778a90bd58060a2c3d87d070f9099fb \ + --hash=sha256:0724cf95fabc87ca4a2d5b7f276b43f51afce8a3804bde704490b008e377e50b \ + --hash=sha256:080cf64a60b90a73435542feecf4171904cc5710658165b40c6869115d4aa100 \ + --hash=sha256:0c5bf267645351887b72903fd2f5fbddcf85234e0e6c4ad94e2fcfb4f0c3f971 \ + --hash=sha256:0e95ad0bec03ced9a73b42514208abd24c789e67f0e1eba476e276dd7a2dea3a \ + --hash=sha256:0f0a8b8f5dee799195a3f2670a5b2617ac7193d3563f52dbef42ad6770c6a9db \ + --hash=sha256:133886ef1a7a8cf673df55d865e41580c6c46aa9b8e31e1325dfe315c038f745 \ + --hash=sha256:1784648d6ec8c2b5465e3f26241b845a0b3cb4e56c993c64abe16989e7698999 \ + --hash=sha256:1fb70621535c22fd4b1a0450d37ed1d6c5eb39656a1cebfb189084c12de54ba7 \ + --hash=sha256:2875280687e64740e6ddcef43bd4c5852ad45ff34549740f6aea3f0373870b93 \ + --hash=sha256:2b4e0aa029ad0c1d42cc494daf86d1e0efd15dab4db7bd096ece29e8a9689c6a \ + --hash=sha256:3467b1d13000812ab85dc2a3834b9379ec77798ca1bcabe434e23fb21fead692 \ + --hash=sha256:3f1613bfe6726169a5680ec3dad5fe1f6d96285c12aded51ad432eadedd39d45 \ + --hash=sha256:4af5ad558033bf71a44a1be149ed61633522824f84c1b6bc2445d3fe2d2a5296 \ + --hash=sha256:4c194c5d878130fca1ae662dfb1feb6274afbab0b40032c80147377e0ea803d5 \ + --hash=sha256:4e18d0da3898b3bcd16192f15a206e7b8b8dd0f4a0b3e51aa5bd5c2afe749e2c \ + --hash=sha256:51f742d4154824837ca6e92aa81f00eec222700a3c337bd258e5562a3880d75a \ + --hash=sha256:63b590965691e540a335fa74dadf31a7069142f6b72e234689bbd244edf55623 \ + --hash=sha256:63c6ff0e7ea546943001a91639c9f0c64b60d239268fa5d29e4a6c87f82c2373 \ + --hash=sha256:680ba5d9f0e3fe0c746b3d14df15f2a718e4bc308a1145616a1ea691ce7c354b \ + --hash=sha256:6f7225951a277dd0d6add900731d487174b7d24ac133c09d670ed63b4d8cb90d \ + --hash=sha256:70196470ac300f444a302a738541101893c2c57804078b33690286a7899149e9 \ + --hash=sha256:70971cc0bcb1d3f03d2eb68fa430a6481ccc03558dc001d9534d7e5fa274c392 \ + --hash=sha256:71eda06e5bae51976ce869fda429159c9cec678bd02f25bb197f0265c8f991be \ + --hash=sha256:727890a32f1858c09549eb55a8b234fe990d460450b28f03e8213ef925f1247c \ + --hash=sha256:7344869cad05f073b8cae2826774fa0161e3eb2f5c685b76813574008d77d750 \ + --hash=sha256:79a1e79199e980fb41f219cb3d4746d25c64b0b623840d3ed57df1cdc13a6502 \ + --hash=sha256:8e437811ebd26d3e6258efb562a711b385c139be597dffed5e735c801d15c77f \ + --hash=sha256:9d7dafd56179d296651df9e1844b91c9517c379398f017a2a435d077a28943c1 \ + --hash=sha256:9ed1195502cca32be5ef756b1693477f4991db2f2e34eaa90cc4ad6bea4f9531 \ + --hash=sha256:a20ff6cd2af7a670c64f089bfa5fbcebe8ff3bf896c5e6ac7c9862c7960e4494 \ + --hash=sha256:a2d4a51db92059eecc2c33b2a5194b28585ebfd917292c015fe87a77dbff6cd2 \ + --hash=sha256:a5b5da107dc2c93fb0a22f7a45dbaea5dc131afc7056b5468d78e819f9a138e6 \ + --hash=sha256:acdd82cb3a2eb10720e87706a128d75785d005a8c47e36a4973221524f41fc56 \ + --hash=sha256:b69a15fc2e75858d6b15e91ed3a0dcff1a533265183b64734138791fe0f49aa5 \ + --hash=sha256:be4c03f33c55500191df2ed4a9b5e7edbdd1fff067fe361a5a9b1b5d3262da6e \ + --hash=sha256:beb254fec368c4e7f7f82a5f310c6470b893ec88a90b66426da971c6826b0453 \ + --hash=sha256:c3a4d0c47053cc90035dd3a2c321112b593ad42935d0cbfd747288e1564fa8ca \ + --hash=sha256:c45485061ba08f700acc12cfc8b177e6997e6bc353605babfc0abb081e079456 \ + --hash=sha256:c535efcb91f7e66f41b9bd2b5dbd78900a7609ce88f4c020d668e4c82d082b0b \ + --hash=sha256:c6c7210e40dd423af7d65cbe428b5906d11dc60659337bdae4e5fdf02ce32ed7 \ + --hash=sha256:d4c343b2a720741a016d720b255e75581a50e2bede61d53250484e18562a1d64 \ + --hash=sha256:d63737426a048a27705a4eedb828669f4bc0873612a1b46b0b9fe892b2ebaaaf \ + --hash=sha256:d6e081b466e88d4343adffe11aff0f02df34b5b9070b4b700053a0b7294c0be1 \ + --hash=sha256:d923cec43316f0e6736b8298fd00abeaaf348a091c20e7296b3aebceecb63eca \ + --hash=sha256:db599d03e7d60d15f2e0a11665c18bc52a88699fcab990fdf8cecd5be8ac801c \ + --hash=sha256:de95648e0a6d46fa9929b956ed2c87c5dc9933d4d59945e6390e9d753c74e7c1 \ + --hash=sha256:ea0714d2bccaf6d010c970e1d3ba2c9c2add79d2030aad2ef03167d788948276 \ + --hash=sha256:ec416d5d2ae689e681f5727e328723f18d8b5dc8c903a146b7851dc5727aad8a \ + --hash=sha256:ef8d5be90032261197ac388d945d8ff4f476c95880798a1911760af64ddfe71f \ + --hash=sha256:f44dd4c5ab22df21206dd926c98381ebdbf5bfd696df37dd38ded2d23143fcb6 \ + --hash=sha256:f9118a3f50de264b614861bb11814833a742138ac3c8e2e49a860b6977fb2704 +mypy-extensions==1.2.0 \ + --hash=sha256:993e7a20aa5671eb41a7132cf555af30062da99729601601b9a8382b11cae768 \ + --hash=sha256:c6e275a07f1c2fc096b62940452d0eaa3f3af7de45d704787866240a7c6d5a51 openapi-python-client==0.29.1 \ --hash=sha256:7e05c904fb4840c17b4a9fff05cc53dfd97d45b486d9462ffb7ecf9c98e67e25 \ --hash=sha256:9820490a2872dc56ce77ffbdea87f4562dae530a70a7207c66e39315ad20a89e @@ -187,145 +459,165 @@ packaging==26.3 \ pathspec==1.1.1 \ --hash=sha256:17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a \ --hash=sha256:a00ce642f577bf7f473932318056212bc4f8bfdf53128c78bbd5af0b9b20b189 -pluggy==1.6.0 \ - --hash=sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3 \ - --hash=sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746 -pydantic==2.13.5 \ - --hash=sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73 \ - --hash=sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08 -pydantic-core==2.46.5 \ - --hash=sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942 \ - --hash=sha256:03b9666e41e35d8909852ba191a0607520f81b74eaf12ccf8737005dbb313821 \ - --hash=sha256:045ab3b6d308439e32b81cc173bba5b9018bc6ed896afd0c65b3b009b1699af5 \ - --hash=sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c \ - --hash=sha256:0cdbada856a1c69a7624a64d3d9aefe79300bd6ef827b43a4f265010b9b55184 \ - --hash=sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2 \ - --hash=sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc \ - --hash=sha256:15f4a94963c95accac15b7b657bb177d3ad82bb90b0d0526d9a9b85079925db5 \ - --hash=sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0 \ - --hash=sha256:193375f3548919d3f0b60936ca113ada3e38f264f91b9b8e0508efaad57be931 \ - --hash=sha256:1a353f84de772f423b5ffb11d7ae352fbbef0f446f3c0b0af0f8236d7233606e \ - --hash=sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25 \ - --hash=sha256:1e5aad1220a1192c42341c8fd4a8686657e73ab2a920c970bdc4de334fe3193d \ - --hash=sha256:200aa3dc9f8d54f0754f43247c0bad0999fdcfbfd2488384dd44f37279271fe6 \ - --hash=sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47 \ - --hash=sha256:24922243639cbdac66c75fcb6fd6495a9cb52b213d62f9a0d16f0310b1ff8038 \ - --hash=sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8 \ - --hash=sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b \ - --hash=sha256:2cbd9a5eff05e51c447c34dfa4632145b26b09120cf04bd0c871e44c1a5e1c9a \ - --hash=sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e \ - --hash=sha256:2d5d76654becf5efd62c9e51c3756c67b49498b0c9a40884934c40807adbd074 \ - --hash=sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0 \ - --hash=sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433 \ - --hash=sha256:356c8368cbc321050b169595683a2e1d63413b1e0e2868b330af9fc14c616d3f \ - --hash=sha256:37ae34309d7bd8c0d61ab839668058f2a7962ea1fc51d105d2db228fe0618034 \ - --hash=sha256:37ea7b83c935e5b0d68c9449b82651accf78a10828b2c02b2f2d9e9496446c21 \ - --hash=sha256:3a3e26b6a8274211bddee2d0e4d0d42778f17a34510f49d2ec44b58abfc41736 \ - --hash=sha256:3aa166e99c4f2985407fb8714aebede877ecb5455cf321b606adca926d30d5a0 \ - --hash=sha256:3d2652072b2d774947ba5cf78a9e59644ac62ee572daf6dd2e1dfe905e15b2b7 \ - --hash=sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c \ - --hash=sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4 \ - --hash=sha256:46c25dda9d092a06c08db76ffe0a197107904d0dfac653f7d5306bbcd6d6119c \ - --hash=sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c \ - --hash=sha256:4d44cf99ddebf875f9b68cc267aa684c99b7b44fe63ee1cac4ec163807290069 \ - --hash=sha256:4dedce55295becb61921e386b99d4f2706045306e7fa52249a33004c837379fb \ - --hash=sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061 \ - --hash=sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29 \ - --hash=sha256:5086029a57366b8cf81b130a43908738095c270c21a8d7f0e8bdfdb89718e2f3 \ - --hash=sha256:52e24eacdb536cade636aa90fb851835222becff8484b7001fdc78cb0290f2aa \ - --hash=sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e \ - --hash=sha256:545f26c504b27c3758439a5e6d9349931f0a04f855668d5fe323c89e82300a38 \ - --hash=sha256:54d510bac3ee52247af28ed4bb18a1e799f040ac60fd2bf5ccd4c92f1fbe786f \ - --hash=sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b \ - --hash=sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8 \ - --hash=sha256:5ee239d575f80b08eca11f6e20f90c4c695de7825c67eefe6091fbf20dda648e \ - --hash=sha256:5f194189415698233dd1114a093a9b56e61e2c57e11b469be3b0506f46f0771c \ - --hash=sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be \ - --hash=sha256:657b40d6240c0a7b6a64b30f22d1e3aa631c7e846c621b0c0f6d1d75e2e15ea6 \ - --hash=sha256:6d30e1a4f138b8951063e9a394752a9179b51da288ffa507b1e659222f4c1793 \ - --hash=sha256:6f7b393a8b3da82f5c1fc0751e6d01ac6c55b93c18226a60bdfba4a724efafd1 \ - --hash=sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b \ - --hash=sha256:771cf63ae0b1b50dd22e5f3e3549fab5f3f4ff1635d352a9e1a97fe01c7b2e64 \ - --hash=sha256:79bdfa52f843137045b2d081cc05c120ba6665d29b7559c2c47690906f39279f \ - --hash=sha256:7ac031912d54f3d83ef3b3eb98dfabc1608802e2202263d25957eeed40b94761 \ - --hash=sha256:7b0fc826b16c55e561e5d2a0c5c77b051ba1d92808118c4e4b5390f5e0cf191d \ - --hash=sha256:7c6be839a5a8312626b32029a415644a0846b420bc8b52b95b28cd92da162168 \ - --hash=sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869 \ - --hash=sha256:82a36973cf8a2ef5406f4fe2edbf8ed0c99629535d959e0b100c76a32535a111 \ - --hash=sha256:837b396ca3d7b74091ca623f6cbd8351bd42d670a79c2683e79fb089f06a2de5 \ - --hash=sha256:850a08d167dde16db8702c274f320c7be9d7da6f6dff2b58b18f9e815bd94f5b \ - --hash=sha256:8816f3d218beb4b787de5c9759c259b8fa61f9dec42dc7811f320a33771778b7 \ - --hash=sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129 \ - --hash=sha256:895395f8918627b04efb1ad2a4cf605387143300ba03304cd1dfa6d03f5e095e \ - --hash=sha256:8b10e3e8fd7ddc2bd915848a2768e44c15b22936f1cc54c462ad1164deb02655 \ - --hash=sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c \ - --hash=sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec \ - --hash=sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689 \ - --hash=sha256:976e1128455aa595ea04c79ccfedff1aaeab96ee013fcc916bed120c4f0ad94f \ - --hash=sha256:978e7b97d4824b5be09c69fb70507cbde3b0323fc147332ca40a94d9a6a0ebbf \ - --hash=sha256:97bf8de4d541598c94a59344eeb988a94c08ff76b5723c41f6567ec18c7892ea \ - --hash=sha256:97cf3eb53a8cccacf9d46686a0926186c9bfb5574f2ed66d3639d5fe117cd3a9 \ - --hash=sha256:9b68938dd5b0c783d88ff8e2dcc69451b5eb936fe212d516b21b9d5567f6d464 \ - --hash=sha256:9c4b71f10dd532fb7a5cbc8f58707779e64f03a258c2bf8bfbaecfcd9970b519 \ - --hash=sha256:9f47b8a949e60f027f0aa0a6f6c7b7e9c55cbf4380d10b344e282fa4e7ab1e1b \ - --hash=sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f \ - --hash=sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee \ - --hash=sha256:a2a5e1d0ff29adddc9f6d6821a66302e4493f8ca898b715b6b1182c2c201ea0a \ - --hash=sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e \ - --hash=sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6 \ - --hash=sha256:a91c17edf6eea2402cb5457b4c89e99bc5ed1004aa34c4adf1d4258c1a5c22c2 \ - --hash=sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f \ - --hash=sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a \ - --hash=sha256:acf8a67ba51f4ca9ddbd0e6b3000a65ac51ab734661778b3e7ba64d99a710f2f \ - --hash=sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a \ - --hash=sha256:b49924c73a235e969511bf2aabdff3beebf9820931f646c80274d5d780010c47 \ - --hash=sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda \ - --hash=sha256:b7ca9034437b6022f941f4857459562ee00a560b97e7cce8a0ec5a74fc6766e0 \ - --hash=sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4 \ - --hash=sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d \ - --hash=sha256:bce57638e08ac148e5778cce7feb968307a727d66f8e2274a543d0cf0c9ad6a3 \ - --hash=sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2 \ - --hash=sha256:c1c43ad4339643d70ebb8124e1305a7dab423001eff58bb41a0f731adbc98355 \ - --hash=sha256:c3471e5c4a949c26ec00a77f01df59096aa9495877de76fd60a980f8ee6be461 \ - --hash=sha256:c583b927a8838dab890706a6fa7573fbb8b70e24000ef9f7238e2d6f6435a5ed \ - --hash=sha256:c76fe65e607be28c7fd4d56fc3c42b1583aa058ce3408b7ad0fd540171d31f9f \ - --hash=sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5 \ - --hash=sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2 \ - --hash=sha256:cdbb78909f52b981d3b2d56b97328d71eb0b974c36bd77c920123a7ebb192829 \ - --hash=sha256:cdc8b74ecc48c0cb1e9607a05ec4e9e88db60a19ffcc9a1d5f9088ede40c8dc0 \ - --hash=sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266 \ - --hash=sha256:d22a945598fb91236b4dd793a6e42e4f3dd7740bb5aace5ebd7d4c08d13bb575 \ - --hash=sha256:d2f9fc07a8042a8f95925b35c4f04f469707c981fc33245b6ca187cf5d2dd290 \ - --hash=sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f \ - --hash=sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62 \ - --hash=sha256:e64e88d5585bea9ce95861079de72006c7fa6d3df4e3a3b65ba31eb979c15c9f \ - --hash=sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a \ - --hash=sha256:e7b891faeedeafba41b2983e5001a81b6a915b69544c7e7570d1989ce1c36ac7 \ - --hash=sha256:e80675d75ae2cd14372cb65cad5400d9347a3d3f6c13000183f22dfd027283ed \ - --hash=sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f \ - --hash=sha256:eb7d8d0e5886a89a55d2eef490e272fa965a9d57c6b29a5b5088a7997ec2cad1 \ - --hash=sha256:ecb42011e12ee19cafbc312887cbf3546959fe02fbad44f272d4be5baa997615 \ - --hash=sha256:ef3fbbf161dc9351a2fe0422e51b129f9e97e42385bd0320b309c15f7d287dd8 \ - --hash=sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3 \ - --hash=sha256:f077d0b97ab11fa7dcc633fca53515f290bca8a8a633e966d5b6d1879d9ed01a \ - --hash=sha256:f332f0e72a5a0400141f830744e141bf9f97917878dbe968669e8a7fefea78ff \ - --hash=sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084 \ - --hash=sha256:fa10ef4112775900e7a0661068635eb67b2ab824fbde764de6e0e21982a93db0 \ - --hash=sha256:fc5d783bd4a2387e97b8a2d5ec781cfb92b3d893bf82370548e99db5915935d3 \ - --hash=sha256:fc8515076c11f3cfdf4fb142dcca0fe384b1230a3b5415458ac84f3e0903ec13 \ - --hash=sha256:ff218293c9c806138dca139765e3b067621be52bcd93cdc14c7711be7ddc90a9 +pluggy==1.7.0 \ + --hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \ + --hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8 +pydantic==2.14.3 \ + --hash=sha256:1054f237f4d4733e5a30e1e2333bd33a2004ab9ab1510bd053a9a31bb48e232d \ + --hash=sha256:3f7b347782ab7e4cf4c798496ae3a82787d9f21ec12676a9c564355eeef8daa8 +pydantic-core==2.50.4 \ + --hash=sha256:0001d6920e3a5d92758cda460d6dc9f918a78ad6d5d092f1c8b5395e6b775356 \ + --hash=sha256:0574866e05f6adeecc520d87e87dd06210c0a51706341f6ef8421572f5a64444 \ + --hash=sha256:09450778e3ab58d3f565899fcfbf6c82926e31af29e28e799d1d50941316e0cb \ + --hash=sha256:0af56dbf8822ba9f4efcbbfdc15478f8b6fb08f1609860cb50aa2cc8476b3c34 \ + --hash=sha256:0b059a7968b1911be5a2d9a8234827ab0bef9d1e465d4b42da525894143550e8 \ + --hash=sha256:0ec20aca2b067369913716847f7dfe5f4dddf16a46965b7a70bbad5defaaba86 \ + --hash=sha256:0f87ae9db5ba8d8de40dcb93982cf8dd544e6552a80d3345af51941cc2146b80 \ + --hash=sha256:1239daaf063e62213ca1f34d96663900bd7510c42a786e843fd328af70e46445 \ + --hash=sha256:13b6dd62b5279f5b9d72f3bf918a35443ee8bd549241d9dc52d79a2c3b6d7016 \ + --hash=sha256:15bece43a02ad543c621c8305e67dedb5f27d378c5ba741e5a2c36523f8ef37f \ + --hash=sha256:16902a147b3da4840612164a5e67947104d63e978f7a57c395877a5e26690b9c \ + --hash=sha256:1afefe44ec042fbabfb4483ea258c04cf75ff4ff328d754f09b321fdaa232aca \ + --hash=sha256:1de7be9a66fc8536770481ab64a05aae5067c725f2b29a09543af00e6a417b97 \ + --hash=sha256:1e20cbde2b6deb33a51d08cd168454dd9044ec7d4474056f4d98d63f51578783 \ + --hash=sha256:2039e323acee9abfec1fb5f661776e8965fe5928f3b7f8431900a774cba5c317 \ + --hash=sha256:219114f8dcdcbe4720d82ef016b1287ce5a0a67d7c69ca61524eb72e82aac344 \ + --hash=sha256:22e874666bdbd96d6bf629d32cd8ab376fedf1fd62585b52a42b9fa9fa6c20b6 \ + --hash=sha256:23a9ba564b2db709ff16eca990992ba95a19069972b34bff87c81d4b473cd755 \ + --hash=sha256:25e7e1080f9f7ce7cd9d114b31470ce912771bd02f38c824721d3c35d312abff \ + --hash=sha256:26cb012c4b8ca9f847bd0ac15978bd3d0f55b050bfbe6c47355edfc7e945029b \ + --hash=sha256:29358a8ca74e7d81158d14e2b10c904bd18773293ae3788716c0626fe0342347 \ + --hash=sha256:2980a701be88f9128a7470189fa3bcda5387f76c298a6f8e000fc29eb2a6f4e7 \ + --hash=sha256:2a60ec2a57ac3ef3767e526e9bf706ec75aa3d79c4ea134d9d4fcf7c62a297a7 \ + --hash=sha256:2f42584e5785385f681163a42506cab0d51295e17599a648396c52a7046c1372 \ + --hash=sha256:2f5cc5bcb94063fbbdfd285a2b302da34af07491337c10bb35de1d5220fa1583 \ + --hash=sha256:2f6767122b37c780bb756a720a4eef2bc6a050a0a1143428834b3cbc89448bd2 \ + --hash=sha256:300753f71c73302e218124baf995f00058e085cd01869bd9610bcbd0bd4500c1 \ + --hash=sha256:30d4dc35bc0eea52202a90b3820445ee0072c820241bfa710a623a078c9b267b \ + --hash=sha256:32a991aebd165f227b7c7c60bb9d66c2c7de9c24308552da264c9938fde0f8d6 \ + --hash=sha256:32d6dda86383645ec428ea64dfc277036f5cbc60a72238eab28b91a3fdb9a113 \ + --hash=sha256:33b21f69540a12c2053cd1d95766d8bd9667a3897f7c712a642de8aa37eb0865 \ + --hash=sha256:39f489ce31272073e6e146f6781690f9c1ee8c126836e6403361ef91154d89fe \ + --hash=sha256:3a48a5254d15a0ad050318bfc7a9566d4ec740118187e8f303e47a6840287eb7 \ + --hash=sha256:3b8ee2589a082739c522c1fe4be227412fcf108b903abb6672ae2f5570558882 \ + --hash=sha256:3de6c2a4df2af0ac9ab4dc1488746fe8b1a90e27955d870d9edda3187d20092b \ + --hash=sha256:3e0b395648c6cb871bceb2906907f255dc876ec425f2d5b024e129985cea8519 \ + --hash=sha256:3e547ceec1da7382f01f9e13963023e53367a71802c88778b21b9645a077cbdf \ + --hash=sha256:41b2cd8b29dbb5a4c9828a70f50d1abfc92011115c813213d3a91205c6f731b3 \ + --hash=sha256:41f4f8ae714e4fea1d635880f8a1af715ecf080eed4d13c5b04a0f3210f9c61a \ + --hash=sha256:474f7e598c7902165662a5d5160d3fce31037890a2975a9871ebf7c05862300b \ + --hash=sha256:477af785d1846e4e96bf56983b92ea7553aaeccdeb8acdaa55c7cee9eda0ae32 \ + --hash=sha256:49eb1241a969a5994db6880c18c012b6cbe2340343d8f529721571806583e500 \ + --hash=sha256:4c29b8f2d6417069bb1f257e6b9113f5d64dc2f554cc200ea90b4fe2c5cdb733 \ + --hash=sha256:4eb15be588407148ef5937dc8d9256a71f6b115e6cddadb7aa20b6ee384680dc \ + --hash=sha256:4eda7e3fdef382b7d4492745988a5baaf6953923a337f8b9dde5f76fa8afde20 \ + --hash=sha256:523466eba8ee10f7480f3c2057563145978011c583130d2cc01fb1e7af808e25 \ + --hash=sha256:57fa0a9490785139f1a4e4f43891830d55dfe4408845c0c9cb5eff4aeaf75f69 \ + --hash=sha256:5b26e5f1793b96cdc60242bf38da86ff24a27a708aa396214cac9b534bf571c7 \ + --hash=sha256:5bc1811ef2b4d4ba63e8e452f6e332b6374bd1d2cbbfdf66826c8cb1f71dd10d \ + --hash=sha256:5c074454dc6d4f6f4ba6561a56bf33a14db7651d882a5a5321ba3ae8868e082d \ + --hash=sha256:5c1013647be741647895c102831dcf79c34209662dbb683df9efb864417ed7d5 \ + --hash=sha256:601fce6cea9ddeaa85329e12e7f351def38d233075f42a3012b9c48071b02941 \ + --hash=sha256:6118e5a5550e36582e19bac1a403711a748f9f18251b054c326d3db02aaa7a18 \ + --hash=sha256:629eae995185540406e3635df5d5cf1d44f19ea240840b835d3f44541ff694d8 \ + --hash=sha256:6348ad12fa741bcc9c2f173e99fbf27cbc038826d8c31a4a7d836eca27878ba2 \ + --hash=sha256:65376dbe1ab4dbc768ca2b72b7c13993562c035f5925fd3bc7ff9c8c585c515d \ + --hash=sha256:6619d49a89a15cd04334f76fec530c155923bfc60da74ff5d815a52629e1aa6c \ + --hash=sha256:664e74848c2f5fc27db8505fe24e1ecd3ac669412913bf73d176916f86cc08e2 \ + --hash=sha256:67f7cc397e1d5556a801d1cba74de0d27d827eb242e6c036c0ca273c745414f1 \ + --hash=sha256:696613a0c0e7b2b35356e389ba4195ce20cfe7a2fc2e992c87d974d973eabec7 \ + --hash=sha256:6c5687b59b6ba0f663c4f2f15470f68507d6b45ccd3a19ee6d224f95cbee70d8 \ + --hash=sha256:6c7d7b0b596319e9ce79ef96ce57a14054a2eac629c0588a0539187a218be799 \ + --hash=sha256:70dbc9f83c41f37a4faa62dae5203853847223a891da446f48ef2efcfd5df806 \ + --hash=sha256:71395a43da5584bb70556f380387e15f845c0dcf76373c1afbfa0025737576ac \ + --hash=sha256:71ade6d2e445839350d589ff99bbddfde16f3f32db28da5c894a09f99c8b2a03 \ + --hash=sha256:71e03d2ea1a221d020cfc5b6cc8bbbedef23a06704c70fcf4d0afb42965b22d1 \ + --hash=sha256:7210398a1607ad607dc73196e575b3148b00a333cbb602ddbe1b60ba54554f43 \ + --hash=sha256:7472c39480ccc11dda69a196d1b7c7a6b48eb6594b77f05d945599d3e47f731c \ + --hash=sha256:7646353a5a7c553c04167aca628e2550b538f492765b03ccf34321a560acc43c \ + --hash=sha256:76e0065998159244ff4c097a6c05ff08019c6fbb6e597a85846e73044f0215b3 \ + --hash=sha256:789a6453e5ffd18a7ab6b8c3a0dd8403053829197ec258ecb90c604c21ffcc99 \ + --hash=sha256:789f88dea57841cdebef392b5d6e90444d767117e9ff2e0d9172df5c9de6690c \ + --hash=sha256:7ac2769a7ddd661e07e26c12220adc31b17014c48234b2a5a88993b8d4109e09 \ + --hash=sha256:817953730e4a73a09008b010c4a42396cefe799616a22df2ac21d3927b3080cf \ + --hash=sha256:83d2beac85b757bfc404c5c0612df51c4ef33bbb7be65cf4a96b4da7cbc4ff4f \ + --hash=sha256:86c7c4615634b5c57a79770f5b738354e45ae219a89949aeae84f19169a05283 \ + --hash=sha256:8923fcd49f875e8a0448d7223d1fdf1a9973ae2d1f20d4158753ceb8909facd2 \ + --hash=sha256:8cceae48ae7f94990c2f4e36291e9ec9868735e8b0f19e4489a17b0422338466 \ + --hash=sha256:92f8f63df729061bb14558ed740e7a222f6e2aa6c2e6a5bcfb4e706676562049 \ + --hash=sha256:930ad463d3fb7a340d323bcc496ec32dae469ec9974c29ff569f19806b6b03b4 \ + --hash=sha256:94733cb447c37b0ce6f71b39ca1288d5f966a084023a5617b4cc35a852586859 \ + --hash=sha256:9be1cfe715ecaa060ffd5d599ef410b94ef2697a0eed4cee562f788a2aa2175b \ + --hash=sha256:a0c5210d038418a115e7cf8706bfa611bd14add2f5787274dba45aadca3155e0 \ + --hash=sha256:a2f8716344bbbd10443391be0b1f2003b34949e3c4e6883005c2bc498ab6b64b \ + --hash=sha256:a4bb174bd65f795c39ad6642d9d5bdc43351b306b7d0a654ab0d0abb38be245f \ + --hash=sha256:a70d5effebd81ebd8e15a8aabdc7980832367b2b00c36543bac378977004cc80 \ + --hash=sha256:a9ee990bf2cfbd81574c5d4f9f6c9d480a14b5b43d2c4f2ca13f4c6f48089394 \ + --hash=sha256:ab2822bcdcefb54d1e8ca29f5e3ec3afe160fb794bb3a3a73b09d11ed2671104 \ + --hash=sha256:ad92d255a165cde5f9882ff69699eaf5495e0a1f32e97566bbbb80f11e46781f \ + --hash=sha256:aead3b74b68396bf0feab5d57e050b730ded7df55853c1e048a87e00aaf033c6 \ + --hash=sha256:aeb2e123cbf978a905e9f55155c1b8316fbbfa7cf64d04521fe174bab302d100 \ + --hash=sha256:aec3c2d741a8e3ee993de7f95f37afb51e31b169c95dbd29da4cf6688f340914 \ + --hash=sha256:b0cdb655fbd1562c2dfc9986f9103a106f7058cd0915afc6e656d4b1d73f3387 \ + --hash=sha256:b26f39a5be3cd91a2035818be3d0ffdf5282c3e1f5f53d3b80b7024021acee52 \ + --hash=sha256:b2f2d13239487cecaae98c9f4d5904ad0737643cdf8873c88ec6a78b12214f20 \ + --hash=sha256:b300a30304c4c6aeab03ed06809819d9eceacdd58441d3c7dffe41edfd006091 \ + --hash=sha256:b42f64825f5d750228f08318a9bf4d723b7ecb4c472aedcb3013c3ec2dc1f949 \ + --hash=sha256:b67d38e8bb0ade7e6e84575e4bb153fab35b122458077273aeb08fdf12be9d2c \ + --hash=sha256:b867f9fd183d76977f810c626d539265183c25b2284762893a31e8d6cacc81c0 \ + --hash=sha256:b99bed995ed7c41515c11fe2beb86f8a6cc298e5537cae2f736de2f982f74ef0 \ + --hash=sha256:bd46bcc28ed85d3cf71581b42d90b4ebd1f2062f81879519fed209f8a4d1cfc6 \ + --hash=sha256:bee28aab5a580eec673f7b68dfa8dece3dd37bd207ef8d22fafe23a8e9837296 \ + --hash=sha256:c04e9d920e2674f54651fd260a15c5d2843526c73d5242ee4311325ddc9573b3 \ + --hash=sha256:c4c5a1770ecfe8bdb6c6f09f8d81ea4de04f7efb012fac1efa4ad315dccc1fd1 \ + --hash=sha256:c733087ecf7dde06b1d071679bfd5f3ba03266ba77814c1c7253bc48c9adedd9 \ + --hash=sha256:c813ada7a651193acda85b6bc1cf12abd4b37cd25c7c6a75d7183512cc374969 \ + --hash=sha256:c81d98e27d9d9261909dcccab1ba5d6ea1c98b0bb9470e368604614fd1d36ddd \ + --hash=sha256:c81e35862aced259177a537ce1a6264c3a97bae1ced184ca9dc10ea754563688 \ + --hash=sha256:c856e439a9d54d514e81a7131229ba151cdf81df7c408e0f6c89340e5003dfe2 \ + --hash=sha256:c9e70012926e97069cdd09221861aff412aa94e4cac2e019055cdb79485b150c \ + --hash=sha256:ca83a32b2b41653d89f09a3d22b770bca96da72273bef8f7a68136bdd1e8b823 \ + --hash=sha256:cbf0777d54672990b10cb8ca9b0523499e182d7e2ea39f86b138519a902aa601 \ + --hash=sha256:d49127f137f871cde3c5650af33bbbdcee02679dae76e020902fa106f522b8ae \ + --hash=sha256:d690121e80ab16e623415351ab24713534d4e500b3cadff216409cb6826063d4 \ + --hash=sha256:d6a166978f22f10cb91413f70519861605219346decf65bc79008f9257c94afe \ + --hash=sha256:d6e3485a5e5c01fb5339c1ee3d4b9e21e2135a2a9d44caafb71acd994487ee7c \ + --hash=sha256:d7d406709ae924cf0b08b8282ca2f0e1c90526911d93bc040557cbc83b74c55f \ + --hash=sha256:d8201c9f9035520cdcc7dcad383b039ec8123969b87e01cf27c3dd883c02313b \ + --hash=sha256:da779ae50b46f3f7d1e1b5f362fdc0ad376a49fd55f6f3122dc2b6149936cdf7 \ + --hash=sha256:dcf2c7eaaa4cafe8e49b017e5bb49e76e084ab6f0cd712ee4019c812b5cf68b8 \ + --hash=sha256:dd8bed00731a21e3106e5dd6bbffb6c775a2c0bbc7c0c9face534d830057bdc9 \ + --hash=sha256:df1c174796cd63eb6b139f7daf783affe1f3ed659605850e843b24764c21bfc5 \ + --hash=sha256:dfcf6e51000b34f7026322cd9ea9bc340d745637e27e0bbc22f504b4f6b967ee \ + --hash=sha256:e498900bfbf7ddddd862f810440c09e9b81674739e8a11d619b40906dccd4a9a \ + --hash=sha256:e512c75ec5cf4475c1aa50ad975ecdf253f4963b06e152e1a11edd6de4010753 \ + --hash=sha256:e5bd109d095aaae989a0463d5ef0fcc43e9ddd5de125e656d3c119a79e466380 \ + --hash=sha256:e6b4b08d09054310a4dc389fa61ee22a7a5a292cb23ab8a985136ca8828bf924 \ + --hash=sha256:e6da138a1ecc1341c8b788a5ee822670b03788e1f5decf7af9d461de6e508b8e \ + --hash=sha256:ea2f61b0bc12f3592288503961b764579dea0658852d96a0b3d823614d808821 \ + --hash=sha256:ed9c0b6f236648dbf30d57e9f57e1f74878caafa04833a19f529b5ba5164b7a8 \ + --hash=sha256:edbca8789fd10f0de534b660a6b4c71f1fd18039679c918dad392ab044bb37e4 \ + --hash=sha256:edc17549ab592e33cfcaf285f047bb75fcd98f608aa9309af1187fd736ce9641 \ + --hash=sha256:ef8a9ddb2e2a4eae4abb72dc0710eca6c2726779b0664bd10c3ce9fcfaed8c4e \ + --hash=sha256:f08ee8248aad2d054e5bc4c73554d4505464698f6d754f16198dbc5764e9821d \ + --hash=sha256:f1d62fb172db35c6478c9323da34ff37d1f3d37d7d44337a9d94ba8c583e5730 \ + --hash=sha256:f8fd23653a252cefabea11cd041efd7b80bdf403e43a36dea53f9cb0aaa21f0f \ + --hash=sha256:faa4e96385c820ce9d7f7a623486e23d4134ae3c9ba2071e44e0ab5a5a5002c4 \ + --hash=sha256:fb2bb5b557080da398b866408117d98fe9731a12334afd0cdff221b458cdc5dc \ + --hash=sha256:fc04affef30be98c1f36f0c422a4061ef618fdc1dde79f5ad5458dd496fecffa \ + --hash=sha256:ffb616d8d55965839670301dc3bae3abacff560a7e137a89056058a8a9da4d96 pygments==2.21.0 \ --hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \ --hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c pyproject-hooks==1.3.3 \ --hash=sha256:5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b \ --hash=sha256:defda19b854fa0d3bd4f76ea4ddcba8abd7dcfcdd585a6690ade050744fc5f43 -pytest==8.4.2 \ - --hash=sha256:86c0d0b93306b961d58d62a4db4879f27fe25513d4b969df351abdddb3c30e01 \ - --hash=sha256:872f880de3fc3a5bdc88a11b39c9710c3497a547cfa9320bc3c5e62fbf272e79 -pytest-asyncio==1.2.0 \ - --hash=sha256:8e17ae5e46d8e7efe51ab6494dd2010f4ca8dae51652aa3c8d55acf50bfb2e99 \ - --hash=sha256:c609a64a2a8768462d0c99811ddb8bd2583c33fd33cf7f21af1c142e824ffb57 +pytest==9.2.0 \ + --hash=sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588 \ + --hash=sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b +pytest-asyncio==1.5.0 \ + --hash=sha256:557f255ee03cc84f84a8d5f438bc9c6e0f714bf86970ae743c7ecb5a38d7e07d \ + --hash=sha256:92c8fa83ca419fd0d4bd6a34df6520dae435841d3733c319343249492adf37f7 python-dateutil==2.9.0.post0 \ --hash=sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3 \ --hash=sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427 @@ -335,32 +627,34 @@ rich==15.0.0 \ ruamel-yaml==0.19.1 \ --hash=sha256:27592957fedf6e0b62f281e96effd28043345e0e66001f97683aa9a40c667c93 \ --hash=sha256:53eb66cd27849eff968ebf8f0bf61f46cdac2da1d1f3576dd4ccee9b25c31993 -ruff==0.14.3 \ - --hash=sha256:0e2f8a0bbcffcfd895df39c9a4ecd59bb80dca03dc43f7fb63e647ed176b741e \ - --hash=sha256:1ec1ac071e7e37e0221d2f2dbaf90897a988c531a8592a6a5959f0603a1ecf5e \ - --hash=sha256:26eb477ede6d399d898791d01961e16b86f02bc2486d0d1a7a9bb2379d055dc1 \ - --hash=sha256:3d6bc90307c469cb9d28b7cfad90aaa600b10d67c6e22026869f585e1e8a2db0 \ - --hash=sha256:469e35872a09c0e45fecf48dd960bfbce056b5db2d5e6b50eca329b4f853ae20 \ - --hash=sha256:4ff876d2ab2b161b6de0aa1f5bd714e8e9b4033dc122ee006925fbacc4f62153 \ - --hash=sha256:678fdd7c7d2d94851597c23ee6336d25f9930b460b55f8598e011b57c74fd8c5 \ - --hash=sha256:71ff6edca490c308f083156938c0c1a66907151263c4abdcb588602c6e696a14 \ - --hash=sha256:786ee3ce6139772ff9272aaf43296d975c0217ee1b97538a98171bf0d21f87ed \ - --hash=sha256:7bfc42f81862749a7136267a343990f865e71fe2f99cf8d2958f684d23ce3dfa \ - --hash=sha256:876b21e6c824f519446715c1342b8e60f97f93264012de9d8d10314f8a79c371 \ - --hash=sha256:a497ec0c3d2c88561b6d90f9c29f5ae68221ac00d471f306fa21fa4264ce5fcd \ - --hash=sha256:a65e448cfd7e9c59fae8cf37f9221585d3354febaad9a07f29158af1528e165f \ - --hash=sha256:afcdc4b5335ef440d19e7df9e8ae2ad9f749352190e96d481dc501b753f0733e \ - --hash=sha256:b6fd8c79b457bedd2abf2702b9b472147cd860ed7855c73a5247fa55c9117654 \ - --hash=sha256:cd6291d0061811c52b8e392f946889916757610d45d004e41140d81fb6cd5ddc \ - --hash=sha256:d7b7006ac0756306db212fd37116cce2bd307e1e109375e1c6c106002df0ae5f \ - --hash=sha256:e231e1be58fc568950a04fbe6887c8e4b85310e7889727e2b81db205c45059eb \ - --hash=sha256:f3d91857d023ba93e14ed2d462ab62c3428f9bbf2b4fbac50a03ca66d31991f7 +ruff==0.17.5 \ + --hash=sha256:0e5c125c5b31dc8efc948d41357496a4c4a312977565ccba740030efdff83580 \ + --hash=sha256:40ca8afaac309b41a5b2e09e4e7beb1f824826b93c25697c4d74f573324fba4e \ + --hash=sha256:50dfc3c6b3ebd0a932f11dfd579bd42234b0b7137e68940eb6abdbfdb9d69697 \ + --hash=sha256:54c0f67d1be11b55d12c184a819fc229f5eee3ef45c16c4fcad41258e83b4882 \ + --hash=sha256:625e57d80cd43352d12ea81690f3eac46cddc8c0f35026d137fb0f157f94592e \ + --hash=sha256:64a6fd668a336df959c522991de33e9e3c8be463afc0c9ac8f029f9d19ef756e \ + --hash=sha256:6f0db748508f04a04e3fbebcc636a5c8b3bd76274f8ed28f497c44d75c2ea2d7 \ + --hash=sha256:6f6a7b138edf9cc402ca736a59d9525e6d766e5395760b72e7e146e6251ac963 \ + --hash=sha256:86bd1f3b83c25f9b8055c6e796f0685b39d3127ce947322098c3108cf82fd586 \ + --hash=sha256:8e85601bd6d9b6c3e3b95c0e0dccdbac1d23c6bcef006d187fbcddaf8225a5df \ + --hash=sha256:aa415d57c244299279901d776607fee3df7831c2a7435433fbfacde8632c6550 \ + --hash=sha256:b72fbc232e328bdbb9cdddf4f1aedcd61bd1aa64d75fc012114b4add0bd7f26b \ + --hash=sha256:d511dd302982e46a285528942fa6557d57730edc4bdb9def95e86a2603d77396 \ + --hash=sha256:dd0dfe7c6fe5a447fce467c58e69893be1d9a7e4378f5b9906432da33d94a97f \ + --hash=sha256:e1546609b2ad73f1d6c5c076881b788672b7b3cc3283981182cbdbb6524ed88a \ + --hash=sha256:e52622ecf3a0df9d03e796fe3eed4aa085adda65520db7e0619cbd2192a97342 \ + --hash=sha256:ec4ecf40fb4d6e1265b009dbe551727920926fc0f769070c452d6d84b422a74d \ + --hash=sha256:f93d2b7d449ed9545304f6923699ca20d13c675b69f258481709a08ae61076db shellingham==1.5.4 \ --hash=sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686 \ --hash=sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de six==1.17.0 \ --hash=sha256:4721f391ed90541fddacab5acf947aa0d3dc7d27b2e1e8eda2be8970586c3274 \ --hash=sha256:ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81 +tomlkit==0.15.2 \ + --hash=sha256:05562412163a3037b94497385fb7f9204c637bc605af7a48199e41cf2272f437 \ + --hash=sha256:83e32755ba1d20d9340bd069ee97e9f6232ba2346b63ffcba425de01f7e327a6 trove-classifiers==2026.9.21.13 \ --hash=sha256:0a9ebc8d4e2f3e8a22848c5258033035bec17a3012ac3fea16dbaa764489eb71 \ --hash=sha256:8b1ff4f9c191b1040b71c37f1e445ab99732911e3cd91de52838453a854d7a17 @@ -370,6 +664,6 @@ typer==0.27.2 \ typing-extensions==4.16.0 \ --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 -typing-inspection==0.4.4 \ - --hash=sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47 \ - --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 +typing-inspection==0.4.5 \ + --hash=sha256:7f16c411e7930dc79596d42ab44672a3fe5f60eb34b781a1647e7872363120c7 \ + --hash=sha256:bc210535442b39e1bf2805e0c7a17dfd6a4ace760c84c7f7d16245d23a6b1c39 diff --git a/scripts/_uv.py b/scripts/_uv.py index 76a07aff..1eb82687 100644 --- a/scripts/_uv.py +++ b/scripts/_uv.py @@ -1,4 +1,4 @@ -"""Use uv 0.10.12, verifying the official release archive before execution.""" +"""Use uv 0.13.7, verifying the official release archive before execution.""" from __future__ import annotations @@ -11,13 +11,13 @@ from pathlib import Path from urllib.request import urlopen -VERSION = "0.10.12" -# https://github.com/astral-sh/uv/releases/tag/0.10.12 +VERSION = "0.13.7" +# https://github.com/astral-sh/uv/releases/tag/0.13.7 CHECKSUMS = { - "aarch64-apple-darwin": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", - "x86_64-apple-darwin": "17443e293f2ae407bb2d8d34b875ebfe0ae01cf1296de5647e69e7b2e2b428f0", - "aarch64-unknown-linux-gnu": "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", - "x86_64-unknown-linux-gnu": "ec72570c9d1f33021aa80b176d7baba390de2cfeb1abcbefca346d563bf17484", + "aarch64-apple-darwin": "81b811b57e4624df7ed3aac148e0359100d9962f3d9dce00aec533dc2e086731", + "x86_64-apple-darwin": "20c47e4c1f630b8abaff8c291fa9b9aa300fef92c4fbff95adf198b55287cda7", + "aarch64-unknown-linux-gnu": "71279f8d3c67241e807b9d8db872d1bf541579fb9f08b7d1eb1682196d1e57dc", + "x86_64-unknown-linux-gnu": "c5221ff41b7892bfc223543883600125f6a47fe845093e0f5bdff4f359196d83", } @@ -41,7 +41,7 @@ def executable(tools: Path) -> Path: system = {"Darwin": "apple-darwin", "Linux": "unknown-linux-gnu"}.get(platform.system()) target = f"{architecture}-{system}" if target not in CHECKSUMS: - raise SystemExit("Install uv 0.10.12 to run the gate on this bootstrap platform.") + raise SystemExit("Install uv 0.13.7 to run the gate on this bootstrap platform.") tools.mkdir(parents=True, exist_ok=True) archive = tools / f"uv-{VERSION}-{target}.tar.gz" if not archive.exists(): diff --git a/scripts/contracts.py b/scripts/contracts.py index e681909c..d34ba64a 100644 --- a/scripts/contracts.py +++ b/scripts/contracts.py @@ -4,9 +4,10 @@ import ast import json +import sys from pathlib import Path -from generate import json_operations +from generate import HTTP_METHODS, json_operations ROOT = Path(__file__).resolve().parents[1] @@ -17,34 +18,27 @@ def main() -> None: operation["operationId"] for item in json_operations(document)["paths"].values() for method, operation in item.items() - if method in {"get", "post", "put", "patch", "delete"} + if method in HTTP_METHODS } generated = { path.stem - for path in (ROOT / "proofline/_generated/api/default").glob("*.py") + for path in (ROOT / "proofline/_generated/api").glob("*/*.py") if path.name != "__init__.py" } - if declared != generated or len(declared) != 21: - raise SystemExit( - "The generated JSON operations must match the twenty-one public JSON token routes." - ) - tree = ast.parse((ROOT / "proofline/client.py").read_text()) - helpers = {"close", "aclose", "iter_reviews", "wait_for_review"} - clients = { - node.name: { - member.name - for member in node.body - if isinstance(member, (ast.FunctionDef, ast.AsyncFunctionDef)) - and not member.name.startswith("_") - and member.name not in helpers + if declared != generated: + raise SystemExit("Generated JSON operations differ from the public contract.") + sys.path.insert(0, str(ROOT)) + from proofline import AsyncProoflineClient, ProoflineClient + + for client in (ProoflineClient, AsyncProoflineClient): + helpers = {"close", "aclose", "iter_reviews", "wait_for_review"} + exposed = { + name + for name in dir(client) + if not name.startswith("_") and name not in helpers and callable(getattr(client, name)) } - for node in tree.body - if isinstance(node, ast.ClassDef) - and node.name in {"ProoflineClient", "AsyncProoflineClient"} - } - public = declared | {"export_reviews"} - if clients != {"ProoflineClient": public, "AsyncProoflineClient": public}: - raise SystemExit("Both client facades must expose the JSON operations and metadata export.") + if exposed != declared | {"export_reviews"}: + raise SystemExit(f"{client.__name__} operations differ from the public contract.") prohibited = {"safe", "passed", "clean"} for path in (ROOT / "proofline").rglob("*.py"): for node in ast.walk(ast.parse(path.read_text())): diff --git a/scripts/generate.py b/scripts/generate.py index 4f246ea8..0e3d4321 100644 --- a/scripts/generate.py +++ b/scripts/generate.py @@ -3,9 +3,9 @@ from __future__ import annotations import argparse +import ast import importlib.metadata import json -import os import shutil import subprocess import sys @@ -14,10 +14,11 @@ from pathlib import Path VERSION = "0.29.1" -RUFF_VERSION = "0.14.3" +RUFF_VERSION = "0.17.5" ROOT = Path(__file__).resolve().parents[1] DOCUMENT = ROOT / "openapi.public.json" OUTPUT = ROOT / "proofline" / "_generated" +HTTP_METHODS = {"get", "put", "post", "delete", "options", "head", "patch", "trace"} def json_operations(document: dict) -> dict: @@ -26,6 +27,8 @@ def json_operations(document: dict) -> dict: for path, item in document["paths"].items(): operations = {} for method, operation in item.items(): + if method not in HTTP_METHODS: + continue success: dict = next( ( response @@ -73,7 +76,7 @@ def json_operations(document: dict) -> dict: raise SystemExit("JSON convenience generation requires a named JSON response") operations[method] = operation if operations: - paths[path] = operations + paths[path] = {**{k: v for k, v in item.items() if k not in HTTP_METHODS}, **operations} return {**document, "paths": paths} @@ -82,45 +85,65 @@ def generate(destination: Path) -> None: raise SystemExit(f"Generation requires openapi-python-client=={VERSION}.") if importlib.metadata.version("ruff") != RUFF_VERSION: raise SystemExit(f"Generation requires ruff=={RUFF_VERSION}.") - version = tomllib.loads((ROOT / "pyproject.toml").read_text())["project"]["version"] document = json.loads(DOCUMENT.read_text()) + with tempfile.TemporaryDirectory(prefix="proofline-json-contract-") as temporary: + json_document = Path(temporary) / "openapi.json" + json_document.write_text(json.dumps(json_operations(document))) + generate_json(destination, json_document) + + +def check_version() -> None: + document = json.loads(DOCUMENT.read_text()) + version = tomllib.loads((ROOT / "pyproject.toml").read_text())["project"]["version"] package_version = tuple(map(int, version.split("."))) api_version = tuple(map(int, document["info"]["version"].split("."))) if package_version[:2] != api_version[:2] or package_version[2] < api_version[2]: raise SystemExit( "The SDK must follow the public API major/minor and not precede its patch." ) - env = dict(os.environ) - env["PATH"] = str(Path(sys.executable).parent) + os.pathsep + env.get("PATH", "") - with tempfile.TemporaryDirectory(prefix="proofline-json-contract-") as temporary: - json_document = Path(temporary) / "openapi.json" - json_document.write_text(json.dumps(json_operations(document))) - generate_json(destination, json_document, env) -def generate_json(destination: Path, document: Path, env: dict) -> None: - subprocess.run( - [ - sys.executable, - "-c", - "from openapi_python_client.cli import app; app()", - "generate", - "--path", - str(document), - "--config", - str(ROOT / "generator.json"), - "--custom-template-path", - str(ROOT / "templates"), - "--meta", - "none", - "--fail-on-warning", - "--output-path", - str(destination), - ], - check=True, - cwd=ROOT, - env=env, +def generate_json(destination: Path, document: Path) -> None: + from openapi_python_client import Config, GeneratorData, GeneratorError, MetaType, Project + from openapi_python_client.config import ConfigFile + + config = Config.from_sources( + ConfigFile.load_from_path(ROOT / "generator.json"), + MetaType.NONE, + document, + "utf-8", + False, + destination, + ) + data = GeneratorData.from_dict(json.loads(document.read_bytes()), config=config) + if isinstance(data, GeneratorError): + raise SystemExit(data) + project = Project(openapi=data, config=config, custom_template_path=ROOT / "templates") + if errors := project.build(): + raise SystemExit(errors) + + # Existing public adapters keep their signatures, pagination and stream behavior. + clients = ast.parse((ROOT / "proofline/client.py").read_bytes()) + custom = { + cls.name: { + method.name + for method in cls.body + if isinstance(method, (ast.FunctionDef, ast.AsyncFunctionDef)) + } + for cls in clients.body + if isinstance(cls, ast.ClassDef) + } + endpoints = [ + (tag, endpoint) + for tag, group in sorted(data.endpoint_collections_by_tag.items()) + for endpoint in sorted(group.endpoints, key=lambda operation: operation.name) + ] + facade = project.env.get_template("operations.py.jinja").render( + endpoints=endpoints, + sync=custom["ProoflineClient"], + asynchronous=custom["AsyncProoflineClient"], ) + (destination / "api/operations.py").write_text(facade) body = json.loads(document.read_text())["paths"][ "/api/v1/organizations/{org_id}/repositories/{repo_id}/pull-requests/{number}/review" ]["post"].get("requestBody") @@ -184,6 +207,7 @@ def main() -> None: generated = Path(temporary) / "generated" generate(generated) if args.check: + check_version() if files(generated) != files(OUTPUT): raise SystemExit("The generated Python API differs; run scripts/generate.py.") else: diff --git a/scripts/install_smoke.py b/scripts/install_smoke.py index 541f2ef3..3509074c 100644 --- a/scripts/install_smoke.py +++ b/scripts/install_smoke.py @@ -9,24 +9,27 @@ import threading from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer from pathlib import Path +from urllib.parse import parse_qs, urlsplit from uuid import UUID import proofline -from proofline import AsyncProoflineClient, ProoflineClient, SecretStr +from proofline import AsyncProoflineClient, ProoflineClient, ReviewFilters, SecretStr ORG = UUID("00000000-0000-4000-8000-000000000001") REVIEW = UUID("00000000-0000-4000-8000-000000000002") ASSESSMENT = UUID("00000000-0000-4000-8000-000000000003") FINDING = UUID("00000000-0000-4000-8000-000000000004") TOKEN = "pln_synthetic_installed_package_token" +QUERY = '(status:COMPLETED OR status:FAILED) AND -author:"release bot"' def main() -> None: if not Path(proofline.__file__).resolve().is_relative_to(Path(sys.prefix).resolve()): raise SystemExit("The smoke test must import the installed artifact, not checkout source.") - assert importlib.metadata.version("proofline-sdk") == "1.0.3" - assert proofline.__version__ == "1.0.3" + package_version = importlib.metadata.version("proofline-sdk") + assert proofline.__version__ == package_version calls: list[str] = [] + filters: ReviewFilters = {"query": QUERY} finding = { "id": str(FINDING), "severity": "HIGH", @@ -79,9 +82,21 @@ def log_message(self, format: str, *args: object) -> None: def do_GET(self) -> None: assert self.headers["Authorization"] == f"Bearer {TOKEN}" - assert self.headers["User-Agent"] == "proofline-python/1.0.3" + assert self.headers["User-Agent"] == f"proofline-python/{package_version}" calls.append(self.path) body = finding if "/findings/" in self.path else review + path = urlsplit(self.path) + if path.path in ( + f"/api/v1/organizations/{ORG}/reviews", + f"/api/v1/organizations/{ORG}/reviews/pr/repo%2Fname/42", + ): + assert parse_qs(path.query)["query"] == [QUERY] + assert "search" not in parse_qs(path.query) + body = { + "filters": {"repositories": [], "environments": [], "authors": []}, + "items": [], + "truncated": False, + } payload = json.dumps(body).encode() self.send_response(200) self.send_header("Content-Type", "application/json") @@ -96,6 +111,10 @@ def do_GET(self) -> None: async def asynchronous() -> None: async with AsyncProoflineClient(SecretStr(TOKEN), base_url=url) as client: + assert (await client.list_reviews(ORG, query=QUERY)).items == [] + history = await client.list_pull_request_reviews(ORG, "repo/name", 42, filters=filters) + assert history.items == [] + assert [item async for item in client.iter_reviews(ORG, filters=filters)] == [] assert (await client.get_finding(ORG, FINDING)).id == FINDING result = await client.wait_for_review(ORG, REVIEW, timeout=2) assert result.status == "INCOMPLETE" @@ -104,13 +123,17 @@ async def asynchronous() -> None: try: with ProoflineClient(SecretStr(TOKEN), base_url=url) as client: + assert client.list_reviews(ORG, query=QUERY).items == [] + history = client.list_pull_request_reviews(ORG, "repo/name", 42, filters=filters) + assert history.items == [] + assert list(client.iter_reviews(ORG, filters=filters)) == [] assert client.get_finding(ORG, FINDING).id == FINDING result = client.wait_for_review(ORG, REVIEW, timeout=2) assert result.status == "INCOMPLETE" assert result.gaps[0].reason_codes[0] == "WORLD_UNAVAILABLE" assert TOKEN not in repr(client) asyncio.run(asynchronous()) - assert len(calls) == 4 + assert len(calls) == 10 finally: server.shutdown() server.server_close() diff --git a/scripts/release-files.py b/scripts/release-files.py new file mode 100644 index 00000000..4077e7b9 --- /dev/null +++ b/scripts/release-files.py @@ -0,0 +1,81 @@ +"""Verify PyPI release files and select the missing distributions for publication.""" + +import argparse +import hashlib +import json +import re +import shutil +import sys +import time +import urllib.error +import urllib.request +from pathlib import Path + +PACKAGE = "proofline-sdk" +# PyPI's CDN caches the version page for up to 15 minutes (Cache-Control: max-age=900), +# so a page fetched before or during the upload can stay stale that long. +PROPAGATION_SECONDS = 20 * 60 +POLL_SECONDS = 30 + + +def published(version: str) -> dict[str, str]: + try: + url = f"https://pypi.org/pypi/{PACKAGE}/{version}/json" + with urllib.request.urlopen(url, timeout=30) as response: + release = json.load(response) + except urllib.error.HTTPError as error: + if error.code == 404: + return {} + raise + if release["info"]["name"] != PACKAGE or release["info"]["version"] != version: + raise ValueError("PyPI returned a different distribution") + return {file["filename"]: file["digests"]["sha256"] for file in release["urls"]} + + +def missing(expected: dict[str, str], released: dict[str, str]) -> list[str]: + for name, digest in released.items(): + if expected.get(name) != digest: + raise ValueError(f"PyPI has unexpected content for {name}") + return sorted(expected.keys() - released.keys()) + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("version") + parser.add_argument("artifacts", type=Path) + parser.add_argument("--pending", type=Path, help="copy only missing files to a new directory") + args = parser.parse_args() + if not re.fullmatch(r"(0|[1-9][0-9]*)(\.(0|[1-9][0-9]*)){2}", args.version): + raise ValueError("expected a stable package version") + files = sorted(args.artifacts.iterdir()) + prefix = f"proofline_sdk-{args.version}" + if {file.name for file in files} != {prefix + ".tar.gz", prefix + "-py3-none-any.whl"}: + raise ValueError("expected the wheel and source distribution for this version") + expected = {file.name: hashlib.sha256(file.read_bytes()).hexdigest() for file in files} + if args.pending: + names = missing(expected, published(args.version)) + args.pending.mkdir() + for name in names: + shutil.copyfile(args.artifacts / name, args.pending / name) + print(len(names)) + return + deadline = time.monotonic() + PROPAGATION_SECONDS + while True: + try: + names = missing(expected, published(args.version)) + except OSError as error: + # A server error, timeout or dropped connection means PyPI does not serve it yet. + if isinstance(error, urllib.error.HTTPError) and error.code < 500: + raise + problem = f"PyPI lookup failed: {error}" + else: + if not names: + return + problem = "PyPI is missing " + ", ".join(names) + if time.monotonic() >= deadline: + sys.exit(problem) + time.sleep(POLL_SECONDS) + + +if __name__ == "__main__": + main() diff --git a/templates/operations.py.jinja b/templates/operations.py.jinja new file mode 100644 index 00000000..d7e36887 --- /dev/null +++ b/templates/operations.py.jinja @@ -0,0 +1,45 @@ +"""Typed methods generated from the public operations without custom adapters.""" + +from typing import Any, cast +from ..client import AuthenticatedClient +from ..types import UNSET, Unset +from ... import _transport +{% from "endpoint_macros.py.jinja" import arguments, kwargs %} +{% for tag, endpoint in endpoints %} +{% if endpoint.name not in sync or endpoint.name not in asynchronous %} +from .{{ tag }} import {{ endpoint.name }} as operation_{{ endpoint.name }} +{% for line in endpoint.relative_imports | sort %} +{{ line | replace("from ...", "from ..") }} +{% endfor %} +{% endif %} +{% endfor %} + +{% for prefix, function, custom in [("", "sync_detailed", sync), ("Async", "asyncio_detailed", asynchronous)] %} +class {{ prefix }}Operations: + _api: AuthenticatedClient + +{% for tag, endpoint in endpoints if endpoint.name not in custom %} +{% set success = namespace(types=[], statuses=[]) %} +{% for response in endpoint.responses.patterns %} +{% if 200 <= response.status_code.range[0] and response.status_code.range[1] < 300 %} +{% set success.types = success.types + [response.prop.get_type_string() | as_unembedded_code] %} +{% set lo, hi = response.status_code.range %} +{% set check = ("response.status_code == " ~ lo) if lo == hi else (lo ~ " <= response.status_code <= " ~ hi) %} +{% set success.statuses = success.statuses + [check] %} +{% endif %} +{% endfor %} +{% set result = success.types | unique | join(" | ") %} + {{ "async " if prefix else "" }}def {{ endpoint.name }}(self, + {{ arguments(endpoint, include_client=False) | indent(8) }} + ) -> {{ result }}: + with _transport.operation_errors(): + response = {{ "await " if prefix else "" }}operation_{{ endpoint.name }}.{{ function }}( + client=self._api, + {{ kwargs(endpoint, include_client=False) | indent(16) }} + ) + if not ({{ success.statuses | join(" or ") }}): + raise _transport.invalid_response() + return cast({{ result }}, response.parsed) + +{% endfor %} +{% endfor %} diff --git a/tests/fixtures/review-outcomes.json b/tests/fixtures/review-outcomes.json new file mode 100644 index 00000000..4a0eccb4 --- /dev/null +++ b/tests/fixtures/review-outcomes.json @@ -0,0 +1,1965 @@ +{ + "cases": [ + { + "name": "review-pending", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "PENDING", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": null, + "gaps": [] + }, + { + "name": "review-running", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "RUNNING", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": null, + "gaps": [] + }, + { + "name": "review-completed", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "review-incomplete", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "INCOMPLETE", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["REVIEW_STATE_UNAVAILABLE"] + } + ] + }, + { + "name": "review-failed", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "FAILED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "FAILED", + "gaps": [] + }, + { + "name": "review-superseded", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "SUPERSEDED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "STOPPED", + "gaps": [] + }, + { + "name": "review-stopped", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "STOPPED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "STOPPED", + "gaps": [] + }, + { + "name": "review-excluded", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "EXCLUDED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["REVIEW_STATE_UNAVAILABLE"] + } + ] + }, + { + "name": "review-future_review", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "FUTURE_REVIEW", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["REVIEW_STATE_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-pending", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "PENDING", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-running", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "RUNNING", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-incomplete", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "INCOMPLETE", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-failed", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "FAILED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-stopped", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "STOPPED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-superseded", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "SUPERSEDED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-excluded", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "EXCLUDED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["ASSESSMENT_RESULT_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-future_assessment", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "FUTURE_ASSESSMENT", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["UNKNOWN_ASSESSMENT_STATUS"] + } + ] + }, + { + "name": "absent-check-receipt", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": false, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["CHECK_RECEIPT_ABSENT"] + } + ] + }, + { + "name": "unresolved-check-receipt", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "UNRESOLVED", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["CHECKS_UNRESOLVED"] + } + ] + }, + { + "name": "unknown-check-status", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "FUTURE_CHECK", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["CHECKS_UNRESOLVED"] + } + ] + }, + { + "name": "check-gating-unresolved", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [ + { + "name": "example", + "outcome": "UNRESOLVED", + "lifecycle": "GATING", + "files": [] + } + ] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["CHECKS_UNRESOLVED"] + } + ] + }, + { + "name": "check-shadow-blocked", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [ + { + "name": "example", + "outcome": "BLOCKED", + "lifecycle": "SHADOW", + "files": [] + } + ] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "evidence-gap", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + }, + "release_evidence_gap": "RELEASE_SET_UNAVAILABLE" + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["RELEASE_SET_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-kind", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + }, + "incompleteness_kind": "EVIDENCE_UNAVAILABLE" + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": ["EVIDENCE_UNAVAILABLE"] + } + ] + }, + { + "name": "combined-gaps", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": false, + "status": "READY", + "families": [] + }, + "reason_codes": ["OUT_OF_CREDITS"], + "incompleteness_kind": "MODEL_BUDGET_EXHAUSTED", + "release_evidence_gap": "RELEASE_SET_UNAVAILABLE" + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000003", + "reason_codes": [ + "OUT_OF_CREDITS", + "MODEL_BUDGET_EXHAUSTED", + "RELEASE_SET_UNAVAILABLE", + "CHECK_RECEIPT_ABSENT" + ] + } + ] + }, + { + "name": "assessment-count-0", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["ASSESSMENT_HISTORY_UNAVAILABLE"] + } + ] + }, + { + "name": "assessment-count-2", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 2, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["ASSESSMENT_HISTORY_UNAVAILABLE"] + } + ] + }, + { + "name": "missing-environment-history", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["ASSESSMENT_HISTORY_UNAVAILABLE"] + } + ] + }, + { + "name": "code-only-completed", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "code-missing", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["CODE_ASSESSMENT_UNAVAILABLE"] + } + ] + }, + { + "name": "code-withheld", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [ + { + "id": "00000000-0000-7000-8000-000000000006", + "severity": "SERIOUS", + "risk_domain": "[withheld: environment value]", + "claim": "[withheld: environment value]", + "impact": "[withheld: environment value]", + "symbols": [], + "lifecycle_state": "NEW", + "evidence_refs": [], + "comment_reactions": [], + "rule_refs": [] + } + ], + "incompleteness_kind": null + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["CODE_ASSESSMENT_UNAVAILABLE"] + } + ] + }, + { + "name": "code-other-head", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "cccccccccccccccccccccccccccccccccccccccc", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["CODE_ASSESSMENT_UNAVAILABLE"] + } + ] + }, + { + "name": "code-other-base", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "cccccccccccccccccccccccccccccccccccccccc", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": null, + "reason_codes": ["CODE_ASSESSMENT_UNAVAILABLE"] + } + ] + }, + { + "name": "code-unpinned-base", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": null, + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "code-unpinned-head", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": null, + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "code-case-insensitive-commits", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "base_commit_sha": "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "COMPLETED", + "gaps": [] + }, + { + "name": "code-incomplete", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "INCOMPLETE", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["CODE_ASSESSMENT_STATE_UNAVAILABLE"] + } + ] + }, + { + "name": "code-out-of-credits", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "INCOMPLETE", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null, + "reason_codes": ["OUT_OF_CREDITS"] + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["OUT_OF_CREDITS"] + } + ] + }, + { + "name": "code-reason-and-kind", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "INCOMPLETE", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": "EVIDENCE_UNAVAILABLE", + "reason_codes": ["MODEL_ANSWER_WITHHELD"] + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["MODEL_ANSWER_WITHHELD", "EVIDENCE_UNAVAILABLE"] + } + ] + }, + { + "name": "code-completed-with-reason", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null, + "reason_codes": ["OUT_OF_CREDITS"] + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["OUT_OF_CREDITS"] + } + ] + }, + { + "name": "code-evidence-gap", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "COMPLETED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": "EVIDENCE_UNAVAILABLE" + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["EVIDENCE_UNAVAILABLE"] + } + ] + }, + { + "name": "code-excluded", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 0, + "environment_display_names": [], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "EXCLUDED", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "INCOMPLETE", + "gaps": [ + { + "assessment_id": "00000000-0000-7000-8000-000000000005", + "reason_codes": ["CODE_ASSESSMENT_STATE_UNAVAILABLE"] + } + ] + }, + { + "name": "complete-environment-with-partial-code", + "review": { + "id": "00000000-0000-7000-8000-000000000002", + "public_key": "review-outcome-example", + "kind": "PULL_REQUEST", + "status": "COMPLETED", + "assessment_count": 1, + "environment_display_names": ["production"], + "finding_count": 0, + "trigger_origin": "MANUAL", + "publication": "WITHHELD", + "created_at": "2026-01-01T00:00:00Z", + "stoppable": false, + "related_reviews": [], + "subjects": [], + "assessments": [ + { + "id": "00000000-0000-7000-8000-000000000003", + "environment_display_name": "production", + "status": "COMPLETED", + "domains": [], + "findings": [], + "checks": { + "receipt_recorded": true, + "status": "READY", + "families": [] + } + } + ], + "actions": { + "promote_findings": false, + "rerun": false, + "publish": false, + "stop": false, + "validate_findings": false + }, + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "code_assessment": { + "id": "00000000-0000-7000-8000-000000000005", + "status": "INCOMPLETE", + "head_commit_sha": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", + "base_commit_sha": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb", + "findings": [], + "incompleteness_kind": null + } + }, + "outcome": "COMPLETED", + "gaps": [] + } + ] +} diff --git a/tests/test_exports.py b/tests/test_exports.py new file mode 100644 index 00000000..3343209f --- /dev/null +++ b/tests/test_exports.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +import csv +import io +from concurrent.futures import ThreadPoolExecutor +from itertools import product + +import httpx +import pytest + +from proofline import ProoflineError +from proofline._transport import MAX_RESPONSE_BYTES +from proofline.exports import decode_export + + +def response(text: str) -> httpx.Response: + return httpx.Response( + 200, + content=text.encode(), + headers={ + "Content-Type": "text/csv", + "X-Proofline-Export-Version": "1", + "X-Proofline-Export-Settled-Until": "2026-11-16T00:00:00Z", + }, + ) + + +@pytest.mark.parametrize("size", [131_072, 131_073, 150_000]) +def test_large_csv_field_preserved(size: int) -> None: + claim = 'é, "quoted"\r\n' + "x" * size + stream = io.StringIO(newline="") + writer = csv.writer(stream) + writer.writerow(["dataset_version", "claim"]) + writer.writerow(["1", claim]) + text = stream.getvalue() + page = decode_export(response(text), "csv") + assert page.rows == [{"dataset_version": "1", "claim": claim}] + assert page.text == text + + +@pytest.mark.parametrize("extra", [0, 1]) +def test_csv_response_byte_bound(extra: int) -> None: + prefix = "dataset_version,claim\n1," + text = prefix + "x" * (MAX_RESPONSE_BYTES - len(prefix) + extra) + if extra: + with pytest.raises(ProoflineError, match="HTTP 200") as caught: + decode_export(response(text), "csv") + assert caught.value.type == "urn:proofline:sdk:invalid-response" + else: + assert len(decode_export(response(text), "csv").rows[0]["claim"]) == ( + MAX_RESPONSE_BYTES - len(prefix) + ) + + +@pytest.mark.parametrize( + "text", + [ + "", + 'dataset_version,claim\n1,"unfinished', + 'dataset_version,claim\n1,"closed"junk', + "dataset_version,claim,claim\n1,a,b", + "dataset_version,claim\n1", + "dataset_version,claim\n1,a,b", + "dataset_version,claim\n\n", + ], +) +def test_invalid_csv_retains_typed_error(text: str) -> None: + with pytest.raises(ProoflineError) as caught: + decode_export(response(text), "csv") + assert caught.value.type == "urn:proofline:sdk:invalid-response" + assert caught.value.status == 200 + + +def test_csv_parser_matches_standard_dialect() -> None: + from proofline._csv import parse_csv + + # Exhaust short combinations to exercise transitions, including malformed quoting. + samples = ("".join(chars) for length in range(6) for chars in product('a,"\r\n', repeat=length)) + for text in samples: + try: + expected = list(csv.reader(io.StringIO(text, newline=""), strict=True)) + except csv.Error: + with pytest.raises(ValueError): + parse_csv(text) + else: + assert parse_csv(text) == expected, repr(text) + for text in ['a,"é,\r\n""quote""",\r\n', "a,b\r1,2", 'a,""', "a,b\n"]: + assert parse_csv(text) == list(csv.reader(io.StringIO(text, newline=""), strict=True)) + + +def test_concurrent_decoding_preserves_global_csv_limit() -> None: + before = csv.field_size_limit() + + def decode(index: int) -> str: + if index % 2: + with pytest.raises(ProoflineError): + decode_export(response('dataset_version,claim\n1,"unfinished'), "csv") + else: + assert decode_export(response("dataset_version,claim\n1," + "x" * 150_000), "csv") + return str(csv.field_size_limit()) + + with ThreadPoolExecutor(max_workers=4) as pool: + assert set(pool.map(decode, range(12))) == {str(before)} + assert csv.field_size_limit() == before diff --git a/tests/test_generated_operation.py b/tests/test_generated_operation.py new file mode 100644 index 00000000..85ce47b1 --- /dev/null +++ b/tests/test_generated_operation.py @@ -0,0 +1,83 @@ +"""A compatible schema addition must produce callable sync and async SDK methods.""" + +import json +import os +import shutil +import subprocess +import sys +from pathlib import Path + +from .http_server import Reply, Server + +SDK = Path(__file__).resolve().parents[1] + + +def test_new_public_operation(tmp_path: Path) -> None: + for name in ("proofline", "scripts", "templates"): + shutil.copytree(SDK / name, tmp_path / name, ignore=shutil.ignore_patterns("__pycache__")) + for name in ("generator.json", "pyproject.toml"): + shutil.copyfile(SDK / name, tmp_path / name) + spec = json.loads((SDK / "openapi.public.json").read_bytes()) + spec["components"]["schemas"]["ExampleResult"] = { + "type": "object", + "required": ["answer"], + "properties": {"answer": {"type": "string"}}, + } + spec["paths"]["/api/example/{item}"] = { + "parameters": [ + {"name": "item", "in": "path", "required": True, "schema": {"type": "integer"}} + ], + "get": { + "operationId": "read_example", + "tags": ["samples"], + "responses": { + "200": { + "description": "Example", + "content": { + "application/json": { + "schema": {"$ref": "#/components/schemas/ExampleResult"} + } + }, + } + }, + }, + } + (tmp_path / "openapi.public.json").write_text(json.dumps(spec)) + subprocess.run([sys.executable, "scripts/generate.py"], cwd=tmp_path, check=True) + # Import both clients from the newly generated package in a fresh interpreter. + probe = """ +import asyncio, sys +from proofline import ProoflineClient, AsyncProoflineClient, ProoflineError + +async def run(): + with ProoflineClient("sample-token", base_url=sys.argv[1]) as client: + assert client.read_example(7).answer == "seven" + async with AsyncProoflineClient("sample-token", base_url=sys.argv[1]) as client: + assert (await client.read_example(7)).answer == "seven" + try: + await client.read_example(8) + except ProoflineError as error: + assert error.status == 403 + else: + raise AssertionError("the generated client accepted a forbidden response") +asyncio.run(run()) +""" + with Server( + lambda r, _: ( + Reply(body={"answer": "seven"}) + if r.path.endswith("/7") + else Reply(status=403, body={"type": "forbidden", "detail": "Unavailable"}) + ) + ) as peer: + subprocess.run( + [sys.executable, "-c", probe, peer.url], + cwd=tmp_path, + env={**os.environ, "PYTHONPATH": str(tmp_path)}, + check=True, + ) + assert [r.path for r in peer.requests] == [ + "/api/example/7", + "/api/example/7", + "/api/example/8", + ] + assert all(r.headers.get("Authorization") == "Bearer sample-token" for r in peer.requests) diff --git a/tests/test_http.py b/tests/test_http.py index eba316e7..fd0494b0 100644 --- a/tests/test_http.py +++ b/tests/test_http.py @@ -1,19 +1,26 @@ from __future__ import annotations import asyncio +import csv import gzip import inspect +import io import json import logging import socket +import subprocess +import sys import threading import time +import tomllib import traceback from collections.abc import AsyncIterator from contextlib import asynccontextmanager from datetime import UTC, datetime, timedelta +from pathlib import Path from typing import Any from urllib.parse import parse_qs, urlsplit +from uuid import UUID import httpx import pytest @@ -48,9 +55,12 @@ models, ) from proofline import client as client_module +from proofline._generated.models.export_review_kind import ExportReviewKind from proofline._generated.models.finding_fix_prompt_type_0 import FindingFixPromptType0 from proofline._generated.models.finding_fix_prompt_type_1 import FindingFixPromptType1 +from proofline._generated.models.reviews_export_row import ReviewsExportRow from proofline._generated.types import UNSET +from proofline._transport import REFUSAL_SHAPES from .fixtures import ( ASSESSMENT, @@ -71,6 +81,7 @@ Client = ProoflineClient | AsyncProoflineClient MODES = pytest.mark.parametrize("mode", ["sync", "async"]) +STRUCTURED_QUERY = '(status:COMPLETED OR status:FAILED) AND -author:"release bot"' @asynccontextmanager @@ -117,13 +128,9 @@ async def async_sleep(self, delay: float) -> None: @MODES -@pytest.mark.parametrize( - "terraform", - [UNSET, None, {"plan": "TAKEN", "addresses": ["aws_s3_bucket.synthetic"], "omitted": 1}], -) -async def test_all_public_operations_use_generated_models_and_scoped_paths( - mode: str, terraform: Any -) -> None: +async def test_all_public_operations_use_generated_models_and_scoped_paths(mode: str) -> None: + metadata = Path(__file__).resolve().parents[1] / "pyproject.toml" + package_version = tomllib.loads(metadata.read_text())["project"]["version"] prefix = f"/api/v1/organizations/{ORG}" paths = [ ("GET", f"{prefix}/reviews", page(), ReviewPage), @@ -202,19 +209,6 @@ async def test_all_public_operations_use_generated_models_and_scoped_paths( ), ] - for _, _, body, response_model in paths: - if response_model is CustomerReviewDetail: - assessments = body["assessments"] - elif response_model is CustomerAssessmentDetail: - assessments = [body] - else: - continue - for entry in assessments: - reach = {"complete": True, "entities": [], "gaps": [], "outcome": "READ"} - if terraform is not UNSET: - reach["terraform"] = terraform - entry["declared_reach"] = reach - def respond(request: Request, index: int) -> Reply: method, path, body, _ = paths[index] assert request.method == method @@ -224,11 +218,21 @@ def respond(request: Request, index: int) -> Reply: with Server(respond) as server: async with session(mode, server.url) as client: calls = [ - ("list_reviews", (ORG,), {"limit": 7, "repository": REPOSITORY}), + ( + "list_reviews", + (ORG,), + {"limit": 7, "repository": REPOSITORY, "query": STRUCTURED_QUERY}, + ), ( "list_pull_request_reviews", (ORG, "repo/name", 42), - {"filters": {"repository": REPOSITORY, "search": "text & space"}}, + { + "filters": { + "repository": REPOSITORY, + "search": "text & space", + "query": STRUCTURED_QUERY, + } + }, ), ("get_pull_request_review", (ORG, "repo/name", 42, 3), {}), ("get_deployment_review", (ORG, "key/with?query"), {}), @@ -246,19 +250,6 @@ def respond(request: Request, index: int) -> Reply: for index, (name, args, kwargs) in enumerate(calls): result = await call(client, name, *args, **kwargs) assert isinstance(result, paths[index][3]) - if isinstance(result, (CustomerReviewDetail, CustomerAssessmentDetail)): - entries = ( - result.assessments if isinstance(result, CustomerReviewDetail) else [result] - ) - for entry in entries: - roots = entry.declared_reach.terraform - if isinstance(terraform, dict): - assert isinstance(roots, models.TerraformRootsView) - assert roots.plan is models.TerraformPlanView.TAKEN - assert roots.addresses == ["aws_s3_bucket.synthetic"] - assert roots.omitted == 1 - else: - assert roots is terraform if isinstance(result, CustomerFinding): assert result.rule_refs[0].key == "no-sync-io-in-handlers" revision = result.rule_refs[0].revisions[0] @@ -281,7 +272,7 @@ def respond(request: Request, index: int) -> Reply: assert len({request.peer_port for request in server.requests}) == 1 for request in server.requests: assert request.headers["Authorization"] == f"Bearer {TOKEN}" - assert request.headers["User-Agent"] == "proofline-python/1.0.3" + assert request.headers["User-Agent"] == f"proofline-python/{package_version}" assert request.headers["Accept-Encoding"] == "identity" assert "Cookie" not in request.headers assert "Content-Type" not in request.headers @@ -289,10 +280,12 @@ def respond(request: Request, index: int) -> Reply: assert parse_qs(urlsplit(server.requests[0].path).query) == { "limit": ["7"], "repository": [str(REPOSITORY)], + "query": [STRUCTURED_QUERY], } assert parse_qs(urlsplit(server.requests[1].path).query) == { "repository": [str(REPOSITORY)], "search": ["text & space"], + "query": [STRUCTURED_QUERY], } bodies = [ @@ -446,7 +439,11 @@ def respond(request: Request, index: int) -> Reply: assert (result.covered_lines, result.instrumented_lines) == (1, 2) with pytest.raises(ProoflineError) as refused: await call(client, "upload_coverage_reports", ORG, REPOSITORY, body=body) - assert refused.value.status == 422 + error = refused.value + assert (error.status, error.type) == (422, "about:blank") + assert error.title == "unprocessable coverage upload" + assert error.detail == "The coverage upload was refused." + assert (error.refusal, error.repository_name) == (None, None) assert len(server.requests) == 3 @@ -531,6 +528,197 @@ def respond(request: Request, index: int) -> Reply: assert summary.prose.notable_paths == ["src/new.py"] +CONTRACT = json.loads((Path(__file__).parents[1] / "openapi.public.json").read_text()) +REFUSAL_VARIANTS = CONTRACT["components"]["schemas"]["RunNowRefusalView"]["oneOf"] +ENVIRONMENT = { + "id": str(ASSESSMENT), + "external_key": "production", + "display_name": "Production", + "status": "PENDING", +} +COMMIT = CommitReviewRequest(base_commit_sha="b" * 40, head_commit_sha="c" * 40) +REVIEW_REQUESTS = { + "request_review": (42,), + "request_patch_review": (), + "request_file_review": (), + "request_commit_review": (), +} + + +def review_request(name: str) -> tuple[tuple[Any, ...], dict[str, Any]]: + bodies = { + "request_review": UNSET, + "request_patch_review": PatchReviewRequest( + base_commit_sha="b" * 40, patch="diff --git a/x b/x\n" + ), + "request_file_review": FileReviewRequest(commit_sha="c" * 40, paths=["src/main.py"]), + "request_commit_review": COMMIT, + } + return (ORG, REPOSITORY, *REVIEW_REQUESTS[name]), {"body": bodies[name]} + + +def refusal_view(variant: dict[str, Any]) -> dict[str, Any]: + view: dict[str, Any] = {"reason": variant["properties"]["reason"]["const"]} + for name in variant["required"]: + if name == "environment": + view[name] = dict(ENVIRONMENT, display_name=f"{PRIVATE} {TOKEN}") + elif name == "detail": + view[name] = f"Configuration names {TOKEN}." + return view + + +def refused(view: Any) -> dict[str, Any]: + return { + "title": "invalid request", + "status": 400, + "detail": f"Nothing was created for {TOKEN}.", + "repository_name": "api", + "refusal": view, + } + + +@MODES +@pytest.mark.parametrize( + "variant", REFUSAL_VARIANTS, ids=[v["properties"]["reason"]["const"] for v in REFUSAL_VARIANTS] +) +async def test_review_requests_return_each_documented_refusal( + mode: str, variant: dict[str, Any] +) -> None: + view = refusal_view(variant) + with Server( + lambda request, index: Reply( + 400, refused(view), {"Content-Type": "application/problem+json"} + ) + ) as server: + async with session(mode, server.url) as client: + for name in REVIEW_REQUESTS: + args, kwargs = review_request(name) + with pytest.raises(ProoflineError) as raised: + await call(client, name, *args, **kwargs) + error = raised.value + assert (error.status, error.type) == (400, "about:blank") + assert error.title == "invalid request" + assert error.detail == "Nothing was created for [redacted]." + assert error.repository_name == "api" + assert error.refusal is not None + assert error.refusal.reason == view["reason"] + decoded = error.refusal.to_dict() + assert TOKEN not in json.dumps(decoded) + if "environment" in view: + assert decoded["environment"]["display_name"] == f"{PRIVATE} [redacted]" + diagnostic = repr(error) + str(error) + "".join(traceback.format_exception(error)) + assert PRIVATE not in diagnostic and TOKEN not in diagnostic + assert len(server.requests) == len(REVIEW_REQUESTS) + + +@MODES +@pytest.mark.parametrize( + "body", + [ + refused({"reason": "NOT_A_DOCUMENTED_REASON"}), + refused({"reason": "ENVIRONMENT_REVIEWS_OFF"}), + refused("NO_LINKED_ENVIRONMENT"), + dict(refused({"reason": "NO_LINKED_ENVIRONMENT"}), repository_name=7), + {k: v for k, v in refused({"reason": "NO_LINKED_ENVIRONMENT"}).items() if k != "detail"}, + refused({"reason": "INVALID_DELIVERY_CONFIGURATION", "detail": 7, "environment": 7}), + refused({"reason": "INVALID_DELIVERY_CONFIGURATION", "detail": "d", "environment": 7}), + refused({"reason": "ENVIRONMENT_REVIEWS_OFF", "environment": dict(ENVIRONMENT, id=7)}), + refused( + { + "reason": "INVALID_DELIVERY_CONFIGURATION", + "detail": "d", + "environment": dict(ENVIRONMENT, id="not-a-uuid"), + } + ), + refused({"reason": "ENVIRONMENT_REVIEWS_OFF", "environment": dict(ENVIRONMENT, id="x")}), + refused( + {"reason": "ENVIRONMENT_NOT_READY", "environment": ENVIRONMENT, "status_detail": 7} + ), + ], + ids=[ + "unknown-reason", + "missing-environment", + "untyped-refusal", + "repository-name", + "detail", + "numeric-delivery-fields", + "numeric-delivery-environment", + "environment-field", + "delivery-environment-id", + "required-environment-id", + "status-detail", + ], +) +async def test_malformed_refusal_keeps_fixed_sdk_problem_type( + mode: str, body: dict[str, Any] +) -> None: + with Server(lambda request, index: Reply(400, body)) as server: + async with session(mode, server.url) as client: + with pytest.raises(ProoflineError) as raised: + await call(client, "request_commit_review", ORG, REPOSITORY, body=COMMIT) + error = raised.value + assert (error.status, error.type) == (400, "urn:proofline:sdk:invalid-response") + assert error.title == "invalid request" + assert (error.refusal, error.repository_name) == (None, None) + assert TOKEN not in error.detail + + +@MODES +@pytest.mark.parametrize( + "view", + [ + {"reason": "OUT_OF_CREDITS"}, + {"reason": "PLAN_CREDITS_SPENT", "resets": "2026-12-01T00:00:00Z"}, + ], + ids=["out-of-credits", "plan-credits-spent"], +) +async def test_credit_refusal_keeps_the_server_problem(mode: str, view: dict[str, Any]) -> None: + body = { + "title": "payment required", + "status": 402, + "detail": f"Credits cannot pay for {TOKEN}.", + "repository_name": "api", + "refusal": view, + } + with Server( + lambda request, index: Reply(402, body, {"Content-Type": "application/problem+json"}) + ) as server: + async with session(mode, server.url) as client: + for name in REVIEW_REQUESTS: + args, kwargs = review_request(name) + with pytest.raises(ProoflineError) as raised: + await call(client, name, *args, **kwargs) + error = raised.value + assert (error.status, error.type) == (402, "about:blank") + assert error.title == "payment required" + assert error.detail == "Credits cannot pay for [redacted]." + assert (error.refusal, error.repository_name) == (None, None) + assert len(server.requests) == len(REVIEW_REQUESTS) + + +def test_every_documented_refusal_reason_has_a_field_check() -> None: + reasons = {variant["properties"]["reason"]["const"] for variant in REFUSAL_VARIANTS} + assert set(REFUSAL_SHAPES) == reasons + + +@MODES +async def test_problem_without_detail_keeps_status_and_title(mode: str) -> None: + with Server( + lambda request, index: Reply( + 500, {"title": "internal error", "status": 500, "detail": None} + ) + ) as server: + async with session(mode, server.url) as client: + with pytest.raises(ProoflineError) as raised: + await call(client, "get_finding", ORG, FINDING) + error = raised.value + assert (error.status, error.type, error.title) == (500, "about:blank", "internal error") + assert "without a problem document" not in error.detail + assert "internal error" in error.detail + assert error.refusal is None + assert len(server.requests) == 1 + + @MODES @pytest.mark.parametrize("status", [401, 403, 404]) async def test_authority_problems_do_not_retry_or_disclose_secrets( @@ -605,16 +793,18 @@ async def test_redirect_never_contacts_other_origin(mode: str) -> None: async def test_retry_after_waits_for_server_then_returns_typed_success( mode: str, monkeypatch: pytest.MonkeyPatch ) -> None: + clock = Clock(monkeypatch) with Server( - lambda request, index: Reply(429, {"detail": "Rate limit."}, {"Retry-After": "2"}) - if index == 0 - else Reply(body=finding()) + lambda request, index: ( + Reply(429, {"detail": "Rate limit."}, {"Retry-After": "2"}) + if index == 0 + else Reply(body=finding()) + ) ) as server: - started = time.monotonic() async with session(mode, server.url) as client: result = await call(client, "get_finding", ORG, FINDING) assert result.id == FINDING - assert time.monotonic() - started >= 2 + assert clock.delays == [2.0] assert len(server.requests) == 2 instant = datetime(2069, 9, 30, tzinfo=UTC) @@ -627,14 +817,15 @@ def now(cls, tz: Any = None) -> datetime: monkeypatch.setattr(_transport, "datetime", Calendar) header = (instant + timedelta(seconds=2)).strftime("%A, %d-%b-%y %H:%M:%S GMT") with Server( - lambda request, index: Reply(429, {"detail": "Rate limit."}, {"Retry-After": header}) - if index == 0 - else Reply(body=finding()) + lambda request, index: ( + Reply(429, {"detail": "Rate limit."}, {"Retry-After": header}) + if index == 0 + else Reply(body=finding()) + ) ) as server: - started = time.monotonic() async with session(mode, server.url) as client: assert (await call(client, "get_finding", ORG, FINDING)).id == FINDING - assert time.monotonic() - started >= 2 + assert clock.delays == [2.0, 2.0] assert len(server.requests) == 2 @@ -710,9 +901,11 @@ def now(cls, tz: Any = None) -> datetime: "Sun, 06 Nov 1994 08:49:37 GMT", ]: with Server( - lambda request, index: Reply(429, {"detail": "Rate limit."}, {"Retry-After": header}) - if index == 0 - else Reply(body=finding()) + lambda request, index: ( + Reply(429, {"detail": "Rate limit."}, {"Retry-After": header}) + if index == 0 + else Reply(body=finding()) + ) ) as server: async with session(mode, server.url) as client: assert (await call(client, "get_finding", ORG, FINDING)).id == FINDING @@ -792,6 +985,16 @@ async def test_wait_retains_evidence_gaps_after_running_review( "name": "synthetic-check", "outcome": "UNRESOLVED", "lifecycle": "SHADOW", + "files": [ + { + "revision": "PROPOSED_CODE_REVISION", + "path": {"untrusted_text": "deploy.yml"}, + }, + { + "revision": "BASE_CODE_REVISION", + "path": {"untrusted_text": "deploy.yml"}, + }, + ], "unresolved_reason": "UNSUPPORTED", "detail": PRIVATE, } @@ -806,12 +1009,17 @@ async def test_wait_retains_evidence_gaps_after_running_review( assert result.review_url == f"{server.url}/orgs/by-id/{ORG}/reviews/{REVIEW}" gap = result.gaps[0] assert gap.assessment_id == ASSESSMENT - assert gap.reason_codes == ("WORLD_UNAVAILABLE", "CHECK_RECEIPT_UNAVAILABLE") + assert gap.reason_codes == ("WORLD_UNAVAILABLE", "WORLD", PRIVATE, "CHECKS_UNRESOLVED") assert gap.incompleteness_kind == "WORLD" assert gap.release_evidence_gap == PRIVATE assert gap.checks[0].unresolved_reason == "UNSUPPORTED" assert gap.checks[0].detail == PRIVATE assert gap.checks[0].lifecycle == "SHADOW" + files = result.review.assessments[0].checks.families[0].files + assert [(file.revision, file.path.untrusted_text) for file in files] == [ + ("PROPOSED_CODE_REVISION", "deploy.yml"), + ("BASE_CODE_REVISION", "deploy.yml"), + ] assert PRIVATE not in repr(result) + repr(gap) assert clock.delays == [5, 10] @@ -853,7 +1061,7 @@ async def test_code_only_outcomes_retain_recorded_kind_and_env_precedence( assert result.gaps[0].incompleteness_kind == kind assert result.gaps[0].checks == () if kind: - assert result.gaps[0].reason_codes == () + assert result.gaps[0].reason_codes == (kind,) else: assert expected == "COMPLETED" assert PRIVATE not in repr(result) @@ -927,7 +1135,12 @@ async def test_completion_uses_all_declared_lifecycles_and_recorded_checks( body = review() body["finding_count"] = 1 body["assessments"][0]["findings"] = [finding()] - check = {"name": "family", "outcome": check_outcome, "lifecycle": lifecycle} + check = { + "name": "family", + "outcome": check_outcome, + "lifecycle": lifecycle, + "files": [], + } if check_outcome == "UNRESOLVED": check["unresolved_reason"] = "REGENERATE_SCENARIO" body["assessments"][0]["checks"]["families"] = [check] @@ -1029,6 +1242,154 @@ async def test_failure_and_stop_remain_distinct( assert len(server.requests) == 1 +HEAD = "a" * 40 +OTHER_HEAD = "c" * 40 +PINNED_ELSEWHERE = (None, "UNKNOWN", ("HEAD_COMMIT_MISMATCH",)) +NO_HEAD = (None, "UNKNOWN", ("HEAD_COMMIT_UNAVAILABLE",)) + + +def review_at(head: Any, status: str = "COMPLETED") -> dict[str, Any]: + return {**review(status), "head_commit_sha": head} + + +def gap_facts(result: Any) -> list[tuple[Any, str, tuple[str, ...]]]: + return [(gap.assessment_id, gap.status, gap.reason_codes) for gap in result.gaps] + + +@MODES +async def test_wait_held_to_a_head_commit_never_completes_for_another( + mode: str, monkeypatch: pytest.MonkeyPatch +) -> None: + clock = Clock(monkeypatch) + with Server(lambda request, index: Reply(body=review_at(HEAD))) as server: + async with session(mode, server.url) as client: + for held in (HEAD, HEAD.upper()): + result = await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha=held) + assert (result.status, result.gaps, result.reason) == ("COMPLETED", (), None) + result = await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha=OTHER_HEAD) + assert result.status == "INCOMPLETE" + assert gap_facts(result) == [PINNED_ELSEWHERE] + assert result.reason == "The review is pinned to another head commit." + assert result.review.head_commit_sha == HEAD + assert result.review_url == f"{server.url}/orgs/by-id/{ORG}/reviews/{REVIEW}" + assert HEAD not in repr(result) and OTHER_HEAD not in repr(result) + # Without the keyword the same record completes, as it always has. + result = await call(client, "wait_for_review", ORG, REVIEW) + assert (result.status, result.gaps, result.reason) == ("COMPLETED", (), None) + assert len(server.requests) == 4 + assert clock.delays == [] + + +@MODES +async def test_wait_ends_on_the_read_that_names_another_head( + mode: str, monkeypatch: pytest.MonkeyPatch +) -> None: + clock = Clock(monkeypatch) + responses = [review("PENDING"), review_at(HEAD, "RUNNING"), review_at(HEAD)] + with Server(lambda request, index: Reply(body=responses[index])) as server: + async with session(mode, server.url) as client: + result = await call( + client, "wait_for_review", ORG, REVIEW, timeout=100, head_commit_sha=HEAD + ) + assert (result.status, result.gaps, result.reason) == ("COMPLETED", (), None) + assert len(server.requests) == 3 + assert clock.delays == [5, 10] + with Server(lambda request, index: Reply(body=responses[index])) as server: + async with session(mode, server.url) as client: + result = await call( + client, "wait_for_review", ORG, REVIEW, timeout=100, head_commit_sha=OTHER_HEAD + ) + assert result.status == "INCOMPLETE" + assert result.review.status == "RUNNING" + assert gap_facts(result) == [PINNED_ELSEWHERE] + assert result.reason == "The review is pinned to another head commit." + # The second read names the head, so the review that would complete is never read. + assert len(server.requests) == 2 + assert clock.delays == [5, 10, 5] + + +@MODES +async def test_a_review_of_another_head_is_incomplete_whatever_its_own_status( + mode: str, monkeypatch: pytest.MonkeyPatch +) -> None: + Clock(monkeypatch) + statuses = ["FAILED", "STOPPED", "SUPERSEDED"] + with Server(lambda request, index: Reply(body=review_at(HEAD, statuses[index // 2]))) as server: + async with session(mode, server.url) as client: + for status in statuses: + result = await call( + client, "wait_for_review", ORG, REVIEW, head_commit_sha=OTHER_HEAD + ) + assert (result.status, gap_facts(result)) == ("INCOMPLETE", [PINNED_ELSEWHERE]) + assert result.review.status == status + result = await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha=HEAD) + assert result.status == ("FAILED" if status == "FAILED" else "STOPPED") + assert (result.gaps, result.reason) == ((), None) + assert len(server.requests) == 6 + + +@MODES +async def test_a_review_that_names_no_head_never_completes_for_a_named_commit( + mode: str, monkeypatch: pytest.MonkeyPatch +) -> None: + clock = Clock(monkeypatch) + bodies = [ + review(), + review_at(None), + review_at(""), + review_at(7), + review_at(None, "FAILED"), + review_at(None, "SUPERSEDED"), + ] + expected = ["INCOMPLETE", "INCOMPLETE", "INCOMPLETE", "INCOMPLETE", "FAILED", "STOPPED"] + with Server(lambda request, index: Reply(body=bodies[index])) as server: + async with session(mode, server.url) as client: + for status in expected: + result = await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha=HEAD) + assert result.status == status + assert gap_facts(result) == [NO_HEAD] + assert result.reason == "The review names no head commit." + assert len(server.requests) == len(bodies) + assert clock.delays == [] + # A review that is still pending may name its head later, so the wait goes on. + with Server(lambda request, index: Reply(body=review("PENDING"))) as server: + async with session(mode, server.url) as client: + result = await call( + client, "wait_for_review", ORG, REVIEW, timeout=12, head_commit_sha=HEAD + ) + assert result.status == "TIMED_OUT" + assert gap_facts(result) == [NO_HEAD] + assert result.reason == "The review names no head commit." + assert len(server.requests) == 2 + assert clock.delays == [5, 7] + + +@MODES +async def test_head_commit_must_be_a_full_sha_before_any_request(mode: str) -> None: + refused = [ + "main", + "a" * 7, + "a" * 39, + "a" * 41, + "g" * 40, + "\u0661" * 40, + HEAD + "\n", + " " + HEAD[1:], + "", + 7, + HEAD.encode(), + ] + with Server(lambda request, index: Reply(body=review_at("d" * 64))) as server: + async with session(mode, server.url) as client: + for value in refused: + with pytest.raises(ValueError, match="full 40 or 64 character"): + await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha=value) + assert server.requests == [] + result = await call(client, "wait_for_review", ORG, REVIEW, head_commit_sha="D" * 64) + assert (result.status, result.gaps, result.reason) == ("COMPLETED", (), None) + assert len(server.requests) == 1 + + @MODES async def test_polling_backoff_and_timeout_keep_review_url_and_last_record( mode: str, monkeypatch: pytest.MonkeyPatch @@ -1054,17 +1415,19 @@ async def test_polling_backoff_and_timeout_keep_review_url_and_last_record( @MODES -async def test_retry_after_is_bounded_by_wait_deadline(mode: str) -> None: +async def test_retry_after_is_bounded_by_wait_deadline( + mode: str, monkeypatch: pytest.MonkeyPatch +) -> None: + clock = Clock(monkeypatch) with Server( - lambda request, index: Reply(503, {"detail": "Unavailable."}, {"Retry-After": "2"}) + lambda request, index: Reply(503, {"detail": "Unavailable."}, {"Retry-After": "20"}) ) as server: async with session(mode, server.url) as client: - started = time.monotonic() - result = await call(client, "wait_for_review", ORG, REVIEW, timeout=0.05) + result = await call(client, "wait_for_review", ORG, REVIEW, timeout=10) assert result.status == "TIMED_OUT" assert result.review_url == f"{server.url}/orgs/by-id/{ORG}/reviews/{REVIEW}" - assert time.monotonic() - started < 0.5 assert len(server.requests) == 1 + assert clock.delays == [10] @MODES @@ -1162,15 +1525,42 @@ async def expire_async( if status == 200: assert raised.value.type == "urn:proofline:sdk:invalid-response" - with Server(lambda request, index: Reply(status, body, header_pause=0.2)) as server: - async with session(mode, server.url) as client: - started = time.monotonic() - result = await call(client, "wait_for_review", ORG, REVIEW, timeout=0.05) - assert result.status == "TIMED_OUT" - assert result.review is None - assert result.review_url == f"{server.url}/orgs/by-id/{ORG}/reviews/{REVIEW}" - assert time.monotonic() - started < 0.5 - assert len(server.requests) == 1 + # The headers wait far past a deadline that leaves time to connect and send. The + # client counts its own attempts, so the no-retry proof needs no scheduler timing. + attempts = 0 + with monkeypatch.context() as patch: + sync_request = _sync_http.Transport.handle_request + async_request = httpx.AsyncHTTPTransport.handle_async_request + + def count_sync(transport: _sync_http.Transport, request: httpx.Request) -> httpx.Response: + nonlocal attempts + attempts += 1 + return sync_request(transport, request) + + async def count_async( + transport: httpx.AsyncHTTPTransport, request: httpx.Request + ) -> httpx.Response: + nonlocal attempts + attempts += 1 + return await async_request(transport, request) + + patch.setattr(_sync_http.Transport, "handle_request", count_sync) + patch.setattr(httpx.AsyncHTTPTransport, "handle_async_request", count_async) + with Server(lambda request, index: Reply(status, body, header_pause=2.0)) as server: + async with session(mode, server.url) as client: + started = time.monotonic() + result = await call(client, "wait_for_review", ORG, REVIEW, timeout=0.3) + assert result.status == "TIMED_OUT" + assert result.review is None + assert result.review_url == f"{server.url}/orgs/by-id/{ORG}/reviews/{REVIEW}" + assert time.monotonic() - started < 1.5 + assert attempts == 1 + # The request was sent before the header wait, so the server reads it + # even after the client gives up. + recorded = time.monotonic() + 5 + while not server.requests and time.monotonic() < recorded: + time.sleep(0.01) + assert len(server.requests) == 1 @MODES @@ -1288,10 +1678,14 @@ def resolve(host: Any, port: Any, *args: Any, **kwargs: Any) -> Any: @MODES async def test_cursor_pagination_preserves_filters_and_refuses_cycles_or_bounds(mode: str) -> None: def respond(request: Request, index: int) -> Reply: + assert urlsplit(request.path).path == f"/api/v1/organizations/{ORG}/reviews" + assert request.headers["Authorization"] == f"Bearer {TOKEN}" query = parse_qs(urlsplit(request.path).query) assert query["repository"] == [str(REPOSITORY)] assert query["status"] == ["COMPLETED"] assert query["limit"] == ["2"] + assert query["query"] == [STRUCTURED_QUERY] + assert query["search"] == ["text & space"] if index == 0: assert "cursor" not in query else: @@ -1303,7 +1697,14 @@ def respond(request: Request, index: int) -> Reply: with Server(respond) as server: async with session(mode, server.url) as client: items = await collect( - client, page_size=2, filters={"repository": REPOSITORY, "status": "COMPLETED"} + client, + page_size=2, + filters={ + "repository": REPOSITORY, + "status": "COMPLETED", + "query": STRUCTURED_QUERY, + "search": "text & space", + }, ) assert [item.id for item in items] == [REVIEW, REVIEW] assert len(server.requests) == 2 @@ -1353,6 +1754,58 @@ def test_token_environment_and_https_origin_rejection(monkeypatch: pytest.Monkey pass +@MODES +@pytest.mark.parametrize("size", [131_072, 131_073, 150_000, 8 * 1024 * 1024 + 1]) +async def test_csv_export_preserves_large_cells(mode: str, size: int) -> None: + claim = 'é, "quoted"\r\n' + "x" * size + row = { + "dataset_version": "1", + "organization_id": str(ORG), + "repository_id": str(REPOSITORY), + "review_id": str(REVIEW), + "assessment_id": str(ASSESSMENT), + "environment_id": str(ORG), + "finding_id": str(FINDING), + "claim": claim, + "impact": "Synthetic consequence", + "risk_domain": "SECURITY", + "severity": "HIGH", + "lifecycle_state": "OPEN", + "created_at": "2026-11-16T00:00:00Z", + "evidence_refs": "[]", + } + stream = io.StringIO(newline="") + writer = csv.DictWriter(stream, fieldnames=list(row)) + writer.writeheader() + writer.writerow(row) + text = stream.getvalue() + with Server( + lambda request, index: Reply( + body=text.encode(), + headers={ + "Content-Type": "text/csv", + "X-Proofline-Export-Version": "1", + "X-Proofline-Export-Settled-Until": "2026-11-16T00:00:00Z", + "X-Proofline-Export-Next-Cursor": "opaque/+cursor", + }, + ) + ) as server: + async with session(mode, server.url) as client: + kwargs = {"from_time": "2026-11-01T00:00:00Z", "to_time": "2026-11-15T00:00:00Z"} + if size > 8 * 1024 * 1024: + with pytest.raises(ProoflineError) as caught: + await call(client, "export_reviews", ORG, "findings", format="csv", **kwargs) + assert caught.value.type == "urn:proofline:sdk:invalid-response" + else: + page = await call(client, "export_reviews", ORG, "findings", format="csv", **kwargs) + assert page.rows == [row] + assert page.text == text + assert page.version == 1 + assert page.settled_until == "2026-11-16T00:00:00Z" + assert page.next_cursor == "opaque/+cursor" + assert len(server.requests) == 1 + + @MODES async def test_export_pages_preserve_csv_and_refuse_foreign_cursor(mode: str) -> None: def respond(request: Request, index: int) -> Reply: @@ -1392,6 +1845,110 @@ def respond(request: Request, index: int) -> Reply: assert caught.value.status == 404 +@MODES +@pytest.mark.parametrize( + ("format", "content_type"), + [ + ("csv", "Text/CSV; charset=utf-8"), + ("ndjson", "Application/X-NDJSON; charset=utf-8"), + ], +) +async def test_export_accepts_case_insensitive_content_type( + mode: str, format: str, content_type: str +) -> None: + def respond(request: Request, index: int) -> Reply: + body = ( + b"dataset_version,claim\n1,hello\n" + if format == "csv" + else b'{"dataset_version":1,"claim":"hello"}\n' + ) + return Reply( + body=body, + headers={ + "Content-Type": content_type, + "X-Proofline-Export-Version": "1", + "X-Proofline-Export-Settled-Until": "2026-10-25T00:00:00Z", + }, + ) + + with Server(respond) as server: + async with session(mode, server.url) as client: + page = await call( + client, + "export_reviews", + ORG, + "findings", + format=format, + from_time="2026-10-01T00:00:00Z", + to_time="2026-10-25T00:00:00Z", + ) + assert page.rows[0]["claim"] == "hello" + + +@MODES +@pytest.mark.parametrize("format", ["csv", "ndjson"]) +async def test_review_export_retains_every_recorded_kind(mode: str, format: str) -> None: + kinds = [ + "PULL_REQUEST", + "DEPLOYMENT", + "PATCH", + "COMMIT", + "FILES", + "MERGE_GROUP", + "REVISION_SCAN", + ] + rows = [ + { + "dataset_version": 1, + "kind": kind, + "created_at": "2026-10-24T00:00:00Z", + "organization_id": str(ORG), + "review_id": "00000000-0000-7000-8000-000000000002", + "status": "COMPLETED", + "trigger_origin": "AUTOMATIC", + } + for kind in kinds + ] + + def respond(request: Request, index: int) -> Reply: + assert request.path.startswith(f"/api/v1/organizations/{ORG}/exports/reviews?") + assert request.headers["Authorization"] == f"Bearer {TOKEN}" + return Reply( + body=( + ( + ",".join(rows[0]) + + "\r\n" + + "".join(",".join(map(str, row.values())) + "\r\n" for row in rows) + ).encode() + if format == "csv" + else ("\n".join(json.dumps(row) for row in rows) + "\n").encode() + ), + headers={ + "Content-Type": "text/csv" if format == "csv" else "application/x-ndjson", + "X-Proofline-Export-Version": "1", + "X-Proofline-Export-Settled-Until": "2026-10-25T00:00:00Z", + }, + ) + + with Server(respond) as server: + async with session(mode, server.url) as client: + page = await call( + client, + "export_reviews", + ORG, + "reviews", + format=format, + from_time="2026-10-01T00:00:00Z", + to_time="2026-10-25T00:00:00Z", + ) + assert [row["kind"] for row in page.rows] == kinds + # The generated wire enum must accept the same retained spellings. + assert [ExportReviewKind(row["kind"]).value for row in page.rows] == kinds + if format == "ndjson": + assert [ReviewsExportRow.from_dict(row).kind.value for row in page.rows] == kinds + assert page.next_cursor is None + + @MODES async def test_knowledge_negotiation_scope_and_no_retry(mode: str) -> None: refusal = False @@ -1506,3 +2063,290 @@ async def invoke(name: str, *args: Any, **kwargs: Any) -> Any: with pytest.raises(ProoflineError): await invoke("request_reverification", str(REVIEW), [str(REVIEW)], "a" * 40) assert len(observed) == 5 + + +@MODES +async def test_shared_review_outcome_contract(mode: str, monkeypatch: pytest.MonkeyPatch) -> None: + Clock(monkeypatch) + fixture = json.loads((Path(__file__).parent / "fixtures/review-outcomes.json").read_text()) + for case in fixture["cases"]: + body = case["review"] + pending = case["outcome"] is None + settled = next( + item["review"] for item in fixture["cases"] if item["name"] == "review-completed" + ) + with Server( + lambda request, index: Reply(body=settled if pending and index else body) + ) as server: + async with session(mode, server.url) as client: + result = await call(client, "wait_for_review", ORG, UUID(body["id"])) + assert result.status == ("COMPLETED" if pending else case["outcome"]), case["name"] + assert len(server.requests) == (2 if pending else 1), case["name"] + assert [ + { + "assessment_id": str(gap.assessment_id) if gap.assessment_id else None, + "reason_codes": list(gap.reason_codes), + } + for gap in result.gaps + ] == case["gaps"], case["name"] + + +@MODES +async def test_mcp_per_call_organizations_and_refusals(mode: str) -> None: + first, second, foreign = (str(ORG), str(REVIEW), str(ASSESSMENT)) + admitted = [first, second] + observed: list[dict[str, Any]] = [] + concurrent = False + overlap = threading.Barrier(2) + + def respond(request: Request, index: int) -> Reply: + assert request.path == "/mcp" + assert request.headers["Authorization"] == f"Bearer {TOKEN}" + body = json.loads(request.body) + if body["method"] == "initialize": + return Reply( + body={"jsonrpc": "2.0", "id": 1, "result": {"protocolVersion": "2025-11-25"}} + ) + assert request.headers["MCP-Protocol-Version"] == "2025-11-25" + if body["method"] == "notifications/initialized": + return Reply(status=202, body=b"") + params = body["params"] + observed.append(params) + if params["name"] == "list_organizations": + assert params["arguments"] == {} + result: dict[str, Any] = { + "content": [], + "structuredContent": { + "ok": True, + "data": {"organizations": [{"organization_id": value} for value in admitted]}, + }, + } + else: + if concurrent: + # Neither response completes until both tool calls have arrived. + overlap.wait(timeout=5) + target = params["arguments"].get("organization_id") + code = ( + "ORGANIZATION_REQUIRED" + if target is None + else "NOT_AUTHORIZED" + if target not in admitted + else None + ) + payload = ( + { + "ok": False, + "error": {"code": code, "message": "Target refused", "retryable": False}, + } + if code + else {"ok": True, "data": {"organization_id": target}} + ) + result = { + "isError": code is not None, + "content": [{"type": "text", "text": json.dumps(payload)}], + "structuredContent": payload, + } + return Reply(body={"jsonrpc": "2.0", "id": 2, "result": result}) + + with Server(respond) as server: + async with session(mode, server.url) as client: + + async def invoke(group: str, name: str, *args: Any, **kwargs: Any) -> Any: + result = getattr(getattr(client, group), name)(*args, **kwargs) + return await result if inspect.isawaitable(result) else result + + discovery = await invoke("mcp", "list_organizations") + assert discovery["structuredContent"]["data"]["organizations"] == [ + {"organization_id": first}, + {"organization_id": second}, + ] + cases = [ + ( + "knowledge", + "list_wiki_pages", + ("owner/name",), + {"commit": "a" * 40}, + {"repository": "owner/name", "commit": "a" * 40}, + ), + ( + "knowledge", + "get_wiki_page", + ("owner/name", "index"), + {}, + {"repository": "owner/name", "page_key": "index"}, + ), + ( + "knowledge", + "ask_codebase", + ("owner/name", "How?"), + {}, + {"repository": "owner/name", "question": "How?"}, + ), + ( + "knowledge", + "get_architecture_document", + (str(REVIEW),), + {}, + {"environment_id": str(REVIEW)}, + ), + ("knowledge", "get_plan", (str(REVIEW),), {}, {"plan_id": str(REVIEW)}), + ( + "knowledge", + "start_plan_implementation", + (str(REVIEW),), + {}, + {"plan_id": str(REVIEW)}, + ), + ( + "knowledge", + "get_plan_implementation", + (str(REVIEW),), + {}, + {"implementation_id": str(REVIEW)}, + ), + ( + "fixes", + "list_open_findings", + ("owner/name", 7), + {}, + {"repository": "owner/name", "pull_request_number": 7}, + ), + ("fixes", "get_fix_context", (str(REVIEW),), {}, {"finding_id": str(REVIEW)}), + ( + "fixes", + "request_reverification", + (str(REVIEW), [str(REVIEW)], "a" * 40), + {"note": "fixed"}, + { + "review_id": str(REVIEW), + "finding_ids": [str(REVIEW)], + "commit_sha": "a" * 40, + "note": "fixed", + }, + ), + ("fixes", "get_reverification", (str(REVIEW),), {}, {"request_id": str(REVIEW)}), + ] + for group, name, args, kwargs, expected in cases: + for target in (first, second): + answer = await invoke(group, name, *args, **kwargs, organization_id=target) + assert answer["structuredContent"]["data"]["organization_id"] == target + assert observed[-1] == { + "name": name, + "arguments": {**expected, "organization_id": target}, + } + + if mode == "async": + concurrent = True + answers = await asyncio.gather( + invoke("knowledge", "get_plan", str(REVIEW), organization_id=first), + invoke("fixes", "get_fix_context", str(REVIEW), organization_id=second), + ) + concurrent = False + assert [ + answer["structuredContent"]["data"]["organization_id"] for answer in answers + ] == [first, second] + + async def refused(target: str | None, code: str) -> None: + before = len(observed) + kwargs = {} if target is None else {"organization_id": target} + answer = await invoke( + "fixes", + "request_reverification", + str(REVIEW), + [str(REVIEW)], + "a" * 40, + **kwargs, + ) + assert answer["isError"] is True + assert answer["structuredContent"]["error"]["code"] == code + assert json.loads(answer["content"][0]["text"]) == answer["structuredContent"] + assert len(observed) == before + 1 + assert observed[-1]["arguments"].get("organization_id") == target + assert ("organization_id" in observed[-1]["arguments"]) == (target is not None) + + # An earlier explicit target must never become an implicit default. + await refused(None, "ORGANIZATION_REQUIRED") + await refused(foreign, "NOT_AUTHORIZED") + admitted.remove(first) + await refused(first, "NOT_AUTHORIZED") + remaining = await invoke("mcp", "list_organizations") + assert remaining["structuredContent"]["data"]["organizations"] == [ + {"organization_id": second} + ] + answer = await invoke("fixes", "get_fix_context", str(REVIEW), organization_id=second) + assert answer["structuredContent"]["data"]["organization_id"] == second + assert len(server.requests) == len(observed) * 3 + + +def test_mcp_public_types_accept_legacy_and_targeted_calls(tmp_path: Path) -> None: + # Compile consumer code through the public entry point; dynamic HTTP tests + # cannot catch a missing keyword in just one sync/async method signature. + lines = ["from proofline import ProoflineClient, AsyncProoflineClient, KnowledgeResult"] + calls = [ + 'knowledge.list_wiki_pages("owner/name", commit="a" * 40)', + 'knowledge.get_wiki_page("owner/name", "index")', + 'knowledge.ask_codebase("owner/name", "How?")', + 'knowledge.get_architecture_document("environment-id")', + 'knowledge.get_plan("plan-id")', + 'knowledge.start_plan_implementation("plan-id")', + 'knowledge.get_plan_implementation("implementation-id")', + 'fixes.list_open_findings("owner/name", 7)', + 'fixes.get_fix_context("finding-id")', + 'fixes.request_reverification("review-id", ["finding-id"], "a" * 40, note="fixed")', + 'fixes.get_reverification("request-id")', + ] + for prefix, kind, wait in [ + ("", "ProoflineClient", ""), + ("async ", "AsyncProoflineClient", "await "), + ]: + lines.append(f"{prefix}def use_{kind}(client: {kind}) -> None:") + lines.append(f" result: KnowledgeResult = {wait}client.mcp.list_organizations()") + for expression in calls: + lines.append(f" result = {wait}client.{expression}") + targeted = expression[:-1] + ', organization_id="00000000-0000-7000-8000-000000000001")' + lines.append(f" result = {wait}client.{targeted}") + fixture = tmp_path / "mcp_types.py" + fixture.write_text("\n".join(lines)) + # Use the same mypy configuration as the SDK qualification gate. + subprocess.run([sys.executable, "-m", "mypy", str(fixture)], check=True) + + +@MODES +async def test_export_ndjson_preserves_unicode_line_separators(mode: str) -> None: + kwargs = { + "from_time": "2026-10-01T00:00:00Z", + "to_time": "2026-10-25T00:00:00Z", + } + + for separator in ("\x85", "\u2028", "\u2029"): + row = { + "dataset_version": 1, + "claim": f"before{separator}after", + } + body = (json.dumps(row, ensure_ascii=False) + "\n").encode("utf-8") + + def respond(request: Request, index: int) -> Reply: + return Reply( + body=body, + headers={ + "Content-Type": "application/x-ndjson", + "X-Proofline-Export-Version": "1", + "X-Proofline-Export-Settled-Until": "2026-10-25T00:00:00Z", + "X-Proofline-Export-Next-Cursor": "next-page", + }, + ) + + with Server(respond) as server: + async with session(mode, server.url) as client: + exported = await call( + client, + "export_reviews", + ORG, + "findings", + format="ndjson", + **kwargs, + ) + + assert len(exported.rows) == 1 + assert exported.rows[0]["claim"] == row["claim"] + assert exported.next_cursor == "next-page"