docs: document Find Moments and moments collections (spec v0.7.23); v0.7.30 - #161
Open
kdr wants to merge 1 commit into
Open
docs: document Find Moments and moments collections (spec v0.7.23); v0.7.30#161kdr wants to merge 1 commit into
kdr wants to merge 1 commit into
Conversation
…0.7.30 #160 shipped the Find Moments API and the `moments` collection type without docs, reopening the gap #159 had just closed. The embedded docs ship inside the npm package (`files: ["dist", "docs"]`), so a consumer on 0.7.29 has the client but no reference for it. Adds docs/find-moments.md covering both entry points: - One video, one criterion via client.findMoments — create/list/get/delete plus the waitForReady poller, whose attempt cap is 60 rather than the SDK-wide 36 because discovery reads the whole video. - A whole collection via collection_type: 'moments', whose criteria run over every current AND future member. The three semantics most likely to bite are called out explicitly: - limit/min_score/sort on getFindMoments are READ-TIME shaping, not selection. Every accepted moment is persisted and total_moments always reports the full accepted count, so narrowing a read never destroys results. - criterion_score/rank_score sorting on collection moments REQUIRES a single-criterion filter (400 otherwise) — scores are only comparable within one rubric. - Detaching a criterion, or removing a file, drops moments from collection enumeration but the underlying runs persist as job history. Membership governs enumeration, not the existence of results. Also documents criterion snapshot/hashing, the attach-is-free / per-file-runs-charge billing split with its backfill counters, the delete refund rule (in-flight refunded, completed not), findings as the non-temporal counterpart, and scope: 'moment' search carrying criterion_name. Cross-linked from overview (namespace table), collections (type table), and search (scope table). Every field, method, and enum verified against the built SDK rather than prose; the boundary_policy=sentence, cache_policy=reuse and signals_required=['speech'] defaults were read out of the v0.7.23 OpenAPI spec rather than assumed. npm test 107/107, build clean, all internal doc links resolve. Patch bump to 0.7.30 so the docs actually reach consumers — they only ship via a publish.
PR SummaryLow Risk Overview New Package version is 0.7.29 → 0.7.30 so consumers get the docs on publish. Reviewed by Cursor Bugbot for commit 3694c15. Bugbot is set up for automated code reviews on this repo. Configure here. |
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.
Why
#160 shipped the Find Moments API and the
momentscollection type without docs — reopening the gap #159 had just closed. The embedded docs ship inside the npm package (files: ["dist", "docs"]), so a consumer on 0.7.29 today has the client but no reference for it.What
New
docs/find-moments.md, covering both entry points:client.findMoments: create / list / get / delete, plus thewaitForReadypoller (attempt cap 60 rather than the SDK-wide 36, because discovery reads the whole video).collection_type: 'moments', whose criteria run over every current and future member.The three semantics most likely to bite are called out explicitly, because each one is easy to get backwards:
limit/min_score/sortongetFindMomentsare read-time shaping, not selection. Every accepted moment is persisted andtotal_momentsalways reports the full accepted count — narrowing a read never destroys results.criterion_score/rank_scoresorting on collection moments requires a single-criterion filter (400 otherwise). Scores are only comparable within one rubric.Also documented: criterion snapshot +
criterion_hash, the attach-is-free / per-file-runs-charge billing split with itsbackfill_status+files_*counters, the delete refund rule (in-flight refunded, completed not), findings as the non-temporal counterpart (absence/observation), andscope: 'moment'search carryingcriterion_name.Cross-linked from overview (namespace table), collections (type table), and search (scope table).
Version bump → 0.7.30
Docs only reach consumers via a publish, so this carries a patch bump. Tag
v0.7.30after merge to cut the release.Verification
Every field, method, and enum checked against the built SDK, not prose:
Defaults were read out of the v0.7.23 OpenAPI spec rather than assumed — I'd initially hedged
boundary_policyand omitted a default entirely; the spec declaresboundary_policy: sentence,cache_policy: reuse, andsignals_required: ['speech'], and the doc now states all three.npm test107/107,npm run buildclean, and every internal doc link resolves.