#!/usr/bin/env python3 """Actual verified-GGUF provisioning; metadata admission only, synthetic CPU tensors.""" import hashlib import http.server import importlib.util import json import os from pathlib import Path import struct import subprocess import sys import tempfile import threading def main(): binary = str(Path(sys.argv[1]).resolve()) spec = importlib.util.spec_from_file_location('pack_fixture', Path(__file__).with_name('native-pack-fixture.py')) fixture = importlib.util.module_from_spec(spec); spec.loader.exec_module(fixture) expected = {'block_count': 48, 'embedding_length': 2560, 'attention.head_count': 24, 'attention.head_count_kv': 2, 'expert_count': 512, 'expert_used_count': 10} with tempfile.TemporaryDirectory(prefix='strata-runtime-profile-') as tmp: root = Path(tmp).resolve(); source = root / 'http'; source.mkdir() requests = [] class Source(http.server.SimpleHTTPRequestHandler): def __init__(self, *args, **kwargs): super().__init__(*args, directory=str(source), **kwargs) def log_message(self, *_): pass def do_GET(self): requests.append(self.path); super().do_GET() server = http.server.ThreadingHTTPServer(('127.0.0.1', 0), Source) thread = threading.Thread(target=server.serve_forever, daemon=True); thread.start() marker = root / 'started' worker = root / 'worker.sh' worker.write_text(f'#!/bin/sh\ntouch "{marker}"\nexit 1\n'); worker.chmod(0o700) manifest = root / 'manifest.json'; config_path = root / 'config.json' config = {'native_model': {'manifest': str(manifest), 'source_dir': str(root/'base'), 'output': str(root/'pack'), 'runtime_profile': 'qwen4exp-flash-next'}, 'engine': {'executable': str(worker), 'max_restarts': 0}} def publish(values, kind=4): fields = [('qwen4exp.'+key, kind, struct.pack('