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

# Read one round whole, to answer it

> Every item of one round, at the indices an answer names them by: the kind, the reach it asks for, the title, the body IN FULL, the turns it stands on, the definition it would replace, and — where narya authored a program — that program IN FULL.

NOTHING HERE IS ELIDED, and that is the operation's whole reason. An authored script must be shown to be READ rather than only named: a person cannot consent to what they were not shown, and what they consent to is what the confined runtime later runs, byte for byte. A client that drew a digest, a length or a "show more" would be offering approval over text nobody read.

An item's `kind`, `scope` and `action` are the MODEL's own words and are deliberately not the ledger's enums: the review keeps them untyped, and they become typed at the moment a person's answer turns a proposal into a row. A client displays them and never resolves them.



## OpenAPI

````yaml /en/openapi/v3-current/narya.yaml get /v1/refinements/rounds/{roundId}
openapi: 3.1.0
info:
  title: Narya Host API
  version: 1.0.0
  description: >-
    The contract between the Narya host and every client. One long-lived host
    serves this API over a Unix socket in your Narya home. The terminal client
    and the one-shot command that Lerian ships drive this API, and a client you
    write drives the same one.


    Requests authenticate with a bearer token issued by the identity provider
    the host is configured with. An operation that declares another security
    scheme also accepts that credential. A request without a valid credential
    gets 401 with NRY-0011. A caller whose role lacks the permission an
    operation needs gets 403 with NRY-0028.


    Submitting a message returns 202 with a turn id. Everything the turn
    produces streams over GET /v1/events as server-sent events with a typed
    envelope, and a stream resumes from a Last-Event-ID header.


    One error envelope: code, title and message. Codes are NRY- followed by four
    digits. Cursors are opaque.
servers: []
security:
  - bearerAuth: []
tags:
  - name: host
    description: The host process itself — version, uptime, mode, store.
  - name: sessions
    description: Durable conversation containers. Archive, never destroy.
  - name: messages
    description: Submitting work into a session and interrupting it.
  - name: events
    description: The server-sent event stream every client consumes.
  - name: lanes
    description: Parallel tracks inside a session — main, subagent, side.
  - name: agents
    description: Named recipes — instructions, tools, model, policy. Read-only in v1.
  - name: ladder
    description: >-
      What a person can type: the skills and command files in force for one
      repository, and expanding one into text. Five origins merged, nearest
      winning a name, the repository's own rungs gated on trust.
  - name: permissions
    description: Pending permission asks, decisions, and the decision audit.
  - name: intercom
    description: Sessions on one machine finding and messaging each other.
  - name: packages
    description: The one thing a user installs — resources, Go code, or both.
  - name: extensions
    description: >-
      Host-side extensions and the operations each exposes over the wire. This
      is the generic lane a host extension uses to serve its own client half (a
      TUI component, a web panel) or any API-only consumer, without adding
      routes to this contract.
  - name: workflows
    description: Deterministic multi-agent orchestration runs.
  - name: providers
    description: Model suppliers, their auth state, and the model catalogue.
  - name: monitors
    description: >-
      Long-running watchers a session keeps beside its conversation — a test
      runner in watch mode, a build, a log being followed. Started by the model
      or by the person, always listed, always killable.
  - name: records
    description: The queryable local record of everything that happened.
  - name: environments
    description: >-
      Where a session's code lives and its commands run — this machine, or a
      container narya operates. A session that names none runs here.
  - name: schedules
    description: >-
      Work the host's own clock starts with nobody present — a repository, a
      prompt, a rule and what one fire may spend. Cancel, never destroy.
  - name: sharing
    description: >-
      Publishing a session from a developer's own home to the organisation's,
      and what is held back before a byte leaves the machine.
  - name: refinements
    description: >-
      What this owner has taught narya and allowed it to keep — distilled facts,
      and the skills, agents and commands the model wrote for itself. Propose,
      read, consent, roll back. Nothing here fires until a person answers.
  - name: platform
    description: >-
      Calls Lerian's control plane made to a home it hosts, as this home
      recorded them.
paths:
  /v1/refinements/rounds/{roundId}:
    parameters:
      - $ref: '#/components/parameters/RoundIdParam'
    get:
      tags:
        - refinements
      summary: Read one round whole, to answer it
      description: >-
        Every item of one round, at the indices an answer names them by: the
        kind, the reach it asks for, the title, the body IN FULL, the turns it
        stands on, the definition it would replace, and — where narya authored a
        program — that program IN FULL.


        NOTHING HERE IS ELIDED, and that is the operation's whole reason. An
        authored script must be shown to be READ rather than only named: a
        person cannot consent to what they were not shown, and what they consent
        to is what the confined runtime later runs, byte for byte. A client that
        drew a digest, a length or a "show more" would be offering approval over
        text nobody read.


        An item's `kind`, `scope` and `action` are the MODEL's own words and are
        deliberately not the ledger's enums: the review keeps them untyped, and
        they become typed at the moment a person's answer turns a proposal into
        a row. A client displays them and never resolves them.
      operationId: getRefinementRound
      responses:
        '200':
          description: The round, with every body and every script in full.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefinementRoundDetail'
        '400':
          $ref: '#/components/responses/BadRequest'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    RoundIdParam:
      name: roundId
      in: path
      required: true
      description: >-
        The refinement round's id, as proposeRefinement returned it or as
        refinement-proposed announced it.
      schema:
        type: string
        format: uuid
  schemas:
    RefinementRoundDetail:
      type: object
      description: >-
        One round whole: what the review proposed, what the service dropped and
        why, and every item at the index an answer names it by.


        It is the only read that carries an item's body and an authored
        program's TEXT. The listing carries neither, for the reason
        listRefinements carries no script: a page nobody can read is not a page.
        Here the whole point is that everything is readable.
      required:
        - roundId
        - itemCount
        - proposed
        - items
      properties:
        roundId:
          type: string
          format: uuid
        sessionId:
          type: string
          format: uuid
          description: >-
            The ONE conversation every citation in this round points into. It is
            on the round rather than on each citation because a review may only
            cite what it read, and what it read is one conversation.


            Absent on a round whose stored conversation is not addressable — a
            round proposed with no session, or one whose id this host can no
            longer parse. A client then draws the round without the jump.
        repository:
          type: string
          description: >-
            The canonical checkout path the round is answered against, absent at
            the owner's global scope — the ledger's own `repository` column
            verbatim. It is what keeps a round a complete question after the
            session that proposed it has been purged.
        origin:
          $ref: '#/components/schemas/RefinementOrigin'
        originActor:
          type: string
          description: >-
            Who asked for this round, on the roads where somebody did. Absent on
            `loop`, where the answer is nobody: narya read a conversation and
            proposed of its own accord, which is the fact that separates that
            road from the other two.


            It is not the consenting actor. Who ALLOWED a fact is on its events,
            where an answer belongs; who asked for it is here and on the row,
            where provenance belongs, and the two are the same person only by
            coincidence.
          maxLength: 128
        itemCount:
          type: integer
          format: int32
          minimum: 1
          description: >-
            How many items this round carries — the length of `items`.


            Never zero, and the bound says so because the engine's three parking
            roads all guarantee it: the loop's review refuses to park a round
            with no surviving edits, and the other two — a proposal over this
            contract, and asking to widen one fact's reach — each park exactly
            one item. The document is written once and never edited afterwards,
            so a round that stands is a round with items. Same bound, same
            reason, as the listing's own `itemCount`, which counts the very same
            list.
        proposed:
          type: integer
          format: int32
          minimum: 0
          description: >-
            How many edits the review proposed, which is `itemCount` plus
            everything the service dropped. "6 proposed, 2 kept" is what tells
            somebody whether the loop is worth having, and it is the service's
            own count rather than a client's arithmetic.
        dropped:
          type: array
          description: >-
            What the service refused and how much of it, by reason, ordered by
            reason so two reads of one round agree. Empty when it kept
            everything the review returned.
          items:
            $ref: '#/components/schemas/RefinementRoundDropped'
        rationale:
          type: string
          description: What the gate said when it decided this round was worth running.
        items:
          type: array
          description: >-
            The items in the order the engine put them, which is the order a
            client draws them in and the order the indices count. A client that
            sorted these rows would post somebody's approval onto a different
            edit.
          items:
            $ref: '#/components/schemas/RefinementRoundItem'
      examples:
        - roundId: 2f7c1b93-4a5e-4d6f-8b0c-1e3a5c7d9f2b
          sessionId: 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d
          repository: /Users/dana/repos/midaz
          origin: loop
          itemCount: 1
          proposed: 3
          dropped:
            - reason: no-citations
              count: 2
          items:
            - index: 0
              action: create
              kind: memory
              scope: repository
              title: Migrations and the schema document are one change
              body: A new migration without its schema block fails two tests.
              citations:
                - sessionId: 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d
                  entryId: 8a1d3f5b-7c9e-4a2b-8d6f-0c2e4a6b8d0f
    RefinementOrigin:
      type: string
      enum:
        - loop
        - api
        - import
      x-enum-varnames:
        - RefinementOriginLoop
        - RefinementOriginApi
        - RefinementOriginImport
      description: >-
        Which road a refinement came in on: narya's own review of a
        conversation, a client teaching it through this contract, or an import.
        Both roads land pending and pass the same consent.
    RefinementRoundDropped:
      type: object
      description: >-
        One reason the service refused part of what the review returned, and how
        many edits it cost. Reported rather than hidden: "the gate proposed
        platitudes" has to be a visible number rather than a feeling.
      required:
        - reason
        - count
      properties:
        reason:
          type: string
        count:
          type: integer
          format: int32
          minimum: 1
      examples:
        - reason: no-citations
          count: 2
    RefinementRoundItem:
      type: object
      description: >-
        One proposed edit, at the index an answer marks it by.


        The index is WRITTEN rather than left to the array position, because the
        mark that comes back names it and a client that had to count would be a
        client doing arithmetic the host already did.


        `action`, `kind` and `scope` are the MODEL's own words and are plain
        strings on purpose: the review keeps them untyped, and they are typed at
        the moment a person's answer turns a proposal into a row. Declaring them
        as the ledger's enums would make a generated client refuse to display a
        round it is being asked to judge.
      required:
        - index
        - action
        - kind
        - scope
        - title
        - citations
      properties:
        index:
          type: integer
          format: int32
          minimum: 0
        action:
          type: string
          description: >-
            What the edit does — `create`, `update` or `delete` as the review
            wrote it, or `promote`, which a round raised by `promoteRefinement`
            carries and which points at a row the ledger already holds rather
            than describing a new one.
        kind:
          type: string
          description: >-
            What the edit is about — a memory, a skill, an agent or a command,
            as the review wrote it.
        scope:
          type: string
          description: The reach the edit asks for, as the review wrote it.
        name:
          type: string
          description: The ladder identity a definition would take. Empty on a memory.
        title:
          type: string
        body:
          type: string
          description: >-
            The fact's text, or the definition's prompt, IN FULL. Never a
            summary and never cut: this is the text a person is consenting to.
        script:
          type: string
          description: >-
            The program narya authored, IN FULL. Never a hash, never a path and
            never a head: what a person allows here is what the confined runtime
            later runs, byte for byte.
        baseline:
          type: string
          description: >-
            The definition this edit would REPLACE, as the review saw it, so the
            screen is a diff rather than a list of proposals. Empty when the
            edit creates something that does not exist yet.
        citations:
          type: array
          description: >-
            The turns this edit stands on. Never empty on a round that reached a
            person: an edit citing no turn is dropped before the round is
            parked.
          items:
            $ref: '#/components/schemas/RefinementCitation'
      examples:
        - index: 0
          action: create
          kind: skill
          scope: repository
          name: rerun-migrations
          title: Re-run the migrations against a scratch store
          body: Use it before touching the schema document.
          script: |
            const out = await sh("goose up");
            return out.stdout;
          citations:
            - sessionId: 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d
              entryId: 8a1d3f5b-7c9e-4a2b-8d6f-0c2e4a6b8d0f
    Error:
      type: object
      description: >-
        The single error envelope every operation returns. Codes are NRY-
        followed by four digits and are catalogued in the top-level
        x-error-catalog extension.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          pattern: ^NRY-[0-9]{4}$
          description: Machine-readable error code from the NRY catalogue.
        title:
          type: string
          maxLength: 256
          description: Short human-readable summary of the error class.
        message:
          type: string
          maxLength: 4096
          description: Specific, actionable description of what went wrong.
        fields:
          type: object
          description: Per-field validation problems.
          additionalProperties:
            type: string
      examples:
        - code: NRY-0002
          title: Session not found
          message: >-
            No session with id 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d exists on
            this host.
    RefinementCitation:
      type: object
      description: >-
        One pointer into the transcript that justifies a refinement. The
        admitted user entry's id IS the turn id, so citing the turns needs no
        second identifier.

        THE POINTER MAY DANGLE, and that is the design: nothing cascades from a
        purged session to a fact learned in it, because a person deleting one
        noisy conversation must not silently lose weeks of learning. A fact
        whose evidence is gone becomes `unverifiable` and keeps firing.
      required:
        - sessionId
        - entryId
      properties:
        sessionId:
          type: string
          format: uuid
        entryId:
          type: string
          format: uuid
        note:
          type: string
          description: What the review said about this turn.
          maxLength: 2000
      examples:
        - sessionId: 6b9f6d2e-1c3a-4f5b-9d7e-2a8c4e6f0b1d
          entryId: 8a1d3f5b-7c9e-4a2b-8d6f-0c2e4a6b8d0f
          note: the third attempt at the same import cycle
  responses:
    BadRequest:
      description: Malformed request — invalid parameter, cursor, or JSON body.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: The addressed resource does not exist on this host.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    InternalServerError:
      description: The host failed — including a store that refuses writes (NRY-0012).
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Enforced on every transport, with no exempt operation. A person's
        request — over the default local unix socket exactly as over a TCP
        listener — must carry a JWT issued by the configured identity provider,
        which the host verifies itself against that issuer's key set: signature,
        issuer, expiry, and the person and organisation it names. Requests
        without a valid one receive 401 NRY-0011. The socket's file permissions
        are transport and are not an authorisation.

````