pi-odd-worktree 2.1.0 → 3.0.1

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 (160) hide show
  1. package/README.md +54 -319
  2. package/extensions/odd-worktree-tools.ts +4182 -2539
  3. package/lib/bash-activity.js +1166 -0
  4. package/lib/bash-design.js +684 -0
  5. package/lib/bash-destructive.js +559 -0
  6. package/lib/bash-frame.js +205 -0
  7. package/lib/card-content.js +23 -0
  8. package/lib/card-style.js +175 -0
  9. package/lib/checkout-facts.js +30 -70
  10. package/lib/codegraph-card-preview.js +628 -0
  11. package/lib/codegraph-card.js +515 -0
  12. package/lib/codegraph-compaction.js +76 -0
  13. package/lib/codegraph-daemon.js +246 -0
  14. package/lib/codegraph-edit-sync.js +182 -0
  15. package/lib/codegraph-guard-target.js +337 -0
  16. package/lib/codegraph-guard.js +211 -0
  17. package/lib/codegraph-index.js +1020 -0
  18. package/lib/codegraph-lock.js +607 -0
  19. package/lib/codegraph-mcp-config.js +134 -0
  20. package/lib/codegraph-mcp.js +123 -0
  21. package/lib/codegraph-paths.js +69 -0
  22. package/lib/codegraph-prompt/explore.md +11 -0
  23. package/lib/codegraph-prompt/fix.md +6 -0
  24. package/lib/codegraph-prompt/generic.md +8 -0
  25. package/lib/codegraph-prompt/judge.md +9 -0
  26. package/lib/codegraph-prompt/orchestrator.md +17 -0
  27. package/lib/codegraph-prompt/verify.md +10 -0
  28. package/lib/codegraph-prompt/worker.md +7 -0
  29. package/lib/codegraph-role.js +55 -0
  30. package/lib/codegraph-rules.js +146 -0
  31. package/lib/codegraph-session.js +303 -383
  32. package/lib/codegraph-warmup.js +139 -0
  33. package/lib/file-card-markdown.js +141 -0
  34. package/lib/file-card-resolver.js +245 -0
  35. package/lib/file-card.js +659 -0
  36. package/lib/files-index.js +387 -0
  37. package/lib/files-insert.js +81 -0
  38. package/lib/files-orders.js +326 -0
  39. package/lib/files-picker-view.js +1421 -0
  40. package/lib/files-preview.js +338 -0
  41. package/lib/files-scope-detail.js +171 -0
  42. package/lib/files-scope-view.js +507 -0
  43. package/lib/gh-issues.js +323 -15
  44. package/lib/issue-preview.js +26 -7
  45. package/lib/issues-bash-mutation.js +206 -0
  46. package/lib/issues-cache-store.js +261 -0
  47. package/lib/issues-section.js +710 -0
  48. package/lib/issues-view.js +649 -52
  49. package/lib/odd-prompt/odd-worktrees.md +21 -0
  50. package/lib/odd-worktrees-prompt.js +10 -28
  51. package/lib/related-issues-cache.js +210 -0
  52. package/lib/shell-card.js +825 -0
  53. package/lib/skill-odd-card.js +183 -0
  54. package/lib/tui-paint.js +4 -5
  55. package/lib/warp-create-panel.js +538 -250
  56. package/lib/warp-create-picker.js +56 -9
  57. package/lib/warp-delete-confirm.js +19 -28
  58. package/lib/warp-selector-view.js +160 -82
  59. package/lib/which-command.js +90 -0
  60. package/lib/worktree-card.js +267 -897
  61. package/lib/worktree-cards.js +383 -0
  62. package/lib/worktree-create.js +287 -0
  63. package/lib/worktree-git.js +3 -3
  64. package/lib/worktree-guard.js +548 -0
  65. package/lib/worktree-hooks.js +421 -712
  66. package/lib/worktree-list.js +120 -0
  67. package/lib/worktree-registry.js +162 -879
  68. package/lib/{worktree-close-herdr.js → worktree-remove.js} +9 -11
  69. package/lib/worktree-setup-runner.js +376 -0
  70. package/lib/worktree-setup.js +140 -0
  71. package/lib/worktree-warp-busy.js +462 -85
  72. package/lib/worktree-warp-sessions.js +1 -2
  73. package/package.json +2 -2
  74. package/tools/bash-activity.test.js +1420 -0
  75. package/tools/bash-design.test.js +1093 -0
  76. package/tools/bash-destructive.test.js +139 -0
  77. package/tools/card-content.test.js +44 -0
  78. package/tools/card-style.test.js +298 -0
  79. package/tools/codegraph-card-preview.test.js +254 -0
  80. package/tools/codegraph-card.test.js +1080 -0
  81. package/tools/codegraph-compaction.test.js +378 -0
  82. package/tools/codegraph-daemon.test.js +248 -0
  83. package/tools/codegraph-edit-sync.test.js +295 -0
  84. package/tools/codegraph-guard-target.test.js +174 -0
  85. package/tools/codegraph-guard.test.js +238 -0
  86. package/tools/codegraph-index.test.js +1948 -0
  87. package/tools/codegraph-lock.test.js +932 -0
  88. package/tools/codegraph-mcp-config.test.js +181 -0
  89. package/tools/codegraph-mcp.test.js +194 -0
  90. package/tools/codegraph-paths.test.js +44 -0
  91. package/tools/codegraph-role.test.js +30 -0
  92. package/tools/codegraph-rules.test.js +250 -0
  93. package/tools/codegraph-session.test.js +660 -391
  94. package/tools/codegraph-warmup.test.js +316 -0
  95. package/tools/commands.test.js +510 -31
  96. package/tools/file-card-markdown.test.js +188 -0
  97. package/tools/file-card.test.js +1289 -0
  98. package/tools/files-bridge.test.js +575 -0
  99. package/tools/files-command.test.js +613 -0
  100. package/tools/files-index.test.js +473 -0
  101. package/tools/files-insert.test.js +139 -0
  102. package/tools/files-orders.test.js +597 -0
  103. package/tools/files-picker-view.test.js +1889 -0
  104. package/tools/files-preview.test.js +452 -0
  105. package/tools/files-scope-detail.test.js +264 -0
  106. package/tools/files-scope-view.test.js +614 -0
  107. package/tools/fixtures/card-codegraph-outputs.js +110 -0
  108. package/tools/fixtures/codegraph-cli-stub.js +16 -0
  109. package/tools/fixtures/codegraph-init-process.js +28 -0
  110. package/tools/fixtures/codegraph-lock-worker.js +117 -0
  111. package/tools/fixtures/daemon-fake.js +98 -0
  112. package/tools/fixtures/daemon-mcp-server.js +39 -0
  113. package/tools/fixtures/daemon-warmup-worker.js +12 -0
  114. package/tools/fixtures/load-extension.js +136 -3
  115. package/tools/gh-issues-feedback.test.js +31 -7
  116. package/tools/gh-issues.test.js +417 -1
  117. package/tools/issue-preview.test.js +44 -7
  118. package/tools/issues-bash-mutation.test.js +101 -0
  119. package/tools/issues-cache-store.test.js +222 -0
  120. package/tools/issues-command.test.js +1517 -67
  121. package/tools/issues-open-guard.test.js +1096 -0
  122. package/tools/issues-section.test.js +4235 -0
  123. package/tools/issues-seed-query-regression.test.js +67 -0
  124. package/tools/issues-view.test.js +1489 -60
  125. package/tools/odd-worktrees-prompt.test.js +98 -65
  126. package/tools/package-surface.test.js +431 -36
  127. package/tools/related-issues-cache.test.js +324 -0
  128. package/tools/shell-card.test.js +834 -0
  129. package/tools/skill-odd-card.test.js +200 -0
  130. package/tools/t5-session-identity.test.js +44 -22
  131. package/tools/warp-busy-guard.test.js +2565 -309
  132. package/tools/warp-create-panel.test.js +499 -74
  133. package/tools/warp-create-picker.test.js +101 -5
  134. package/tools/warp-delete-confirm.test.js +49 -15
  135. package/tools/warp-empty-session.test.js +0 -1
  136. package/tools/warp-fallback-regression.test.js +533 -0
  137. package/tools/warp-selector-view.test.js +460 -196
  138. package/tools/which-command.test.js +126 -0
  139. package/tools/worktree-card.test.js +551 -0
  140. package/tools/worktree-cards.test.js +845 -0
  141. package/tools/worktree-changes.test.js +4 -5
  142. package/tools/worktree-create.test.js +489 -0
  143. package/tools/worktree-guard.test.js +823 -0
  144. package/tools/worktree-hooks.test.js +905 -0
  145. package/tools/worktree-list.test.js +170 -0
  146. package/tools/worktree-registry.test.js +89 -230
  147. package/tools/worktree-remove-async.test.js +318 -0
  148. package/tools/worktree-setup-runner.test.js +276 -0
  149. package/tools/worktree-setup.test.js +140 -0
  150. package/tools/worktree-tools.test.js +419 -199
  151. package/lib/codegraph-commands.js +0 -165
  152. package/lib/odd-prompt/odd-worktrees.with-codegraph.md +0 -19
  153. package/lib/odd-prompt/odd-worktrees.without-codegraph.md +0 -15
  154. package/lib/worktree-model-result.js +0 -291
  155. package/tools/codegraph-commands.test.js +0 -371
  156. package/tools/herdr-free-create.test.js +0 -161
  157. package/tools/worktree-close-herdr-async.test.js +0 -204
  158. package/tools/worktree-odd-migration.test.js +0 -224
  159. package/tools/worktree-registry-cache.test.js +0 -163
  160. package/tools/worktree-registry-odd.test.js +0 -231
@@ -0,0 +1,21 @@
1
+ ## ODD worktrees
2
+
3
+ An ODD writes only in its own worktree, never in the primary checkout or on the default
4
+ branch; the feature branch lives there. Reading anywhere is fine, and a request that stays
5
+ read-only needs no worktree.
6
+
7
+ A worktree lives at `<repo-parent>/<repo-name>-worktrees/<odd>`: the directory IS the ODD
8
+ it serves. Before the ODD's first write, call `worktree_list`: if it already has a
9
+ worktree, work there; if not, create it with `worktree_create` (use `copy_changes: true`
10
+ if the pending changes of the current checkout belong to that work).
11
+
12
+ One ODD, one worktree. An ODD is one request and its follow-ups, big or small: everything
13
+ that belongs to it goes into the same ODD and worktree, and an unrelated request is another
14
+ ODD with its own worktree.
15
+
16
+ Delegate an ODD's independent units of behavior to agents in parallel, each with the
17
+ `workspace_root` of that ODD's worktree; the only limit is that two agents never edit the
18
+ same file.
19
+
20
+ After the merge, update the default branch. Then remove the worktree, keeping its branch,
21
+ unless its tree is dirty or a session is standing in it.
@@ -7,30 +7,20 @@
7
7
  // ever added after the existing text, is skipped when it is already there, and
8
8
  // reaches a primary session only — a named agent or a `GENTLE_PI_AGENTS_CHILD`
9
9
  // worker is left untouched. `ODD_WORKTREE_PROMPT=0` turns it off.
10
- //
11
- // The section has two variants: the CodeGraph sentences are present only when
12
- // the session gate says the CLI exists, so the prompt never promises a sync
13
- // that cannot happen.
14
10
 
15
11
  const fs = require('node:fs');
16
12
  const path = require('node:path');
17
13
 
18
- const { hasCodegraph } = require('./codegraph-session.js');
19
-
20
14
  // The heading is the identity of the block, so an already-injected section is
21
- // never added twice — not even when the gate answer changes mid-session and a
22
- // different variant would otherwise be appended.
15
+ // never added twice.
23
16
  const SECTION_MARKER = '## ODD worktrees';
24
17
 
25
- // The section text lives in its own Markdown files so it can be read, reviewed
26
- // and edited as prose: `lib/odd-prompt/odd-worktrees.*.md`. Two variants exist —
27
- // the CodeGraph sentences are present only when the session gate says the CLI
28
- // exists, so the prompt never promises a sync that cannot happen. A missing or
29
- // empty file falls back to the heading alone: the block still injects, never
30
- // crashes the session, and the idempotency marker still works.
18
+ // The section text lives in its own Markdown file so it can be read, reviewed
19
+ // and edited as prose: `lib/odd-prompt/odd-worktrees.md`. A missing or empty
20
+ // file falls back to the heading alone: the block still injects, never crashes
21
+ // the session, and the idempotency marker still works.
31
22
  const PROMPT_DIR = path.join(__dirname, 'odd-prompt');
32
- const WITH_FILE = path.join(PROMPT_DIR, 'odd-worktrees.with-codegraph.md');
33
- const WITHOUT_FILE = path.join(PROMPT_DIR, 'odd-worktrees.without-codegraph.md');
23
+ const PROMPT_FILE = path.join(PROMPT_DIR, 'odd-worktrees.md');
34
24
  const FALLBACK = `${SECTION_MARKER}\n\nEach ODD feature has its own worktree.`;
35
25
 
36
26
  function readPromptFile(file) {
@@ -42,9 +32,7 @@ function readPromptFile(file) {
42
32
  }
43
33
  }
44
34
 
45
- const WITH_CODEGRAPH = readPromptFile(WITH_FILE) || FALLBACK;
46
- const WITHOUT_CODEGRAPH = readPromptFile(WITHOUT_FILE) || FALLBACK;
47
-
35
+ const SECTION = readPromptFile(PROMPT_FILE) || FALLBACK;
48
36
 
49
37
  // The names a named-agent event may carry. `agent` itself is listed because a
50
38
  // plain string there is a named agent too; an object is read through `.name`.
@@ -83,17 +71,12 @@ function appendOddWorktreesSection(event, deps = {}) {
83
71
  const options = event && event.systemPromptOptions;
84
72
  if (!options || typeof options !== 'object') return;
85
73
 
86
- const available = typeof effectiveDeps.hasCodegraph === 'function'
87
- ? effectiveDeps.hasCodegraph(env)
88
- : hasCodegraph(env);
89
- const section = available ? WITH_CODEGRAPH : WITHOUT_CODEGRAPH;
90
-
91
74
  const existing = typeof options.appendSystemPrompt === 'string' ? options.appendSystemPrompt : '';
92
75
  if (existing.includes(SECTION_MARKER)) return;
93
76
  // Append-only: every existing byte stays the prefix of the new value.
94
77
  options.appendSystemPrompt = existing.length === 0
95
- ? section
96
- : `${existing}${separatorFor(existing)}${section}`;
78
+ ? SECTION
79
+ : `${existing}${separatorFor(existing)}${SECTION}`;
97
80
  } catch {
98
81
  // The prompt block must never break session start.
99
82
  }
@@ -101,6 +84,5 @@ function appendOddWorktreesSection(event, deps = {}) {
101
84
 
102
85
  module.exports = {
103
86
  appendOddWorktreesSection,
104
- WITH_CODEGRAPH,
105
- WITHOUT_CODEGRAPH,
87
+ SECTION,
106
88
  };
@@ -0,0 +1,210 @@
1
+ 'use strict';
2
+ // S9 (issues-sidebar, T14): the in-process cache of the three scoped issue
3
+ // views the rail's ONE combined read answers (`mine`, `assigned`, `involved`).
4
+ //
5
+ // Pure by contract: no imports, no child process and no clock but the one
6
+ // injected. State is process memory only — nothing is ever written to disk —
7
+ // and it is kept per repository identity (`<host>/<owner>/<repo>`), so a session
8
+ // that moves between checkouts can never show one repository's rows under
9
+ // another's name.
10
+ //
11
+ // The first sync reads up to 100 per bucket and REPLACES it. Later syncs read
12
+ // the newest 20 and MERGE by issue number. A merge cannot see an issue that was
13
+ // closed or unassigned (it simply leaves the result), so after every apply each
14
+ // bucket that is not truncated is held to one invariant: the cached row count
15
+ // must equal the `issueCount` the same response reported. A mismatch is exactly
16
+ // how a departed issue is detected, and it makes the NEXT `plan` a full re-read
17
+ // of the three buckets. A bucket whose `issueCount` exceeds `bucketCap` is
18
+ // `truncated`: the invariant is skipped for it — a bucket the cache cannot hold
19
+ // whole is never held to a count it cannot store — and the truncation is
20
+ // reported to the caller instead of being looped over.
21
+ //
22
+ // Two times are kept per entry (T15): `fullAt` moves only when a FULL apply
23
+ // replaces the buckets, and `syncedAt` moves on every apply and is what `get`
24
+ // reports. `plan` compares `fullAt` with `fullTtlMs`, so a steady stream of
25
+ // deltas can never postpone the ten-minute full re-read.
26
+ //
27
+ // `apply` also accepts the caller's start-ordered `sequence` (T15): a response
28
+ // whose sequence is older than the last one applied for that identity is ignored
29
+ // whole, so a full read that finishes after a newer one can never overwrite it.
30
+ //
31
+ // `get` hands out copies, so a consumer can never mutate the cache through a
32
+ // frame it rendered. It reports the entry's own `truncated` and `inconsistent`
33
+ // facts (T17): a consumer that reports a TOTAL must not claim an exact one from
34
+ // an entry whose cached rows no longer match the count the response reported —
35
+ // that is the same fact `plan` acts on. `apply` never throws: a failed or
36
+ // malformed answer leaves the cached entry exactly as it was.
37
+
38
+ const BUCKET_KEYS = ['mine', 'assigned', 'involved'];
39
+ // The two read sizes S9 names: the first sync is the full one, every later one
40
+ // is the newest 20 that can still change what the rail shows.
41
+ const FULL_FIRST = 100;
42
+ const DELTA_FIRST = 20;
43
+ const DEFAULT_FULL_TTL_MS = 600000;
44
+ const DEFAULT_BUCKET_CAP = 100;
45
+
46
+ function updatedAtValue(row) {
47
+ const raw = row && typeof row === 'object' ? row.updatedAt : null;
48
+ const parsed = typeof raw === 'string' ? Date.parse(raw) : Number.NaN;
49
+ return Number.isFinite(parsed) ? parsed : Number.NEGATIVE_INFINITY;
50
+ }
51
+
52
+ function copyIssue(row) {
53
+ const copy = { ...row };
54
+ if (Array.isArray(row.labels)) copy.labels = row.labels.map((label) => (label && typeof label === 'object' ? { ...label } : label));
55
+ if (Array.isArray(row.assignees)) copy.assignees = row.assignees.slice();
56
+ if (row.reactions && typeof row.reactions === 'object') copy.reactions = { ...row.reactions };
57
+ return copy;
58
+ }
59
+
60
+ // The rows of one bucket, deduplicated by issue number (a later occurrence
61
+ // replaces an earlier one) and stored as copies. A row without a usable number
62
+ // cannot be merged or counted, so it never enters the cache.
63
+ function normalizeRows(rows) {
64
+ const byNumber = new Map();
65
+ if (!Array.isArray(rows)) return [];
66
+ for (const row of rows) {
67
+ if (!row || typeof row !== 'object') continue;
68
+ if (!Number.isInteger(row.number) || row.number <= 0) continue;
69
+ byNumber.set(row.number, copyIssue(row));
70
+ }
71
+ return [...byNumber.values()];
72
+ }
73
+
74
+ // A delta MERGES by issue number. The freshly read row is the newer one, so it
75
+ // replaces the stored row; a stored row whose number the delta did not mention
76
+ // stays exactly as it was (which is what lets the count invariant notice an
77
+ // issue that left the result).
78
+ function mergeRows(previous, incoming) {
79
+ const byNumber = new Map();
80
+ for (const row of previous || []) byNumber.set(row.number, copyIssue(row));
81
+ for (const row of incoming) {
82
+ const existing = byNumber.get(row.number);
83
+ if (existing === undefined || updatedAtValue(row) >= updatedAtValue(existing)) {
84
+ byNumber.set(row.number, row);
85
+ }
86
+ }
87
+ return [...byNumber.values()];
88
+ }
89
+
90
+ function sortAndTrim(rows, cap) {
91
+ return rows
92
+ .slice()
93
+ .sort((left, right) => updatedAtValue(right) - updatedAtValue(left))
94
+ .slice(0, cap);
95
+ }
96
+
97
+ function createIssuesCache(options = {}) {
98
+ const opts = options && typeof options === 'object' ? options : {};
99
+ const now = typeof opts.now === 'function' ? opts.now : Date.now;
100
+ const fullTtlMs = Number.isFinite(opts.fullTtlMs) && opts.fullTtlMs >= 0
101
+ ? opts.fullTtlMs
102
+ : DEFAULT_FULL_TTL_MS;
103
+ const bucketCap = Number.isInteger(opts.bucketCap) && opts.bucketCap > 0
104
+ ? opts.bucketCap
105
+ : DEFAULT_BUCKET_CAP;
106
+ const entries = new Map();
107
+
108
+ // The injected clock is the module's only notion of time; a clock that throws
109
+ // or answers nonsense costs the staleness window, never a caller.
110
+ function clock() {
111
+ try {
112
+ const value = now();
113
+ return Number.isFinite(value) ? value : 0;
114
+ } catch {
115
+ return 0;
116
+ }
117
+ }
118
+
119
+ function plan(identity) {
120
+ const entry = entries.get(identity);
121
+ if (!entry) return { full: true, first: FULL_FIRST };
122
+ if (entry.inconsistent === true) return { full: true, first: FULL_FIRST };
123
+ // T15 (S9, defect 3): the ten-minute bound is measured from the last FULL
124
+ // read. Every delta stamps `syncedAt`, but only a full apply moves `fullAt`,
125
+ // so a steady stream of deltas can never postpone the full re-read forever.
126
+ const age = clock() - entry.fullAt;
127
+ if (!Number.isFinite(age) || age >= fullTtlMs) return { full: true, first: FULL_FIRST };
128
+ return { full: false, first: DELTA_FIRST };
129
+ }
130
+
131
+ function apply(identity, response, applyOptions = {}) {
132
+ const buckets = response && response.ok === true && response.buckets && typeof response.buckets === 'object'
133
+ ? response.buckets
134
+ : null;
135
+ if (buckets === null) {
136
+ return { consistent: false, truncated: { mine: false, assigned: false, involved: false } };
137
+ }
138
+ const full = Boolean(applyOptions && applyOptions.full === true);
139
+ // T15 (S9, defect 5): the caller numbers a read when it STARTS. An answer
140
+ // older than the last one applied for this identity is ignored whole — a
141
+ // full read that finishes after a newer one can never overwrite it.
142
+ const sequence = Number.isFinite(applyOptions && applyOptions.sequence) ? applyOptions.sequence : null;
143
+ const previous = entries.get(identity);
144
+ if (sequence !== null && previous && Number.isFinite(previous.lastApplied)
145
+ && sequence <= previous.lastApplied) {
146
+ return { consistent: false, truncated: { ...previous.truncated } };
147
+ }
148
+ const at = clock();
149
+ const next = {
150
+ buckets: {},
151
+ counts: {},
152
+ truncated: {},
153
+ inconsistent: false,
154
+ fullAt: full || !previous ? at : previous.fullAt,
155
+ syncedAt: at,
156
+ lastApplied: sequence !== null
157
+ ? sequence
158
+ : (previous && Number.isFinite(previous.lastApplied) ? previous.lastApplied : null),
159
+ };
160
+ for (const key of BUCKET_KEYS) {
161
+ const bucket = buckets[key] && typeof buckets[key] === 'object' ? buckets[key] : null;
162
+ if (!bucket || !Number.isInteger(bucket.issueCount) || bucket.issueCount < 0
163
+ || !Array.isArray(bucket.issues)) {
164
+ // A malformed answer is not a state change: the cached entry stays as
165
+ // it was and the caller is told the result is not trustworthy.
166
+ return { consistent: false, truncated: { mine: false, assigned: false, involved: false } };
167
+ }
168
+ const incoming = normalizeRows(bucket.issues);
169
+ const merged = full || !previous ? incoming : mergeRows(previous.buckets[key], incoming);
170
+ next.buckets[key] = sortAndTrim(merged, bucketCap);
171
+ next.counts[key] = bucket.issueCount;
172
+ next.truncated[key] = bucket.issueCount > bucketCap;
173
+ if (!next.truncated[key] && next.buckets[key].length !== bucket.issueCount) {
174
+ next.inconsistent = true;
175
+ }
176
+ }
177
+ entries.set(identity, next);
178
+ return {
179
+ consistent: next.inconsistent === false,
180
+ truncated: { ...next.truncated },
181
+ };
182
+ }
183
+
184
+ function get(identity) {
185
+ const entry = entries.get(identity);
186
+ if (!entry) return null;
187
+ const buckets = {};
188
+ for (const key of BUCKET_KEYS) {
189
+ buckets[key] = entry.buckets[key].map(copyIssue);
190
+ }
191
+ return {
192
+ buckets,
193
+ truncated: { ...entry.truncated },
194
+ inconsistent: entry.inconsistent === true,
195
+ syncedAt: entry.syncedAt,
196
+ };
197
+ }
198
+
199
+ function drop(identity) {
200
+ entries.delete(identity);
201
+ }
202
+
203
+ function clear() {
204
+ entries.clear();
205
+ }
206
+
207
+ return { get, plan, apply, drop, clear };
208
+ }
209
+
210
+ module.exports = { createIssuesCache };