Repository navigation
fix(compute): reject prototype keys as a doctor target - #919
Closed
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Closed
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Conversation
`provider()` guarded the reviewed broker table with `in`, which also matches Object.prototype members. A target such as "toString" or "constructor" passed the guard, so `DOCTOR_SPECS[target]` returned an inherited function instead of a Spec: `spec.cli` read as undefined and reached the executable attestation path, and `doctor()` recorded a failed connection check for a provider that does not exist. Use an own-property check, the idiom already used elsewhere in the CLI.
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
October 3, 2026 05:16
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Incorporated, reviewed, and validated in #953, now merged into main. Closing this original PR as superseded by the consolidated change. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do, and why?
The guard used
inon a plain object literal, which also findsObject.prototypemembers. Sodoctor("toString")orapproveExecutable("constructor")passed the guard,DOCTOR_SPECS[target]returned an inherited function instead of a Spec, andinvoke()/approve()then readspec.clias undefined and spawn it - whilemarkProviderCheckFailedrecorded state for a provider that does not exist.Linked issue
small fix, no issue
How did you verify it?
cd backend/cli && bun test test/tool/provider-compute.test.tsRegression proof: reverted ONLY provider-cli.ts to base and re-ran: the new test fails with the exact "does not support" message above, proving it exercises the guard rather than the operation grammar. Restored, all 5 pass.
cd backend/cli && bun test test/tool/provider-compute.test.ts test/settings/network.test.ts -> 30 pass, 0 failOnly
provider()was touched, so all four entry points - preview, execute, doctor and approveExecutable - are covered. Thecanonical as Providercast is unchanged, so type safety here remains a cast rather than a compile-time guarantee.Not verified: I could not execute the downstream attestation path for a prototype key, because it fails earlier at
TrustedExecutable.attest(undefined)- so the deepest consequence is read from the code, not observed.test/compute/has 38 pre-existing failures at the untouched base on this machine ("no sandbox backend for platform win32"), which I confirmed via a temporary baseline branch.Two pre-existing conditions in this checkout, reproduced on the untouched base commit and therefore not caused by this change: �un run typecheck (turbo) fails with sgo: command not found, and �un run format:check reports roughly 30 files. I ran sc --noEmit for �ackend/cli and prettier on the files I touched instead; neither appears in the base warning list.
Checklist
I left the first box unticked rather than claiming it: �un run check cannot pass in this checkout because turbo cannot find sgo, and that failure reproduces on the base commit.