Skip to content

feat: pgcrate brief — whole database in one dense screen (PGC-100)#18

Merged
jackschultz merged 1 commit into
mainfrom
brief
Jun 11, 2026
Merged

feat: pgcrate brief — whole database in one dense screen (PGC-100)#18
jackschultz merged 1 commit into
mainfrom
brief

Conversation

@jackschultz

Copy link
Copy Markdown
Owner

The session-start orientation command, spec'd from observed agent friction (first dogfood session): target echo first (the wrong-database hazard), ALL schemas → tables → estimated rows (non-public schemas are the headline — data hiding outside public caused the original wild-goose chase), compact FK map, migrations applied/pending when project config resolves, extensions, catalog-cheap health flags.

  • ~20ms typical; catalog/statistics reads only, never count(*)
  • reltuples=-1 (never analyzed) renders as ~? — the common case on fresh DBs
  • Messy-instance handling: per-schema cap of 40 in human output, size-descending so signal beats orphan noise; --json uncapped
  • Read-only guarantee: reads pgcrate.schema_migrations tolerantly instead of the write-capable helper (which CREATEs bookkeeping on first touch) — brief must never write to an arbitrary target; verified live
  • Dense/pretty via Density, pgcrate.brief JSON schema, SKILL.md session-start now leads with brief
  • 780 tests green (12 new, incl. multi-schema fixture)

Completes the 0.7 agent-wedge feature set.

- Built: `pgcrate brief` command (src/commands/brief.rs) — target echo,
  schemas→tables→estimated rows (reltuples, never count(*); -1 rendered as ?),
  compact FK graph, migrations line (applied/pending, silent when unconfigured),
  extensions + server version, catalog-cheap health flags (sequences >75%, XID age).
  Dense/pretty via PGC-102 Density; --json with pgcrate.brief schema + brief.schema.json.
  Wired into main.rs + commands/mod.rs; SKILL.md session-start now leads with brief
  and drops the "coming soon" note.
- Validation: cargo fmt --check clean, clippy clean for new files, 780 tests pass
  (768 baseline + 12 new: 9 brief_integration incl. multi-schema fixture, 3 unit).
  Live-verified on solitaire_local (multi-schema + migrations line) and the messy
  postgres instance (88 tables → per-schema cap). ~20ms, 50x under the sub-second bar.
- Notes: added a SCHEMA_TABLE_CAP=40 (human output only; JSON uncapped) and
  size-descending table ordering so a schema full of orphan/partition tables can't
  bury the headline — the messy-instance case made the cap necessary. Health flags
  are displayed not scored; brief always exits 0 (orientation, not triage).
@jackschultz jackschultz merged commit 1340176 into main Jun 11, 2026
0 of 2 checks passed
@jackschultz jackschultz deleted the brief branch June 11, 2026 00:15
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