openapi: 3.1.0
info:
  title: TruthScore Narratives — read API
  version: '1'
  description: >
    A read-only view of a living model of unfolding events. Every number belongs to a named
    judgment lens and sits beside an explicit unknown residual; quote the two together. Nothing
    here is an editorial verdict, and there is no write API.
  license:
    name: See /about
    url: https://truthscore.com/about
servers:
  - url: https://truthscore.com
paths:
  /api/v1/question/{id8}:
    get:
      summary: A Question: every branch, its share, its evidence, the residual.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }
        - name: asof
          in: query
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/claim/{id8}:
    get:
      summary: A claim: standing with the full term breakdown, tree, voices, sources.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/entity/{id8}:
    get:
      summary: An entity: involvement, statements made, resolution doubt.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/event/{id8}:
    get:
      summary: An event: event-time with its basis, participants, claims.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/source/{id8}:
    get:
      summary: A document: what it claims (verbatim spans), syndication, runs.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/story/{id8}:
    get:
      summary: A Question's neighbourhood: questions, cast, clock, ranked worlds.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/world/{id8}:
    get:
      summary: An assembled possible world, including what it rules out.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }
        - name: w
          in: query
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/changes:
    get:
      summary: The what-changed log, filterable.
      parameters:
        - name: kind
          in: query
          schema: { type: string }
        - name: question
          in: query
          schema: { type: string }
        - name: page
          in: query
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/search:
    get:
      summary: Search across every kind, with each hit’s relationships.
      parameters:
        - name: q
          in: query
          schema: { type: string }
        - name: kind
          in: query
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/suggest:
    get:
      summary: Type-ahead suggestions.
      parameters:
        - name: q
          in: query
          schema: { type: string }
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
  /api/v1/peek/{id8}:
    get:
      summary: A one-line preview of any node.

      parameters:
        - name: id8
          in: path
          required: true
          schema: { type: string, pattern: '^[0-9a-f]{8}$' }
        - name: lens
          in: query
          schema: { type: string, enum: ['log-odds@1', 'structural@1'] }

      responses:
        '200':
          description: OK
          content:
            application/json:
              schema: { type: object }
        '404':
          description: No such node
