Skip to content

task: Implement Kiro spec large-payload-streaming-fast-path #532

Description

@matdev83

Implement the approved Kiro SDD for #503 introduced by merged spec-only PR #531.

Spec: .kiro/specs/large-payload-streaming-fast-path/

Outcome

Deliver the regression-safe large-request fast path defined by the spec: bounded-memory pre-commit replayable capture/spooling, streaming JSON validation/metadata proof, explicit frontend/backend wire-compatibility contracts, exact-once secure-session/canonical fallback orchestration, token-aware bounded model rewrite, replay-safe retry/failover, and measured protocol certification.

The existing canonical request path is the behavioral oracle and fallback. Preserving existing proxy functionality is more important than retaining the optimization. Any uncertain request shape, feature authority, route, backend, accounting/guardrail requirement, or semantic mismatch must fall back to canonical execution.

The authoritative implementation order is tasks.md: 16 ordered workstreams / 52 explicit subtasks.

Start gate / current ordering

Current dependency order:

#532 this implementation task
        ↓
#503 feature tracker
        ↓
#398 OSS Base split gate

Keep this transitive. Do not add #532 directly as a blocker of #398 while #503 remains the feature-level gate.

Relationship to #394 performance hardening

Relationship to newer simplification work

Non-negotiable delivery constraints

  • Feature remains disabled by default in the first release.
  • No upstream request-body byte is committed before complete validation and final eligibility/authority proof.
  • Never fabricate a partial/minimal lipapi.Call; canonical code receives only a fully decoded/validated call.
  • Never move route/failover ownership into frontends/backends or add provider-name switches in generic core.
  • Do not prune/reorder failover/race candidates just to retain the optimization.
  • Static/dynamic uncertainty is canonical fallback, not a new rejection.
  • Secure-session/A-leg preparation remains exactly-once across post-identity canonical continuation.
  • Preserve current JSON limits/trust-boundary, guardrail, billing/accounting, conversation-projection and extension-plane authority.
  • Protocol certification remains sequential according to spec: define regression-safe large-payload streaming fast path (#503) #531.
  • Keep implementation PRs focused/chronological rather than combining all subtasks into one giant change.

Completion evidence

Do not close this work order until all applicable tasks.md work is complete and evidenced, including canonical-path characterization, streaming JSON differential/fuzz/limit parity, replay/spool race and cleanup tests, exact-once session/A-leg fallback, route-wide wire compatibility, canonical-vs-wire certification, retry/failover parity, bounded observability/architecture ratchets, material multi-MiB allocation/GC improvement, forced-fallback equivalence, and full repository quality/parity/race/QA gates.

If a proposed certified lane does not demonstrate worthwhile ROI or cannot prove semantic parity, leave that lane canonical-only rather than weakening correctness.

Tracker relationship

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    allow-large-changeAllow PRs that change more than 100 filespriority:firsttaskOrdinary planned work / tast execution

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions