Skip to content

Commit 9e3bfd4

Browse files
committed
Complete Roslynk quality review and canonical formatting
Roslynk loaded all 27 projects without load diagnostics and reported zero compiler/analyzer errors or warnings. Canonical solution formatting passed; the full Release build passed with isolated single-process MSBuild after an MSB4166 parallel-worker failure. Retain advisory style findings and the owner-scoped exclusion of further test execution.
1 parent 745f4e3 commit 9e3bfd4

23 files changed

Lines changed: 102 additions & 54 deletions

File tree

‎docs/Features/CodeQuality.md‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ flowchart LR
5050
Repair --> Gates[Canonical format and build]
5151
```
5252

53-
Local Roslynk inspection on2026-10-09 loaded all27/27 projects to Ready and
53+
Local Roslynk inspection on 2026-10-09 loaded all 27/27 projects to Ready and
5454
rechecked the solution with compiler errors, warnings and analyzers included.
55-
The initial27 errors were repaired; the recheck reported zero errors and zero
56-
warnings. Informational/hidden suggestions remain advisory, including existing
55+
The initial 27 errors were repaired; the final native MCP recheck reported zero
56+
errors and zero warnings, with zero workspace load diagnostics. The canonical
57+
whole-solution formatter passed. The full Release build passed with zero warnings
58+
and errors using `--disable-build-servers -m:1` after a parallel MSBuild attempt
59+
failed with `MSB4166`. Informational/hidden suggestions remain advisory, including existing
5760
namespace/folder differences and intentionally unused fluent assertion results;
5861
this result does not claim every style suggestion has been eliminated. The
59-
owner-scoped follow-up performs formatting and compilation only, without test
60-
execution or additional runtime qualification. Original diagnostic reports are
62+
owner-scoped follow-up performed formatting and compilation only; no tests were
63+
executed after the owner's scope clarification. Runtime qualification remains
64+
outside this inspection. Original diagnostic and build reports are
6165
kept outside the checkout.
6266

6367
TASK-CQ-UNIT64-010 implements the owner's 2026-10-06 rule-specific correction:

‎src/KeyLoad.AppHost/Features/ClusterRouting/Validation/TwoRf3Profile.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Globalization;
22
using KeyLoad.AppHost.Features.TestInfrastructure;
3-
using Microsoft.Extensions.Configuration;
43
using KeyLoad.Storage.ZoneTree;
4+
using Microsoft.Extensions.Configuration;
55

66
namespace KeyLoad.AppHost.Features.ClusterRouting;
77

‎src/KeyLoad.Core/Features/BackupRestore/Validation/AtomicPartitionRosterOriginValidation.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ internal static long ReadBound(IKeyValueView view, AtomicPartitionCatalogEntryV1
1212
{
1313
var origin = view.GetRecord<AtomicPartitionRosterRestoreOrigin>(
1414
AtomicPartitionRosterRestoreOriginSerialization.OriginKey(entry.Partition));
15-
if (origin is null) { return NoHistoricalBound; }
15+
if (origin is null)
16+
{ return NoHistoricalBound; }
1617
var identity = view.GetRecord<AtomicPartitionRosterRestoreIdentity>(
1718
AtomicPartitionRosterRestoreOriginSerialization.IdentityKey());
1819
if (identity is null || !AtomicPartitionRosterRestoreOriginSerialization.MatchesIdentity(identity, currentIncarnation))

‎src/KeyLoad.Orleans/Features/ClusterRouting/Grains/CommandPartitionGrain.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
using KeyLoad.Core;
2-
using Orleans.Runtime.Placement;
32
using Microsoft.Extensions.DependencyInjection;
43
using Microsoft.Extensions.Logging;
54
using Microsoft.Extensions.Options;
5+
using Orleans.Runtime.Placement;
66

77
namespace KeyLoad.Orleans;
88

‎src/KeyLoad.Server/Features/ClusterRouting/Execution/RequestCqrsProbeCleanupInventory.cs‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,17 @@ internal void Read(string path, string name, List<RequestCqrsProbeLoadedArm> loa
1616
if (name.StartsWith(RequestCqrsProbeProtocol.ArmFilePrefix, StringComparison.Ordinal))
1717
{
1818
var known = arms.SingleOrDefault(pair => RequestCqrsProbeFiles.ArmName(pair.Value.Record) == name);
19-
if (known.Key == Guid.Empty) { return; }
19+
if (known.Key == Guid.Empty)
20+
{ return; }
2021
RequireBytes(path, known.Value.Bytes);
2122
loaded.Add(new(known.Value.Record, known.Value.Bytes));
2223
return;
2324
}
2425
if (name == RequestCqrsProbeProtocol.OwnerFile
25-
|| name.StartsWith(RequestCqrsProbeProtocol.TemporaryFilePrefix, StringComparison.Ordinal)) { return; }
26-
if (!controls.TryGetValue(name, out var bytes)) { throw Invalid(); }
26+
|| name.StartsWith(RequestCqrsProbeProtocol.TemporaryFilePrefix, StringComparison.Ordinal))
27+
{ return; }
28+
if (!controls.TryGetValue(name, out var bytes))
29+
{ throw Invalid(); }
2730
RequireBytes(path, bytes);
2831
present.Add(name);
2932
if (name.StartsWith(RequestCqrsProbeProtocol.MarkerFilePrefix, StringComparison.Ordinal))
@@ -46,13 +49,15 @@ internal void RequireArmQuota(IEnumerable<string> names)
4649
.Concat(arms.Values.Select(arm => RequestCqrsProbeFiles.ArmName(arm.Record)))
4750
.Concat(retired.Select(id => RequestCqrsProbeProtocol.ArmFilePrefix + id.ToString(RequestCqrsProbeProtocol.SessionIdFormat)
4851
+ RequestCqrsProbeProtocol.JsonFileSuffix)).Distinct(StringComparer.Ordinal).Count();
49-
if (count > options.Value.MaximumArms) { throw Invalid(); }
52+
if (count > options.Value.MaximumArms)
53+
{ throw Invalid(); }
5054
}
5155

5256
private void RequireBytes(string path, byte[] expected)
5357
{
5458
var actual = RequestCqrsProbeFiles.ReadRecord(path, options);
55-
if (!CryptographicOperations.FixedTimeEquals(expected, actual)) { throw Invalid(); }
59+
if (!CryptographicOperations.FixedTimeEquals(expected, actual))
60+
{ throw Invalid(); }
5661
}
5762

5863
private static InvalidOperationException Invalid() => new(RequestCqrsProbeProtocol.InvalidFiles);

‎src/KeyLoad.Server/Features/ClusterRouting/Execution/RequestCqrsReceiverIssueAdjunct.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ internal async Task<bool> TryObserveAsync(RequestCqrsProbeClaim primary, GrainRe
2525
|| arm.Record.SourceRequestId == primary.Identity.RequestId
2626
|| arm.Record.PrincipalId == primary.Identity.PrincipalId
2727
&& arm.Record.CommandId == primary.Identity.CommandId)).Take(PairMatchCeiling).ToArray();
28-
if (linked.Length == NoAdjunct) { return false; }
28+
if (linked.Length == NoAdjunct)
29+
{ return false; }
2930
if (linked.Length != ExactlyOneAdjunct || primary.ReceiverIssueAdjunct is not null)
3031
{ throw Invalid(); }
3132
var arm = linked[FirstAdjunct];
@@ -49,7 +50,8 @@ await hold(claim, RequestCqrsProbePhase.ParentReceiverIssueObserved, context,
4950

5051
internal void ProducerDisposed(RequestCqrsProbeClaim primary)
5152
{
52-
if (primary.ReceiverIssueAdjunct is not { } adjunct) { return; }
53+
if (primary.ReceiverIssueAdjunct is not { } adjunct)
54+
{ return; }
5355
files.WriteClaimedProducerDisposed(createMarker(adjunct, RequestCqrsProbePhase.ProducerDisposed,
5456
RequestCqrsProbeOutcome.Observed), adjunct.Arm);
5557
}

‎src/KeyLoad.Server/Features/ClusterRouting/Serialization/RequestCqrsProbeClaimedCleanup.cs‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ private RequestCqrsProbeSnapshot Read(RequestCqrsProbeCleanupInventory inventory
3333
{
3434
RequestCqrsProbePaths.RequireDirectory(root);
3535
var owner = RequestCqrsProbeFiles.ReadRecord(Path.Combine(root, RequestCqrsProbeProtocol.OwnerFile), options);
36-
if (!CryptographicOperations.FixedTimeEquals(ownerBytes, owner)) { throw Invalid(); }
36+
if (!CryptographicOperations.FixedTimeEquals(ownerBytes, owner))
37+
{ throw Invalid(); }
3738
var entries = Directory.EnumerateFileSystemEntries(root).Take(options.Value.MaximumFiles + OverflowEntry).ToArray();
38-
if (entries.Length > options.Value.MaximumFiles) { throw Invalid(); }
39+
if (entries.Length > options.Value.MaximumFiles)
40+
{ throw Invalid(); }
3941
var arms = new List<RequestCqrsProbeLoadedArm>();
4042
var releases = new List<RequestCqrsProbeReleaseRecord>();
4143
var markers = new List<RequestCqrsProbeMarkerRecord>();
@@ -46,7 +48,8 @@ private RequestCqrsProbeSnapshot Read(RequestCqrsProbeCleanupInventory inventory
4648
{
4749
var name = Path.GetFileName(path);
4850
total = checked(total + validateEntry(path, name));
49-
if (total > options.Value.MaximumAggregateBytes) { throw Invalid(); }
51+
if (total > options.Value.MaximumAggregateBytes)
52+
{ throw Invalid(); }
5053
inventory.Read(path, name, arms, releases, markers, present);
5154
}
5255
inventory.RequireKnownArmPresence(arms);
@@ -58,8 +61,10 @@ private RequestCqrsProbeSnapshot Read(RequestCqrsProbeCleanupInventory inventory
5861
private void RequireClaim(RequestCqrsProbeLoadedArm claim, RequestCqrsProbeSnapshot snapshot)
5962
{
6063
var current = snapshot.Arms.SingleOrDefault(arm => arm.Record.ArmId == claim.Record.ArmId);
61-
if (current is not null && CryptographicOperations.FixedTimeEquals(current.ExactBytes, claim.ExactBytes)) { return; }
62-
if (current is null && records.IsRetiredArm(claim.Record.ArmId, claim.ExactBytes)) { return; }
64+
if (current is not null && CryptographicOperations.FixedTimeEquals(current.ExactBytes, claim.ExactBytes))
65+
{ return; }
66+
if (current is null && records.IsRetiredArm(claim.Record.ArmId, claim.ExactBytes))
67+
{ return; }
6368
throw Invalid();
6469
}
6570

‎src/KeyLoad.Storage.ZoneTree/Features/BackupRestore/Recovery/ZoneTreeBackupRestoreRestore.cs‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ internal static StoreIdentity Restore(string backup, string destination,
3333
{
3434
try
3535
{
36-
if (Directory.Exists(staging)) { Directory.Delete(staging, recursive: true); }
36+
if (Directory.Exists(staging))
37+
{ Directory.Delete(staging, recursive: true); }
3738
}
3839
catch (Exception cleanup)
3940
{ throw new AggregateException(primary, cleanup); }
@@ -115,10 +116,12 @@ private static StoreIdentity ApplyRestoreAuthorityState(string destination,
115116

116117
private static void DisposeRestoredStore(ZoneTreeStore restored, Exception? primary)
117118
{
118-
try { restored.Dispose(); }
119+
try
120+
{ restored.Dispose(); }
119121
catch (Exception cleanup)
120122
{
121-
if (primary is null) { throw; }
123+
if (primary is null)
124+
{ throw; }
122125
throw new AggregateException(primary, cleanup);
123126
}
124127
}

‎tests/KeyLoad.CrashHost/Features/ClusterRouting/Helpers/NativeInstallFrameInspection.cs‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ internal static async Task<bool> TryRunAsync(string[] args)
1818
try
1919
{
2020
evidence.SetPhase(C1OutcomeInspectionFailurePhase.ValidateRequest);
21-
if (args.Length != SingleArgument) { throw new InvalidDataException(C1OutcomeInspectionProtocol.InvalidRequest); }
21+
if (args.Length != SingleArgument)
22+
{ throw new InvalidDataException(C1OutcomeInspectionProtocol.InvalidRequest); }
2223
evidence.SetPhase(C1OutcomeInspectionFailurePhase.ReadInput);
2324
var bytes = await C1OutcomeInspection.ReadRequestBytesAsync().ConfigureAwait(false);
2425
evidence.SetPhase(C1OutcomeInspectionFailurePhase.ValidateRequest);
@@ -33,7 +34,8 @@ internal static async Task<bool> TryRunAsync(string[] args)
3334
evidence.Capture(failure);
3435
var failures = new List<Exception> { failure };
3536
await ServerFailureObserver.ObserveAsync(() => C1OutcomeInspection.WriteBytesAsync(evidence.Bytes(), true), failures).ConfigureAwait(false);
36-
if (failures.Any(C1OutcomeInspectionFailures.ContainsFatal)) { ServerFailureObserver.ThrowIfAny(failures); }
37+
if (failures.Any(C1OutcomeInspectionFailures.ContainsFatal))
38+
{ ServerFailureObserver.ThrowIfAny(failures); }
3739
Environment.ExitCode = C1OutcomeInspectionProtocol.FailureExitCode;
3840
GC.KeepAlive(failures);
3941
}

‎tests/KeyLoad.CrashHost/Features/ClusterRouting/Helpers/NativeInstallFrameInspectionOperation.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ internal static NativeInstallFrameInspectionReceipt Run(NativeInstallFrameInspec
3232
KeySpace.PartitionOutcome(request.Partition, request.PrincipalId, request.CommandId), TimeProvider.System, CancellationToken.None);
3333
receipt = RequireOutcome(frame, request);
3434
}, failures);
35-
if (failures.Count > NoFailures) { evidence.Capture(failures[FirstFailure]); }
35+
if (failures.Count > NoFailures)
36+
{ evidence.Capture(failures[FirstFailure]); }
3637
evidence.SetPhase(C1OutcomeInspectionFailurePhase.DisposeStore);
3738
}, failures);
3839
ServerFailureObserver.ThrowIfAny(failures);

0 commit comments

Comments
 (0)