#!/usr/bin/env python3
"""
Vault parity KAT.

**SPEC**: Proves identical output between fallback and real vault.

## Acceptance Criteria

When real vault is available:

Run A: VAULT_DISABLED=1 (fallback mode)
Run B: VAULT_DISABLED=0 (real vault)

**Expected**: Identical output
- generated_text must match exactly
- raw_symbols must match exactly
- generated_tokens count must match

**Allowed Deltas** (in receipts only):
- env_fingerprint.timestamp_utc (different run times)
- tile_stream[*].anchor.kind ("fallback" vs "vault")
- tile_stream[*].tile_sha256 (different tile sources)
- vault_anchored (true for both, but tile source differs)

**Invariants**:
- All tile_stream[*].chosen_in_allowed must be true
- scaffold_sha256 must match
- macro_mode must match
- early_stop_reason must match

## Current Status

**SKIPPED**: No real vault implementation yet (only fallback).

When vault lands, this test will:
1. Generate with VAULT_DISABLED=1 → capture baseline
2. Generate with VAULT_DISABLED=0 → compare to baseline
3. Assert text/symbols match
4. Allow only documented receipt deltas

## Implementation Notes

Real vault must:
- Accept same anchor.key format (FibPi3D)
- Return deterministic tiles (same anchor → same tile)
- Return tiles with same schema: {"bytes": ..., "sha256": ..., "anchor_key": ...}
- Set "method": "vault" instead of "deterministic_seed"

Fallback mode (current):
- Uses SHAKE-256 XOF seeded by: seed_hash + anchor_key + seed_bytes
- Returns method: "deterministic_seed"
"""
import os
import sys

os.environ["VAULT_DISABLED"] = "1"

def main():
    print("=== Vault Parity KAT ===")
    print("\nStatus: SKIPPED - no real vault implementation")
    print("\nThis test defines acceptance criteria for vault parity.")
    print("When a real vault lands, it will verify identical output.")
    print("\nSee test docstring for full specification.")
    return 0

if __name__ == "__main__":
    sys.exit(main())
