Skip to content

feat(task): Phase 2 — registry/corpus derived from CanonicalStandard - #15

Closed
xianyu9n wants to merge 2 commits into
masterfrom
feat/phase2-registry-from-standard
Closed

feat(task): Phase 2 — registry/corpus derived from CanonicalStandard#15
xianyu9n wants to merge 2 commits into
masterfrom
feat/phase2-registry-from-standard

Conversation

@xianyu9n

Copy link
Copy Markdown
Collaborator

Phase 2: registry/corpus 从 CanonicalStandard 派生(docs/design/phase2_registry_corpus.md)。legacy standards_map 脱离正式构建链;Stage1 registry 字段与提交版逐字节一致;corpus 无损携带 standard_entries+scoped_annotations;B3-6 排除并报告;pers_info fallback。全仓 310 passed / 2 skipped。

曾立宏 added 2 commits August 20, 2026 18:33
Unify the data chain: raw standard -> CanonicalStandard (Phase 1) ->
LeafRegistry + Corpus. The legacy standards_map digests are no longer read by
the formal build (audit/legacy only). No Stage1/Stage2 prompt, parser, reward
or SFT/RL behavior changes.

- canonical_corpus.build_from_standard(): one category per training alias,
  ordered by first source row; Stage-1 registry fields (id set/order/name/
  path/code) byte-identical to committed (verified vs HEAD); registry keeps
  the historical Stage-1 path (finance L1/L2/leaf, shougang []).
- LOSSESS per-entry facts on the corpus: standard_entry_ids + standard_entries
  (real path, own description, raw_level, standard_data_level, raw_fields with
  provenance) + scoped_annotations — the finance 5×基本信息 bucket keeps all
  five entries (237 entries -> 233 categories, nothing first-only).
- shougang B3-6: excluded from the active universe and REPORTED
  (excluded_categories + category_excluded issue), never silently added or
  dropped; infra reuses the shared shougang standard.
- pers_info: no standard -> dataset-derived fallback unchanged, no fabricated
  standard_data_level/annotations.
- documented residual: finance 经营管理/运营管理/档案资料管理信息 description
  keeps the SOURCE cell's stray space (canonical standard is the fact source;
  the legacy dict silently dropped it) — whitespace-only, Stage1 never uses
  description, allowed explicitly in parity tests.
- script.canonical.cli reads data/standards/*.standard.json; corpus source
  points at the standard file; previous-active reference = committed registry.
- tests: tests/task/test_canonical_corpus_phase2.py (projection lossless,
  multi-entry round-trip, B3-6 report, infra reuse, pers_info fallback,
  determinism, real-data parity); full suite 310 passed, 2 skipped (existing).
…LI, lossless EntryView

- projection policy: DatasetConfig.projection_excluded_category_ids
  (shougang=("B3-6",); infra inherits via registry_source); build_from_standard
  applies it by default and reports excluded categories; the legacy registry
  is NO LONGER read at build time (_previous_active_ids removed) — the formal
  chain is CanonicalStandard + policy -> registry/corpus, old registry used
  only by parity tests.
- CI fresh clone: canonical CLI integration test now builds from a HERMETIC
  tmp canonical-standard fixture (--standard-dir) incl. B3-6, asserting the
  policy exclusion + report; no dependency on gitignored data/standards.
  Real-standard parity tests keep skipping when files are absent.
- StandardEntryView now carries the full Phase-1 StandardCategory facts:
  content (数据资源说明), code, source (file/sheet/row) plus raw_fields —
  corpus JSON -> load_corpus_categories() round-trips losslessly; shougang
  description(四级定义)/content(数据资源说明)/resource(raw_fields) stay
  distinct.
- tests: 28 corpus tests + EntryView round-trip + policy-default tests; full
  suite 313 passed, 2 skipped (pre-existing).
@xianyu9n

Copy link
Copy Markdown
Collaborator Author

r? 已按 review 修完 3 项(commit 53910b4):

  1. CI fresh-clone:CLI 集成测试改用 tmp canonical-standard fixture(--standard-dir 指向临时目录,含 B3-6),不再依赖 gitignored data/standards;真实 parity 测试文件缺失时继续 skip。
  2. 显式 projection policyDatasetConfig.projection_excluded_category_ids(shougang=("B3-6",);infra 经 registry_source 继承);build_from_standard 默认按 policy 排除并报告(excluded_categories + category_excluded issue);_previous_active_ids 已删除,正式构建不再读旧 registry —— 正式链 = CanonicalStandard + policy → registry/corpus;旧 registry 仅 parity 测试使用。
  3. EntryView 无损补全StandardEntryView 现携带 content / code / source(file/sheet/row) + raw_fields,corpus JSON → load_corpus_categories() 完整 round-trip;shougang description(四级定义)/content(数据资源说明)/resource(raw_fields) 三字段各归其位(有专门测试)。

全仓 313 passed / 2 skipped(既有 verl skip)。

@wantRP wantRP closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants