@agentshouse/mdmodel 0.1.0-ccb295d7b1fee → 0.1.0-ccb5d0a28eae3

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 (259) hide show
  1. package/API.md +57 -19
  2. package/README.md +1 -0
  3. package/dist/built-in.d.ts.map +1 -1
  4. package/dist/built-in.js +10 -1
  5. package/dist/definition.d.ts +5 -1
  6. package/dist/definition.d.ts.map +1 -1
  7. package/dist/definition.js +79 -10
  8. package/dist/document.d.ts +2 -1
  9. package/dist/document.d.ts.map +1 -1
  10. package/dist/document.js +24 -1
  11. package/dist/event.d.ts +5 -8
  12. package/dist/event.d.ts.map +1 -1
  13. package/dist/event.js +3 -2
  14. package/dist/facts.d.ts.map +1 -1
  15. package/dist/facts.js +8 -4
  16. package/dist/folders.d.ts +5 -0
  17. package/dist/folders.d.ts.map +1 -0
  18. package/dist/folders.js +19 -0
  19. package/dist/house-model.d.ts +200 -18
  20. package/dist/house-model.d.ts.map +1 -1
  21. package/dist/house-model.js +99 -12
  22. package/dist/house-references/patterns.d.ts +5 -1
  23. package/dist/house-references/patterns.d.ts.map +1 -1
  24. package/dist/house-references/patterns.js +8 -1
  25. package/dist/index.d.ts +14 -13
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +11 -10
  28. package/dist/indexed.d.ts +1 -0
  29. package/dist/indexed.d.ts.map +1 -1
  30. package/dist/indexed.js +8 -0
  31. package/dist/kinds.d.ts +6 -1
  32. package/dist/kinds.d.ts.map +1 -1
  33. package/dist/kinds.js +8 -0
  34. package/dist/moment.d.ts +2 -0
  35. package/dist/moment.d.ts.map +1 -1
  36. package/dist/moment.js +22 -0
  37. package/dist/query/language.d.ts +2 -0
  38. package/dist/query/language.d.ts.map +1 -1
  39. package/dist/query/language.js +7 -6
  40. package/dist/query/match.d.ts.map +1 -1
  41. package/dist/query/match.js +3 -24
  42. package/dist/query/rows.d.ts +5 -0
  43. package/dist/query/rows.d.ts.map +1 -1
  44. package/dist/query/rows.js +35 -3
  45. package/dist/query/sql.d.ts +5 -0
  46. package/dist/query/sql.d.ts.map +1 -1
  47. package/dist/query/sql.js +19 -0
  48. package/dist/query/walk.d.ts +10 -0
  49. package/dist/query/walk.d.ts.map +1 -1
  50. package/dist/query/walk.js +15 -1
  51. package/dist/reserved.d.ts +0 -1
  52. package/dist/reserved.d.ts.map +1 -1
  53. package/dist/reserved.js +0 -2
  54. package/dist/room-types.d.ts +2 -1
  55. package/dist/room-types.d.ts.map +1 -1
  56. package/dist/room-types.js +16 -10
  57. package/dist/types.d.ts +10 -0
  58. package/dist/types.d.ts.map +1 -1
  59. package/dist/validate.d.ts +5 -3
  60. package/dist/validate.d.ts.map +1 -1
  61. package/dist/validate.js +100 -42
  62. package/dist/view.d.ts +5 -0
  63. package/dist/view.d.ts.map +1 -0
  64. package/dist/view.js +27 -0
  65. package/fixtures/README.md +25 -5
  66. package/fixtures/cases/absent-link-dangles/{schema.yaml → schema.md} +2 -0
  67. package/fixtures/cases/{boolean-field/schema.yaml → absent-optional-field/schema.md} +2 -0
  68. package/fixtures/cases/{duplicate-link-definition/schema.yaml → absolute-link/schema.md} +2 -0
  69. package/fixtures/cases/{attachment-reference-dangles/schema.yaml → attachment-reference-any-file/schema.md} +2 -0
  70. package/fixtures/cases/{attachment-reference-outside/schema.yaml → attachment-reference-dangles/schema.md} +2 -0
  71. package/fixtures/cases/{list-of-objects-reference/schema.yaml → attachment-reference-outside/schema.md} +2 -0
  72. package/fixtures/cases/binary-any-reference/{schema.yaml → schema.md} +2 -0
  73. package/fixtures/cases/binary-document-collision/{schema.yaml → schema.md} +2 -0
  74. package/fixtures/cases/binary-image-dangles/{schema.yaml → schema.md} +2 -0
  75. package/fixtures/cases/binary-link-dangles/{schema.yaml → schema.md} +2 -0
  76. package/fixtures/cases/binary-link-outside-collection/{schema.yaml → schema.md} +2 -0
  77. package/fixtures/cases/binary-prototype-reference/{schema.yaml → schema.md} +2 -0
  78. package/fixtures/cases/binary-typed-reference/{schema.yaml → schema.md} +2 -0
  79. package/fixtures/cases/{absent-optional-field/schema.yaml → boolean-field/schema.md} +2 -0
  80. package/fixtures/cases/{absolute-link/schema.yaml → bracketed-link-definition/schema.md} +2 -0
  81. package/fixtures/cases/closed-nested-object/{schema.yaml → schema.md} +2 -0
  82. package/fixtures/cases/composed-root-reference/{schema.yaml → schema.md} +2 -0
  83. package/fixtures/cases/conditional-long-text/{schema.yaml → schema.md} +2 -0
  84. package/fixtures/cases/cross-room-link/{schema.yaml → schema.md} +2 -0
  85. package/fixtures/cases/cross-room-reference/{schema.yaml → schema.md} +2 -0
  86. package/fixtures/cases/date-time-format/{schema.yaml → schema.md} +2 -0
  87. package/fixtures/cases/declared-binary-links/schema.md +3 -0
  88. package/fixtures/cases/default-unfilled/schema.md +57 -0
  89. package/fixtures/cases/defs-pattern/schema.md +57 -0
  90. package/fixtures/cases/dependent-rule/schema.md +57 -0
  91. package/fixtures/cases/{bracketed-link-definition/schema.yaml → duplicate-link-definition/schema.md} +2 -0
  92. package/fixtures/cases/email-format/schema.md +57 -0
  93. package/fixtures/cases/equal-labels/{schema.yaml → schema.md} +2 -0
  94. package/fixtures/cases/fenced-link-definition/schema.md +7 -0
  95. package/fixtures/cases/field-enum/{schema.yaml → schema.md} +2 -0
  96. package/fixtures/cases/folder-keeps-a-built-in-type/expected.json +1 -0
  97. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/door.md +3 -0
  98. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/host.md +13 -0
  99. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/map.md +24 -0
  100. package/fixtures/cases/folder-keeps-a-built-in-type/library/tickets/open.md +13 -0
  101. package/fixtures/cases/folder-keeps-a-built-in-type/schema.md +9 -0
  102. package/fixtures/cases/folder-keeps-a-record/context.json +1 -0
  103. package/fixtures/cases/folder-keeps-a-record/expected.json +1 -0
  104. package/fixtures/cases/folder-keeps-a-record/library/tickets/2026-11-16-d_1.r.md +13 -0
  105. package/fixtures/cases/folder-keeps-a-record/library/tickets/door.md +3 -0
  106. package/fixtures/cases/folder-keeps-a-record/schema.md +9 -0
  107. package/fixtures/cases/folder-names-no-type-of-the-schema/context.json +1 -0
  108. package/fixtures/cases/folder-names-no-type-of-the-schema/expected.json +5 -0
  109. package/fixtures/cases/folder-names-no-type-of-the-schema/schema.md +7 -0
  110. package/fixtures/cases/folder-nearer-entry-types-a-document/context.json +1 -0
  111. package/fixtures/cases/folder-nearer-entry-types-a-document/expected.json +6 -0
  112. package/fixtures/cases/folder-nearer-entry-types-a-document/library/tickets/archive/2025/old.md +1 -0
  113. package/fixtures/cases/folder-nearer-entry-types-a-document/schema.md +15 -0
  114. package/fixtures/cases/folder-refuses-a-declared-any/context.json +1 -0
  115. package/fixtures/cases/folder-refuses-a-declared-any/expected.json +6 -0
  116. package/fixtures/cases/folder-refuses-a-declared-any/library/tickets/door.md +5 -0
  117. package/fixtures/cases/folder-refuses-a-declared-any/schema.md +9 -0
  118. package/fixtures/cases/folder-refuses-another-declared-type/context.json +1 -0
  119. package/fixtures/cases/folder-refuses-another-declared-type/expected.json +6 -0
  120. package/fixtures/cases/folder-refuses-another-declared-type/library/tickets/door.md +5 -0
  121. package/fixtures/cases/folder-refuses-another-declared-type/schema.md +12 -0
  122. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/context.json +1 -0
  123. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/expected.json +1 -0
  124. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/notes/plan.md +7 -0
  125. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/door.md +3 -0
  126. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/library/tickets/gate.md +7 -0
  127. package/fixtures/cases/folder-type-is-the-type-a-reference-reaches/schema.md +13 -0
  128. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/context.json +1 -0
  129. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/expected.json +6 -0
  130. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/library/tickets/2026/gate.md +1 -0
  131. package/fixtures/cases/folder-types-a-document-in-a-folder-below-it/schema.md +9 -0
  132. package/fixtures/cases/folder-types-a-document-that-names-no-type/context.json +1 -0
  133. package/fixtures/cases/folder-types-a-document-that-names-no-type/expected.json +7 -0
  134. package/fixtures/cases/folder-types-a-document-that-names-no-type/library/tickets/door.md +3 -0
  135. package/fixtures/cases/folder-types-a-document-that-names-no-type/schema.md +9 -0
  136. package/fixtures/cases/folder-under-a-reserved-name/context.json +1 -0
  137. package/fixtures/cases/folder-under-a-reserved-name/expected.json +5 -0
  138. package/fixtures/cases/folder-under-a-reserved-name/schema.md +7 -0
  139. package/fixtures/cases/folder-without-a-trailing-slash/context.json +1 -0
  140. package/fixtures/cases/folder-without-a-trailing-slash/expected.json +5 -0
  141. package/fixtures/cases/folder-without-a-trailing-slash/schema.md +7 -0
  142. package/fixtures/cases/integer-field/schema.md +57 -0
  143. package/fixtures/cases/interrupted-link-definition/schema.md +3 -0
  144. package/fixtures/cases/json-schema-constructs/schema.md +57 -0
  145. package/fixtures/cases/labels-in-the-rooms-language/{schema.yaml → schema.md} +2 -0
  146. package/fixtures/cases/lazy-list-item/{schema.yaml → schema.md} +2 -0
  147. package/fixtures/cases/link-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  148. package/fixtures/cases/list-item-enum/{schema.yaml → schema.md} +2 -0
  149. package/fixtures/cases/list-item-kind/{schema.yaml → schema.md} +2 -0
  150. package/fixtures/cases/list-items/{schema.yaml → schema.md} +2 -0
  151. package/fixtures/cases/list-of-objects-closed/schema.md +57 -0
  152. package/fixtures/cases/list-of-objects-item/schema.md +57 -0
  153. package/fixtures/cases/{attachment-reference-any-file/schema.yaml → list-of-objects-reference/schema.md} +2 -0
  154. package/fixtures/cases/list-reference-path/{schema.yaml → schema.md} +2 -0
  155. package/fixtures/cases/list-reference-type/{schema.yaml → schema.md} +2 -0
  156. package/fixtures/cases/list-size/schema.md +57 -0
  157. package/fixtures/cases/long-fence-link-definition/schema.md +3 -0
  158. package/fixtures/cases/long-value-past-six-levels/{schema.yaml → schema.md} +2 -0
  159. package/fixtures/cases/malformed-definition/{schema.yaml → schema.md} +2 -0
  160. package/fixtures/cases/malformed-list/{schema.yaml → schema.md} +2 -0
  161. package/fixtures/cases/member-document/{schema.yaml → schema.md} +2 -0
  162. package/fixtures/cases/member-on-another-type/{schema.yaml → schema.md} +2 -0
  163. package/fixtures/cases/missing-required-field/{schema.yaml → schema.md} +2 -0
  164. package/fixtures/cases/misspelled-key/schema.md +57 -0
  165. package/fixtures/cases/name-not-a-string/{schema.yaml → schema.md} +2 -0
  166. package/fixtures/cases/nested-defs/{schema.yaml → schema.md} +2 -0
  167. package/fixtures/cases/nested-object-reference/schema.md +34 -0
  168. package/fixtures/cases/nested-reference/schema.md +34 -0
  169. package/fixtures/cases/nested-required-field/schema.md +57 -0
  170. package/fixtures/cases/numeric-range/schema.md +57 -0
  171. package/fixtures/cases/one-key-two-labels/{schema.yaml → schema.md} +2 -0
  172. package/fixtures/cases/one-key-two-types/{schema.yaml → schema.md} +2 -0
  173. package/fixtures/cases/one-of-variant/schema.md +57 -0
  174. package/fixtures/cases/other-room-reference/schema.md +34 -0
  175. package/fixtures/cases/paragraph-link-definition/schema.md +3 -0
  176. package/fixtures/cases/prototype-field/schema.md +7 -0
  177. package/fixtures/cases/quoted-link-definition/schema.md +3 -0
  178. package/fixtures/cases/reference-into-a-reserved-name/{schema.yaml → schema.md} +2 -0
  179. package/fixtures/cases/reference-to-any-file-name/{schema.yaml → schema.md} +2 -0
  180. package/fixtures/cases/referenced-missing-file/{schema.yaml → schema.md} +2 -0
  181. package/fixtures/cases/referenced-missing-non-latin-file/{schema.yaml → schema.md} +2 -0
  182. package/fixtures/cases/remote-ref/{schema.yaml → schema.md} +2 -0
  183. package/fixtures/cases/schema-body-ignored/context.json +1 -0
  184. package/fixtures/cases/schema-body-ignored/expected.json +1 -0
  185. package/fixtures/cases/schema-body-ignored/schema.md +9 -0
  186. package/fixtures/cases/schema-type-named-folders/context.json +1 -0
  187. package/fixtures/cases/schema-type-named-folders/expected.json +5 -0
  188. package/fixtures/cases/schema-type-named-folders/schema.md +5 -0
  189. package/fixtures/cases/schema-type-named-type/context.json +1 -0
  190. package/fixtures/cases/schema-type-named-type/expected.json +5 -0
  191. package/fixtures/cases/{unknown-type/schema.yaml → schema-type-named-type/schema.md} +3 -1
  192. package/fixtures/cases/second-member-document/{schema.yaml → schema.md} +2 -0
  193. package/fixtures/cases/sections-keyword-refused/{schema.yaml → schema.md} +2 -0
  194. package/fixtures/cases/shortcut-reference-link/schema.md +7 -0
  195. package/fixtures/cases/string-length/schema.md +57 -0
  196. package/fixtures/cases/submission-keys/{schema.yaml → schema.md} +2 -0
  197. package/fixtures/cases/text-field-kind/{schema.yaml → schema.md} +2 -0
  198. package/fixtures/cases/thematic-break-ends-the-values/{schema.yaml → schema.md} +2 -0
  199. package/fixtures/cases/truncated-link-definition/schema.md +3 -0
  200. package/fixtures/cases/typed-path-names-another-type/{schema.yaml → schema.md} +2 -0
  201. package/fixtures/cases/typed-path-names-its-type/{schema.yaml → schema.md} +2 -0
  202. package/fixtures/cases/typed-path-names-no-type/{schema.yaml → schema.md} +2 -0
  203. package/fixtures/cases/types-folder-content/{schema.yaml → schema.md} +2 -0
  204. package/fixtures/cases/undeclared-field/schema.md +7 -0
  205. package/fixtures/cases/unevaluated-items-closed/{schema.yaml → schema.md} +2 -0
  206. package/fixtures/cases/unique-in-app-schema/context.json +1 -0
  207. package/fixtures/cases/unique-in-app-schema/expected.json +5 -0
  208. package/fixtures/cases/unique-in-app-schema/schema.yaml +7 -0
  209. package/fixtures/cases/unique-indexed-field/context.json +1 -0
  210. package/fixtures/cases/unique-indexed-field/expected.json +1 -0
  211. package/fixtures/cases/unique-indexed-field/library/tickets/first.md +8 -0
  212. package/fixtures/cases/unique-indexed-field/library/tickets/second.md +8 -0
  213. package/fixtures/cases/unique-indexed-field/schema.md +9 -0
  214. package/fixtures/cases/unique-off-indexed-field/context.json +1 -0
  215. package/fixtures/cases/unique-off-indexed-field/expected.json +5 -0
  216. package/fixtures/cases/unique-off-indexed-field/schema.md +9 -0
  217. package/fixtures/cases/unlisted-reference-type/{schema.yaml → schema.md} +2 -0
  218. package/fixtures/cases/unnamed-typed-path-checks-its-fields/{schema.yaml → schema.md} +2 -0
  219. package/fixtures/cases/unnamed-typed-path-names-a-type/{schema.yaml → schema.md} +2 -0
  220. package/fixtures/cases/unnamed-typed-path-reads-its-type/{schema.yaml → schema.md} +2 -0
  221. package/fixtures/cases/unnamed-typed-path-without-a-body/{schema.yaml → schema.md} +2 -0
  222. package/fixtures/cases/unresolved-link/schema.md +7 -0
  223. package/fixtures/cases/valid-typed-document/{schema.yaml → schema.md} +2 -0
  224. package/fixtures/cases/wide-item-fence-link/schema.md +3 -0
  225. package/fixtures/queries.json +776 -1
  226. package/fixtures/references.json +15 -0
  227. package/package.json +2 -2
  228. package/fixtures/cases/declared-binary-links/schema.yaml +0 -1
  229. package/fixtures/cases/default-unfilled/schema.yaml +0 -55
  230. package/fixtures/cases/defs-pattern/schema.yaml +0 -55
  231. package/fixtures/cases/dependent-rule/schema.yaml +0 -55
  232. package/fixtures/cases/email-format/schema.yaml +0 -55
  233. package/fixtures/cases/fenced-link-definition/schema.yaml +0 -5
  234. package/fixtures/cases/frontmatter-schema/expected.json +0 -5
  235. package/fixtures/cases/integer-field/schema.yaml +0 -55
  236. package/fixtures/cases/interrupted-link-definition/schema.yaml +0 -1
  237. package/fixtures/cases/json-schema-constructs/schema.yaml +0 -55
  238. package/fixtures/cases/list-of-objects-closed/schema.yaml +0 -55
  239. package/fixtures/cases/list-of-objects-item/schema.yaml +0 -55
  240. package/fixtures/cases/list-size/schema.yaml +0 -55
  241. package/fixtures/cases/long-fence-link-definition/schema.yaml +0 -1
  242. package/fixtures/cases/misspelled-key/schema.yaml +0 -55
  243. package/fixtures/cases/nested-object-reference/schema.yaml +0 -32
  244. package/fixtures/cases/nested-reference/schema.yaml +0 -32
  245. package/fixtures/cases/nested-required-field/schema.yaml +0 -55
  246. package/fixtures/cases/numeric-range/schema.yaml +0 -55
  247. package/fixtures/cases/one-of-variant/schema.yaml +0 -55
  248. package/fixtures/cases/other-room-reference/schema.yaml +0 -32
  249. package/fixtures/cases/paragraph-link-definition/schema.yaml +0 -1
  250. package/fixtures/cases/prototype-field/schema.yaml +0 -5
  251. package/fixtures/cases/quoted-link-definition/schema.yaml +0 -1
  252. package/fixtures/cases/shortcut-reference-link/schema.yaml +0 -5
  253. package/fixtures/cases/string-length/schema.yaml +0 -55
  254. package/fixtures/cases/truncated-link-definition/schema.yaml +0 -1
  255. package/fixtures/cases/undeclared-field/schema.yaml +0 -5
  256. package/fixtures/cases/unresolved-link/schema.yaml +0 -5
  257. package/fixtures/cases/wide-item-fence-link/schema.yaml +0 -1
  258. /package/fixtures/cases/{frontmatter-schema → folder-keeps-a-built-in-type}/context.json +0 -0
  259. /package/fixtures/cases/{frontmatter-schema/schema.yaml → unknown-type/schema.md} +0 -0
@@ -1,5 +1,8 @@
1
1
  {
2
- "schema": "task:\n type: object\n properties:\n title: { type: string }\n status: { enum: [open, done] }\n due: { type: string, format: date }\n at: { type: string, format: date-time }\n ends: { type: [string, \"null\"], format: date-time }\n place:\n type: object\n properties:\n city: { type: string }\n starts: { type: string, format: time }\n points: { type: number }\n count: { type: integer }\n done: { type: boolean }\n priority: { type: integer, enum: [1, 2, 3] }\n flagged: { enum: [true, false] }\n tier: { enum: [1, 2, null] }\n rank: { enum: [1, high] }\n code: { type: string, maxLength: 12 }\n owner: { type: string, reference: person }\n labels: { type: array, items: { type: string } }\n times: { type: array, items: { type: string, format: date-time } }\n steps:\n type: array\n items:\n type: object\n properties:\n name: { type: string }\n at: { type: string, format: date-time }\n indexed: [status, due, at, ends, starts, points, count, done, tier, code]\nperson:\n type: object\n properties:\n name: { type: string }\n",
2
+ "schema": "task:\n type: object\n properties:\n title: { type: string }\n status: { enum: [open, done] }\n due: { type: string, format: date }\n at: { type: string, format: date-time }\n ends: { type: [string, \"null\"], format: date-time }\n place:\n type: object\n properties:\n city: { type: string }\n starts: { type: string, format: time }\n points: { type: number }\n count: { type: integer }\n done: { type: boolean }\n priority: { type: integer, enum: [1, 2, 3] }\n flagged: { enum: [true, false] }\n tier: { enum: [1, 2, null] }\n rank: { enum: [1, high] }\n code: { type: string, maxLength: 12 }\n owner: { type: string, reference: person }\n blocked_by: { type: array, items: { type: string, reference: task } }\n watchers: { type: array, items: { type: string, reference: person, cross_room: true } }\n labels: { type: array, items: { type: string } }\n times: { type: array, items: { type: string, format: date-time } }\n steps:\n type: array\n items:\n type: object\n properties:\n name: { type: string }\n at: { type: string, format: date-time }\n indexed: [status, due, at, ends, starts, points, count, done, tier, code]\nperson:\n type: object\n properties:\n name: { type: string }\nrecord:\n type: object\n properties:\n path: { type: string }\n received:\n type: object\n properties:\n at: { type: string, format: date-time }\n through: { type: string }\n by: { type: string }\n key: { type: string }\n original: { type: string }\n claimed: { type: object }\n json: { type: object }\nactor:\n type: object\n properties:\n user: { type: string }\n door: { enum: [browser, client, environment, function] }\n",
3
+ "reads": [
4
+ "team"
5
+ ],
3
6
  "documents": {
4
7
  "task": {
5
8
  "path": "tasks/one.md",
@@ -8,6 +11,9 @@
8
11
  "text": "# One\n\nShip the release on Friday.\n",
9
12
  "fields": {
10
13
  "title": "Ship the release",
14
+ "watchers": [
15
+ "/rooms/team/people/gone.md"
16
+ ],
11
17
  "status": "open",
12
18
  "due": "2026-10-30",
13
19
  "at": "2026-10-30T10:00:00+02:00",
@@ -16,6 +22,10 @@
16
22
  "count": 2,
17
23
  "done": false,
18
24
  "owner": "../people/ada.md",
25
+ "blocked_by": [
26
+ "two.md",
27
+ "three.md"
28
+ ],
19
29
  "labels": [
20
30
  "urgent",
21
31
  "home"
@@ -42,6 +52,7 @@
42
52
  "status": "done",
43
53
  "ends": null,
44
54
  "labels": [],
55
+ "blocked_by": [],
45
56
  "code": "Zeta"
46
57
  }
47
58
  },
@@ -52,6 +63,10 @@
52
63
  "text": null,
53
64
  "fields": {
54
65
  "title": "Three",
66
+ "watchers": [
67
+ "/rooms/vault/people/ada.md",
68
+ "/rooms/team/people/lin.md"
69
+ ],
55
70
  "status": "open",
56
71
  "at": "2026-10-30 08:00:00Z",
57
72
  "times": [
@@ -85,6 +100,12 @@
85
100
  "text": null,
86
101
  "fields": {
87
102
  "title": "Four",
103
+ "watchers": [
104
+ "/rooms/team/people/ada.md"
105
+ ],
106
+ "blocked_by": [
107
+ "two.md"
108
+ ],
88
109
  "status": "done",
89
110
  "due": "2025-12-31",
90
111
  "at": "2026-10-29T23:30:00-10:00",
@@ -104,6 +125,12 @@
104
125
  "text": null,
105
126
  "fields": {
106
127
  "title": "Five",
128
+ "watchers": [
129
+ "/rooms/team/people/lin.md"
130
+ ],
131
+ "blocked_by": [
132
+ "three.md"
133
+ ],
107
134
  "status": "open",
108
135
  "due": "2026-01-05",
109
136
  "at": "2026-10-30T07:59:59.999999999Z",
@@ -123,6 +150,12 @@
123
150
  "text": null,
124
151
  "fields": {
125
152
  "title": "Six",
153
+ "watchers": [
154
+ "/rooms/vault/people/ada.md"
155
+ ],
156
+ "blocked_by": [
157
+ "gone.md"
158
+ ],
126
159
  "status": "done",
127
160
  "due": "2026-10-30",
128
161
  "at": "2026-10-30T09:00:00Z",
@@ -142,6 +175,10 @@
142
175
  "text": null,
143
176
  "fields": {
144
177
  "title": "Seven",
178
+ "watchers": [
179
+ "/rooms/vault/people/ada.md",
180
+ "/rooms/team/people/ada.md"
181
+ ],
145
182
  "ends": "2026-10-30T08:00:00.000000001Z",
146
183
  "starts": "09:30:00Z",
147
184
  "points": null,
@@ -150,6 +187,125 @@
150
187
  "tier": 2,
151
188
  "code": "alpha"
152
189
  }
190
+ },
191
+ "team-ada": {
192
+ "room": "team",
193
+ "path": "people/ada.md",
194
+ "type": "person",
195
+ "fileId": null,
196
+ "text": null,
197
+ "fields": {
198
+ "name": "Ada"
199
+ }
200
+ },
201
+ "team-lin": {
202
+ "room": "team",
203
+ "path": "people/lin.md",
204
+ "type": "person",
205
+ "fileId": null,
206
+ "text": null,
207
+ "fields": {
208
+ "name": "Lin"
209
+ }
210
+ },
211
+ "vault-ada": {
212
+ "room": "vault",
213
+ "path": "people/ada.md",
214
+ "type": "person",
215
+ "fileId": null,
216
+ "text": null,
217
+ "fields": {
218
+ "name": "Ada"
219
+ }
220
+ },
221
+ "push-record": {
222
+ "path": "payments/stripe/2026-11-16-d_1j.4.md",
223
+ "type": "record",
224
+ "fileId": "file-push-record",
225
+ "text": null,
226
+ "fields": {
227
+ "path": "payments/stripe/2026-11-16-d_1j.4.md",
228
+ "received": {
229
+ "at": "2026-11-16T09:12:03Z",
230
+ "through": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a7b",
231
+ "key": "evt_1Q2w3E"
232
+ },
233
+ "claimed": {
234
+ "headers": {
235
+ "content-type": "application/json",
236
+ "stripe-signature": "t=1731748323,v1=5257a8"
237
+ }
238
+ },
239
+ "json": {
240
+ "type": "invoice.paid",
241
+ "data": {
242
+ "object": {
243
+ "status": "paid",
244
+ "amount": 1200
245
+ }
246
+ }
247
+ }
248
+ }
249
+ },
250
+ "mailed-record": {
251
+ "path": "mail/inbox/quote-for-the-garden.md",
252
+ "type": "record",
253
+ "fileId": "file-mailed-record",
254
+ "text": null,
255
+ "fields": {
256
+ "path": "mail/inbox/quote-for-the-garden.md",
257
+ "received": {
258
+ "at": "2026-11-16T09:20:41Z",
259
+ "by": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a7c",
260
+ "key": "<CAF=quote@example.com>",
261
+ "original": "quote-for-the-garden.eml"
262
+ },
263
+ "claimed": {
264
+ "from": "Sam Ortiz <sam@example.com>",
265
+ "date": "Sat, 15 Nov 2026 18:02:11 +0100",
266
+ "subject": "Quote for the garden"
267
+ }
268
+ }
269
+ },
270
+ "browser-actor": {
271
+ "path": "actors/browser.md",
272
+ "type": "actor",
273
+ "fileId": "file-browser-actor",
274
+ "text": null,
275
+ "fields": {
276
+ "user": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a70",
277
+ "door": "browser"
278
+ }
279
+ },
280
+ "client-actor": {
281
+ "path": "actors/client.md",
282
+ "type": "actor",
283
+ "fileId": "file-client-actor",
284
+ "text": null,
285
+ "fields": {
286
+ "user": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a70",
287
+ "door": "client"
288
+ }
289
+ },
290
+ "environment-actor": {
291
+ "path": "actors/environment.md",
292
+ "type": "actor",
293
+ "fileId": "file-environment-actor",
294
+ "text": null,
295
+ "fields": {
296
+ "user": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a70",
297
+ "door": "environment"
298
+ }
299
+ },
300
+ "function-actor": {
301
+ "path": "actors/function.md",
302
+ "type": "actor",
303
+ "fileId": "file-function-actor",
304
+ "text": null,
305
+ "fields": {
306
+ "user": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a70",
307
+ "door": "function"
308
+ }
153
309
  }
154
310
  },
155
311
  "cases": [
@@ -1242,6 +1398,625 @@
1242
1398
  },
1243
1399
  "document": "task",
1244
1400
  "matches": true
1401
+ },
1402
+ {
1403
+ "name": "a hop keeps a Document whose reference names a matching Document",
1404
+ "query": {
1405
+ "hop": {
1406
+ "field": "/blocked_by",
1407
+ "where": {
1408
+ "/status": "open"
1409
+ }
1410
+ }
1411
+ },
1412
+ "document": "task-five",
1413
+ "matches": true,
1414
+ "refusedInMemory": "hop"
1415
+ },
1416
+ {
1417
+ "name": "a hop leaves out a Document whose references name no matching Document",
1418
+ "query": {
1419
+ "hop": {
1420
+ "field": "/blocked_by",
1421
+ "where": {
1422
+ "/status": "open"
1423
+ }
1424
+ }
1425
+ },
1426
+ "document": "task-four",
1427
+ "matches": false,
1428
+ "refusedInMemory": "hop"
1429
+ },
1430
+ {
1431
+ "name": "a hop keeps a list naming one matching Document and one that is not",
1432
+ "query": {
1433
+ "hop": {
1434
+ "field": "/blocked_by",
1435
+ "where": {
1436
+ "/status": "open"
1437
+ }
1438
+ }
1439
+ },
1440
+ "document": "task",
1441
+ "matches": true,
1442
+ "refusedInMemory": "hop"
1443
+ },
1444
+ {
1445
+ "name": "a hop leaves out an empty reference list",
1446
+ "query": {
1447
+ "hop": {
1448
+ "field": "/blocked_by",
1449
+ "where": {
1450
+ "/status": "open"
1451
+ }
1452
+ }
1453
+ },
1454
+ "document": "bare-task",
1455
+ "matches": false,
1456
+ "refusedInMemory": "hop"
1457
+ },
1458
+ {
1459
+ "name": "a hop leaves out a missing reference field",
1460
+ "query": {
1461
+ "hop": {
1462
+ "field": "/blocked_by",
1463
+ "where": {
1464
+ "/status": "open"
1465
+ }
1466
+ }
1467
+ },
1468
+ "document": "spaced-task",
1469
+ "matches": false,
1470
+ "refusedInMemory": "hop"
1471
+ },
1472
+ {
1473
+ "name": "a hop leaves out a reference to no Document",
1474
+ "query": {
1475
+ "hop": {
1476
+ "field": "/blocked_by",
1477
+ "where": {
1478
+ "/status": "open"
1479
+ }
1480
+ }
1481
+ },
1482
+ "document": "task-six",
1483
+ "matches": false,
1484
+ "refusedInMemory": "hop"
1485
+ },
1486
+ {
1487
+ "name": "none leaves out a Document whose reference names a matching Document",
1488
+ "query": {
1489
+ "hop": {
1490
+ "field": "/blocked_by",
1491
+ "where": {
1492
+ "/status": "open"
1493
+ },
1494
+ "none": true
1495
+ }
1496
+ },
1497
+ "document": "task-five",
1498
+ "matches": false,
1499
+ "refusedInMemory": "hop"
1500
+ },
1501
+ {
1502
+ "name": "none keeps a Document whose references name no matching Document",
1503
+ "query": {
1504
+ "hop": {
1505
+ "field": "/blocked_by",
1506
+ "where": {
1507
+ "/status": "open"
1508
+ },
1509
+ "none": true
1510
+ }
1511
+ },
1512
+ "document": "task-four",
1513
+ "matches": true,
1514
+ "refusedInMemory": "hop"
1515
+ },
1516
+ {
1517
+ "name": "none leaves out a list naming one matching Document and one that is not",
1518
+ "query": {
1519
+ "hop": {
1520
+ "field": "/blocked_by",
1521
+ "where": {
1522
+ "/status": "open"
1523
+ },
1524
+ "none": true
1525
+ }
1526
+ },
1527
+ "document": "task",
1528
+ "matches": false,
1529
+ "refusedInMemory": "hop"
1530
+ },
1531
+ {
1532
+ "name": "none keeps an empty reference list",
1533
+ "query": {
1534
+ "hop": {
1535
+ "field": "/blocked_by",
1536
+ "where": {
1537
+ "/status": "open"
1538
+ },
1539
+ "none": true
1540
+ }
1541
+ },
1542
+ "document": "bare-task",
1543
+ "matches": true,
1544
+ "refusedInMemory": "hop"
1545
+ },
1546
+ {
1547
+ "name": "none keeps a missing reference field",
1548
+ "query": {
1549
+ "hop": {
1550
+ "field": "/blocked_by",
1551
+ "where": {
1552
+ "/status": "open"
1553
+ },
1554
+ "none": true
1555
+ }
1556
+ },
1557
+ "document": "spaced-task",
1558
+ "matches": true,
1559
+ "refusedInMemory": "hop"
1560
+ },
1561
+ {
1562
+ "name": "none keeps a reference to no Document",
1563
+ "query": {
1564
+ "hop": {
1565
+ "field": "/blocked_by",
1566
+ "where": {
1567
+ "/status": "open"
1568
+ },
1569
+ "none": true
1570
+ }
1571
+ },
1572
+ "document": "task-six",
1573
+ "matches": true,
1574
+ "refusedInMemory": "hop"
1575
+ },
1576
+ {
1577
+ "name": "none keeps a Document whose referenced Document is of a type the hop does not name",
1578
+ "query": {
1579
+ "hop": {
1580
+ "field": "/blocked_by",
1581
+ "types": [
1582
+ "person"
1583
+ ],
1584
+ "none": true
1585
+ }
1586
+ },
1587
+ "document": "task-five",
1588
+ "matches": true,
1589
+ "refusedInMemory": "hop"
1590
+ },
1591
+ {
1592
+ "name": "a hop keeps a Document whose reference names a matching Document of another Room it reads",
1593
+ "query": {
1594
+ "hop": {
1595
+ "field": "/watchers",
1596
+ "where": {
1597
+ "/name": "Ada"
1598
+ }
1599
+ }
1600
+ },
1601
+ "document": "task-four",
1602
+ "matches": true,
1603
+ "refusedInMemory": "hop"
1604
+ },
1605
+ {
1606
+ "name": "a hop leaves out a Document whose reference names a Document of another Room it reads that does not match",
1607
+ "query": {
1608
+ "hop": {
1609
+ "field": "/watchers",
1610
+ "where": {
1611
+ "/name": "Ada"
1612
+ }
1613
+ }
1614
+ },
1615
+ "document": "task-five",
1616
+ "matches": false,
1617
+ "refusedInMemory": "hop"
1618
+ },
1619
+ {
1620
+ "name": "a hop matches nothing through a reference into a Room it does not read",
1621
+ "query": {
1622
+ "hop": {
1623
+ "field": "/watchers",
1624
+ "where": {
1625
+ "/name": "Ada"
1626
+ }
1627
+ }
1628
+ },
1629
+ "document": "task-six",
1630
+ "matches": false,
1631
+ "refusedInMemory": "hop"
1632
+ },
1633
+ {
1634
+ "name": "a hop keeps a list naming a matching Document of another Room beside one in a Room it does not read",
1635
+ "query": {
1636
+ "hop": {
1637
+ "field": "/watchers",
1638
+ "where": {
1639
+ "/name": "Ada"
1640
+ }
1641
+ }
1642
+ },
1643
+ "document": "task-seven",
1644
+ "matches": true,
1645
+ "refusedInMemory": "hop"
1646
+ },
1647
+ {
1648
+ "name": "a hop leaves out a list naming a Document of another Room that does not match beside one in a Room it does not read",
1649
+ "query": {
1650
+ "hop": {
1651
+ "field": "/watchers",
1652
+ "where": {
1653
+ "/name": "Ada"
1654
+ }
1655
+ }
1656
+ },
1657
+ "document": "spaced-task",
1658
+ "matches": false,
1659
+ "refusedInMemory": "hop"
1660
+ },
1661
+ {
1662
+ "name": "a hop leaves out a reference to no Document in another Room it reads",
1663
+ "query": {
1664
+ "hop": {
1665
+ "field": "/watchers",
1666
+ "where": {
1667
+ "/name": "Ada"
1668
+ }
1669
+ }
1670
+ },
1671
+ "document": "task",
1672
+ "matches": false,
1673
+ "refusedInMemory": "hop"
1674
+ },
1675
+ {
1676
+ "name": "none leaves out a Document whose reference names a matching Document of another Room it reads",
1677
+ "query": {
1678
+ "hop": {
1679
+ "field": "/watchers",
1680
+ "where": {
1681
+ "/name": "Ada"
1682
+ },
1683
+ "none": true
1684
+ }
1685
+ },
1686
+ "document": "task-four",
1687
+ "matches": false,
1688
+ "refusedInMemory": "hop"
1689
+ },
1690
+ {
1691
+ "name": "none keeps a Document whose reference names a Document of another Room it reads that does not match",
1692
+ "query": {
1693
+ "hop": {
1694
+ "field": "/watchers",
1695
+ "where": {
1696
+ "/name": "Ada"
1697
+ },
1698
+ "none": true
1699
+ }
1700
+ },
1701
+ "document": "task-five",
1702
+ "matches": true,
1703
+ "refusedInMemory": "hop"
1704
+ },
1705
+ {
1706
+ "name": "none leaves out a Document whose reference names a Room it does not read",
1707
+ "query": {
1708
+ "hop": {
1709
+ "field": "/watchers",
1710
+ "where": {
1711
+ "/name": "Ada"
1712
+ },
1713
+ "none": true
1714
+ }
1715
+ },
1716
+ "document": "task-six",
1717
+ "matches": false,
1718
+ "refusedInMemory": "hop"
1719
+ },
1720
+ {
1721
+ "name": "none leaves out a list naming a matching Document of another Room beside one in a Room it does not read",
1722
+ "query": {
1723
+ "hop": {
1724
+ "field": "/watchers",
1725
+ "where": {
1726
+ "/name": "Ada"
1727
+ },
1728
+ "none": true
1729
+ }
1730
+ },
1731
+ "document": "task-seven",
1732
+ "matches": false,
1733
+ "refusedInMemory": "hop"
1734
+ },
1735
+ {
1736
+ "name": "none leaves out a list naming a Document of another Room that does not match beside one in a Room it does not read",
1737
+ "query": {
1738
+ "hop": {
1739
+ "field": "/watchers",
1740
+ "where": {
1741
+ "/name": "Ada"
1742
+ },
1743
+ "none": true
1744
+ }
1745
+ },
1746
+ "document": "spaced-task",
1747
+ "matches": false,
1748
+ "refusedInMemory": "hop"
1749
+ },
1750
+ {
1751
+ "name": "none keeps a reference to no Document in another Room it reads",
1752
+ "query": {
1753
+ "hop": {
1754
+ "field": "/watchers",
1755
+ "where": {
1756
+ "/name": "Ada"
1757
+ },
1758
+ "none": true
1759
+ }
1760
+ },
1761
+ "document": "task",
1762
+ "matches": true,
1763
+ "refusedInMemory": "hop"
1764
+ },
1765
+ {
1766
+ "name": "a Record's push address names its delivery",
1767
+ "query": {
1768
+ "where": {
1769
+ "/received/through": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a7b"
1770
+ }
1771
+ },
1772
+ "document": "push-record",
1773
+ "matches": true
1774
+ },
1775
+ {
1776
+ "name": "a Record's push address leaves another address's delivery out",
1777
+ "query": {
1778
+ "where": {
1779
+ "/received/through": "0197a3c4-5d6e-7f80-9a1b-2c3d4e5f6a7d"
1780
+ }
1781
+ },
1782
+ "document": "push-record",
1783
+ "matches": false
1784
+ },
1785
+ {
1786
+ "name": "a Record its User delivered names no push address",
1787
+ "query": {
1788
+ "where": {
1789
+ "/received/through": {
1790
+ "$exists": true
1791
+ }
1792
+ }
1793
+ },
1794
+ "document": "mailed-record",
1795
+ "matches": false
1796
+ },
1797
+ {
1798
+ "name": "a Record its User delivered names its User",
1799
+ "query": {
1800
+ "where": {
1801
+ "/received/by": {
1802
+ "$exists": true
1803
+ }
1804
+ }
1805
+ },
1806
+ "document": "mailed-record",
1807
+ "matches": true
1808
+ },
1809
+ {
1810
+ "name": "a Record's claimed header is tested at its own name",
1811
+ "query": {
1812
+ "where": {
1813
+ "/claimed/headers/stripe-signature": {
1814
+ "$prefix": "t="
1815
+ }
1816
+ }
1817
+ },
1818
+ "document": "push-record",
1819
+ "matches": true
1820
+ },
1821
+ {
1822
+ "name": "a Record's claimed sender equals itself",
1823
+ "query": {
1824
+ "where": {
1825
+ "/claimed/from": "Sam Ortiz <sam@example.com>"
1826
+ }
1827
+ },
1828
+ "document": "mailed-record",
1829
+ "matches": true
1830
+ },
1831
+ {
1832
+ "name": "a Record's JSON body field matches at its exact path",
1833
+ "query": {
1834
+ "where": {
1835
+ "/json/type": "invoice.paid"
1836
+ }
1837
+ },
1838
+ "document": "push-record",
1839
+ "matches": true
1840
+ },
1841
+ {
1842
+ "name": "a Record's JSON body field nested in objects matches at its exact path",
1843
+ "query": {
1844
+ "where": {
1845
+ "/json/data/object/status": "paid"
1846
+ }
1847
+ },
1848
+ "document": "push-record",
1849
+ "matches": true
1850
+ },
1851
+ {
1852
+ "name": "a Record's JSON body number compares as a number",
1853
+ "query": {
1854
+ "where": {
1855
+ "/json/data/object/amount": {
1856
+ "$gte": 1000
1857
+ }
1858
+ }
1859
+ },
1860
+ "document": "push-record",
1861
+ "matches": true
1862
+ },
1863
+ {
1864
+ "name": "a Record with no JSON body has no JSON body field",
1865
+ "query": {
1866
+ "where": {
1867
+ "/json/type": {
1868
+ "$exists": true
1869
+ }
1870
+ }
1871
+ },
1872
+ "document": "mailed-record",
1873
+ "matches": false
1874
+ },
1875
+ {
1876
+ "name": "a Record's path prefix names its folder",
1877
+ "query": {
1878
+ "where": {
1879
+ "/path": {
1880
+ "$prefix": "payments/stripe/"
1881
+ }
1882
+ }
1883
+ },
1884
+ "document": "push-record",
1885
+ "matches": true
1886
+ },
1887
+ {
1888
+ "name": "a Record's path prefix leaves a Record of another folder out",
1889
+ "query": {
1890
+ "where": {
1891
+ "/path": {
1892
+ "$prefix": "payments/stripe/"
1893
+ }
1894
+ }
1895
+ },
1896
+ "document": "mailed-record",
1897
+ "matches": false
1898
+ },
1899
+ {
1900
+ "name": "a door test names a change made through browser",
1901
+ "query": {
1902
+ "types": [
1903
+ "actor"
1904
+ ],
1905
+ "where": {
1906
+ "/door": "browser"
1907
+ }
1908
+ },
1909
+ "document": "browser-actor",
1910
+ "matches": true
1911
+ },
1912
+ {
1913
+ "name": "a door test of client leaves a change made through browser out",
1914
+ "query": {
1915
+ "types": [
1916
+ "actor"
1917
+ ],
1918
+ "where": {
1919
+ "/door": "client"
1920
+ }
1921
+ },
1922
+ "document": "browser-actor",
1923
+ "matches": false
1924
+ },
1925
+ {
1926
+ "name": "a door test names a change made through client",
1927
+ "query": {
1928
+ "types": [
1929
+ "actor"
1930
+ ],
1931
+ "where": {
1932
+ "/door": "client"
1933
+ }
1934
+ },
1935
+ "document": "client-actor",
1936
+ "matches": true
1937
+ },
1938
+ {
1939
+ "name": "a door test of environment leaves a change made through client out",
1940
+ "query": {
1941
+ "types": [
1942
+ "actor"
1943
+ ],
1944
+ "where": {
1945
+ "/door": "environment"
1946
+ }
1947
+ },
1948
+ "document": "client-actor",
1949
+ "matches": false
1950
+ },
1951
+ {
1952
+ "name": "a door test names a change made through environment",
1953
+ "query": {
1954
+ "types": [
1955
+ "actor"
1956
+ ],
1957
+ "where": {
1958
+ "/door": "environment"
1959
+ }
1960
+ },
1961
+ "document": "environment-actor",
1962
+ "matches": true
1963
+ },
1964
+ {
1965
+ "name": "a door test of function leaves a change made through environment out",
1966
+ "query": {
1967
+ "types": [
1968
+ "actor"
1969
+ ],
1970
+ "where": {
1971
+ "/door": "function"
1972
+ }
1973
+ },
1974
+ "document": "environment-actor",
1975
+ "matches": false
1976
+ },
1977
+ {
1978
+ "name": "a door test names a change made through function",
1979
+ "query": {
1980
+ "types": [
1981
+ "actor"
1982
+ ],
1983
+ "where": {
1984
+ "/door": "function"
1985
+ }
1986
+ },
1987
+ "document": "function-actor",
1988
+ "matches": true
1989
+ },
1990
+ {
1991
+ "name": "a door test of browser leaves a change made through function out",
1992
+ "query": {
1993
+ "types": [
1994
+ "actor"
1995
+ ],
1996
+ "where": {
1997
+ "/door": "browser"
1998
+ }
1999
+ },
2000
+ "document": "function-actor",
2001
+ "matches": false
2002
+ },
2003
+ {
2004
+ "name": "a door test of an AI client or an Environment names an Environment's change",
2005
+ "query": {
2006
+ "types": [
2007
+ "actor"
2008
+ ],
2009
+ "where": {
2010
+ "/door": {
2011
+ "$in": [
2012
+ "client",
2013
+ "environment"
2014
+ ]
2015
+ }
2016
+ }
2017
+ },
2018
+ "document": "environment-actor",
2019
+ "matches": true
1245
2020
  }
1246
2021
  ],
1247
2022
  "orders": [