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
@@ -21,9 +21,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Add to Shelf
docs:
content: |-
# Add to Shelf
`POST /api/devices/:id/shelves` — auth: jwt.
`POST /api/devices/:id/shelves` — auth: jwt.
Canonical reference: `docs/developer/api/devices/add_to_shelf.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/add_to_shelf.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: |-
# Approve Device Registration
docs:
content: |-
# Approve Device Registration
`GET /api/devices/approve/:registration_id` — auth: jwt.
`GET /api/devices/approve/:registration_id` — auth: jwt.
Canonical reference: `docs/developer/api/devices/approve_device_registration.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/approve_device_registration.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: |-
# Clear Shelf
docs:
content: |-
# Clear Shelf
`DELETE /api/devices/:id/shelves/clear` — auth: jwt.
`DELETE /api/devices/:id/shelves/clear` — auth: jwt.
Canonical reference: `docs/developer/api/devices/clear_shelf.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/clear_shelf.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 Device
docs:
content: |-
# Delete Device
`DELETE /api/devices/:id` — auth: jwt.
`DELETE /api/devices/:id` — auth: jwt.
Canonical reference: `docs/developer/api/devices/delete_device.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/delete_device.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: |-
# Download Sidecar Config
docs:
content: |-
# Download Sidecar Config
`GET /api/devices/:id/sidecar/download` — auth: jwt.
`GET /api/devices/:id/sidecar/download` — auth: jwt.
Canonical reference: `docs/developer/api/devices/download_sidecar_config.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/download_sidecar_config.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 Device
docs:
content: |-
# Get Device
`GET /api/devices/:id` — auth: jwt.
`GET /api/devices/:id` — auth: jwt.
Canonical reference: `docs/developer/api/devices/get_device.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/get_device.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 Device Collection Mappings
docs:
content: |-
# Get Device Collection Mappings
`GET /api/devices/:id/collections` — auth: jwt.
`GET /api/devices/:id/collections` — auth: jwt.
Canonical reference: `docs/developer/api/devices/get_device_mappings.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/get_device_mappings.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: |-
# Get Device / Check Registration Status
docs:
content: |-
# Get Device / Check Registration Status
`POST /api/devices/register/status` — auth: none.
`POST /api/devices/register/status` — auth: none.
Canonical reference: `docs/developer/api/devices/get_devices.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/get_devices.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 Shelf
docs:
content: |-
# Get Shelf
`GET /api/devices/:id/shelves` — auth: jwt.
`GET /api/devices/:id/shelves` — auth: jwt.
Canonical reference: `docs/developer/api/devices/get_shelf.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/get_shelf.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 Device Sidecar Config
docs:
content: |-
# Get Device Sidecar Config
`GET /api/devices/:id/sidecar` — auth: jwt.
`GET /api/devices/:id/sidecar` — auth: jwt.
Canonical reference: `docs/developer/api/devices/get_sidecar_config.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/get_sidecar_config.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/devices/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/devices/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
@@ -13,9 +13,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# List User Devices
docs:
content: |-
# List User Devices
`GET /api/devices` — auth: jwt.
`GET /api/devices` — auth: jwt.
Canonical reference: `docs/developer/api/devices/list_devices.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/list_devices.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 Pending Device Registrations:<|end|><|start|><|start|>assistant to=edit<|channel|>analysis <|constrain|>xml<|message|><rfl:parameter name="path">
docs:
content: |-
# List Pending Device Registrations:<|end|><|start|><|start|>assistant to=edit<|channel|>analysis <|constrain|>xml<|message|><rfl:parameter name="path">
`GET /api/devices/pending` — auth: jwt.
`GET /api/devices/pending` — auth: jwt.
Canonical reference: `docs/developer/api/devices/list_pending_registrations.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/list_pending_registrations.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: |-
# Regenerate Device Token
docs:
content: |-
# Regenerate Device Token
`PUT /api/devices/:id/regenerate-token` — auth: jwt.
`PUT /api/devices/:id/regenerate-token` — auth: jwt.
Canonical reference: `docs/developer/api/devices/regenerate_device_token.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/regenerate_device_token.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: |-
# Register Device
docs:
content: |-
# Register Device
`POST /api/devices/register` — auth: none.
`POST /api/devices/register` — auth: none.
Canonical reference: `docs/developer/api/devices/register_device.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/register_device.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: |-
# Reject Device Registration
docs:
content: |-
# Reject Device Registration
`POST /api/devices/reject/:registration_id` — auth: jwt.
`POST /api/devices/reject/:registration_id` — auth: jwt.
Canonical reference: `docs/developer/api/devices/reject_device_registration.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/reject_device_registration.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: |-
# Remove from Shelf
docs:
content: |-
# Remove from Shelf
`DELETE /api/devices/:id/shelves` — auth: jwt.
`DELETE /api/devices/:id/shelves` — auth: jwt.
Canonical reference: `docs/developer/api/devices/remove_from_shelf.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/remove_from_shelf.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: |-
# Update Device
docs:
content: |-
# Update Device
`PUT /api/devices/:id` — auth: jwt.
`PUT /api/devices/:id` — auth: jwt.
Canonical reference: `docs/developer/api/devices/update_device.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/update_device.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
@@ -20,9 +20,11 @@ settings:
followRedirects: true
maxRedirects: 5
docs: |-
# Update Device Collection Mapping
docs:
content: |-
# Update Device Collection Mapping
`PUT /api/devices/:id/collections/:collectionId` — auth: jwt.
`PUT /api/devices/:id/collections/:collectionId` — auth: jwt.
Canonical reference: `docs/developer/api/devices/update_device_mapping.md` (docs site → Developer → API). This request is GENERATED from that doc; edit the doc, not this file.
Canonical reference: docs/developer/api/devices/update_device_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