Skip to content

Use structural evidence for safety audit guards - #5021

Merged
Widthdom merged 3 commits into
mainfrom
fix-issue4912
Aug 1, 2026
Merged

Use structural evidence for safety audit guards#5021
Widthdom merged 3 commits into
mainfrom
fix-issue4912

Conversation

@Widthdom

@Widthdom Widthdom commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • replace line-proximity safety-audit guards with container-scoped structural evidence
  • require same-path whole-file size/control relationships and resolved awaited bounded-writer helpers
  • resolve the EnumerationOptions value actually passed to Directory.Enumerate*, including named arguments, lexical scope, and shadowing
  • expose accepted and rejected guard decision, reason, relationship, subject, container, and evidence-path metadata
  • add regression coverage for unsafe controls, named arguments, reassignment, conditional sources, switch dominance, helper binding, and option shadowing

Validation

  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Debug -f net8.0 --no-restore --filter FullyQualifiedName~Issue4912 (3 passed)
  • dotnet test tests/CodeIndex.Tests/CodeIndex.Tests.csproj -c Debug -f net9.0 --no-restore --filter FullyQualifiedName~Issue4912 (3 passed)
  • full net9.0 suite (10,574 passed, 420 skipped, 0 failed)
  • full net8.0 suite (11,047 passed, 7 skipped; one performance smoke exceeded its 20-second budget by 0.3 seconds under concurrent net9.0 load), followed by an isolated rerun of that performance smoke (passed in 3 seconds)
  • dotnet format CodeIndex.sln --verify-no-changes --no-restore
  • dotnet run --project tools/CodeIndex.Changelog -- check (86 fragments validated)
  • dotnet build CodeIndex.sln -c Debug --no-restore (0 warnings, 0 errors)
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll audit risky-code/file-read-all-text --allow-partial --format compact (0 findings)
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll audit phrase-risk-patterns/readalltext-call-site --allow-partial --format compact (0 findings)
  • dotnet ./src/CodeIndex/bin/Debug/net8.0/cdidx.dll audit filesystem-traversal/enumerate-without-options --allow-partial --format compact (4 remaining reviewable findings; 3 structurally safe calls excluded)
  • post-commit index . --commits HEAD --json (1,324 files, 11,070 chunks, 46,618 symbols, 458,577 references; 0 warnings/errors; index and reference graph complete/current)
  • two codex review --base origin/main adversarial-review rounds completed; all 15 actionable findings were fixed and regression-tested

Documentation and changelog

  • updated the English and Japanese sections in USER_GUIDE.md and TESTING_GUIDE.md
  • added changelog.d/unreleased/4912.fixed.md

Follow-ups

  • None.

Fixes #4912

@Widthdom
Widthdom marked this pull request as ready for review August 1, 2026 03:55
@Widthdom
Widthdom merged commit 35114e7 into main Aug 1, 2026
12 checks passed
@Widthdom
Widthdom deleted the fix-issue4912 branch August 1, 2026 03:55
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.

Let safety audits use guard evidence beyond a narrow local window

1 participant