Backfill BCQuality article classifications for code-review gold dataset (AB#646153) - #811
Open
Wenjie Fan (gggdttt) wants to merge 1 commit into
Open
Backfill BCQuality article classifications for code-review gold dataset (AB#646153)#811Wenjie Fan (gggdttt) wants to merge 1 commit into
Wenjie Fan (gggdttt) wants to merge 1 commit into
Conversation
…et (AB#646153) Extends the per-article coverage work from #776 (security domain) to every non-security domain: performance, style, privacy, upgrade, error-handling, breaking-changes, data-modeling, testing, events, and ui. Article backfill - 96 previously-unannotated entries now carry faithful BCQuality article associations: 139 expected_comments got a comment-level `articles` entry, and 26 false-positive/by-omission "clean" entries got entry-level `metadata.articles`. - Every assignment required reading the actual BCQuality article body (and its .good.al/.bad.al samples) against the patch, not just the slug name. - 28 non-security entries were deliberately left unannotated where no existing BCQuality article faithfully covers the exact finding being tested; each carries a specific reason (see PR description). The 3 remaining unannotated security entries are out of scope for this PR (security was handled in #776) and are left untouched. Gold-answer audit - While reading each patch against its article, also re-verified the existing gold expected_comments/metadata for correctness. 16 high-confidence, tightly-coupled corrections were applied (wrong line ranges, mislabeled domains, a hallucinated finding, false-positive findings that contradict BCQuality's own documented behavior, and 6 missing findings). Two sub-agent-proposed corrections were reviewed and rejected because they would have overwritten a legitimate false-positive-boundary design. Full rationale for every correction and rejection is in the PR body. Notebook - Re-executed notebooks/code-review-coverage.ipynb against current BCQuality main; every cell has an id and outputs are deterministic (no timestamps/session-specific metadata). Before -> after: 17 -> 114 annotated entries (30 unannotated remain), 9 -> 80 unique articles covered, 17 -> 164 comment-level annotations, 4 -> 30 metadata-level annotations. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sun Haoran (haoranpb)
approved these changes
Aug 21, 2026
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
Continues AB#646153 by extending the per-article BCQuality coverage work from #776 (which established the schema, the coverage notebook, and annotated the
securitydomain) to every non-security domain indataset/codereview.jsonl:performance,style,privacy,upgrade,error-handling,breaking-changes,data-modeling,testing,events, andui.Every association was made by reading the actual BCQuality article body (and its
.good.al/.bad.alsamples) from currentmicrosoft/BCQualitymain against the patch/finding — not guessed from the slug name. Where no existing article faithfully covers the exact finding a comment tests, the entry was left unannotated rather than force a mis-crediting association (mirroring the discipline #776 established).#804 is unrelated to this PR's approach — it already merged into
main(CI e2e slug validation) before this branch was created; this PR rebases on top of it and does not duplicate anything from it.Before → after
expected_comments[].articles) annotationsmetadata.articles, FP/by-omission) annotations30 entries remain intentionally unannotated:
security-007,security-013,sec-internal-not-boundary-01) are out of scope for this PR (security was already handled end-to-end in Add per-article BCQuality coverage for code-review dataset (AB#646153) #776) and were left untouched.Unannotated, with reason (non-security)
data-modeling (3)
data-modeling-excluded-from-calculation-01— migration-buffer field-parity/open-balance calculation defect; no BCQuality article documents this exact scenario.data-modeling-blocked-validation-skip-01— closest article (check-blocked-in-referencing-code-not-in-master) documents the opposite rule (enforcing Blocked); this finding is a migration-specific bypass boundary.data-modeling-tablerelation-restriction-mismatch-01— no article covers keeping a setup field'sTableRelationas narrow as its downstream target.error-handling (7)
error-testfield-enabled-01,error-handling-fieldno-swap-01,error-handling-guiallowed-01,error-handling-silent-skip-01,error-handling-assistedit-cancel-01,error-handling-drilldown-position-01,error-handling-case-unreachable-else-01— each is a genuine, narrow AL defect/FP-boundary (wrong FieldNo copy-paste, over-broadGuiAllowedgating, silent success-shaped skip, unconditionalSaveRecordafter a cancellableAssistEdit, unstable-key drilldown restore, non-extensible-enum exhaustivecase) that no existing BCQuality article documents at this level of specificity.privacy (3)
privacy-004— corrected in this PR to a clean/FP-guard entry (see Gold-answer audit below); left unannotated since no article is an exact fit for the corrected scenario.privacy-013— hardcoded personal email addresses in source/config; no article covers this specific case.privacy-clean-02— telemetry message stays dynamic rather than matching an article's static-message good sample closely enough.style (9)
style-001,style-003,style-008,style-015— generic indentation-width/Hungarian-prefix/PascalCase/snake_case naming conventions with no matching BCQuality article.style-duplicate-action-01— obsolete-and-replace page-action FP boundary, not documented.style-tooltip-mismatch-01— tooltip text contradicting an action's real behavior; domain correctedstyle→ui(see audit) but still no exact article.style-this-keyword-01— flagged for human review, see "BCQuality/gold conflict" below.style-showmandatory-flowfield-01,style-field-repurpose-indent-01— narrow FP/defect boundaries with no matching article.testing (2), upgrade (3)
testing-tolerance-clean-01,testing-ui-handler-assert-after-run-01— no article for timezone-tolerance date-serialization assertions or post-RunModalsemantic assertions.upgrade-obsolete-caption-01— caption-only pseudo-deprecation; BCQuality has no page-action-specific obsoletion article (split across obsoletion/breaking-change docs, ambiguous which owns it — flagged suspicious, not forced).upgrade-transferfields-field-collision-01,upgrade-broken-hook-copyrows-01— narrowTransferFields()/CopyRows()mechanics not documented.BCQuality/gold conflict needing human review
synthetic__style-this-keyword-01: this entry's owndescriptioncites a real BCApps PR (#8959,SpendRequestTests.Codeunit.al) where a developer explicitly rejected thethis.requirement for self-calls ("Wrong. We should not use 'this'"). The current BCQuality articlestyle/this-keyword-in-codeunits.mdstates the rule applies to all codeunits with no stated exception. A sub-agent proposed flipping this entry toexpect_findings: trueand adding a positive finding, purely from the article's literal text — I rejected that because it would defeat the entry's deliberate purpose (a false-positive guard grounded in real project precedent) and because BCQuality's own text doesn't yet reconcile the conflict. Recommend BCQuality maintainers either add a test-codeunit carve-out to the article or confirm the rule truly applies universally, then re-visit this entry.Gold-answer audit
While reading each patch against its candidate article, the review also re-verified the existing gold
expected_comments/metadatafor high-confidence, tightly-coupled inconsistencies (never wording/style preference, never debatable maintainer judgment). 16 corrections applied, all independently re-verified by hand against the raw patch before being merged (not applied blindly from sub-agent proposals):performance-011— 2 comment bodies recommendedSetLoadFieldsfor FlowFields, which cannot be preloaded that way; corrected to the real remedy (combineCalcFieldscalls /SetAutoCalcFields).performance-023— added a missing, independent finding (CalcFieldsin a loop insideBuildVendorReport) the gold under-specified; also fixed a pre-existing "HTML body" mislabel found in passing (the code builds a plain report body, not HTML).style-010,style-018,style-tooltip-mismatch-01— reclassifieddomain: style→ui(page-binding/tooltip correctness, not a style convention).style-011— removed a hallucinated finding referencing a procedure (ImportTemplateFromStream) and code shape that don't exist anywhere in the patch.style-012— fixed a misquotedMessage()string that didn't match the patch, and added 5 missingxmldoc-for-public-library-proceduresfindings for sibling public procedures the gold left unflagged.style-013— corrected a finding's line range from theError()call site to the mislabeled-Err-suffix label's actual declaration line.privacy-003— reclassifieddomain: privacy→style: BCQuality's ownprivacy/avoid-strsubstno-prebuild-before-errorarticle states aStrSubstNo-wrappedErrordoes not log the composed text verbatim to telemetry, contradicting the gold's stated privacy concern; the real, better-matched issue is thestyle/error-passes-parameters-directly-not-strsubstno(AA0231) label-identity loss.privacy-004— the sole finding rested onGetLastErrorText(true), which BCQuality documents as the scrubbed overload; flippedexpect_findingstofalseand removed the finding.privacy-010— removed a finding asserting an unsupported "classify/tag the PII flow for GDPR" requirement that duplicates the (kept) consent-check finding.privacy-011— removed 3 of 4 findings that flagged fields for omittingDataClassification, when BCQuality'stable-level-data-classification-cascadesarticle explicitly says a field inheriting a valid table-level default should not be flagged solely for that omission.privacy-012— removed 3 of 6 findings that flaggedError(Label, values)calls where the Label is passed directly (the documented correct pattern) rather than pre-baked viaStrSubstNo.upgrade-008— added a missing, independent finding: the migration logic lives in aSubtype = Installcodeunit, which BCQuality documents as never running during an ordinary version upgrade.upgrade-009— corrected a finding's body: the trigger does delegate to a named procedure; the real mismatch (per BCQuality) is that it keeps the upgrade-tag guard inline instead of letting the helper own it.errh-errortype-internal-01— corrected the line range from theif-guard to the actualError()call site being flagged.2 sub-agent-proposed corrections were reviewed and rejected (not applied):
synthetic__events-ishandled-reset-boundary-01— a sub-agent proposed rewriting the body to drop its explicit "do not flag the sibling fresh-local/second-raise cases" guidance, reasoning the article requiresIsHandled := falseunconditionally. Rejected: that guidance is the entry's deliberate false-positive-boundary design (per its owndescription), not an error — removing it would delete legitimate scoring content.synthetic__style-this-keyword-01— see "BCQuality/gold conflict" above.7 suspicious-but-unresolved cases were logged by domain sub-agents and reviewed but left as-is (debatable, not tightly coupled to hard evidence):
performance-010,performance-014,performance-018,performance-024,style-016,style-017,upgrade-obsolete-caption-01.Validation
CodeReviewEntry.load(...)— 144/144 entries parse and validate.uv run pytest -q(withBCQUALITY_ROOT) — 743 passed, 2 skipped.uv run pytest -q -m e2e(article-slug-exists-in-BCQuality check from Validate code-review article slugs against BCQuality #804) — 1 passed.uv run ruff format --check ./uv run ruff check .— all clean.uv run ty check— 23 pre-existing diagnostics (all insrc/bcbench/redteam.py, an unrelatedazure.identityimport gap); confirmed identical onmainbefore this change, none touch the files this PR modifies.notebooks/code-review-coverage.ipynbre-executed against current BCQuality main; every cell has an id, outputs are deterministic (no timestamps/session metadata).Scope discipline