{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://fusioncx.com/library/rlhf-record.schema.json",
  "title": "FusionCX RLHF record schema",
  "description": "Preference-pair structure, redaction checklist and acceptance criteria. Prepared within 2 business days of ticket closure, in your schema, submitted to your repository.",
  "version": "2026-09-03",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "record_id",
    "source_ticket_id",
    "prompt",
    "stated_objective",
    "rejected_output",
    "preferred_output",
    "rubric_score_rejected",
    "rubric_score_preferred",
    "engineer_remediation",
    "redaction",
    "consent",
    "review"
  ],
  "properties": {
    "record_id": { "type": "string" },
    "source_ticket_id": {
      "type": "string",
      "description": "Hashed or tokenised id. Do not ship raw helpdesk ids into a training store unless your DPA allows it."
    },
    "delivered_at": { "type": "string", "format": "date-time" },
    "prompt": {
      "type": "string",
      "description": "Customer's original prompt. Redacted."
    },
    "stated_objective": { "type": "string" },
    "platform_output_or_diagnosis": {
      "type": "string",
      "description": "The platform output or automated diagnosis that failed."
    },
    "rejected_output": {
      "type": "string",
      "description": "The failing output in the preference pair."
    },
    "preferred_output": {
      "type": "string",
      "description": "The engineer's corrected, working result."
    },
    "rubric_score_rejected": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "rubric_score_preferred": {
      "type": "integer",
      "minimum": 1,
      "maximum": 5
    },
    "preference": {
      "type": "string",
      "enum": ["preferred_wins", "tie", "rejected_wins"],
      "description": "tie and rejected_wins should fail acceptance unless the rubric explains them."
    },
    "engineer_diagnosis": { "type": "string" },
    "engineer_remediation": {
      "type": "array",
      "items": { "type": "string" },
      "description": "Steps taken in client tooling, attributable and reversible."
    },
    "labels": {
      "type": "object",
      "description": "Further labels you specify: intent, error class, capability, product surface.",
      "additionalProperties": true
    },
    "consent": {
      "type": "object",
      "required": ["training_use", "opt_out"],
      "properties": {
        "training_use": {
          "type": "boolean",
          "description": "True only when the customer consented under your terms."
        },
        "opt_out": { "type": "boolean" },
        "lawful_basis": { "type": "string" }
      }
    },
    "redaction": {
      "type": "object",
      "required": ["complete", "spans_removed", "checklist"],
      "properties": {
        "complete": { "type": "boolean" },
        "spans_removed": { "type": "integer", "minimum": 0 },
        "checklist": {
          "type": "object",
          "description": "Every item must be true before submission.",
          "required": [
            "personal_data",
            "credentials",
            "api_keys",
            "secrets",
            "end_user_data",
            "customer_identifiers"
          ],
          "properties": {
            "personal_data": {
              "type": "boolean",
              "description": "Names, emails, phone numbers, addresses removed or pseudonymised."
            },
            "credentials": {
              "type": "boolean",
              "description": "Passwords, session tokens, cookies removed."
            },
            "api_keys": { "type": "boolean" },
            "secrets": {
              "type": "boolean",
              "description": "Connection strings, private keys, webhook secrets removed."
            },
            "end_user_data": {
              "type": "boolean",
              "description": "Your customer's end-user data removed."
            },
            "customer_identifiers": {
              "type": "boolean",
              "description": "Project ids, domains, workspace slugs tokenised."
            }
          }
        },
        "notes": { "type": "string" }
      }
    },
    "review": {
      "type": "object",
      "required": ["second_annotator", "acceptance"],
      "properties": {
        "second_annotator": {
          "type": "string",
          "enum": ["sampled", "required", "skipped"],
          "description": "At least 20% of records receive a second annotator."
        },
        "second_reviewer_id": { "type": "string" },
        "agreement": {
          "type": "string",
          "enum": ["agreed", "disagreed", "not_reviewed"]
        },
        "acceptance": {
          "type": "string",
          "enum": ["first_pass_accepted", "accepted_after_rework", "rejected"]
        },
        "rejection_reason": { "type": "string" }
      }
    }
  },
  "x-acceptance-criteria": {
    "delivery": "Within 2 business days of ticket closure",
    "second_annotator_review": "≥20% of records",
    "first_pass_acceptance": "90% (set in SOW)",
    "inter_annotator_agreement": "0.8 κ against your labelled sample (set in SOW)",
    "rework": "Rejected records reworked at no charge within 3 business days",
    "consent": "No record without training_use true and opt_out false",
    "redaction": "checklist values all true; complete true",
    "pair_quality": "preferred_output is a working result verified in client tooling; preference is preferred_wins",
    "ownership": "Your work product on creation. Never used to train a FusionCX model or system."
  },
  "examples": [
    {
      "record_id": "RLHF-REDACTED-08841",
      "source_ticket_id": "ticket_tok_7f21",
      "delivered_at": "2026-08-16T18:02:00Z",
      "prompt": "Attach my domain and make the live site use it",
      "stated_objective": "Custom domain serving current build",
      "platform_output_or_diagnosis": "DNS instructions only; no rebind step",
      "rejected_output": "DNS instructions only; no rebind step",
      "preferred_output": "Rebind target, purge edge cache, verify 200",
      "rubric_score_rejected": 2,
      "rubric_score_preferred": 5,
      "preference": "preferred_wins",
      "engineer_diagnosis": "Edge proxy bound to stale build target",
      "engineer_remediation": [
        "Confirm edge target still pointed at previous build",
        "Rebind domain to current deployment",
        "Purge edge cache and verify HTTP 200 on the apex"
      ],
      "labels": {
        "intent": "custom_domain",
        "error_class": "stale_edge_binding",
        "capability": "domain_config"
      },
      "consent": {
        "training_use": true,
        "opt_out": false,
        "lawful_basis": "customer_terms_v12"
      },
      "redaction": {
        "complete": true,
        "spans_removed": 6,
        "checklist": {
          "personal_data": true,
          "credentials": true,
          "api_keys": true,
          "secrets": true,
          "end_user_data": true,
          "customer_identifiers": true
        },
        "notes": "Domain, email and project id removed"
      },
      "review": {
        "second_annotator": "required",
        "second_reviewer_id": "ANN-REDACTED",
        "agreement": "agreed",
        "acceptance": "first_pass_accepted"
      }
    }
  ]
}
