Skip to content

feat: support read-only compatibility dataset focus (#200) - #211

Closed
codeasier wants to merge 1 commit into
fix/issue-199-chain-67e26f4from
fix/issue-200-chain-67e26f4
Closed

codeasier wants to merge 1 commit into
fix/issue-199-chain-67e26f4from
fix/issue-200-chain-67e26f4

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

Part of the #198–#205 dependency stack, based on fix/issue-199-chain-67e26f4 (stacked on #199). Merge in issue order; after the parent merges, retarget this PR to main.

  • Read-only compatibility dataset focus and addressing: core/dataset_resolver.py reuses the committed P0 compatibility-v1 validator; manifest/device/slice fields and real-event range routing and completion facts.
  • Pre-open safety: every declared member's canonical non-symlink path, WAL/journal/SHM sidecars (including dangling aliases) and SQLite file-header read/write versions are verified BEFORE any connection; checkpointed persistent-WAL databases are rejected even without existing sidecars (added after a real regression where mode=ro created persistent WAL/SHM sidecars).
  • Generation-aware bounded Context LRU (default 4) keyed by manifest/member content identity; analyzer closure stays terminal while an injected cache/service remains caller-owned and reusable.
  • Overview/query bounds exclude negative boundary rows; text stacks only (no structured-frame promotion); no silent cross-slice template execution; never loads source pickle or repairs external databases.

Commits in this PR:

18 files changed, 1089 insertions(+), 31 deletions(-):

README.md
README_zh.md
docs/en/sharded-snapshotdb.md
docs/zh/sharded-snapshotdb.md
src/pt_snap_cli/api.py
src/pt_snap_cli/cli.py
src/pt_snap_cli/completion.py
src/pt_snap_cli/context.py
src/pt_snap_cli/core/context_cache.py
src/pt_snap_cli/core/dataset_resolver.py
src/pt_snap_cli/core/focus_service.py
src/pt_snap_cli/core/import_metadata.py
src/pt_snap_cli/core/models.py
src/pt_snap_cli/core/overview_service.py
src/pt_snap_cli/core/query_service.py
src/pt_snap_cli/snapshot/PROVENANCE.md
tests/test_contract_cli_api.py
tests/test_dataset_focus.py

🔗 Related Issue

Refs #200 — deliberately no auto-closing keywords; the issue stays open because GUI/C++/installed-wheel acceptance is human-deferred.

Review comment: #200 (comment)

🧪 Testing

  • Tests added/updated
  • Manual testing completed

Real read-only focus resolution, overview/query bounds and pre-open rejection paths exercised locally, including the persistent-WAL probe that produced the correction.

  • Owning focused run: 365 passed.
  • Owning full suite: 1636 passed in 86.17s; coverage with branches enabled 92.26%; critical files 92%/90%/85%.
  • basedpyright 0 errors (836 informational warnings); staged governance: 27 passed.
  • Independent parent verification: fixture provenance 7 + dataset contract/focus/CLI-API/governance 204, all passed.

✅ Checklist

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

"No new warnings" keeps the pre-existing external pytest-asyncio startup deprecation and existing informational type warnings unchanged rather than hidden; ResourceWarning / PytestUnraisableExceptionWarning remain errors.

Snapshot Runtime Provenance

  • Snapshot provenance evaluation completed when snapshot runtime files change
    Snapshot provenance decision: updated
    Provenance entries are append-only; this PR adds its entry to src/pt_snap_cli/snapshot/PROVENANCE.md.

📸 Screenshots (if applicable)

Not applicable — no user-interface or C++ changes in this PR.

📋 Additional Notes

Head SHA: c7ad0fefcd37bcec3e5947d0ac6e0bf971d21d97; branch fix/issue-200-chain-67e26f4. All checks above were recorded locally on this exact head; the C++/GUI consumer and installed-wheel profile remain untested and unclaimed.

@codeasier

Copy link
Copy Markdown
Owner Author

Superseded by #216 — the complete #198–#205 chain (including this PR’s commits) was merged into main via #216 (rebase merge) after retargeting. This PR stays as the per-issue review record; the linked issue remains open pending the human-deferred GUI acceptance.

@codeasier codeasier closed this Oct 6, 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.

1 participant