Repository navigation
Report a broken import run instead of staying silent - #749
Conversation
Three counts cannot say a pass was lost, so the run sends zeros and a coded reason rather than a partial tally the surviving pass would make look clean. What is not available is silence: it reads identically to a machine that died, and the browser waits that out before saying anything.
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
Code Review by Qodo
1.
|
alexeyzimarev
left a comment
There was a problem hiding this comment.
Standards
-
[P2] Align the contracts with
run_failed's non-refusal semantics. The merged server contract explicitly makes this the one reason that is not a refusal: surviving passes may have landed sessions even though the wire counts must be zero because the totals are unaccounted.BrowserFirstRunFlow.cs:491now constructs it throughRefusal, whose comment at lines 509-513 says it is always a refusal;FirstRunImportOutcome.cs:3-9andFirstRunFlowModels.cs:117-118say every reason belongs only to a run that moved nothing; andIFirstRunImportLane.cs:42-45still says a null result makes the caller send nothing. These contracts are now false. Please generalize the helper/name and update the comments to distinguish zero reported counts from actual sessions that may have landed. -
[P3] Rewrite the PR description as current-state rationale. Its “reported nothing… That held… it becomes…” and “the suite carried a test asserting the old silence… now pins…” passages are change narration and a test-diff inventory, both forbidden by
.github/PULL_REQUEST_TEMPLATE.md. State the current constraint and verification result directly. -
[P3] Reduce the duplicated test doc comment.
BrowserFirstRunFlowTests.cs:1573-1577repeats rationale already carried by the production comments and by the test's name/assertions.CLAUDE.mdsays comments are scarce, one or two lines is the norm, and longer blocks must contain something unavailable elsewhere.
The existing thread already covers the missing GitHub half of the reference line, so I have not duplicated that finding here.
Spec
- [P3] Pin the server token independently.
BrowserFirstRunFlowTests.cs:1591compares the emitted reason with the sameFirstRunImportOutcomeReasons.RunFailedconstant production uses. A mistyped wire literal would keep this test green while the server rejects every report and the client retries until timeout—the rollout failure the spec explicitly warns about. The verification claim says this test pins therun_failedtoken and three zero counts; currently only the counts are independent. Assert the literal"run_failed"here or add equivalent wire-serialization coverage.
Validation: dotnet build Capacitor.slnx --no-incremental succeeded with 0 errors and 0 warnings; all 102 BrowserFirstRunFlowTests passed locally; GitHub reports all 6 CI checks passing.
Summary: Standards — 3 new findings, worst P2 stale contracts. Spec — 1 P3 finding, missing independent wire-token coverage.
Two of the three tokens mean nothing was attempted; a lost pass means the accounting is gone, so sessions may have landed behind zeroes the wire requires. The contracts named every token a refusal, and the lane still promised silence.
|
All four taken, in 4b098c0 plus a description rewrite. P2, the stale contracts. Correct, and the merged server contract already draws the line the CLI half was missing —
Spec, the wire token. Good catch, and the failure mode you describe is the rollout one. The assertion is now the literal P3 description rewritten as current-state constraint, and P3 test comment cut to the two lines that say what the test pins.
|
alexeyzimarev
left a comment
There was a problem hiding this comment.
Standards
- [P2] Finish separating reported counts from actual sessions landed.
src/Capacitor.Cli.Core/FirstRun/FirstRunImportOutcome.cs:8-10still says the server “rejects any token at all on an outcome that moved something.” That contradicts the newRunFailedcontract immediately below: sessions may have landed even though the report deliberately carries zeroes. The server can only reject a reason alongside non-zero reported counts; it cannot establish that the underlying run moved nothing. Please use that precise wording here, matchingFirstRunFlowModels.cs:117-118.
The other standards findings from the first review are addressed: ReasonOnly replaces the misleading Refusal name, the lane/model contracts are corrected, the test comment is focused, and the PR description now states current constraints and evidence.
Spec
No findings. The regression test now independently pins the literal "run_failed" and all three zero counts, and the implementation still retains/retries the reason-only outcome until the server records it.
Validation: dotnet build Capacitor.slnx --no-incremental succeeded for all 12 projects with 0 errors and 0 warnings; all 102 BrowserFirstRunFlowTests passed locally; all 6 GitHub CI checks pass. One preceding focused-test launch exited once with native code 139 before producing test output; the immediate identical rerun passed.
Summary: Standards — 1 remaining finding (P2 stale contract wording). Spec — clean.
The server's guard sums the three reported figures, so that is all it can judge: whether the run behind them moved anything is not visible to it.
|
Taken, in 2c93c16 — and you were right about the wording being the precise point rather than a nicety. The store's guard is That Sweeping the phrase rather than the line found one more instance, in my own previous commit: Two other hits in the same sweep I left alone deliberately, since neither conflates the two — both describe a run that genuinely did move nothing: the import-outcome route's "an outcome that moved nothing is still worth sending" (why a zero-count report is sent at all, as the finished signal), and Comment-only, so the evidence is the build: |
alexeyzimarev
left a comment
There was a problem hiding this comment.
Standards
- [P3] State why the GitHub half of the reference line is absent. The body starts with only
AI-2405.CLAUDE.mdrequires both the Linear issue and a GitHub closing reference;.github/PULL_REQUEST_TEMPLATE.mdpermits dropping a nonexistent half only when the omission is stated. A repository issue search finds no AI-2405 match, so please make that explicit (for example,AI-2405 — no GitHub issue) or add the closing reference if one exists.
No code-hunk violations or baseline smells found. Commit 2c93c16e correctly resolves the remaining stale contract wording: both affected comments now describe the server guard in terms of non-zero reported counts.
Spec
No findings. Both null-return and thrown-import paths now owe run_failed with three zero counts; rejected delivery remains retained and retried without rerunning the import; the test independently pins the "run_failed" wire literal; and the known-token set includes it. The merged server-side AI-2405 change defines the matching token and semantics.
Validation: reviewed head 2c93c16e; all 6 GitHub CI checks pass. Per request, no local tests or builds were run.
Summary: Standards — 1 P3 PR-metadata finding; Spec — clean.
AI-2405 - #749 (review)
What & why
The browser's Done screen waits for the machine's word rather than inferring an ending from the figures, so an import whose pass threw has to say so. It reports three zeros and the
run_failedtoken: three counts cannot express "some unknown number is unaccounted", and the surviving pass's figures alone would state a clean import.Where to look
Silence is the one option not available — it reads identically to a machine that died, which is a different ending, with different copy and half an hour of waiting between them. Partial counts are worse than zeros: the lost pass's skipped and failed are unknown and the route requires all three, so they would put a measured-looking zero where nobody measured.
run_failedis the one token that is not a refusal — sessions may have landed behind its zeros — so the token vocabulary and the lane's contract name it a failure, and copy saying the history was left alone is wrong for it. It also needs the server to know the token before this ships: reversed, the store refuses the report and the retry re-sends it every tick until the budget runs out.Verification
Capacitor.Cli.Core.Tests.Unit→ 2583 passed.The throwing path pins the wire literal
"run_failed"and three zero counts; mutating the constant torun_faledfails that assertion.