Clarify restart-safe batches and scripted UI handler tests - #181
Open
Wenjie Fan (gggdttt) wants to merge 1 commit into
Open
Wenjie Fan (gggdttt) wants to merge 1 commit into
Wenjie Fan (gggdttt) wants to merge 1 commit into
Conversation
Address Nikola's batching and UI-handler feedback on PR #132. Preserve existing false-positive guards and defer the unconfirmed IsHandled policy. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: f841a18b-535a-498e-96f2-f279b5378da5
Jesper Schulz-Wedde (JesperSchulz)
requested changes
Sep 15, 2026
Jesper Schulz-Wedde (JesperSchulz)
left a comment
Contributor
There was a problem hiding this comment.
Two necessary contract/integration fixes remain before this is mergeable:
- Rebase onto current
main.evaluation/review-fixtures.jsonnow conflicts with #148's exact-tree coverage. Preserve its seven performancearticles, addavoid-commit-inside-loops, and preserve this PR's testing context. The harness currently appliescontextto the whole domain, so do not attach the credit-limit scenario to every performance case; either rely on the now self-describing sample (the merged 48-case tree prepares cleanly without that context) or add per-article context support. - Align
microsoft/skills/review/al-performance-review.mdwith the revised article. Its targeted cue still only exempts a persisted watermark/state and says to match every full-tailFindSetwith periodic commits. The new guidance correctly also exempts demonstrably idempotent/deduplicated replay and says bounded retrieval must not be required solely because a loop commits. Encode those same exclusions in the leaf contract so routing cannot reinstate the false positives this PR removes.
The changed AL samples otherwise match current BC behavior (Commit, TopNumberOfRows, Duration, handler signatures, Library - Variable Storage, and ExpectedConfirm/ExpectedMessage). Branch validators pass (34 fixtures); a conflict-resolved current-main exact-tree preparation passes 48 fixtures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow up on Nikola's review of #132 without reverting its false-positive guards. This changes two knowledge articles, their four AL samples, and the existing fixture selection/context. Article slugs and review skills remain unchanged.
Restart-safe batches
Separate commit cadence, restart safety, and bounded retrieval. Row-count or elapsed-time commits can be valid after complete business units. An atomic checkpoint/processed state is one retry strategy; demonstrably idempotent replay or durable deduplication is another. A missing watermark alone does not establish corruption, and committing does not itself require TOP-bounded retrieval.
Both samples now perform the same one-time credit-limit increase, select the same exact key buffer, and commit after at most 500 selected customers or an observed one-minute threshold. The helper is identical; only durable progress differs. The good sample initializes/reloads state and commits the last processed, not merely selected, key with the corresponding changes. Errors propagate. The time threshold is checked between complete units, not a fixed-duration guarantee. The examples assume one worker and a stable customer set.
The previous UpperCase operation demonstrated redundant replay, not a non-idempotent correctness failure. The replacement makes duplicate increases after a retry concrete; the old sample did contain periodic commits.
Addresses batch cadence, progress and time-based examples, safe replay versus corruption, and aligned samples.
Scripted UI interactions
Restore a paired Confirm/Message flow with the same Boolean outcome assertion. The good test clears
LibraryVariableStorage, enqueues the question/reply/message, dequeues and verifies each interaction, and finishes withAssertEmpty. The bad test blindly accepts/dismisses the same interactions. Recommend reusing one handler per type where practical, not as a platform requirement.Keep semantic reset/capture/assert testing, intentionally optional
[SendNotificationHandler(true)], and the separate listed-but-unreached bad handler scenario. Neither missing queue storage nor a legitimate specialized handler is a finding by itself.Addresses queue-driven expectations, restoring paired Confirm examples, and library guidance and handler reuse.
Deferred: IsHandled policy
The requests to stop introducing IsHandled and sync the event-review guidance with Marko are not addressed here. Scope, exceptions, and alternatives need Marko's confirmation. Existing publisher contracts and carry-over/reset false-positive guards remain intact. This PR does not resolve all nine comments or resolve the old threads.
Validation and limits
These are static/metadata and fixture-preparation checks, not AL compilation, Business Central runtime execution, or model evaluation. No live engine/model/judge calls or workflow dispatches were made. No Gold entries, engine pins, frozen candidates, or ongoing A/B runs are changed.