@@ -1886,80 +1886,103 @@ Milestone output: normalized OpenAI, Anthropic, and OpenAI-compatible adapters w
18861886
18871887## Provider Interface
18881888
1889- - [ ] ` M12-001 BLOCKER ` Define provider discovery and capability methods.
1890- - [ ] ` M12-002 BLOCKER ` Define streaming response and cancellation.
1891- - [ ] ` M12-003 ` Define request messages, tool declarations, tool results, and structured-output requirements.
1892- - [ ] ` M12-004 ` Define normalized stop reasons.
1893- - [ ] ` M12-005 ` Define normalized usage accounting.
1894- - [ ] ` M12-006 ` Define provider-specific raw metadata retention after redaction.
1895- - [ ] ` M12-007 ` Define timeout, retryable, rate-limit, authentication, invalid-request, safety, and unavailable errors.
1896- - [ ] ` M12-008 ` Define model capabilities: tools, structured output, context length, image input, and reasoning controls.
1897- - [ ] ` M12-009 ` Define exact provider/model/version identity recorded per request.
1898- - [ ] ` M12-010 ` Define pricing snapshots separately from mutable current pricing.
1899- - [ ] ` M12-011 ` Define cancellation semantics and late-response handling.
1900- - [ ] ` M12-012 ` Define request idempotency where providers support it.
1889+ - [x ] ` M12-001 BLOCKER ` Define provider discovery and capability methods.
1890+ - [x ] ` M12-002 BLOCKER ` Define streaming response and cancellation.
1891+ - [x ] ` M12-003 ` Define request messages, tool declarations, tool results, and structured-output requirements.
1892+ - [x ] ` M12-004 ` Define normalized stop reasons.
1893+ - [x ] ` M12-005 ` Define normalized usage accounting.
1894+ - [x ] ` M12-006 ` Define provider-specific raw metadata retention after redaction.
1895+ - [x ] ` M12-007 ` Define timeout, retryable, rate-limit, authentication, invalid-request, safety, and unavailable errors.
1896+ - [x ] ` M12-008 ` Define model capabilities: tools, structured output, context length, image input, and reasoning controls.
1897+ - [x ] ` M12-009 ` Define exact provider/model/version identity recorded per request.
1898+ - [x ] ` M12-010 ` Define pricing snapshots separately from mutable current pricing.
1899+ - [x ] ` M12-011 ` Define cancellation semantics and late-response handling.
1900+ - [x ] ` M12-012 ` Define request idempotency where providers support it.
19011901
19021902## OpenAI Adapter
19031903
1904- - [ ] ` M12-013 ` Implement model configuration.
1905- - [ ] ` M12-014 ` Implement credential lookup.
1906- - [ ] ` M12-015 ` Implement streaming text.
1907- - [ ] ` M12-016 ` Implement tool calls and tool results.
1908- - [ ] ` M12-017 ` Implement structured output needed by the planner.
1909- - [ ] ` M12-018 ` Implement cancellation.
1910- - [ ] ` M12-019 ` Normalize usage and stop reasons.
1911- - [ ] ` M12-020 ` Capture request IDs and safe provider metadata.
1912- - [ ] ` M12-021 ` Classify errors and retry hints.
1913- - [ ] ` M12-022 TEST ` Test against a deterministic mock server.
1914- - [ ] ` M12-023 TEST ` Add an opt-in live smoke test.
1904+ - [x ] ` M12-013 ` Implement model configuration.
1905+ - [x ] ` M12-014 ` Implement credential lookup.
1906+ - [x ] ` M12-015 ` Implement streaming text.
1907+ - [x ] ` M12-016 ` Implement tool calls and tool results.
1908+ - [x ] ` M12-017 ` Implement structured output needed by the planner.
1909+ - [x ] ` M12-018 ` Implement cancellation.
1910+ - [x ] ` M12-019 ` Normalize usage and stop reasons.
1911+ - [x ] ` M12-020 ` Capture request IDs and safe provider metadata.
1912+ - [x ] ` M12-021 ` Classify errors and retry hints.
1913+ - [x ] ` M12-022 TEST ` Test against a deterministic mock server.
1914+ - [x ] ` M12-023 TEST ` Add an opt-in live smoke test.
19151915
19161916## Anthropic Adapter
19171917
1918- - [ ] ` M12-024 ` Implement model configuration.
1919- - [ ] ` M12-025 ` Implement credential lookup.
1920- - [ ] ` M12-026 ` Implement streaming text.
1921- - [ ] ` M12-027 ` Implement tool calls and tool results.
1922- - [ ] ` M12-028 ` Implement structured output needed by the planner.
1923- - [ ] ` M12-029 ` Implement cancellation.
1924- - [ ] ` M12-030 ` Normalize usage and stop reasons.
1925- - [ ] ` M12-031 ` Capture request IDs and safe provider metadata.
1926- - [ ] ` M12-032 ` Classify errors and retry hints.
1927- - [ ] ` M12-033 TEST ` Test against a deterministic mock server.
1928- - [ ] ` M12-034 TEST ` Add an opt-in live smoke test.
1918+ - [x ] ` M12-024 ` Implement model configuration.
1919+ - [x ] ` M12-025 ` Implement credential lookup.
1920+ - [x ] ` M12-026 ` Implement streaming text.
1921+ - [x ] ` M12-027 ` Implement tool calls and tool results.
1922+ - [x ] ` M12-028 ` Implement structured output needed by the planner.
1923+ - [x ] ` M12-029 ` Implement cancellation.
1924+ - [x ] ` M12-030 ` Normalize usage and stop reasons.
1925+ - [x ] ` M12-031 ` Capture request IDs and safe provider metadata.
1926+ - [x ] ` M12-032 ` Classify errors and retry hints.
1927+ - [x ] ` M12-033 TEST ` Test against a deterministic mock server.
1928+ - [x ] ` M12-034 TEST ` Add an opt-in live smoke test.
19291929
19301930## OpenAI-Compatible Local Adapter
19311931
1932- - [ ] ` M12-035 ` Implement configurable loopback or user-approved endpoint.
1933- - [ ] ` M12-036 ` Support optional credentials.
1934- - [ ] ` M12-037 ` Implement model listing where the endpoint provides it.
1935- - [ ] ` M12-038 ` Implement streaming text.
1936- - [ ] ` M12-039 ` Detect and advertise tool-call support.
1937- - [ ] ` M12-040 ` Handle endpoints without usage reporting.
1938- - [ ] ` M12-041 ` Handle nonstandard error bodies safely.
1939- - [ ] ` M12-042 ` Require approval before connecting to a non-loopback endpoint.
1940- - [ ] ` M12-043 TEST ` Test against a local deterministic fake endpoint.
1932+ - [x ] ` M12-035 ` Implement configurable loopback or user-approved endpoint.
1933+ - [x ] ` M12-036 ` Support optional credentials.
1934+ - [x ] ` M12-037 ` Implement model listing where the endpoint provides it.
1935+ - [x ] ` M12-038 ` Implement streaming text.
1936+ - [x ] ` M12-039 ` Detect and advertise tool-call support.
1937+ - [x ] ` M12-040 ` Handle endpoints without usage reporting.
1938+ - [x ] ` M12-041 ` Handle nonstandard error bodies safely.
1939+ - [x ] ` M12-042 ` Require approval before connecting to a non-loopback endpoint.
1940+ - [x ] ` M12-043 TEST ` Test against a local deterministic fake endpoint.
19411941
19421942## Retry, Fallback, and Accounting
19431943
1944- - [ ] ` M12-044 BLOCKER ` Implement bounded retry for transient transport failures.
1945- - [ ] ` M12-045 ` Respect provider retry-after guidance within the task deadline and budget.
1946- - [ ] ` M12-046 ` Do not retry invalid, authentication, or policy errors.
1947- - [ ] ` M12-047 ` Record each physical request attempt.
1948- - [ ] ` M12-048 ` Attribute retry usage and cost to the task.
1949- - [ ] ` M12-049 ` Preserve partial streamed output as non-final evidence.
1950- - [ ] ` M12-050 ` Pause after retry budget exhaustion.
1951- - [ ] ` M12-051 ` Offer retry, resume, or explicitly approved provider switch.
1952- - [ ] ` M12-052 ` Never silently switch providers or models.
1953- - [ ] ` M12-053 ` Handle missing pricing as unknown rather than zero.
1954- - [ ] ` M12-054 ` Reconcile estimated and provider-reported usage.
1955- - [ ] ` M12-055 ` Surface accounting discrepancies.
1944+ - [x] ` M12-044 BLOCKER ` Implement bounded retry for transient transport failures.
1945+ - [x] ` M12-045 ` Respect provider retry-after guidance within the task deadline and budget.
1946+ - [x] ` M12-046 ` Do not retry invalid, authentication, or policy errors.
1947+ - [x] ` M12-047 ` Record each physical request attempt.
1948+ - [x] ` M12-048 ` Attribute retry usage and cost to the task.
1949+ - [x] ` M12-049 ` Preserve partial streamed output as non-final evidence.
1950+ - [x] ` M12-050 ` Pause after retry budget exhaustion.
1951+ - [x] ` M12-051 ` Offer retry, resume, or explicitly approved provider switch.
1952+ - [x] ` M12-052 ` Never silently switch providers or models.
1953+ - [x] ` M12-053 ` Handle missing pricing as unknown rather than zero.
1954+ - [x] ` M12-054 ` Reconcile estimated and provider-reported usage.
1955+ - [x] ` M12-055 ` Surface accounting discrepancies.
1956+
1957+ M12 test evidence:
1958+
1959+ - Deterministic OpenAI Responses, Anthropic Messages, and OpenAI-compatible
1960+ mock endpoints pass the same normalized text, partial tool-arguments,
1961+ completed tool-call, usage, stop-reason, identity, and metadata conversation.
1962+ - Provider execution tests cover cancellation-authoritative UI delivery,
1963+ explicit provider cancellation, deadline classification, late buffered-event
1964+ suppression, bounded retry, retry-after limits, no retry after observable
1965+ output or tool effects, and no automatic provider or model switching.
1966+ - SQLite tests cover sealed immutable known and explicit-unknown pricing
1967+ snapshots, attributable logical and physical requests, exact rational cost,
1968+ latest-record reconciliation, provider-specific usage, discrepancy states,
1969+ partial evidence hashes, retry exhaustion pause, and bounded compensation
1970+ for pre-I/O, accounting, and terminal-write failures.
1971+ - ` codeflux-dev run-live ` is an opt-in, cost-warned path for OpenAI or
1972+ Anthropic. It reads only an ` os://service/account ` credential, requires an
1973+ external database outside physical repository aliases, emits no response
1974+ content, and is covered by a deterministic no-network end-to-end test.
1975+ - Lint, generation, migration, fast, integration, security, repeated
1976+ cancellation/accounting regressions, and the complete local ` test-all ` gate
1977+ pass. The real billable live request remains deliberately opt-in and is not
1978+ executed by CI.
19561979
19571980## Gate
19581981
1959- - [ ] ` M12-G01 GATE ` The same normalized mock conversation passes through all three adapters.
1960- - [ ] ` M12-G02 GATE ` Cancellation stops UI streaming and prevents additional tool execution.
1961- - [ ] ` M12-G03 GATE ` Every request has attributable provider, model, version, usage, price snapshot, latency, and final status.
1962- - [ ] ` M12-G04 GATE ` Provider switching never occurs without explicit user authority.
1982+ - [x ] ` M12-G01 GATE ` The same normalized mock conversation passes through all three adapters.
1983+ - [x ] ` M12-G02 GATE ` Cancellation stops UI streaming and prevents additional tool execution.
1984+ - [x ] ` M12-G03 GATE ` Every request has attributable provider, model, version, usage, price snapshot, latency, and final status.
1985+ - [x ] ` M12-G04 GATE ` Provider switching never occurs without explicit user authority.
19631986
19641987---
19651988
0 commit comments