An off-chain append with no hook in between would shift Pi live positions

Open
#2,014 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
backend

Research direction

Read packages/pi-extension/index.js:138-165, especially the parent-chain walk in capture(), and inspect the pi_tui_cli_capture step 5 live-versus-backfill position comparison. First verify on a real Pi client whether an off-chain append can occur without the listed hooks firing; done means the comparison shows matching positions across navigation and compaction, or a real trace demonstrates the uncovered case.

Written by the indexing model from the issue text.

Description

Source: #1874 at 5ab56bcaa3e41a8fcb6a095eb83e9b6d76c3f38e
Location: packages/pi-extension/index.js:138-165
Severity: minor

Evidence

The parent-chain walk in capture() counts only ancestors of the new head, so an entry appended off the current chain is never counted by appended(), shifting later positions by the same mechanism as finding 17. The stronger form of this claim, that ordinary branch navigation breaks, was probed and rejected in round 2: with session_before_tree and session_tree firing, live and recovery agree because checkpoint() resyncs by delivering the appended tail.

Why deferral is safe

The shift requires Pi to append off-chain while firing none of turn_end, agent_end, agent_settled, session_compact, session_before_tree, or session_tree, and there is no evidence it ever does. That is a speculative risk about undocumented client behavior, not an observed defect, and the same acceptance-gate step 5 live-vs-backfill position comparison covers it on a real client. Confirmed the walk is unchanged at head 5ab56bca.

Acceptance condition

The pi_tui_cli_capture step 5 comparison on a real Pi shows live and backfill positions agree across navigation and compaction; if a real client ever demonstrates an uncovered off-chain append, promote this to a defect with that trace.

Review preference; backlog only. A human may explicitly delegate it with neutral:fix.

Dominant language
JavaScript
Stars
11
Forks
0
Avg merge
2h 55m
Merged PRs (30d)
294

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from hyparam/hypaware

All issues in hyparam/hypaware

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.