Skip to content

spec: add-delivery-status - #1

Merged
brunosouzas merged 4 commits into
mainfrom
change/add-delivery-status
Oct 9, 2026
Merged

brunosouzas merged 4 commits into
mainfrom
change/add-delivery-status

Conversation

@brunosouzas

Copy link
Copy Markdown
Owner

OpenSpec change add-delivery-status, proposed from the one-line request:

"Precisamos de uma API que, dado o número do pedido, retorne o status da entrega."

  • v1 by Claude (openspec-propose), no code. openspec validate --strict passes.
  • The proposal lists open questions for the product owner. Answers and an independent review come as new commits on this branch.

Pending: owner answers, review and approval of one commit. Opening or validating this PR is not approval. After approval, implementation runs from the approved artifacts only.

@brunosouzas

Copy link
Copy Markdown
Owner Author

Independent review — Codex, clean session, read-only (v2, commit after the owner's answers)

Prompt: judge whether an implementer with no other context could build exactly the intended behaviour from these artifacts alone; classify Blocker / Major / Minor; verdict GO / NO-GO. openspec validate --strict was passing.

Blocker: none.

Major

  1. Order-number identity is undefined. "1 to 20 digits" permits leading zeros but does not say whether 01001 identifies order 1001. Fix: specify ASCII digits [0-9]{1,20} and whether leading zeros are preserved; add a scenario.
  2. Unsupported methods and unmatched paths have no contract. POST on the endpoint, an unrelated path, or /api/orders//delivery-status are undefined. Fix: a short routing requirement with status, headers and body.
  3. Response-field restriction contradicts the error responses. "Only orderNumber and status" vs. message in errors; error text defined only for 9999 and abc. Fix: limit the two-field rule to success; define error templates.
  4. Evidence tasks do not verify the complete behaviour. No 20-digit boundary, no leading-zero case, only one status exercised; "Same for" has no acceptance check; a Maven build does not prove HTTP behaviour.

Minor

  1. design.md still treats approved decisions as unanswered defaults.
  2. "One flow" constrains internal structure without justification.

Verdict: NO-GO — resolve the major contract gaps; changes can stay short and confined to this endpoint.

@brunosouzas

Copy link
Copy Markdown
Owner Author

Independent review — Codex, clean session (v3, commit 5606201)

Major

  1. File: openspec/changes/add-delivery-status/specs/delivery-status/spec.md:68–75
    Issue: “Any method other than GET” includes HEAD, but the requirement mandates a JSON response body. HEAD responses cannot contain a body, so an implementer cannot satisfy this contract literally. The POST scenario does not reveal the contradiction.
    Concrete fix: Specify that HEAD returns 405 without a body, while other unsupported methods return the stated JSON error. Add a HEAD scenario and its curl evidence task.

  2. File: openspec/changes/add-delivery-status/specs/delivery-status/spec.md:54–70
    Issue: Error precedence is undefined. POST /api/orders/abc/delivery-status satisfies both the malformed-number rule (400) and unsupported-method rule (405). Implementers could produce different observable behaviour depending on validation order. AGENTS.md:9–11 prohibits silently making this decision.
    Concrete fix: Explicitly limit order-number validation and lookup to GET requests, with unsupported methods returning 405 regardless of the identifier. Alternatively, record the owner’s intended precedence.

Minor

  1. File: openspec/changes/add-delivery-status/tasks.md:10
    Issue: Requiring captured bodies to match scenarios “exactly” could imply byte-for-byte JSON comparison, including whitespace and field order. The spec defines fields and values, without requiring a serialization format. This makes task completion unnecessarily ambiguous.
    Concrete fix: State that JSON bodies are compared structurally, preserving exact field names, types and values; status and specified headers are checked separately.

Verdict: NO-GO. The core scope, sample data and response contracts are clear, but method handling needs a consistent, implementable contract before implementation.


Addressed in v4: 405 limited to POST/PUT/PATCH/DELETE and checked before the order number (HEAD/OPTIONS out of scope); bodies compared structurally.

@brunosouzas
brunosouzas merged commit 2c551a7 into main Oct 9, 2026
2 checks passed
@brunosouzas
brunosouzas deleted the change/add-delivery-status branch October 10, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant