dsh-memu-memory 1.2.2 → 1.2.3

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.
@@ -0,0 +1,406 @@
1
+ import test from 'node:test'
2
+ import assert from 'node:assert/strict'
3
+ import fs from 'node:fs'
4
+ import os from 'node:os'
5
+ import path from 'node:path'
6
+
7
+ const home = fs.mkdtempSync(path.join(os.tmpdir(), 'dsh-memu-memory-loop-date-'))
8
+ process.env.DSH_MEMU_HOME = home
9
+
10
+ const state = await import('../lib/state.js')
11
+ const memory = await import('../lib/memory.js')
12
+ const inject = await import('../lib/inject.js')
13
+ const { estTokens } = await import('../lib/budget.js')
14
+
15
+ test.after(() => {
16
+ try { state.flushState() } catch {}
17
+ try { fs.rmSync(home, { recursive: true, force: true }) } catch {}
18
+ })
19
+
20
+ const DAY = 86_400_000
21
+ const local = (y, m, d, h = 12) => new Date(y, m - 1, d, h, 0, 0)
22
+ const pad = (n) => String(n).padStart(2, '0')
23
+
24
+ function newSession(id) {
25
+ const cwd = path.join(home, 'proj-' + id)
26
+ const binding = state.ensureSession(id, { cwd, agentPreset: 'coding' })
27
+ return { sessionId: id, binding, cwd }
28
+ }
29
+
30
+ // Entries are written straight into the index: the point of these cases is the
31
+ // injection side (date + open_loop + reminder clock), not the write path.
32
+ function putEntry(libraryId, id, patch = {}) {
33
+ const index = state.loadPrivateIndex(libraryId)
34
+ index.entries[id] = {
35
+ track: 'memory',
36
+ layer: 'long_term',
37
+ title: id,
38
+ content: `content of ${id}`,
39
+ status: 'active',
40
+ createdAt: local(2026, 10, 1).toISOString(),
41
+ updatedAt: local(2026, 10, 1).toISOString(),
42
+ ...patch,
43
+ }
44
+ state.savePrivateIndex(libraryId, index)
45
+ return index.entries[id]
46
+ }
47
+
48
+ function nudge(sessionId, now, extra = {}) {
49
+ return inject.buildOpenLoopNudge(state.getSessionBinding(sessionId), state.getSettings(), sessionId, { now, ...extra })
50
+ }
51
+
52
+ function setRemindDays(value) {
53
+ return state.updateSettings({ openLoopRemindDays: value })
54
+ }
55
+
56
+ test('the setting defaults to 7 days and clamps to [1,365]', () => {
57
+ assert.equal(state.DEFAULT_SETTINGS.openLoopRemindDays, 7)
58
+ assert.equal(state.getSettings().openLoopRemindDays, 7)
59
+ try {
60
+ assert.equal(setRemindDays(0).openLoopRemindDays, 1, 'zero is clamped to one day, not disabled')
61
+ assert.equal(setRemindDays(999).openLoopRemindDays, 365)
62
+ assert.throws(() => state.updateSettings({ openLoopRemindDays: 'weekly' }), /finite number/)
63
+ } finally {
64
+ setRemindDays(7)
65
+ }
66
+ })
67
+
68
+ // ── R3: the overdue leg ───────────────────────────────────────────────────────
69
+
70
+ test('a promise due yesterday is raised without waiting three days', () => {
71
+ const { sessionId, binding } = newSession('loop-yesterday')
72
+ const now = local(2026, 11, 2)
73
+ putEntry(binding.libraryId, 'mem-promise', {
74
+ title: '回电话', content: '答应了昨天回电话。', openLoop: true,
75
+ salientDate: '2026-11-01', updatedAt: now.toISOString(), createdAt: now.toISOString(),
76
+ })
77
+ const first = nudge(sessionId, now)
78
+ assert.match(first.text, /\[open loop\]/)
79
+ assert.ok(first.text.includes('mem-promise'))
80
+ assert.match(first.text, /date=2026-11-01/, 'the overdue line says how late it is')
81
+ assert.deepEqual(first.recurringIds, ['mem-promise'], 'this came from the dated leg, not the 3-day rule')
82
+ assert.equal(first.dayKey, '2026-11-02')
83
+ })
84
+
85
+ test('it repeats on its interval: once a day, then only after openLoopRemindDays', () => {
86
+ const { sessionId, binding } = newSession('loop-interval')
87
+ const now = local(2026, 11, 2)
88
+ putEntry(binding.libraryId, 'mem-interval', {
89
+ openLoop: true, salientDate: '2026-11-01', updatedAt: now.toISOString(), createdAt: now.toISOString(),
90
+ })
91
+ assert.deepEqual(nudge(sessionId, now).recurringIds, ['mem-interval'])
92
+
93
+ // Exactly what the injector does once the nudge is published: the id goes into the
94
+ // session dedupe list and the reminder clock starts. Only the second one may decide
95
+ // when this repeats.
96
+ state.markInjected(sessionId, ['mem-interval'], 1)
97
+ state.markOpenLoopReminded(sessionId, 'mem-interval', now)
98
+ assert.equal(state.wasOpenLoopRemindedToday(sessionId, 'mem-interval', now), true)
99
+ assert.equal(state.wasOpenLoopRemindedToday(sessionId, 'mem-interval', local(2026, 11, 3)), false)
100
+
101
+ assert.equal(nudge(sessionId, now).text, '', 'the same day never repeats it')
102
+ assert.equal(nudge(sessionId, new Date(now.getTime() + 6 * DAY + 3_600_000)).text, '',
103
+ 'one hour short of seven days is still inside the window')
104
+ const again = nudge(sessionId, new Date(now.getTime() + 7 * DAY))
105
+ assert.ok(again.text.includes('mem-interval'), 'the seventh day raises it again')
106
+ assert.deepEqual(again.recurringIds, ['mem-interval'])
107
+ })
108
+
109
+ test('openLoopRemindDays 1 and 365 are the real boundaries', () => {
110
+ const { sessionId, binding } = newSession('loop-bound')
111
+ const now = local(2026, 11, 2)
112
+ putEntry(binding.libraryId, 'mem-bound', {
113
+ openLoop: true, salientDate: '2026-10-01', updatedAt: now.toISOString(), createdAt: now.toISOString(),
114
+ })
115
+ // Keep the regular 3-day leg out of the way: this case is only about the clock.
116
+ state.markInjected(sessionId, ['mem-bound'], 1)
117
+ state.markOpenLoopReminded(sessionId, 'mem-bound', now)
118
+ const at = (days, hours = 0) => new Date(now.getTime() + days * DAY + hours * 3_600_000)
119
+ try {
120
+ setRemindDays(1)
121
+ assert.equal(nudge(sessionId, at(0, 23)).text, '', '23 hours is younger than one day')
122
+ assert.ok(nudge(sessionId, at(1)).text.includes('mem-bound'), 'exactly one day is due again')
123
+
124
+ state.markOpenLoopReminded(sessionId, 'mem-bound', now)
125
+ setRemindDays(365)
126
+ assert.equal(nudge(sessionId, at(364)).text, '')
127
+ assert.ok(nudge(sessionId, at(365)).text.includes('mem-bound'))
128
+ } finally {
129
+ setRemindDays(7)
130
+ }
131
+ })
132
+
133
+ test('once injected, the dated leg still comes back; the undated leg does not', () => {
134
+ const { sessionId, binding } = newSession('loop-vs-regular')
135
+ const now = local(2026, 11, 2)
136
+ putEntry(binding.libraryId, 'mem-dated', {
137
+ openLoop: true, salientDate: '2026-10-30', updatedAt: new Date(now.getTime() - 4 * DAY).toISOString(),
138
+ })
139
+ putEntry(binding.libraryId, 'mem-plain', {
140
+ openLoop: true, updatedAt: new Date(now.getTime() - 4 * DAY).toISOString(),
141
+ })
142
+ // The session already pushed both ids in earlier turns.
143
+ state.markInjected(sessionId, ['mem-dated'], 1)
144
+ state.markInjected(sessionId, ['mem-plain'], 1)
145
+ const only = nudge(sessionId, now)
146
+ assert.ok(only.text.includes('mem-dated'), 'injectedIds is not a permanent silence for a slipped promise')
147
+ assert.equal(only.text.includes('mem-plain'), false, 'the ordinary loop stays silent once said')
148
+ assert.deepEqual(only.recurringIds, ['mem-dated'])
149
+ })
150
+
151
+ test('undated open loops keep the 3-day gate and the permanent silence', () => {
152
+ const { sessionId, binding } = newSession('loop-undated')
153
+ const now = local(2026, 11, 2)
154
+ putEntry(binding.libraryId, 'mem-undated', {
155
+ openLoop: true, updatedAt: new Date(now.getTime() - 2 * DAY).toISOString(),
156
+ })
157
+ assert.equal(nudge(sessionId, now).text, '', 'two days is context, not a nudge')
158
+
159
+ putEntry(binding.libraryId, 'mem-undated', {
160
+ openLoop: true, updatedAt: new Date(now.getTime() - 4 * DAY).toISOString(),
161
+ })
162
+ const raised = nudge(sessionId, now)
163
+ assert.ok(raised.text.includes('mem-undated'))
164
+ assert.deepEqual(raised.recurringIds, [], 'an undated loop is not on the reminder clock')
165
+
166
+ state.markInjected(sessionId, ['mem-undated'], 3)
167
+ assert.equal(nudge(sessionId, now).text, '', 'once said, it stays quiet')
168
+ })
169
+
170
+ test('archived, secret, invisible and annual entries never join the overdue leg', () => {
171
+ const { sessionId, binding } = newSession('loop-excluded')
172
+ const now = local(2026, 11, 2)
173
+ const recent = now.toISOString()
174
+ putEntry(binding.libraryId, 'mem-archived', { openLoop: true, salientDate: '2026-10-20', status: 'archived', updatedAt: recent })
175
+ putEntry(binding.libraryId, 'mem-secret', { openLoop: true, salientDate: '2026-10-21', visibility: 'secret', updatedAt: recent })
176
+ putEntry(binding.libraryId, 'mem-hidden', {
177
+ openLoop: true, salientDate: '2026-10-19', context: { characterId: 'someone-else' }, updatedAt: recent,
178
+ })
179
+ putEntry(binding.libraryId, 'mem-annual', { openLoop: true, salientDate: '10-20', updatedAt: recent })
180
+ assert.equal(nudge(sessionId, now).text, '')
181
+
182
+ // The hidden one sorts first (oldest date) but must not eat the single slot.
183
+ putEntry(binding.libraryId, 'mem-visible', { openLoop: true, salientDate: '2026-10-25', updatedAt: recent })
184
+ const visible = nudge(sessionId, now)
185
+ assert.ok(visible.text.includes('mem-visible'))
186
+ assert.equal(visible.text.includes('mem-hidden'), false)
187
+ })
188
+
189
+ test('a slipped date outranks an ordinary old loop, and still limit 1', () => {
190
+ const { sessionId, binding } = newSession('loop-priority')
191
+ const now = local(2026, 11, 2)
192
+ putEntry(binding.libraryId, 'mem-old-loop', {
193
+ openLoop: true, updatedAt: new Date(now.getTime() - 30 * DAY).toISOString(),
194
+ })
195
+ putEntry(binding.libraryId, 'mem-late-date', {
196
+ openLoop: true, salientDate: '2026-10-30', updatedAt: new Date(now.getTime() - 1 * DAY).toISOString(),
197
+ })
198
+ const raised = nudge(sessionId, now)
199
+ assert.ok(raised.text.includes('mem-late-date'), raised.text)
200
+ assert.equal(raised.text.includes('mem-old-loop'), false, 'limit 1: the dated promise wins the slot')
201
+ assert.deepEqual(raised.ids, ['mem-late-date'])
202
+
203
+ const direct = memory.dueOpenLoops({
204
+ libraryId: binding.libraryId, days: 3, limit: 1, now: now.getTime(),
205
+ includeOverdueDated: true, remindDays: 7,
206
+ })
207
+ assert.deepEqual(direct.map((item) => [item.id, item.recurring]), [['mem-late-date', true]])
208
+
209
+ // The overdue leg is opt-in at the dueOpenLoops level: the old call shape keeps the
210
+ // old answer (only the 3-day regular loop).
211
+ assert.deepEqual(memory.dueOpenLoops({ libraryId: binding.libraryId, days: 3, limit: 1, now: now.getTime() })
212
+ .map((item) => item.id), ['mem-old-loop'])
213
+
214
+ // The regular leg is still reachable once the dated one is out of the way.
215
+ putEntry(binding.libraryId, 'mem-late-date', { openLoop: false, salientDate: '2026-10-30', updatedAt: new Date(now.getTime() - 1 * DAY).toISOString() })
216
+ const regular = nudge(sessionId, now)
217
+ assert.ok(regular.text.includes('mem-old-loop'))
218
+ assert.deepEqual(regular.recurringIds, [])
219
+ })
220
+
221
+ test('the overdue leg honours same-turn skipIds but not the injectedIds list', () => {
222
+ const { sessionId, binding } = newSession('loop-skip')
223
+ const now = local(2026, 11, 2)
224
+ putEntry(binding.libraryId, 'mem-both', {
225
+ openLoop: true, salientDate: '2026-11-01', updatedAt: now.toISOString(),
226
+ })
227
+ assert.equal(nudge(sessionId, now, { skipIds: ['mem-both'] }).text, '')
228
+ })
229
+
230
+ // ── legacy bindings and the reminder map ──────────────────────────────────────
231
+
232
+ test('a binding without openLoopRemindedAt reminds normally and the map is pruned', () => {
233
+ const { sessionId, binding } = newSession('loop-legacy')
234
+ const now = local(2026, 11, 2)
235
+ putEntry(binding.libraryId, 'mem-legacy', {
236
+ openLoop: true, salientDate: '2026-11-01', updatedAt: now.toISOString(),
237
+ })
238
+ assert.equal(state.getSessionBinding(sessionId).openLoopRemindedAt, undefined, 'old bindings have no map')
239
+ assert.equal(state.wasOpenLoopRemindedToday(sessionId, 'mem-legacy', now), false)
240
+ assert.ok(nudge(sessionId, now).text.includes('mem-legacy'))
241
+
242
+ state.markOpenLoopReminded(sessionId, 'mem-legacy', now)
243
+ state.markOpenLoopReminded(sessionId, 'mem-stale', new Date(now.getTime() - 120 * DAY))
244
+ state.markOpenLoopReminded(sessionId, 'mem-kept', new Date(now.getTime() - 10 * DAY))
245
+ const map = state.getSessionBinding(sessionId).openLoopRemindedAt
246
+ assert.ok(map['mem-legacy'])
247
+ assert.ok(map['mem-kept'])
248
+ assert.equal(map['mem-stale'], undefined, 'keys older than 90 days are dropped on write')
249
+ assert.equal(state.wasOpenLoopRemindedToday(sessionId, 'mem-legacy', now), true)
250
+ })
251
+
252
+ test('a missing session or memory id is not an error', () => {
253
+ assert.equal(state.wasOpenLoopRemindedToday(null, 'mem-x'), false)
254
+ assert.equal(state.wasOpenLoopRemindedToday('nobody-here', 'mem-x'), false)
255
+ assert.equal(state.markOpenLoopReminded(null, 'mem-x'), null)
256
+ assert.equal(state.markOpenLoopReminded('nobody-here', null), null)
257
+ })
258
+
259
+ // ── R2: promise wording in the due block ─────────────────────────────────────
260
+
261
+ test('an open_loop dated today or tomorrow reads as a promise, with no body', () => {
262
+ const { sessionId, binding } = newSession('loop-wording')
263
+ const today = local(2026, 11, 2)
264
+ putEntry(binding.libraryId, 'mem-today', {
265
+ title: '交周报', content: 'BODY-TODAY 答应了周一交周报。', openLoop: true, salientDate: '2026-11-02',
266
+ })
267
+ putEntry(binding.libraryId, 'mem-tomorrow', {
268
+ title: '回电话', content: 'BODY-TOMORROW 答应明天回电话。', openLoop: true, salientDate: '2026-11-03',
269
+ })
270
+ const due = inject.buildAnniversary(sessionId, binding, today)
271
+ assert.ok(due.text.includes('你之前答应过的「交周报」,就是今天。'), due.text)
272
+ assert.ok(due.text.includes('你之前答应过的「回电话」,就是明天。'), due.text)
273
+ assert.equal(due.text.includes('BODY-TODAY'), false, 'a promise line carries the title, not the body')
274
+ assert.equal(due.text.includes('BODY-TOMORROW'), false)
275
+ assert.deepEqual(due.ids.sort(), ['mem-today', 'mem-tomorrow'])
276
+
277
+ // A dated entry that is not a promise keeps the old appointment shape.
278
+ putEntry(binding.libraryId, 'mem-exam', {
279
+ title: '考驾照', content: '明天要去考驾照。', salientDate: '2026-11-03',
280
+ })
281
+ const mixed = inject.buildAnniversary('loop-wording-2', binding, today)
282
+ assert.ok(mixed.text.includes('明天要去考驾照。'), 'a plain appointment still shows its body')
283
+ assert.ok(mixed.text.includes('就是明天(2026-11-03)'))
284
+ })
285
+
286
+ // ── R1: one memory, one block per turn ────────────────────────────────────────
287
+
288
+ test('the anniversary ids suppress the nudge for the same memory', () => {
289
+ const { sessionId, binding } = newSession('loop-dedup')
290
+ const now = local(2026, 11, 2)
291
+ putEntry(binding.libraryId, 'mem-both', {
292
+ title: '交周报', content: '答应了周一交周报。', openLoop: true, salientDate: '2026-11-02',
293
+ updatedAt: new Date(now.getTime() - 5 * DAY).toISOString(),
294
+ })
295
+ const anniversary = inject.buildAnniversary(sessionId, binding, now)
296
+ assert.match(anniversary.text, /你之前答应过的「交周报」,就是今天。/)
297
+ assert.deepEqual(anniversary.ids, ['mem-both'])
298
+
299
+ const plain = nudge(sessionId, now)
300
+ assert.ok(plain.text.includes('mem-both'), 'without dedup the nudge would repeat it')
301
+ assert.equal(nudge(sessionId, now, { skipIds: anniversary.ids }).text, '')
302
+ })
303
+
304
+ test('a budget-dropped anniversary does not silence the nudge (injectForStep)', async () => {
305
+ const sessionId = 'loop-budget'
306
+ const cwd = path.join(home, 'proj-loop-budget')
307
+ const binding = state.ensureSession(sessionId, { cwd, agentPreset: 'coding' })
308
+ const today = new Date()
309
+ const dated = `${today.getFullYear()}-${pad(today.getMonth() + 1)}-${pad(today.getDate())}`
310
+ const annual = `${pad(today.getMonth() + 1)}-${pad(today.getDate())}`
311
+
312
+ putEntry(binding.libraryId, 'mem-said', {
313
+ title: '回电话', content: '答应过回电话。', openLoop: true, salientDate: dated,
314
+ updatedAt: new Date(today.getTime() - 5 * DAY).toISOString(),
315
+ })
316
+ // Makes the anniversary block big enough that a small budget drops it whole.
317
+ putEntry(binding.libraryId, 'mem-long', {
318
+ title: '长备注', content: '长'.repeat(200), salientDate: annual, updatedAt: today.toISOString(),
319
+ })
320
+
321
+ const step = (text) => ({
322
+ agent: { session: { header: { id: sessionId, cwd, agentPreset: 'coding', origin: 'user' } } },
323
+ decision: {
324
+ kind: 'enter',
325
+ messages: [{ id: `u-${Math.random().toString(36).slice(2)}`, role: 'user', source: { kind: 'user' }, content: [{ type: 'text', text }] }],
326
+ },
327
+ })
328
+ const pluginText = (out) => out.messages
329
+ .filter((message) => message?.source?.kind === 'plugin:dsh-memu-memory')
330
+ .map((message) => (message.content || []).map((part) => part.text || '').join('\n'))
331
+ .join('\n\n')
332
+
333
+ const anniversaryTokens = estTokens(inject.buildAnniversary(sessionId, state.getSessionBinding(sessionId), new Date()).text)
334
+ const nudgeTokens = estTokens(inject.buildOpenLoopNudge(state.getSessionBinding(sessionId), state.getSettings(), sessionId, { now: new Date() }).text)
335
+ assert.ok(anniversaryTokens > 160, `the anniversary block must not fit a 160-token budget (got ${anniversaryTokens})`)
336
+ assert.ok(nudgeTokens <= 160, `the nudge must fit that budget (got ${nudgeTokens})`)
337
+
338
+ // The anchor is a separate block with its own room; mark it as already delivered so
339
+ // the whole 160-token budget is left to the anniversary/nudge decision under test.
340
+ state.setSessionBinding(sessionId, {
341
+ injectedIds: ['__anchor__'], injectedAt: {}, anniversariesShown: {}, openLoopRemindedAt: {},
342
+ })
343
+ state.updateSettings({ injectionTotalTokens: 160, randomCueChance: 0 })
344
+ try {
345
+ const out = await inject.injectForStep({ ...step('今天有什么要注意的吗'), turn: 1, step: 1, signal: { aborted: false } })
346
+ const text = pluginText(out)
347
+ assert.equal(text.includes('<memory-due>'), false, 'the anniversary block was dropped by the budget')
348
+ assert.match(text, /\[open loop\]/, 'the nudge still gets its turn')
349
+ assert.ok(text.includes('mem-said'))
350
+ assert.equal(state.getSessionBinding(sessionId).openLoopRemindedAt?.['mem-said'], undefined,
351
+ 'the regular leg does not write the recurring clock')
352
+ } finally {
353
+ state.updateSettings({ injectionTotalTokens: 2000 })
354
+ }
355
+
356
+ // Same turn shape with a normal budget: the anniversary fits, so the nudge stays out.
357
+ state.setSessionBinding(sessionId, {
358
+ injectedIds: ['__anchor__'], injectedAt: {}, anniversariesShown: {}, openLoopRemindedAt: {},
359
+ })
360
+ try {
361
+ const out = await inject.injectForStep({ ...step('今天有什么要注意的吗'), turn: 1, step: 1, signal: { aborted: false } })
362
+ const text = pluginText(out)
363
+ assert.match(text, /<memory-due>/, text)
364
+ assert.ok(text.includes('你之前答应过的「回电话」,就是今天。'))
365
+ assert.equal(text.includes('[open loop]'), false, 'one memory, one block per turn')
366
+ } finally {
367
+ state.updateSettings({ randomCueChance: 0.02 })
368
+ }
369
+ })
370
+
371
+ test('injectForStep records the overdue reminder only after the block is really sent', async () => {
372
+ const sessionId = 'loop-commit'
373
+ const cwd = path.join(home, 'proj-loop-commit')
374
+ const binding = state.ensureSession(sessionId, { cwd, agentPreset: 'coding' })
375
+ const today = new Date()
376
+ const yesterday = new Date(today.getTime() - DAY)
377
+ const dated = `${yesterday.getFullYear()}-${pad(yesterday.getMonth() + 1)}-${pad(yesterday.getDate())}`
378
+ putEntry(binding.libraryId, 'mem-recurring', {
379
+ title: '交周报', content: '昨天该交的周报还没交。', openLoop: true, salientDate: dated,
380
+ updatedAt: today.toISOString(),
381
+ })
382
+ state.updateSettings({ randomCueChance: 0 })
383
+ const step = {
384
+ agent: { session: { header: { id: sessionId, cwd, agentPreset: 'coding', origin: 'user' } } },
385
+ decision: {
386
+ kind: 'enter',
387
+ messages: [{ id: 'u-commit', role: 'user', source: { kind: 'user' }, content: [{ type: 'text', text: '今天有什么要注意的吗' }] }],
388
+ },
389
+ }
390
+ const out = await inject.injectForStep({ ...step, turn: 1, step: 1, signal: { aborted: false } })
391
+ const text = (out.messages || [])
392
+ .filter((message) => message?.source?.kind === 'plugin:dsh-memu-memory')
393
+ .map((message) => (message.content || []).map((part) => part.text || '').join('\n'))
394
+ .join('\n\n')
395
+ assert.match(text, /\[open loop\]/)
396
+ assert.ok(text.includes('mem-recurring'))
397
+ assert.equal(state.wasOpenLoopRemindedToday(sessionId, 'mem-recurring', new Date()), true,
398
+ 'the clock starts once the reminder reached the prompt')
399
+
400
+ const again = await inject.injectForStep({ ...step, turn: 2, step: 1, signal: { aborted: false } })
401
+ const againText = (again.messages || [])
402
+ .filter((message) => message?.source?.kind === 'plugin:dsh-memu-memory')
403
+ .map((message) => (message.content || []).map((part) => part.text || '').join('\n'))
404
+ .join('\n\n')
405
+ assert.equal(againText.includes('[open loop]'), false, 'not twice on the same day')
406
+ })