Skip to content

fix(csharp-tests): remove 10 useless tuple-cast warnings (B-0073 step 2)#97

Merged
AceHack merged 1 commit intomainfrom
fix/lfg-csharp-useless-cast-removal-2026-04-28
Apr 28, 2026
Merged

fix(csharp-tests): remove 10 useless tuple-cast warnings (B-0073 step 2)#97
AceHack merged 1 commit intomainfrom
fix/lfg-csharp-useless-cast-removal-2026-04-28

Conversation

@AceHack
Copy link
Copy Markdown
Owner

@AceHack AceHack commented Apr 28, 2026

Summary

Step 2 of B-0073. Removes 10 `cs/useless-cast-to-self` warnings flagged by CodeQL on tuple-literal sites in C# tests.

Sites

  • `tests/Tests.CSharp/CircuitTests.cs` lines 70-72 (3 casts)
  • `tests/Tests.CSharp/ZSetTests.cs` lines 30-31 (4 casts) + 43-45 (3 casts)

Pattern: `((int, long))(N, NL)` → `(N, NL)`. Compiler already infers `(int, long)` from `N` (int) and `NL` (long); the cast was redundant.

Build verification

`dotnet build tests/Tests.CSharp/ -c Release --nologo` returns:

  • `0 Warning(s)`
  • `0 Error(s)`

Per AGENTS.md `TreatWarningsAsErrors` is on, so 0/0 is the contract.

Composes with

After PR #96 + this PR land + forward-sync to LFG + CodeQL re-scan, only the Scorecard SAST meta-finding remains (informational, not a real defect — separate disposition).

Agency-Signature-Version: 1
Agent: otto
Agent-Runtime: claude-code
Agent-Model: claude-opus-4-7
Credential-Identity: AceHack-shared
Credential-Mode: shared-with-aaron
Human-Review: not-implied-by-credential
Human-Review-Evidence: aaron-explicit-ask
Action-Mode: autonomous-fail-open
Task: B-0073-step-2-useless-cast-removal

…erals (B-0073 step 2)

The casts `((int, long))(N, NL)` on tuple literals like
`(1, 1L)` are flagged by CodeQL as `cs/useless-cast-to-self`
because the compiler already infers `(int, long)` from the
literal types (`int` from N, `long` from NL). The cast adds
no information.

Sites fixed (10 alerts → 0 after this lands and CodeQL
re-scans):
- tests/Tests.CSharp/CircuitTests.cs lines 70-72 (3 casts)
- tests/Tests.CSharp/ZSetTests.cs lines 30-31 (4 casts; two
  on each line) + lines 43-45 (3 casts)

Build verification: `dotnet build tests/Tests.CSharp/ -c
Release` returns 0 warnings, 0 errors. The casts were
genuinely redundant — array type inference `new[] { ... }`
correctly infers `(int, long)[]` from elements that are all
`(int, long)`.

This is step 2 of B-0073 (LFG csharp Code Scanning cleanup
blocking the code_quality:severity=all ruleset). Step 1 (PR
#96, obj/bin exclusion) drops 2 build-artifact alerts. This
PR drops the 10 source alerts. After both land + forward-sync
to LFG + CodeQL re-scan, only the Scorecard SAST meta-finding
remains (which is informational, not a real defect — separate
disposition).

Agency-Signature-Version: 1
Agent: otto
Agent-Runtime: claude-code
Agent-Model: claude-opus-4-7
Credential-Identity: AceHack-shared
Credential-Mode: shared-with-aaron
Human-Review: not-implied-by-credential
Human-Review-Evidence: aaron-explicit-ask
Action-Mode: autonomous-fail-open
Task: B-0073-step-2-useless-cast-removal
Copilot AI review requested due to automatic review settings April 28, 2026 09:24
@AceHack AceHack enabled auto-merge (squash) April 28, 2026 09:25
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes redundant tuple casts in C# test tuple-literal sites to eliminate cs/useless-cast-to-self CodeQL warnings (B-0073 step 2).

Changes:

  • Drop ((int, long)) casts around (int, long) tuple literals passed to ZSetModule.ofPairs in C# tests.
  • Keep tuple literals as (N, NL) / (1, 3L) etc., relying on C#’s type inference to produce ValueTuple<int, long>.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/Tests.CSharp/ZSetTests.cs Removes redundant tuple casts in ofPairs(new[] { ... }) calls in unit tests.
tests/Tests.CSharp/CircuitTests.cs Removes redundant tuple casts in ofPairs(new[] { ... }) call in an end-to-end circuit test.

@AceHack AceHack merged commit 0f5812d into main Apr 28, 2026
19 checks passed
@AceHack AceHack deleted the fix/lfg-csharp-useless-cast-removal-2026-04-28 branch April 28, 2026 09:27
AceHack added a commit that referenced this pull request Apr 28, 2026
…hain + P1 legal fix (#98)

* tick-history: 2026-04-28T09:37Z — 7 PRs MERGED + B-0073 LFG-unblock chain + P1 legal fix

Major-arc structural-unblock tick chain covering ~50 minutes
of work after 08:50Z post-compaction recovery:

- 7 AceHack PRs MERGED: #28 #94 #23 #19 #95 #96 #97
- B-0073 P0 root-cause + 2-step LFG ruleset unblock (CodeQL
  obj/bin exclusion + 10 useless-cast removals; build-verified
  0 warnings 0 errors)
- PR #72: 18 threads drained including P1 legal/IP paraphrase
  fix on 5 leaked-source verbatim-quote sites
- B-0074 P2 filed for spec-consistency drift sweep (8
  deferred-with-tracking items per bulk-resolve discipline)

Drift state: AceHack +9 ahead this chain (from merges), LFG
unchanged at +499 ahead (forward-sync pending — B-0073 fixes
need to land on LFG main before its ruleset gate clears).

Cron ff34da97 verified live.

Agency-Signature-Version: 1
Agent: otto
Agent-Runtime: claude-code
Agent-Model: claude-opus-4-7
Credential-Identity: AceHack-shared
Credential-Mode: shared-with-aaron
Human-Review: not-implied-by-credential
Human-Review-Evidence: aaron-explicit-ask
Action-Mode: autonomous-fail-open
Task: tick-history-2026-04-28T09-37

* fix(pr-98): drain 5 review-thread findings on tick-history row

- PR #94 timestamp: corrected from initial-draft '~08:48Z' to
  empirically-verified '09:09:02Z' (per gh pr view 94 --json
  mergedAt). The 08:48Z claim was stale-recall; the merge
  actually fired at 09:09Z when auto-merge cleared.
- 7-vs-9 PR count discrepancy: clarified that 7 PRs merged in
  this tick chain, session-cumulative is 9 including the prior
  #92/#87 compacted-context window. Drift +9 was correct;
  framing was ambiguous about scope.
- feedback_search_internet xref: replaced filename-pattern
  reference with full user-scope absolute path + explicit
  '(user-scope only; in-repo migration deferred per the
  natural-home-of-memories directive)' tag, addressing the P1
  broken-xref finding.

Agency-Signature-Version: 1
Agent: otto
Agent-Runtime: claude-code
Agent-Model: claude-opus-4-7
Credential-Identity: AceHack-shared
Credential-Mode: shared-with-aaron
Human-Review: not-implied-by-credential
Human-Review-Evidence: aaron-explicit-ask
Action-Mode: autonomous-fail-open
Task: pr-98-thread-drain-5-substantive-fixes
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