Skip to content

feat: add sharded frame-tree analysis and lightweight cache reuse - #269

Merged
codeasier merged 8 commits into
codeasier:mainfrom
shaanjiangcun:codex/work-20261021
Nov 4, 2026
Merged

codeasier merged 8 commits into
codeasier:mainfrom
shaanjiangcun:codex/work-20261021

Conversation

@shaanjiangcun

@shaanjiangcun shaanjiangcun commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

Enable active_memory_frame_tree_at_event and report memory-tree for native and msinsight sharded datasets. Live blocks resolve their original allocation events across shards and aggregate by the complete ordered caller path. Inclusive/self bytes, requested bytes and block counts remain conserved, including static, preexisting, empty and missing-stack leaves.

New exports retain deduplicated raw frames and ordered stack sequences in the optional version-2 frame extension. Readers support legacy version-1 and text-only datasets, expose source completeness separately from row truncation, and preserve query deadlines and work budgets. Version-2 callstack statistics reduce repeated events in SQLite before loading representative stacks.

Compatible cache hashing uses Insight parser v3: cacheHash = SHA256(b"mem_snapshot_parser_v3" + raw_pickle_bytes). Former v2 caches require export to a new output directory; they are not overwritten. Imports check source identity, complete manifest/member inventory, required read-only schema and indexed event endpoints, including during focus updates. Compatible content verification has been removed: no DB-byte hashes, base/frame row scans, quick_check, logical frame seals, strict CLI/API option or environment switch. Historical digest fields remain accepted as member inventories without comparing their values; new exports retain a structural parserCache inventory with empty member values.

Lightweight compatible imports never seed the query validation cache or persistent validation receipts, including initial publication. Queries and explicit validators retain independent admission checks. Native imports retain content verification, ordered-frame integrity validation and disposable content-verified receipts across processes.

Concurrent frame-tree requests on one analyzer/service use latest-request-wins semantics. New requests cancel older Python/SQLite work, obsolete queued requests are skipped, and cancelled calls raise QueryCancelledError / QUERY_CANCELLED instead of publishing partial trees. Each task owns and closes its connections in its executing thread before the next tree starts. Runtime template registrations survive worker cloning without sharing connections. Analyzer close and context-cache invalidation cancel outstanding trees; cancelled dataset admission evicts existing validation-cache entries. Other templates retain their existing concurrency contract; independent analyzers/services and CLI processes do not cancel each other. No persistent tree-result cache is introduced.

Both READMEs and bilingual guides describe the behavior and limitations. Compatible publication preserves existing outputs even with --force; lightweight import checks do not detect arbitrary edited row values, internal event gaps or damaged secondary indexes. Legacy text-only datasets expose missing structured-frame evidence. Query-local IDs and equal-size sibling ordering may differ across physical formats. Pinned historical v2 GUI evidence remains historical and does not verify parser v3.

PR review fixes preflight each serialized optional stack against the same JSON depth limit used by readers before writing any rows; unsupported stacks retain their text and occupancy. Sharded frame attachment no longer rescans the complete allocation-ID list per row. The clean-wheel acceptance comparator checks shared event fields and validates dataset-only ordered-frame evidence separately. Compatible-cache regression coverage now distinguishes accepted content edits from rejected structural damage. Parser v3 is retained by agreement for the coordinated Insight upgrade.

Latest review fixes (7bed620) count frame-tree queue waiting against the original operation deadline. Timed lock acquisition and a post-acquisition check prevent expired queued requests from starting a worker. Deterministic regressions cover fresh and supplied budgets and expiry on acquisition. Bilingual README/quickstart/protocol/acceptance docs now distinguish historical v2 consumer references from current v3 exports; no matching v3 consumer revision/build or GUI reuse is claimed without evidence. Future acceptance requires a separate trusted pickle copy and a new adjacent cache.

Validation

  • Upstream integration (54806d1, 2026-11-04): merged canonical main 81af669. Resolved four bilingual README/quickstart conflicts by preserving upstream onboarding and the v3/lightweight-reuse corrections. Post-merge validation: 225 targeted tests, 39 upstream property tests and 7 fixture provenance checks passed; Ruff, Black, basedpyright (0 errors) and git diff --check passed. This is local validation, not a remote CI or GUI acceptance claim. CI workflow changes come from upstream; no additional workflow edits were made for conflict resolution.

  • Latest queue/deadline review: 149 distinct query, CLI/API contract, lifecycle and governance tests passed, plus 7 fixture provenance checks. Windows governance tests require UTF-8 mode. Ruff, Black and git diff --check passed; basedpyright: 0 errors (1942 informational warnings). Installed-wheel and GUI acceptance were not rerun for this deadline/documentation change.

  • Earlier cancellation/API review: 302 distinct targeted query, frame-tree, executor, pagination, report, CLI/API and lifecycle tests passed. Four additional symlink cases failed solely at setup with Windows WinError 1314. Fixture provenance: 7 passed.

  • Coverage includes latest-only queueing, analyzer close/cache invalidation, real standalone SQLite interruption with and without deadlines, runtime template cloning, dataset Python-work cancellation, cancelled-admission cache eviction, subsequent query recovery, and CLI JSON error classification.

  • Current review fixes: 130 targeted tests and 60 runtime tests passed; fixture provenance: 7 passed. One additional targeted case failed during setup because Windows denied symlink creation (WinError 1314). The 30,000-event regression guards against full-list membership scans, and real two-shard native/compatible CLI acceptance exercises the event comparator.

  • Current Ruff, Black and git diff --check passed; basedpyright: 0 errors (1941 informational warnings).

  • Earlier parser-v3 verification: 170 cache/export/three-shard tests passed, two symlink cases deselected; the finalized v2-cache rejection regression also passed.

  • Earlier cache-policy verification reused a synthetic 7,292,264,448-byte compatible database with focus enabled in 0.071 seconds. Guards prohibited full dataset validation, DB hashing and receipt writes. This is a local warm-cache observation, not a general performance guarantee.

  • Earlier frame-tree evidence compared real memory0 standalone/sharded reports: 5,193 caller paths, 4,897 live blocks and 28,554,697,557 active bytes, plus Chinese-path import/report verification. These real-data checks predate the final cancellation changes; browser acceptance was not rerun for this review.

  • Current built-wheel acceptance passed in an isolated offline-wheelhouse environment: native and compatibility-v1 exports each produced two physical shards (8,180 real events), with cache reuse, standalone peak parity, cross-shard event parity and unchanged focus verified. CLI/help and packaged skill checks passed; no live-agent or GUI acceptance was performed.

  • Existing Windows full-suite limitations include symlink privileges, unavailable os.fchmod and Linux-only fcntl stress cases. This is not a full-suite-green claim. CI workflow logic is unchanged and CI failures are not repaired here.

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed.
    Snapshot provenance decision: updated

@shaanjiangcun
shaanjiangcun force-pushed the codex/work-20261021 branch 2 times, most recently from 6458e77 to ac959d5 Compare October 27, 2026 09:38
@shaanjiangcun shaanjiangcun changed the title feat: support frame-tree reports for sharded datasets feat: add sharded frame-tree analysis and lightweight cache reuse Oct 27, 2026

@codeasier codeasier left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

基于最新 head da53b58d8af30593dea4b575abf9c7870ed44da9 完成检视,记录 5 条行内问题:1 条 P1、4 条 P2。

本轮依据固定源码、diff 与现有 CI 日志,未运行本地 UT/build、benchmark 或 GUI。当前 exact-head CI 尚未通过,wheel/nightly 验收也不能视作已完成;另一个已有的 fstat 故障注入测试问题不计入本 PR 新增缺陷。

)

PARSER_HASH_SALT = b"mem_snapshot_parser_v2"
PARSER_HASH_SALT = b"mem_snapshot_parser_v3"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] v3 缓存与仍承诺支持的 msinsight 目标不匹配

当前文档仍将 --format msinsight 限定到 Ascend/msinsight@101f65b 的“同一原始 pickle + 相邻缓存”入口;该目标的 C++ parser 使用 L43 的 mem_snapshot_parser_v2 计算并比较 cacheHash。这里改成 v3 后,新导出在该入口会被判为需要重新解析,不能复用。

当前 master 5c722719 也不是可直接替代的 v3 consumer:它仍用 v2,而且 L328–332 要求 parserCache.members 等于实际摘要;本文件 L182 写空字符串,因此仅改回 salt 也不足以满足该版本。修改 targetRevision 只影响 pt-snap 的身份/reuse 门禁,不会切换消费端算法。

建议保留匹配既定目标的导出协议,或明确指定已实现相同 v3 hash/member 语义的 consumer,再更新兼容声明和验收。这是固定源码协议核对,未运行 GUI。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已确认这是与 Insight 端联动的版本升级:本工具使用 mem_snapshot_parser_v3,Insight 端会同步修改解析版本。此处保留 v3,不回退到 v2;固定旧版本的历史验收不作为新版兼容性证明。

Comment on lines +33 to +42
encoded = [
json.dumps(
frame.to_dict() if isinstance(frame, Frame) else frame,
sort_keys=True,
ensure_ascii=True,
separators=(",", ":"),
allow_nan=False,
)
for frame in frames
]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 写入前需要与 reader 使用相同的 frame 深度约束

正常 filename/line/name 之外,frame 可以带上能正常 JSON 编码、但嵌套超过 128 层的额外字段。原文本路径只使用这三个展示字段;这里的 json.dumps 也能成功,所以会写入这份可选证据。但 native finalize 随后无条件调用 frame_member_digest,其 L88–89 用 _bounded_depth([frame]) 拒绝它,导致整个原本可接受的 native 分片导入失败,而不是降级为缺少 frame evidence。

建议在任何 frame/stack 行写入前按同一 JSON/深度规则预检;不支持的可选证据省略整栈,保持原始文本输入的接受范围,并补“可序列化但超深”的导入回归。此处为静态路径确认,本轮未运行导入测试。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 39d0793 修复。writer 与 reader 共用 JSON 深度检查,在任何可选帧/栈行写入前,对序列化后再解码的整栈预检,包含 tuple 转 JSON array 的情况。超过 128 层时省略整栈可选证据,保留文本调用栈和内存占用,避免 native finalize 因此拒绝整个导入。新增 native/compatible × dict/tuple 超深证据回归,验证可选表没有残留行、文本与占用保持可用;相关测试通过,中英文文档已同步。

Comment thread src/pt_snap_cli/core/dataset_frames.py Outdated
for row in coverage:
resolver.budget.remaining()
event, stack, count = row["eventId"], row["stackId"], row["frameCount"]
if event not in ids or type(stack) is not int or type(count) is not int or count < 0:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 对整 shard 的 ids 列表逐行 membership 会退化为 O(N²)

ids 是 events() 按 shard 汇总后经 _ensure_frames 传入的完整待加载列表,不是当前 256 条 batch。因此每条 coverage 在这里都重新线性扫描它;SQL 已经限定 eventId IN(batch)。

例如同 shard 30,000 个仍存活 allocation 共用单帧 stack,查询下一次 free_requested 后的树:group/event/coverage 加少量 frame 行约 90,200 work rows,仍在默认 100,000 行预算内,输出也很小;但这里额外产生约 30,000 × 30,001 / 2 = 450,015,000 次位置检查。旧 v1 路径检查的是 sources 字典,没有这项二次复杂度。

建议删除 SQL 已保证的冗余 membership,或预建 set,并补大量同时存活 allocation 的回归。以上是静态复杂度推导,未做耗时 benchmark。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 39d0793 删除冗余的 event not in ids 检查,依赖现有 SQL eventId IN(batch) 限定结果,消除每条 coverage 对完整 allocation 列表的线性扫描。新增真实 SQLite 的 30,000 事件共享栈回归:禁止触发 ids 的 membership 操作,并验证按 256 条分批、共 2 * ceil(30000 / 256) 次读取及完整结果。回归通过;未将其表述为耗时 benchmark。

refs = sources.events(cast(int, r["id"]) for r in selected)
detailed = (
sources.dataset.ordered_frames_version == 1 or cast(int, params["stack_bytes"]) >= 0
sources.dataset.ordered_frames_version in (1, 2)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 新 v2 默认事件字段需要同步 clean-wheel comparator

新 native/compatible 导出都声明 frame extension v2,因此这里会让默认 event 结果进入 detailed 分支,附加 source_stack_id、frames 等七个字段。但 clean_wheel_agent_acceptance.py:354–364 仍要求跨 shard 与 standalone 的整个 rows 完全相等;standalone event 模板 在默认 stack_bytes=-1 时没有这些字段。

所以现有 --events-per-slice 4096 双 shard wheel 验收走到这里会报 Cross-shard real events differ from standalone,即使事件数值完全正确。建议按明确的共同稳定字段比较,另行验证 dataset frame evidence,补穿透双 shard 比较器的测试,不要删除产品新增元数据。

这是静态契约确认;该 head 的 wheel 步骤目前被前面的 UT 失败短路,不能把它描述为已运行的 wheel 失败。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 39d0793 同步 comparator:逐项比较 9 个共同事件字段,另外验证 dataset 的 ordered 状态、帧字段类型及其格式化文本与共同 callstack 一致,保留产品新增元数据。新增真实双分片 CLI 穿透测试,以及数值改变、字段缺失、证据缺失和帧文本不符的拒绝用例,均通过。实际构建 wheel 后在隔离依赖环境执行 --events-per-slice 4096 验收也已通过:native 和 compatibility-v1 均为两个物理分片,跨分片事件与 standalone 峰值一致;未运行 GUI 或 live agent。

# A self-consistent seal is not proof of semantic validity.
# Use shared P0 without repeating the resolver's seal scan.
validate_dataset(target)
self._recheck_source(options.snapshot_file, source_hash)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 删除完整校验后,interop 验收仍保留相反的旧断言

这里切到 lightweight compatible reuse 后,test_interop_acceptance.py:170–177 仍要求修改 block.size 后抛出 ImportExecutionError;但本 PR 的文档及新增 lightweight 测试明确允许这种修改后的 reuse。最新 exact-head Python 3.13 CI 已在该断言报 DID NOT RAISE,其他 Python 版本、macOS 和 Windows shard 1 也受此阻塞。

请同步 acceptance 的预期:内容编辑后可 reuse,且已有字节不被覆盖;missing member/schema/endpoint 等仍应拒绝并验证目标保留。这是测试契约未同步造成的实际 CI blocker,不是把已经明确选择的 lightweight 策略误判为意外产品回归。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 39d0793 更新旧 interop 断言以符合 lightweight reuse 契约:修改 block.size 后允许复用,并验证修改后的已有文件字节完全保留;随后删除必需的 block_0 表,验证结构损坏仍抛出 ImportExecutionError,且不替换已有产物。对应回归已通过,未恢复数据库内容扫描或强校验。

@codeasier codeasier left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

基于当前 head 39d0793db3b79d514f55f258b6331bac143050af 重新检视,补充 2 条 P2 行内意见:帧树排队时间未计入一次调用的 timeout,以及 v3 联动升级后仍指向旧 v2 消费者的公开兼容入口。

旧 da53b58 审查中的四个具体问题已有相应代码修复,不再按原问题重复报告:

  • 可选帧在任何插入前按归一化 JSON 和共享深度约束预检,超深证据整栈省略。
  • 移除了 coverage 每行对完整 allocation ID 列表的 membership 扫描;SQL 的分批 IN 已限制事件,原 O(N²) 问题已消除。没有将这项静态结论表述为耗时 benchmark。
  • clean-wheel 不再要求 dataset 与 standalone 整个 row 字典相同,新增字段不再触发旧比较错误。
  • interop 已改为内容编辑可复用且保留字节,必要表损坏仍拒绝。

本轮检查了 writer/reader 的帧约束、跨分片来源与聚合、取消及工作线程连接所有权、导入与缓存准入/no-replace/receipt 路径,并进行了独立交叉检视。#273 已关闭并保留分支,其额外回归覆盖已在关闭说明列出;未把这些覆盖差异自动升级为产品缺陷。

验收状态与上述代码/文档问题分开:当前实际 main 为 81af669,本 PR 仍有合并冲突;当前 head 在本仓及作者 fork 均未发现 Actions/check runs,作者报告的本地测试和 wheel 结果不能替代最终合并基线的 CI。Insight 联动 v3 的说明已读,但尚无可核对的固定配套 consumer revision/构建及新版 GUI 复用证据。后续需要整合 main、修复问题后重新审查最终提交,并完成普通 CI、适用的 installed-wheel/200-seed differential 和联动消费者验收。本轮未运行本地 UT、build、benchmark 或 GUI。

Comment thread src/pt_snap_cli/core/query_service.py Outdated
Comment on lines +274 to +275
with self._frame_tree_queries.run() as cancelled:
budget = _budget if _budget is not None else self._new_budget(timeout_s, query_limits)

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 在进入帧树队列前建立本次调用的 deadline

LatestQuery.run() 会先在 工作锁 上等待,取得锁后才执行这里的 _new_budget();其 started 此时才取 time.monotonic()。公开 SnapshotAnalyzer.execute_query() 也没有预先传入 _budget。因此,同一实例的旧请求若仍在不能立即响应取消的步骤(例如 standalone Context 的 SQLite schema 读取/锁等待),一个指定短 timeout_s 的新请求可以先排队超过该时限,再从零计时并成功返回。这违反一次 execute_query 调用的 wall-clock budget,不是仅取消检查的采样延迟。

建议在进入 run() 前创建/保留预算,并在获锁后检查剩余时间,避免把排队时间清零;若还要保证等待阶段及时返回,再使用受同一 deadline 限制的锁等待。可用同步事件与受控时钟补排队超时回归,断言过期的新请求不继续执行。此结论来自静态调用链,未运行复现测试。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 7bed620 修复。帧树调用在进入 latest-request 队列前创建预算(或保留传入的既有预算),工作锁等待使用同一预算的剩余时间,等待期间检查超时及取消,取得锁后再次检查 deadline。过期请求不会启动查询 worker,也不必等待旧任务释放锁才返回。

新增受控时钟与同步锁回归,分别覆盖新建预算/传入预算:模拟排队 5 秒、timeout_s=1,断言旧任务仍持锁时新请求已抛出 QueryTimeoutError,且未执行 worker;另测获锁瞬间过期后释放锁并允许后续调用。相关查询、CLI/API 契约、生命周期及文档治理共 149 项测试通过,fixture 校验 7 项通过;Ruff、Black 和 basedpyright(0 errors)通过。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已对固定提交 7bed6208b6dfb72eb0e7ead89dc3d7e15e5cfa6c 做增量静态复审及独立交叉检查,确认本线程的排队超时 P2 已修复:query_service.py:274–275 在入队前创建或复用原预算;latest_query.py:32–40 在有界获锁循环及成功获锁后检查原 deadline/取消,过期请求不会启动 worker,异常路径会释放已取得的锁并清理自身 token。新增测试覆盖新建/传入预算、持锁期间超时及获锁瞬间过期后的恢复。

本轮未执行测试或构建,作者报告的 149 项测试及 7 项 provenance 检查未独立复跑,不能作为当前 head 的 CI 通过证明。发布前核验 head 未变;它与当前 main(81af6698)仍有冲突,当前 head 在两仓均无 Actions run,仍需整合后完成精确最终提交的 CI。

Comment on lines +28 to +30
The pinned historical acceptance below used `mem_snapshot_parser_v2`. Current
exports use `mem_snapshot_parser_v3`; the historical GUI result does not verify
the new parser version. Re-export v2 caches to a new output directory for v3 reuse.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 将 v3 联动目标与旧 v2 的 GUI 操作入口明确分开

这段正确说明历史结果不验证 v3,但本页 L7 仍写唯一目标是 101f65b,后续步骤仍要求使用该历史 GUI 构建;协议指南 L489–494 和 quickstart 也继续承诺这个入口。固定 101f65b 的 parser 使用 v2 salt,hash 不匹配会进入重新解析,并删除旧 manifest/log 后启动 producer(固定源码,L43、L189–202、L243–265)。按当前整段说明把新 v3 产物交给这个旧消费者,不是简单的“尚未验收”,而是不能复用且可能改写缓存。

这里不要求回退已说明的 v3 联动方向。请将 101f65b/targetRevision 明确标为历史 schema/身份参考,并给出配套 v3 consumer 的固定 revision 与匹配 hash/member 语义;在其建立和验收前不要继续承诺旧入口支持新导出。中英文同步说明使用独立可信 pickle 副本与相邻新缓存验收,避免旧 GUI 接触唯一产物。

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已在 7bed620 同步中英文 README、quickstart、协议指南和互操作验收文档。保留 parser v3,将 101f65b 和 targetRevision 明确标为历史 v2 schema/身份参考,旧 GUI 操作步骤单列为历史流程,不再承诺它支持当前 v3 导出;同时说明旧 GUI 可能重新解析并改写缓存。

目前尚无已核验的配套 v3 consumer 固定 revision/build,文档如实标记未建立该证据,未编造版本或宣称 GUI 复用通过。新增当前 v3 验收要求:消费端匹配 v3 salted cacheHash 和空 member 值的结构清单语义,固定消费端 revision/build,并使用独立可信 pickle 副本与新建邻接缓存,验证实际复用及无意外修改后再宣称支持。文档治理 27 项测试通过;本次未运行 GUI,也未修改 Insight 仓。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已对固定提交 7bed6208b6dfb72eb0e7ead89dc3d7e15e5cfa6c 的中英文 README、quickstart、协议和验收说明做静态复审及独立交叉检查。原 P2 的旧 v2 GUI 支持承诺已修正:101f65b/targetRevision 已明确为历史 schema/身份参考,旧 GUI 重解析改写风险及独立可信副本、新邻接缓存的验收要求均已写明,不再把历史验收当作 v3 证明。

当前仍缺已核验的配套 v3 consumer 固定 revision/build 和实际 GUI 复用证据;消费端需同时匹配 v3 salted cacheHash 与空 member 值的结构清单语义。本轮未运行 GUI或测试,也未据此确认联合兼容。

另有一项低优先级文档清理,不维持或新增上述 P2:英文 quickstart:144–146 / 中文:118–119 仍称全部成员哈希必须匹配。现行 snapshot_cache.py:248–268 只比较成员清单的键,不比较摘要值;结构合法的内容变更可被复用。建议把这两处改为源身份、成员清单和结构检查,并说明不保证发现任意行内容修改,与协议页一致。

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已静态复审并独立交叉核对 1cab969ef6fb958ac11518df2b04074b8019cbed:该提交仅修改中英文 quickstart/database 四份文档,运行时和测试未变。此前非阻塞的成员哈希表述已修正为成员清单及结构检查,明确不比较摘要值、不保证发现任意内容编辑,metadata/复用成功不代表内容完整性;与现行实现一致。本次增量未发现新的实质问题。

本轮未运行测试、构建或 GUI。当前 head 仍与 main 有冲突且无 CI 运行;配套 v3 consumer 固定 revision/build 与实际 GUI 复用验收仍待补齐,文档修正不替代这些验收。

@codeasier codeasier left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已复审固定提交 54806d1275a172b7800756d60b309070cc6da88e 并完成独立交叉检查。它以 1cab969 和实际 main 的 81af669 为双亲,main 已是祖先,GitHub 当前确认为无文本冲突。四份 README/quickstart 冲突文件完整保留主线内容并加入 v3/轻量复用说明;此前排队 deadline、O(N²)、optional-depth 及文档修复均保留。主线测试工作流、十项独立覆盖门槛和 checkpoint 修复也保留。

仍有一项测试集成缺陷,见行内意见:Test 的 Python 3.10–3.13 和 Platform compatibility 的 Windows 四分片/macOS 共九个失败 job,均在收集 test_critical_coverage_cache.py 时因导入不存在的 member_digest 中止。不是九个独立平台故障;覆盖门槛、wheel 构建及 clean-wheel 验收尚未执行。lint、provenance 和独立 browser job 成功,installed-wheel dataset 专项 skipped,均不能替代未完成门槛。

本轮未本地运行测试、构建或 GUI。配套 v3 consumer 固定 revision/build 与真实 GUI 复用证据仍未补齐;作者定向测试自述不作为远端 CI 或 GUI 验收。除上述集成问题,本次同步增量未发现新的实质问题。

Comment on lines +100 to 104
def validate_member_structure(
path: Path, device: str, start: int, end: int, *, budget: ValidationBudget | None = None
) -> str:
"""Hash fixed base columns; consumer columns, tables, indexes, views and triggers are allowed."""
if re.fullmatch(r"0|[1-9][0-9]*", str(device)) is None:
raise ValueError("Invalid device ID")
digest = hashlib.sha256()
encoder = _RowEncoder()
# Consumers may start writing after the sidecar check. Always use SQLite's
# locking/WAL protocol and one read snapshot, even for a currently closed DB.
) -> None:
"""Check required schema and indexed endpoints, without scanning rows/pages."""
sidecars = [Path(str(path) + suffix) for suffix in ("-wal", "-shm", "-journal")]

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 同步主线新增测试对已删除 helper 的引用

这里用结构验证替代 member_digest 后,新合入的 test_critical_coverage_cache.py:14–15 仍静态导入旧名称,236–242 行仍调用它。最新 Test/Platform 的九个测试 job 都因此在 collection 阶段抛出 ImportError,全套断言和后续覆盖/打包门槛无法执行。

请把该回归迁移到当前结构验证/manifest 入口,并保留“非法 device 在数据库访问前拒绝”及产物不变断言。不要只机械改名:validate_member_structure 本身没有原来的 device 预检查,目前该检查由 parser_members 承担。无需恢复内容摘要扫描,也不应删除该测试或降低主线门槛。修复后需在最终提交重新完成普通 CI。

@codeasier
codeasier merged commit d5adcd4 into codeasier:main Nov 4, 2026
13 checks passed
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