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

# Recommended first hydration call after `/lookup`: repo + capped deps + capped dependents + artifacts in one round-trip.

> Return the repo, capped direct dependents/dependencies, and artifacts in one call.

**This is the recommended second call** for AI coding agents auditing a
repo (after ``/repositories/lookup`` resolves the ID). One request
collapses what would otherwise be three or four. The freshness fields on
``repository`` (``last_scanned_at``, ``last_activity_at``,
``last_commit_sha``, ``archived``) let the agent decide whether to trust
the data or trigger a rescan.

Direct dependents and dependencies are capped at 100 rows each; the
``dependencies_total`` and ``dependents_total`` fields carry the post-dedup
count so the agent knows when to paginate via the dedicated
``/dependencies`` and ``/dependents`` endpoints. For transitive blast
radius (multi-hop downstream), call ``/repositories/{id}/impact`` after
this — it is deliberately *not* bundled here because not every agent flow
needs it.



## OpenAPI

````yaml /openapi.json get /api/v1/repositories/{repo_id}/context
openapi: 3.1.0
info:
  description: Change Impact Engine for multi-repo systems
  title: Riftmap
  version: 1.7.5
servers: []
security: []
paths:
  /api/v1/repositories/{repo_id}/context:
    get:
      tags:
        - repositories
      summary: >-
        Recommended first hydration call after `/lookup`: repo + capped deps +
        capped dependents + artifacts in one round-trip.
      description: >-
        Return the repo, capped direct dependents/dependencies, and artifacts in
        one call.


        **This is the recommended second call** for AI coding agents auditing a

        repo (after ``/repositories/lookup`` resolves the ID). One request

        collapses what would otherwise be three or four. The freshness fields on

        ``repository`` (``last_scanned_at``, ``last_activity_at``,

        ``last_commit_sha``, ``archived``) let the agent decide whether to trust

        the data or trigger a rescan.


        Direct dependents and dependencies are capped at 100 rows each; the

        ``dependencies_total`` and ``dependents_total`` fields carry the
        post-dedup

        count so the agent knows when to paginate via the dedicated

        ``/dependencies`` and ``/dependents`` endpoints. For transitive blast

        radius (multi-hop downstream), call ``/repositories/{id}/impact`` after

        this — it is deliberately *not* bundled here because not every agent
        flow

        needs it.
      operationId: get_repository_context_api_v1_repositories__repo_id__context_get
      parameters:
        - in: path
          name: repo_id
          required: true
          schema:
            format: uuid
            title: Repo Id
            type: string
        - in: header
          name: X-Workspace-Id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Workspace-Id
        - in: cookie
          name: riftmap_access
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Riftmap Access
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RepositoryContextResponse'
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
      security:
        - APIKeyHeader: []
        - HTTPBearer: []
components:
  schemas:
    RepositoryContextResponse:
      description: >-
        Single-call context bundle for AI coding agents.


        Combines the repo row (with freshness fields), capped lists of direct

        dependents + dependencies, and the artifacts this repo produces. For
        full

        pagination of dependents/dependencies use the dedicated endpoints; for

        transitive blast radius use ``/repositories/{id}/impact``.
      properties:
        artifacts:
          items:
            $ref: '#/components/schemas/RepositoryContextArtifact'
          title: Artifacts
          type: array
        dependencies:
          items:
            $ref: '#/components/schemas/DependencyInfo'
          title: Dependencies
          type: array
        dependencies_total:
          title: Dependencies Total
          type: integer
        dependents:
          items:
            $ref: '#/components/schemas/DependencyInfo'
          title: Dependents
          type: array
        dependents_total:
          title: Dependents Total
          type: integer
        ownership:
          anyOf:
            - $ref: '#/components/schemas/OwnershipContextBlock'
            - type: 'null'
        repository:
          $ref: '#/components/schemas/RepositoryResponse'
      required:
        - repository
        - dependencies
        - dependencies_total
        - dependents
        - dependents_total
        - artifacts
      title: RepositoryContextResponse
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    RepositoryContextArtifact:
      description: Slim artifact summary embedded in the repo context bundle.
      properties:
        artifact_type:
          title: Artifact Type
          type: string
        id:
          format: uuid
          title: Id
          type: string
        name:
          title: Name
          type: string
        version:
          anyOf:
            - type: string
            - type: 'null'
          title: Version
      required:
        - id
        - artifact_type
        - name
        - version
      title: RepositoryContextArtifact
      type: object
    DependencyInfo:
      description: A single dependency declaration from a repo's latest scan.
      properties:
        confidence:
          title: Confidence
          type: number
        dependency_type:
          title: Dependency Type
          type: string
        id:
          format: uuid
          title: Id
          type: string
        raw_reference:
          title: Raw Reference
          type: string
        resolved:
          title: Resolved
          type: boolean
        source_file:
          title: Source File
          type: string
        source_line:
          title: Source Line
          type: integer
        target_artifact_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Target Artifact Id
        target_repository_id:
          anyOf:
            - format: uuid
              type: string
            - type: 'null'
          title: Target Repository Id
        target_repository_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Target Repository Name
        version_constraint:
          anyOf:
            - type: string
            - type: 'null'
          title: Version Constraint
        version_constraint_state:
          default: absent
          title: Version Constraint State
          type: string
      required:
        - id
        - dependency_type
        - raw_reference
        - version_constraint
        - source_file
        - source_line
        - resolved
        - confidence
      title: DependencyInfo
      type: object
    OwnershipContextBlock:
      description: |-
        Slim ownership summary embedded in ``/repositories/{id}/context``.

        Tiny by design (spec §8) — the context bundle is capped. Agents call
        ``/repositories/{id}/ownership`` for the full contributor list.
      properties:
        bus_factor:
          title: Bus Factor
          type: integer
        human_author_count:
          title: Human Author Count
          type: integer
        top_author_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Top Author Name
      required:
        - bus_factor
        - top_author_name
        - human_author_count
      title: OwnershipContextBlock
      type: object
    RepositoryResponse:
      description: Basic repository record.
      properties:
        archived:
          title: Archived
          type: boolean
        clone_url:
          title: Clone Url
          type: string
        connected_org_id:
          format: uuid
          title: Connected Org Id
          type: string
        created_at:
          format: date-time
          title: Created At
          type: string
        default_branch:
          title: Default Branch
          type: string
        full_path:
          title: Full Path
          type: string
        id:
          format: uuid
          title: Id
          type: string
        last_activity_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Activity At
        last_commit_sha:
          anyOf:
            - type: string
            - type: 'null'
          title: Last Commit Sha
        last_scanned_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          title: Last Scanned At
        name:
          title: Name
          type: string
        platform_id:
          title: Platform Id
          type: string
      required:
        - id
        - connected_org_id
        - platform_id
        - name
        - full_path
        - clone_url
        - default_branch
        - last_scanned_at
        - last_commit_sha
        - last_activity_at
        - archived
        - created_at
      title: RepositoryResponse
      type: object
    ValidationError:
      properties:
        ctx:
          title: Context
          type: object
        input:
          title: Input
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
  securitySchemes:
    APIKeyHeader:
      in: header
      name: X-API-Key
      type: apiKey
    HTTPBearer:
      description: API key as Bearer token (rfm_live_... prefix)
      scheme: bearer
      type: http

````