{"$id":"https://evals.blah.dev/lens/manifest.schema.json","title":"BLAH Lens Bundle v1 — lens-manifest.json","description":"Structural schema for a blah-jacobian-lens manifest. Additional cross-field invariants are enforced by the conformance validator: transports are stored as J[output_dimension, input_dimension]; logit_lens_supported requires the site width to equal the target width; grid_compatible requires every site to be token-aligned.","$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"format":{"type":"string","const":"blah-jacobian-lens"},"format_version":{"type":"number","const":1},"platform":{"type":"object","properties":{"consumer":{"type":"string","minLength":1}},"required":["consumer"]},"model":{"type":"object","properties":{"repo_id":{"description":"Hugging Face repo, e.g. your-org/model-name","type":"string","minLength":1},"revision":{"type":"string","pattern":"^[0-9a-f]{40}$"},"checkpoint":{"type":"string","minLength":1},"framework":{"description":"alpha2 | transformers | jax | mlx | candle | custom | ...","type":"string","minLength":1},"architecture":{"type":"string","minLength":1},"task":{"default":"causal-language-model","type":"string","minLength":1},"weights_fingerprint":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"config_fingerprint":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"tokenizer_fingerprint":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"chat_template_fingerprint":{"default":null,"anyOf":[{"type":"string","pattern":"^sha256:[0-9a-f]{64}$"},{"type":"null"}]}},"required":["repo_id","revision","checkpoint","framework","architecture","weights_fingerprint","config_fingerprint","tokenizer_fingerprint"]},"execution":{"type":"object","properties":{"mode":{"type":"string","enum":["huggingface","remote_http","oci","precomputed_only"]},"protocol":{"default":null,"anyOf":[{"type":"string","const":"blah-lens-http/1"},{"type":"null"}]},"entrypoint":{"default":null,"anyOf":[{"type":"string"},{"type":"null"}]},"public_runtime_url":{"default":null,"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"requires_remote_code":{"default":false,"type":"boolean"},"requires_auth":{"default":false,"type":"boolean"}},"required":["mode"]},"sequence":{"type":"object","properties":{"causal":{"type":"boolean"},"activation_layout":{"type":"string","enum":["BTD","TBD","custom"]},"position_mapping":{"type":"string","enum":["token","token_with_expansion","byte","character","patch_to_token","recurrent_step_to_token","custom"]},"grid_compatible":{"type":"boolean"},"bos_policy":{"type":"string","minLength":1},"eos_policy":{"type":"string","minLength":1}},"required":["causal","activation_layout","position_mapping","grid_compatible","bos_policy","eos_policy"]},"target_site":{"type":"object","properties":{"id":{"type":"string","minLength":1},"display_name":{"type":"string","minLength":1},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capture_semantics":{"type":"string","minLength":1}},"required":["id","display_name","width","capture_semantics"]},"sites":{"minItems":1,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"pattern":"^[A-Za-z0-9][A-Za-z0-9._-]*$"},"display_name":{"type":"string","minLength":1},"order":{"type":"integer","minimum":0,"maximum":9007199254740991},"layout":{"type":"string","enum":["BTD","TBD","custom"]},"width":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"capture_semantics":{"type":"string","minLength":1},"token_aligned":{"type":"boolean"},"position_mapping":{"type":"string","enum":["token","token_with_expansion","byte","character","patch_to_token","recurrent_step_to_token","custom"]},"logit_lens_supported":{"type":"boolean"},"transport":{"anyOf":[{"type":"object","properties":{"representation":{"type":"string","const":"dense"},"tensor_key":{"type":"string","minLength":1},"shape":{"type":"array","prefixItems":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}]},"source_mean_key":{"type":"string","minLength":1}},"required":["representation","tensor_key","shape"]},{"type":"object","properties":{"representation":{"type":"string","const":"low_rank"},"left_tensor_key":{"type":"string","minLength":1},"right_tensor_key":{"type":"string","minLength":1},"left_shape":{"type":"array","prefixItems":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}]},"right_shape":{"type":"array","prefixItems":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}]},"rank":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"approximation_method":{"type":"string","minLength":1},"source_mean_key":{"type":"string","minLength":1},"relative_matrix_error":{"type":"number","minimum":0},"heldout_top1_agreement":{"type":"number","minimum":0,"maximum":1},"heldout_top5_overlap":{"type":"number","minimum":0,"maximum":1}},"required":["representation","left_tensor_key","right_tensor_key","left_shape","right_shape","rank","approximation_method","relative_matrix_error","heldout_top1_agreement","heldout_top5_overlap"]}]},"parent_stage":{"type":"string"},"component":{"type":"string"}},"required":["id","display_name","order","layout","width","capture_semantics","token_aligned","position_mapping","logit_lens_supported","transport"]}},"lens":{"type":"object","properties":{"method":{"default":"average-input-output-jacobian","type":"string","minLength":1},"estimator":{"type":"string","minLength":1},"estimator_kind":{"default":"future_integrated","type":"string","enum":["same_position","lagged","future_integrated"]},"lag":{"type":"integer","minimum":0,"maximum":9007199254740991},"diagonal_estimator":{"type":"object","properties":{"method":{"type":"string","enum":["isolated","hutchinson"]},"probes":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"seed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["method"]},"centering":{"default":{"mode":"none"},"type":"object","properties":{"mode":{"default":"none","type":"string","enum":["none","affine"]},"target_mean_key":{"type":"string","minLength":1}}},"artifact":{"type":"string","minLength":1},"dtype":{"type":"string","minLength":1},"n_prompts":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"max_seq_len":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"skip_first_positions":{"type":"integer","minimum":0,"maximum":9007199254740991},"target_position_policy":{"type":"string","minLength":1}},"required":["estimator","artifact","dtype","n_prompts","max_seq_len","skip_first_positions","target_position_policy"]},"validation":{"type":"object","properties":{"artifact":{"type":"string","minLength":1},"status":{"type":"string","enum":["pass","fail","partial"]}},"required":["artifact","status"]}},"required":["format","format_version","model","execution","sequence","target_site","sites","lens"]}