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

+6 -4
View File
@@ -20,9 +20,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Auto Link Books
docs:
content: |-
# Auto Link Books
`POST /api/sync/auto-link-books` — auth: jwt.
`POST /api/sync/auto-link-books` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/auto_link_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/auto_link_books.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
@@ -30,9 +30,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Link Books
docs:
content: |-
# Bulk Link Books
`POST /api/sync/bulk-link-books` — auth: jwt.
`POST /api/sync/bulk-link-books` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/bulk_link_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/bulk_link_books.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
@@ -21,9 +21,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Create Device File Alias
docs:
content: |-
# Create Device File Alias
`POST /api/devices/:id/file-aliases` — auth: jwt.
`POST /api/devices/:id/file-aliases` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/create_device_file_alias.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/create_device_file_alias.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: |-
# Delete Device File Alias
docs:
content: |-
# Delete Device File Alias
`DELETE /api/devices/:id/file-aliases/:aliasId` — auth: jwt.
`DELETE /api/devices/:id/file-aliases/:aliasId` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/delete_device_file_alias.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/delete_device_file_alias.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 Book Matches
docs:
content: |-
# Get Book Matches
`GET /api/books/match` — auth: jwt.
`GET /api/books/match` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/get_book_matches.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/get_book_matches.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: |-
# Get Device File Aliases
docs:
content: |-
# Get Device File Aliases
`GET /api/devices/:id/file-aliases` — auth: jwt.
`GET /api/devices/:id/file-aliases` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/get_device_file_aliases.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/get_device_file_aliases.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: |-
# Get Unlinked Book Suggestions
docs:
content: |-
# Get Unlinked Book Suggestions
`GET /api/sync/unlinked-books/:id/suggestions` — auth: jwt.
`GET /api/sync/unlinked-books/:id/suggestions` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/get_unlinked_book_suggestions.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/get_unlinked_book_suggestions.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 Unlinked Books
docs:
content: |-
# Get Unlinked Books
`GET /api/devices/:deviceId/sync/unlinked-books` — auth: jwt.
`GET /api/devices/:deviceId/sync/unlinked-books` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/get_unlinked_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/get_unlinked_books.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
@@ -25,9 +25,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Link Book
docs:
content: |-
# Link Book
`POST /api/devices/:deviceId/sync/link-book` — auth: jwt.
`POST /api/devices/:deviceId/sync/link-book` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/link_book.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/link_book.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: |-
# Search Books for Matching
docs:
content: |-
# Search Books for Matching
`POST /api/sync/books/query` — auth: jwt.
`POST /api/sync/books/query` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/search_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/search_books.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
@@ -20,9 +20,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Update Device File Alias
docs:
content: |-
# Update Device File Alias
`PUT /api/devices/:id/file-aliases/:aliasId` — auth: jwt.
`PUT /api/devices/:id/file-aliases/:aliasId` — auth: jwt.
Canonical reference: `docs/developer/api/book-matching/update_device_file_alias.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/book-matching/update_device_file_alias.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