pi-odd-worktree 3.9.2 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +63 -40
  2. package/extensions/odd-worktree-tools.ts +859 -12
  3. package/lib/gh-issues.js +65 -10
  4. package/lib/gh-prs.js +2011 -0
  5. package/lib/issue-preview.js +70 -4
  6. package/lib/issues-cache-store.js +4 -1
  7. package/lib/issues-section.js +346 -23
  8. package/lib/issues-view.js +116 -5
  9. package/lib/pr-preview.js +353 -0
  10. package/lib/prs-rail-store.js +317 -0
  11. package/lib/prs-view.js +2896 -0
  12. package/package.json +1 -1
  13. package/tools/files-bridge.test.js +2 -2
  14. package/tools/files-command.test.js +1 -1
  15. package/tools/fixtures/gh-pr-connection-page.json +84 -0
  16. package/tools/fixtures/gh-pr-metadata.json +29 -0
  17. package/tools/fixtures/gh-pr-rail.json +61 -0
  18. package/tools/fixtures/gh-pr-search-page.json +82 -0
  19. package/tools/fixtures/gh-pr-view.json +159 -0
  20. package/tools/gh-issues.test.js +4 -2
  21. package/tools/gh-prs.test.js +1828 -0
  22. package/tools/issue-preview.test.js +119 -0
  23. package/tools/issues-cache-store.test.js +2 -2
  24. package/tools/issues-command.test.js +10 -3
  25. package/tools/issues-open-guard.test.js +15 -0
  26. package/tools/issues-section.test.js +618 -9
  27. package/tools/issues-view.test.js +297 -0
  28. package/tools/package-surface.test.js +18 -4
  29. package/tools/pr-preview.test.js +281 -0
  30. package/tools/prs-command.test.js +1280 -0
  31. package/tools/prs-rail-store.test.js +343 -0
  32. package/tools/prs-t10-safety.test.js +326 -0
  33. package/tools/prs-t12-safety.test.js +348 -0
  34. package/tools/prs-t13-independent.test.js +378 -0
  35. package/tools/prs-t14-safety.test.js +340 -0
  36. package/tools/prs-t15-independent.test.js +259 -0
  37. package/tools/prs-t18-safety.test.js +217 -0
  38. package/tools/prs-t7-safety.test.js +127 -0
  39. package/tools/prs-view.test.js +1462 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-odd-worktree",
3
- "version": "3.9.2",
3
+ "version": "3.10.0",
4
4
  "description": "Pi package for odd-worktree: the Git worktree tools a Pi session uses (create and list the checkouts the agent works in), the /warp worktree panel, the /odd ODD viewer, and the /issues GitHub issue reader. Needs only Pi and git: no companion app, no extra service.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -433,8 +433,8 @@ test('S18/S19 (T14): the ready announcement registers the whole surface, exactly
433
433
  const bridge = installBridge();
434
434
  for (const entry of ready) entry.handler();
435
435
 
436
- assert.deepEqual([...loaded.commands.keys()].sort(), ['files', 'issues', 'odd', 'warp'],
437
- 'the four commands arrive with the bridge');
436
+ assert.deepEqual([...loaded.commands.keys()].sort(), ['files', 'issues', 'odd', 'prs', 'warp'],
437
+ 'the five commands arrive with the bridge');
438
438
  assert.deepEqual([...loaded.tools.keys()].sort(), ['worktree_create', 'worktree_list'], 'the two tools');
439
439
  assert.deepEqual([...loaded.messageRenderers.keys()], ['worktree-warp'], 'the message renderer');
440
440
  assert.deepEqual([...loaded.entryRenderers.keys()].sort(), ['odd-worktree-issues-refusal', 'odd-worktree-warp-queue'],
@@ -253,7 +253,7 @@ const agentStub = {
253
253
  describe('/files registration (S17)', () => {
254
254
  test('the file picker is registered beside the other three panels', async () => {
255
255
  const { commands } = await loadExtension({});
256
- assert.deepEqual([...commands.keys()].sort(), ['files', 'issues', 'odd', 'warp']);
256
+ assert.deepEqual([...commands.keys()].sort(), ['files', 'issues', 'odd', 'prs', 'warp']);
257
257
  const files = commands.get('files');
258
258
  assert.equal(typeof files.handler, 'function', 'the command carries its handler');
259
259
  assert.ok(files.description.includes('files'), 'the description says what it browses');
@@ -0,0 +1,84 @@
1
+ {
2
+ "data": {
3
+ "repository": {
4
+ "pullRequests": {
5
+ "totalCount": 2,
6
+ "pageInfo": {
7
+ "hasNextPage": false,
8
+ "endCursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xOVQwODowMDowMFo"
9
+ },
10
+ "edges": [
11
+ {
12
+ "cursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xOVQwODowMDowMFo",
13
+ "node": {
14
+ "number": 87,
15
+ "title": "feat: the prs panel",
16
+ "state": "OPEN",
17
+ "isDraft": false,
18
+ "url": "https://github.com/jonasotoaguilar/herdr-gentle-shell/pull/87",
19
+ "createdAt": "2026-10-18T04:21:27Z",
20
+ "updatedAt": "2026-10-19T08:00:00Z",
21
+ "author": {
22
+ "login": "jonasotoaguilar"
23
+ },
24
+ "labels": {
25
+ "nodes": [
26
+ {
27
+ "name": "enhancement",
28
+ "color": "a2eeef",
29
+ "description": "New feature or request"
30
+ }
31
+ ]
32
+ },
33
+ "assignees": {
34
+ "nodes": [
35
+ {
36
+ "login": "octocat"
37
+ }
38
+ ]
39
+ },
40
+ "comments": {
41
+ "totalCount": 2
42
+ },
43
+ "reactionGroups": [
44
+ {
45
+ "content": "HEART",
46
+ "users": {
47
+ "totalCount": 3
48
+ }
49
+ }
50
+ ],
51
+ "reviewDecision": "REVIEW_REQUIRED"
52
+ }
53
+ },
54
+ {
55
+ "cursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xN1QwOTowMDowMFo",
56
+ "node": {
57
+ "number": 86,
58
+ "title": "fix: the rail count",
59
+ "state": "OPEN",
60
+ "isDraft": true,
61
+ "url": "https://github.com/jonasotoaguilar/herdr-gentle-shell/pull/86",
62
+ "createdAt": "2026-10-17T09:00:00Z",
63
+ "updatedAt": "2026-10-17T09:30:00Z",
64
+ "author": {
65
+ "login": "jonasotoaguilar"
66
+ },
67
+ "labels": {
68
+ "nodes": []
69
+ },
70
+ "assignees": {
71
+ "nodes": []
72
+ },
73
+ "comments": {
74
+ "totalCount": 0
75
+ },
76
+ "reactionGroups": [],
77
+ "reviewDecision": ""
78
+ }
79
+ }
80
+ ]
81
+ }
82
+ }
83
+ }
84
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "data": {
3
+ "repository": {
4
+ "viewerPermission": "WRITE",
5
+ "mergeCommitAllowed": true,
6
+ "squashMergeAllowed": true,
7
+ "rebaseMergeAllowed": false,
8
+ "pullRequest": {
9
+ "isDraft": false,
10
+ "closingIssuesReferences": {
11
+ "nodes": [
12
+ {
13
+ "number": 63
14
+ },
15
+ {
16
+ "number": 14
17
+ },
18
+ {
19
+ "number": 63
20
+ }
21
+ ],
22
+ "pageInfo": {
23
+ "hasNextPage": false
24
+ }
25
+ }
26
+ }
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "data": {
3
+ "mine": {
4
+ "issueCount": 3,
5
+ "nodes": [
6
+ {
7
+ "number": 87,
8
+ "closingIssuesReferences": {
9
+ "nodes": [
10
+ {
11
+ "number": 14
12
+ },
13
+ {
14
+ "number": 63
15
+ }
16
+ ],
17
+ "pageInfo": {
18
+ "hasNextPage": false
19
+ }
20
+ }
21
+ },
22
+ {
23
+ "number": 86,
24
+ "closingIssuesReferences": {
25
+ "nodes": [],
26
+ "pageInfo": {
27
+ "hasNextPage": false
28
+ }
29
+ }
30
+ },
31
+ {
32
+ "number": 85,
33
+ "closingIssuesReferences": {
34
+ "nodes": [
35
+ {
36
+ "number": 70
37
+ }
38
+ ],
39
+ "pageInfo": {
40
+ "hasNextPage": false
41
+ }
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ "review": {
47
+ "issueCount": 1,
48
+ "nodes": [
49
+ {
50
+ "number": 86,
51
+ "closingIssuesReferences": {
52
+ "nodes": [],
53
+ "pageInfo": {
54
+ "hasNextPage": false
55
+ }
56
+ }
57
+ }
58
+ ]
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,82 @@
1
+ {
2
+ "data": {
3
+ "search": {
4
+ "issueCount": 2,
5
+ "pageInfo": {
6
+ "hasNextPage": false,
7
+ "endCursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xOVQwODowMDowMFo"
8
+ },
9
+ "edges": [
10
+ {
11
+ "cursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xOVQwODowMDowMFo",
12
+ "node": {
13
+ "number": 87,
14
+ "title": "feat: the prs panel",
15
+ "state": "OPEN",
16
+ "isDraft": false,
17
+ "url": "https://github.com/jonasotoaguilar/herdr-gentle-shell/pull/87",
18
+ "createdAt": "2026-10-18T04:21:27Z",
19
+ "updatedAt": "2026-10-19T08:00:00Z",
20
+ "author": {
21
+ "login": "jonasotoaguilar"
22
+ },
23
+ "labels": {
24
+ "nodes": [
25
+ {
26
+ "name": "enhancement",
27
+ "color": "a2eeef",
28
+ "description": "New feature or request"
29
+ }
30
+ ]
31
+ },
32
+ "assignees": {
33
+ "nodes": [
34
+ {
35
+ "login": "octocat"
36
+ }
37
+ ]
38
+ },
39
+ "comments": {
40
+ "totalCount": 2
41
+ },
42
+ "reactionGroups": [
43
+ {
44
+ "content": "HEART",
45
+ "users": {
46
+ "totalCount": 3
47
+ }
48
+ }
49
+ ],
50
+ "reviewDecision": "REVIEW_REQUIRED"
51
+ }
52
+ },
53
+ {
54
+ "cursor": "Y3Vyc29yOnYyOpK5MjAyNi0xMC0xN1QwOTowMDowMFo",
55
+ "node": {
56
+ "number": 86,
57
+ "title": "fix: the rail count",
58
+ "state": "OPEN",
59
+ "isDraft": true,
60
+ "url": "https://github.com/jonasotoaguilar/herdr-gentle-shell/pull/86",
61
+ "createdAt": "2026-10-17T09:00:00Z",
62
+ "updatedAt": "2026-10-17T09:30:00Z",
63
+ "author": {
64
+ "login": "jonasotoaguilar"
65
+ },
66
+ "labels": {
67
+ "nodes": []
68
+ },
69
+ "assignees": {
70
+ "nodes": []
71
+ },
72
+ "comments": {
73
+ "totalCount": 0
74
+ },
75
+ "reactionGroups": [],
76
+ "reviewDecision": ""
77
+ }
78
+ }
79
+ ]
80
+ }
81
+ }
82
+ }
@@ -0,0 +1,159 @@
1
+ {
2
+ "number": 87,
3
+ "title": "feat: the prs panel",
4
+ "state": "OPEN",
5
+ "isDraft": false,
6
+ "author": {
7
+ "id": "U_kgDOBXYt8A",
8
+ "is_bot": false,
9
+ "login": "jonasotoaguilar",
10
+ "name": "Jonathan Soto"
11
+ },
12
+ "assignees": [
13
+ {
14
+ "id": "U_kgDOBXYt8B",
15
+ "login": "octocat",
16
+ "name": "The Octocat"
17
+ }
18
+ ],
19
+ "labels": [
20
+ {
21
+ "color": "a2eeef",
22
+ "description": "New feature or request",
23
+ "name": "enhancement"
24
+ }
25
+ ],
26
+ "createdAt": "2026-10-18T04:21:27Z",
27
+ "updatedAt": "2026-10-19T08:00:00Z",
28
+ "comments": [
29
+ {
30
+ "id": "IC_kwDOA1",
31
+ "author": {
32
+ "login": "reviewer-one"
33
+ },
34
+ "authorAssociation": "MEMBER",
35
+ "createdAt": "2026-10-18T05:00:00Z",
36
+ "body": "Looks good to me",
37
+ "reactionGroups": [
38
+ {
39
+ "content": "THUMBS_UP",
40
+ "users": {
41
+ "totalCount": 2
42
+ }
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ "id": "IC_kwDOA2",
48
+ "author": {
49
+ "login": "reviewer-two"
50
+ },
51
+ "authorAssociation": "CONTRIBUTOR",
52
+ "createdAt": "2026-10-19T06:00:00Z",
53
+ "body": "One question about the merge flow",
54
+ "reactionGroups": []
55
+ }
56
+ ],
57
+ "reactionGroups": [
58
+ {
59
+ "content": "HEART",
60
+ "users": {
61
+ "totalCount": 3
62
+ }
63
+ }
64
+ ],
65
+ "url": "https://github.com/jonasotoaguilar/herdr-gentle-shell/pull/87",
66
+ "body": "## Summary\n\nAdds the `/prs` panel.\n\nCloses #63\n\nRisk: item 1 (the merge is an irreversible effect)",
67
+ "baseRefName": "main",
68
+ "headRefName": "feat/prs-panel",
69
+ "headRepositoryOwner": {
70
+ "id": "O_kgDOA1",
71
+ "login": "jonasotoaguilar"
72
+ },
73
+ "additions": 412,
74
+ "deletions": 31,
75
+ "changedFiles": 9,
76
+ "commits": [
77
+ {
78
+ "oid": "a1b2c3d4e5f60718293a4b5c6d7e8f9012345678",
79
+ "committedDate": "2026-10-18T04:10:00Z",
80
+ "messageHeadline": "feat: scaffold the prs client"
81
+ },
82
+ {
83
+ "oid": "b2c3d4e5f60718293a4b5c6d7e8f90123456789",
84
+ "committedDate": "2026-10-19T07:30:00Z",
85
+ "messageHeadline": "test: pin the merge argv"
86
+ }
87
+ ],
88
+ "reviewDecision": "REVIEW_REQUIRED",
89
+ "reviewRequests": [
90
+ {
91
+ "requestedReviewer": {
92
+ "__typename": "User",
93
+ "login": "reviewer-two"
94
+ }
95
+ },
96
+ {
97
+ "requestedReviewer": {
98
+ "__typename": "Team",
99
+ "name": "core"
100
+ }
101
+ }
102
+ ],
103
+ "latestReviews": [
104
+ {
105
+ "author": {
106
+ "login": "reviewer-one"
107
+ },
108
+ "state": "APPROVED",
109
+ "submittedAt": "2026-10-19T06:30:00Z"
110
+ }
111
+ ],
112
+ "statusCheckRollup": [
113
+ {
114
+ "__typename": "CheckRun",
115
+ "name": "build",
116
+ "status": "COMPLETED",
117
+ "conclusion": "FAILURE"
118
+ },
119
+ {
120
+ "__typename": "CheckRun",
121
+ "name": "lint",
122
+ "status": "COMPLETED",
123
+ "conclusion": "SUCCESS"
124
+ },
125
+ {
126
+ "__typename": "CheckRun",
127
+ "name": "types",
128
+ "status": "COMPLETED",
129
+ "conclusion": "SKIPPED"
130
+ },
131
+ {
132
+ "__typename": "CheckRun",
133
+ "name": "tests",
134
+ "status": "IN_PROGRESS",
135
+ "conclusion": null
136
+ },
137
+ {
138
+ "__typename": "StatusContext",
139
+ "context": "ci/coverage",
140
+ "state": "SUCCESS"
141
+ }
142
+ ],
143
+ "mergeable": "MERGEABLE",
144
+ "mergeStateStatus": "BLOCKED",
145
+ "closingIssuesReferences": [
146
+ {
147
+ "number": 63,
148
+ "title": "linked issue"
149
+ },
150
+ {
151
+ "number": 63,
152
+ "title": "the same issue twice"
153
+ },
154
+ {
155
+ "number": 14,
156
+ "title": "another linked issue"
157
+ }
158
+ ]
159
+ }
@@ -1618,8 +1618,10 @@ describe('listRelatedIssues: one combined read of the three scoped views', () =>
1618
1618
  assert.equal(/timelineItems\(first:/.test(query), false,
1619
1619
  'never the oldest window: the marker names the newest pull request (S3)');
1620
1620
  // T9 (S8): the marker is a NUMBER, so the cross-referenced source carries it.
1621
- assert.ok(query.includes('... on PullRequest { number }'),
1622
- 'the pull-request source selection asks for its number');
1621
+ // S6/D29: and the REPOSITORY it belongs to, because a linked pull request is
1622
+ // identified by both — a same-numbered one elsewhere is not this marker.
1623
+ assert.ok(query.includes('... on PullRequest { number repository { nameWithOwner } }'),
1624
+ 'the pull-request source selection asks for its number and its repository');
1623
1625
  // T10 (S9): the row the rail caches is the panel\'s seed, so it carries the
1624
1626
  // assignees the first frame shows.
1625
1627
  assert.ok(query.includes('assignees(first: 10) { nodes { login } }'),