Skip to content

Add source-verified Finance knowledge and review domain - #57

Open
Jesper Schulz-Wedde (JesperSchulz) wants to merge 5 commits into
mainfrom
jesperschulz-legendary-barnacle
Open

Jesper Schulz-Wedde (JesperSchulz) wants to merge 5 commits into
mainfrom
jesperschulz-legendary-barnacle

Conversation

@JesperSchulz

@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Replace the Community Finance pilot with a Microsoft-owned domain: nine atomic articles, eighteen original AL companions, and al-finance-review. Current validated head: 7c17aa3ab8391af88a5121fa5d4ca6eb88ef1cfe.

Integration order: land #192 first, then refresh this branch from main and reconcile the shared skill-registration additions before merging #57. The independent fixes below are complete now; no unmerged SCM implementation was imported or rebased into this branch.

Knowledge inventory

All articles live in microsoft/knowledge/finance/, with the established inline See sample: links to .bad.al / .good.al companions.

Article Mistake prevented
post-ledger-entries-through-posting-codeunits Manufacturing financial ledger rows instead of using the owning posting workflow; balanced rows, locks, and table triggers do not supply register/transaction bookkeeping.
do-not-modify-or-delete-posted-ledger-entries Repairing original financial content through direct row changes, without banning supported operational/correction/maintenance workflows.
write-dimensions-as-dimension-set-entries Losing financial-posting dimensions by copying only shortcut/global projections.
do-not-edit-shared-dimension-sets Mutating shared dimension membership and thereby changing other transactions or posting history.
apply-ledger-entries-through-application-codeunits Fabricating customer/vendor settlement or unapplication through status flags.
change-ledger-due-dates-through-entry-edit Omitting detailed-entry due-date synchronization despite Validate plus Modify(true).
reverse-transactions-by-transaction-number Passing a ledger Entry No. to ReverseTransaction instead of the selected entry's Transaction No.
preserve-journal-batch-document-balance Bypassing an evidenced template Force Doc. Balance policy with a line-posting loop.
normal-vat-journal-amount-includes-vat Supplying imported net instead of gross for Automatic VAT Entry + Normal VAT.

The two foundational posting/correction rules remain because their actionable bookkeeping invariants and precise supported-edit, compression, temporary-buffer, and extension-field exceptions add value beyond generic AL advice. They are not retained to meet an article count.

External-review corrections

  • All Finance articles use application-area: [all]. READ otherwise makes missing area context conditional, allowing findings to be capped or dropped. Resolved records and operations now supply narrowing; the evaluation context deliberately omits area.
  • Shared conventions match Add SCM functional knowledge domain #192: leaf-count diagnostics derive from $expectedLeaves.Count; documentation is number-free. No schema or shared functional-domain infrastructure change.
  • Reciprocal ownership: Finance owns pure G/L, customer/vendor/detailed/VAT and financial-posting records. Item, Value, Capacity, Warehouse and inventory-application records remain SCM-owned, even if SCM is absent/disabled. Equivalent findings for one inventory-originated posting bypass have one SCM primary owner; independent financial defects remain Finance. Generic custom/master dimension wiring remains data-modeling work (18 AL/BC patterns: style, data-modeling, web-services, appsource, breaking-changes, performance, testing #156).
  • VAT samples no longer reference later Non-Deductible VAT % fields. The rule addresses the supplied gross transaction total, not a fixed deductible/non-deductible allocation. Executable input totals, Normal VAT/automatic mode, rate, currency, rounding, and unrealized-VAT prerequisites remain after neutralization.
  • Journal exemplars: the amount parameter is LineAmount; the negative loop passes a separate LineToPost buffer by var, preserving its iterator. The intended document-balance violation remains.
  • The owning leaf uses a source gate before bounded, index-first retrieval, complete catalogs, exact paths, and body chunks of at most eight. Findings use the Finance display domain. No new ## Samples convention.

Evidence and applicability

Behavior was checked against public BCApps W1 source at 8f7a04cb0db8aa96cb97e055c45c61aead49e280, whose manifest describes development version 30, and corroborating Microsoft Learn pages linked in the articles. Implementation bodies were not copied. Normal-VAT gross extraction was independently rechecked when addressing this feedback.

The rules describe longstanding invariants (bc-version: [all], countries: [w1]), not tax legislation. Actual sample API compilation was against BC 28.5, not every historical version or localization. An optional older-target attempt resolved the tool's shared BC28 symbols and is not counted as BC20 validation.

Validation of the corrected tree

  • Frontmatter/structure: 0 errors, 0 warnings; inline sample links retained.
  • Dynamic skill-index order, both JSON schemas, and the 8-case review contract passed.
  • Full-tree fixture preparation: 88 cases across 19 leaf domains; all 18 Finance fixtures preserve executable source without an application-area hint.
  • Knowledge index/retrieval: 316 articles and 525 samples round-tripped with deterministic, bounded/lossless retrieval.
  • Production-like catalog checks: all 9 Finance articles remain fully applicable with omitted, Finance, or warehousing area, even when conditional articles are excluded.
  • All 18 revised AL samples and 8 expanded controls compiled in separate good/bad packages on BC28.5/runtime17 with CodeCop enabled: 0 errors, 0 warnings. Exact source hashes and both 17-object package inventories were verified.
  • Fresh blinded no-area model evaluation: 9/9 exact-ID recall and 9/9 clean controls.
  • Full DO routing reports: six unrelated/SCM-only inputs pruned before worklisting; the combined inventory-originated Item+G/L bypass produced no duplicate Finance finding; an independent G/L mutation in a warehouse-named module retained a high-confidence Finance finding without area context.
  • Complete feedback diff self-reviewed. Prior validation artifacts are preserved; new evidence is isolated in the second validation run.

No extension was deployed and no live Business Central posting transactions were executed. Customer configurations, localized overlays, and historical API compatibility remain subject to normal maintainer/domain review. This PR has not been merged or self-approved.

Adds three atomic domain-rule knowledge files under community/knowledge/finance/ as a pilot for Type-A (normative) Business Central domain knowledge: post through the posting engine, treat posted ledger entries as immutable, and treat the Dimension Set ID as the source of truth for dimensions. Includes a good/bad AL sample pair for the posting rule.

These encode BC-specific invariants that LLMs reliably get wrong, fitting the existing remedial/atomic knowledge grain with no schema or contract changes. Passes the repo frontmatter validator and is discovered by the knowledge index.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JeremyVyska

Copy link
Copy Markdown
Collaborator

Jesper Schulz-Wedde (@JesperSchulz) - for the Do Not Modify posted entries, should we note in that file that non financial fields can be modified?

For example, Customer Ledger Entries have a wide variety of "operational" fields that are editable these days.

Addresses review feedback from @JeremyVyska on PR #57: the immutability rule applies to financial content, not the whole entry. Reframes the Description around financial content and gives the operational-field exception (payment/application data, on-hold, applies-to, communication fields edited via CustEntry-Edit/VendEntry-Edit and the ledger entry pages) its own paragraph in Best Practice instead of understating it as a narrow set.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@JesperSchulz

Copy link
Copy Markdown
Contributor Author

Good call, thanks Jeremy. You're right that "narrow set" undersold it. I've reworked the file so the immutability rule is explicitly about financial content (amounts, accounts, posting date, quantities), and gave the operational fields their own paragraph in Best Practice -- due date, payment-discount dates, on-hold, applies-to ID, and recipient/communication fields, edited through CustEntry-Edit / VendEntry-Edit and the ledger entry pages that call them. The Anti Pattern already scoped to edits outside the *Entry-Edit routines, so that stays. Pushed in 5e779c7.

Jesper Schulz-Wedde and others added 2 commits September 17, 2026 15:04
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Move Finance knowledge to the Microsoft-owned layer, add nine scoped rules with eighteen AL samples, and register bounded Finance review with complete paired evaluation coverage.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) changed the title Add Finance posting domain-knowledge pilot Add source-verified Finance knowledge and review domain Sep 17, 2026
Remove application-area gating and later VAT-field dependencies, align dynamic shared conventions, separate SCM ownership, and keep journal examples focused on the intended invariant.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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