bruno: replace Python generator with Go golden-writer in the drift test

The generator moves into the Go toolchain per repo preference:
internal/docs/bruno_gen.go emits the OpenCollection mirrors (same output
contract — gate-verified example-request bodies, env-var params,
device-token headers, login/register/refresh token-capture scripts) and
TestBrunoMirrorsDocs grows a -update flag: verification by default,
regeneration on demand:

  go test ./internal/docs -run TestBrunoMirrorsDocs -update

Generator and checker are now the same code — they cannot drift apart.
scripts/gen_bruno_from_docs.py deleted; opencollection.yml README points
at the go-test command.

Also fixed vs the Python pass: mirror placement follows the docs tree
folder (RelPath), not the area frontmatter (several docs — highlights,
notes, ratings, users, progress — carry a different area); docs blocks
emit the collection's mapping form (content + type), not a bare scalar;
JSON body sanity is checked at generation time.

Idempotent: back-to-back -update runs are byte-identical.
make test green (9 pkgs).
This commit is contained in:
John O'Keefe committed 2026-10-24 18:47:56 -04:00
1 parent acd82fff0a
commit cfcd95b25e
195 files changed
+1479 -1073

No files matched your search

@@ -23,9 +23,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Delete Media Items
docs:
content: |-
# Bulk Delete Media Items
`POST /api/media-items/bulk-delete` — auth: jwt.
`POST /api/media-items/bulk-delete` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/bulk_delete_media_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/bulk_delete_media_items.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -35,9 +35,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Update Media Items
docs:
content: |-
# Bulk Update Media Items
`POST /api/media-items/bulk-update` — auth: jwt.
`POST /api/media-items/bulk-update` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/bulk_update_media_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/bulk_update_media_items.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -27,9 +27,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Create Media Bookmark
docs:
content: |-
# Create Media Bookmark
`POST /api/media-items/:id/bookmarks` — auth: jwt.
`POST /api/media-items/:id/bookmarks` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/create_media_bookmark.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/create_media_bookmark.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -31,9 +31,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Create Media Item
docs:
content: |-
# Create Media Item
`POST /api/media-items` — auth: jwt+admin.
`POST /api/media-items` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/create_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/create_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Delete Media Bookmark
docs:
content: |-
# Delete Media Bookmark
`DELETE /api/media-items/:id/bookmarks/:bookmarkId` — auth: jwt.
`DELETE /api/media-items/:id/bookmarks/:bookmarkId` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/delete_media_bookmark.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/delete_media_bookmark.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Delete Media Item
docs:
content: |-
# Delete Media Item
`DELETE /api/media-items/:id` — auth: jwt+admin.
`DELETE /api/media-items/:id` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/delete_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/delete_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Delete Media Review
docs:
content: |-
# Delete Media Review
`DELETE /api/media-items/:id/review` — auth: jwt.
`DELETE /api/media-items/:id/review` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/delete_media_review.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/delete_media_review.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Deleted Annotations History
docs:
content: |-
# Deleted Annotations History
`GET /api/media-items/:id/annotations/deleted` — auth: jwt.
`GET /api/media-items/:id/annotations/deleted` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/deleted_annotations.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/deleted_annotations.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Download Media Item File
docs:
content: |-
# Download Media Item File
`GET /api/media-items/:id/download` — auth: jwt.
`GET /api/media-items/:id/download` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/download_media_item_file.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/download_media_item_file.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Filter Count
docs:
content: |-
# Filter Count
`GET /api/media-items/filter-count` — auth: jwt.
`GET /api/media-items/filter-count` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/filter_count.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/filter_count.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Audio Chapters
docs:
content: |-
# Get Audio Chapters
`GET /api/media-items/:id/chapters` — auth: jwt.
`GET /api/media-items/:id/chapters` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_audio_chapters.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_audio_chapters.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Audio Track
docs:
content: |-
# Get Audio Track
`GET /api/media-items/:id/audio/:trackIndex` — auth: jwt.
`GET /api/media-items/:id/audio/:trackIndex` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_audio_track.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_audio_track.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Item Facets
docs:
content: |-
# Get Media Item Facets
`GET /api/media-items/facets` — auth: jwt.
`GET /api/media-items/facets` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_facets.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_facets.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Bookmarks
docs:
content: |-
# Get Media Bookmarks
`GET /api/media-items/:id/bookmarks` — auth: jwt.
`GET /api/media-items/:id/bookmarks` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_media_bookmarks.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_media_bookmarks.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Highlight
docs:
content: |-
# Get Media Highlight
`GET /api/media-items/:id/highlights/:highlightId` — auth: jwt.
`GET /api/media-items/:id/highlights/:highlightId` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_media_highlight.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_media_highlight.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Item
docs:
content: |-
# Get Media Item
`GET /api/media-items/:id` — auth: jwt.
`GET /api/media-items/:id` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Note
docs:
content: |-
# Get Media Note
`GET /api/media-items/:id/notes/:noteId` — auth: jwt.
`GET /api/media-items/:id/notes/:noteId` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_media_note.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_media_note.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Get Media Review
docs:
content: |-
# Get Media Review
`GET /api/media-items/:id/review` — auth: jwt.
`GET /api/media-items/:id/review` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/get_media_review.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/get_media_review.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# List Media Items
docs:
content: |-
# List Media Items
`GET /api/media-items` — auth: jwt.
`GET /api/media-items` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/list_media_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/list_media_items.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -19,9 +19,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Merge Archived Media Item
docs:
content: |-
# Merge Archived Media Item
`POST /api/media-items/:id/merge` — auth: jwt+admin.
`POST /api/media-items/:id/merge` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/merge_archived_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/merge_archived_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Purge Archived Media Items
docs:
content: |-
# Purge Archived Media Items
`POST /api/media-items/purge-archived` — auth: jwt+admin.
`POST /api/media-items/purge-archived` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/purge_archived_media_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/purge_archived_media_items.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Purge Deleted Annotation
docs:
content: |-
# Purge Deleted Annotation
`DELETE /api/media-items/:id/annotations/:annotationId` — auth: jwt.
`DELETE /api/media-items/:id/annotations/:annotationId` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/purge_deleted_annotation.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/purge_deleted_annotation.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Rescan Media Item
docs:
content: |-
# Rescan Media Item
`POST /api/media-items/:id/rescan` — auth: jwt+admin.
`POST /api/media-items/:id/rescan` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/rescan_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/rescan_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Restore Deleted Annotation
docs:
content: |-
# Restore Deleted Annotation
`POST /api/media-items/:id/annotations/:annotationId/restore` — auth: jwt.
`POST /api/media-items/:id/annotations/:annotationId/restore` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/restore_deleted_annotation.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/restore_deleted_annotation.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Search Media Items (Unified):<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/create_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/update_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|channel|>Edited docs/developer/api/media-items/delete_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/search_media_items.md (1 replacement)
docs:
content: |-
# Search Media Items (Unified):<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/create_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/update_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|channel|>Edited docs/developer/api/media-items/delete_media_item.md (1 replacement)<|end|><|start|>edit to=assistant<|channel|>analysis<|message|>Edited docs/developer/api/media-items/search_media_items.md (1 replacement)
`GET /api/media-items/search` — auth: jwt.
`GET /api/media-items/search` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/search_media_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/search_media_items.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -19,9 +19,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Set Audio Speed
docs:
content: |-
# Set Audio Speed
`PUT /api/media-items/:id/audio-speed` — auth: jwt.
`PUT /api/media-items/:id/audio-speed` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/set_audio_speed.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/set_audio_speed.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Unarchive Media Item
docs:
content: |-
# Unarchive Media Item
`POST /api/media-items/:id/unarchive` — auth: jwt+admin.
`POST /api/media-items/:id/unarchive` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/unarchive_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/unarchive_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -21,9 +21,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Update Media Bookmark
docs:
content: |-
# Update Media Bookmark
`PUT /api/media-items/:id/bookmarks/:bookmarkId` — auth: jwt.
`PUT /api/media-items/:id/bookmarks/:bookmarkId` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/update_media_bookmark.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/update_media_bookmark.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -23,9 +23,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Update Media Item
docs:
content: |-
# Update Media Item
`PUT /api/media-items/:id` — auth: jwt+admin.
`PUT /api/media-items/:id` — auth: jwt+admin.
Canonical reference: `docs/developer/api/media-items/update_media_item.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/update_media_item.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown
+6 -4
View File
@@ -19,9 +19,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Upsert Media Review
docs:
content: |-
# Upsert Media Review
`POST /api/media-items/:id/review` — auth: jwt.
`POST /api/media-items/:id/review` — auth: jwt.
Canonical reference: `docs/developer/api/media-items/upsert_media_review.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/media-items/upsert_media_review.md (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, then run the drift test with -update.
type: text/markdown