{
  "date": "2026-10-27",
  "requirement": "Complete seven-language Order P2 buyer and tenant isolation, runnable examples, independent SQLite checks, documentation and receipts; preserve School, all Order receipts and pending marks; local evidence only.",
  "model": {
    "path": "model.xml",
    "revision": "1.1.0",
    "change": "Add commerce_platform.tenant_key. Existing order-to-root and item-to-order relations define the tenant ownership path. The root model and previous receipts are unchanged.",
    "localEvaluation": {
      "errors": 0,
      "warnings": 1,
      "suggestions": 2,
      "skippedRules": 0
    },
    "acceptedWarning": "The nullable order_note retains its generic string()? warning; status color/progress suggestions remain optional.",
    "initialRepair": "Removed _identifier from the business root; the local evaluator correctly reserves that attribute for constant objects.",
    "runtimePins": "The revised model explicitly pins the exact previously verified releases; generator defaults were older than the populated local caches."
  },
  "discovery": {
    "mode": "local-evaluation-generation-and-assist",
    "onlineModelTransmission": false,
    "localGeneratorTests": "4/4 with exact revised model supplied to the pagination test; default unnamed inline fixture failed the original title assertion and the failed command is retained.",
    "assist": "26 scopes per language, 182 total; generated application guides, 14 generated targets, final source copies, generator patch and hash manifests retained.",
    "generatedDomainSourceEditedManually": false,
    "generatedDomainSourceUsedForApiDiscovery": false
  },
  "result": {
    "isolationCells": "7/7",
    "sqliteDatabases": "7/7",
    "probesPerLanguage": 46,
    "databaseCheckpointsPerLanguage": 50,
    "totalDatabaseCheckpoints": 350,
    "retainedCore": "119/119 on the original model revision; source-bound receipt retained, not rerun or reclassified by this stage.",
    "school": "238/238 historical baseline and all earlier receipts remain bound and unchanged."
  },
  "fixture": "Two tenants, two buyers in each tenant, two orders per buyer, two items per order. Order numbers repeat across all four tenant/buyer scopes; BUYER-A and BUYER-B also repeat across tenants. Shared OrderStatus constants are global catalog values, not tenant-private rows.",
  "trustBoundary": "The server-owned fixture session registry binds actor, tenant and buyer independently of request JSON. The public application facade owns the native UserContext and constructs root+buyer predicates before every query. This is application authorization, not automatic SQL row-level security for arbitrary raw Q or database access. Real authentication, credential verification and HTTP/TFP wiring are separate integration work.",
  "acceptance": [
    "Exact scoped lists, direct IDs, repeated business keys, per-parent items and provider COUNT/SUM.",
    "Four actor/buyer scopes, missing/unknown sessions, forged tenant/buyer/actor/permissions/policy/context, forbidden mutation fields, unknown filters and seven invalid page bounds. Guard rejections perform no provider SELECT/DML after the facade begins.",
    "Foreign buyer/tenant order IDs, foreign-parent/item IDs and foreign writes return the same NOT_FOUND result and preserve storage.",
    "Retained-ID query namespace is fixed by trusted application code; switching a,b,c,a in one server context yields BUILD,BUILD,BUILD,HIT with the correct identities and exact totals. TypeScript uses the retained application-owned public-protocol store.",
    "Authorized note and item-label edits change exactly one permitted field, version and update timestamp; separate fresh-process reads and complete SQLite snapshots verify every unrelated row and field.",
    "All database checks use SQLite mode=ro; no oracle seeds or changes domain storage."
  ],
  "repairs": [
    {
      "layer": "generator",
      "languages": [
        "typescript"
      ],
      "detail": "Correct relation field Assist from nonexistent withCommercePlatformIs to filterByCommercePlatform."
    },
    {
      "layer": "generator",
      "languages": [
        "python",
        "typescript",
        "dotnet",
        "go"
      ],
      "detail": "Align generated graph saves with mandatory root mutation intents, explicit session/request capabilities, transaction-scoped context/callbacks and runtime APIs. Re-evaluate and regenerate; never patch emitted domain files."
    },
    {
      "layer": "generator",
      "languages": [
        "python",
        "typescript",
        "dotnet"
      ],
      "detail": "After clearing committed changes, accept the authoritative version through the dedicated committed-version operation; ordinary loaded-version validation correctly rejects replacing the old version."
    },
    {
      "layer": "application",
      "detail": "Use captured explicit page terminals for typed rows and filtered exact totals; use separate native aggregate terminals for summaries. Retained pages omit unloaded child fields so nested child queries cannot overwrite the plan observation."
    },
    {
      "layer": "application",
      "languages": [
        "python",
        "typescript",
        "dotnet",
        "go"
      ],
      "detail": "Reload complete scoped scalar Order state for note-only saves, preventing a loaded child graph from advancing item versions. This is a command boundary, not a reduced projection."
    },
    {
      "layer": "harness",
      "detail": "Permit the provider internal authoritative SELECT by the admitted owned ID only after its audited UPDATE; all pre-mutation Order SELECTs still require tenant and buyer predicates."
    },
    {
      "layer": "environment",
      "detail": "Retained offline dependency misses, stale copied Swift module-cache paths, Go cache permission failures and localized compiler errors. New caches stay in the workspace; final native builds use recorded local archives. No online package/model generation is required."
    }
  ],
  "qualification": {
    "publishedRuntimes": [
      "java",
      "swift"
    ],
    "workspacePendingRelease": [
      "go",
      "typescript",
      "rust",
      "python",
      "dotnet"
    ],
    "generator": "Existing qualifications and this stage\u2019s intent/session, committed-version and Assist repairs are workspace-tested-pending-deployment. No runtime release or generator deployment is claimed."
  },
  "mechanicalReview": "Exact model and generator output fingerprints, seven native builds, provider SQL, cache plans, guard-before-provider checks, independent SQLite results, full read/write snapshots, fresh reads and immutable receipt-chain checks.",
  "humanReviewFocus": "Production session provisioning, membership and permission policy, tenant-key uniqueness/lifecycle, chosen page/retention budgets, and trusted runtime composition.",
  "telemetry": {
    "tokenUsage": "not reported",
    "estimatedContextAvoided": "not measured",
    "queryPolicyExecutionCount": "not reported",
    "writePolicyExecutionCount": "not reported"
  },
  "nextUse": "npm run evidence:order:isolation -- --check",
  "executionLog": [
    "Saved isolation model and fixture.",
    "Local evaluation rejected constant-only _identifier; repaired model reached zero errors.",
    "Pinned recorded runtime versions, generated seven workspaces and rendered scoped Assist locally.",
    "Retained and repaired compiler, mutation-intent, committed-version, count-terminal and child-cascade failures.",
    "All seven final builds and isolation runs passed; each has 46 probes and 50 database checkpoints."
  ],
  "limits": [
    "Synthetic trusted session registry; no authentication protocol or production membership service evidence.",
    "Native SQLite only; raw library access can bypass this application facade.",
    "Shared status constants are global, and no tenant admin/create/delete workflow is exposed by the facade.",
    "No sustained stress, tenant migration, stock reservation, provider fault/cancellation or cross-provider certification."
  ]
}
