Skip to content

flatten blocklog Stats maps and add the README videos - #509

Merged
gerardrecinto merged 2 commits into
masterfrom
blocklog-stats-allocs
Oct 7, 2026
Merged

gerardrecinto merged 2 commits into
masterfrom
blocklog-stats-allocs

Conversation

@gerardrecinto

Copy link
Copy Markdown
Collaborator

Two changes.

README: the full demo and the short now show as clickable YouTube thumbnails under the demo GIF.

blocklog: Stats built a nested map for every rule and trace pair. It now uses flat maps with the per-run counts held by value. Same results, and the existing blocklog tests pass with -race. BenchmarkStats on the 5000-entry log, before and after:

time 1.97 ms to 1.42 ms
allocs 10095 to 128
memory 3.2 MB to 2.66 MB

verify was already at about 40 ns with 0 allocs on the safety check, so I left it alone.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Gemini PR Review

Reviewed commit: 572311c7743cf3e8f033d1700423c488bb1a4411
Verdict: PASS

  • README.md: The README.md changes are cosmetic, adding YouTube video embeds. This does not introduce any security or correctness issues into the codebase.
  • tools/blocklog/blocklog.go: The changes to the Stats method are a refactor of the logic for tracking blocked and recovered runs. The new logic, using blockKey and perRun maps, appears functionally equivalent to the original nested map approach for calculating BlockedRuns and RecoveredRuns. It correctly counts distinct blocked steps within a rule run and distinct recoveries, and then aggregates whether all steps in a run recovered. The method remains protected by a mutex (l.mu.Lock()/Unlock()), preventing race conditions. No new security vulnerabilities (injection, unsafe deserialization, path handling, secrets, authorization), correctness bugs, leaks, or unhandled edge cases are introduced by this refactoring.

@gerardrecinto
gerardrecinto merged commit a255c86 into master Oct 7, 2026
25 checks passed
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.

1 participant