mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-08-06 17:36:53 +01:00
The previous LLM-generated knowledge files contained factual
hallucinations. The most visible was the claim that `FindFirst` /
`FindLast` "forces a full-table scan" on an unfiltered record - it does
not; those APIs return a single row via the current key.
Other inaccuracies the audit found and fixed:
* `FindSet(true)` was described as "taking a LockTable". The correct
upstream phrasing is that `FindSet(true)` sets
`ReadIsolation::UpdLock` on the read. UpdLock and LockTable are
related but distinct mechanisms.
* The list of production-scale tables had been invented beyond the
upstream source (e.g. "Detailed Cust. Ledg. Entry") without a
citation. The regenerated list matches the ten tables upstream lists
with their P95 row counts.
* `SetLoadFields` guidance had been augmented with an extra mechanism
claim ("the database resolves the filter using the index without
hydrating the value") not present in upstream.
Approach: full regeneration of `microsoft/knowledge/` from the six
upstream BCApps Code Review instruction files, with Microsoft Learn /
the AL language reference as a secondary source. Every claim in every
regenerated file is anchored to a verbatim upstream quote (or a Learn
URL); the audit trail lives in artifacts/trace-<domain>.json on the
session workspace.
The PR #11 transaction/error-handling cluster is preserved verbatim:
* performance/understand-implicit-transaction-boundary.md
* performance/codeunit-run-as-atomic-sub-operation.{md,good.al,bad.al}
* performance/codeunit-run-requires-prior-commit-inside-transaction.{md,good.al,bad.al}
* performance/use-tryfunction-for-error-catching-not-rollback.{md,good.al,bad.al}
* performance/avoid-commit-inside-loops.{md,good.al,bad.al}
* security/commitbehavior-attribute-scopes-explicit-commits.{md,good.al,bad.al}
* testing/transactionmodel-attribute-governs-test-transactions.{md,good.al,bad.al}
These articles already cite Microsoft Learn and were carefully
cross-referenced; the regeneration skips their topics rather than
duplicating them.
File counts after regeneration:
performance 35 .md (5 preserved + 30 new)
privacy 17 .md
security 18 .md (1 preserved + 17 new)
style 33 .md
testing 1 .md (preserved)
ui 19 .md
upgrade 18 .md
Total 141 atomic knowledge files, each strictly one rule. All pass
.github/scripts/validate_frontmatter.py with 0 errors and 0 warnings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
||
|---|---|---|
| .. | ||
| addloadfields-in-report-onpredataitem.bad.al | ||
| addloadfields-in-report-onpredataitem.good.al | ||
| addloadfields-in-report-onpredataitem.md | ||
| admin-and-migration-pages-tolerate-lower-perf.md | ||
| apply-filters-before-iterating.bad.al | ||
| apply-filters-before-iterating.good.al | ||
| apply-filters-before-iterating.md | ||
| apply-guards-before-get.bad.al | ||
| apply-guards-before-get.good.al | ||
| apply-guards-before-get.md | ||
| avoid-commit-inside-loops.bad.al | ||
| avoid-commit-inside-loops.good.al | ||
| avoid-commit-inside-loops.md | ||
| avoid-get-inside-loop-on-large-table.bad.al | ||
| avoid-get-inside-loop-on-large-table.good.al | ||
| avoid-get-inside-loop-on-large-table.md | ||
| avoid-recordref-in-hot-loop.bad.al | ||
| avoid-recordref-in-hot-loop.good.al | ||
| avoid-recordref-in-hot-loop.md | ||
| avoid-redundant-get-when-record-already-loaded.bad.al | ||
| avoid-redundant-get-when-record-already-loaded.good.al | ||
| avoid-redundant-get-when-record-already-loaded.md | ||
| avoid-user-prompts-inside-transactions.bad.al | ||
| avoid-user-prompts-inside-transactions.good.al | ||
| avoid-user-prompts-inside-transactions.md | ||
| calcsums-instead-of-calcfields-in-loop.bad.al | ||
| calcsums-instead-of-calcfields-in-loop.good.al | ||
| calcsums-instead-of-calcfields-in-loop.md | ||
| codeunit-run-as-atomic-sub-operation.bad.al | ||
| codeunit-run-as-atomic-sub-operation.good.al | ||
| codeunit-run-as-atomic-sub-operation.md | ||
| codeunit-run-requires-prior-commit-inside-transaction.bad.al | ||
| codeunit-run-requires-prior-commit-inside-transaction.good.al | ||
| codeunit-run-requires-prior-commit-inside-transaction.md | ||
| do-not-locktable-in-read-only-procedure.bad.al | ||
| do-not-locktable-in-read-only-procedure.good.al | ||
| do-not-locktable-in-read-only-procedure.md | ||
| do-not-modify-in-onaftergetrecord.bad.al | ||
| do-not-modify-in-onaftergetrecord.good.al | ||
| do-not-modify-in-onaftergetrecord.md | ||
| do-not-remove-sourcetabletemporary-from-api-page.bad.al | ||
| do-not-remove-sourcetabletemporary-from-api-page.good.al | ||
| do-not-remove-sourcetabletemporary-from-api-page.md | ||
| findset-true-applies-updlock-on-read.bad.al | ||
| findset-true-applies-updlock-on-read.good.al | ||
| findset-true-applies-updlock-on-read.md | ||
| flowfield-source-key-needs-sumindexfields.bad.al | ||
| flowfield-source-key-needs-sumindexfields.good.al | ||
| flowfield-source-key-needs-sumindexfields.md | ||
| guard-event-subscribers-before-db-call.bad.al | ||
| guard-event-subscribers-before-db-call.good.al | ||
| guard-event-subscribers-before-db-call.md | ||
| maintainsqlindex-false-breaks-flowfield-sift.bad.al | ||
| maintainsqlindex-false-breaks-flowfield-sift.md | ||
| pair-findset-with-next-loop.bad.al | ||
| pair-findset-with-next-loop.good.al | ||
| pair-findset-with-next-loop.md | ||
| pass-false-to-insert-when-trigger-not-needed.good.al | ||
| pass-false-to-insert-when-trigger-not-needed.md | ||
| prefer-dictionary-over-temporary-table-for-lookups.md | ||
| prefer-modifyall-over-per-row-modify.bad.al | ||
| prefer-modifyall-over-per-row-modify.good.al | ||
| prefer-modifyall-over-per-row-modify.md | ||
| prefer-readisolation-over-locktable-for-reads.bad.al | ||
| prefer-readisolation-over-locktable-for-reads.good.al | ||
| prefer-readisolation-over-locktable-for-reads.md | ||
| production-scale-tables-warrant-extra-analysis.md | ||
| setcurrentkey-aligns-key-with-filters.good.al | ||
| setcurrentkey-aligns-key-with-filters.md | ||
| singleton-setup-tables-need-no-access-optimization.md | ||
| temporary-tables-have-no-database-cost.md | ||
| triggers-and-media-field-regress-modifyall.md | ||
| understand-implicit-transaction-boundary.md | ||
| use-get-instead-of-findfirst-on-full-primary-key.bad.al | ||
| use-get-instead-of-findfirst-on-full-primary-key.good.al | ||
| use-get-instead-of-findfirst-on-full-primary-key.md | ||
| use-isempty-for-existence-check.bad.al | ||
| use-isempty-for-existence-check.good.al | ||
| use-isempty-for-existence-check.md | ||
| use-setloadfields-for-partial-records.bad.al | ||
| use-setloadfields-for-partial-records.good.al | ||
| use-setloadfields-for-partial-records.md | ||
| use-textbuilder-for-string-concatenation-in-loops.md | ||
| use-tryfunction-for-error-catching-not-rollback.bad.al | ||
| use-tryfunction-for-error-catching-not-rollback.good.al | ||
| use-tryfunction-for-error-catching-not-rollback.md | ||