{
  "schema": "NET003_VISIBLE_RULES_v1",
  "authority": "MAKNOW exercise design; platform facts remain sourced separately",
  "aggregate_rule": "READY_FOR_REVIEW only when no blocking issue exists; otherwise HOLD. Both results are SYNTHETIC_ONLY and never permission to deploy.",
  "rules": [
    [
      "INPUT_INVALID",
      "UNKNOWN",
      "Malformed decisive structure or an altered fixed exercise contract cannot establish readiness."
    ],
    [
      "IDENTITY_GAP",
      "UNVERIFIED",
      "Nonblank string DbContext, entity, fixture database, revision and audit identities are required."
    ],
    [
      "PROVIDER_UNSUPPORTED",
      "UNSUPPORTED",
      "This exercise defines only SQLITE and SQLSERVER provider evidence. Unknown providers require a new reviewed exercise contract."
    ],
    [
      "MODEL_PENDING",
      "REVIEW_REQUIRED",
      "pending_model_change_state must be NONE; the target model must match its snapshot and the fixed reviewed target shape."
    ],
    [
      "HISTORY_GAP",
      "UNVERIFIED",
      "The before-apply history must contain exactly 001_Initial, followed by the declared migration 002_BuyerStatusVersion in the tested after-history."
    ],
    [
      "DATA_LOSS_RISK",
      "FAILED",
      "Dropping CustomerName instead of preserving it by rename, or an asserted data-loss warning, blocks this change. Diagnostic detection of a dropped source column survives unrelated malformed input."
    ],
    [
      "MIGRATION_PLAN_GAP",
      "UNVERIFIED",
      "Exactly the three reviewed operations, including precise rename and typed backfill values, must be present once. Seed orders are all unfulfilled; Pending is an exercise-specific backfill."
    ],
    [
      "QUERY_CONTRACT_MISMATCH",
      "FAILED",
      "ReadOrders is a no-tracking entity read with the four named fields, zero tracked entities and the two fixed expected rows; altered tracking, shape or observations need new evidence."
    ],
    [
      "TEST_EVIDENCE_GAP",
      "UNVERIFIED",
      "The fixed query, migration and conflict test IDs each occur once, have PASS and nonblank capture references; no extra rows are accepted by this bounded format. A label alone does not replace observations."
    ],
    [
      "MIGRATION_FAILED",
      "FAILED",
      "Disposable after-history, row count and names/status/token observations must match the reviewed post-migration expectations."
    ],
    [
      "TRANSACTION_GAP",
      "UNVERIFIED",
      "The disposable fixture verifies EXPLICIT_TRANSACTION, rollback after a failed step, and intact original data. This is not a universal provider transaction guarantee."
    ],
    [
      "CONCURRENCY_UNSUPPORTED",
      "UNSUPPORTED",
      "Application-managed integer tokens are supported in both exercise providers; SQLSERVER_ROWVERSION is unsupported for SQLITE."
    ],
    [
      "CONCURRENCY_EVIDENCE_GAP",
      "UNVERIFIED",
      "The fixed conflict probe must show stale token 1, stored token 2, first writer affected one row, second writer zero rows, conflict observed and the first writer value retained."
    ],
    [
      "CONCURRENCY_CONFLICT",
      "CONCURRENCY_CONFLICT",
      "A token mismatch remains an explicit conflict unless the recorded, context-bound REJECT resolution was tested and no write overwrote the accepted first result. No automatic retry is authorized."
    ],
    [
      "PROVIDER_RISK_UNVERIFIED",
      "REVIEW_REQUIRED",
      "Provider-risk, locking and migration test captures must name the current provider and context, with nonblank references and a reviewed locking note. A lock is not an online-DDL or recovery guarantee."
    ],
    [
      "DEPLOYMENT_REVIEW_GAP",
      "REVIEW_REQUIRED",
      "Require a reviewed plan, named reviewer, explicit backup/restore rehearsal, forward fix, and no shared database application. Manual reviewed execution is a plan, not deployment permission."
    ],
    [
      "LARGE_TABLE_PLAN_UNVERIFIED",
      "UNVERIFIED",
      "At or above the exercise threshold of 100000 rows, require a provider-specific batched plan, measured locking/rewriting impact and an app-compatibility rehearsal. No universal safe threshold is claimed."
    ],
    [
      "CONTEXT_STALE",
      "STALE",
      "Every test, provider-risk and conflict-resolution capture must match the candidate context."
    ],
    [
      "VERSION_REVIEW",
      "REVIEW_REQUIRED",
      "Version review must be CURRENT, non-expired on the recorded evaluation date and bound to EF Core 10 / .NET 10."
    ]
  ],
  "fixed_contract": {
    "target_framework": "net10.0",
    "ef_core_major": 10,
    "entity_id": "Order",
    "query_id": "ReadOrders",
    "migration_id": "002_BuyerStatusVersion",
    "required_test_ids": [
      "query_read",
      "migration_apply",
      "conflict_reject"
    ],
    "target_model": {
      "Id": "INTEGER_KEY",
      "BuyerName": "REQUIRED_TEXT",
      "Status": "REQUIRED_TEXT",
      "Version": "APP_MANAGED_INTEGER_TOKEN"
    },
    "operations": [
      {
        "kind": "RENAME_COLUMN",
        "from": "CustomerName",
        "to": "BuyerName"
      },
      {
        "kind": "ADD_COLUMN",
        "name": "Status",
        "nullable": false,
        "backfill": "Pending"
      },
      {
        "kind": "ADD_COLUMN",
        "name": "Version",
        "nullable": false,
        "backfill": 1
      }
    ],
    "query_columns": [
      "Id",
      "BuyerName",
      "Status",
      "Version"
    ],
    "expected_rows": [
      {
        "Id": 1,
        "BuyerName": "Neda",
        "Status": "Pending",
        "Version": 1
      },
      {
        "Id": 2,
        "BuyerName": "Reza",
        "Status": "Pending",
        "Version": 1
      }
    ],
    "before_history": [
      "001_Initial"
    ],
    "large_table_threshold": 100000
  },
  "input_contract": "JSON objects, strict typed numbers and booleans, nonblank string evidence references. The public checker checks submission shape/bindings only; the instructor semantic check compares visible rules and requires human rationale review.",
  "date_policy": "Record evaluated_on as YYYY-MM-DD; historical exercises may pin --as-of. Changing the date must be visible."
}
