fix(api): OpenAPI StackRequest additionalProperties + generic 404 hint cleanup (DOG-30 + BUG-API-105)#186
Merged
mastermanas805 merged 2 commits intoMay 30, 2026
Conversation
7201607 to
fa4da7d
Compare
…tarballs (DOG-30)
StackRequest used to model the dynamic per-service multipart field as a
literal property named "<service-name>". OpenAPI-3 codegen clients
(Postman, openapi-generator, etc.) read this as "a property literally
named <service-name>" — so generated upload code emits a field with
that exact literal name and the deploy fails.
Now: the dynamic field is expressed via additionalProperties (the
OpenAPI-3 idiom for "any additional property with this shape"). The
description spells out the contract — for every service in
manifest.services, emit one multipart field named after the real service
name whose value is the gzipped tar of that service's build context.
Codegen clients now produce correct upload loops.
Existing CLI/dashboard/MCP clients build the multipart body imperatively
from manifest.services (not from the OpenAPI schema) so this is purely
a docs/contract improvement — no runtime behaviour change.
Coverage block:
Symptom: StackRequest schema property literally named "<service-name>"
Enumeration: rg -F '<service-name>' internal/handlers/openapi.go
Sites found: 2 (StackRequest property + StackResponse.services.url
description, where it's a real placeholder in human prose)
Sites touched: 1 (StackRequest property — the schema bug). The
StackResponse description text is human prose, not a
property name.
Coverage test: TestOpenAPI_StackRequestUsesAdditionalProperties —
asserts the literal '<service-name>' property is gone
AND additionalProperties is present with the binary-
upload shape. Fails today before the schema change.
Live verified: pending merge + auto-deploy + curl /openapi.json
| jq '.components.schemas.StackRequest'
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…rom generic 404 (BUG-API-105)
The generic "not_found" agent_action used to tack on "anon resources
also auto-expire after 24h" — irrelevant when the 404 is a typo'd path,
unknown internal endpoint, or authenticated misroute. Hint is kept on
the surface-specific 404s (webhook_not_found etc.) where the auto-
expire footnote IS actionable.
Coverage block:
Symptom: 404 agent_action says "anon resources auto-expire" on
any 404 including internal/typo'd routes
Enumeration: rg 'anon resources' internal/ --type go
Sites found: 2 — webhook_not_found (kept; correct context) +
generic not_found (changed)
Sites touched: 1 (generic not_found)
Coverage test: N/A — agent_action contract is the prose itself; no
test pins the exact wording for the generic 404 today.
Live verified: pending merge + auto-deploy + curl unknown path
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
fa4da7d to
d09c91d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
StackRequestschema had a literal property named"<service-name>"— codegen clients (Postman, openapi-generator) interpreted it as a real property and emitted upload code with that exact literal field name. Replaced withadditionalProperties(OpenAPI-3 idiom for dynamic field names).agent_actiontacked on "anon resources also auto-expire after 24h" — irrelevant on typo'd / internal / authenticated misroutes. Hint kept on surface-specific 404s (webhook_not_foundetc.) where it IS actionable.Rule-17 coverage block (DOG-30)
StackRequestschema property literally named"<service-name>"rg -F '<service-name>' internal/handlers/openapi.go— 2 hitsTestOpenAPI_StackRequestUsesAdditionalProperties— asserts the literal property is gone ANDadditionalPropertiesis present withtype: string+format: binary.Rule-17 coverage block (BUG-API-105)
rg 'anon resources' internal/ --type go— 2 hitsnot_found— generic).webhook_not_foundkept because the auto-expire footnote IS valid context for a webhook-token 404.Test plan
go build ./.../go vet ./...go test ./internal/handlers/ -short -count=1 -run TestOpenAPI(all pass including newTestOpenAPI_StackRequestUsesAdditionalProperties)go test ./internal/handlers/ -short -count=1 -run TestAgentAction|TestHelpers|TestRespondError(clean)curl /openapi.json | jq '.components.schemas.StackRequest.additionalProperties'returns binary-upload shape;curl -X GET /internal/set-tieragent_action no longer mentions "anon resources auto-expire"