目录文档-技术白皮书47-PTN Template v1.0

第5章 数据规范与管线契约


I. 字段表(Field Dictionary)

统一要求:字段名用蛇形命名;内联符号一律使用反引号;凡涉及路径相关量必须显式 gamma(ell) 与测度 d ell;所有数量带单位字段均需在同级或元数据中声明 unit。

  1. 核心观测与路径
  1. 仪器与标定
  1. 误差与质量
  1. 依赖、引用与版本

II. 取值域与单位(Domains, Units & Constraints)

  1. 基本约束
  1. 取值域
  1. 缺失与异常
  1. 量纲校核

III. 质量门与审计轨(Quality Gates & Audit Trail)

  1. 质量门(按执行顺序)
  1. 审计轨

IV. 导出与发布(Export & Release)

  1. 导出清单(必须包含)
  1. 目录结构(建议)

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

  1. 文件命名
  1. 发布级别

V. 机读契约示例(可直接复用)

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: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"

licenses:

- "CC-BY-4.0"

release_tier: "public"

B. schema.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", "pattern": "^[0-9A-HJKMNP-TV-Z]{26}$|^[0-9a-fA-F-]{36}$" },

"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": 2.9e8, "maximum": 3.1e8 }

}

},

"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", "pattern": "^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:[-+].*)?$" }

},

"allOf": [

{ "properties": {

"path": { "properties": { "gamma_ell": { "minItems": { "$data": "1/path/d_ell/minItems" } } } }

}

}

]

}


C. pipeline.yaml(处理管线契约)

version: "1.0.0"

pipeline:

- id: step-10-ingest

in: ["raw/*.parquet"]

out: ["stage/ingested.parquet"]

checks: ["G1","G8"]

- id: step-20-calibrate

in: ["stage/ingested.parquet"]

out: ["stage/calibrated.parquet"]

checks: ["G5"]

- id: step-30-arrival

in: ["stage/calibrated.parquet"]

out: ["stage/arrival.parquet"]

compute:

form: "T_arr = ( ∫ ( n_eff / c_ref ) d ell )"

requires: ["path.gamma_ell","path.d_ell","medium.n_eff_profile","ref.c_ref"]

delta_form: "general"

checks: ["G3","G4"]

see:

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

- id: step-40-noisefit

in: ["stage/arrival.parquet"]

out: ["stage/denoised.parquet","reports/noise.json"]

model: "huber"

checks: ["G6"]

- id: step-50-exports

in: ["stage/denoised.parquet"]

out: ["PTN_EXPORT/"]

checks: ["G2","G4","G7"]

audit:

run_id: "01JXYZABCD0EFG7H8JK9MN0PQ"

seeds: [20250924]

tools:

- name: "ptn-cli"

version: "1.4.2"

exports:

must_include: ["manifest.yaml","schema.json","check_dim_report.json","quality_report.json","audit.jsonl"]


D. 计算校核示例(量纲闭合)

Check: T_arr = ∫ ( n_eff / c_ref ) d ell

Dims : [1] / [m·s^-1] * [m] = [s] ✅


VI. 结果导出页面(发布项目信息最小集)


版权与许可(CC BY 4.0)

版权声明:除另有说明外,《能量丝理论》(含文本、图表、插图、符号与公式)的著作权由作者(“屠广林”先生)享有。
许可方式:本作品采用 Creative Commons 署名 4.0 国际许可协议(CC BY 4.0)进行许可;在注明作者与来源的前提下,允许为商业或非商业目的进行复制、转载、节选、改编与再分发。
署名格式(建议):作者:“屠广林”;作品:《能量丝理论》;来源:energyfilament.org;许可证:CC BY 4.0。

首次发布: 2025-11-11|当前版本:v5.1
协议链接:https://creativecommons.org/licenses/by/4.0/