Skip to content
Closed
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ tagged release also ships native binaries for Linux, macOS, and Windows.

- Fix duration day/minute boundaries, file directory and extension labels, and payload-size rounding. Unknown payload sizes now display clearly. Background queues process undefined items, reject invalid concurrency, and release timeout timers when an operation fails.

- Reject inherited object property names as compute provider doctor targets instead of treating them as reviewed CLI brokers.

- Expand account, privacy, and usage documentation; clarify prepaid Ace access, fixed optional reloads, and current account requirements.

### Changed
Expand Down
6 changes: 5 additions & 1 deletion backend/cli/src/compute/provider-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,11 @@ export namespace ProviderCli {

function provider(target: string): Provider {
const canonical = target === "prime" ? "prime_intellect" : target
if (!(canonical in DOCTOR_SPECS)) throw new Error(`Compute provider ${target} has no reviewed native CLI broker`)
// An own-property check: `in` also matches Object.prototype keys, so
// "toString" or "constructor" would otherwise resolve to an inherited
// member instead of a Spec and reach the executable attestation path.
if (!Object.hasOwn(DOCTOR_SPECS, canonical))
throw new Error(`Compute provider ${target} has no reviewed native CLI broker`)
return canonical as Provider
}

Expand Down
11 changes: 11 additions & 0 deletions backend/cli/test/tool/provider-compute.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,17 @@ test("provider_compute owns every executable and exact official read argv", () =
expect(() => ProviderCli.preview("lambda", "resource_status", "../../account")).toThrow("requires")
})

test("provider_compute rejects inherited Object.prototype names instead of reading them as a Spec", () => {
// `in` also matches prototype keys, so these names used to pass the provider
// guard and then fail deep in the operation grammar as an unknown provider.
for (const key of ["toString", "constructor", "hasOwnProperty", "valueOf", "__proto__", "isPrototypeOf"]) {
expect(() => ProviderCli.preview(key, "list_resources")).toThrow("has no reviewed native CLI broker")
}
// The reviewed names, including the documented alias, still resolve.
expect(ProviderCli.preview("prime", "list_resources").provider).toBe("prime_intellect")
expect(ProviderCli.preview("tensorpool", "list_resources").cli).toBe("tp")
})

test("provider_compute asks on the exact read before resolving a saved credential and forwards cancellation", async () => {
const asked: Parameters<Tool.Context["ask"]>[0][] = []
const calls: unknown[][] = []
Expand Down
Loading