{
  "schema_version": "review-workspace-system-contract/v3",
  "status": "executable_reference_orchestrator",
  "purpose": "TinyFish acquires approved external evidence; Reality verifies provenance, case or entity attachment, bounded claim support and authorized file integrity; the product emits a source-bound reviewer packet and never makes a consequential decision.",
  "schemas": {
    "intake": "schemas/intake.schema.json",
    "acquisition": "schemas/acquisition.schema.json",
    "minimax_output": "schemas/minimax-output.schema.json",
    "reality_result": "schemas/reality-result.schema.json",
    "human_disposition": "schemas/human-disposition.schema.json"
  },
  "shared_stages": [
    "bind_authorized_case_and_policy",
    "validate_artifact_manifest_and_jurisdiction",
    "compile_or_accept_atomic_claims",
    "resolve_entity_or_vehicle_boundary",
    "route_public_authenticated_and_first_party_acquisition",
    "reality_verify_source_provenance_case_attachment_and_claim_support",
    "gate_reality_file_results_and_minimax_organization",
    "emit_human_reviewer_packet"
  ],
  "blind_regression_contract": {
    "initial_input_only": ["case controls", "reviewer role/rubric", "the exact packet a real reviewer receives", "tenant-private first-party record when applicable"],
    "pipeline_must_derive": ["atomic claims", "direct URLs", "aliases", "dynamic query plan", "source selection", "entity or vehicle attachment", "bounded findings", "report actions"],
    "pre_acquisition_filesystem_isolation": "The parse-and-plan subprocess runs with Node filesystem permissions restricted to an ephemeral directory containing only staged intake data and code; an outside-allowlist probe must fail with ERR_ACCESS_DENIED.",
    "oracle_isolation": "Golden expected facts and adjudication are loaded only by the verifier after the pipeline emits its packet.",
    "deterministic_ci": "Mutable web responses are converted to URL/time/hash/whitelisted-fact fixtures; optional live replay is a separate freshness check.",
    "heldout_cases": ["single-résumé general hiring", "complete simulated vehicle claim"]
  },
  "adapter_interface": {
    "registration_required": ["adapter_id", "modes", "source_classes"],
    "optional_executor": "acquire(request, context)",
    "receipt_required": ["adapter_id", "request_id", "status", "source_records"],
    "receipt_statuses": ["completed", "partial", "unavailable"],
    "extension_point": "createAdapterRegistry().register(definition)",
    "fail_closed": "unregistered or incompatible adapters are rejected before acquisition"
  },
  "capability_registry": {
    "tinyfish_public_search_fetch": {
      "status": "recorded",
      "auth_mode": "server-held API key",
      "allowed_source_classes": ["candidate_submitted_public", "official_public", "institutional_public", "manufacturer_public"],
      "output": "ranked search receipt plus selected Fetch result receipt"
    },
    "dynamic_query_planner": {
      "status": "implemented_with_heldout_tests",
      "input": "claims and direct anchors extracted from the submitted packet",
      "rounds": ["exact anchors and claim pairs", "cross-link/profession/official-public expansion", "material-conflict closure"],
      "stopping_criteria": ["claim coverage or explicit unresolved action", "no new non-name anchor", "rights blocked", "budget reached"],
      "fixed_search_limit": false,
      "secret_fields_forbidden": ["SSN", "government-ID number", "complete street address", "phone", "credential secret", "biometric template", "complete VIN on public routes"]
    },
    "tinyfish_authenticated_agent_browser": {
      "status": "planned",
      "auth_mode": "tenant-owned least-privilege Browser Context Profile or Vault-backed Agent session",
      "tenant_binding_required": true,
      "candidate_credentials_forbidden": true,
      "login_failure": "SOURCE_UNAVAILABLE; never broaden to name-only public search"
    },
    "github_public": {
      "status": "contract_defined_recorded_public_slice",
      "auth_mode": "none",
      "adapter_id": "github-public",
      "boundary": "candidate-submitted exact profile, repository or organization namespace; public metadata only"
    },
    "github_private_authenticated": {
      "status": "planned_not_run",
      "auth_mode": "tenant-owned read-only OAuth grant stored behind a tenant-bound Vault reference",
      "adapter_id": "github-private",
      "required_scope": "contents:read",
      "candidate_credentials_forbidden": true,
      "tenant_and_expiry_assertion_required": true
    },
    "customer_first_party": {
      "status": "planned",
      "auth_mode": "customer-owned adapter with opaque case-scoped record reference",
      "secret_fields_forbidden_in_output": ["full_vin", "owner_identifier", "credential_secret"]
    },
    "reality_evidence_verification": {
      "status": "implemented_recorded",
      "input": "TinyFish acquisition receipt, reviewed selection audit, case or entity anchors and bounded claim rows",
      "output": "verification receipt for source provenance, reviewed case or entity attachment, claim support, conflicts and unresolved limits",
      "boundary": "verifies what the acquired evidence supports and where it stops; does not guarantee source completeness, freshness, substantive truth or a consequential decision"
    },
    "minimax_source_bound_synthesis": {
      "status": "recorded_alex_and_heldout",
      "model": "MiniMax-M3",
      "input": "selected minimized evidence with known source IDs",
      "gate": "strict schema, hashed evidence projection, allowed source IDs, exact source-fact references for visible work, full project coverage, material first-party preservation, namesake isolation and forbidden-output scan",
      "invalid_state": "MODEL_SCHEMA_REJECTED"
    },
    "reality_image": {
      "status": "available_unverified_not_run",
      "input": "authorized original bytes by opaque artifact ID and sha256",
      "output": "artifact-bounded status, signals, limits and model receipt"
    },
    "reality_video": {
      "status": "planned_not_run",
      "input": "authorized original video bytes by opaque artifact ID, sha256, duration and MIME",
      "output": "artifact-bounded status, sampled coverage, signals and limits"
    },
    "reality_pdf": {
      "status": "available_unverified_not_run",
      "input": "authorized PDF bytes by opaque artifact ID, sha256 and page count",
      "output": "artifact-bounded structural/model signals, affected pages, limits and receipt"
    }
  },
  "artifact_manifest_contract": {
    "required": ["artifact_id", "kind", "mime_type", "sha256", "origin", "purpose_permission", "retention_class"],
    "allowed_kinds": ["resume", "application", "portfolio", "work_sample", "image", "video", "pdf", "estimate", "invoice", "loss_narrative"],
    "full_source_body_persistence": false,
    "secret_or_biometric_identifier_persistence": false,
    "media_type_binding": {
      "image": ["image MIME", "pixel dimensions"],
      "video": ["video MIME", "duration seconds"],
      "pdf": ["application/pdf MIME", "page count"]
    }
  },
  "tenant_and_secret_boundary": {
    "tenant_id_required_on_case_and_acquisition_request": true,
    "profile_ref_pattern": "profile://{tenant_id}/...",
    "vault_ref_pattern": "vault://{tenant_id}/...",
    "carrier_ref_pattern": "carrier://{tenant_id}/vehicle/opaque-...",
    "approved_authenticated_request_requires": ["matching owner_tenant_id", "least-privilege scope", "active status", "future expiry"],
    "public_packet_forbids": ["complete 17-character VIN", "owner identifiers", "policyholder name", "passwords", "access or refresh tokens", "credential secrets"]
  },
  "atomic_claim_contract": {
    "required": ["claim_id", "claim_type", "candidate_statement", "approved_anchors", "allowed_source_classes", "search_permission"],
    "name_alone_resolves_entity": false,
    "low_footprint_is_negative": false
  },
  "evidence_ledger_contract": {
    "required": ["source_id", "url", "source_class", "capture_time", "selection_audit_id", "selection_route", "selection_reason", "fetch_status", "text_sha256"],
    "search_rank_is_truth": false,
    "partial_failures_preserved": true
  },
  "human_disposition_contract": {
    "initial_state": "pending",
    "events": ["review", "correction", "override"],
    "allowed_statuses": ["pending", "request_more_information", "cleared_for_next_stage", "escalated", "closed_no_action"],
    "scope": "evidence_process_only",
    "immutable_boundary": "artifact manifest, evidence ledger, Reality results, recorded/planned labels and evidence provenance hash cannot be changed by disposition events"
  },
  "adapters": {
    "hiring": {
      "recorded_receipts": [
        "../demo/search-fetch-replay/general-hiring/consented-profile/alex-shen-public-context-receipt.json",
        "../demo/search-fetch-replay/general-hiring/general-hiring-receipt.json"
      ],
      "recorded_capability": "TinyFish Search/Fetch acquisition plus Reality deterministic provenance, candidate-attachment and claim-support verification, followed by MiniMax-M3 source-bound organization for a consented public self-review; separate fictional low-footprint/source-conflict fixture.",
      "heldout_regression": "An OS-backed filesystem-restricted stage sees only one simulated résumé PDF plus controls, parses six claims and seven direct anchors, and expands them into twenty-six deterministic Search-contract executions and fifteen Fetch receipts only after planning; one namesake stays isolated, live Reality PDF receipts run, and MiniMax-M3 is gated to exact cited facts.",
      "planned_capabilities": ["general OCR for arbitrary scan quality and layout", "tenant-isolated authenticated source live adapter", "first-party employer/registrar adapter"],
      "allowed_source_classes": ["candidate_submitted_public", "github_public", "github_private_authenticated", "official_public", "institutional_public", "professional_network_authenticated", "tenant_authorized_authenticated", "first_party_issuer"],
      "output": "per-subject, per-claim evidence matrix with no cross-candidate score"
    },
    "vehicle": {
      "recorded_receipt": "../demo/vehicle-claim-image-review/vehicle-context-receipt.json",
      "recorded_capability": "TinyFish Search/Fetch acquisition plus Reality deterministic provenance, claim-attachment and bounded-support verification for a partial VIN training pattern.",
      "heldout_regression": "An OS-backed filesystem-restricted stage sees only a new Kia claim packet and carrier-private record, validates the VIN check digit and public/private boundary, then records public configuration/recall acquisition, three artifact hashes, a cross-engine PDF disagreement and an explicit controlled-recapture handoff without reading the BMW receipt.",
      "planned_capabilities": ["production carrier/first-party full-VIN adapter", "reachable production Reality image/video adapter", "production MiniMax credential/runtime adapter", "cross-OEM and country coverage", "repair-value or payment integration"],
      "allowed_source_classes": ["official_public", "manufacturer_public", "carrier_first_party", "authorized_claim_artifact"],
      "output": "vehicle and claim fact matrix with full VIN and owner data kept outside the public packet"
    }
  },
  "failure_states": [
    "AUTHORIZATION_REQUIRED", "INTAKE_INCOMPLETE", "POLICY_OR_JURISDICTION_REQUIRED",
    "CLAIM_TOO_BROAD", "AMBIGUOUS_ENTITY", "NO_TEXT_BRIDGE", "SOURCE_UNAVAILABLE",
    "SOURCE_VERSION_CHANGED", "RIGHTS_BLOCKED", "INSUFFICIENT_PUBLIC_EVIDENCE",
    "CONFLICTING_EVIDENCE", "MEDIA_UNRESOLVED", "MODEL_SCHEMA_REJECTED", "SELECTION_AUDIT_REJECTED",
    "FIRST_PARTY_VERIFICATION_REQUIRED", "EVIDENCE_PACKET_READY"
  ],
  "forbidden_outputs": [
    "hire", "reject", "candidate ranking", "character score", "culture-fit score",
    "public-footprint score", "fraud finding", "liability finding", "coverage finding",
    "repair-value decision", "payment decision", "VIN reconstruction from pixels"
  ]
}
