prose-dev Atlas OpenProse docs bound to the contracts they describe
144 documents
skills/open-prose/examples/renewal-risk/README.md

renewal-risk

The relatable on-ramp: a standing customer-health truth that re-judges only the accounts whose signals moved. SaaS / finance, a single headline responsibility, selective wake. This is the non-React example the library leads with.

One-line scenario

Your portfolio of active accounts emits thousands of product-usage, support, and billing signals a day. renewal-risk keeps a current renewal-risk verdict for every account as a maintained truth, and only re-judges an account when that account's signals actually move. Quiet accounts cost nothing; a signal that nudges an account without changing its verdict never pages the team.

The DAG

Signal Inbox  (ingress, phantom)
     │  @atomic
Account Signals  (gateway · ### Continuity: external-driven · entry point)
     │  acct:<id>          one facet per account, the selective-wake boundary
     ▼
Renewal Risk  (responsibility · the standing maintained truth)
     │   ├─ risk     the live verdict (level + next action), alertable
     │   └─ history  the append-only decision log, NOT alerted on
     │  risk
     ▼
Renewal Alert Feed  (responsibility · subscribes to `risk` ONLY)

renewal-alert-feed subscribes to the risk facet only, never to history. So the team is paged when a verdict flips and stays dark when the standing truth merely re-judges an account to the same verdict (the non-material memo-hit) or appends to its decision history.

What it teaches

  • A standing, maintained truth. renewal-risk is a responsibility whose ### Maintains world-model carries every account's current verdict. It reads its prior truth by reference and carries unchanged accounts forward.
  • Selective wake. The gateway exposes one acct:<id> facet per account. A single account's material signal change perturbs only its facet, so only that account is re-judged; the sibling accounts' lanes stay dark.
  • Cost scales with surprise. A byte-identical re-delivery memo-skips the whole graph (fresh 0); a verdict-stable re-judgement re-renders the truth but leaves the risk facet put, so the alert feed never wakes. Only a real verdict flip spends fresh tokens downstream.

Conformance expectations

A conforming harness proves account-lane isolation, zero-fresh quiet replay, a verdict-stable re-judgement that leaves the alert feed dark, and an alert wake only when the risk facet changes.

Replay any run you produce

A run leaves a frozen, chain-verifiable state on disk that a harness replays keyless: one harness's replay layout; the skill's native layout is state/world-model/{node}/ with a per-node receipts.jsonl (state/filesystem.md). The marquee frame is a long flat-cost quiet stretch, one alert spike, and a verdict-stable beat that stays dark:

dispositions rendered · skipped · failed
surprise-cause  external · input · self
cost rollup (tokens) ...  chain-verify ok

Files

  • src/account-signals.prose.md: the gateway (### Continuity: external-driven).
  • src/renewal-risk.prose.md: the headline responsibility (### Requires / ### Maintains / ### Continuity, #### risk / #### history facets).
  • src/score-account-health.prose.md: a stateless function helper (### Parameters / ### Returns).
  • src/renewal-alert-feed.prose.md: the downstream responsibility subscribing to risk only.