Skip to content

Run the async client on trio as well as asyncio - #1

Open
Om-Beast wants to merge 10 commits into
mainfrom
fix/async-client-trio-backend
Open

Om-Beast wants to merge 10 commits into
mainfrom
fix/async-client-trio-backend

Conversation

@Om-Beast

@Om-Beast Om-Beast commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Fork-internal PR to evaluate the Trio backend fix proposed in prooflinedev/sdk-python#48.

This PR now uses the same base (1acf77b) and head (eeae462) as the upstream PR: 6 files, +232/-3. The existing verification of this head passes python scripts/check.py, including 230 tests and all 12 backend regression cases.

Review scope correction

The earlier Proofline run compared this branch with the fork's stale main (bb09db3), which was 50 upstream commits behind. That expanded the review to 93 files and included upstream schema and generated-code changes.

Both reported warnings—deploy-verification commit_sha validation and the required environment_external_key field—refer to openapi.public.json, which is identical to current upstream main and is outside this PR's corrected diff. The fork's main has been fast-forwarded to upstream; GitHub now marks both inline threads outdated. This scope correction does not claim to fix or disprove those upstream schema concerns.

The previous Proofline report applies to the old comparison. A fresh review should evaluate the corrected six-file diff.


Originally generated by Claude Code.

AsyncProoflineClient bounds I/O with anyio, but its Retry-After backoff
and wait_for_review polling slept with asyncio.sleep. Under trio a
retried request surfaced as a status-0 invalid-response problem and
wait_for_review raised "no running event loop". Sleep with anyio so both
paths run on any backend that anyio and httpx support, and test the
sleeping and deadline paths on asyncio and trio.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017GA2KNDKv463GeBmDCYL95
Retain exact-head review polling and every existing dependency lock entry. Exercise retry backoff, pinned-head polling and request deadlines on both asyncio and Trio.

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proofline has 2 new findings to review.

View full review in Proofline

Comment thread openapi.public.json Resolved
Comment thread openapi.public.json Resolved

@prooflinedev prooflinedev Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proofline has 10 new findings to review. 13 open findings need attention in this pull request.

View full review in Proofline

1 more finding is on the Proofline Check.

)
assert review.incomplete_causes == [
"LATER_CAUSE",
models.IncompleteCauseType0.EVIDENCE_UNAVAILABLE,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Review cause test passes when a known cause decodes as a string

The list comparison in tests/test_generated_operation.py accepts a plain string in place of the expected enum member because they compare equal.

The test would miss a regression where the string fallback in scripts/generate.py shadows known review causes.

Assert that the known cause is the expected enum member using is.

Details

test_checkpoint_keeps_its_positional_result in tests/test_generated_operation.py compares against IncompleteCauseType0.EVIDENCE_UNAVAILABLE, defined in proofline/_generated/models/incomplete_cause_type_0.py as a StrEnum member.

View finding in Proofline

Comment thread requirements-dev.txt
Comment on lines +765 to +767
trio==0.35.0 \
--hash=sha256:7efb295c78a0ecd1235c5759e620b5da564ca80d2efcb0055423588547248b96 \
--hash=sha256:9a062a029487c1bdbcc1b2543b729a0bde857ce478b1512c84f391f628e0c5c9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Wheel and sdist smoke tests miss accidental Trio imports

scripts/check.py installs Trio from requirements-dev.txt into both artifact smoke environments, although pyproject.toml does not require it at runtime.

An unconditional Trio import would pass scripts/install_smoke.py but fail in a default installation without Trio.

Keep Trio for backend tests and run both artifact smoke tests in separate environments with runtime dependencies but no Trio.

View finding in Proofline

Comment thread openapi.public.json
}
],
"description": "The deterministic World checks recorded for this assessment."
"description": "The deterministic environment checks recorded for this assessment.\n Only assessments made by the check evaluator Proofline retired on\n 2026-11-05 carry them. A later assessment records none, and\n `receipt_recorded` is then false."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · SDK help omits why current assessments have no check receipt

Both generated assessment models omit the new retirement guidance, and CustomerChecks in proofline/_generated/models/customer_checks.py only says what a missing receipt contains.

SDK users cannot tell that receipt_recorded: false is expected after retirement.

Document the retirement rule on the shared checks schema and regenerate the SDK.

View finding in Proofline

Also at:

Comment thread openapi.public.json
}
],
"description": "The change-level diagram: the changed call path from the pinned code\n index and the relations World declares. Absent when the review\n recorded none."
"description": "The change-level diagram: the changed call path from the pinned code\n index. A diagram recorded by the check evaluator Proofline retired on\n 2026-11-05 can also show the environment relations it returned.\n Absent when the review recorded none."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Diagram docs credit the retired evaluator with recording the diagram

The new change_diagram wording in openapi.public.json attributes the diagram to the retired evaluator rather than only the historical environment relations it supplied.

Client authors get the wrong provenance for diagrams generated by the server from the stored graph.

Apply the retirement qualifier to the environment relations, not to the diagram, and regenerate the SDK.

View finding in Proofline

Also at:

Comment thread openapi.public.json
}
],
"description": "The change-level diagram: the changed call path from the pinned code\n index and the relations World declares. Absent when the review\n recorded none."
"description": "The change-level diagram: the changed call path from the pinned code\n index. A diagram recorded by the check evaluator Proofline retired on\n 2026-11-05 can also show the environment relations it returned.\n Absent when the review recorded none."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Standalone diagram help omits that evaluator relations are historical

ChangeDiagramView.legend in openapi.public.json describes environment provenance without the historical restriction introduced on the parent field.

Readers of standalone schema or SDK help cannot tell whether current diagrams can include those relations.

Qualify evaluator-supplied relations in the legend description and regenerate the SDK.

View finding in Proofline

Also at:

Comment thread openapi.public.json
Comment on lines 1173 to +1176
"$ref": "#/components/schemas/CustomerChecks"
}
],
"description": "The deterministic World checks recorded for this assessment."
"description": "The deterministic environment checks recorded for this assessment.\n Only assessments made by the check evaluator Proofline retired on\n 2026-11-05 carry them. A later assessment records none, and\n `receipt_recorded` is then false."

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Completed reviews return INCOMPLETE after evaluator retirement

outcome in proofline/outcomes.py treats every absent receipt as a gap, but CustomerAssessment in openapi.public.json now documents that later assessments record no receipt.

Both sync and async wait_for_review in proofline/client.py return INCOMPLETE for otherwise completed reviews.

Require receipts only when deterministic checks were expected, while preserving other assessment gaps.

View finding in Proofline

Also at:

Comment thread openapi.public.json
Comment on lines 2701 to +2702
"const": "RUNTIME_INVENTORY_UNAVAILABLE",
"description": "The check could not read an inventory of the connection's Cloud Run\n services or ECS tasks: Kian retains none, or the read failed or timed\n out. Nothing shows what runs.",
"description": "The check could not read an inventory of the connection's Cloud Run\n services or ECS tasks. Kian may retain none. When opening the evidence\n database or reading its workspace failed, or the read exceeded its\n deadline, the report records `runtime_read_cause`.",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · The inventory gap points to an undocumented diagnostic

The RUNTIME_INVENTORY_UNAVAILABLE description in openapi.public.json directs readers to runtime_read_cause on an unnamed report, but the public deploy and checkpoint schemas expose no such field.

API and SDK consumers have no documented way to distinguish missing inventory from a failed or timed-out read.

Identify where consumers can read runtime_read_cause, or say explicitly that the public response does not distinguish these cases.

Details

get_commit_deploy_verifications in openapi.public.json returns CommitDeployVerifications, which contains CommitDeploy entries with DeployCoverageCheckpoint entries. The DeployCoverageCheckpoint docstring in proofline/_generated/models/deploy_coverage_checkpoint.py lists the gap but does not explain its possible causes. Before this change, the gap description listed the causes without directing readers to a report.

View finding in Proofline

workflow_run_id: int | None | Unset = UNSET
rolled_back: bool | Unset = False
github_deployment_ids: list[int] | Unset = UNSET
verification_ended: bool | Unset = False

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Omitted verification_ended does not deserialize to False

CommitDeploy.from_dict in proofline/_generated/models/commit_deploy.py passes UNSET when verification_ended is omitted, overriding the False default documented in openapi.public.json.

SDK callers receive a sentinel instead of a boolean, so verification_ended is False fails.

Use False as the fallback when parsing an omitted verification_ended.

Details

UNSET in proofline/_generated/types.py is falsey but is not False. The HTTP 200 parser in proofline/_generated/api/default/get_commit_deploy_verifications.py calls CommitDeployVerifications.from_dict in proofline/_generated/models/commit_deploy_verifications.py, which returns the parsed deployments without normalizing the field.

View finding in Proofline

Comment on lines +1126 to +1128
github_deployment_ids = cast(list[int], d.pop("github_deployment_ids", UNSET))

verification_ended = d.pop("verification_ended", UNSET)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Deployment metadata lookups now raise KeyError

CommitDeploy in proofline/_generated/models/commit_deploy.py moves four response keys to attributes, but mapping reads still only check additional_properties.

Existing reads such as deploy["github_deployment_ids"] raise KeyError even when the response includes the key.

Preserve mapping lookup and membership for the four promoted keys when present in the response.

Details

Before this change, the four keys remained in additional_properties. This change removes github_deployment_ids, verification_ended, aws_provider, and aws_run_id from that dictionary during parsing. CommitDeployVerifications in proofline/_generated/models/commit_deploy_verifications.py returns the parsed objects directly; no repository caller was found performing the affected lookup.

View finding in Proofline

@@ -547,16 +558,41 @@ def _parse_counted_incomplete_causes_item(
return componentsschemas_credit_refusal_cause_type_0
except (TypeError, ValueError, AttributeError, KeyError):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning · Review cause arrays accept non-string entries

The new fallback in both review models returns non-string cause entries unchanged instead of rejecting them.

A response containing a JSON null cause now yields None in the parsed model, where callers expect a string and may call string methods.

Check isinstance(data, str) before each fallback and raise TypeError for non-strings while preserving unknown strings.

Details

Both counted_incomplete_causes and incomplete_causes are affected in ReviewSummary (proofline/_generated/models/review_summary.py) and CustomerReviewDetail (proofline/_generated/models/customer_review_detail.py). The successful detail response passes decoded JSON directly into the model parser in proofline/_generated/api/default/get_review.py.

View finding in Proofline

Also at:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant