Repository navigation
Add events knowledge domain and review leaf skill - #43
Merged
Jesper Schulz-Wedde (JesperSchulz) merged 6 commits intoJun 25, 2026
Merged
Conversation
This was referenced Jun 24, 2026
Add a new `events` knowledge domain covering AL events & subscribers, wired into the AL review pipeline. - 3 atomic articles (+ .good.al/.bad.al samples) under microsoft/knowledge/events/: the IsHandled override pattern, thin OnBefore/OnAfter integration-event publishers, and static vs manual subscribers. - New leaf skill microsoft/skills/review/al-events-review.md sourcing the events domain. - Wired into microsoft/skills/review/al-code-review.md (sub-skills + Source + description) and README.md (leaf-skill count + domain list). AL event syntax verified against Microsoft Learn. Samples are demonstration-only (not compiled by CI). Additive change; no contract change. Part of #34. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Add 12 atomic knowledge articles under microsoft/knowledge/events covering general AL event-design best practices: IsHandled initialization and OnAfter preservation, appending new event parameters, position-based event naming, reusing/extending events, avoiding per-iteration publishing, Temp-prefixing temporary record parameters, unabbreviated parameter names, preferring the this keyword over IncludeSender, avoiding loosely typed parameters, not mutating existing event contracts, and not bypassing critical operations with IsHandled. Each article ships a .good.al and .bad.al demonstration sample (object IDs 50240-50296; not compiled by CI). Extend the al-events-review leaf Worklist with one targeted check per new rule. Additive only; no contract or wiring change (events leaf already wired). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Correct wording in five events articles to reflect that AL event subscribers bind by parameter name, not position: - add-new-event-parameters-at-the-end: drop the inaccurate claim that appending a parameter forces subscribers to be updated or causes wrong values; keep the append-at-end best practice. - do-not-add-ishandled-to-an-existing-event: reframe from "breaking change" to the semantic/purpose shift that leaves existing subscribers pointless; rename the breaking-change keyword to semantic-change. - name-events-by-publisher-position: extend the good sample with position-named publishers raised from table and report trigger contexts. - initialize-ishandled-to-false-before-publishing: scope the detection and best practice to events that actually carry a var IsHandled, so an OnBefore with no IsHandled is not flagged. - do-not-bypass-critical-operations-with-ishandled: add a litmus-test definition of a critical operation (code that cannot stand as an independent, self-contained unit). Knowledge-only; no contract or wiring change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Remove the last name-vs-position misconception from the Anti Pattern so it is consistent with the corrected Description: mid-list insertion is framed as noisy and harder to review rather than as forcing subscriber re-mapping. Detection sentence unchanged. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Marko Aleksandric (AleksandricMarko)
approved these changes
Jun 25, 2026
Add @AleksandricMarko and @pchriste-microsoft-com as required reviewers for the events knowledge domain, matching the existing per-domain expert ownership convention. Inserted in alphabetical order ahead of the performance line. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Jesper Schulz-Wedde (JesperSchulz)
force-pushed
the
jesperschulz-seed-events-domain
branch
from
June 25, 2026 10:00
070fa5e to
ad30e2b
Compare
4 of 12 tasks
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
Adds a new
eventsknowledge domain covering AL events & subscribers, fully wired into the AL review pipeline. This is increment #3 of the knowledge-seeding initiative, followingerror-handlingandinterfaces. The change is purely additive — no contract change (skills/read.md|write.md|do.md|entry.mduntouched).3 atomic articles (each with
.good.al+.bad.alsamples)Under
microsoft/knowledge/events/:IsHandledpattern to make base behaviour overridable — publisher exposes[IntegrationEvent(false, false)] local procedure OnBeforeX(…; var IsHandled: Boolean); the routine raises it and guardsif IsHandled then exit;; a subscriber setsIsHandled := true. Bad: noOnBefore/IsHandledhook (not extensible), or a missingif IsHandled then exit;guard.OnBefore/OnAfterintegration events to expose extension points — raise thin events at operation boundaries passingvar Rec/var IsHandled, with empty publisher bodies. Bad: business logic inside the[IntegrationEvent]publisher body, or no extension points at all.BindSubscription— static[EventSubscriber]for always-on;EventSubscriberInstance = Manual+BindSubscription/UnbindSubscriptionfor scoped behaviour. Bad: static subscriber for always-on side effects, or a manual subscriber bound (and held on aSingleInstanceglobal) and never unbound.Leaf review skill
microsoft/skills/review/al-events-review.md— modeled onal-error-handling-review.md: 5 sections (Source/Relevance/Worklist/Action/Output), sources theeventsdomain, worklist tokens (IntegrationEvent,BusinessEvent,EventSubscriber,IsHandled,BindSubscription,UnbindSubscription,EventSubscriberInstance,OnBefore,OnAfter,Manual), populated + empty-corpusfindings-reportexamples.Wiring (additive)
microsoft/skills/review/al-code-review.md— added the leaf to the frontmattersub-skillslist and the## Sourcebullet list; appended, eventsto the line-6descriptionparenthetical.README.md— leaf-skill countseven → eight; appended, eventsto the domain list.API verification
All AL event syntax was verified against Microsoft Learn (not training recall):
IntegrationEvent/BusinessEventattributes and empty publisher bodies; the exact[EventSubscriber(ObjectType, ObjectId, EventName, ElementName, SkipOnMissingLicense, SkipOnMissingPermission)]order;EventSubscriberInstance = Manual;;BindSubscription/UnbindSubscription; and thevar IsHandled: Boolean+if IsHandled then exit;convention. Object IDs use 50220–50235 (within the assigned 50220–50239 range; no collision with error-handling 50180–50191 or interfaces 50200–50219). The.alsamples are demonstration-only and not compiled by CI.Validation
python .github/scripts/validate_frontmatter.py→ 0 errors, 0 warningspwsh .github/scripts/Test-KnowledgeIndex.ps1→ PASSED (163 articles, deterministic, full coverage, selection inputs intact)Notes
al-code-review.mdsub-skills/Source/description lines and the README count/domain line. Resolve by keeping both leaves and setting the README count to the correct total.Part of #34.