Skip to content

Learn a writing rule from authenticated human feedback

POST
/v1/reviews/{id}/learned-rules

The composing agent may learn organization house rules or project/category rules from an authenticated human turn on its own review. Every authorized human reviewer may teach organization style. This does not change sending authority. The rule, provenance, audit, retry receipt, and pending-draft propagation are durable. Reuse client_id for retries. Read fresh rules, revise the same review, and wait again.

id
required
string
object
client_id
required
string
>= 1 characters <= 128 characters
source_turn_id
required
string
rule_text
required
string
>= 1 characters <= 8000 characters
target
required
string
Allowed values: org_house project_general category
category_id

Required only for category target

string
kind
string
default: soft
Allowed values: soft hard
supersedes_id

Existing rule in the same ownership layer and scope

string

Active learned rule and its source

object
rule
required

A learned writing rule (rule_…) in the Review Loop (D2/D11). House-style/ general (scope=‘general’, applies across all categories) or category-scoped. Append-only by supersession: an edit is a new rev (same lineage_id) with the prior flipped to superseded. Read by the agent at compose/redraft time via the ordered get_rules ladder; we never apply it. Opaque ids only (D10).

object
id
required

Opaque rule id (rule_…).

string
rule_layer

Ownership layer (org/project model). org = house-style inherited by every project in the org; project = layered on top (the agent-plane default). Hard organization house rules remain mandatory across narrower scopes; the remaining rules follow the ordered precedence ladder.

string
Allowed values: org project
org_id

The org this rule belongs to.

string
project_id

The project this rule belongs to; empty for an org-layer rule.

string
lineage_id
required

Stable lineage handle across versions (rln_…).

string
rev
required
integer
scope
required

General = house-style (D2).

string
Allowed values: general category
category_id

Set iff scope=category (cat_…).

string
scope_agent_id

Set for a per-agent override; empty = all org agents.

string
rule_text
required
string
kind
required

Hard = non-overridable.

string
Allowed values: soft hard
priority
required
integer
status
required
string
Allowed values: proposed active superseded retired
supersedes_id

The prior rev this row superseded (rule_…).

string
source_review_id

Review containing the source feedback.

string
source_turn_id

Immutable source feedback turn.

string
author_kind
required
string
Allowed values: agent human connection
created_at
required
string format: date-time
updated_at
required
string format: date-time
source_review_id
required
string
source_turn_id
required
string
human_id
required
string
audit_id
required
string
propagation
required
string
Allowed values: queued

Source is not authenticated human feedback or the caller lacks scope

Review or feedback turn is outside the composing agent’s access

Retry identity changed or the superseded rule changed concurrently