fix(arctic): address review findings and reconcile LFS rules
Browse filesRegression-tested tools and evidence safeguards; preserve data bytes and pending human review. Reconcile current main LFS rules without changing unrelated dataset content.
- .gitattributes +0 -0
- ARCTIC/shared-v1.1/doc/FULL_MIGRATION_SUMMARY.json +11 -1
- ARCTIC/shared-v1.1/doc/REVIEW_FIXES.md +41 -0
- ARCTIC/shared-v1.1/script/arctic_v1_1/README.md +9 -1
- ARCTIC/shared-v1.1/script/arctic_v1_1/test_review_fixes.py +119 -0
- ARCTIC/shared-v1.1/script/arctic_v1_1/validate.py +6 -0
- ARCTIC/shared-v1.1/script/arctic_v1_1/verify.py +29 -3
.gitattributes
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
ARCTIC/shared-v1.1/doc/FULL_MIGRATION_SUMMARY.json
CHANGED
|
@@ -254,5 +254,15 @@
|
|
| 254 |
"note": "CONTRACT 6.5 keeps human visual acceptance separate from this record; every check above is mechanical. full_output_human_review in the view metainfo still reads pending and was not rewritten."
|
| 255 |
},
|
| 256 |
"publication_authorized": false,
|
| 257 |
-
"scope": "339 sequences, 3051 cameras, 2193687 frames; human post-full review and HF publication pending"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 258 |
}
|
|
|
|
| 254 |
"note": "CONTRACT 6.5 keeps human visual acceptance separate from this record; every check above is mechanical. full_output_human_review in the view metainfo still reads pending and was not rewritten."
|
| 255 |
},
|
| 256 |
"publication_authorized": false,
|
| 257 |
+
"scope": "339 sequences, 3051 cameras, 2193687 frames; human post-full review and HF publication pending",
|
| 258 |
+
"maintenance": {
|
| 259 |
+
"date": "2026-10-17",
|
| 260 |
+
"reviewed_parent": "5299fddd40102b598844da5cbe1cfcbe6dd6f815",
|
| 261 |
+
"scope": "tools, regression tests and documentation only; data unchanged",
|
| 262 |
+
"evidence": "doc/REVIEW_FIXES.md",
|
| 263 |
+
"historical_claims": "All original full-validation and publication-manifest claims describe the reviewed parent, not a fresh full run with these maintenance tools.",
|
| 264 |
+
"current_external_sha256_manifest_refreshed": true,
|
| 265 |
+
"human_review": "pending",
|
| 266 |
+
"manifest_method": "Ordinary Git blob bytes hashed; LFS payload SHA256/size from immutable stored pointers. See REVIEW_FIXES.md; no fresh full-data semantic validation."
|
| 267 |
+
}
|
| 268 |
}
|
ARCTIC/shared-v1.1/doc/REVIEW_FIXES.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# PR #5 review fixes — 2026-10-17
|
| 2 |
+
|
| 3 |
+
Reviewed parent: `5299fddd40102b598844da5cbe1cfcbe6dd6f815` in `ParityLab/Hand-Datasets-Raw`.
|
| 4 |
+
This maintenance change updates tools, tests, documentation and evidence bookkeeping only.
|
| 5 |
+
The `data/` subtree and raw data are unchanged from that immutable parent.
|
| 6 |
+
The merge replaces the old release paths atomically and preserves other datasets.
|
| 7 |
+
|
| 8 |
+
## Evidence scope
|
| 9 |
+
|
| 10 |
+
No full real-media decode, full numerical comparison or human visual acceptance was rerun
|
| 11 |
+
for this maintenance change. Historical validation results remain historical, not new
|
| 12 |
+
sign-off. Human review is still pending; this document does not grant approval.
|
| 13 |
+
Git tree/blob identities establish unchanged tracked content, not annotation correctness.
|
| 14 |
+
The maintenance audit records exact before/after Git trees and path changes outside the
|
| 15 |
+
release; Git blob SHA1 identities must not be confused with file-content SHA256 hashes.
|
| 16 |
+
|
| 17 |
+
## Fix and tests
|
| 18 |
+
|
| 19 |
+
`verify.py` requires existing source/target data directories and nonempty source views.
|
| 20 |
+
Unselected `--complete` additionally requires 3051 source views and identical relative
|
| 21 |
+
target view paths. Partial/incremental checks cannot replace formal acceptance or rebuild
|
| 22 |
+
the publication manifest. Both verify and validate reject a manifest as a report output,
|
| 23 |
+
including normalized path aliases. Invalid/empty selections fail before evidence writes.
|
| 24 |
+
|
| 25 |
+
`python -B script/arctic_v1_1/test_review_fixes.py`: 10 tests pass. The combined
|
| 26 |
+
ARCTIC/ReInterHand isolated CLI regression suite passes all 19 scenarios, including
|
| 27 |
+
missing source, partial evidence protection and ReInterHand media-valid failures.
|
| 28 |
+
Those CLI fixtures use cached numeric data; ARCTIC media/assets are marked placeholders,
|
| 29 |
+
and ReInterHand declares unavailable video. They test control flow, not media correctness.
|
| 30 |
+
Earlier independent numeric sampling covered 18 ARCTIC and 27 ReInterHand views; this
|
| 31 |
+
maintenance does not expand that sample into a full comparison.
|
| 32 |
+
|
| 33 |
+
`FULL_MIGRATION_SUMMARY.json` keeps its original validation claims as historical fields;
|
| 34 |
+
its maintenance section narrows their provenance. The author's external SHA256 publication
|
| 35 |
+
manifest was not available locally. A fresh external PUBLISH_MANIFEST.json is generated
|
| 36 |
+
from the final fixed Git tree: SHA256 is computed over ordinary file bytes, and LFS
|
| 37 |
+
content SHA256/size is taken from the exact stored pointer. This verifies published
|
| 38 |
+
content identities without downloading or decoding the LFS payloads. A separate
|
| 39 |
+
Git-identity ledger records paths and blob IDs for merge auditing.
|
| 40 |
+
|
| 41 |
+
The existing object-keypoint registry exception is retained, not silently relabeled.
|
ARCTIC/shared-v1.1/script/arctic_v1_1/README.md
CHANGED
|
@@ -253,4 +253,12 @@ traceback。checkpoint 也记录同一份工具摘要,所以**改动 `migrate.
|
|
| 253 |
|
| 254 |
**画外点怎么判定、怎么披露。** 页面只画发布自己的 camera 系几何,所以「物体大部分落在画外」是会真实发生的情形,而一个几乎空的面板光看是分不出「物体真的出画」和「投影坏了」的。抽样出的 54 个视图里只有 `s05_microwave_use_01/0` 命中:第 195 帧 32 个有效关键点只有 1 个落在画内,而**同一帧**的 8 路 exo 视图是 32/32——该视图是戴在头上的 ego 相机,物体正好在视野上缘之上,与发布声明的 `coordinate_frame: camera` 自洽,不是投影错误。处置是披露而不是改数:页面在标题下点名命中的帧并说明这是 ego 视图的视野问题,面板标题以「物体大部分落在画外(该帧 N 个有效关键点只有 M 个落在画内)」开头,规则一并写出(`inside_points / valid_points < 0.5` 即标记)。规则之外还逐帧记数:**每个抽样帧**的 `annotated`、`valid_points`、`inside_points`、`inside_ratio`、`mostly_out_of_frame` 都写进该视图报告的 `projection.frames`(源未标注的帧记 `annotated: false`,不省略),规则原文写进 `projection.out_of_frame_rule`,视图级计数写进 `geometry_panels.frames_mostly_out_of_frame`。门限只用于披露,不改动任何发布数据。
|
| 255 |
|
| 256 |
-
这套页面是**人工验收要看的材料**,不是训练输入。CONTRACT §6.5 区分「重打包在数值上逐字节同一」与「人工目视验收」,页面给的是后者;渲出页面不等于有人看过,所以发布状态里的 `full_output_human_review` 与汇总里的 `human_full_review` 都仍是 `"pending"`。ARCTIC v1.0 自己的复核产物照旧随发布保留在 `doc/history-v1.0/validation/`。
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 253 |
|
| 254 |
**画外点怎么判定、怎么披露。** 页面只画发布自己的 camera 系几何,所以「物体大部分落在画外」是会真实发生的情形,而一个几乎空的面板光看是分不出「物体真的出画」和「投影坏了」的。抽样出的 54 个视图里只有 `s05_microwave_use_01/0` 命中:第 195 帧 32 个有效关键点只有 1 个落在画内,而**同一帧**的 8 路 exo 视图是 32/32——该视图是戴在头上的 ego 相机,物体正好在视野上缘之上,与发布声明的 `coordinate_frame: camera` 自洽,不是投影错误。处置是披露而不是改数:页面在标题下点名命中的帧并说明这是 ego 视图的视野问题,面板标题以「物体大部分落在画外(该帧 N 个有效关键点只有 M 个落在画内)」开头,规则一并写出(`inside_points / valid_points < 0.5` 即标记)。规则之外还逐帧记数:**每个抽样帧**的 `annotated`、`valid_points`、`inside_points`、`inside_ratio`、`mostly_out_of_frame` 都写进该视图报告的 `projection.frames`(源未标注的帧记 `annotated: false`,不省略),规则原文写进 `projection.out_of_frame_rule`,视图级计数写进 `geometry_panels.frames_mostly_out_of_frame`。门限只用于披露,不改动任何发布数据。
|
| 255 |
|
| 256 |
+
这套页面是**人工验收要看的材料**,不是训练输入。CONTRACT §6.5 区分「重打包在数值上逐字节同一」与「人工目视验收」,页面给的是后者;渲出页面不等于有人看过,所以发布状态里的 `full_output_human_review` 与汇总里的 `human_full_review` 都仍是 `"pending"`。ARCTIC v1.0 自己的复核产物照旧随发布保留在 `doc/history-v1.0/validation/`。
|
| 257 |
+
## 2026-10-17 审查修复
|
| 258 |
+
|
| 259 |
+
`verify.py` 在写任何验收产物前拒绝缺失/空源树;完整验收必须有完整源视图集合,且与目标集合一致。
|
| 260 |
+
仅下载新发布树时,必须先从固定旧提交准备 `--v10`,不能把缺失的旧树当成已通过验收。
|
| 261 |
+
子集/增量运行不再重建发布清单,也不能覆盖正式数值验收记录。
|
| 262 |
+
`verify.py` / `validate.py` 均禁止将报告写到发布清单;选择数量必须为正。
|
| 263 |
+
运行 `python -B test_review_fixes.py` 执行这些边界的离线回归。
|
| 264 |
+
本次工具修改与旧验收记录的范围见 `../../doc/REVIEW_FIXES.md`。
|
ARCTIC/shared-v1.1/script/arctic_v1_1/test_review_fixes.py
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Offline regression checks for input completeness and protected evidence paths."""
|
| 2 |
+
import contextlib
|
| 3 |
+
import io
|
| 4 |
+
import json
|
| 5 |
+
from pathlib import Path
|
| 6 |
+
import tempfile
|
| 7 |
+
import unittest
|
| 8 |
+
from unittest.mock import patch
|
| 9 |
+
|
| 10 |
+
import validate
|
| 11 |
+
import verify
|
| 12 |
+
|
| 13 |
+
|
| 14 |
+
class ReviewFixes(unittest.TestCase):
|
| 15 |
+
def setUp(self):
|
| 16 |
+
self.temp = tempfile.TemporaryDirectory()
|
| 17 |
+
self.addCleanup(self.temp.cleanup)
|
| 18 |
+
self.root = Path(self.temp.name)
|
| 19 |
+
self.source, self.target = self.root / 'v10', self.root / 'v11'
|
| 20 |
+
self.schema = verify.RELEASE_ROOT / 'doc/schema.json'
|
| 21 |
+
self.manifest = self.root / 'PUBLISH_MANIFEST.json'
|
| 22 |
+
self.acceptance = self.root / 'acceptance.json'
|
| 23 |
+
self.structural = self.root / 'validate_report.json'
|
| 24 |
+
for path in (self.manifest, self.acceptance, self.structural):
|
| 25 |
+
path.write_bytes(b'original evidence')
|
| 26 |
+
for module, key, value in (
|
| 27 |
+
(verify, 'MANIFEST_PATH', self.manifest),
|
| 28 |
+
(verify, 'ACCEPTANCE_REPORT', self.acceptance),
|
| 29 |
+
(validate, 'MANIFEST_PATH', self.manifest),
|
| 30 |
+
(validate, 'ACCEPTANCE_REPORT', self.structural),
|
| 31 |
+
(validate, 'RELEASE_ROOT', self.target),
|
| 32 |
+
(validate, 'TMP_ROOT', self.root / 'tmp'),
|
| 33 |
+
):
|
| 34 |
+
guard = patch.object(module, key, value)
|
| 35 |
+
guard.start()
|
| 36 |
+
self.addCleanup(guard.stop)
|
| 37 |
+
self.args = ['--v10', str(self.source), '--v11', str(self.target),
|
| 38 |
+
'--schema', str(self.schema)]
|
| 39 |
+
|
| 40 |
+
def view(self, root, sequence='s', camera='c'):
|
| 41 |
+
path = root / 'data' / sequence / camera / 'metainfo.json'
|
| 42 |
+
path.parent.mkdir(parents=True, exist_ok=True)
|
| 43 |
+
path.write_text('{}')
|
| 44 |
+
|
| 45 |
+
def rejected(self, module, args):
|
| 46 |
+
before = {p.relative_to(self.root): p.read_bytes()
|
| 47 |
+
for p in self.root.rglob('*') if p.is_file()}
|
| 48 |
+
with contextlib.redirect_stdout(io.StringIO()), contextlib.redirect_stderr(io.StringIO()):
|
| 49 |
+
with self.assertRaises((SystemExit, AssertionError)):
|
| 50 |
+
module.main(args)
|
| 51 |
+
after = {p.relative_to(self.root): p.read_bytes()
|
| 52 |
+
for p in self.root.rglob('*') if p.is_file()}
|
| 53 |
+
self.assertEqual(before, after, 'rejected runs must not modify evidence')
|
| 54 |
+
|
| 55 |
+
def test_missing_source(self):
|
| 56 |
+
self.view(self.target)
|
| 57 |
+
self.rejected(verify, self.args + ['--complete', '--report', str(self.acceptance)])
|
| 58 |
+
|
| 59 |
+
def test_empty_source(self):
|
| 60 |
+
(self.source / 'data').mkdir(parents=True)
|
| 61 |
+
self.view(self.target)
|
| 62 |
+
self.rejected(verify, self.args + ['--complete', '--report', str(self.acceptance)])
|
| 63 |
+
|
| 64 |
+
def test_missing_target(self):
|
| 65 |
+
self.view(self.source)
|
| 66 |
+
self.rejected(verify, self.args + ['--complete'])
|
| 67 |
+
|
| 68 |
+
def test_truncated_full_source(self):
|
| 69 |
+
self.view(self.source)
|
| 70 |
+
self.view(self.target)
|
| 71 |
+
self.rejected(verify, self.args + ['--complete', '--report', str(self.acceptance)])
|
| 72 |
+
|
| 73 |
+
def test_complete_requires_same_view_set(self):
|
| 74 |
+
self.view(self.source, 's1')
|
| 75 |
+
self.view(self.source, 's2')
|
| 76 |
+
self.view(self.target, 's1')
|
| 77 |
+
self.view(self.target, 'wrong')
|
| 78 |
+
with patch.object(verify, 'EXPECTED_VIEWS', 2):
|
| 79 |
+
self.rejected(verify, self.args + ['--complete'])
|
| 80 |
+
|
| 81 |
+
def test_partial_cannot_overwrite_acceptance(self):
|
| 82 |
+
self.rejected(verify, self.args + ['--complete', '--sample', '1',
|
| 83 |
+
'--report', str(self.acceptance)])
|
| 84 |
+
|
| 85 |
+
def test_manifest_is_never_a_report(self):
|
| 86 |
+
for module, args in ((verify, self.args), (validate, [])):
|
| 87 |
+
self.rejected(module, args + ['--report', str(self.manifest)])
|
| 88 |
+
self.rejected(module, args + ['--report', str(self.root / 'sub/../PUBLISH_MANIFEST.json')])
|
| 89 |
+
custom = self.root / 'custom-manifest.json'
|
| 90 |
+
self.rejected(verify, self.args + ['--manifest', str(custom), '--report', str(custom)])
|
| 91 |
+
|
| 92 |
+
def test_selection_must_be_nonempty_and_positive(self):
|
| 93 |
+
for module, option, args in ((verify, '--sample', self.args), (validate, '--limit', [])):
|
| 94 |
+
for value in ['0', '-1']:
|
| 95 |
+
self.rejected(module, args + [option, value])
|
| 96 |
+
self.rejected(module, args + ['--views'])
|
| 97 |
+
|
| 98 |
+
def test_unknown_source_sequence(self):
|
| 99 |
+
self.view(self.source)
|
| 100 |
+
(self.target / 'data').mkdir(parents=True)
|
| 101 |
+
self.rejected(verify, self.args + ['--views', 'unknown', '--no-manifest'])
|
| 102 |
+
|
| 103 |
+
def test_incremental_absent_view_stays_explicit_and_does_not_write_manifest(self):
|
| 104 |
+
self.view(self.source)
|
| 105 |
+
(self.target / 'data').mkdir(parents=True)
|
| 106 |
+
report = self.root / 'incremental.json'
|
| 107 |
+
with contextlib.redirect_stdout(io.StringIO()):
|
| 108 |
+
code = verify.main(self.args + ['--views', 's', '--report', str(report)])
|
| 109 |
+
self.assertEqual(code, 0)
|
| 110 |
+
result = json.loads(report.read_text())
|
| 111 |
+
self.assertEqual(result['views_absent_from_target'], ['s/c'])
|
| 112 |
+
self.assertEqual(result['views_migrated'], 0)
|
| 113 |
+
self.assertIn('skipped', result['manifest'])
|
| 114 |
+
self.assertEqual(self.manifest.read_bytes(), b'original evidence')
|
| 115 |
+
self.assertEqual(self.acceptance.read_bytes(), b'original evidence')
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
if __name__ == '__main__':
|
| 119 |
+
unittest.main()
|
ARCTIC/shared-v1.1/script/arctic_v1_1/validate.py
CHANGED
|
@@ -339,6 +339,12 @@ def main(argv=None):
|
|
| 339 |
"without being asked. The accepting run must not pass this "
|
| 340 |
"(CONTRACT 6.4).")
|
| 341 |
args = parser.parse_args(argv)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 342 |
|
| 343 |
all_views = sorted((RELEASE_ROOT / "data").glob("*/*/metainfo.json"))
|
| 344 |
wanted = set(args.views) if args.views else None
|
|
|
|
| 339 |
"without being asked. The accepting run must not pass this "
|
| 340 |
"(CONTRACT 6.4).")
|
| 341 |
args = parser.parse_args(argv)
|
| 342 |
+
if args.limit is not None and args.limit < 1:
|
| 343 |
+
parser.error("--limit must be positive")
|
| 344 |
+
if args.views is not None and not args.views:
|
| 345 |
+
parser.error("--views requires at least one sequence")
|
| 346 |
+
if args.report is not None and args.report.resolve() == MANIFEST_PATH.resolve():
|
| 347 |
+
parser.error("--report must not overwrite the publication manifest")
|
| 348 |
|
| 349 |
all_views = sorted((RELEASE_ROOT / "data").glob("*/*/metainfo.json"))
|
| 350 |
wanted = set(args.views) if args.views else None
|
ARCTIC/shared-v1.1/script/arctic_v1_1/verify.py
CHANGED
|
@@ -49,7 +49,10 @@ DATASET_ROOT = RELEASE_ROOT.parent
|
|
| 49 |
#: validate.py is what the documented chain rebuilds the shipping manifest with.
|
| 50 |
MANIFEST_PATH = DATASET_ROOT / "tmp" / "arctic-tools" / "PUBLISH_MANIFEST.json"
|
| 51 |
|
|
|
|
|
|
|
| 52 |
V10_SCHEMA_VERSION = "hand-warehouse/1.0"
|
|
|
|
| 53 |
#: metainfo keys the migration is allowed to rewrite at the top level. Everything
|
| 54 |
#: else is a claim the source made and must survive verbatim -- ARCTIC's release
|
| 55 |
#: status flags, the omitted-component reasons, the split bookkeeping. The version
|
|
@@ -384,10 +387,32 @@ def main(argv=None):
|
|
| 384 |
"the one to write it.")
|
| 385 |
args = parser.parse_args(argv)
|
| 386 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 387 |
registry = Registry.load(args.schema)
|
| 388 |
reader = BundleReader()
|
| 389 |
-
|
| 390 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 391 |
migrated, absent = [], []
|
| 392 |
for view in source_views:
|
| 393 |
relative = view.relative_to(args.v10 / "data")
|
|
@@ -402,6 +427,7 @@ def main(argv=None):
|
|
| 402 |
known = {view.parent.name for view in source_views}
|
| 403 |
assert wanted <= known, ("no such view", sorted(wanted - known))
|
| 404 |
migrated = [v for v in migrated if v.parent.name in wanted]
|
|
|
|
| 405 |
if args.sample:
|
| 406 |
migrated = migrated[:args.sample]
|
| 407 |
|
|
@@ -425,7 +451,7 @@ def main(argv=None):
|
|
| 425 |
print(f"FAIL {relative}: {error}", file=sys.stderr)
|
| 426 |
|
| 427 |
# 4: regenerated release manifest
|
| 428 |
-
if args.no_manifest:
|
| 429 |
#: reported as skipped, not as "0 files" -- an empty manifest in the report
|
| 430 |
#: would read like a tree with nothing in it
|
| 431 |
report["manifest"] = {"skipped": "incremental check; not an acceptance run"}
|
|
|
|
| 49 |
#: validate.py is what the documented chain rebuilds the shipping manifest with.
|
| 50 |
MANIFEST_PATH = DATASET_ROOT / "tmp" / "arctic-tools" / "PUBLISH_MANIFEST.json"
|
| 51 |
|
| 52 |
+
ACCEPTANCE_REPORT = MANIFEST_PATH.parent / "acceptance.json"
|
| 53 |
+
|
| 54 |
V10_SCHEMA_VERSION = "hand-warehouse/1.0"
|
| 55 |
+
EXPECTED_VIEWS = 3051
|
| 56 |
#: metainfo keys the migration is allowed to rewrite at the top level. Everything
|
| 57 |
#: else is a claim the source made and must survive verbatim -- ARCTIC's release
|
| 58 |
#: status flags, the omitted-component reasons, the split bookkeeping. The version
|
|
|
|
| 387 |
"the one to write it.")
|
| 388 |
args = parser.parse_args(argv)
|
| 389 |
|
| 390 |
+
if args.sample is not None and args.sample < 1:
|
| 391 |
+
parser.error("--sample must be positive")
|
| 392 |
+
if args.views is not None and not args.views:
|
| 393 |
+
parser.error("--views requires at least one sequence")
|
| 394 |
+
acceptance_pass = args.complete and args.views is None and args.sample is None
|
| 395 |
+
if args.report is not None:
|
| 396 |
+
if args.report.resolve() in {MANIFEST_PATH.resolve(), args.manifest.resolve()}:
|
| 397 |
+
parser.error("--report must not overwrite a publication manifest")
|
| 398 |
+
if not acceptance_pass and args.report.resolve() == ACCEPTANCE_REPORT.resolve():
|
| 399 |
+
parser.error("the acceptance report requires --complete without --views/--sample")
|
| 400 |
+
|
| 401 |
registry = Registry.load(args.schema)
|
| 402 |
reader = BundleReader()
|
| 403 |
+
source_data, target_data = args.v10 / "data", args.v11 / "data"
|
| 404 |
+
if not source_data.is_dir() or not target_data.is_dir():
|
| 405 |
+
parser.error("both source and target data directories must exist")
|
| 406 |
+
source_views = sorted(p.parent for p in source_data.glob("*/*/metainfo.json"))
|
| 407 |
+
if not source_views:
|
| 408 |
+
parser.error("source contains no views; no acceptance evidence was written")
|
| 409 |
+
if acceptance_pass:
|
| 410 |
+
source_set = {p.relative_to(source_data) for p in source_views}
|
| 411 |
+
target_set = {p.parent.relative_to(target_data)
|
| 412 |
+
for p in target_data.glob("*/*/metainfo.json")}
|
| 413 |
+
if len(source_set) != EXPECTED_VIEWS or source_set != target_set:
|
| 414 |
+
parser.error(f"full acceptance requires {EXPECTED_VIEWS} source views and "
|
| 415 |
+
"the exact same target view set")
|
| 416 |
migrated, absent = [], []
|
| 417 |
for view in source_views:
|
| 418 |
relative = view.relative_to(args.v10 / "data")
|
|
|
|
| 427 |
known = {view.parent.name for view in source_views}
|
| 428 |
assert wanted <= known, ("no such view", sorted(wanted - known))
|
| 429 |
migrated = [v for v in migrated if v.parent.name in wanted]
|
| 430 |
+
absent = [v for v in absent if v.parent.name in wanted]
|
| 431 |
if args.sample:
|
| 432 |
migrated = migrated[:args.sample]
|
| 433 |
|
|
|
|
| 451 |
print(f"FAIL {relative}: {error}", file=sys.stderr)
|
| 452 |
|
| 453 |
# 4: regenerated release manifest
|
| 454 |
+
if args.no_manifest or not acceptance_pass:
|
| 455 |
#: reported as skipped, not as "0 files" -- an empty manifest in the report
|
| 456 |
#: would read like a tree with nothing in it
|
| 457 |
report["manifest"] = {"skipped": "incremental check; not an acceptance run"}
|