<?php
declare(strict_types=1);

require __DIR__ . '/StoreReadOnlyBatchBase.php';

$response = [
    'code' => 0,
    'message' => 'fixture',
    'data' => [
        '客户分类名' => ['uuid' => 'fixture'],
        'total' => 1,
    ],
];
$safe = StoreReadOnlyBatchBase::safeResponse($response);
$encoded = json_encode($safe, JSON_UNESCAPED_UNICODE);
if (!is_string($encoded) || strpos($encoded, '客户分类名') !== false
    || strpos($encoded, 'fixture') !== false
    || !isset($safe['data_key_types_sha256'], $safe['top_level_key_types_sha256'])) {
    throw new RuntimeException('Read-only evidence leaked dynamic response content');
}
if (($safe['code'] ?? null) !== 0 || ($safe['data_key_count'] ?? null) !== 2) {
    throw new RuntimeException('Read-only evidence lost contract shape');
}
echo "SAFE_RESPONSE_CONTRACT_PASS\n";
