{
  "antiPatterns": [
    "Counting missing case outcomes as verified passes.",
    "Repeating an ambiguous external write without inspecting its operation and target digest."
  ],
  "api": {
    "contractRef": "schemas/rsi-release.v1.json",
    "entrypoint": "ancrel_rsi_kernel"
  },
  "constraints": [
    "Supply an authenticated actor, a mandatory revision for edits, and a conditional target adapter.",
    "Use local durable storage and reconcile incomplete writebacks at startup."
  ],
  "docs": "raw/backend/rsi-kernel.md",
  "examples": [
    {
      "code": "\"\"\"Run from the repository root with the Python workspace selected.\"\"\"\n\nfrom pathlib import Path\nfrom tempfile import TemporaryDirectory\n\nfrom ancrel_rsi_kernel.artifacts import LocalArtifactStore\nfrom ancrel_rsi_kernel.evaluation import TIERS, EvalGate\nfrom ancrel_rsi_kernel.models import EvaluationSuite, PerCaseOutcome\n\n\ndef main() -> None:\n    with TemporaryDirectory() as folder:\n        store = LocalArtifactStore(Path(folder))\n        baseline = store.put(b\"Write a summary.\\n\")\n        candidate = store.put(b\"Write a concise summary.\\n\", baseline.artifact_id)\n        suites = [\n            EvaluationSuite(suite_id=tier, tier=tier, case_ids=[\"sample\"]) for tier in TIERS\n        ]\n        frozen = EvalGate.freeze_inputs(suites, candidate.sha256)\n        before = EvalGate.summarize(frozen, [])\n        case = PerCaseOutcome(case_id=\"sample\", verdict=\"passed\", trust_level=\"verified\",\n                              violations=[])\n        after = EvalGate.summarize(frozen, [case])\n        print(f\"Without evidence: {before.verdict}\")\n        print(f\"With evidence: {after.verdict} ({after.unique_case_count} case across 3 tiers)\")\n        print(f\"Baseline: {store.read(baseline).decode().strip()}\")\n\n\nif __name__ == \"__main__\":\n    main()\n",
      "command": "uv run --project packages/backend/python python examples/be.rsi-kernel/demo.py",
      "entry": "examples/be.rsi-kernel/demo.py",
      "fixture": "examples/be.rsi-kernel/",
      "id": "evidence-gate"
    }
  ],
  "id": "be.rsi-kernel",
  "kind": "library",
  "language": "python",
  "layer": "backend",
  "owner": "backend-infra",
  "package": {
    "ecosystem": "pypi",
    "name": "ancrel-rsi-kernel",
    "version": "0.3.0"
  },
  "provenance": {
    "changes": "Generalized draft revisions and disk audits at lines 248–332 and 355–526. Reworked release_preview.py and writeback.py behavior around durable intent, conditional application and digest reconciliation.",
    "commit": "cf2c47642e0bffc8fc52cf955dc34150a9cfa69e",
    "mode": "extracted",
    "origin": "rule-studio",
    "path": "backend/app/preset_drafts.py",
    "rights": "org-internal; approved-by=owner; ref=item-27"
  },
  "schemaVersion": 1,
  "stability": "experimental",
  "summary": "Versioned ontology drafts, evidence gates, human approvals and recoverable conditional writeback for single-node hosts."
}
