Appendix C. Archive schema & file tree

Appendix C. Archive schema & file tree: The following tree is locked as the minimal immutable structure.

The following tree is locked as the minimal immutable structure. 2/pi.

C.0 Directory tree (immutable conventions)

The following tree is locked as the minimal immutable structure.

repo_root/
  registry/
    canon_lock.json
    realization_lock.json
    analysis_lock.json
    gate_lock.json
    protocol_lock.json
    registry_snapshot.json
  protocol/
    protocol.yaml
    pass.rules.yaml
  runs/
    run_<run_id>/
      inputs/
      logs/
      metrics/
      figures/
      tables/
      manifest.json
      checksums.sha256
  releases/
    v4.<major>.<minor>.<patch>/
      release_manifest.json
      checksums.sha256
      registry_snapshot.json
      artifacts/
registry/ is the SSOT, runs/ stores artifacts, and releases/ is the distribution unit.

C.1 registryₛnapshot schema (SSOT sealing)

{
  "registry_snapshot_id": "sha256:<64hex>",
  "created_utc": "YYYY-MM-DDThh:mm:ssZ",
  "code_version": "git:<commit>",
  "locks": {
    "canon_lock_id": "canon_lock:v4.x.y:sha256:<64hex>",
    "realization_lock_id": "realization_lock:v4.x.y:sha256:<64hex>",
    "analysis_lock_id": "analysis_lock:v4.x.y:sha256:<64hex>",
    "gate_lock_id": "gate_lock:v4.x.y:sha256:<64hex>",
    "protocol_lock_id": "protocol_lock:v4.x.y:sha256:<64hex>"
  },
  "files": [
    {"path": "registry/canon_lock.json", "sha256": "<64hex>"},
    {"path": "registry/realization_lock.json", "sha256": "<64hex>"},
    {"path": "registry/analysis_lock.json", "sha256": "<64hex>"},
    {"path": "registry/gate_lock.json", "sha256": "<64hex>"},
    {"path": "registry/protocol_lock.json", "sha256": "<64hex>"}
  ]
}

C.2 canonₗock schema (canonical inputs)

{
  "lock_type": "canon_lock",
  "lock_id": "canon_lock:v4.x.y:sha256:<64hex>",
  "version": "v4.x.y",
  "constants": {
    "pi": 3.141592653589793,
    "alpha_rect": "2/pi",
    "delta_rect": "1/pi^2"
  },
  "inputs": {
    "D_anch_m": "<float>",
    "r_p_m": 0.8412e-15,
    "l_rot_m": "<float|optional>",
    "geometry_meaning": "diameter|radius",
    "cell_geometry": "cube"
  },
  "hash_policy": {
    "float_format": "decimal_string",
    "unit_strings": "SI",
    "ordering": "sorted_keys"
  }
}

C.3 realizationₗock schema (unit realization)

{
  "lock_type": "realization_lock",
  "lock_id": "realization_lock:v4.x.y:sha256:<64hex>",
  "version": "v4.x.y",
  "inputs": {
    "a_m": 6.3299121257859865746e-19,
    "dt_s": 1.86e-21,
    "c_ref_m_s": 299792458
  },
  "anchors": {
    "lambda_ref_nm": [633.0, 532.0],
    "rcross_ref_id": "R-mean|R-633|R-532"
  }
}

C.4 analysisₗock schema (choice/regime/definition locking)

{
  "lock_type": "analysis_lock",
  "lock_id": "analysis_lock:v4.x.y:sha256:<64hex>",
  "version": "v4.x.y",
  "definitions": {
    "event_definition_id": "<string>",
    "closure_stack_id": "<string>",
    "regime_map_id": "<string>"
  },
  "choices": {
    "cell_geometry": "cube",
    "geometry_meaning": "diameter",
    "normalization_length_id": "a|Lq|lambda_C",
    "report_unit_energy": "GeV",
    "rounding_rule_id": "<string>"
  },
  "numerics": {
    "kahan_sum": true,
    "window_size": "<int>",
    "replicas": "<int>"
  }
}

C.5 gateₗock schema (thresholds/judgment rules)

{
  "lock_type": "gate_lock",
  "lock_id": "gate_lock:v4.x.y:sha256:<64hex>",
  "version": "v4.x.y",
  "tolerances": {
    "eps_abs": "<float>",
    "eps_rel": "<float>",
    "dev_tol_max": "<float>"
  },
  "fail_codes": [
    {"code":"F-LOCK-MIX","meaning":"mixed lock_id"},
    {"code":"F-NOTUNING","meaning":"post-hoc tuning/fitting detected"},
    {"code":"F-REP-MISSING","meaning":"sealing/reproducibility info missing"},
    {"code":"F-SYM-UNIT","meaning":"symbol/unit/meaning conflict"}
  ]
}

C.6 protocolₗock schema (unit conversion/reporting conventions)

{
  "lock_type": "protocol_lock",
  "lock_id": "protocol_lock:v4.x.y:sha256:<64hex>",
  "version": "v4.x.y",
  "unit_conversions": {
    "GeV_to_J": 1.602176634e-10
  },
  "hashes": {
    "sha256_impl": "sha256",
    "encoding": "utf-8"
  }
}

C.7 run manifest schema (input/artifact sealing)

{
  "run_id": "<tuple-string-or-hash>",
  "created_utc": "YYYY-MM-DDThh:mm:ssZ",
  "registry_snapshot_id": "sha256:<64hex>",
  "protocol_id": "<string>",
  "seed_id": "sha256:<64hex>",
  "artifacts": [
    {"path":"logs/run.log","sha256":"<64hex>"},
    {"path":"metrics/metrics.json","sha256":"<64hex>"},
    {"path":"tables/table.csv","sha256":"<64hex>"}
  ]
}