Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions api/tinyhumans.backend.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"url": "https://api.tinyhumans.ai/swagger.json",
"title": "TinyHumans API",
"version": "1.0.0",
"pathCount": 230,
"totalOperationCount": 255,
"operationCount": 203,
"pathCount": 231,
"totalOperationCount": 256,
"operationCount": 204,
"supplementalOperationCount": 13,
"excludedAdminOperationCount": 44,
"excludedWebhookOperationCount": 12,
Expand Down Expand Up @@ -309,7 +309,7 @@
"name": "openCompany",
"basePath": "/opencompany",
"auth": "bearer",
"operationCount": 9,
"operationCount": 10,
"tags": [
"OpenCompany"
],
Expand All @@ -322,6 +322,7 @@
"POST /opencompany/instances/{slug}/custom-domain/verify",
"POST /opencompany/instances/{slug}/resume",
"POST /opencompany/instances/{slug}/suspend",
"POST /opencompany/instances/{slug}/update",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium security confident

Add the typed client method for the new update route

This exposes POST /opencompany/instances/{slug}/update in the public manifest without adding the matching Rust route entry, request/response types, typed namespace method, and route test. The generated-route parity test will also detect that the checked-in registry does not match the manifest. Complete the contract change across the Rust client and generated registry, or do not expose the route here.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed OpenCompany update method

This adds the route to the public SDK contract, but OpenCompanyApi has no method for it. Callers are forced to use the raw transport, contrary to the repository's requirement that every changed public operation have a matching typed method, request/response types, and route test. Add the typed update operation before exposing this route.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed client method for the new update route

The new public route is present in the manifest, but no update_instance-style method exists under src/api/opencompany.rs. This leaves the operation available only through the raw escape hatch and does not preserve the typed SDK surface expected for namespace operations. Add the corresponding client method and request type.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed method for the OpenCompany instance update route

Adding this manifest entry without adding the matching OpenCompanyApi operation makes the contract and typed API inconsistent. The new endpoint needs a typed request/response path and a route test, rather than being exposed only through raw HTTP.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority critical security confident

Regenerate the Rust route registry for the new route

This manifest adds POST /opencompany/instances/{slug}/update, but the pull request changes only the manifest. The repository's generated PUBLIC_ROUTES registry must be regenerated in the same change; otherwise the manifest and Rust transport allowlist disagree and the OpenAPI parity test will fail.

[RULE] generated-surface-sync ·

"PUT /opencompany/instances/{slug}/custom-domain"
]
},
Expand Down
1 change: 1 addition & 0 deletions src/generated_public_routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ pub const PUBLIC_ROUTES: &[(&str, &str)] = &[
("POST", "/opencompany/instances/{slug}/custom-domain/verify"),
("POST", "/opencompany/instances/{slug}/resume"),
("POST", "/opencompany/instances/{slug}/suspend"),
("POST", "/opencompany/instances/{slug}/update"),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed OpenCompany update method

This newly exposed public operation has no corresponding method on OpenCompanyApi (the client currently provides create, delete, suspend, resume, and custom-domain methods only). Callers must use the raw transport for a route that the generated public contract says is supported, contrary to the repository's one-typed-method-per-public-operation contract; add the request type, typed method, and route test alongside this registry entry.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium security confident

Add the typed OpenCompany update method

This exposes POST /opencompany/instances/{slug}/update in the public route registry without adding the corresponding OpenCompanyApi method, request/response types, and route test required for a contract change. Callers are forced to use the raw transport and lose the typed SDK surface and its normal response handling.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium security confident

Add the typed client method for the new update route

The new public route has no matching typed client method in the changed surface. Add the OpenCompany update operation with its request and response types and a route test so the generated registry and typed API remain consistent.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium security confident

Add the typed method for the instance update route

Registering this route alone leaves POST /opencompany/instances/{slug}/update available only through the raw escape hatch. The repository contract requires a matching typed OpenCompany method, DTOs, and route test for newly exposed operations.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium tests confident

Add typed method for the opencompany instance update route

The new public route POST /opencompany/instances/{slug}/update is added to PUBLIC_ROUTES, making it available via the raw HTTP escape hatch, but no corresponding typed method is added to OpenCompanyApi in src/api/opencompany.rs. Per repository rules ("Add matching Rust methods, request/response types, and route tests"), every new public route with a namespace change should have a typed method and a route test. Without this, callers must use the raw client and forfeit envelope unwrapping and typed error handling. Add pub async fn update_instance(...) to OpenCompanyApi and a wiremock test in tests/opencompany.rs similar to usage_gets_instance_usage_summary.

[RULE] missing-typed-method ·

("GET", "/opencompany/instances/usage"),
("POST", "/payments/coinbase/charge"),
("GET", "/payments/coinbase/charge/{gatewayTransactionId}"),
Expand Down
6 changes: 4 additions & 2 deletions tests/openapi_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ fn generated_rust_routes_match_the_public_manifest() {
// 202 -> 203: `GET /payments/credits/lots`, the caller's live credit lots
// and their expiries (subscription credit no longer rolls over; top-ups
// last a year).
assert_eq!(manifest["source"]["operationCount"], 203);
// 203 -> 204: `POST /opencompany/instances/{slug}/update`, the

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed client method for the new update route

This comment documents a public route that has no update_instance implementation anywhere under src/api. The contract change is therefore incomplete: callers cannot invoke the operation through the named OpenCompany namespace with the SDK's normal envelope and error handling.

[RULE] missing-typed-method ·

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add typed method for the opencompany instance update route

The new /opencompany/instances/{slug}/update route is only reflected in the manifest-count test. No matching typed OpenCompany request/response API or route test exists, so the SDK surface does not match the advertised public operation. Add the typed instance-update method before merging.

[RULE] missing-typed-method ·

// owner-triggered "update to latest" for a hosted company.
assert_eq!(manifest["source"]["operationCount"], 204);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority medium critique confident

Add the typed OpenCompany update method

The manifest now counts POST /opencompany/instances/{slug}/update, but OpenCompanyApi has no corresponding method or request/response type. This leaves the newly advertised operation available only through the raw escape hatch and violates the SDK's typed-operation contract; add the typed method and its route test.

[RULE] missing-typed-method ·

// 14 -> 13: `GET /orchestration/v1/steering` left with that family.
assert_eq!(manifest["source"]["supplementalOperationCount"], 13);
// 37 -> 39: the two service-token operations on
Expand All @@ -179,7 +181,7 @@ fn generated_rust_routes_match_the_public_manifest() {
// post's cover and body figures. Same token as the other blog writes.
assert_eq!(manifest["source"]["excludedAdminOperationCount"], 44);
assert_eq!(manifest["source"]["excludedWebhookOperationCount"], 12);
assert_eq!(rust_routes.len(), 203);
assert_eq!(rust_routes.len(), 204);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

priority critical critique confident

Regenerate the Rust route registry for the new route

The checked-in PUBLIC_ROUTES contains no POST /opencompany/instances/{slug}/update, so it remains at 203 entries while this assertion requires 204 and rust_routes == manifest_routes cannot pass. Regenerate the generated route registry so the new public route is present in PUBLIC_ROUTES (and remains absent from UNEXPOSED_ROUTES).

[RULE] generated-route-registry-drift ·

assert_eq!(rust_routes, manifest_routes);
assert!(rust_routes
.iter()
Expand Down
Loading