Commit Graph
4 Commits
Author SHA1 Message Date
stumpylog e80ede4cb0 fix(profiling): assign realistic document ownership so seed data exercises the guardian permission path 2026-07-27 17:25:48 -07:00
stumpylog e0902c63d6 chore(profiling): record Stage 1 baseline for get_objects_for_user_owner_aware 2026-07-27 16:03:15 -07:00
stumpylogandClaude Sonnet 5 0506dcad05 chore(profiling): add append_profiling_history function for persistent profiling records
Adds two new functions to harness.py:
- _current_git_ref(): Gets the current git short SHA
- append_profiling_history(): Appends JSON line to profiling/results/history.jsonl

This enables profiling numbers to persist across sessions/dates, with every run
appended to an immutable timeline rather than overwriting per-stage snapshots.

Also adds corresponding test to verify the function writes valid JSON lines.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-27 15:49:14 -07:00
stumpylog 91647eecb5 chore(profiling): add throwaway-Postgres helper and typed profiling harness
Adds standalone profiling tooling (never merged into dev/main): a
persistent, self-healing Postgres 18 container helper
(run_with_postgres.sh/stop_postgres.sh), a scale-profile dataset seeder
(seed.py) whose document counts and guardian permission-row ratios
mirror real bug reports (#13276, #13161), and a typed profiling harness
(harness.py) for timing/query-count comparisons and EXPLAIN ANALYZE
capture, gated by require_postgres() so it never silently runs on
SQLite.

seed.py samples distinct (subject, document) pairs up front rather than
drawing with replacement, since guardian's assign_perm() dedupes on the
(subject, object, permission) triple -- with-replacement sampling
against a small group pool collides heavily (birthday paradox) and
undercounts the target permission-row ratios otherwise.
2026-07-27 15:08:23 -07:00