Skip to content

base- 复制文本序列化:buildDataText/buildLogText #77

Closed

Description

@FeatherHunter

任务

按裁决 B2:不移植旧版 snapshot,改用 envelope shape 取代;但保留复制文本序列化能力(旧版复制按钮的内容来源)。

验收

  • 给定 envelope 能产出可复制的数据文本与日志文本,单测覆盖。
  • 与控件层票、复制交互票的接口一致。

进度:100%

下一步:无(验收通过并关闭)。4 条 pending 已落地:5 shape 投影/6 段日志/三 format(text·json·csv)/判定次序;冻结面 130 条(implemented 123/pending 7,仅剩 #75 两条、#78 五条)。#90 仅凭 §3.4 即可接线。

Activity

  1. self-assigned this
    on Sep 8, 2026
  2. FeatherHunter commented on Sep 8, 2026

    @FeatherHunter
    OwnerAuthor

    结论:复制文本序列化落地(buildDataText/buildLogText)

    按裁决 B2:不移植旧版 snapshot 结构,改用 envelope shape 取代;保留复制文本序列化。只动 packages/base-render。

    交付物

    交付 路径
    序列化运行时 packages/base-render/src/text.ts(2 个运行时出口;TextError 不导出,与 TemplateError/ControlsError 同口径)
    单测 packages/base-render/test/text.test.mjs(83 用例)
    证据 docs/research/t77-serialization-evidence.mjs + 快照 .md(215 断言,可复跑、逐字节确定)
    契约 docs/base-paint-contract.md §3.4.1–§3.4.7(行文本格式/旧→新差异 20 条/U1–U14 定案/自查台账/判定次序)
    changeset .changeset/base-paint-text-serialization.md(base-paint: minor)

    关键数字

    实现要点

    • 5 个 shape 投影逐字段对齐 DATA_TEXT_PROJECTIONS ↔ EnvelopeDataByShape;fallback → shape-unsupported。
    • 6 段日志:scene 由 envelope 派生,其余 5 段来自 CopyLogFields;(未知)/未填写 口径分明。
    • 三 format:text(§3.4.1 八条)/json(缩进 2、< → \u003c、键序)/csv(CSV_DIALECT 逐值 + RFC4180 转义 + 两列语义)。
    • 判定次序:format → shape → structure,首个命中即抛、不返空。
    • R-1 以新契约为准:旧 csv 是行拼接(无表头无转义)、旧 buildLogText 忽略 format、旧掩码合一行——差异 20 条逐条记账(§3.4.2),避免后人查 parity 时被误导。
    • 14 条「文档无规定」逐条定案(§3.4.3),无第二真相。

    验收记录

    轮次 结论 要点
    V1 投影与日志 通过 5 shape 逐字段 + 6 段来源 + 14 条定案审查;动态改表实验证明无第二份投影表
    V2 格式与错误码 不通过(阻塞 1) json 下 undefined 属性被静默丢弃 → 与 text/csv 同输入不同结果,违反「键不省略」
    V3 门禁与接口 通过 五命令/多重集/冻结面/三处同步;#90 仅凭契约可接线;独立验出「空产出 → 静默不复制」反例
    返修 — FX-77-1…8
    V4 终局复验 通过(阻塞 0) 16 组 parity 样本 PARITY_FAIL=0;30 例空产出全非空;8 条变异全部产生红并逐字节还原;证据脚本三次运行 sha256 与入仓快照全等

    交接

  3. FeatherHunter commented on Sep 8, 2026

    @FeatherHunter
    OwnerAuthor

    验收通过(V4 终局复验:阻塞级 0;16 组 parity 样本全过、30 例空产出全非空、8 条变异全红并逐字节还原、证据脚本可复现)→ 进度 100%,关闭。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

wayfinder:task

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions