第7章 数据记录与契约


I. 目的与范围(Purpose & Scope)


II. 前置条件与输入(Prerequisites & Inputs)


III. 字段字典(Field Dictionary,最小必备)

字段名用蛇形;所有数值字段须带 unit 或在 see[] 指向量纲锚点;禁用中文符号。

  1. 采集与标识
  1. 路径与介质
  1. 观测量与相位
  1. 质量与不确定度
  1. 引用与版本

IV. 数据契约(Data Contract,规范要求)

  1. 一致性约束
  1. 量纲与公式口径(两种等价到达时 + 相位)

文中显式 gamma(ell) 与 d ell;数据/元数据记录 delta_form ∈ {general, factored};导出随附 check_dim_report.json。

  1. 缺失与异常

V. 导出工件与目录结构(Exports & Layout)

  1. 必交付
    • manifest.yaml(dataset_id/version/see[]/references[]/checksum/licenses/created_at/producer)
    • schema.json(JSON Schema)
    • observations.parquet,paths.parquet
    • check_dim_report.json,quality_report.json,audit.jsonl(含阈值事件与哈希)
  2. 建议目录

PTN_EXPORT/

manifest.yaml

data/

observations.parquet

paths.parquet

schema/

schema.json

reports/

check_dim_report.json

quality_report.json

audit.jsonl

README.md

SIGNATURE.asc


VI. 机读样例(Machine-Readable Examples)


A. manifest.yaml

dataset_id: "ptn-demo"

version: "1.0.0"

created_at: "2025-09-24T16:00:00Z"

producer: "PTN.Workgroup.Core"

see:

- "EFT.WP.Core.Equations v1.1:S20-1"

- "EFT.WP.Core.Metrology v1.0:check_dim"

- "EFT.WP.Core.DataSpec v1.0:TARR"

references:

- "EFT.WP.Core.Terms v1.0:P10-3"

checksum: { algo: "sha256", value: "<64-hex>" }

release_tier: "public"


B. schema.json(节选)

JSON json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PTN Data Object v1.0.0",
  "type": "object",
  "required": [ "record_id", "acq", "path", "medium", "ref", "obs", "version", "see", "references" ],
  "properties": {
    "record_id": { "type": "string" },
    "acq": {
      "type": "object",
      "required": [ "ts_start", "ts_end" ],
      "properties": {
        "ts_start": { "type": "string", "format": "date-time" },
        "ts_end": { "type": "string", "format": "date-time" }
      }
    },
    "path": {
      "type": "object",
      "required": [ "gamma_ell", "d_ell" ],
      "properties": {
        "gamma_ell": { "type": "array", "items": { "type": "number" }, "minItems": 2 },
        "d_ell": { "type": "array", "items": { "type": "number" }, "minItems": 2 }
      }
    },
    "medium": {
      "type": "object",
      "required": [ "n_eff_profile" ],
      "properties": { "n_eff_profile": { "type": "array", "items": { "type": "number" }, "minItems": 2 } }
    },
    "ref": {
      "type": "object",
      "required": [ "c_ref" ],
      "properties": { "c_ref": { "type": "number", "minimum": 290000000.0, "maximum": 310000000.0 } }
    },
    "obs": {
      "type": "object",
      "properties": { "T_arr": { "type": "number" }, "Phi": { "type": "number" } }
    },
    "see": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "references": { "type": "array", "items": { "type": "string" }, "minItems": 1 },
    "version": { "type": "string" }
  }
}

C. paths.parquet 字段示意(表头)

record_id,gamma_ell[],d_ell[],n_eff[],unit_gamma,unit_dell,unit_n

01H..., [..], [..], [..], m, m, 1


D. audit.jsonl(一行示例)

JSON json
{
  "run_id": "01JXYZABCD0EFG...",
  "started_at": "2025-09-24T16:10:00Z",
  "tools": [ { "name": "ptn-cli", "version": "1.4.2" } ],
  "random_seeds": [ 20250924 ],
  "input_hashes": [ "sha256:..." ],
  "events": [ { "ts": "...", "clock_state": "locked", "delta_t_abs_ns": 23, "allan_1s": 1.2e-11 } ],
  "references": [ "EFT.WP.Core.Equations v1.1:S20-1" ],
  "version": "1.0.0"
}

VII. 质量门与停止准则(Quality Gates & Stops)


VIII. 引用与版本(Citations & Versioning)


IX. 执行勾选清单(Checklist)