Skip to content

docs: document the Profile API and correct the gate count - #21

Merged
cvega merged 1 commit into
mainfrom
docs/profile-and-gates
Jun 14, 2026
Merged

cvega merged 1 commit into
mainfrom
docs/profile-and-gates

Conversation

@cvega

@cvega cvega commented Jun 14, 2026

Copy link
Copy Markdown
Owner

What

Brings the docs back in line with the code after this session's changes — primarily documenting the Profile workspace (which shipped without API docs) and correcting a stale gate count.

Approach

I audited all the docs against the current code, not just the obvious ones. Most were already accurate (the architecture/server-reorg and release-flow PRs kept them current). Only three files were actually wrong or incomplete:

docs/api.md — added the Profile API (was entirely missing)

  • New Profile section documenting all four endpoints:
    • POST /api/profile — start a run (org-only body, 201 on success, 400 for bad org / no source creds)
    • GET /api/profile — list runs → { "runs": [...] }
    • GET /api/profile/:id — run + per-repo considerations/insights, 404 if unknown
    • GET /api/profile/:id/events — SSE progress stream
  • Documented the SSE event shapes (progress / done) and that profile streams are ephemeral (no replay/?after= cursor, unlike migration streams).
  • Updated the intro to note /api/profile/* is the Profile workspace, and added it to the table of contents.
  • Verified against the actual route handlers — e.g. GET /api/profile returns { runs } and is not paginated, the request body is just { org }, and POST returns 201.

README.md — surfaced Profile + fixed the gate count

  • Added "Pre-migration profiling" to the hero tagline and a Profile capability bullet.
  • Fixed the "at a glance" gate list: it listed 10 gates but verify runs 11 — added the missing import-boundary gate.

.github/workflows/verify.yml — fixed a stale comment

  • The comment said "exact 10-gate suite" and omitted boundaries; corrected to 11 with boundaries listed. (Comment-only; the actual bun run verify:json was already correct.)

Left unchanged (audited, already accurate)

architecture.md (already documents the core/migrate/profile layering, the boundaries gate, and the profile pipeline), configuration.md (all env vars match .env.example), development.md (11-gate suite + the new Releasing section), deployment.md, getting-started.md, troubleshooting.md, CONTRIBUTING.md.

Validation

  • Full gate suite green (ok: true); docs and the workflow comment are outside all gate scopes.
  • verify.yml parses as valid YAML.
  • Profile API details cross-checked against src/routes/api/profile/** and src/lib/server/profile/{types,events}.ts.

Minor follow-up (not in this PR)

Two code comments on ProfileRun (src/lib/server/profile/types.ts) still say "gaps" for the blockers/warnings fields — leftover from the gap → consideration rename. Trivial, but it's a src/ change so I kept it out of this docs-only PR. Happy to fix separately.

The Profiler workspace shipped without API docs, and a couple of places
still counted 10 verify gates instead of 11.

- api.md: add a Profile section (POST/GET /api/profile, GET /api/profile/:id,
  and the /events SSE stream) covering the org-only request body, the 201/400
  responses, and the progress/done event shapes — and note in the intro that
  /api/profile/* is the Profile workspace.
- README: add profiling to the hero tagline and a Profile capability bullet;
  add the import-boundary gate to the "at a glance" list (10 → 11).
- verify.yml: fix the stale "10-gate" comment to 11 and list the boundaries
  gate.

Audited the rest of the docs against the current code: architecture,
configuration, development (incl. the Releasing section), deployment,
getting-started, troubleshooting, and CONTRIBUTING are already accurate and
were left unchanged.
@cvega
cvega merged commit 06e018e into main Jun 14, 2026
2 checks passed
@cvega
cvega deleted the docs/profile-and-gates branch June 18, 2026 08:25
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