Skip to content

fix(types): check snapshot runtime at the basedpyright error gate - #155

Merged
codeasier merged 2 commits into
mainfrom
feat/issue-122-snapshot-types
Sep 23, 2026
Merged

codeasier merged 2 commits into
mainfrom
feat/issue-122-snapshot-types

Conversation

@codeasier

@codeasier codeasier commented Sep 19, 2026 •

Copy link
Copy Markdown
Owner

📝 Description

Complete issue 122 phase 3: annotate the first-party snapshot runtime so the snapshot-only basedpyright executionEnvironments downgrade list can be removed. Phases 1–2 already landed in #130. Replay, import, and split behavior is unchanged.

Removed downgrades: reportMissingTypeArgument, reportAssignmentType, reportAttributeAccessIssue, reportUninitializedInstanceVariable, reportArgumentType, reportIndexIssue, reportImportCycles.

🔗 Related Issue

Fixes #122

Related to the Agent-friendly parent roadmap (issue 136) only. This slice must not auto-close that parent.

🧪 Testing

  • Tests added/updated
  • python -m basedpyright --pythonpath "$(python -c 'import sys; print(sys.executable)')" — 0 errors
  • PYTHONPATH=src pytest tests/test_fixture_provenance.py tests/snapshot/ tests/test_governance.py — 228 passed, 1 xfailed
  • ruff check and black --check on touched Python paths
  • Full pytest suite
  • Manual testing completed

✅ Checklist

  • Code follows project guidelines
  • Documentation updated (if applicable)
  • No new warnings introduced
  • Changes tested locally

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed when snapshot runtime files change
    Snapshot provenance decision: updated

📋 Additional Notes

  • Also edits CHANGELOG.md under [0.5.0]. Parallel with the sibling-database skill PR; rebase the later merge on that file.

Phase 3 of #122 tightens first-party snapshot annotations so the
snapshot-only executionEnvironments downgrade list can be removed
instead of widened. Replay, import, and split behavior is unchanged.

Fixes #122

@codeasier codeasier left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Cross-Review 结果(3 位独立审阅者,quorum 2,父会话仲裁)

审阅者:volceapi/qwen3.8-flash、opencode-go/deepseek-v4.1-flash、opencode-go/muse-spark-1.3-contributor,针对 PR head 快照独立评审后由仲裁会话逐条验证。

发现(已验证)

  1. [高 · CI 阻断] src/pt_snap_cli/snapshot/PROVENANCE.md:189 改写了既有行(append-only 违规),provenance 守卫实跑 exit 1,详见行内评论。修复:恢复该行为 base 原文,仅保留新增条目。
  2. [低 · 文档] CHANGELOG 新条目落在 [0.5.0] 段而 PR 描述写的是 [0.4.0],见行内评论。

已独立复现的非问题

  • basedpyright 实测 0 errors / 831 warnings(failOnWarnings=false,与 PR 声明一致)。
  • 聚焦测试实测 228 passed, 1 xfailed(tests/snapshot/ tests/test_governance.py tests/test_fixture_provenance.py)。
  • DeviceSnapshot.__init__(原为无 __init__ 的普通类,调用点均为无参构造后赋属性)、_format_frame 逐元素分发、int | None 字段(读取方均 None-aware)、cast(int, getattr(event, "device", 0))、import-cycle 直连导入(无残留 snapshot_lookup./snapshot_mutator. 引用)、SliceDumpHooker.dump 的 RuntimeError 守卫(正常回放流先经 pre_undo_event 置 prev_segments)——均无行为回归。

遗留测试缺口(不阻断)

  • Full pytest 套件与 manual testing 在 PR 描述中未勾选。
  • 混合 Frame/dict 帧列表、build_from_event 携带 device 属性分支缺一行式用例。

结论:变更本体健全;仅发现 1 必须修复(PROVENANCE.md:189 恢复原文),否则 snapshot-provenance CI 必失败。

Comment thread src/pt_snap_cli/snapshot/PROVENANCE.md Resolved
Comment thread CHANGELOG.md Resolved
The snapshot-provenance guard rejects rewritten existing lines; this
puts the accidental extra spaces back so the 2026-09-19 entry is the
only insertion.
@codeasier
codeasier merged commit cd21018 into main Sep 23, 2026
6 checks passed
@codeasier
codeasier deleted the feat/issue-122-snapshot-types branch September 23, 2026 14:27
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.

[FEATURE] 将 basedpyright 检查范围从 cli.py 扩展到 core/、query/、snapshot/(当前 88 个错误未被 CI 覆盖)

1 participant