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
@@ -23,9 +23,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Add Auto-Assign Rule
docs:
content: |-
# Add Auto-Assign Rule
`POST /api/collections/:id/rules` — auth: jwt.
`POST /api/collections/:id/rules` — auth: jwt.
Canonical reference: `docs/developer/api/collections/add_auto_assign_rule.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/add_auto_assign_rule.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
@@ -26,9 +26,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Add Books
docs:
content: |-
# Bulk Add Books
`POST /api/collections/bulk-add-books` — auth: jwt.
`POST /api/collections/bulk-add-books` — auth: jwt.
Canonical reference: `docs/developer/api/collections/bulk_add_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/bulk_add_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
@@ -23,9 +23,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Assign Books
docs:
content: |-
# Bulk Assign Books
`POST /api/collections/:id/books` — auth: jwt.
`POST /api/collections/:id/books` — auth: jwt.
Canonical reference: `docs/developer/api/collections/bulk_assign.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/bulk_assign.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
@@ -22,9 +22,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Bulk Remove Books
docs:
content: |-
# Bulk Remove Books
`POST /api/collections/:id/books/bulk-remove` — auth: jwt.
`POST /api/collections/:id/books/bulk-remove` — auth: jwt.
Canonical reference: `docs/developer/api/collections/bulk_remove_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/bulk_remove_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: |-
# Create Collection
docs:
content: |-
# Create Collection
`POST /api/collections` — auth: jwt.
`POST /api/collections` — auth: jwt.
Canonical reference: `docs/developer/api/collections/create_collection.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/create_collection.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
+7 -5
View File
@@ -5,7 +5,7 @@ info:
http:
method: POST
url: '{{base_url}}/api/devices/{{collection_id}}/collections'
url: '{{base_url}}/api/devices/{{device_id}}/collections'
auth: inherit
body:
type: json
@@ -21,9 +21,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Create Shelf Mapping
docs:
content: |-
# Create Shelf Mapping
`POST /api/devices/:id/collections` — auth: jwt.
`POST /api/devices/:id/collections` — auth: jwt.
Canonical reference: `docs/developer/api/collections/create_shelf_mapping.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/create_shelf_mapping.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 Collection
docs:
content: |-
# Delete Collection
`DELETE /api/collections/:id` — auth: jwt.
`DELETE /api/collections/:id` — auth: jwt.
Canonical reference: `docs/developer/api/collections/delete_collection.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/delete_collection.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
+7 -5
View File
@@ -5,7 +5,7 @@ info:
http:
method: DELETE
url: '{{base_url}}/api/devices/{{collection_id}}/collections/{{collection_id}}'
url: '{{base_url}}/api/devices/{{device_id}}/collections/{{collection_id}}'
auth: inherit
settings:
encodeUrl: true
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Delete Shelf Mapping
docs:
content: |-
# Delete Shelf Mapping
`DELETE /api/devices/:id/collections/:collectionId` — auth: jwt.
`DELETE /api/devices/:id/collections/:collectionId` — auth: jwt.
Canonical reference: `docs/developer/api/collections/delete_shelf_mapping.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/delete_shelf_mapping.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 Collection
docs:
content: |-
# Get Collection
`GET /api/collections/:id` — auth: jwt.
`GET /api/collections/:id` — auth: jwt.
Canonical reference: `docs/developer/api/collections/get_collection.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/get_collection.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 Collections
docs:
content: |-
# Get Book Collections
`GET /api/collections/:id/books` — auth: jwt.
`GET /api/collections/:id/books` — auth: jwt.
Canonical reference: `docs/developer/api/collections/get_collection_books.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/get_collection_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
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# List Collections
docs:
content: |-
# List Collections
`GET /api/collections` — auth: jwt.
`GET /api/collections` — auth: jwt.
Canonical reference: `docs/developer/api/collections/list_collections.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/list_collections.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
@@ -22,9 +22,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Preview Collection
docs:
content: |-
# Preview Collection
`POST /api/collections/preview` — auth: jwt.
`POST /api/collections/preview` — auth: jwt.
Canonical reference: `docs/developer/api/collections/preview_collection.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/preview_collection.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: |-
# Remove Auto-Assign Rule
docs:
content: |-
# Remove Auto-Assign Rule
`DELETE /api/collections/:id/rules/:ruleId` — auth: jwt.
`DELETE /api/collections/:id/rules/:ruleId` — auth: jwt.
Canonical reference: `docs/developer/api/collections/remove_auto_assign_rule.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/remove_auto_assign_rule.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
@@ -22,9 +22,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Reorder Collection Items
docs:
content: |-
# Reorder Collection Items
`PUT /api/collections/:id/items/order` — auth: jwt.
`PUT /api/collections/:id/items/order` — auth: jwt.
Canonical reference: `docs/developer/api/collections/reorder_items.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/reorder_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
@@ -30,9 +30,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Test Rule
docs:
content: |-
# Test Rule
`POST /api/collections/test-rules` — auth: jwt.
`POST /api/collections/test-rules` — auth: jwt.
Canonical reference: `docs/developer/api/collections/test_rule.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/test_rule.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
@@ -26,9 +26,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Update Collection
docs:
content: |-
# Update Collection
`PUT /api/collections/:id` — auth: jwt.
`PUT /api/collections/:id` — auth: jwt.
Canonical reference: `docs/developer/api/collections/update_collection.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/update_collection.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: |-
# Update Collection Rule
docs:
content: |-
# Update Collection Rule
`PUT /api/collections/:id/rules/:ruleId` — auth: jwt.
`PUT /api/collections/:id/rules/:ruleId` — auth: jwt.
Canonical reference: `docs/developer/api/collections/update_rule.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/collections/update_rule.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