Skip to content

feat(files): close the endpoint coverage gap - #175

Merged
altaywtf merged 3 commits into
mainfrom
172-endpoint-completeness-evidence
Aug 11, 2026
Merged

feat(files): close the endpoint coverage gap#175
altaywtf merged 3 commits into
mainfrom
172-endpoint-completeness-evidence

Conversation

@altaywtf

@altaywtf altaywtf commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

A current private backend-to-SDK comparison found one unresolved supported public capability: the XSPF playlist route still used for first-party VLC handoff. This PR exposes it through the canonical SDK surface and records an accurate point-in-time endpoint-completeness contract without publishing the backend inventory.

Closes #172.

Changed

  • Add token-aware files.getXspfPlaylistUrl(...) to both Effect and Promise clients, plus the public URL builder and option type.
  • Validate file IDs and token overrides before URL construction while preserving invocation-time Promise token behavior.
  • Cover the operation in domain, client-adapter, export-snapshot, packed-consumer, route-matrix, and safe live tests.
  • Add docs/API-COVERAGE.md with the completeness scope, exclusions, evidence boundary, audit outcome, and refresh contract.
  • Align README, architecture, and live-testing docs with the new capability and public evidence boundary.

Review aids

flowchart LR
    A["Private backend + consumer audit"] --> B{"Supported public gap?"}
    B -->|"XSPF"| C["files.getXspfPlaylistUrl"]
    B -->|"Alias, browser, or private"| H["Explicit coverage exclusions"]
    C --> D["Canonical operation tree"]
    D --> E["Effect client"]
    D --> F["Promise client"]
    C --> G["Unit + packed + live proof"]
Loading

The public route matrix gains only the XSPF decision. The complete backend inventory and classifications remain private.

Risks

  • The direct route uses an OAuth token in the query string because that is the backend content-route contract, consistent with the existing direct URL helpers. Tests and live evidence do not log the generated URL.
  • Completeness is point-in-time and can drift when the backend changes. The new refresh contract states when to repeat the private comparison.
  • The live probe fetches an existing explicitly owned video fixture and makes no mutation.

Verification

  • node_modules/.bin/vp run verify — passed; 24 files / 143 tests, 98.09% statements, 100% functions, 26 public route decisions with zero awaiting disposition
  • node_modules/.bin/vp run lint:package — passed; Publint and ATTW ESM-only profile
  • node_modules/.bin/vp run test:compat — passed; packed strict Node consumer plus Chromium, Firefox, WebKit, and Bun
  • sops exec-env --same-process <redacted-sdk-ciphertext> 'pnpm test:live:fresh -- test/live/file-direct.test.ts' — passed; 1 file / 7 tests including the real XSPF fetch
  • autoreview review --mode branch --base origin/main --engine cursor --model cursor-grok-4.5-high-fast --output json --prompt-file - — clean; no findings

Complexity

Low to medium. The runtime addition follows the existing direct-route helper pattern; most of the change is contract proof and durable coverage documentation.


Summary by cubic

Exposes the XSPF playlist endpoint via files.getXspfPlaylistUrl(...) and a public URL builder to support VLC handoff. This closes the last supported public endpoint gap and documents current API coverage (closes #172).

  • New Features
    • Add token-aware files.getXspfPlaylistUrl(...) to Effect and Promise clients, plus buildFileXspfPlaylistUrl(...).
    • Validate file IDs and optional token overrides; preserve invocation-time Promise token behavior.
    • Update docs/api-route-matrix.json; add unit, compat (Node token replacement), and live tests for the XSPF route; align Promise adapter fixture with the XSPF URL.
    • Add docs/API-COVERAGE.md, link from README, and clarify scope/exclusions/evidence; align architecture/testing docs; use query-string oauth_token like other direct URL helpers.

Written for commit 8689c62. Summary will update on new commits.

Copilot AI lite review requested due to automatic review settings August 10, 2026 20:00

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.

Pull request overview

This PR closes the remaining supported-public endpoint gap identified in the private backend-to-SDK audit by adding first-class support for the XSPF playlist direct route (used for VLC handoff) to the canonical files domain surface, and it documents a public-safe endpoint-completeness evidence boundary/refresh contract.

Changes:

  • Add files.getXspfPlaylistUrl(...) (Effect + Promise clients), along with buildFileXspfPlaylistUrl(...) and a typed options object with token override validation.
  • Extend the canonical operation tree + export surface assertions/snapshots to include the new operation.
  • Add/extend coverage: domain/unit tests, packed consumer compat probe, route matrix, and a safe live test that fetches the XSPF playlist for an owned video; introduce docs/API-COVERAGE.md and align docs/README wording.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
test/live/domains/file-direct.ts Adds live proof that the generated XSPF URL is fetchable and returns expected content type/body.
src/index.spec.ts Extends root export surface test to include getXspfPlaylistUrl.
src/domains/files.ts Introduces XSPF URL builder + Effect operation with schema validation and token resolution.
src/domains/files.spec.ts Adds unit coverage for the builder and Effect operation output + validation failures.
src/core/client.ts Wires the new operation into the shared operation tree.
src/core/client.spec.ts Asserts the client exposes and resolves files.getXspfPlaylistUrl.
src/core/client.promise.spec.ts Mocks and verifies the Promise adapter forwards the new operation.
src/snapshots/index.spec.ts.snap Updates public surface snapshot to include the new exports.
scripts/test-compat-node.ts Adds packed Node consumer check ensuring Promise token replacement reaches the XSPF URL helper.
README.md Documents the new helper and adds a new “Endpoint Coverage” section pointing to API coverage docs.
docs/TESTING.md Updates live target matrix to include XSPF under file-direct.
docs/ARCHITECTURE.md Documents files.getXspfPlaylistUrl(...) as part of the direct-route helpers.
docs/api-route-matrix.json Adds an explicit route-matrix decision entry for /v2/files/:fileId/xspf.
docs/API-COVERAGE.md Adds public-safe endpoint completeness scope, audit outcome, evidence boundary, and refresh contract.

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

Comment thread README.md
Comment thread docs/API-COVERAGE.md
Comment thread docs/API-COVERAGE.md

@cubic-dev-ai cubic-dev-ai Bot 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.

All reported issues were addressed

You’re at about 90% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src/core/client.promise.spec.ts
@altaywtf
altaywtf merged commit 71858bf into main Aug 11, 2026
10 checks passed
@altaywtf
altaywtf deleted the 172-endpoint-completeness-evidence branch August 11, 2026 04:43
putio-releaser Bot added a commit that referenced this pull request Aug 11, 2026
## [11.2.0](v11.1.2...v11.2.0) (2026-08-11)

### Features

* **files:** close the endpoint coverage gap ([#175](#175)) ([71858bf](71858bf))
@putio-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 11.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Establish and document endpoint-completeness evidence

2 participants