Skip to main content
POST
Undo what narya learned

Authorizations

Authorization
string
header
required

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.

Path Parameters

refinementId
string<uuid>
required

The refinement's id.

Body

application/json

How far back to undo.

toEventId
string<uuid>

Undo down to and INCLUDING this event. Absent undoes the whole history, back to the creation, which leaves the row in rolled-back rather than deleting it.

Response

The refinement, as the rollback left it.

One thing the harness learned and a person allowed: a distilled memory, or a skill, agent or command definition the model authored. The owner is never something a caller names. script and events are present on getRefinement and absent from the listing. A page carrying every authored program's source is a page nobody can read; the hash is on both, which is what "what was consented to is what runs" is checked against.

id
string<uuid>
required
kind
enum<string>
required

What a refinement IS. Four values and no more — one vocabulary is what makes "everything this repository taught narya" one question.

Available options:
memory,
skill,
agent,
command
scope
enum<string>
required

How far a refinement reaches. repository is keyed on the canonical checkout path, the same key a trust answer uses; global is the owner's. There is no session here and the absence is a decision: a session-scoped fact lives exactly as long as the conversation that gave it, so it is never a stored row at all.

Available options:
repository,
global
owner
string
required

Whose learning this is.

title
string
required
Maximum string length: 200
body
string
required

The fact's text, or the definition's prompt or description.

state
enum<string>
required

Where a refinement stands. pending is proposed and nothing else — never rendered, never executed, never on a ladder. active is consented and firing. rolled-back is kept for the record. unverifiable is the one that surprises: such a fact is STILL FIRING and says so. Every session it cited has been purged, which is a person deleting a transcript rather than a person retracting a belief.

Available options:
pending,
active,
rolled-back,
unverifiable
origin
enum<string>
required

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.

Available options:
loop,
api,
import
createdAt
string<date-time>
required
hits
integer<int32>
required

How many turns this has fired into.

Required range: x >= 0
repository
string

The canonical checkout path, absent at the owner's global scope.

name
string

The ladder identity of the three definition kinds, absent on a memory.

Maximum string length: 128
script
string

The program the model wrote, IN FULL — never a digest and never a path. A person cannot consent to what they were not shown, and what they consented to is what the confined runtime later runs, byte for byte. Present on getRefinement only.

scriptSha256
string

The hash of that program, on the listing as well as the read. It is what the runtime checks the text against before running it.

Pattern: ^[0-9a-f]{64}$
originSessionId
string

The conversation this was learned from. It may name a session that has since been purged, which is what unverifiable reads from.

originEntryId
string

The turn this was learned in.

originActor
string

Who was acting when this came in over the contract.

citations
object[]

The turns this stands on, in the order they were written.

events
object[]

Everything that has happened to this refinement, newest first. Present on getRefinement only.

activatedAt
string<date-time>

When a person consented. Absent while pending.

lastUsedAt
string<date-time>

When this last fired into a prompt. It is what eviction is ordered by — a fact that fires often is a fact that earned its place — and it is deliberately never rewound by a rollback.

supersededBy
string<uuid>

The row that replaced this one, if any.