Skip to content

fix: resolve batched cross-shard event attribution (#203) - #214

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

codeasier wants to merge 1 commit into
fix/issue-202-chain-67e26f4from
fix/issue-203-chain-67e26f4

Conversation

@codeasier

Copy link
Copy Markdown
Owner

📝 Description

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

  • Batched cross-shard sources: DatasetSourceResolver batches up to 256 distinct IDs by owner with EventSource; shared diminishing QueryBudget; filesystem hash/validation time is charged but not hard-preempted.
  • Canonical full-stack identity: FULL text and recognized ordered raw JSON arrays identify stacks; local IDs/slices/text_kind provenance; order/duplicates/types preserved; a captured nonempty display is preferred.
  • Reader-only ordered-frames extension: extensions.ptSnapOrderedFrames.version=1 with pt_snap_frame_coverage(eventId, frameCount) and pt_snap_frame(eventId, frameIndex, frameJson); finite JSON/depth/schema/count/index guards; invalid/unknown/uncovered degrade to text-only; no emitter; default P0 structured_frames=False.

Commits in this PR:

19 files changed, 1705 insertions(+), 37 deletions(-):

README.md
README_zh.md
docs/en/querying.md
docs/en/quickstart.md
docs/en/sharded-snapshotdb.md
docs/zh/querying.md
docs/zh/quickstart.md
docs/zh/sharded-snapshotdb.md
src/pt_snap_cli/core/dataset_attribution.py
src/pt_snap_cli/core/dataset_resolver.py
src/pt_snap_cli/core/dataset_sources.py
src/pt_snap_cli/core/models.py
src/pt_snap_cli/core/query_service.py
src/pt_snap_cli/core/report_service.py
src/pt_snap_cli/query/templates/basic/event.yaml
src/pt_snap_cli/query/templates/business/active_memory_callstack_at_event.yaml
src/pt_snap_cli/query/templates/statistical/active_blocks_at_event.yaml
tests/core/test_dataset_attribution.py
tests/test_contract_cli_api.py

🔗 Related Issue

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

Review comment: #203 (comment)

🧪 Testing

  • Tests added/updated
  • Manual testing completed

Real cross-shard source/attribution queries and ordered-frames degradation paths exercised locally against the authentic original artifact, with unchanged hashes.

  • Owning focused run: 1038 passed.
  • Owning full suite: 1853 passed; combined line+branch coverage 92.351672% (raw line 93.900392%, raw branch 87.134779%); critical floors 91.89/90.27/85.45.
  • basedpyright 0 errors (976 informational warnings); staged governance: 32 passed; post-commit regression: 219 passed.
  • Independent parent verification: fixture provenance 7 + 338 regressions, all passed; authentic-original 13-point differential with an independent in-memory canonical reference and CLI/API/report parity.

✅ 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
    No snapshot runtime files change in this PR, so no provenance declaration is required.

📸 Screenshots (if applicable)

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

📋 Additional Notes

Head SHA: ff2392f381f405a259fbb158f914769473739e7f; branch fix/issue-203-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