The current project follows a "literate coding" approach where:
- Only Amp is allowed to make code changes.
- Commit messages need to be detailled and include the link to the last Amp thread.
- The Amp thread may have been handed off from previous threads, which can be explored.
Draw a UML Sequence Diagram in Mermaid to show how Amp threads are synchronized with the application.
Amp threads synchronization UML sequence diagram
G-J
van Rooyen • @gvrooyen
7mo agooctoco-dash
Smart (Opus 4.5)
Unlisted
Searched codebase
Explored 4 files
Now I have a clear picture of the sync architecture. Let me create the sequence diagram:
Ran mermaid
The diagram shows the complete synchronization flow:
- User triggers sync via the "Refresh Data" button in Streamlit
- Incremental fetch - queries the last
updated_attimestamp to only fetch new/modified threads - OAuth token acquisition - uses client credentials flow with
auth.ampcode.com - Paginated thread fetching - loops through pages via
nextCursoruntil exhausted - Entity upserts - creates/updates Thread, User, and Repository records
- Usage backfill - fetches usage data for any threads missing
usage_usd - Returns summary - reports counts back to the UI