Undo what narya learned
Undoes a refinement and records that it did. THIS IS ALSO THE DELETE: “archive, never destroy” holds here, so the row stops firing, keeps its provenance and its evidence, and stays in the listing — walking backwards from a strange behaviour to the fact that caused it is exactly what the row is for.
With no toEventId the whole history is inverted, back to the creation, and the row lands in rolled-back. Naming an event undoes down to and including that event, which is also how a rollback is itself undone: undo and redo are one verb aimed at different events.
It answers 200 with the row as the rollback left it rather than 204, so narya learned rollback --json has something to print.
Authorizations
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
The refinement's id.
Body
How far back to undo.
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.
What a refinement IS. Four values and no more — one vocabulary is what makes "everything this repository taught narya" one question.
memory, skill, agent, command 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.
repository, global Whose learning this is.
200The fact's text, or the definition's prompt or description.
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.
pending, active, rolled-back, unverifiable 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.
loop, api, import How many turns this has fired into.
x >= 0The canonical checkout path, absent at the owner's global scope.
The ladder identity of the three definition kinds, absent on a memory.
128The 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.
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.
^[0-9a-f]{64}$The conversation this was learned from. It may name a session that has since been purged, which is what unverifiable reads from.
The turn this was learned in.
Who was acting when this came in over the contract.
The turns this stands on, in the order they were written.
Everything that has happened to this refinement, newest first. Present on getRefinement only.
When a person consented. Absent while pending.
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.
The row that replaced this one, if any.

