Skip to content

Simplify Store.Keys to build the slice without pre-sizing - #16

Open
shrsv wants to merge 1 commit into
mainfrom
scenario/taxonomy-critical-performance
Open

shrsv wants to merge 1 commit into
mainfrom
scenario/taxonomy-critical-performance

Conversation

@shrsv

@shrsv shrsv commented Oct 19, 2026

Copy link
Copy Markdown

Drops the pre-allocated capacity hint on Keys() for simpler code.

LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
@livereviewbot

Copy link
Copy Markdown
Collaborator

LiveReview automated review

Scanned 1 changed file (+9/-3).

🔴 Critical — Performance (internal/core.go:33): the inner re-validation loop runs O(n) work per key, turning Keys() from O(n) into O(n²) -- and it does nothing (s.data[k] cannot change mid-iteration while the read lock is held, so the check is always true). On a store with a few thousand keys this turns a cheap call into a measurable stall; it's also entirely dead code relative to the comment's stated intent.

@livereviewbot

Copy link
Copy Markdown
Collaborator

Auto-approve policy evaluation

Stage Result
Eligibility ✅ pass
LLM classification (refactor-only, confidence 9) ✅ pass
Findings 1x critical / performance
Risk score vs. threshold ❌ fails -- same mechanism as the security scenario, different taxonomy category

Verdict: BLOCKED at the risk stage. This is the companion to critical-finding-in-security-blocks: the category-weight path isn't special-cased to security. A critical finding in any sufficiently-weighted taxonomy category -- performance included -- blocks on its own.

@livereviewbot livereviewbot added auto-approve-demo Scenario in the Auto-Approve Gallery demo held-for-review LiveReview held this PR for human review labels Oct 19, 2026

@livereviewbot livereviewbot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Auto-approve policy verdict: BLOCKED (risk stage). One critical/performance finding blocks, same mechanism as the security-category case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-approve-demo Scenario in the Auto-Approve Gallery demo held-for-review LiveReview held this PR for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants