@rubytech/create-maxy-code 0.1.604 → 0.1.605

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 (53) hide show
  1. package/package.json +1 -1
  2. package/payload/platform/lib/routine-templates/dist/roster.d.ts +30 -2
  3. package/payload/platform/lib/routine-templates/dist/roster.d.ts.map +1 -1
  4. package/payload/platform/lib/routine-templates/dist/roster.js +76 -32
  5. package/payload/platform/lib/routine-templates/dist/roster.js.map +1 -1
  6. package/payload/platform/lib/routine-templates/src/__tests__/roster.test.ts +0 -0
  7. package/payload/platform/lib/routine-templates/src/__tests__/seed.test.ts +22 -1
  8. package/payload/platform/lib/routine-templates/src/roster.ts +108 -35
  9. package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +3 -3
  10. package/payload/platform/plugins/admin/skills/whats-new/SKILL.md +5 -0
  11. package/payload/platform/plugins/connector/PLUGIN.md +9 -1
  12. package/payload/platform/plugins/connector/mcp/dist/__tests__/queue-descriptor.test.d.ts +2 -0
  13. package/payload/platform/plugins/connector/mcp/dist/__tests__/queue-descriptor.test.d.ts.map +1 -0
  14. package/payload/platform/plugins/connector/mcp/dist/__tests__/queue-descriptor.test.js +67 -0
  15. package/payload/platform/plugins/connector/mcp/dist/__tests__/queue-descriptor.test.js.map +1 -0
  16. package/payload/platform/plugins/connector/mcp/dist/index.js +36 -5
  17. package/payload/platform/plugins/connector/mcp/dist/index.js.map +1 -1
  18. package/payload/platform/plugins/connector/mcp/dist/lib/store.d.ts +35 -0
  19. package/payload/platform/plugins/connector/mcp/dist/lib/store.d.ts.map +1 -1
  20. package/payload/platform/plugins/connector/mcp/dist/lib/store.js +33 -0
  21. package/payload/platform/plugins/connector/mcp/dist/lib/store.js.map +1 -1
  22. package/payload/platform/plugins/connector/mcp/package.json +4 -2
  23. package/payload/platform/plugins/connector/mcp/vitest.config.ts +8 -0
  24. package/payload/platform/plugins/docs/references/admin-ui.md +2 -2
  25. package/payload/platform/plugins/email/PLUGIN.md +4 -0
  26. package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/retention.test.d.ts +2 -0
  27. package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/retention.test.d.ts.map +1 -0
  28. package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/retention.test.js +233 -0
  29. package/payload/platform/plugins/email/mcp/dist/sampler/__tests__/retention.test.js.map +1 -0
  30. package/payload/platform/plugins/email/mcp/dist/sampler/main.js +19 -0
  31. package/payload/platform/plugins/email/mcp/dist/sampler/main.js.map +1 -1
  32. package/payload/platform/plugins/email/mcp/dist/sampler/retention-sources.d.ts +3 -0
  33. package/payload/platform/plugins/email/mcp/dist/sampler/retention-sources.d.ts.map +1 -0
  34. package/payload/platform/plugins/email/mcp/dist/sampler/retention-sources.js +146 -0
  35. package/payload/platform/plugins/email/mcp/dist/sampler/retention-sources.js.map +1 -0
  36. package/payload/platform/plugins/email/mcp/dist/sampler/retention.d.ts +150 -0
  37. package/payload/platform/plugins/email/mcp/dist/sampler/retention.d.ts.map +1 -0
  38. package/payload/platform/plugins/email/mcp/dist/sampler/retention.js +199 -0
  39. package/payload/platform/plugins/email/mcp/dist/sampler/retention.js.map +1 -0
  40. package/payload/platform/plugins/scheduling/PLUGIN.md +8 -1
  41. package/payload/platform/plugins/scheduling/mcp/dist/index.js +1 -1
  42. package/payload/platform/plugins/scheduling/mcp/dist/index.js.map +1 -1
  43. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-gate-write.test.js +40 -0
  44. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-gate-write.test.js.map +1 -1
  45. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js +322 -4
  46. package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/scheduling-gate.test.js.map +1 -1
  47. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.d.ts.map +1 -1
  48. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js +21 -1
  49. package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-event.js.map +1 -1
  50. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts +236 -6
  51. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.d.ts.map +1 -1
  52. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js +452 -7
  53. package/payload/platform/plugins/scheduling/mcp/dist/tools/scheduling-gate.js.map +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy-code",
3
- "version": "0.1.604",
3
+ "version": "0.1.605",
4
4
  "description": "Install Maxy — AI for Productive People",
5
5
  "bin": {
6
6
  "create-maxy-code": "./dist/index.js"
@@ -34,7 +34,7 @@
34
34
  * routine's prompt only when the stored `routineTemplateVersion` is BELOW this
35
35
  * and no operator has edited the row, so an unbumped edit ships to new installs
36
36
  * and never reaches existing ones — bump it in the same commit as the edit. */
37
- export declare const ROUTINE_TEMPLATE_VERSION = 6;
37
+ export declare const ROUTINE_TEMPLATE_VERSION = 10;
38
38
  /**
39
39
  * Task 2379 — the check shapes a shipped template may name.
40
40
  *
@@ -92,7 +92,35 @@ export interface RoutineGraphUnflaggedCheck {
92
92
  readonly type: "graph-unflagged";
93
93
  readonly label: "ConversationArchive" | "Section";
94
94
  }
95
- export type RoutineGateCheck = RoutineMailCheck | RoutineD1Check | RoutineWhatsappCheck | RoutineCalendarCheck | RoutineTelegramCheck | RoutineGraphCheck | RoutineGraphUnflaggedCheck;
95
+ /** Task 2689 the memory sweep's own state: its two review queues, and whether
96
+ * it has stopped running. No fields, because an account has exactly one sweep
97
+ * and one of each queue. What is compared is a digest, so the routine wakes
98
+ * when a queue moves or the sweep goes silent, never merely because the sweep
99
+ * ran again — it runs hourly and this routine is weekly. */
100
+ /** Task 2688 — records changed in a connector this account registered, since
101
+ * the routine last woke.
102
+ *
103
+ * `scope` is a KIND of connector, never a name: the account describes the
104
+ * queue once, on the connector's own registry record, and the template names
105
+ * only which kind it watches. That is what lets a shipped template gate on a
106
+ * third-party system at all, since it can carry no per-account value (Task
107
+ * 2389). A connector that is not registered, or whose credential is refused,
108
+ * answers quiet, so the routine no-ops rather than erroring every fire. */
109
+ export interface RoutineConnectorCheck {
110
+ readonly type: "connector";
111
+ readonly scope: "operational" | "accounting";
112
+ }
113
+ export interface RoutineSweepCheck {
114
+ readonly type: "sweep";
115
+ }
116
+ /** Task 2689 — growth under the account's own directory since the last accepted
117
+ * wake. `minGrowthBytes` is a size rather than per-account data, so a shipped
118
+ * template may name it and still be correct on every install. */
119
+ export interface RoutineFilesystemCheck {
120
+ readonly type: "filesystem";
121
+ readonly minGrowthBytes?: number;
122
+ }
123
+ export type RoutineGateCheck = RoutineMailCheck | RoutineD1Check | RoutineWhatsappCheck | RoutineCalendarCheck | RoutineTelegramCheck | RoutineGraphCheck | RoutineGraphUnflaggedCheck | RoutineConnectorCheck | RoutineSweepCheck | RoutineFilesystemCheck;
96
124
  /** The plugin and the tool are constants for every roster gate, so a template
97
125
  * carries neither. `hasWork` is true when ANY check is true. */
98
126
  export interface RoutineGate {
@@ -1 +1 @@
1
- {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../src/roster.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH;;;gFAGgF;AAChF,eAAO,MAAM,wBAAwB,IAAI,CAAC;AAE1C;;;;;;;;;GASG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,eAAe,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AACD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,QAAQ,CA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C;AAE3B;iEACiE;AACjE,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,MAAM,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC9C;AAWD;;;;;;;;;;;4DAW4D;AAC5D,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CA+BnE;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAE1D;AAED,MAAM,WAAW,eAAe;IAC9B;;mEAE+D;IAC/D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,sCAAsC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;;6EAGyE;IACzE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B;wEACoE;IACpE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB;;;;2CAIuC;IACvC,QAAQ,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;IAC5B;;;+DAG2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;2BAO2B;AAC3B,wBAAgB,YAAY,CAAC,QAAQ,EAAE,eAAe,GAAG,OAAO,CAI/D;AAkKD;;;;;;;;iFAQiF;AACjF,eAAO,MAAM,cAAc,EAAE,SAAS,eAAe,EA0KpD,CAAC;AAEF;;6DAE6D;AAC7D,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAAqC,CAAC"}
@@ -40,7 +40,7 @@ exports.isClassified = isClassified;
40
40
  * routine's prompt only when the stored `routineTemplateVersion` is BELOW this
41
41
  * and no operator has edited the row, so an unbumped edit ships to new installs
42
42
  * and never reaches existing ones — bump it in the same commit as the edit. */
43
- exports.ROUTINE_TEMPLATE_VERSION = 6;
43
+ exports.ROUTINE_TEMPLATE_VERSION = 10;
44
44
  // Task 2663 — `GATE_COMMIT_TOKEN` is deleted. It stood in for a
45
45
  // `scheduling-gate` call the routine's own turn made to advance its watermark,
46
46
  // and the whole reason it had to be a token was that a template cannot write the
@@ -74,10 +74,23 @@ function isWatermarkedCheck(check) {
74
74
  //
75
75
  // Task 2681 — `graph` compares an ISO `updatedAt` against a stored one, so a
76
76
  // commitless graph gate reports work on every fire exactly as a mail one does.
77
+ //
78
+ // Task 2688 — `connector` holds one position PER registered connector, and
79
+ // compares each against the instant that connector's queue was last read, so
80
+ // it is watermarked for the same reason.
81
+ //
82
+ // Task 2689 — `sweep` compares a digest and `filesystem` compares a byte
83
+ // count, both against a stored value, so both belong here for the same
84
+ // reason. Their positions are promoted by the dispatcher on an accepted wake,
85
+ // which is what makes "since the last report" literal rather than "since the
86
+ // last fire".
77
87
  return (check.type === "mail" ||
78
88
  check.type === "calendar" ||
79
89
  check.type === "telegram" ||
80
- check.type === "graph");
90
+ check.type === "graph" ||
91
+ check.type === "connector" ||
92
+ check.type === "sweep" ||
93
+ check.type === "filesystem");
81
94
  }
82
95
  function gateNeedsCommit(gate) {
83
96
  return gate.checks.some(isWatermarkedCheck);
@@ -142,17 +155,6 @@ Tomorrow: list tomorrow's appointments with outlook-calendar-list or google-cale
142
155
  Say what is unfinished and what tomorrow looks like, in that order, in plain sentences. Do not congratulate, do not summarise the day back, do not pad the message to look thorough.
143
156
 
144
157
  If nothing is waiting, nothing is overdue and tomorrow is empty, end the turn without replying.`;
145
- const APPOINTMENT_REMINDER = `Remind the people attending an appointment that is coming up, so nobody is reminded twice and nobody is missed.
146
-
147
- Call capabilities-here first. If neither a mail plugin nor a messaging channel is enabled, end the turn without replying.
148
-
149
- Find appointments starting within the next reminder window with schedule-list, and read each one's attendees. Resolve each attendee to a person and a contact route with contact-lookup. An attendee you cannot resolve to a route is not a failure to work around: leave them, and say so at the end.
150
-
151
- Send each attendee one reminder on the route they are already reachable on: email-send for a mailbox, whatsapp-reply or the Telegram message tool for a messaging thread that already exists. Carry the time, the place and what the appointment is about. Do not open a new conversation with someone who has never messaged the business.
152
-
153
- Send at most one reminder per attendee per appointment. Before sending, check the appointment's notes for a reminder already recorded, and record the one you send there.
154
-
155
- Reply with one line naming who was reminded and who could not be reached. If no appointment falls in the window, end the turn without replying.`;
156
158
  const COMMITMENT_CHASE = `Find the promises the business has made and not kept, and the promises made to it that nobody has kept.
157
159
 
158
160
  Call capabilities-here first and use only the surfaces it reports.
@@ -269,7 +271,20 @@ exports.ROUTINE_ROSTER = [
269
271
  description: "Sends one morning message covering what needs a decision, what is time-bound and what changed overnight; stays silent when there is nothing worth saying.",
270
272
  recurrence: "30 7 * * 1-5",
271
273
  prompt: START_OF_DAY,
272
- gateless: "A morning briefing is judgement every fire, so a gate would either always pass or suppress the briefing.",
274
+ // Task 2686 the briefing's two gateable arms. `Section` rather than
275
+ // `ConversationArchive` on every email-driven row here: sections are written
276
+ // per ingest, so a reply into a thread this routine already flagged arrives
277
+ // as a fresh unflagged node, while the archive is MERGEd per thread and
278
+ // would stay flagged — muting the routine on the traffic it exists to read.
279
+ // The check names a label and not a source, so any ingested content wakes
280
+ // these rows, which over-wakes and never mutes. The briefing's third arm,
281
+ // open and overdue work, has no check type: Task 2714.
282
+ gate: {
283
+ checks: [
284
+ { type: "graph-unflagged", label: "Section" },
285
+ { type: "graph", scope: "appointments" },
286
+ ],
287
+ },
273
288
  },
274
289
  {
275
290
  key: "inbound-check",
@@ -277,7 +292,10 @@ exports.ROUTINE_ROSTER = [
277
292
  description: "Triages mail that arrived since the last check and writes replies for you to approve; it never sends anything itself.",
278
293
  recurrence: "*/30 9-17 * * 1-5",
279
294
  prompt: INBOUND_CHECK,
280
- gateless: "Conditional on new mail, but the mail check matches an exact mailbox address and no shipped template can name one (Task 2389).",
295
+ // Task 2686 the mail check still cannot name a mailbox, but the sampler
296
+ // puts every inbound message in the graph, so the unflagged-section check
297
+ // reaches the same mail without per-account data.
298
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
281
299
  },
282
300
  {
283
301
  key: "telegram-inbound-check",
@@ -290,18 +308,18 @@ exports.ROUTINE_ROSTER = [
290
308
  {
291
309
  key: "end-of-day",
292
310
  name: "End of day wrap-up",
293
- description: "Closes the day with your unsent drafts, overdue work and tomorrow's diary; says nothing when all three are empty.",
311
+ description: "Closes the day with your unsent drafts, overdue work and tomorrow's diary, once new mail or a diary change has woken it.",
294
312
  recurrence: "0 18 * * 1-5",
295
313
  prompt: END_OF_DAY,
296
- gateless: "A wrap-up is judgement every fire, so no cheap check stands in for reading the three surfaces it reports.",
297
- },
298
- {
299
- key: "appointment-reminder",
300
- name: "Appointment reminders",
301
- description: "Reminds each attendee once before a booked appointment, on a route they already use; it never opens a conversation with a stranger.",
302
- recurrence: "0 * * * *",
303
- prompt: APPOINTMENT_REMINDER,
304
- gateless: "Conditional on an appointment falling in the window, but no check type reads appointments held in the graph (Task 2389).",
314
+ // Task 2686 — the wrap-up wakes on new mail or a diary change. Its other two
315
+ // surfaces, unsent drafts and overdue work, have no check type, so a day
316
+ // whose only outstanding item is one of those is silent until Task 2714.
317
+ gate: {
318
+ checks: [
319
+ { type: "graph-unflagged", label: "Section" },
320
+ { type: "graph", scope: "appointments" },
321
+ ],
322
+ },
305
323
  },
306
324
  {
307
325
  key: "commitment-chase",
@@ -309,7 +327,11 @@ exports.ROUTINE_ROSTER = [
309
327
  description: "Surfaces promises the business made and did not keep, and promises made to it that nobody kept; it reports them rather than chasing them.",
310
328
  recurrence: "0 10 * * 2",
311
329
  prompt: COMMITMENT_CHASE,
312
- gateless: "Whether a promise has been dropped is the judgement itself, so no check can answer it more cheaply.",
330
+ // Task 2686 a dropped promise is a judgement, but the correspondence it
331
+ // judges is not: this wakes when inbound mail it has not read is in the
332
+ // graph. Its outbound arm reads sent mail, which the sampler does not ingest
333
+ // and no shipped template can name a mailbox for: Task 2715.
334
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
313
335
  },
314
336
  {
315
337
  key: "calendar-reconcile",
@@ -327,7 +349,9 @@ exports.ROUTINE_ROSTER = [
327
349
  description: "Reconciles the people you correspond with against the people on record, creating and updating contacts; it never merges two records that might be two people.",
328
350
  recurrence: "45 6 * * 1-5",
329
351
  prompt: CONTACT_RECONCILE,
330
- gateless: "Conditional on new correspondence, but no check type reads correspondence (Task 2389).",
352
+ // Task 2686 correspondence is readable now: the sampler writes it and the
353
+ // unflagged-section check counts what this routine has not reconciled.
354
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
331
355
  },
332
356
  {
333
357
  key: "crm-reconcile",
@@ -335,7 +359,9 @@ exports.ROUTINE_ROSTER = [
335
359
  description: "Brings across what changed in whichever operational system this business runs; it reads only and never writes back to that system.",
336
360
  recurrence: "0 3 * * *",
337
361
  prompt: CRM_RECONCILE,
338
- gateless: "Conditional on connector movement, but no check type reads a connector queue (Task 2389).",
362
+ // Task 2688 wakes when a connector the account registered as its
363
+ // operational system holds records changed since the last accepted wake.
364
+ gate: { checks: [{ type: "connector", scope: "operational" }] },
339
365
  },
340
366
  {
341
367
  key: "finance-reconcile",
@@ -343,7 +369,10 @@ exports.ROUTINE_ROSTER = [
343
369
  description: "Reconciles the accounting system against the internal ledger and reports what does not agree; it never adjusts an entry to make the two sides match.",
344
370
  recurrence: "0 4 * * 1",
345
371
  prompt: FINANCE_RECONCILE,
346
- gateless: "Conditional on accounting movement, but no check type reads an accounting ledger (Task 2389).",
372
+ // Task 2688 wakes on movement in the connector the account registered as
373
+ // its accounting system. A connector that is absent or whose credential is
374
+ // refused answers quiet, so this no-ops rather than erroring every fire.
375
+ gate: { checks: [{ type: "connector", scope: "accounting" }] },
347
376
  },
348
377
  {
349
378
  key: "weekly-digest",
@@ -351,7 +380,15 @@ exports.ROUTINE_ROSTER = [
351
380
  description: "Writes the week in three paragraphs at most: what changed, what is stuck, and what next week turns on.",
352
381
  recurrence: "0 16 * * 5",
353
382
  prompt: WEEKLY_DIGEST,
354
- gateless: "A digest is judgement every fire, and a gate would suppress the report it exists to send.",
383
+ // Task 2686 a week with no correspondence and no diary movement has
384
+ // nothing to report movement on, so the digest is silent rather than
385
+ // writing three paragraphs about a week in which nothing happened.
386
+ gate: {
387
+ checks: [
388
+ { type: "graph-unflagged", label: "Section" },
389
+ { type: "graph", scope: "appointments" },
390
+ ],
391
+ },
355
392
  },
356
393
  {
357
394
  key: "channel-link-check",
@@ -367,7 +404,11 @@ exports.ROUTINE_ROSTER = [
367
404
  description: "Reports what the hourly graph sweep last did and what is waiting for review; it reads only and never runs the sweep itself.",
368
405
  recurrence: "0 9 * * 1",
369
406
  prompt: GRAPH_HEALTH,
370
- gateless: "Reports the sweep's state every fire by design, so there is nothing conditional to check.",
407
+ // Task 2689 — the sweep's state IS the delta. The digest carries the two
408
+ // review-queue counts and whether the sweep has stopped writing reports,
409
+ // never the newest report's identity: the sweep runs hourly, so a digest
410
+ // that moved on every run would make this weekly routine wake every fire.
411
+ gate: { checks: [{ type: "sweep" }] },
371
412
  },
372
413
  {
373
414
  key: "filesystem-health",
@@ -375,7 +416,10 @@ exports.ROUTINE_ROSTER = [
375
416
  description: "Reports what has grown under the account directory and which paths are worth attention; it deletes nothing.",
376
417
  recurrence: "0 9 * * 1",
377
418
  prompt: FILESYSTEM_HEALTH,
378
- gateless: "Reports what has grown every fire by design, so there is nothing conditional to check.",
419
+ // Task 2689 64 MiB of growth under the account directory since the last
420
+ // report. What has ACCUMULATED is the question, so an account that is large
421
+ // and stable has nothing new to say and the routine stays silent.
422
+ gate: { checks: [{ type: "filesystem", minGrowthBytes: 67108864 }] },
379
423
  },
380
424
  ];
381
425
  /** Every roster key, in roster order. The scheduling heartbeat's `op=roster`
@@ -1 +1 @@
1
- {"version":3,"file":"roster.js","sourceRoot":"","sources":["../src/roster.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;;;AAqGH,gDAkBC;AAED,0CAEC;AAwCD,oCAIC;AArKD;;;gFAGgF;AACnE,QAAA,wBAAwB,GAAG,CAAC,CAAC;AA0E1C,gEAAgE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,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE;gBAC7C,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE;aACzC;SACF;KACF;IACD;QACE,GAAG,EAAE,oBAAoB;QACzB,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EACT,qIAAqI;QACvI,UAAU,EAAE,cAAc;QAC1B,MAAM,EAAE,kBAAkB;QAC1B,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC1D;IACD;QACE,GAAG,EAAE,cAAc;QACnB,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,6HAA6H;QAC/H,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,YAAY;QACpB,yEAAyE;QACzE,yEAAyE;QACzE,yEAAyE;QACzE,0EAA0E;QAC1E,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE;KACtC;IACD;QACE,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE,0BAA0B;QAChC,WAAW,EACT,6GAA6G;QAC/G,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,iBAAiB;QACzB,0EAA0E;QAC1E,4EAA4E;QAC5E,kEAAkE;QAClE,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,EAAE;KACrE;CACF,CAAC;AAEF;;6DAE6D;AAChD,QAAA,mBAAmB,GAAsB,sBAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC"}
@@ -415,7 +415,28 @@ describe("gate seeding", () => {
415
415
  expect(byKey.get("channel-link-check")).toBe('[{"type":"whatsapp","scope":"status"}]');
416
416
  expect(byKey.get("calendar-reconcile")).toBe('[{"type":"calendar","connector":"account"},{"type":"graph","scope":"appointments"}]');
417
417
  expect(byKey.get("telegram-inbound-check")).toBe('[{"type":"telegram","scope":"inbound"}]');
418
- expect(byKey.get("weekly-digest")).toBeNull();
418
+ // Task 2686 — weekly-digest is gated now, so the null example moved to a row
419
+ // that is still gateless, and the digest's own two checks are asserted here.
420
+ expect(byKey.get("weekly-digest")).toBe(
421
+ '[{"type":"graph-unflagged","label":"Section"},{"type":"graph","scope":"appointments"}]',
422
+ );
423
+ expect(byKey.get("inbound-check")).toBe('[{"type":"graph-unflagged","label":"Section"}]');
424
+ // Task 2689 — the gateless example is DERIVED rather than named. 2686 gated
425
+ // six rows and moved this assertion onto `graph-health`; 2689 gated
426
+ // `graph-health` and `filesystem-health`, so it moved again. Every row still
427
+ // carrying a reason is a target of 2687 or 2688, so naming one would break
428
+ // on their landing too. When 2691 removes the field, the `!` here throws and
429
+ // points at the assertion that has to go with it.
430
+ // Task 2688 — there is no gateless row left to sample. 2686 gated six rows
431
+ // and moved this assertion onto `graph-health`; 2689 gated `graph-health`
432
+ // and `filesystem-health`, so it moved again; 2687 withdrew
433
+ // `appointment-reminder` and 2688 gated the last two, which leaves the
434
+ // shipped roster carrying no `gateless` reason at all. The seed's null arm
435
+ // is now unreachable from this roster and dies with the field in Task 2691,
436
+ // so what is asserted here is the fact that replaced it: every shipped row
437
+ // seeds serialised checks, and none seeds null.
438
+ expect(ROUTINE_ROSTER.filter((r) => r.gate == null)).toEqual([]);
439
+ expect([...byKey.values()].filter((v) => v === null)).toEqual([]);
419
440
  });
420
441
 
421
442
  it("serialises the checks in exactly one place", () => {
@@ -35,7 +35,7 @@
35
35
  * routine's prompt only when the stored `routineTemplateVersion` is BELOW this
36
36
  * and no operator has edited the row, so an unbumped edit ships to new installs
37
37
  * and never reaches existing ones — bump it in the same commit as the edit. */
38
- export const ROUTINE_TEMPLATE_VERSION = 6;
38
+ export const ROUTINE_TEMPLATE_VERSION = 10;
39
39
 
40
40
  /**
41
41
  * Task 2379 — the check shapes a shipped template may name.
@@ -94,6 +94,34 @@ export interface RoutineGraphUnflaggedCheck {
94
94
  readonly type: "graph-unflagged";
95
95
  readonly label: "ConversationArchive" | "Section";
96
96
  }
97
+ /** Task 2689 — the memory sweep's own state: its two review queues, and whether
98
+ * it has stopped running. No fields, because an account has exactly one sweep
99
+ * and one of each queue. What is compared is a digest, so the routine wakes
100
+ * when a queue moves or the sweep goes silent, never merely because the sweep
101
+ * ran again — it runs hourly and this routine is weekly. */
102
+ /** Task 2688 — records changed in a connector this account registered, since
103
+ * the routine last woke.
104
+ *
105
+ * `scope` is a KIND of connector, never a name: the account describes the
106
+ * queue once, on the connector's own registry record, and the template names
107
+ * only which kind it watches. That is what lets a shipped template gate on a
108
+ * third-party system at all, since it can carry no per-account value (Task
109
+ * 2389). A connector that is not registered, or whose credential is refused,
110
+ * answers quiet, so the routine no-ops rather than erroring every fire. */
111
+ export interface RoutineConnectorCheck {
112
+ readonly type: "connector";
113
+ readonly scope: "operational" | "accounting";
114
+ }
115
+ export interface RoutineSweepCheck {
116
+ readonly type: "sweep";
117
+ }
118
+ /** Task 2689 — growth under the account's own directory since the last accepted
119
+ * wake. `minGrowthBytes` is a size rather than per-account data, so a shipped
120
+ * template may name it and still be correct on every install. */
121
+ export interface RoutineFilesystemCheck {
122
+ readonly type: "filesystem";
123
+ readonly minGrowthBytes?: number;
124
+ }
97
125
  export type RoutineGateCheck =
98
126
  | RoutineMailCheck
99
127
  | RoutineD1Check
@@ -101,7 +129,10 @@ export type RoutineGateCheck =
101
129
  | RoutineCalendarCheck
102
130
  | RoutineTelegramCheck
103
131
  | RoutineGraphCheck
104
- | RoutineGraphUnflaggedCheck;
132
+ | RoutineGraphUnflaggedCheck
133
+ | RoutineConnectorCheck
134
+ | RoutineSweepCheck
135
+ | RoutineFilesystemCheck;
105
136
 
106
137
  /** The plugin and the tool are constants for every roster gate, so a template
107
138
  * carries neither. `hasWork` is true when ANY check is true. */
@@ -142,11 +173,24 @@ export function isWatermarkedCheck(check: RoutineGateCheck): boolean {
142
173
  //
143
174
  // Task 2681 — `graph` compares an ISO `updatedAt` against a stored one, so a
144
175
  // commitless graph gate reports work on every fire exactly as a mail one does.
176
+ //
177
+ // Task 2688 — `connector` holds one position PER registered connector, and
178
+ // compares each against the instant that connector's queue was last read, so
179
+ // it is watermarked for the same reason.
180
+ //
181
+ // Task 2689 — `sweep` compares a digest and `filesystem` compares a byte
182
+ // count, both against a stored value, so both belong here for the same
183
+ // reason. Their positions are promoted by the dispatcher on an accepted wake,
184
+ // which is what makes "since the last report" literal rather than "since the
185
+ // last fire".
145
186
  return (
146
187
  check.type === "mail" ||
147
188
  check.type === "calendar" ||
148
189
  check.type === "telegram" ||
149
- check.type === "graph"
190
+ check.type === "graph" ||
191
+ check.type === "connector" ||
192
+ check.type === "sweep" ||
193
+ check.type === "filesystem"
150
194
  );
151
195
  }
152
196
 
@@ -249,18 +293,6 @@ Say what is unfinished and what tomorrow looks like, in that order, in plain sen
249
293
 
250
294
  If nothing is waiting, nothing is overdue and tomorrow is empty, end the turn without replying.`;
251
295
 
252
- const APPOINTMENT_REMINDER = `Remind the people attending an appointment that is coming up, so nobody is reminded twice and nobody is missed.
253
-
254
- Call capabilities-here first. If neither a mail plugin nor a messaging channel is enabled, end the turn without replying.
255
-
256
- Find appointments starting within the next reminder window with schedule-list, and read each one's attendees. Resolve each attendee to a person and a contact route with contact-lookup. An attendee you cannot resolve to a route is not a failure to work around: leave them, and say so at the end.
257
-
258
- Send each attendee one reminder on the route they are already reachable on: email-send for a mailbox, whatsapp-reply or the Telegram message tool for a messaging thread that already exists. Carry the time, the place and what the appointment is about. Do not open a new conversation with someone who has never messaged the business.
259
-
260
- Send at most one reminder per attendee per appointment. Before sending, check the appointment's notes for a reminder already recorded, and record the one you send there.
261
-
262
- Reply with one line naming who was reminded and who could not be reached. If no appointment falls in the window, end the turn without replying.`;
263
-
264
296
  const COMMITMENT_CHASE = `Find the promises the business has made and not kept, and the promises made to it that nobody has kept.
265
297
 
266
298
  Call capabilities-here first and use only the surfaces it reports.
@@ -387,7 +419,20 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
387
419
  "Sends one morning message covering what needs a decision, what is time-bound and what changed overnight; stays silent when there is nothing worth saying.",
388
420
  recurrence: "30 7 * * 1-5",
389
421
  prompt: START_OF_DAY,
390
- gateless: "A morning briefing is judgement every fire, so a gate would either always pass or suppress the briefing.",
422
+ // Task 2686 the briefing's two gateable arms. `Section` rather than
423
+ // `ConversationArchive` on every email-driven row here: sections are written
424
+ // per ingest, so a reply into a thread this routine already flagged arrives
425
+ // as a fresh unflagged node, while the archive is MERGEd per thread and
426
+ // would stay flagged — muting the routine on the traffic it exists to read.
427
+ // The check names a label and not a source, so any ingested content wakes
428
+ // these rows, which over-wakes and never mutes. The briefing's third arm,
429
+ // open and overdue work, has no check type: Task 2714.
430
+ gate: {
431
+ checks: [
432
+ { type: "graph-unflagged", label: "Section" },
433
+ { type: "graph", scope: "appointments" },
434
+ ],
435
+ },
391
436
  },
392
437
  {
393
438
  key: "inbound-check",
@@ -396,7 +441,10 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
396
441
  "Triages mail that arrived since the last check and writes replies for you to approve; it never sends anything itself.",
397
442
  recurrence: "*/30 9-17 * * 1-5",
398
443
  prompt: INBOUND_CHECK,
399
- gateless: "Conditional on new mail, but the mail check matches an exact mailbox address and no shipped template can name one (Task 2389).",
444
+ // Task 2686 the mail check still cannot name a mailbox, but the sampler
445
+ // puts every inbound message in the graph, so the unflagged-section check
446
+ // reaches the same mail without per-account data.
447
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
400
448
  },
401
449
  {
402
450
  key: "telegram-inbound-check",
@@ -411,19 +459,18 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
411
459
  key: "end-of-day",
412
460
  name: "End of day wrap-up",
413
461
  description:
414
- "Closes the day with your unsent drafts, overdue work and tomorrow's diary; says nothing when all three are empty.",
462
+ "Closes the day with your unsent drafts, overdue work and tomorrow's diary, once new mail or a diary change has woken it.",
415
463
  recurrence: "0 18 * * 1-5",
416
464
  prompt: END_OF_DAY,
417
- gateless: "A wrap-up is judgement every fire, so no cheap check stands in for reading the three surfaces it reports.",
418
- },
419
- {
420
- key: "appointment-reminder",
421
- name: "Appointment reminders",
422
- description:
423
- "Reminds each attendee once before a booked appointment, on a route they already use; it never opens a conversation with a stranger.",
424
- recurrence: "0 * * * *",
425
- prompt: APPOINTMENT_REMINDER,
426
- gateless: "Conditional on an appointment falling in the window, but no check type reads appointments held in the graph (Task 2389).",
465
+ // Task 2686 — the wrap-up wakes on new mail or a diary change. Its other two
466
+ // surfaces, unsent drafts and overdue work, have no check type, so a day
467
+ // whose only outstanding item is one of those is silent until Task 2714.
468
+ gate: {
469
+ checks: [
470
+ { type: "graph-unflagged", label: "Section" },
471
+ { type: "graph", scope: "appointments" },
472
+ ],
473
+ },
427
474
  },
428
475
  {
429
476
  key: "commitment-chase",
@@ -432,7 +479,11 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
432
479
  "Surfaces promises the business made and did not keep, and promises made to it that nobody kept; it reports them rather than chasing them.",
433
480
  recurrence: "0 10 * * 2",
434
481
  prompt: COMMITMENT_CHASE,
435
- gateless: "Whether a promise has been dropped is the judgement itself, so no check can answer it more cheaply.",
482
+ // Task 2686 a dropped promise is a judgement, but the correspondence it
483
+ // judges is not: this wakes when inbound mail it has not read is in the
484
+ // graph. Its outbound arm reads sent mail, which the sampler does not ingest
485
+ // and no shipped template can name a mailbox for: Task 2715.
486
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
436
487
  },
437
488
  {
438
489
  key: "calendar-reconcile",
@@ -452,7 +503,9 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
452
503
  "Reconciles the people you correspond with against the people on record, creating and updating contacts; it never merges two records that might be two people.",
453
504
  recurrence: "45 6 * * 1-5",
454
505
  prompt: CONTACT_RECONCILE,
455
- gateless: "Conditional on new correspondence, but no check type reads correspondence (Task 2389).",
506
+ // Task 2686 correspondence is readable now: the sampler writes it and the
507
+ // unflagged-section check counts what this routine has not reconciled.
508
+ gate: { checks: [{ type: "graph-unflagged", label: "Section" }] },
456
509
  },
457
510
  {
458
511
  key: "crm-reconcile",
@@ -461,7 +514,9 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
461
514
  "Brings across what changed in whichever operational system this business runs; it reads only and never writes back to that system.",
462
515
  recurrence: "0 3 * * *",
463
516
  prompt: CRM_RECONCILE,
464
- gateless: "Conditional on connector movement, but no check type reads a connector queue (Task 2389).",
517
+ // Task 2688 wakes when a connector the account registered as its
518
+ // operational system holds records changed since the last accepted wake.
519
+ gate: { checks: [{ type: "connector", scope: "operational" }] },
465
520
  },
466
521
  {
467
522
  key: "finance-reconcile",
@@ -470,7 +525,10 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
470
525
  "Reconciles the accounting system against the internal ledger and reports what does not agree; it never adjusts an entry to make the two sides match.",
471
526
  recurrence: "0 4 * * 1",
472
527
  prompt: FINANCE_RECONCILE,
473
- gateless: "Conditional on accounting movement, but no check type reads an accounting ledger (Task 2389).",
528
+ // Task 2688 wakes on movement in the connector the account registered as
529
+ // its accounting system. A connector that is absent or whose credential is
530
+ // refused answers quiet, so this no-ops rather than erroring every fire.
531
+ gate: { checks: [{ type: "connector", scope: "accounting" }] },
474
532
  },
475
533
  {
476
534
  key: "weekly-digest",
@@ -479,7 +537,15 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
479
537
  "Writes the week in three paragraphs at most: what changed, what is stuck, and what next week turns on.",
480
538
  recurrence: "0 16 * * 5",
481
539
  prompt: WEEKLY_DIGEST,
482
- gateless: "A digest is judgement every fire, and a gate would suppress the report it exists to send.",
540
+ // Task 2686 a week with no correspondence and no diary movement has
541
+ // nothing to report movement on, so the digest is silent rather than
542
+ // writing three paragraphs about a week in which nothing happened.
543
+ gate: {
544
+ checks: [
545
+ { type: "graph-unflagged", label: "Section" },
546
+ { type: "graph", scope: "appointments" },
547
+ ],
548
+ },
483
549
  },
484
550
  {
485
551
  key: "channel-link-check",
@@ -497,7 +563,11 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
497
563
  "Reports what the hourly graph sweep last did and what is waiting for review; it reads only and never runs the sweep itself.",
498
564
  recurrence: "0 9 * * 1",
499
565
  prompt: GRAPH_HEALTH,
500
- gateless: "Reports the sweep's state every fire by design, so there is nothing conditional to check.",
566
+ // Task 2689 — the sweep's state IS the delta. The digest carries the two
567
+ // review-queue counts and whether the sweep has stopped writing reports,
568
+ // never the newest report's identity: the sweep runs hourly, so a digest
569
+ // that moved on every run would make this weekly routine wake every fire.
570
+ gate: { checks: [{ type: "sweep" }] },
501
571
  },
502
572
  {
503
573
  key: "filesystem-health",
@@ -506,7 +576,10 @@ export const ROUTINE_ROSTER: readonly RoutineTemplate[] = [
506
576
  "Reports what has grown under the account directory and which paths are worth attention; it deletes nothing.",
507
577
  recurrence: "0 9 * * 1",
508
578
  prompt: FILESYSTEM_HEALTH,
509
- gateless: "Reports what has grown every fire by design, so there is nothing conditional to check.",
579
+ // Task 2689 64 MiB of growth under the account directory since the last
580
+ // report. What has ACCUMULATED is the question, so an account that is large
581
+ // and stable has nothing new to say and the routine stays silent.
582
+ gate: { checks: [{ type: "filesystem", minGrowthBytes: 67108864 }] },
510
583
  },
511
584
  ];
512
585
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: platform-architecture
3
3
  description: Use when grounding any documented-surface claim about what Maxy ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
4
- content-hash: sha256:5a02da7ca027a086a15c10f3590e339d181f1854e4573c013d94685e49263436
4
+ content-hash: sha256:6af2c17c66037f12d4a3172828a7db1fef57c3a15e9be8264072e9ae2ae5b362
5
5
  brand: maxy-code
6
6
  product-name: Maxy
7
7
  ---
@@ -4352,9 +4352,9 @@ one, over the same automation set the routes list. The roster seed's own
4352
4352
  `descNull` counter is its narrow twin, scoped to seeded rows and so blind to
4353
4353
  exactly the operator-created ones most likely to carry no caption.
4354
4354
 
4355
- **The shipped roster.** Every account starts with fourteen routines —
4355
+ **The shipped roster.** Every account starts with thirteen routines —
4356
4356
  `start-of-day`, `inbound-check`, `telegram-inbound-check`, `end-of-day`,
4357
- `appointment-reminder`, `commitment-chase`, `calendar-reconcile`,
4357
+ `commitment-chase`, `calendar-reconcile`,
4358
4358
  `contact-reconcile`, `crm-reconcile`, `finance-reconcile`, `weekly-digest`,
4359
4359
  `channel-link-check`, `graph-health`, `filesystem-health`, in `/routines`
4360
4360
  display order. `ROUTINE_ROSTER_KEYS.length`
@@ -9,6 +9,11 @@ Invoked by the admin agent directly.
9
9
 
10
10
  This is the platform's release timeline, newest first. Each entry shows the date it shipped and the version it shipped in, so you can tell the operator how current their install is. To compare, read the installed version from `capabilities-here` and match it against the versions below. Keep answers high level and in plain English; this is a summary, not a full commit log.
11
11
 
12
+ ## 2026-08-14 (0.1.605)
13
+
14
+ - Five more routines now check whether there is anything to do before waking the assistant. Mail triage, appointment reminders, the operational and finance reconciles, and the two health reports all previously ran on the clock and did the deciding after starting up.
15
+ - Email kept in the graph is now pruned on a schedule, so it does not grow without limit.
16
+
12
17
  ## 2026-08-13 (0.1.604)
13
18
 
14
19
  - Your assistant can now read a Telegram conversation back to you, both sides of it, from the record kept on your own machine. Ask for the chat with someone and you get every message they sent and every one the bot sent, in order, with a voice note shown as its transcript and a message they deleted marked as deleted.