Skip to content

fix(review): #2718 review findings, round 1 - #2729

Open
WilcoLouwerse wants to merge 5 commits into
fix/flow-step-report-and-contractsweep-end-nodefrom
review/pr-2718-fixes
Open

WilcoLouwerse wants to merge 5 commits into
fix/flow-step-report-and-contractsweep-end-nodefrom
review/pr-2718-fixes

Conversation

@WilcoLouwerse

@WilcoLouwerse WilcoLouwerse commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Fixes for the round-1 review of #2718 (#2718 (review)). Merge into fix/flow-step-report-and-contractsweep-end-node, then re-request the review; nothing here is merged by the reviewer.

Findings → commits

Finding Commit What changed
f1 🟡 E2E spec still expects the trailing openregister.end node d977248 Removed the four openregister.end / openregister-end expectations and the trailing end transition in the run-log list from flow-native-sync.spec.ts.
f1 (pre-push) 5759237 The canvas comment's node count reads ten, matching the ten-node generated pipeline.
f1 (review of this PR) 7c02124 The first run of the generated flow asserts status completed; the shared driveRunToTerminal helper still accepts stopped.
f3 🟢 Failed fetches leave no trace in the hop report f98297d SourcePaginateNode reports an errors count, incremented once per failed fetch under onError: continue; new unit test, existing report assertions updated.
f4 🟢 Stubs called verbatim copies, but FlowStepReport is not cb23c87 The FlowStepReport stub header says it is a subset (CONTEXT_KEY, put(), take()); both stub headers name integriq instead of openconnector. IFlowEndNode stays "verbatim" (identical apart from the omitted @spec tag).

Left to the author (threads stay open)

Checks run on this branch

  • php -l on the four changed PHP files → no syntax errors
  • vendor/bin/phpunit -c phpunit-unit.xml on SourcePaginateNodeTest (27), ContractMatchNodeTest (16), ContractSweepNodeTest (13), SynchronizationFlowGeneratorTest (45) → OK; with the f3 change reverted the new and the updated report test fail
  • vendor/bin/phpcs --standard=phpcs.xml → clean on SourcePaginateNode.php and both stubs; SourcePaginateNodeTest.php carries the same 110 pre-existing errors before and after, none added
  • npx eslint tests/e2e/spec-coverage/flow-native-sync.spec.ts (Node 22) → clean (also after 7c02124)
  • run-hydra-gates.sh --scope-to-diff --base 820e389 → exit 0, 36 of 36 applicable gates ran
  • Independent pre-push review of the whole diff → no findings after the 5759237 round
  • not run: the Playwright e2e spec (no local E2E environment; the E2E job is skipped on PRs)
  • not run: psalm (crashes on PHP 8.4 locally), phpstan per file (no files found in single-file mode); CI runs both

🤖 Generated with Claude Code

WilcoLouwerse and others added 4 commits October 23, 2026 14:23
…ster.end node

The generator no longer appends openregister.end after contract-sweep, so
the flow-native sync E2E spec drops it from the documented chain, both
node-type lists, the canvas node counts and the run-log transition list
(the trailing 'end' transition came from the same node).

Thread: #2718 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Under onError continue a failed fetch emitted an error item but counted
nothing, so a run whose every fetch failed reported objects 0 / pages 0,
the same summary as an empty source. The source-paginate report now
carries an errors bucket, incremented in the catch branch, and a unit
test drives two failing fetches under continue and asserts the count.
The existing report assertion now expects errors => ['count' => 0].

Thread: #2718 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…port is not

The FlowStepReport stub carries only CONTEXT_KEY, put() and take(); the
real openregister class also has line() and its limits, so its header now
calls it a subset. Both stub headers named openconnector as the repository
that does not ship the spec path; that is integriq. The IFlowEndNode stub
was checked against openregister development and matches apart from the
omitted @SPEC tag, so it stays described as verbatim.

Thread: #2718 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the trailing openregister.end node the generated sync pipeline has
ten nodes, so the canvas comment's "count of eleven" now reads ten.

Thread: #2718 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bbrands02

Copy link
Copy Markdown
Contributor

Code Review — Integriq PR #2729

The implementation looks correct overall. The previous findings concerning outdated E2E expectations, missing pagination error counts, and inaccurate test-stub documentation have been addressed.

I found no confirmed blocking issues in the changed code.

Two points are worth checking before merging.

  1. [Low] E2E test still accepts stopped as successful

File: tests/e2e/spec-coverage/flow-native-sync.spec.ts

The original purpose of PR #2718 was to make generated synchronization flows finish as completed rather than stopped.

This PR correctly removes the trailing openregister.end node from the expected pipeline.

However, the E2E test still accepts stopped as a successful terminal status.

Please investigate whether the generated synchronization flow should now always finish with status completed.

If so, update the relevant assertion to require completed rather than accepting stopped.

This would ensure the test actually protects the original behavioral fix.

Do not change unrelated tests that intentionally support stopped executions.

  1. [Low — Needs verification] Pagination errors under dead_letter

File: lib/Flow/SourcePaginateNode.php

The new errors counter correctly records failed fetches when onError is continue.

Please verify that the same reporting behavior applies when onError is dead_letter.

Specifically:

  1. Confirm whether both policies execute the same catch branch.
  2. Verify that every failed fetch contributes exactly one error.
  3. Confirm that throw/rethrow behavior remains unchanged.
  4. Ensure the report does not incorrectly claim a completed execution when an exception propagates.

If both policies already share the same implementation, no production changes are required.

Add regression coverage only if there is a realistic untested difference.

Verified improvements

The following changes look correct:

  • Removed obsolete openregister.end expectations.
  • Updated the generated pipeline node count to ten.
  • Removed the obsolete end transition from run-log expectations.
  • Added errors reporting to SourcePaginateNode.
  • Added regression coverage for multiple failed fetches.
  • Updated successful-fetch reporting assertions to include errors: 0.
  • Corrected FlowStepReport stub documentation.
  • Corrected repository references in the test-stub documentation.

Please preserve these changes.

Requested actions

  1. Verify whether the E2E flow status should explicitly be completed.
  2. Verify error counting under dead_letter.
  3. Make changes only if the investigation identifies a real gap.
  4. Run the relevant tests.
  5. Report which findings required changes and which were already correct.

Avoid unnecessary refactoring.

Overall recommendation: Approve once these minor points are clarified. No confirmed blocking defects identified.

SUCCESSFUL_STATUSES accepts `stopped`, so dropping the trailing
`openregister.end` node (which threw FlowStop and turned every successful
sync into a `stopped` run) was not pinned by the spec. The first run of the
generated flow now asserts `completed` at its own call site; the shared
driveRunToTerminal helper keeps accepting `stopped` for flows that end in a
deliberate stop.

Raised in #2729 (comment)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@WilcoLouwerse

Copy link
Copy Markdown
Contributor Author

Thanks, both checked. (1) Changed in 7c02124: the first run of the generated flow now asserts completed; the shared driveRunToTerminal helper still accepts stopped for flows that end in a deliberate stop. (2) No change needed: dead_letter and continue share the one catch branch, every failed fetch increments errors exactly once, and stop rethrows before the counter and before writeReport, so no report claims a completed run. The existing dead_letter test covers that branch. The Playwright spec could not run locally; the new assertion runs on the next E2E run.

This branch has not been deployed

No deployments
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.

2 participants