catalogue: T6 — the send: one POST, send-then-record, one fail-loud shape #1124

Closed
opened 2026-09-01 20:50:00 +00:00 by ben · 2 comments
Owner

Parent

Spec #1116 (catalogue two tiers; DDR 0220 / ADR 0219). Feature #1073. Slice request-send-route in docs/slices/catalogue.yaml.

What to build

The request POST on the control API: kind (candidate | suggestion), slug or name + optional product, optional note. It makes one RequestService call; on accept it records the ledger entry and returns the canonical date; on refusal or unreachable it records NOTHING and returns the operator-facing reason — the single failure shape P4-S2bx renders. Dedupe returns the original date as a success, never an error. Requested is earned on accept, never before (ADR 0219).

Acceptance criteria

  • Accept → ledger entry exists with the broker's canonical date; the response carries it
  • Refusal / unreachable → ledger untouched, response carries the human reason; a retry after transient failure succeeds cleanly
  • Second request for the same slug (any operator) → success with the ORIGINAL date; no duplicate ledger entry
  • A suggestion send validates name required, why required, product optional — and records to the suggestions list on accept
  • Candidate-kind sends validate the slug against Candidates(); an installable or unknown slug is refused locally without a broker call

Blocked by

  • #1121 (service-request-ledger)
  • #1122 (broker-request-client)

Task manifest

task: request-send-route
implements_flow: p4-provisioning
implements_edge: "S2b-req → S2b (accept); S2b-req → S2bx (fail)"
wireframe: docs/ux/wireframes/p4-provisioning/p4-s2b-req-request-confirm.html + p4-s2bx-request-nothing-sent.html
seam: controlapi HTTP seam with the fake broker (accept/refuse/unreachable/dedupe)
depends_on: [catalogue:service-request-ledger, catalogue:broker-request-client]
out_of_scope: [UI dialogs, arrival loop]
needs_human_decision: []
## Parent Spec #1116 (catalogue two tiers; DDR 0220 / ADR 0219). Feature #1073. Slice `request-send-route` in docs/slices/catalogue.yaml. ## What to build The request POST on the control API: kind (candidate | suggestion), slug or name + optional product, optional note. It makes one RequestService call; on accept it records the ledger entry and returns the canonical date; on refusal or unreachable it records NOTHING and returns the operator-facing reason — the single failure shape P4-S2bx renders. Dedupe returns the original date as a success, never an error. Requested is earned on accept, never before (ADR 0219). ## Acceptance criteria - [ ] Accept → ledger entry exists with the broker's canonical date; the response carries it - [ ] Refusal / unreachable → ledger untouched, response carries the human reason; a retry after transient failure succeeds cleanly - [ ] Second request for the same slug (any operator) → success with the ORIGINAL date; no duplicate ledger entry - [ ] A suggestion send validates name required, why required, product optional — and records to the suggestions list on accept - [ ] Candidate-kind sends validate the slug against Candidates(); an installable or unknown slug is refused locally without a broker call ## Blocked by - #1121 (service-request-ledger) - #1122 (broker-request-client) ## Task manifest ```yaml task: request-send-route implements_flow: p4-provisioning implements_edge: "S2b-req → S2b (accept); S2b-req → S2bx (fail)" wireframe: docs/ux/wireframes/p4-provisioning/p4-s2b-req-request-confirm.html + p4-s2bx-request-nothing-sent.html seam: controlapi HTTP seam with the fake broker (accept/refuse/unreachable/dedupe) depends_on: [catalogue:service-request-ledger, catalogue:broker-request-client] out_of_scope: [UI dialogs, arrival loop] needs_human_decision: [] ```

swarm-claim host=matou-dev-server-01 run=16109
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=16109 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1124 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1124,
  "status": "success",
  "commits": [
    "a94ddc5b"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/servicerequest/send.go",
    "internal/controlapi/catalogue_requests.go",
    "internal/controlapi/catalogue_requests_integration_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/servicerequest ./internal/controlapi",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/servicerequest/... ./internal/controlapi/...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Accept -> ledger entry exists with the broker's canonical date; the response carries it": "internal/controlapi/catalogue_requests_integration_test.go TestCatalogueRequests_Accept_RecordsAndReturnsCanonicalDate; Sender.sendCandidate records on accept via RecordRequest then returns SendResult.RequestedOn (internal/servicerequest/send.go)",
    "Refusal / unreachable -> ledger untouched, response carries the human reason; a retry after transient failure succeeds cleanly": "TestCatalogueRequests_Refusal_RecordsNothing_ThenRetrySucceeds and TestCatalogueRequests_Unreachable_RecordsNothing; Send returns the error before any RecordRequest/Save, writeRequestFailure carries the operator-facing message",
    "Second request for the same slug (any operator) -> success with the ORIGINAL date; no duplicate ledger entry": "TestCatalogueRequests_Dedupe_ReturnsOriginalDate_NoDuplicate; sendCandidate short-circuits on state.Requested(slug) to the original date without a broker call",
    "A suggestion send validates name required, why required, product optional -- and records to the suggestions list on accept": "TestCatalogueRequests_Suggestion_ValidatesAndRecords; sendSuggestion requires name + note(why), product optional, RecordSuggestion appends on accept",
    "Candidate-kind sends validate the slug against Candidates(); an installable or unknown slug is refused locally without a broker call": "TestCatalogueRequests_Candidate_RefusesInstallableOrUnknownLocally; sendCandidate checks servicerequest.Catalogue.IsCandidate/IsInstallable and returns *RefusedLocally with no broker.Calls (the port stands in for catalogue.Candidates()/Services() until T2 #1120 merges)"
  },
  "summary": "Built POST /api/v1/catalogue/requests as a thin projection over a new servicerequest.Sender that relays via the broker, records on accept only, dedupes to the original date, and fails loud with the operator reason having recorded nothing.",
  "reason": "",
  "blockers": []
}
**close-report** for #1124 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1124, "status": "success", "commits": [ "a94ddc5b" ], "changed_files": [ "STATUS.md", "internal/servicerequest/send.go", "internal/controlapi/catalogue_requests.go", "internal/controlapi/catalogue_requests_integration_test.go" ], "tests": [ { "command": "go test ./internal/servicerequest ./internal/controlapi", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 }, { "command": "go vet ./internal/servicerequest/... ./internal/controlapi/...", "exit_code": 0 } ], "criteria": { "Accept -> ledger entry exists with the broker's canonical date; the response carries it": "internal/controlapi/catalogue_requests_integration_test.go TestCatalogueRequests_Accept_RecordsAndReturnsCanonicalDate; Sender.sendCandidate records on accept via RecordRequest then returns SendResult.RequestedOn (internal/servicerequest/send.go)", "Refusal / unreachable -> ledger untouched, response carries the human reason; a retry after transient failure succeeds cleanly": "TestCatalogueRequests_Refusal_RecordsNothing_ThenRetrySucceeds and TestCatalogueRequests_Unreachable_RecordsNothing; Send returns the error before any RecordRequest/Save, writeRequestFailure carries the operator-facing message", "Second request for the same slug (any operator) -> success with the ORIGINAL date; no duplicate ledger entry": "TestCatalogueRequests_Dedupe_ReturnsOriginalDate_NoDuplicate; sendCandidate short-circuits on state.Requested(slug) to the original date without a broker call", "A suggestion send validates name required, why required, product optional -- and records to the suggestions list on accept": "TestCatalogueRequests_Suggestion_ValidatesAndRecords; sendSuggestion requires name + note(why), product optional, RecordSuggestion appends on accept", "Candidate-kind sends validate the slug against Candidates(); an installable or unknown slug is refused locally without a broker call": "TestCatalogueRequests_Candidate_RefusesInstallableOrUnknownLocally; sendCandidate checks servicerequest.Catalogue.IsCandidate/IsInstallable and returns *RefusedLocally with no broker.Calls (the port stands in for catalogue.Candidates()/Services() until T2 #1120 merges)" }, "summary": "Built POST /api/v1/catalogue/requests as a thin projection over a new servicerequest.Sender that relays via the broker, records on accept only, dedupes to the original date, and fails loud with the operator reason having recorded nothing.", "reason": "", "blockers": [] } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
Matou/idss#1124
No description provided.