Skip to content

chore: sync smartem-decisions OpenAPI spec to latest main#190

Merged
vredchenko merged 1 commit intomainfrom
chore/sync-smartem-openapi-spec
Apr 18, 2026
Merged

chore: sync smartem-decisions OpenAPI spec to latest main#190
vredchenko merged 1 commit intomainfrom
chore/sync-smartem-openapi-spec

Conversation

@vredchenko
Copy link
Copy Markdown
Collaborator

Summary

One-shot regeneration of `docs/api/smartem/swagger.json` from smartem-decisions main. Relates to smartem-decisions#253.

The checked-in spec had been frozen at `0.1.dev276+g1b7ed28d6.d20250818` (August 2025) because there is no automation wired up between backend releases and this copy. Eight months of endpoint and schema additions have been invisible to every consumer that pulls this file — the frontend's Orval client regen (`npm run api:update` in `packages/api`) among them.

Regenerated from smartem-decisions@`2c75a79` (fix: populate ATLAS_CREATED event id from atlas_id, not name), which includes all of the recent work:

  • #248 — post-commit SELECT storm fix
  • #250 — processing-feedback publish endpoints
  • #249 — bulk gridsquare creation endpoint
  • #254 — ATLAS_CREATED event id field fix
  • Plus ~8 months of prior work not tracked in the above issues.

Delta

Old New Change
Paths 25 58 +33 added, 0 removed
Schemas 30 51 +21 added, 0 removed

Zero removals — this is an additive-only sync, so existing generated clients will not break on regeneration.

New path families

  • Agent streaming + instruction lifecycle: `/agent/{agent_id}/session/{session_id}/heartbeat`, `.../instructions/stream`, `.../instructions/{instruction_id}/ack`
  • Debug surface for session/instruction management: `/debug/agent-connections`, `/debug/session/{session_id}/`, `/debug/sessions/`
  • Quality-prediction model surface: `/prediction_models`, `/quality_predictions`, `/quality_metrics`, `/prediction_model/{name}/...`
  • Image endpoints: `/grids/{grid_uuid}/atlas_image`, `/gridsquares/{gridsquare_uuid}/gridsquare_image`
  • Atlas tile gridsquare positions: `/atlas-tiles/{tile_uuid}/gridsquares`
  • Bulk gridsquare creation: `/grids/{grid_uuid}/gridsquares/batch` (#249)
  • Processing feedback: `/micrographs/{uuid}/{motion_correction|ctf_estimation}/{completed|registered}` (#250)

New schema highlights

`GridSquareBatchCreateRequest`, `GridSquareBatchCreateResponse`, `MotionCorrectionRequest`, `CtfEstimationRequest`, `ProcessingFeedbackPublishResponse`, `AgentInstructionAcknowledgement`, `AgentInstructionAcknowledgementResponse`, various quality/prediction models and responses.

Generation command

```
SKIP_DB_INIT=true uv run python -c "
import logging, json, pathlib
logging.disable(logging.CRITICAL)
import smartem_backend.api_server as s
pathlib.Path('docs/api/smartem/swagger.json').write_text(
json.dumps(s.app.openapi(), indent=2, sort_keys=True) + '\n'
)
"
```

(Run from a smartem-decisions checkout at the desired commit. Uses `sort_keys=True` to match the existing file's sorted-key convention, so future diffs stay readable.)

Test plan

  • `python -m json.tool docs/api/smartem/swagger.json` — valid JSON.
  • Delta check: 0 removals (additive-only).
  • Consumer smoke (to do manually after merge): in smartem-frontend, `cd packages/api && npm run api:update` — expect a clean regen with many new endpoints and types added, no breakage.

Next step

Automating this sync via a GitHub Actions workflow (part of smartem-decisions#253) will be a follow-up PR. Intent to open it for discussion before implementation.

Regenerated from smartem-decisions@2c75a79 (fix: populate ATLAS_CREATED
event id from atlas_id, not name).

The checked-in spec had been frozen at 0.1.dev276+g1b7ed28d6.d20250818
(August 2025) because there is no automation wired up between backend
releases and this copy. Eight months of endpoint and schema additions
were invisible to every consumer that pulls this file — the frontend's
Orval client regen (npm run api:update in packages/api) among them.

Delta vs previous spec:
  Paths:   25 -> 58  (+33 added, 0 removed)
  Schemas: 30 -> 51  (+21 added, 0 removed)

No path or schema removals, so this is an additive-only sync; existing
generated clients will not break on regeneration.

This is the one-shot catch-up. Automation of future regeneration is
tracked separately (smartem-decisions#253); that work will land a
GitHub Actions workflow that keeps this file in sync on every stable
smartem-decisions release.
@github-actions github-actions bot added the documentation Improvements or additions to project documentation label Apr 16, 2026
@vredchenko vredchenko merged commit 988cc78 into main Apr 18, 2026
7 checks passed
@vredchenko vredchenko deleted the chore/sync-smartem-openapi-spec branch April 18, 2026 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to project documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant