Files
alkhttp/tasks/adapters/review-002-fwd17-19-contract-decisions.md
T
glm-5.3-flash e2c255d40c docs(tasks): decompose review-002 into 24 tasks (23 implementation + 1 bracketed follow-up)
Decomposition of docs/reviews/002-post-remediation-review.md per its
5-unit remediation plan:

- Unit 1 (security-critical): gw15-publish-body-cap,
  prj16-schema-via-call (CF-004 filed alkcall-side), fwd13-dot-segments,
  fwd16-missing-capability, oai11-ref-memoization
- Unit 2 (timeout/terminality): ws13-idle-progress,
  fwd15-stream-timeout, cli01-retry-after-budget, con17-mcp-pagination,
  con18-wss-sweep-exit
- Unit 3 (projection/docs): projection-truthfulness, mcp-batch-cap,
  gw16-status-drift
- Unit 4 (spec-import): yaml-normalization, oai13-path-item-wildcards,
  import-loudness-cluster, js01-placeholder-check,
  fwd17-19-contract-decisions
- Unit 5 (WS polish + tests): con18b-ws-polish,
  client-policy-wire-tests, cov-deployment-knobs, cov13-dead-code,
  srv11-srv12-router-ordering
- review-002-bracketed-followup: tentatively planned post-bulk pass
  (stale-check, OQA-18 enforcement decision, CON-08/09 close() lever,
  cross-crate re-checks) — deliberately not serialized against the
  bulk

Also: review-002 numbering repair (CON-14 was double-booked; MCP
pagination now CON-14, from_wss monitor renumbered CON-18, missing
CON-14 section added).

taskgraph: 66 valid, no cycles; 24 pending (all review-002);
gen-1/gen-2 parallel waves identified; workflow-cost hotspots are
prj16 (12.8) and ws13 (11.1), both carrying the reviewed slicing
guidance in their Notes.
2026-08-30 10:50:34 +00:00

68 lines
3.2 KiB
Markdown

---
id: review-002-fwd17-19-contract-decisions
name: Forwarding contract decisions — non-JSON SSE payloads, double-routed placeholders, percent preservation (FWD-17/18/19 decide+document or fix)
status: pending
depends_on: [review-002-fwd15-stream-timeout]
scope: narrow
risk: low
impact: component
level: implementation
tags: [adapters, review-002, from-openapi]
---
## Description
Three review-002 forwarding findings that are design decisions more
than bugs — decide, document, and fix where the decision says so:
- **FWD-17**: non-JSON SSE payloads silently degrade to JSON strings
(`forward.rs:774-781`, `unwrap_or(Value::String)`) and the parser's
`event:` field is discarded (`:977-979`). A consumer cannot extract
fields from a legitimately non-JSON stream, and an upstream's
SSE `event: error` convention is indistinguishable from data.
Decide: (a) document the JSON-or-string contract as-is, or (b) carry
the raw payload + the `event:` field name in the envelope for
non-JSON payloads (e.g. `{data, event}` object wrapper).
- **FWD-18**: non-scalar path-placeholder values double-route —
rendered into the path (as JSON text) *and* appended as a query
param (`forward.rs:144-157`). Fix the routing rule: a key that
matched a placeholder never also emits as query, regardless of value
shape (plus a spec-decision on whether object/array path values are
an error instead).
- **FWD-19 [info]**: preserved literal `%` in template/base text is
upstream-semantics-changing (`%2F` survives; most stacks route it
differently from `/`). Inputs are assembly-supplied (ADR-066 trust);
document the trade-off in the module doc (+ ADR-066 note) — or
reject raw `%` in *template text* while allowing it in values
(the strict shape).
## Acceptance Criteria
- [ ] A decision per finding, recorded (module doc + ADR-066 section
as appropriate); doc-only outcomes still need the doc change +
a doc-asserting test where applicable
- [ ] FWD-17: whichever shape is chosen, non-JSON payload behavior is
pinned by a test (string case, number-vs-string distinction,
event-field presence if option (b))
- [ ] FWD-18: placeholder keys never double-emit (query test with an
object value under a placeholder key) — and the object-in-path
outcome (error vs JSON-segment) decided and tested
- [ ] FWD-19: documented (and if the reject-raw-% shape is chosen, its
import- or call-time error tested)
- [ ] `cargo test`, `cargo clippy --all-targets -- -D warnings`,
`cargo fmt --check` pass
## References
- docs/reviews/002-post-remediation-review.md (Part D', FWD-17/18/19)
- src/adapters/forward.rs:774-781, :977-979, :144-157, :353-370, :481-505
- docs/architecture/decisions/066-from-jsonschema-as-http-adapter.md
- tasks/adapters/review-002-fwd13-dot-segments.md (adjacent template-renderer work — sequence or coordinate to avoid churn in the same helpers)
## Notes
Deliberately a decide-first task: none of the three is a crash or
leak; each is a contract the code half-implies. Keep the decisions
small and documented rather than building speculative machinery (e.g.
no new envelope schema unless (b) is actually chosen). Coordinate with
review-002-fwd13-dot-segments (same helpers, different concerns).