Skip to content

perf(count): drive scoped counts from the assignee/priority cohort - #218

Merged
scbrown merged 3 commits into
mainfrom
wt/lex-efa
Nov 2, 2026
Merged

scbrown merged 3 commits into
mainfrom
wt/lex-efa

Conversation

@scbrown

@scbrown scbrown commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

sd count --assignee X --priority P put both filters in OPTIONAL { … } FILTER(…) after the work-item type triple. Quipu evaluates a pattern that holds a type triple in written order, so every scoped count scanned every seed before narrowing to the cohort. On a copy of the live board, sd count --assignee franklin --priority 1 --by status sends two such queries and took about 10.7s; the live command is killed at 5s, which blocks the burn-down that needs this count.

  • An explicit --assignee becomes VALUES ?assignee { <principal/X> "X" } ?s <agent> ?assignee, and a single non-default --priority becomes a required constant triple. Both go before the type triple, in all four branches (main/ephemeral, with/without a stored status).
  • Each is equivalent to the form it replaces: the old FILTER already rejected rows without the value, and VALUES keeps both stored assignee forms. The default priority 2 (applied to seeds without one), priority ranges and --unassigned keep the old form.
  • Only count uses the leading position; filter_fields still returns the same constraints for every other caller.

Evidence

On a restored copy of the live board, through a loopback read-only quipu-server 0.16.6:

  • sd count --assignee franklin --priority 1 --by status: 20/20 runs, p50 0.19s, p95 0.30s (before: 10.7s uncapped; killed at 5s live).
  • 36 scoped counts (6 owners × {no priority, P1, P2} × {total, --by status}) against sd 0.10.0: 35 byte-identical; the other is a count that sd 0.10.0 could not finish inside the server's 10s limit (now 49, matching its own by-status breakdown). Every count is faster; the heaviest went from 10.1s to 3.5s.
  • New driven-cohort cases in the scoped-vs-whole-snapshot server test (string and foreign assignees, the default priority, an assignee with no seeds, --assignee with --unassigned, priority ranges) pass with this change and on unchanged main.
  • cargo fmt --check, cargo clippy --all-targets -- -D warnings and a release build pass.

Demo: no recording — the observable change is query latency with identical output; the before/after timings and the differential above are the evidence.

Refs aegis-efa.

🤖 Generated with Claude Code

https://claude.ai/code/session_014TTLDAEqq5Whc7qUZsJMUM

Bead: aegis-efa

Overlap preflight: dc9b3e3e3ad91177897f733dc6ecadf673b4d4237d3c1a4ff0da51985a2f4df2

scbrown and others added 3 commits November 1, 2026 21:42
sd count --assignee X --priority P put both filters in OPTIONAL + FILTER
after the work-item type triple. Quipu evaluates a pattern that holds a
type triple in written order, so every count scanned every seed before
narrowing: on a copy of the live board, sd count --assignee franklin
--priority 1 --by status took ~4.5s per query and two queries, and was
killed at 5s (aegis-efa, blocking the burn-down in aegis-7mm).

An explicit assignee and a single non-default priority are now required
triples placed before the type triple. Each is equivalent to the form it
replaces: the FILTER already rejected rows without the value, and the
default priority 2 keeps the old form. Other filters and callers are
unchanged; filter_fields still returns the same constraints.

Refs aegis-efa

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014TTLDAEqq5Whc7qUZsJMUM
Refs aegis-efa

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014TTLDAEqq5Whc7qUZsJMUM
@scbrown
scbrown merged commit 9721304 into main Nov 2, 2026
19 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 2, 2026
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