Skip to content

Expose injectable transports and exact response receipts - #149

Merged
konard merged 2 commits into
mainfrom
issue-147-3e2d2c6145d9
Aug 3, 2026
Merged

konard merged 2 commits into
mainfrom
issue-147-3e2d2c6145d9

Conversation

@konard

@konard konard commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes #147.

  • adds a shared exact-byte response receipt contract with final URL, status, selected headers, and structured diagnostics
  • exposes caller-owned JavaScript transport injection and AbortSignal cancellation while keeping the existing HTTP /search payload stable
  • exposes a Rust Transport abstraction, caller-owned ReqwestTransport, explicit drop-future cancellation semantics, and receipt-bearing search results
  • preserves deterministic build_search_url and parse_search_results behavior
  • documents the portable FormalAI integration contract for JavaScript and Rust

Root cause and reproduction

The previous Rust capture/search paths constructed their own clients, while JavaScript capture owned its fetch operation and search injection did not expose response metadata or a cancellation contract. Both paths decoded response text before downstream callers could retain an exact receipt.

The new regression tests inject a binary response containing 00 ff 41, a redirected final URL, status, and selected headers. They verify exact byte preservation, transport injection, JavaScript signal forwarding and abort diagnostics, and Rust cancellation by dropping a pending capture future.

Validation

  • npm run check
  • npm test -- --runInBand tests/unit/fetch-html.test.js tests/unit/search.test.js tests/integration/formalai-contract.test.js (27 passed)
  • cargo test (253 passed)
  • cargo fmt --check
  • cargo clippy --all-targets -- -D warnings
  • node scripts/check-js-rust-parity.mjs
  • node scripts/validate-changeset.mjs
  • git diff --check

A broader local JavaScript run passed 489 tests and skipped 42. Thirteen environment-dependent browser/Docker tests could not run because the local Playwright Chromium bundle and Docker service are unavailable; the repository CI provisions its browser dependency.

Screenshots

Not applicable; this is a transport/API change with no visual UI impact.

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #147
@konard konard self-assigned this Aug 3, 2026
@konard konard changed the title [WIP] Expose injectable transport, cancellation, and exact response receipts Expose injectable transports and exact response receipts Aug 3, 2026
@konard
konard marked this pull request as ready for review August 3, 2026 09:49
@konard

konard commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

Working session summary

Implemented and finalized issue #147 in PR #149.

Key results:

  • Added injectable JavaScript and Rust transports.
  • Added exact-byte response receipts with final URL, status, selected headers, and diagnostics.
  • Added JavaScript AbortSignal support and Rust future-drop cancellation semantics.
  • Preserved existing search HTTP responses and deterministic parsing.
  • Added regression tests and FormalAI contract documentation.
  • Committed as 66d8144 and pushed to the requested branch.
  • Updated the PR description/title and marked it ready.
  • Verified current main is included and the worktree is clean.
  • All fresh JavaScript, Rust, parity, cross-platform, Docker, and live-integration CI checks passed. No failed logs required investigation.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $18.485437

📊 Context and tokens usage:

  • 310.0K / 200K (155%) input tokens, 39.0K / 128K (30%) output tokens

Total: (310.0K + 13.6M cached) input tokens, 39.0K output tokens, $18.485437 cost


This summary was automatically extracted from the AI working session output.

@konard

konard commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $18.485437

📊 Context and tokens usage:

  • 310.0K / 200K (155%) input tokens, 39.0K / 128K (30%) output tokens

Total: (310.0K + 13.6M cached) input tokens, 39.0K output tokens, $18.485437 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: medium (~15999 tokens)
  • Model: GPT 5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (4265KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit 3046b96 into main Aug 3, 2026
21 checks passed
@konard

konard commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose injectable transport, cancellation, and exact response receipts

1 participant