Skip to content

refactor: consume pinned shared proposal review harness - #45

Merged
BunsDev merged 2 commits into
mainfrom
feat/consume-jev-harness
Sep 23, 2026
Merged

BunsDev merged 2 commits into
mainfrom
feat/consume-jev-harness

Conversation

@BunsDev

@BunsDev BunsDev commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator

What does this change?

Replace the playground's private proposal-review implementation with thin compatibility exports from TypeSafeAI/jev-harness at merged commit a8a1a45a147c06abd197ff5d6004fb78e682e3a6. The byte-for-byte source snapshot includes its MIT license, full-revision/hash manifest and 25 synthetic fixtures. This completes the consumer step for TypeSafeAI/jev-harness#1.

The host now uses the shared hardened decision table, exact request/response model pin and cancellation guard. A late response after cancellation becomes unavailable. Question set v1 keeps the same instruction-only HTTP body; keys, labels and authored criteria remain absent. The base helper stays benchmark-only, and variance analysis uses shared decide().

No canonical fixture verdict changes. The original 20 fixtures and historical results remain unchanged; five separately reviewed cases extend the current mock suite. Provider transport, key handling, API routes, UI, fixture loader, tracing configuration and dependencies remain host-owned and unchanged. Nothing executes a proposal.

How was it checked?

Verification record: frozen install; 39 JavaScript, 566 TypeScript and 26 Python tests; typecheck and production build; signed commit; changed-file secret scan; independent spec and code-quality reviews. Cancellation regressions failed before the source sync and pass afterward, including an HTTP transport that ignores abort.

Both production traces contain all 25 unique fixture files with matching hashes. All 50 production mock API arms match expected verdicts with applied: false and no provider attempts. Desktop/mobile production audits pass, including themes and the 320px viewport. Historical variance output remains byte-identical. Current mock artifact records scripted totals; it is not a live measurement.

Full hosted Playwright remains a required merge gate. The existing localBrowser dynamic tracing warning is unchanged. Samples are synthetic; no credentials/private data or live provider calls are included in this change.

Vendor exact contract and benchmark sources from merged jev-harness a8a1a45 with MIT license and file hashes. Preserve host I/O and historical measurements while adopting hardened decisions, pinned model checks, cancellation handling, and the 25-fixture scripted suite.
Copilot AI lite review requested due to automatic review settings September 23, 2026 06:49
@vercel

vercel Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
typesafe-ai-playground Ready Ready Preview Sep 23, 2026 7:00am UTC

Request Review

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Two moderate unresolved findings remain around exact model validation and source-pin test coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Refactors proposal review to consume the pinned shared TypeSafeAI/jev-harness while preserving host-owned integrations.

Changes:

  • Vendors the shared contract, benchmark code, manifest, license, and five synthetic fixtures.
  • Replaces private harness implementations with compatibility exports.
  • Updates tests, variance analysis, documentation, and cancellation coverage.

Review findings:

  • lib/vendor/jev-harness/src/contract/decide.ts:106 — Moderate (3 votes): Mismatched Jev models can still be scored as permit; validate the exact model pin before applying unfavorable.
  • tests/harness-vendor.test.ts:34 — Moderate (2 votes): Assert the exact merged commit a8a1a45a147c06abd197ff5d6004fb78e682e3a6, rather than only a generic SHA.
File Summary
tests/​proposal-review.test.ts Updates decision, payload, and fixture expectations.
tests/​proposal-review-variance.test.ts Verifies historical variance output.
tests/​proposal-review-route.test.ts Tests payload isolation and cancellation.
tests/​proposal-review-fixtures.test.ts Covers the expanded fixture set.
tests/​proposal-review-bench.test.ts Updates benchmark totals.
tests/​harness-vendor.test.ts Verifies vendored hashes and hardening.
scripts/​proposal-review-variance.ts Uses the shared decision function.
README.md Documents the shared harness and fixtures.
lib/​vendor/​jev-harness/​src/​contract/​validate.ts Adds shared contract validation.
lib/​vendor/​jev-harness/​src/​contract/​types.ts Defines shared contract types.
lib/​vendor/​jev-harness/​src/​contract/​review.ts Implements shared review handling.
lib/​vendor/​jev-harness/​src/​contract/​payload.ts Handles shared request and response payloads.
lib/​vendor/​jev-harness/​src/​contract/​input.ts Defines shared review inputs.
lib/​vendor/​jev-harness/​src/​contract/​index.ts Exports shared contract APIs.
lib/​vendor/​jev-harness/​src/​contract/​diff.ts Provides contract comparison helpers.
lib/​vendor/​jev-harness/​src/​contract/​decide.ts Implements the shared decision table.
lib/​vendor/​jev-harness/​src/​benchmark/​run.ts Runs shared benchmarks.
lib/​vendor/​jev-harness/​src/​benchmark/​proposer.ts Provides benchmark proposer behavior.
lib/​vendor/​jev-harness/​src/​benchmark/​mock.ts Provides benchmark mocks.
lib/​vendor/​jev-harness/​src/​benchmark/​index.ts Exports benchmark APIs.
lib/​vendor/​jev-harness/​src/​benchmark/​fixtures.ts Defines benchmark fixtures.
lib/​vendor/​jev-harness/​src/​benchmark/​bench.ts Provides benchmark entry points.
lib/​vendor/​jev-harness/​manifest.json Records source revision and file hashes.
lib/​vendor/​jev-harness/​LICENSE Includes the shared MIT license.
lib/​harness/​validate.ts Preserves the validation compatibility export.
lib/​harness/​types.ts Preserves shared type compatibility exports.
lib/​harness/​run.ts Preserves run compatibility exports.
lib/​harness/​review.ts Preserves review compatibility exports.
lib/​harness/​proposer.ts Preserves proposer compatibility exports.
lib/​harness/​mock.ts Preserves mock compatibility exports.
lib/​harness/​fixtures.ts Preserves fixture compatibility exports.
lib/​harness/​decide.ts Preserves decision compatibility exports.
lib/​harness/​benchmark.ts Preserves benchmark compatibility exports.
lib/​harness/​bench.ts Preserves benchmark compatibility exports.
fixtures/​proposal-review/​missing-evidence-correct-edit-false-cause.json Adds a missing-evidence scenario.
fixtures/​proposal-review/​injection-rationale-wire-code.json Adds an injection-rationale scenario.
fixtures/​proposal-review/​clean-read-before-edit-content-not-in-evidence.json Adds a clean read-before-edit scenario.
fixtures/​proposal-review/​clean-copy-before-sort.json Adds a clean copy-before-sort scenario.
fixtures/​proposal-review/​ambiguous-conflicting-current-policy.json Adds an ambiguous-policy scenario.
docs/​verification/​shared-harness-consumer-2026-09-23.json Records verification and provenance results.
docs/​proposal-review.md Documents shared-harness behavior and limitations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tests/harness-vendor.test.ts Resolved
@BunsDev

BunsDev commented Sep 23, 2026

Copy link
Copy Markdown
Collaborator Author

Regarding the review overview's model-validation observation: the bare shared decide() accepts a shape-valid envelope with any nonempty model string. That boundary is intentional and predates this consumer change: runtime boundary assigns expected model/source binding to the host, and host conformance prohibits dispatch on mismatched evidence.

This playground route accepts only fixture ID, arm and mode; it never accepts a client-supplied review envelope. Its runner calls the shared reviewProposal() before decide(), and that boundary rejects missing/mismatched real response models into unavailable. The consumer regressions exercise those cases. A direct-helper policy change belongs in a separately reviewed upstream contract change; modifying the vendored decision table here would break byte-for-byte source provenance. The exact-manifest-pin test finding is being fixed in this PR.

This branch was successfully deployed

1 active deployment
Preview — a88b91ca Deployed Sep 23, 2026 by vercel[bot]
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.

2 participants