Skip to content

fix(factory): complete fail-closed receipt shape validation - #2140

Draft
groupthinking wants to merge 3 commits into
mainfrom
fix/chatgpt-fixture-wire-shapes
Draft

groupthinking wants to merge 3 commits into
mainfrom
fix/chatgpt-fixture-wire-shapes

Conversation

@groupthinking

Copy link
Copy Markdown
Owner

Canonical issue

Fixes #2139.

Outcome

Completes the fail-closed runtime-shape boundary for the fixture-only ChatGPT MCP Skills receipt. Malformed nested wire objects now produce deterministic ChatGPT fixture handoff held: ... errors instead of raw JavaScript TypeError exceptions.

Scope

  • Adds a reusable record/object guard.
  • Validates root input, capabilities, extension metadata, result, skill, frontmatter, resource contents, approval records, and every manifest entry before property access.
  • Adds a malformed-input matrix covering null, primitive, array, and nested-object failures.
  • Proves every negative case uses the controlled hold prefix and is not a TypeError.
  • Preserves the existing receipt schema, hash behavior, fixture-only mode, and zero-authority boundary.

Evidence

  • Residual main-branch behavior reviewed after merged fix: harden ChatGPT fixture receipt parsing #1956.
  • Source merge inspected at b136aafd882440739c91ea25379e95820fc76773.
  • Branch is two commits ahead of current main and touches only the parser plus its focused test.

Verification plan

  • Focused Vitest receipt suite.
  • Frontend type-check, lint, unit tests, and production build.
  • Coverage, Security/Trivy, CodeQL, dependency review, and secret scan.
  • Report preview-dependent E2E separately from the fixture-only acceptance claim.

Boundaries

No live ChatGPT import, network MCP call, authorization grant, deployment, or production activation. Keep this PR draft until exact-head checks are inspected.

Risk and rollback

Low, fail-closed input-hardening change. Roll back by reverting the two branch commits.

@vercel

vercel Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
v0-uvai Ready Ready Preview, v0 Sep 19, 2026 7:00am UTC

@coderabbitai

coderabbitai Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added javascript Pull requests that update javascript code tests labels Sep 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@github-actions

Copy link
Copy Markdown
Contributor

✅ E2E Test Results: ALL TESTS PASSED

Metric Value
Status 🟢 GREEN
Total Tests
Passed 19
Failed
Deployment https://v0-uvai-dwnm60f2k-garv1.vercel.app
Test Output
dout�[2m | tests/e2e/pipeline.test.ts�[2m > �[22m�[2mEventRelay E2E — Live Deployment�[2m > �[22m�[2mSSE Pipeline Stream�[2m > �[22m�[2mSSE stream emits at least a pipeline_status:running event
�[22m�[39m[E2E] last pipeline_status: complete

 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mSSE Pipeline Stream�[2m > �[22mSSE stream emits at least a pipeline_status:running event�[33m 19999�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mSSE Pipeline Stream�[2m > �[22mSSE stream closes within 90 seconds (no 95% hang)�[33m 27096�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mSSE Pipeline Stream�[2m > �[22mSSE events fire in correct agent order�[33m 20321�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mCloudEvent Schema�[2m > �[22mSSE events contain valid timestamps�[33m 24082�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mCloudEvent Schema�[2m > �[22mterminal pipeline_status includes duration and stage progress�[33m 22522�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mError Handling�[2m > �[22mmissing URL returns 400, not a hang�[32m 86�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mError Handling�[2m > �[22minvalid URL returns error event or completes quickly, not a hang�[33m 12169�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mDashboard�[2m > �[22m/dashboard returns 200�[33m 507�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mDashboard�[2m > �[22m/dashboard contains agent or pipeline visualization markup�[33m 1342�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mAPI Health�[2m > �[22mGET /api returns a response (not 404)�[32m 256�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mAPI Health�[2m > �[22mPOST /api/pipeline/stream with no body returns 400�[32m 81�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mStatic Assets�[2m > �[22mhomepage has proper meta tags�[32m 85�[2mms�[22m�[39m
 �[32m✓�[39m tests/e2e/pipeline.test.ts�[2m > �[22mEventRelay E2E — Live Deployment�[2m > �[22mStatic Assets�[2m > �[22m/features page returns 200�[33m 351�[2mms�[22m�[39m

�[2m Test Files �[22m �[1m�[32m1 passed�[39m�[22m�[90m (1)�[39m
�[2m      Tests �[22m �[1m�[32m19 passed�[39m�[22m�[90m (19)�[39m
�[2m   Start at �[22m 07:00:53
�[2m   Duration �[22m 131.47s�[2m (transform 59ms, setup 0ms, import 75ms, tests 131.27s, environment 0ms)�[22m


Copy link
Copy Markdown
Owner Author

Execution receipt — exact head 16dd941f750f74c3255d1336851d802ab67ba745

Decision: TEST — keep draft and unmerged.

Observed correction

  • Added runtime record guards for every root and nested untrusted wire-object boundary.
  • Validated every manifest entry before URI, digest, or size access.
  • Added a malformed-input matrix proving controlled ChatGPT fixture handoff held: failures rather than raw TypeError.
  • Receipt schema, deterministic hashing, fixture-only behavior, and zero-authority policy remain unchanged.

Addressed failure

The initial head 437f93cc23ae81a63c06916e0ff008a89de02571 failed type-check and tests because the resource-content guard accidentally referenced its own block-scoped variable. This was corrected in 16dd941f. The failed run remains visible and is not reclassified.

Prevention: after mechanical identifier replacement, re-fetch and inspect the exact declaration and run type-check before treating the mutation as viable.

Verification

All applicable exact-head gates completed successfully:

Boundary

No merge, production deployment, live ChatGPT import, external MCP execution, or authorization grant was performed.

Next action: human review of the exact head; merge requires explicit approval for PR #2140 or this exact SHA.

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

Labels

javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(factory): complete fail-closed ChatGPT receipt shape validation

1 participant