Skip to content

Commit 8d8d395

Browse files
committed
Retain machine-key argument-role regression baseline
Preserve all required tests and coverage gates. Fix native display parsing and numeric test spans/cohesion; add meaningful real semantic regressions before the separately reviewed production repair. This is a tests-first source cut, not completed qualification.
1 parent b402dc5 commit 8d8d395

14 files changed

Lines changed: 1081 additions & 238 deletions

‎docs/ADR/ADR-033-code-quality.md‎

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,130 @@ per file and explicit aggregate covered-line budgets, with independent exact cou
506506
exit and critical-pipeline assertions. It must not pad production sources, copy
507507
invented execution into native evidence, or make absence of a threshold label
508508
alone count as a successful parse. These bounded corrections precede TASK011 join.
509+
510+
### Observed native candidate failure implementation contract
511+
512+
Run36988549282 atb402dc50785028cc5b09a3928c5b28ba8a721a6e preserves the first real
513+
AnalyzerTests baseline:88executed/84passed/4failed/0skipped and native Cobertura
514+
SHA256983f7de7132938062db791723cdfba1ca683eceb98b3cecb191b2452af938091. Related
515+
REQ/AC-BC-027, REQ-CQ-006 and AC-CQ-008/009 keep all original thresholds/sources.
516+
517+
1. Strongest lead freezes the observed failure acceptance and task graph before
518+
writing workers. Read-only native grammar/numeric span/cohesion discovery is
519+
complete; the missing native report or test failure never becomes a pass.
520+
2. TASK-SITE-NATIVE-FORMAT-014 owns only
521+
`scripts/Features/CodeQuality/site-analyzer-coverage.shared.ps1` and new
522+
`tests/KeyLoad.Analyzers.Tests/Features/CodeQuality/SiteAnalyzerCoverageBranchDisplayTests.cs`.
523+
Author real-PowerShell TUnit native decimal/display-rounding/malformed cases
524+
first; change only the full-token display regex. Observed0..100 integer or
525+
one/two decimal spellings are valid; covered/valid groups stay integer-only
526+
and retain all bounds/overflow/denominator checks. Rounded display never
527+
controls a threshold. No other parser, contract or configuration change.
528+
3. TASK-SITE-NUMERIC-REPAIR-015 owns existing ControlFlowNestingAnalyzerTests.cs
529+
and ExecutableUnitCodeLineCountAnalyzerTests.cs, and new
530+
ControlFlowNestingExtendedConstructTests.cs and
531+
ExecutableUnitSpanAndTriviaAnalyzerTests.cs in the same test slice. Preserve
532+
all registered cases/assertions; move cohesive construct/trivia scenarios into
533+
separate nonpartial types under200code lines. Expected method spans use the
534+
known declaration token's source index, preserving all location/end assertions.
535+
NumericAnalyzerFixture, production analyzers and self-inventory stay unchanged.
536+
4. TASK-SITE-DIAGNOSTIC-FLOWS-016 follows a strongest reviewed source/case map
537+
before implementation. It owns only explicitly new CodeQuality test files;
538+
no014/015/shared source overlaps. It exercises real analyzers through SDK
539+
Roslyn/BCL/Orleans inputs and diagnostic/no-diagnostic assertions for actual
540+
KLD0001/KLD0022 uncovered flows. Source denominators remain frozen; no direct
541+
helper calls, stubs, padding, reclassification or threshold alteration.
542+
5. Root alone integrates docs, project/workflow/config/candidate ownership. Join
543+
every complete source/method-registration/hash packet; development Release
544+
build and scoped formatter precede GitHub qualification. Compose an ordinary
545+
descendant using a reviewed separate index; preserve the shared dirty checkout.
546+
Run complete AnalyzerTests/native collection/gate and complete SiteTests at
547+
the exact candidate SHA, retain raw native/TRX/PDB/SARIF/run/job/hash receipts,
548+
then require strongest joined final review. No local tests or qualifications.
549+
550+
Stages014/015 are safe parallel writes after frozen approval;016 waits for its
551+
read-only case map and an available capable economical worker. Workers must end
552+
complete/blocked/failed/cancelled with exact diff/hashes and preserved case maps;
553+
only reviewed complete packets unblock integration. Stop on ambiguous semantics,
554+
actual analyzer defects, unsupported APIs, overlapping ownership or new contracts.
555+
Rollback restores the coherent candidate tooling/test unit while keeping mandatory
556+
policy and failed artifacts. Runtime/data/public migrations are N/A. ADR remains
557+
Accepted until required exact-SHA evidence and every acceptance criterion pass.
558+
559+
TASK016's exact new-file ownership is now frozen under
560+
`tests/KeyLoad.Analyzers.Tests/Features/CodeQuality/`:
561+
LiteralMachineKeyInvocationTests.cs (actual keyed invocation and nested-literal
562+
flows), LiteralMachineKeyConstructionTests.cs (actual key-value construction and
563+
initializer flows), LiteralMachineKeyAttributeContractTests.cs (native qualified
564+
attribute key contracts), and SystemClockSemanticTests.cs (real clock/nonclock
565+
property symbols). Its precise positive/negative/edge map is in site acceptance.
566+
Use existing AnalyzerFixture compilation and public analyzer entry points only;
567+
each positive proves exact count/ID/severity/path/known token location, negatives
568+
prove no finding. No shared fixture changes or artificial framework types.
569+
Known potential reordered named-value/multiargument WriteString false positives
570+
must be retained as regressions and escalated, never copied into a passing oracle.
571+
Any production repair requires a separate explicit strongest-reviewed contract
572+
before writes. Root queues this task on the economical014 worker after its complete
573+
join, while015 retains disjoint numeric-test ownership; no blocked dependency is
574+
treated as complete. Native90% pipeline proof remains required after all joins.
575+
576+
TASK015's strongest source join found a latent executable-unit violation in
577+
ElseIfEveryLoopUsingStatementAndFixedAddNestingAsync: its multiline literal is
578+
part of the unit's token line span, exceeding50 even after aggregate-type splits.
579+
The same worker may edit only ControlFlowNestingExtendedConstructTests.cs to
580+
extract that literal into a named private const in the same class. Preserve exact
581+
decoded compiler-input bytes, all assertions and the sole original registration.
582+
No counter/threshold/source exclusion or test case changes. Root verifies the
583+
raw-string byte-equivalence and refreshed hash before enabled build/format/CI;
584+
this source-only remedy cannot close the GitHub self-inventory qualification.
585+
586+
### Accepted machine-key argument-role repair contract
587+
588+
TASK016 stopped with a real compiler-input regression for Utf8JsonWriter.WriteString:
589+
the existing nested AlwaysKey helper classifies both property-name and human value.
590+
Related REQ-CQ-002/006, AC-CQ-004/008/009 and REQ/AC-BC-027 require this test-first
591+
TASK-SITE-ARGUMENT-ROLE-018 repair, not an oracle accepting the false positive.
592+
593+
1. Root freezes the detailed semantic acceptance and explicit task graph. The
594+
economical capable worker authors only new LiteralMachineKeyArgumentBindingTests.cs
595+
and LiteralMachineKeyCreationBindingTests.cs under the CodeQuality test slice.
596+
Keep016's retained Invocation regression unchanged and blocked. Verify actual
597+
compiler-valid SDK/BCL/ASP.NET inputs and independent exact literal spans for
598+
positional/reordered/nested key versus value, key-value construction, dynamic
599+
fallback, reduced/static extensions and expanded params.
600+
2. Root joins those sources plus completed014/015, enabled build/format and a
601+
reviewed ordinary descendant temporary-index source cut. Run complete real
602+
AnalyzerTests/native collection in GitHub with production unchanged. Retain
603+
exact failed assertions/TRX/XML/source/PDB/run/job/artifact hashes. This red
604+
baseline cannot unblock017/final acceptance; no test or branch exit is ignored.
605+
3. After reviewed GitHub regression evidence, the same worker may edit only
606+
src/KeyLoad.Analyzers/Features/CodeQuality/MachineKeyLiteralClassifier.cs and
607+
MachineKeySemanticSymbols.cs. Resolve named arguments by actual parameter
608+
identity; positional and expanded params by bound parameter. Explicit key
609+
names qualify; current method/container/constructor heuristics qualify only
610+
the first logical parameter, skipping an unreduced extension receiver.
611+
Reduced instance extension calls already omit that receiver. A resolved value
612+
parameter returns false before any textual-position heuristic.
613+
4. Apply one shared decision to nested AlwaysKey literals, ordinary invocation
614+
fallback and known key-value construction. Preserve nearest argument context.
615+
Unresolved/dynamic invocations retain recognized named-key or unnamed argument0
616+
method-name fallback; unresolved construction stays non-key. Keep catalogs,
617+
analyzer entry point/ID/severity, attributes/indexers/initializers/generated/
618+
empty-string behavior and all25 executable paths/12 pipelines unchanged.
619+
5. Root/strongest join every source diff/case/hash and mandatory numeric limits,
620+
then resume016's exact semantic scope. Enabled build/format/governance precede
621+
complete exact-SHA GitHub analyzer/native/site/browser qualification. Freeze
622+
new source hashes and use actual new native denominators for80/70/90; historical
623+
native counts cannot qualify changed source. Final017/TASK007 waits for every
624+
completed source stage and all required runtime evidence.
625+
626+
Worker018 owns its two new tests and later two production files only;014/015/016,
627+
shared AnalyzerFixture, catalog, contracts/config/packages/policy/docs stay other
628+
owned. Root exclusively owns shared integration/candidate delivery. Completion
629+
requires complete/blocked/failed/cancelled stage packets; stop on unsupported SDK
630+
metadata, ambiguous bindings or changed diagnostic contract. No local tests,
631+
stubs, direct helper coverage, suppression, exclusions or weakened thresholds.
632+
This changes compiler diagnostic classification only, with no public runtime,
633+
data or deployment migration. Rollback restores the coherent analyzer plus
634+
regressions under unchanged mandatory policy and retains all red evidence.
635+
ADR remains Accepted until actual joined implementation and verification pass.

‎docs/Features/CodeQuality.md‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,24 @@ sources, exact integer80/70/90 thresholds and complete diagnostic regressions.
3333
Successful evidence establishes only the first analyzer-module baseline; global
3434
AC-CQ-009 and RF3/container/no-decrease coverage remain pending.
3535

36+
Observed candidate run36988549282 executes88 regressions with84 successes and4
37+
failures, retained native XML/TRX and no skipped analyzer case. Its next bounded
38+
failure loop maps BC-027/CQ-006/CQ-008/009 to TASK-SITE-NATIVE-FORMAT-014 (native
39+
decimal-display grammar with integer-only decisions), TASK-SITE-NUMERIC-REPAIR-015
40+
(independent token-start span oracles and cohesive200-line test classes), and
41+
TASK-SITE-DIAGNOSTIC-FLOWS-016 (meaningful KLD0001/KLD0022 flows for real coverage
42+
gaps). Acceptance, exact disjoint ownership, staged join and GitHub verification
43+
are in the site acceptance/plan and ADR-033 below. No native numeric pass or
44+
broader CodeQuality completion follows from source repairs or local builds.
45+
46+
TASK016's genuine WriteString regression exposed a value-argument false positive.
47+
Accepted TASK-SITE-ARGUMENT-ROLE-018 preserves that failing case, adds exact real
48+
argument-binding regressions and first runs an unchanged-production GitHub red
49+
baseline. The later two-file bound-parameter classification repair and016 semantic
50+
join remain mandatory before complete native/site qualification. See the detailed
51+
site acceptance/plan and ADR-033 implementation contract; blocked source never
52+
unblocks final acceptance.
53+
3654
## Canonical slice map
3755

3856
- Backend/tooling: `src/KeyLoad.Analyzers/Features/CodeQuality/`.

‎docs/implementation/site-design.json‎

Lines changed: 67 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,11 @@
5959
"coverage": "TASK013_COMPLETE_strongest_source_approval_ae21793f1c58424a507dbeb2b8bdf4b227cd84821f4034b7d576966d6e5ad352; integrated_development_build_passed; real_GitHub_native_numeric_qualification_pending",
6060
"browser": "TASK012_COMPLETE_strongest_source_approval_7424fb8d25f303c3c94ca95870de76431de473e5317a76654e028a8b23bf1082; preserved_otherchat_KL-SITE-BUILD-003A_handoff; integrated_build_and_format_passed",
6161
"candidateAudit": "TASK-SITE-CANDIDATE-AUDIT-010_COMPLETE; repair source-preparation review COMPLETE, all required joins still pending",
62-
"analyzerCoverage": "TASK011_COMPLETE_strongest_source_approval; native_boolean_BigInteger_checked_sum_physical_line_gate_and_complete_12_pipeline_oracles_joined; nesting3; integrated_build_and_format_passed"
62+
"analyzerCoverage": "TASK011_COMPLETE_strongest_source_approval; native_boolean_BigInteger_checked_sum_physical_line_gate_and_complete_12_pipeline_oracles_joined; nesting3; integrated_build_and_format_passed",
63+
"nativeFormatRepair": "TASK014_COMPLETE_root_and_strongest_source_approval; native_decimal_TUnit_execution_pending",
64+
"numericRepair": "TASK015_COMPLETE_root_and_strongest_source_approval;17registrations_preserved;699byte_fixture_d402a5f38f1eb28daa90714c92ec45906c833ea7eef936893fd44875c1eb3f01;21unitlines; runtime_selfinventory_pending",
65+
"diagnosticFlows": "TASK016_BLOCKED_on_real_WriteString_value_false_positive; retained_meaningful_regression; no_production_edits",
66+
"argumentRoleRepair": "TASK018_RED_source_COMPLETE_11cases_plus_retained016regression; integrated_build0warnings0errors; strongest_source_and_red_candidate_review_pending; production_unchanged"
6367
},
6468
"verification": {
6569
"source": "All_bounded_worker_packets_complete_joined_full_root_and_strongest_review; 51_source_manifest_98c457ee0333c816795665f742101989b9a0638b2382372313afefd823de4617; source_only_not_runtime_qualification",
@@ -106,7 +110,7 @@
106110
]
107111
},
108112
"githubSiteSuite": {
109-
"state": "pending_descendant_retry_after_pretest_workflow_failure",
113+
"state": "test_first_argument_role_red_baseline_pending_before_scoped_production_repair",
110114
"attempts": [
111115
{
112116
"run": 36987695573,
@@ -119,7 +123,40 @@
119123
"siteTests": "skipped_not_passing",
120124
"coverage": "missing_native_report_failed_closed",
121125
"publication": "skipped",
122-
"artifact": "site-qualification-f56d511b4a343eff99d3117e9414490a05cfb8ae"
126+
"artifact": "site-qualification-f56d511b4a343eff99d3117e9414490a05cfb8ae",
127+
"artifactReceipt": {
128+
"id": 11218301726,
129+
"digest": "sha256:be2cc09ec751e64ff51fe257ea3c91b8a90ef9331f8a7c78300fd0dfdf66ac9a",
130+
"localEvidence": "/private/tmp/keyload-site-run-36987695573",
131+
"log": "/private/tmp/keyload-site-run-36987695573/workflow.log"
132+
}
133+
},
134+
{
135+
"run": 36988549282,
136+
"sourceRevision": "b402dc50785028cc5b09a3928c5b28ba8a721a6e",
137+
"url": "https://github.com/managedcode/KeyLoad/actions/runs/36988549282",
138+
"jobUrl": "https://github.com/managedcode/KeyLoad/actions/runs/36988549282/job/110779101338",
139+
"conclusion": "failure",
140+
"state": "completed_failure",
141+
"runtimeSourceReceipt": "passed",
142+
"publication": "skipped",
143+
"analyzerTests": {
144+
"total": 88,
145+
"executed": 88,
146+
"passed": 84,
147+
"failed": 4,
148+
"skipped": 0
149+
},
150+
"siteTests": "skipped_not_passing",
151+
"coverage": "native_report_retained_decimal_display_pair_rejected",
152+
"nativeReportSha256": "983f7de7132938062db791723cdfba1ca683eceb98b3cecb191b2452af938091",
153+
"artifactReceipt": {
154+
"id": 11217729758,
155+
"name": "site-qualification-b402dc50785028cc5b09a3928c5b28ba8a721a6e",
156+
"digest": "sha256:9ed687f54b29ba15de64653993cb5cb2b93227eb64a8295621eeffcddc6a3640",
157+
"localEvidence": "/private/tmp/keyload-site-run-36988549282",
158+
"log": "/private/tmp/keyload-site-run-36988549282/workflow.log"
159+
}
123160
}
124161
]
125162
},
@@ -149,15 +186,39 @@
149186
"kind": "raw_compiler_SARIF; includes suppressed/generated diagnostics; terminal error count is separate",
150187
"terminalBuildErrors": 3
151188
}
152-
]
189+
],
190+
"analyzerNativeAnalysis": {
191+
"state": "strongest_independent_diagnostic_analysis_only_not_gate_pass",
192+
"run": 36988549282,
193+
"nativeReportSha256": "983f7de7132938062db791723cdfba1ca683eceb98b3cecb191b2452af938091",
194+
"unionLinesCovered": 841,
195+
"unionLinesValid": 942,
196+
"branchesCovered": 399,
197+
"branchesValid": 570,
198+
"belowCriticalThreshold": [
199+
{
200+
"diagnostic": "KLD0001",
201+
"covered": 163,
202+
"valid": 224
203+
},
204+
{
205+
"diagnostic": "KLD0022",
206+
"covered": 25,
207+
"valid": 30
208+
}
209+
],
210+
"otherTenPipelines": "arithmetic_at_least90percent; genuine_gate_parser_failed"
211+
}
153212
},
154213
"delivery": {
155-
"candidate": "validation_branch_created_first_attempt_failed_before_tests_retry_pending",
214+
"candidate": "second_validation_failed_analyzer_tests_and_native_format_repair_pending",
156215
"branch": "codex/site-qualification-20261002-a",
157216
"initialCandidateRevision": "f56d511b4a343eff99d3117e9414490a05cfb8ae",
158217
"qualifiedRevision": null,
159218
"sourceSnapshotReceiptSha256": "271d8415d29c69e8af84f604858079ed6effd4ce586d06220237ff9ac57b9684",
160219
"workspace": "shared_dirty_checkout_preserved",
161-
"main": "not_changed"
220+
"main": "not_changed",
221+
"currentCandidateRevision": "b402dc50785028cc5b09a3928c5b28ba8a721a6e",
222+
"descendantReceipt": "/private/tmp/keyload-site-candidate-20261002-b.delivery.json"
162223
}
163224
}

‎scripts/Features/CodeQuality/site-analyzer-coverage.shared.ps1‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ $script:CoverageTokens = [ordered]@{
5151
XmlBranchTrue = 'true'
5252
XmlBranchFalse = 'false'
5353
XmlConditionCoverage = 'condition-coverage'
54-
BranchCoveragePattern = '\A[0-9]+% \(([0-9]+)/([0-9]+)\)\z'
54+
BranchCoveragePattern = '\A(?:100(?:\.0{1,2})?|(?:0|[1-9][0-9]?)(?:\.[0-9]{1,2})?)% \(([0-9]+)/([0-9]+)\)\z'
5555
XmlPackageSelector = './packages/package'
5656
XmlSourceSelector = './sources/source'
5757
XmlClassSelector = './classes/class'

0 commit comments

Comments
 (0)