Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ node dist/bin.js run --model <model-id> --prompt "Explain webhooks" --max-tokens

That command explicitly makes a potentially billable request. The library equivalent is `runStreamCheck({ apiKey, model, prompt, signal, onText })`. `npm run example:live -- <model-id>` runs the live TypeScript example. Automated verification never runs either live entry point.

From a source checkout, explicitly verify interruption handling with three bounded live requests:

```sh
npm run test:live:interruptions -- --live --env-file=.env
```

Omit `--env-file` when `OPENROUTER_API_KEY` is already in the environment. This manual command uses `openai/gpt-4.1-nano`, up to 128 output tokens and a 30-second deadline per request, with no retries. After decoded text arrives, it separately cancels, injects a transport read error, and stalls local delivery until the deadline. It checks exact text preservation and the shared CLI exit mapping, then writes evidence under ignored `.work/live-interruptions/`. It exits 0 only when every case passes; it does not run the production CLI subprocess or physical Ctrl+C. The command refuses to run when `CI` is set and is excluded from `npm run check` and the CI workflow. [Manual interruption runbook](docs/testing-runbook.md#manual-live-interruption-checks).

## Results and completion

| Outcome | Meaning | Default CLI exit |
Expand Down Expand Up @@ -156,4 +164,6 @@ The full check covers types, library/CLI tests, release checks, and a consumer o

CI runs **Windows/Ubuntu × Node 22.12.0/24**. [View actual runs](https://github.com/dannymitchelldev/streamcheck/actions/workflows/ci.yml?query=branch%3Amain); release notes link the exact validated commit. macOS, live provider behavior, and physical console Ctrl+C are not established by this matrix.

A separate [live OpenRouter smoke check](docs/verification/live-provider-2026-11-12.json) passed on 2026-11-12 with `openai/gpt-4.1-nano`, StreamCheck v0.1.1, and Windows / Node 24.18.0: HTTP 200, exact marker text, normal stop, and CLI exit 0. [Three live-stream fault checks](docs/verification/live-interruptions-2026-11-12.json) also passed on that model/platform: caller cancellation, locally injected transport failure, and a locally stalled deadline all retained their exact received text. The latter checks use the library and shared CLI exit mapper; production-bin subprocess behavior, physical console Ctrl+C, naturally occurring upstream errors, and sustained reliability remain separate verification boundaries. [Reproduction steps](docs/testing-runbook.md#manual-live-interruption-checks).

Built with Codex from a reviewed contract, with a separate AI implementation review and reproduced corrections. Human implementation review is not claimed. The [engineering record](docs/engineering-log.md) separates those stages; the [testing runbook](docs/testing-runbook.md) documents reproducible verification. [Contributions](CONTRIBUTING.md) are welcome under [MIT](LICENSE).
31 changes: 28 additions & 3 deletions docs/engineering-log.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ AI-assisted implementation from an explicitly reviewed, bounded design. Product
| Packed package / fresh consumer | Passed locally, including offline cache-only installation |
| Typed examples | Both compile; offline example executed; live example not executed |
| Windows/Ubuntu, Node 22.12.0/24 GitHub Actions | [Current workflow results](https://github.com/dannymitchelldev/streamcheck/actions/workflows/ci.yml?query=branch%3Amain); release notes identify the validated commit |
| Live OpenRouter integration | Not run; offline SDK fixtures only |
| Live OpenRouter integration | One bounded v0.1.1 CLI smoke passed on 2026-11-12: Windows / Node 24.18.0 / `openai/gpt-4.1-nano`; [receipt](verification/live-provider-2026-11-12.json) |
| Live text with injected local faults | Three manual library cases passed on 2026-11-12: caller abort, transport read failure, and stalled deadline; [receipt](verification/live-interruptions-2026-11-12.json) |
| SIGINT handling | Portable subprocess event harness passed; physical Windows console Ctrl+C unverified |

## Reviews
Expand All @@ -49,7 +50,7 @@ The two initially Minor findings were treated as contract-impacting for this dia

## Remaining verification boundaries

The original local evidence covered Windows / Node 24.18.0. The release workflow records the additional platform/runtime evidence at its actual commit. Live provider behavior, macOS, physical console Ctrl+C, and human implementation review remain unverified. The intentionally accepted SDK trailing-frame blind spot remains documented.
The original local evidence covered Windows / Node 24.18.0. The release workflow records the additional platform/runtime evidence at its actual commit. Later live checks verified one successful completion and three locally induced fault paths on the recorded model/platform. Naturally occurring upstream provider failures, macOS, physical console Ctrl+C, and human implementation review remain unverified. The intentionally accepted SDK trailing-frame blind spot remains documented.

## Publication checks

Expand All @@ -72,4 +73,28 @@ CLI test subprocesses now preload a provider-fetch guard. The patch changes no l

Independent patch review caught a gap in Headers-only validation: SOH, vertical tab, and DEL are accepted by Headers but rejected by the Node transport. Four additional library/CLI cases were observed failing before adding Node's HTTP field-value validation after header normalization. A separate control preserves the SDK's existing trailing-whitespace normalization. The reviewer also caught a missing fetch guard on the SIGINT subprocess; it now uses the same preload as the other CLI tests.

All 14 targeted regression/control checks passed after these corrections. Final local `npm run check` passed type checks, build, **108/108 tests**, and the fresh packed-consumer check on Windows / Node 24.18.0. Independent AI patch re-review confirmed both review findings resolved, with no remaining runtime findings; additional offline probes covered malformed headers, normalization, genuine connection failure, callback races, and built-CLI JSON/exit codes. Release notes identify the final exact-commit CI run and archive verification. Human implementation review, live providers, macOS, and physical console Ctrl+C remain unverified.
All 14 targeted regression/control checks passed after these corrections. Final local `npm run check` passed type checks, build, **108/108 tests**, and the fresh packed-consumer check on Windows / Node 24.18.0. Independent AI patch re-review confirmed both review findings resolved, with no remaining runtime findings; additional offline probes covered malformed headers, normalization, genuine connection failure, callback races, and built-CLI JSON/exit codes. Release notes identify the final exact-commit CI run and archive verification. Human implementation review, live providers, macOS, and physical console Ctrl+C were outside that patch validation. The live smoke below is separate evidence.

## v0.1.1 live provider smoke

On 2026-11-12, the built CLI at `d9795dfb0cdc0fda6c37f887c49bb264d6179286` made one live OpenRouter invocation using `openai/gpt-4.1-nano`, a public marker prompt, 32 maximum output tokens, and a 30,000 ms deadline. The SDK retry strategy remained `none`; no transport fixture or automatic rerun was used. The offline check passed before the invocation on the same runtime source: types, build, **108/108 tests**, and the packed consumer.

The live CLI exited 0, emitted one schema-version-1 JSON result and no stderr, observed HTTP 200, and returned exactly `STREAMCHECK_OK` with `finishReason: stop`, `partialOutput: false`, no warnings, and no error diagnostic. First text arrived at **670.113 ms**; accepted completion was at **842.169 ms**. All 15 evidence assertions passed. These are observations from one request, not a latency benchmark.

The [receipt](verification/live-provider-2026-11-12.json) records the source commit, runtime, SDK, request bounds, result, output checksum, and assertions without credentials or account metadata. The [runbook](testing-runbook.md#live-openrouter-smoke-check) describes reproduction. This verifies successful live completion for that model/platform combination; live interruption/rate-limit/cancellation handling, sustained reliability, upstream provider identity, and billed cost were not measured. SDK-observed completion retains the documented trailing-frame limitation.

## Manual interruption harness

The source-checkout command `npm run test:live:interruptions -- --live` exercises caller cancellation, transport read failure, and a stalled deadline after SDK-decoded nonempty text. It uses the existing transport seam and unchanged native response bytes; production source, public API, dependencies, and CI workflow are unchanged. The script requires explicit live opt-in, rejects CI, permits one native request per case, runs cases sequentially, and saves incremental nonsecret receipts. Per-case CLI codes come from the shared production mapper; the production CLI binary and physical console Ctrl+C are outside this harness.

Eight initial offline harness cases failed before implementation, then passed through the real built runner and pinned SDK with synthetic transport only. A Windows preload-path failure was corrected by using file URLs. Independent read-only AI review examined request gates, buffered SSE events, text preservation, pending reads, fragmented UTF-8, cleanup, and evidence scope. It found one minor classification issue: already-buffered completion could make a stall experiment report failed rather than inconclusive. A new regression was observed failing before the correction and passing afterward; the reviewer confirmed the finding resolved with no additional correctness findings. The actual completion result and failed assertions remain visible, and inconclusive evidence never passes the overall command.

The final offline check passed type checks, build, **117/117 tests**, and the packed-package consumer. The implementation was committed as `9490d5311ccf2abb442f39516ca9169109dd1ec8` before live execution. A subsequent explicit invocation made exactly three live requests on Windows / Node 24.18.0 / SDK 1.5.91 / `openai/gpt-4.1-nano`; all **33 live evidence assertions passed**, and the manual command exited 0.

| Local fault | Actual result | Retained text | Elapsed | Shared CLI mapping |
| --- | --- | --- | ---: | ---: |
| Caller abort after text | `cancelled`, reason `caller` | `Sure` | 789.170 ms | 130 |
| Transport read error after text | `interrupted`, `network` / `stream` | `I` | 690.057 ms | 3 |
| Stalled local body until deadline | `interrupted`, `timeout` / `stream` | `I` | 30,003.504 ms | 124 |

Each case observed HTTP 200, retained exactly the text delivered through callbacks, set `partialOutput: true`, and completed upstream reader cancellation. The [receipt](verification/live-interruptions-2026-11-12.json) records actual results, failed-or-passed checks, injection timing, source/runtime checksums, and request bounds. The nominal deadline can be observed slightly late because timer execution is scheduled by the event loop. These results establish live client behavior under deliberate local faults; they do not establish a natural upstream error, physical console Ctrl+C, production-bin subprocess behavior, billing cessation, or long-term reliability.
Loading
Loading