> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hebbianrobotics.com/llms.txt
> Use this file to discover all available pages before exploring further.

# The published vocabulary of an enriched corpus: per-section counts, the tier
tables, and every term with the clips behind it.

> One computation with two projections, which is why the counts and the term
table arrive together — a reader checking a count against the terms it was
derived from must not have to make a second request that could observe
different enrichment.

The threshold a term must clear to be published is fixed, not a parameter.
It used to be one, and a caller sweeping it could watch the counts and tier
shares move, read off how many independent passes we run from the value at
which the response empties, and — more simply — set it to 1 to publish a
richer vocabulary than the one we scored.



## OpenAPI

````yaml https://api.hebbianrobotics.com/openapi.json get /api/quality/vocabulary
openapi: 3.1.0
info:
  title: squash
  description: >-
    Semantic search and debugging over LeRobot robot-episode datasets: register
    and index datasets, search episodes by natural language with frame-level
    evidence, inspect and annotate episodes, run episode-level analytics, export
    selections as new LeRobot datasets, and follow every operation live on the
    global event stream.


    Requests may select an organization's data by sending its id in the
    `X-Squash-Organization-Id` header; without it a request is scoped to public
    data.
  license:
    name: Apache-2.0
    identifier: Apache-2.0
  version: 0.0.0
servers:
  - url: https://api.hebbianrobotics.com
    description: Hosted squash API
security:
  - {}
  - bearer_token: []
tags:
  - name: search
    description: Natural-language search over indexed episodes.
  - name: episodes
    description: >-
      Browse, inspect, and stream one episode's metadata, frames, and
      timeseries.
  - name: datasets
    description: Register datasets, follow indexing, and manage catalog entries.
  - name: analytics
    description: >-
      Corpus-level measurements: similarity, near-duplicates, coverage, and
      consistency.
  - name: quality
    description: >-
      Stored Quality Indexing reports: diversity and cleanliness scores over an
      enriched corpus.
  - name: annotations
    description: 'Human curation: episode annotations and mutually-exclusive curation flags.'
  - name: exports
    description: Export a selection of episodes as a new LeRobot dataset.
  - name: jobs
    description: 'Durable pipeline jobs: acquisition, conversion, and their records.'
  - name: backfills
    description: Queue derived-artifact backfills against an active index.
  - name: events
    description: Server-sent event streams of live activity.
  - name: access
    description: The effective capabilities of the calling principal.
paths:
  /api/quality/vocabulary:
    get:
      tags:
        - quality
      summary: >-
        The published vocabulary of an enriched corpus: per-section counts, the
        tier

        tables, and every term with the clips behind it.
      description: >-
        One computation with two projections, which is why the counts and the
        term

        table arrive together — a reader checking a count against the terms it
        was

        derived from must not have to make a second request that could observe

        different enrichment.


        The threshold a term must clear to be published is fixed, not a
        parameter.

        It used to be one, and a caller sweeping it could watch the counts and
        tier

        shares move, read off how many independent passes we run from the value
        at

        which the response empties, and — more simply — set it to 1 to publish a

        richer vocabulary than the one we scored.
      operationId: quality_vocabulary_route
      parameters:
        - name: dataset
          in: query
          description: Dataset or corpus id whose index root holds the enrichment.
          required: true
          schema:
            type: string
        - name: vocabulary
          in: query
          description: Stored vocabulary classification. Omit for the most recent.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: section
          in: query
          description: 'Only this section: `environments`, `objects` or `actions`.'
          required: false
          schema:
            type:
              - string
              - 'null'
      responses:
        '200':
          description: The published vocabulary, per section
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QualityVocabularyResponse'
        '400':
          description: Invalid dataset id or section
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '401':
          description: A valid bearer credential is required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '404':
          description: No such classification, or one of its source runs is not stored
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
        '409':
          description: The classification is stale for what its source runs now contain
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorBody'
      security:
        - bearer_token: []
components:
  schemas:
    QualityVocabularyResponse:
      type: object
      description: Response of `GET /api/quality/vocabulary`.
      required:
        - dataset
        - vocabulary
        - clips_analyzed
        - segments_unassessed
        - segments_unusable
        - sections
      properties:
        clips_analyzed:
          type: integer
          minimum: 0
        dataset:
          type: string
        sections:
          type: array
          items:
            $ref: '#/components/schemas/QualityVocabularySectionDto'
        segments_unassessed:
          type: integer
          description: Segments of footage that could not be assessed.
          minimum: 0
        segments_unusable:
          type: integer
          description: Segments whose assessment was unusable.
          minimum: 0
        vocabulary:
          type: string
          description: >-
            The classification these sections were built from — the one asked
            for,

            or the most recent when none was named.
    ApiErrorBody:
      type: object
      description: Error payload returned by every failing API route.
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: Machine-readable error code, e.g. `dataset_not_found`.
        message:
          type: string
          description: Human-readable message.
    QualityVocabularySectionDto:
      type: object
      description: One vocabulary section as `GET /api/quality/vocabulary` publishes it.
      required:
        - section
        - distinct_terms
        - effective_distinct_terms
        - comparable_depth_clips
        - distinct_kinds
        - tiers
        - untiered_terms
        - terms
      properties:
        comparable_depth_clips:
          type: integer
          description: |-
            The depth `rarefied_distinct_terms` was computed at, stamped so a
            consumer never has to assume which convention produced it.
          minimum: 0
        distinct_kinds:
          type: integer
          description: |-
            Distinct coarser kinds the published terms group under. Answers "how
            varied is this corpus" where the term count answers "what is in it".
          minimum: 0
        distinct_terms:
          type: integer
          description: >-
            Published terms that carry a tier — the count a scored report
            publishes.
          minimum: 0
        effective_distinct_terms:
          type: number
          format: double
          description: The repetition-corrected count.
        rarefied_distinct_terms:
          type:
            - number
            - 'null'
          format: double
          description: >-
            `distinct_terms` rarefied to a fixed common depth, and the only one
            of

            these counts that may be set beside another dataset's: the raw count

            rises with how much footage was read, and that curve never flattens.

            `null` when fewer clips than the common depth were analysed, because

            rarefaction interpolates and must not extrapolate.
        section:
          type: string
          description: '`environments`, `objects` or `actions`.'
        terms:
          type: array
          items:
            $ref: '#/components/schemas/QualityTermDto'
          description: Every published term, most frequent first.
        tiers:
          type: array
          items:
            $ref: '#/components/schemas/QualityVocabularyTierDto'
          description: Every tier, including the unobserved ones.
        untiered_terms:
          type: array
          items:
            type: string
          description: |-
            Published terms that could not be placed in a tier, and which are
            therefore in neither `distinct_terms` nor the shares.
    QualityTermDto:
      type: object
      description: >-
        One published term and how much of the corpus carries it.


        How many independent passes had to report a term before it was published
        is

        not here: it describes the filter, and the filter is ours.
      required:
        - term
        - occurrences
        - clip_count
        - spellings
      properties:
        clip_count:
          type: integer
          minimum: 0
        kind:
          type:
            - string
            - 'null'
          description: |-
            The broader kind this term groups under; absent when it is its own
            kind. What makes `distinct_kinds` auditable rather than asserted.
        occurrences:
          type: integer
          format: int64
          description: Distinct clips containing it.
          minimum: 0
        spellings:
          type: array
          items:
            type: string
          description: The variant spellings that were merged into this term.
        term:
          type: string
        tier:
          type:
            - string
            - 'null'
          description: >-
            The tier's wire name; absent when the term could not be placed and
            is

            therefore in neither the report's count nor its shares.
    QualityVocabularyTierDto:
      type: object
      description: >-
        One tier of one vocabulary section.


        The unscored twin of `TierShareDto`: same tiers, same shares, plus how
        many

        published terms landed in each. `TierShareDto` describes a scored
        report;

        this describes the corpus a report would be scored from.
      required:
        - tier
        - label
        - distinct_terms
        - share
        - example_terms
      properties:
        distinct_terms:
          type: integer
          description: Published terms in this tier.
          minimum: 0
        example_terms:
          type: array
          items:
            type: string
          description: The tier's most frequent members.
        label:
          type: string
          description: Display name, as the reference report writes it.
        share:
          type: number
          format: double
          description: >-
            Share of the section's occurrences, in `[0, 1]` — the same
            convention

            `TierShareDto::share` uses.
        tier:
          type: string
          description: Stable wire name of the tier or environment category.
  securitySchemes:
    bearer_token:
      type: http
      scheme: bearer
      description: >-
        Capability-bearing token issued by a squash operator. Required for
        curation, exports, dataset registration, and job control when the
        deployment runs in gated mode; public reads stay open. `GET /api/access`
        reports the capabilities a given credential actually carries.

````