@abide/abide 0.105.1 → 0.106.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/bin/abide.ts +4 -1
  3. package/docs/REGISTRY.md +156 -44
  4. package/docs/RULEBOOK.md +375 -87
  5. package/docs/abide.md +7243 -10256
  6. package/package.json +4 -1
  7. package/scaffold/AGENTS.md +2 -0
  8. package/scaffold/src/getGreeting.ts +6 -0
  9. package/scaffold/src/index.abide +3 -1
  10. package/scaffold/src/tests/getGreeting.test.ts +6 -0
  11. package/scaffold/src/tests/index.test.ts +18 -0
  12. package/src/compiler/DOCS_SITE.ts +2 -0
  13. package/src/compiler/Lowering.ts +234 -14
  14. package/src/compiler/PositionTable.ts +14 -7
  15. package/src/compiler/PositionedRefusal.ts +13 -0
  16. package/src/compiler/Refusals.ts +18 -11
  17. package/src/compiler/SHARED_NAMES.ts +2 -0
  18. package/src/compiler/ShadowMap.ts +37 -0
  19. package/src/compiler/TEMPLATE_BLOCKS.ts +12 -0
  20. package/src/compiler/TypeSession.ts +410 -31
  21. package/src/compiler/appLayout.ts +18 -2
  22. package/src/compiler/argsSchemaOf.ts +55 -9
  23. package/src/compiler/checkApp.ts +33 -0
  24. package/src/compiler/checkedShadow.ts +36 -22
  25. package/src/compiler/citedClauses.ts +14 -0
  26. package/src/compiler/classifyRead.ts +6 -0
  27. package/src/compiler/classifyTemplate.ts +2 -1
  28. package/src/compiler/compileApp.ts +2 -2
  29. package/src/compiler/declaredExports.ts +27 -6
  30. package/src/compiler/emitClient.ts +304 -103
  31. package/src/compiler/handlersUnder.ts +4 -0
  32. package/src/compiler/invocationProps.ts +1 -1
  33. package/src/compiler/isIgnored.ts +27 -0
  34. package/src/compiler/parseAbide.ts +176 -76
  35. package/src/compiler/projectShadow.ts +30 -6
  36. package/src/compiler/readSources.ts +1 -1
  37. package/src/compiler/readsIn.ts +100 -1
  38. package/src/compiler/renderMarkup.ts +36 -5
  39. package/src/compiler/scaffold.ts +19 -6
  40. package/src/compiler/serveLanguage.ts +156 -21
  41. package/src/compiler/templateContext.ts +150 -0
  42. package/src/compiler/tokenize.ts +6 -0
  43. package/src/server/BRIDGE_VERSION.ts +1 -1
  44. package/src/server/Inbox.ts +8 -0
  45. package/src/server/MCP_PROTOCOL_VERSION.ts +1 -1
  46. package/src/server/MOUNTABLE.ts +6 -0
  47. package/src/server/abideModules.ts +8 -1
  48. package/src/server/answerRequest.ts +3 -1
  49. package/src/server/answerRpc.ts +26 -12
  50. package/src/server/answerSocket.ts +26 -1
  51. package/src/server/argsFor.ts +4 -3
  52. package/src/server/assistant.ts +19 -13
  53. package/src/server/bridgeRelay.ts +108 -20
  54. package/src/server/claudeApi.ts +7 -7
  55. package/src/server/claudeCode.ts +11 -11
  56. package/src/server/commands.ts +73 -9
  57. package/src/server/createApp.ts +41 -7
  58. package/src/server/devWorker.ts +3 -3
  59. package/src/server/generatedSurfaces.ts +37 -4
  60. package/src/server/muxUpgrade.ts +47 -0
  61. package/src/server/preload.ts +13 -2
  62. package/src/server/render.ts +4 -1
  63. package/src/server/runCompiled.ts +1 -0
  64. package/src/server/seedBuffer.ts +31 -1
  65. package/src/server/serveDev.ts +83 -72
  66. package/src/server/surfaceOf.ts +3 -0
  67. package/src/server/testMount.ts +53 -0
  68. package/src/shared/ADDRESSES.ts +1 -1
  69. package/src/shared/ERROR_META.ts +3 -0
  70. package/src/shared/Schema.ts +1 -1
  71. package/src/shared/WORK.ts +14 -12
  72. package/src/shared/applyPatch.ts +1 -1
  73. package/src/shared/boundValue.ts +81 -0
  74. package/src/shared/index.ts +7 -2
  75. package/src/shared/jsonSchema.ts +25 -2
  76. package/src/shared/log.ts +11 -1
  77. package/src/shared/reactive/Keyed.ts +30 -6
  78. package/src/shared/reactive/PATCHES.ts +1 -1
  79. package/src/shared/reactive/Reactive.ts +118 -60
  80. package/src/shared/reactive/canonicalKey.ts +1 -1
  81. package/src/shared/reactive/index.ts +13 -5
  82. package/src/shared/reactive/recordWrites.ts +1 -1
  83. package/src/shared/reactive/watch.ts +26 -4
  84. package/src/shared/rpc.ts +6 -1
  85. package/src/shared/url.ts +7 -3
  86. package/src/shared/validateJson.ts +1 -1
  87. package/src/ui/ArmRegion.ts +2 -2
  88. package/src/ui/List.ts +9 -9
  89. package/src/ui/RawRun.ts +1 -1
  90. package/src/ui/Router.ts +194 -36
  91. package/src/ui/Scope.ts +29 -0
  92. package/src/ui/adoptWalk.ts +3 -3
  93. package/src/ui/applyHead.ts +25 -3
  94. package/src/ui/bindProperty.ts +70 -22
  95. package/src/ui/index.ts +1 -1
  96. package/src/ui/listenForRoutes.ts +14 -3
  97. package/src/ui/reconcile.ts +23 -28
  98. package/src/ui/regions.ts +9 -2
  99. package/src/ui/rows.ts +108 -28
package/docs/RULEBOOK.md CHANGED
@@ -37,6 +37,53 @@ These are immutable. A change to them is a change to what this document is.
37
37
  7. **A clause states what holds today.** A rule that stops holding is deleted, and the clauses
38
38
  after it close the gap — every citation of a number is swept in the same change.
39
39
 
40
+ ## Contents
41
+
42
+ - [1. The reactive value](#1)
43
+ - [2. Reads](#2)
44
+ - [3. Probes](#3)
45
+ - [4. Writes and gates](#4)
46
+ - [5. Productions and identity](#5)
47
+ - [6. Expiry](#6)
48
+ - [7. Triggers](#7)
49
+ - [8. Stores](#8)
50
+ - [9. Streams and wired values](#9)
51
+ - [10. Sharing](#10)
52
+ - [11. Derived and keyed values](#11)
53
+ - [12. Effects](#12)
54
+ - [13. Selections](#13)
55
+ - [14. Tracking](#14)
56
+ - [15. Refusals](#15)
57
+ - [16. Handlers and transports](#16)
58
+ - [17. Response helpers](#17)
59
+ - [18. Following a `GET`](#18)
60
+ - [19. Mount paths and schemas](#19)
61
+ - [20. Generated surfaces](#20)
62
+ - [21. Generated headers](#21)
63
+ - [22. Request-scoped ambients](#22)
64
+ - [23. Route and connectivity](#23)
65
+ - [24. Tracing](#24)
66
+ - [25. Health](#25)
67
+ - [26. Principal](#26)
68
+ - [27. Configuration](#27)
69
+ - [28. Logging](#28)
70
+ - [29. Content security policy](#29)
71
+ - [30. Addresses and navigation](#30)
72
+ - [31. Reading and writing by name](#31)
73
+ - [32. Templating](#32)
74
+ - [33. Props](#33)
75
+ - [34. Script and style blocks](#34)
76
+ - [35. Pages, rendering and sinks](#35)
77
+ - [36. Environment and files](#36)
78
+ - [37. Lifecycle hooks](#37)
79
+ - [38. Commands](#38)
80
+ - [39. Head and view transitions](#39)
81
+ - [40. Documentation](#40)
82
+ - [41. Rendering and hydration](#41)
83
+ - [42. The app object](#42)
84
+ - [43. The measurement harness](#43)
85
+ - [44. The assistant](#44)
86
+
40
87
  ## Terms
41
88
 
42
89
  A term below is a category the clauses are written over. It is defined here rather than in
@@ -71,6 +118,7 @@ REGISTRY.md because none of them is a name an app author writes.
71
118
  | fence | A `server`, `public`, `lib` or `tests` directory. |
72
119
  | handler file | A `.ts` of the app's own, neither a `.d.ts` nor a `.test.ts`, directly in a directory under no fence. |
73
120
  | private handler | A handler a `<script server>` declares. |
121
+ | chapter app | The app the documentation's story has built by the end of one chapter, kept whole so a reader can download it and run it. |
74
122
 
75
123
  RFC 2119 keywords are used as that document defines them: **MUST**, **MUST NOT**, **SHALL**,
76
124
  **SHOULD**, **SHOULD NOT**, **MAY**.
@@ -135,7 +183,8 @@ from its first, and MUST end when that run closes.
135
183
  3.2 A probe MUST answer about the value a read would serve, running what that read would run, and
136
184
  MUST NOT otherwise start work.
137
185
 
138
- 3.3 Reading a probe MUST subscribe to that probe alone.
186
+ 3.3 Reading a probe MUST subscribe the reader to that value's probes together, and MUST NOT
187
+ subscribe it to the value.
139
188
 
140
189
  3.4 A sink MUST be opened where `s.busy` is true and `s.ready` is false.
141
190
 
@@ -601,8 +650,9 @@ teardown of the scope it was opened in.
601
650
  12.6 A throw from an `Effect` or a `Disposer`, and a read of a failed `Reactive` inside one, MUST
602
651
  reach `onError` as thrown, and MUST warn on `abide:watch` with the trace.
603
652
 
604
- 12.7 In a browser a throw from an `Effect` MUST additionally be re-thrown, to surface as an uncaught
605
- error.
653
+ 12.7 In a browser a throw from an `Effect` MUST additionally surface as an uncaught error — re-thrown
654
+ to the caller of `watch` from its first run, and reported with `reportError` from a rerun — and
655
+ MUST NOT keep any other `Effect` the same turn woke from running.
606
656
 
607
657
  12.8 An `Effect` that threw MUST stop its `watch`.
608
658
 
@@ -718,6 +768,9 @@ excludes `null` and `undefined`, naming `s.ready`.
718
768
  14.18 The compiler MUST NOT warn under 14.16 on a read inside the `get` or `set` of a component's
719
769
  `bind:` pair.
720
770
 
771
+ 14.19 The compiler MUST NOT report a warning on a reactive read where the line above the read holds
772
+ `abide-ignore` followed by the number of the clause the warning cites.
773
+
721
774
  # 15. Refusals
722
775
 
723
776
  15.1 A refusal MUST be a declared value, and MUST NOT be a status code or a transport concern.
@@ -782,6 +835,8 @@ states otherwise.
782
835
 
783
836
  # 16. Handlers and transports
784
837
 
838
+ ## The handler and its `Rpc`
839
+
785
840
  16.1 A handler MUST be a `reactive`, a plain function, or a value.
786
841
 
787
842
  16.2 `GET`, `POST`, `PUT`, `PATCH` and `DELETE` MUST give the handler a handler file exports as its
@@ -811,6 +866,8 @@ carry the rest in the query on a `GET` or a `DELETE` alone.
811
866
  16.10 `rpc.url` MUST resolve a mount-relative address at run time, and the build MUST NOT bake an
812
867
  absolute one.
813
868
 
869
+ ## Middleware and arguments
870
+
814
871
  16.11 A `Middleware` rung MUST run on every call, in process as much as over the wire.
815
872
 
816
873
  16.12 The rungs in registration order, the `ctx.args()` coerce-then-validate, and `timeout` MUST run
@@ -853,6 +910,8 @@ read it.
853
910
 
854
911
  16.27 A `schema` MUST run where its `Reactive` lives.
855
912
 
913
+ ## What crosses the wire
914
+
856
915
  16.28 A browser MUST receive a generated `Rpc` wrapper carrying the method, the mount-relative address and
857
916
  the description, and MUST NOT receive the handler file or the `<script server>` that declared it.
858
917
 
@@ -887,6 +946,8 @@ ETag it derives, and answer 206, 416 and 304 as the protocol requires.
887
946
  16.39 A handler whose value carries a `Reactive` below its top level MUST be a compile error naming
888
947
  the handler and the path to it.
889
948
 
949
+ ## Answers and failures
950
+
890
951
  16.40 A `Failed` escaping a handler MUST be answered at its own `status`.
891
952
 
892
953
  16.41 A throw that is not a `Failed` MUST be answered 500.
@@ -926,6 +987,8 @@ MUST refuse with `aborted` at status 499, and MUST abort the request carrying it
926
987
  16.53 The 303 16.38 answers MUST go to the mount's root where the referrer is absent or is not of
927
988
  `APP_URL`'s origin, per 36.2.
928
989
 
990
+ ## Ceilings and timeouts
991
+
929
992
  16.54 `maxBodySize` and `ABIDE_MAX_REQUEST_BODY_SIZE` MUST default to no ceiling.
930
993
 
931
994
  16.55 A mutation's body over the ceiling `maxBodySize` or `ABIDE_MAX_REQUEST_BODY_SIZE` sets MUST
@@ -954,6 +1017,8 @@ answer `aborted` at 499, and MUST NOT report the throw as unexpected.
954
1017
 
955
1018
  16.64 An `Rpc` over a plain function MUST NOT run that function before the first call reaches it.
956
1019
 
1020
+ ## Addresses and private handlers
1021
+
957
1022
  16.65 Each parameter of the route a handler file answers at MUST reach its handler's `Args` from the
958
1023
  path.
959
1024
 
@@ -987,6 +1052,8 @@ naming it.
987
1052
  16.74 A module of the client graph importing a handler file MUST receive the wrapper 16.28 states as
988
1053
  that file's default.
989
1054
 
1055
+ ## Streamed answers and ceilings, continued
1056
+
990
1057
  16.75 A streamed answer — jsonl, sse, bytes, or a document `page` hands a stream — MUST carry
991
1058
  `X-Accel-Buffering: no`.
992
1059
 
@@ -996,6 +1063,9 @@ close, where a new run replaces it, and with the failure that run ended on.
996
1063
  16.77 A `timeout` MUST NOT end a `throttle` or `debounce` window holding a production back, and the
997
1064
  call MUST wait on that window as 5.15 has it.
998
1065
 
1066
+ 16.78 A body `/__abide/mcp` or `/__abide/bridge` reads over the ceiling `ABIDE_MAX_REQUEST_BODY_SIZE`
1067
+ sets MUST be refused 413, whether its length was declared or streamed.
1068
+
999
1069
  # 17. Response helpers
1000
1070
 
1001
1071
  17.1 Every body helper MUST take `Values<T>`.
@@ -1102,6 +1172,22 @@ declared it, as it opens, and MUST NOT be fed where a rung answered in the handl
1102
1172
  it by the format's fields: a comment skipped, the space after a field's colon optional, `data` lines
1103
1173
  joined, and an event ended by a blank line.
1104
1174
 
1175
+ 18.28 A frame received over a connection `App.listen` or `abide dev` upgrades to the socket mux that is
1176
+ over `ABIDE_MAX_SOCKET_MESSAGE_SIZE` bytes, 1048576 where it is unset, MUST close that connection.
1177
+
1178
+ 18.29 A connection `App.listen` or `abide dev` upgrades to the socket mux MUST be pinged while idle,
1179
+ and MUST be closed where 120 seconds pass with nothing received over it.
1180
+
1181
+ 18.30 A connection `App.listen` or `abide dev` upgrades to the socket mux MUST be closed with 1013
1182
+ where a frame sent to it is dropped rather than sent or held, which happens once 16 MiB are held
1183
+ unsent, and MUST NOT be sent the frames after it.
1184
+
1185
+ 18.31 A subscription to a `GET` that would take one connection to the socket mux past
1186
+ `ABIDE_MAX_SOCKET_SUBSCRIPTIONS`, 1024 where it is unset, MUST be refused 429.
1187
+
1188
+ 18.32 A subscription to a `GET` naming an id its connection already follows MUST replace that one, and
1189
+ MUST NOT count toward 18.31's bound.
1190
+
1105
1191
  # 19. Mount paths and schemas
1106
1192
 
1107
1193
  19.1 A route MUST be answered for each method by one file at most, a page answering `GET` and `HEAD`
@@ -1159,6 +1245,19 @@ record keyed by `''`.
1159
1245
  19.20 A request MUST be answered by the most specific route answering its method, ranked as 30.9
1160
1246
  ranks routes for `navigate`.
1161
1247
 
1248
+ 19.21 What a handler answers MUST be derived at build as a JSON Schema from the value its `Rpc`
1249
+ reads, and none MUST be derived where that value may be `undefined`, where the handler streams, or
1250
+ where the derivation constrains nothing.
1251
+
1252
+ 19.22 A `JsonSchema` derived per 19.21 MUST NOT refuse a member its type does not declare, and MUST
1253
+ leave unconstrained a value whose type has a method.
1254
+
1255
+ 19.23 A `jsonSchema` given no type argument MUST be accepted as the `Schema` of any slot it is given
1256
+ to, and MUST NOT change the type of the value that slot gates.
1257
+
1258
+ 19.24 The value a body produces MUST be typed from the body alone, and a `schema` declared beside it
1259
+ MUST NOT change that type.
1260
+
1162
1261
  # 20. Generated surfaces
1163
1262
 
1164
1263
  20.1 Every surface `Clients` names MUST be derived from the route table, and MUST NOT be authored
@@ -1200,6 +1299,19 @@ and then its route, each joined by `_`, with every character but a letter, a dig
1200
1299
  `_` and a segment's brackets and dots dropped, and two handlers sharing one MUST be a build error
1201
1300
  naming both.
1202
1301
 
1302
+ 20.14 Every tool `/__abide/mcp` lists MUST carry `annotations` read off its handler's method:
1303
+ `readOnlyHint` true for a `GET` alone, `idempotentHint` true for a `GET`, a `PUT` and a `DELETE`
1304
+ alone, and `destructiveHint` true for every method but `GET`.
1305
+
1306
+ 20.15 `/__abide/openapi.json` MUST publish a handler's 19.21 schema as its `200` response's, and
1307
+ MUST publish none where 19.21 derives none.
1308
+
1309
+ 20.16 A tool `/__abide/mcp` lists MUST declare its handler's 19.21 schema as its `outputSchema`
1310
+ where that schema is an object, and MUST declare none otherwise.
1311
+
1312
+ 20.17 A `tools/call` that `/__abide/mcp` answers for a tool declaring an `outputSchema` MUST carry
1313
+ the value as `structuredContent` beside its text, and a refused call MUST carry none.
1314
+
1203
1315
  # 21. Generated headers
1204
1316
 
1205
1317
  21.1 Every response MUST carry `x-content-type-options: nosniff`.
@@ -1592,6 +1704,15 @@ to the document.
1592
1704
  member left `undefined` omitted, a list its member repeated, an empty list its name with no `=`, and
1593
1705
  anything else its text.
1594
1706
 
1707
+ 30.29 A back or forward history step `navigate` answers MUST restore the scroll the entry it arrives
1708
+ at was left at, once that entry's page is mounted.
1709
+
1710
+ 30.30 A page hydrated at an entry that carries the scroll it was left at, by a reload or a return to
1711
+ the document, MUST land at that scroll.
1712
+
1713
+ 30.31 A `navigate` that a later `navigate` overtakes before it mounts MUST abort the request it made
1714
+ to `middleware`.
1715
+
1595
1716
  # 31. Reading and writing by name
1596
1717
 
1597
1718
  31.1 Inside a `.abide` file a name bound to a `Reactive` MUST be read wherever 31.3 does not hold it.
@@ -1723,8 +1844,8 @@ a `{#for}`, a `{#try}`, a `<slot/>` or a `<Name/>`.
1723
1844
  32.32 `{#for}` without a key over a subject that is a `Reactive` named alone MUST key its rows by
1724
1845
  that value's `by`, where it declares one.
1725
1846
 
1726
- 32.33 A `{#for}` MUST NOT keep a row showing an item as it stood before an `s.patch` wrote to that
1727
- item, or to an object the patch reached through it.
1847
+ 32.33 A `{#for}` MUST take an `s.patch` written to a row's item, or to an object the patch reached
1848
+ through it, as that item changing under 32.67.
1728
1849
 
1729
1850
  32.34 A `<Name/>` whose name is bound to a `Reactive`, or to a prop `props` hands back, MUST invoke
1730
1851
  the component the value holds.
@@ -1804,6 +1925,40 @@ error.
1804
1925
  operand, a `{#if}` condition, a `{#for}` subject or key, or a value handed to a component — outside
1805
1926
  any function that expression declares, MUST be a compile error.
1806
1927
 
1928
+ 32.58 A `bind:value` MUST be numeric once its value has been a number or its input is `type=number`
1929
+ or `type=range`, and MUST stay numeric for the life of the binding; a numeric bind MUST write a
1930
+ number for text that reads as one, `undefined` for blank text, and nothing for any other text.
1931
+
1932
+ 32.59 A numeric `bind:value` MUST NOT write its value into the property while the property's text
1933
+ already reads as that number.
1934
+
1935
+ 32.60 A `bind:value` MUST NOT write between a `compositionstart` and its `compositionend`, and MUST
1936
+ write once on the `compositionend`.
1937
+
1938
+ 32.61 The server MUST render a `<textarea>`'s `bind:value` as its text, and a `<select>`'s as
1939
+ `selected` on the option its value selects — the first whose value reads as the value's text, or
1940
+ each one a list holds under 32.62.
1941
+
1942
+ 32.62 A `bind:value` on a `<select multiple>` MUST hold a list: each option is selected where the list
1943
+ holds its value as text, and a change MUST write the values of the selected options, in order.
1944
+
1945
+ 32.63 A `{#if}`, `{#for}`, `{#try}` or `{#component Name(pattern)}` not closed by its own close tag
1946
+ before the end of the file, or before the close tag of the element it was opened in, MUST be a build
1947
+ error at the tag that opened it.
1948
+
1949
+ 32.64 An `{:else}` anywhere but directly inside a `{#if}`, and a close tag that does not name the
1950
+ innermost open block, MUST be a build error at that tag.
1951
+
1952
+ 32.65 A template tag spelled as a block — `{#name}`, `{:name}`, `{/name}` or `{@name}` — whose name is
1953
+ none of the blocks 32.12, 32.13, 32.16 and 32.39 govern MUST be a build error naming those blocks.
1954
+
1955
+ 32.66 A region emptied while a `bind:element` exit (32.38) holds a node in it MUST be filled by what
1956
+ arrives in it next as an empty region, and the held node MUST NOT be hydrated as that arrival's
1957
+ markup.
1958
+
1959
+ 32.67 A `{#for}` MUST keep the row and the nodes of a key it keeps when that key's item is a
1960
+ different value, and MUST update the row's bindings that read the item in place.
1961
+
1807
1962
  # 33. Props
1808
1963
 
1809
1964
  33.1 `props` MUST be callable from a `<script>` block only, and calling it from a `<script module>`
@@ -2012,6 +2167,9 @@ refused where it renders.
2012
2167
  35.17 An attribute on the document's `<html>` or `<body>` MUST be typed, rendered and bound as one
2013
2168
  on any element is.
2014
2169
 
2170
+ 35.18 A document an `error.abide` answers MUST NOT be hydrated as the page its address names, and a
2171
+ navigation from it MUST load the document it asks for.
2172
+
2015
2173
  # 36. Environment and files
2016
2174
 
2017
2175
  36.1 `PORT` MUST default to 3000, and a command's own port flag MUST override it by declaring it.
@@ -2027,7 +2185,7 @@ on any element is.
2027
2185
  36.6 `ABIDE_APP_TOKEN` and `ABIDE_APP_URL` MUST be read by the remote CLI only.
2028
2186
 
2029
2187
  36.7 A closed surface — `/__abide/openapi.json` or `/__abide/mcp` (20.7), or `/__abide/bridge`
2030
- (45.19) — MUST answer 404.
2188
+ (44.19) — MUST answer 404.
2031
2189
 
2032
2190
  36.8 `ABIDE_LOG_FORMAT` unset MUST follow the TTY.
2033
2191
 
@@ -2108,6 +2266,8 @@ file MUST be a build error naming the module and the hook.
2108
2266
 
2109
2267
  # 38. Commands
2110
2268
 
2269
+ ## The commands
2270
+
2111
2271
  38.1 `abide scaffold` MUST write a starter project, and MUST skip a step already done.
2112
2272
 
2113
2273
  38.2 `abide run` MUST pass everything after the file to the script.
@@ -2136,6 +2296,8 @@ per 20.1.
2136
2296
  38.13 `abide mcp` MUST be a bridge a model client spawns and kills, and `abide start` MUST NOT be
2137
2297
  put in that position.
2138
2298
 
2299
+ ## `dev`, `build`, `start` and `check`
2300
+
2139
2301
  38.14 `abide dev` MUST hold the app in a child process and keep the listener in its own.
2140
2302
 
2141
2303
  38.15 `abide dev` MUST replace that process to reload, and MUST force-close every live socket on
@@ -2212,6 +2374,8 @@ a component tag as the component it invokes.
2212
2374
  38.41 A worker `abide dev` did not replace that exits MUST be replaced, and every request it held
2213
2375
  MUST be answered or ended rather than left open.
2214
2376
 
2377
+ ## Scaffolding, compiled executables and the shell
2378
+
2215
2379
  38.42 The project `abide scaffold` writes MUST depend on the abide that wrote it in a spelling that
2216
2380
  installs, and MUST type the runtime its server modules run on.
2217
2381
 
@@ -2268,6 +2432,8 @@ one.
2268
2432
  38.62 38.7's shell MUST list and complete each handler `call` reaches that `clients.cli` does not
2269
2433
  withhold, with its args, and with its `description` where the declaration writes one as a literal.
2270
2434
 
2435
+ ## Ports, rebuilds and encodings
2436
+
2271
2437
  38.63 `abide dev` given neither `--port` nor `PORT` MUST listen on the first free port from 3000
2272
2438
  through 3099.
2273
2439
 
@@ -2286,6 +2452,8 @@ its output only a file it did not produce that was written before it began.
2286
2452
  38.69 `abide watch` MUST follow a `GET` per 18.20, and print its value and its value after each
2287
2453
  `s.patch`.
2288
2454
 
2455
+ ## The desktop app
2456
+
2289
2457
  38.70 The executable `abide bundle` writes, started on macOS with no command, MUST open a window on
2290
2458
  the app rather than 38.53's shell, and given a command MUST answer it as 38.50 does.
2291
2459
 
@@ -2360,6 +2528,8 @@ rest.
2360
2528
  to what an `onMenu` it filed read, and MUST be the default alone from each load the launcher starts
2361
2529
  until the page loaded tells it its route's menus.
2362
2530
 
2531
+ ## Bytecode, chunks and tooling
2532
+
2363
2533
  38.93 The executable `abide compile` writes MUST carry the app's code as bytecode, and MUST still
2364
2534
  report an error at its source line.
2365
2535
 
@@ -2418,6 +2588,37 @@ be reported on stderr, leaving the command's stdout to its own output.
2418
2588
 
2419
2589
  38.111 `abide openapi` MUST print the OpenAPI document on stdout.
2420
2590
 
2591
+ 38.112 The project `abide scaffold` writes MUST carry a handler file, a test that calls it, a test
2592
+ that mounts its page and measures a click with `@abide/harness/abide`, and a `test` script that runs
2593
+ `bun test`, and those tests MUST pass in the project as written.
2594
+
2595
+ 38.113 A flag `abide` does not know, or one missing its value, MUST be refused with one line naming
2596
+ the flag, followed by the usage, and MUST NOT be a success.
2597
+
2598
+ 38.114 An unknown command within two edits of an `abide` command MUST be refused naming that
2599
+ command.
2600
+
2601
+ 38.115 `--version` MUST print the version of abide, and on a compiled app's executable (38.50) the
2602
+ version of the app it holds, and MUST be a success.
2603
+
2604
+ 38.116 `abide lsp` MUST answer the references to a name and a rename of it across every `.abide`
2605
+ and `.ts` of the app, each placed where the author wrote it — a reactive's declaration in a script
2606
+ and its reads by name in markup alike, a prop and the attribute naming it on every tag that passes
2607
+ it, asked at either, and a component and its close tags as well as its open ones — and MUST refuse
2608
+ a rename of a name declared in a library.
2609
+
2610
+ 38.117 `abide lsp` MUST answer a completion in markup with the blocks the template parser reads
2611
+ after `{#`, `{:` and `{/`, the components in scope after `<`, and inside a component's tag the props
2612
+ its `props` call declares that the tag does not yet pass.
2613
+
2614
+ 38.118 A diagnostic `abide lsp` publishes for a finding that cites a clause MUST carry the clause as
2615
+ its code, linked to that clause on the documentation's rulebook page.
2616
+
2617
+ 38.119 `mount` MUST render the component it is given into the document's body as the server renders
2618
+ it, MUST hydrate it there with that component's browser module, and MUST run every effect the
2619
+ hydration woke before it settles; it MUST throw where the component was not imported from a
2620
+ `.abide` and bound, or where the process has no DOM.
2621
+
2421
2622
  # 39. Head and view transitions
2422
2623
 
2423
2624
  39.1 A `<head>` element in a `.abide` file MUST contribute its children to the document head.
@@ -2466,6 +2667,15 @@ MUST replace, in place, the one that same contributor wrote before.
2466
2667
  39.16 A `<head>` contribution with no merge key MUST be removed when the page, layout or component
2467
2668
  that made it leaves.
2468
2669
 
2670
+ 39.17 A `<script>` a `<head>` contribution writes in a browser MUST run when it is written, as the
2671
+ one a server paints does, and MUST NOT run again while the same contributor writes it unchanged.
2672
+
2673
+ 39.18 A `view-transition-name` transition a navigation starts MUST carry the type `back` or `forward`
2674
+ for a history step in that direction, and `push` for any other navigation.
2675
+
2676
+ 39.19 A browser whose view transitions take no types MUST run a navigation's `view-transition-name`
2677
+ transition without them.
2678
+
2469
2679
  # 40. Documentation
2470
2680
 
2471
2681
  *Free-standing: these clauses govern the documentation system, which REGISTRY does not name — a
@@ -2475,7 +2685,8 @@ that made it leaves.
2475
2685
 
2476
2686
  40.2 Every name REGISTRY carries MUST be documented against real `.abide` and `.ts` files.
2477
2687
 
2478
- 40.3 Every `<Example>` SHOULD carry an end-to-end spec.
2688
+ 40.3 Every `<Example>` MUST show a test file of its chapter app that exercises the component it
2689
+ renders.
2479
2690
 
2480
2691
  40.4 A file an `<Example>` names that is not part of the problem its summary names MUST NOT be
2481
2692
  one of its files.
@@ -2512,53 +2723,87 @@ NOT be answered by a fixture.
2512
2723
 
2513
2724
  40.16 Instrumentation the documentation adds to an `<Example>` MUST sit outside the render.
2514
2725
 
2515
- 40.17 A page MUST embed one `<Example>` per behavior it teaches.
2726
+ 40.17 A page MUST embed one `<Example>` per behavior it teaches, save a page 40.35 exempts.
2516
2727
 
2517
2728
  40.18 An `<Example>` MUST demonstrate exactly one behavior.
2518
2729
 
2519
- 40.19 A readout the hand-written arm paired with an `<Example>` renders MUST be one that example's
2520
- own source names.
2521
-
2522
- 40.20 An `<Example>` MUST be embedded by exactly one page declaring `covers`.
2730
+ 40.19 An `<Example>` MUST be embedded by exactly one page declaring `covers`.
2523
2731
 
2524
- 40.21 An `<Example>` MUST model a pattern from an app `docs/BRAND.md` names.
2732
+ 40.20 An `<Example>` MUST model a pattern from the app `docs/BRAND.md` names.
2525
2733
 
2526
- 40.22 Every `<Example>` a page embeds MUST be drawn from the same app.
2734
+ 40.21 Every `<Example>` a chapter embeds MUST name that chapter's own chapter app.
2527
2735
 
2528
- 40.23 A control an `<Example>` renders MUST sit with the value it changes.
2736
+ 40.22 A control an `<Example>` renders MUST sit with the value it changes.
2529
2737
 
2530
- 40.24 An `<Example>` MUST prove the heading it sits under.
2738
+ 40.23 An `<Example>` MUST prove the heading it sits under.
2531
2739
 
2532
- 40.25 An `<Example>` MUST NOT carry code its proof does not need.
2740
+ 40.24 An `<Example>` MUST NOT carry code its proof does not need.
2533
2741
 
2534
- 40.26 The capability an `<Example>` proves MUST be one the app it is drawn from would reach
2742
+ 40.25 The capability an `<Example>` proves MUST be one the app it is drawn from would reach
2535
2743
  for.
2536
2744
 
2537
- 40.27 A heading that carries an `<Example>` MUST be followed by it, with nothing between
2745
+ 40.26 A heading that carries an `<Example>` MUST be followed by it, with nothing between
2538
2746
  them.
2539
2747
 
2540
- 40.28 An `<Example>`'s summary MUST state the situation it is in, and MUST NOT restate the
2748
+ 40.27 An `<Example>`'s summary MUST state the situation it is in, and MUST NOT restate the
2541
2749
  heading.
2542
2750
 
2543
- 40.29 A comment in an `<Example>`'s own source MUST fit on one line, and a reason longer than
2751
+ 40.28 A comment in an `<Example>`'s own source MUST fit on one line, and a reason longer than
2544
2752
  that MUST go in the copy after the card.
2545
2753
 
2546
- 40.30 A page's lead MUST read standalone, being what a section overview shows for that page, and
2547
- MUST NOT carry a relative link.
2754
+ 40.29 A page's lead MUST read standalone, being what the home page shows for that page, and MUST
2755
+ NOT carry a relative link.
2548
2756
 
2549
- 40.31 A page whose `covers` names one REGISTRY entry SHOULD open on a section giving that entry's
2757
+ 40.30 A page whose `covers` names one REGISTRY entry SHOULD open on a section giving that entry's
2550
2758
  forms, the options they share, and a link to its reference page.
2551
2759
 
2552
- 40.32 A page reporting the build's own results MUST NOT be listed in `SITE`.
2760
+ 40.31 A documentation page other than a reference page MUST be an `index.abide` written by hand at
2761
+ its route, and its title, nav label, intent, lead and `covers` MUST be its `SITE` entry's alone.
2553
2762
 
2554
- 40.33 A documentation page MUST be an `index.abide` written by hand at its route, and its title, nav
2555
- label, intent, lead, app and `covers` MUST be its `SITE` entry's alone.
2556
-
2557
- 40.34 An `<Example>` MUST render a component in the `lib` directory beside the page that embeds it,
2558
- and that component's handlers, hooks and data MUST be in its own file, save a file the example is
2763
+ 40.32 An `<Example>` MUST render a component in a `lib` directory of the chapter app it names, and
2764
+ that component's handlers, hooks and data MUST be in its own file, save a file the example is
2559
2765
  about.
2560
2766
 
2561
- 40.35 A page's `.md` twin MUST be derived from what its `index.abide` renders.
2767
+ 40.33 A page's `.md` twin MUST be derived from what the page renders.
2768
+
2769
+ 40.34 The documentation site MUST serve `docs/RULEBOOK.md` at `/rulebook`, read from the file as the
2770
+ site builds, with each clause and each group anchored by its own number.
2771
+
2772
+ 40.35 A page whose every behavior is performed by a command, or decided by the deployment an app is
2773
+ served from, MAY embed no `<Example>`.
2774
+
2775
+ 40.36 A page embedding no `<Example>` under 40.35 MUST name which of the two in its `SITE` entry's
2776
+ `cardless`.
2777
+
2778
+ 40.37 The documentation site MUST serve each chapter's feature directory at the address the chapter
2779
+ app serves it at, with none of the site's chrome around its pages.
2780
+
2781
+ 40.38 A chapter app MUST be a package directly under the documentation site's `examples`, and MUST
2782
+ pass its own tests and its own `abide check` run from its own directory.
2783
+
2784
+ 40.39 An `<Example>` naming a chapter app MUST render, above the source of each test or bench file
2785
+ it shows, what that file last reported in the results the site keeps for the app.
2786
+
2787
+ 40.40 An `<Example>` naming a chapter app whose results were never kept MUST say so where the
2788
+ results would render.
2789
+
2790
+ 40.41 The documentation site MUST serve each chapter app as a gzipped tarball at
2791
+ `/examples/<app>.tar.gz`, holding every file of the app save its `node_modules` and `.abide`, with
2792
+ each workspace dependency naming the published version it stands for.
2793
+
2794
+ 40.42 The documentation site MUST give every name a public entry point exports and REGISTRY names a
2795
+ reference page of its own, generated from REGISTRY and the entry points' exports.
2796
+
2797
+ 40.43 Every row of `docs/REGISTRY.md` MUST be on exactly one reference page.
2798
+
2799
+ 40.44 A REGISTRY table no export's reference page holds MUST be on the reference page of the `#`
2800
+ group it is in, one page per group.
2801
+
2802
+ 40.45 A reference page MUST link each clause its rows cite to that clause's anchor on `/rulebook`.
2803
+
2804
+ 40.46 A reference page MUST link to every guide whose `covers` claims one of its rows.
2805
+
2806
+ 40.47 A reference page's rows MUST be read from REGISTRY as the page renders.
2562
2807
 
2563
2808
  # 41. Rendering and hydration
2564
2809
 
@@ -2581,7 +2826,8 @@ again, and a serialized setup result MUST NOT be adopted.
2581
2826
  41.7 The `Rpc` calls that re-execution makes MUST be answered from the seed buffer.
2582
2827
 
2583
2828
  41.8 A `{#for}` block over a value the server already painted MUST be reconciled against that value by
2584
- the block's key once it lands, and MUST NOT be appended to.
2829
+ the block's key once it lands, keeping each painted row whose key the value holds under 32.67, and
2830
+ MUST NOT be appended to.
2585
2831
 
2586
2832
  41.9 `render` MUST delimit a dynamic region with a comment anchor, and MUST NOT add a node, an
2587
2833
  attribute or a wrapper to the document for any other purpose than 41.20's script.
@@ -2683,130 +2929,172 @@ client of its own for one.
2683
2929
  the framework's, MUST NOT boot a build that state did not make, and MUST NOT require a prior
2684
2930
  `abide build`.
2685
2931
 
2686
- # 44. The measurement harness
2932
+ 42.17 `App.stop` still draining once `ABIDE_STOP_TIMEOUT` milliseconds have passed MUST close every
2933
+ connection still answering, and MUST then run `onStop` without waiting on what is still in flight.
2934
+
2935
+ 42.18 `ABIDE_STOP_TIMEOUT` MUST default to 5000.
2687
2936
 
2688
- *Free-standing: these clauses govern the measurement harness, which REGISTRY does not name — a
2689
- `Sample` is not something an app writes.*
2937
+ # 43. The measurement harness
2690
2938
 
2691
- 44.1 `harness/measure`, `harness/engine` and `harness/server` MUST each be reachable through only
2692
- the dependency each is named for, and `harness/report` MUST have none.
2939
+ 43.1 `@abide/harness/measure`, `@abide/harness/engine` and `@abide/harness/server` MUST each be
2940
+ reachable through only the dependency each is named for, `@abide/harness/report` MUST have none,
2941
+ and no module `@abide/harness` ships outside `@abide/harness/abide` MUST reach a package it is used
2942
+ to measure.
2693
2943
 
2694
- 44.2 A `Work` record MUST partition nodes moved by node kind, and MUST NOT carry a total across
2944
+ 43.2 A `Work` record MUST partition nodes moved by node kind, and MUST NOT carry a total across
2695
2945
  those kinds.
2696
2946
 
2697
- 44.3 A DOM member `harness/measure` does not count MUST throw naming that member while a case is
2947
+ 43.3 A DOM member `@abide/harness/measure` does not count MUST throw naming that member while a case is
2698
2948
  armed.
2699
2949
 
2700
- 44.4 A patched member MUST tally only where no patched member is already tallying, and
2701
- `harness/measure` MUST install its patches once for the process.
2950
+ 43.4 A patched member MUST tally only where no patched member is already tallying, and
2951
+ `@abide/harness/measure` MUST install its patches once for the process.
2702
2952
 
2703
- 44.5 The patch set `harness/measure` installs MUST be the same list of interfaces and members in
2704
- both substrates.
2953
+ 43.5 The patch set `@abide/harness/measure` installs MUST be the same list of interfaces and members in
2954
+ both substrates, and it MUST NOT add a member to the DOM it measures: a listed member a substrate
2955
+ lacks is left absent there.
2705
2956
 
2706
- 44.6 A `Work` record MUST NOT carry a duration, and `time` MUST throw while the counters are armed.
2957
+ 43.6 A `Work` record MUST NOT carry a duration, and `time` MUST throw while the counters are armed.
2707
2958
 
2708
- 44.7 A floor MUST be measured by running one arm twice under its own name, and `ratio` MUST report
2959
+ 43.7 A floor MUST be measured by running one arm twice under its own name, and `ratio` MUST report
2709
2960
  a value inside that floor as a tag rather than as a number.
2710
2961
 
2711
- 44.8 `batch` MUST interleave its arms, and MUST NOT run one arm in a block.
2962
+ 43.8 `batch` MUST interleave its arms, and MUST NOT run one arm in a block.
2712
2963
 
2713
- 44.9 A `gate` MUST carry a revert installing the broken arm and what that arm reports, and a revert
2964
+ 43.9 A `gate` MUST carry a revert installing the broken arm and what that arm reports, and a revert
2714
2965
  leaving the gate passing MUST be reported as a failure.
2715
2966
 
2716
- 44.10 `ratio` MUST throw where two samples disagree on substrate, on case or on batch size, and
2967
+ 43.10 `ratio` MUST throw where two samples disagree on substrate, on case or on batch size, and
2717
2968
  where one arm is given twice.
2718
2969
 
2719
- 44.11 A `Sample` MUST be at least 100 times the clock's measured resolution, and `batch` MUST throw
2970
+ 43.11 A `Sample` MUST be at least 100 times the clock's measured resolution, and `batch` MUST throw
2720
2971
  rather than report a smaller one.
2721
2972
 
2722
- 44.12 A refusal MUST be taken where the `Sample` is constructed, and MUST NOT be deferred to where
2973
+ 43.12 A refusal MUST be taken where the `Sample` is constructed, and MUST NOT be deferred to where
2723
2974
  it is reported.
2724
2975
 
2725
- 44.13 `shares` MUST take the trace, the layer, the denominator and a threshold, and MUST throw
2976
+ 43.13 `shares` MUST take the trace, the layer, the denominator and a threshold, and MUST throw
2726
2977
  where the layer runs outside the denominator.
2727
2978
 
2728
- 44.14 `shares` MUST report an observed ceiling of zero for an op under one frame.
2979
+ 43.14 `shares` MUST report an observed ceiling of zero for an op under one frame.
2729
2980
 
2730
- 44.15 A count of calls MUST be taken with `spyOn`.
2981
+ 43.15 A count of calls MUST be taken with `spyOn`.
2731
2982
 
2732
- 44.16 `retained` MUST throw in a process with a DOM.
2983
+ 43.16 `retained` MUST throw in a process with a DOM.
2733
2984
 
2734
- 44.17 `allocated` MUST report a batch mean, and MUST NOT report a count an exact integer can be
2985
+ 43.17 `allocated` MUST report a batch mean, and MUST NOT report a count an exact integer can be
2735
2986
  compared against.
2736
2987
 
2737
- 44.18 `batch` MUST throw in a parallel worker.
2988
+ 43.18 `batch` MUST throw in a parallel worker.
2989
+
2990
+
2991
+ 43.19 `measure` MUST leave a source that published no record absent from `published`, and
2992
+ `publishedBy` MUST return null for that source rather than a record of zeroes.
2993
+
2994
+ 43.20 `publishedBy` MUST throw naming each field it is asked for that the source's record does not
2995
+ carry as a number, and `measure` MUST NOT create a field a source did not publish.
2738
2996
 
2739
- 44.19 A hand-written arm under `harness/arms` MUST be paired with an `<Example>` of the same id.
2997
+ 43.21 A counter `measure` reads rather than counts MUST be published as a fixed-shape record of
2998
+ numbers under its source's name on `globalThis.__HARNESS_WORK__`.
2740
2999
 
2741
- 44.20 `measure` MUST report `wakes`, `bindingRuns` and `descents` as absent where no record has been
2742
- published, and MUST NOT report zero for one.
3000
+ 43.22 `batch` MUST throw on a duration whose op touched an emulated DOM.
2743
3001
 
2744
- 44.21 A published record MUST carry every field `measure` reads off it as a number, and `measure`
2745
- MUST throw naming each field that is absent.
3002
+ 43.23 `measure` from `@abide/harness/abide` MUST report `wakes`, `bindingRuns` and `descents` off the
3003
+ record abide publishes, and MUST report each as absent where abide has published none.
2746
3004
 
2747
- 44.22 A counter `measure` reads rather than counts MUST be published as a fixed-shape record
2748
- reached through `globalThis.__ABIDE_WORK__`.
3005
+ 43.24 `spawned` MUST kill a child that has not exited by its deadline and throw naming the command,
3006
+ and MUST NOT wait on a child synchronously.
2749
3007
 
2750
- 44.23 `batch` MUST throw on a duration whose op touched an emulated DOM.
2751
- # 45. The assistant
3008
+ 43.25 `inAFreshProcess` MUST run its source in a child `bun` with no DOM preloaded, and MUST NOT mark
3009
+ the child a parallel worker unless it is given a worker id.
2752
3010
 
2753
- 45.1 `assistant` MUST answer only through a handler that yields it, and MUST NOT mount an address
3011
+ 43.26 `rowsCommand` MUST print its catalog as one JSON array under `--list`, and otherwise MUST print
3012
+ one JSON row per line as each lands, for the items `inScope` and `matchesFilter` select by
3013
+ `--scope` and `--filter`.
3014
+
3015
+ 43.27 `testRows` MUST run each test file in a process of its own, and MUST report a file whose
3016
+ runner wrote no report as `broken` rather than as a result.
3017
+
3018
+ 43.28 The DOM `@abide/harness/preload` registers MUST leave the runtime's own `fetch`, `Request`,
3019
+ `Response`, `Headers`, `Blob`, `File`, `FormData`, `AbortController` and `AbortSignal` the globals.
3020
+
3021
+ # 44. The assistant
3022
+
3023
+ 44.1 `assistant` MUST answer only through a handler that yields it, and MUST NOT mount an address
2754
3024
  of its own.
2755
3025
 
2756
- 45.2 `assistant` MUST yield the same `AssistantEvent` sequence for one conversation whichever
3026
+ 44.2 `assistant` MUST yield the same `AssistantEvent` sequence for one conversation whichever
2757
3027
  `Provider` ran it.
2758
3028
 
2759
- 45.3 `assistant` MUST refuse 400, before any `Provider` is reached, a transcript whose last
3029
+ 44.3 `assistant` MUST refuse 400, before any `Provider` is reached, a transcript whose last
2760
3030
  `AssistantMessage` is not the user's.
2761
3031
 
2762
- 45.4 `assistant` MUST hold no conversation between calls, and MUST take the whole transcript with
3032
+ 44.4 `assistant` MUST hold no conversation between calls, and MUST take the whole transcript with
2763
3033
  each one.
2764
3034
 
2765
- 45.5 `claudeCode` MUST send a transcript to Claude Code as one message, its earlier turns folded
3035
+ 44.5 `claudeCode` MUST send a transcript to Claude Code as one message, its earlier turns folded
2766
3036
  above the last.
2767
3037
 
2768
- 45.6 With `mcp`, the `Toolbox` `assistant` hands a `Provider` MUST list the tools `/__abide/mcp`
3038
+ 44.6 With `mcp`, the `Toolbox` `assistant` hands a `Provider` MUST list the tools `/__abide/mcp`
2769
3039
  lists, and MUST call each as a request through the app answering the request.
2770
3040
 
2771
- 45.7 A `Toolbox` call MUST carry the asking request's `cookie` and `authorization` headers, and MUST
3041
+ 44.7 A `Toolbox` call MUST carry the asking request's `cookie` and `authorization` headers, and MUST
2772
3042
  NOT carry any other header of it.
2773
3043
 
2774
- 45.8 `mcp` over an app whose route table lists no handler for `/__abide/mcp` MUST throw.
3044
+ 44.8 `mcp` over an app whose route table lists no handler for `/__abide/mcp` MUST throw.
2775
3045
 
2776
- 45.9 `claudeApi` MUST call the Messages API again with the tool results only while a turn stops for
3046
+ 44.9 `claudeApi` MUST call the Messages API again with the tool results only while a turn stops for
2777
3047
  `tool_use`, and MUST send each assistant turn's blocks back as they arrived.
2778
3048
 
2779
- 45.10 `claudeApi` MUST throw where no `apiKey` is given, and MUST NOT read a key from the
3049
+ 44.10 `claudeApi` MUST throw where no `apiKey` is given, and MUST NOT read a key from the
2780
3050
  environment.
2781
3051
 
2782
- 45.11 A conversation reaching `maxTurns` with a tool call pending MUST end on a `done` whose `stop`
3052
+ 44.11 A conversation reaching `maxTurns` with a tool call pending MUST end on a `done` whose `stop`
2783
3053
  is `max_turns`, and MUST NOT run that call.
2784
3054
 
2785
- 45.12 `claudeApi` MUST send the results of one turn's tool calls back in one message.
3055
+ 44.12 `claudeApi` MUST send the results of one turn's tool calls back in one message.
2786
3056
 
2787
- 45.13 `claudeCode` MUST run a turn on the Claude Code of the bridge paired with the asking browser,
3057
+ 44.13 `claudeCode` MUST run a turn on the Claude Code of the bridge paired with the asking browser,
2788
3058
  and MUST refuse 409 where none is paired.
2789
3059
 
2790
- 45.14 A code `claudeCode.bridgeCommand` mints MUST pair one bridge with the browser that asked for
3060
+ 44.14 A code `claudeCode.bridgeCommand` mints MUST pair one bridge with the browser that asked for
2791
3061
  it, once, and MUST NOT pair once it has expired.
2792
3062
 
2793
- 45.15 A bridge MUST run Claude Code with its built-in tools off, no setting source read and no MCP
3063
+ 44.15 A bridge MUST run Claude Code with its built-in tools off, no setting source read and no MCP
2794
3064
  server but the bridge's own, in an empty directory removed when the run ends.
2795
3065
 
2796
- 45.16 A bridge MUST take from the site no Claude Code option `ClaudeCodeConfig` does not name.
3066
+ 44.16 A bridge MUST take from the site no Claude Code option `ClaudeCodeConfig` does not name.
2797
3067
 
2798
- 45.17 An MCP request a bridge's Claude Code makes MUST be answered from the `Toolbox` of the turn it
3068
+ 44.17 An MCP request a bridge's Claude Code makes MUST be answered from the `Toolbox` of the turn it
2799
3069
  was made in.
2800
3070
 
2801
- 45.18 `claudeCode` MUST end a turn's run on the bridge when the caller hangs up.
3071
+ 44.18 `claudeCode` MUST end a turn's run on the bridge when the caller hangs up.
2802
3072
 
2803
- 45.19 `/__abide/bridge` MUST be closed until `claudeCode` has minted a pairing code in that process.
3073
+ 44.19 `/__abide/bridge` MUST be closed until `claudeCode` has minted a pairing code in that process.
2804
3074
 
2805
- 45.20 `claudeCode.bridge` MUST yield a `BridgeStatus` whenever the asking browser's pairing changes,
3075
+ 44.20 `claudeCode.bridge` MUST yield a `BridgeStatus` whenever the asking browser's pairing changes,
2806
3076
  and MUST yield a fresh command where the standing one's code expires unpaired.
2807
3077
 
2808
- 45.21 A failure the Messages API reports to `claudeApi`, or a bridge reports to `claudeCode`, MUST
3078
+ 44.21 A failure the Messages API reports to `claudeApi`, or a bridge reports to `claudeCode`, MUST
2809
3079
  refuse 502.
2810
3080
 
2811
- 45.22 A bridge `claudeCode.bridge` has watched MUST be sent away once nothing watches it and it has
3081
+ 44.22 A bridge `claudeCode.bridge` has watched MUST be sent away once nothing watches it and it has
2812
3082
  run no turn for 30 seconds.
3083
+
3084
+ 44.23 A post to `/__abide/bridge` carrying a line that is not JSON MUST be refused 400, and none of
3085
+ its lines MUST be relayed.
3086
+
3087
+ 44.24 A bridge MUST answer an MCP request its Claude Code made with a failure where the report
3088
+ carrying it was not taken by `/__abide/bridge`, or where no reply arrived within 120 seconds.
3089
+
3090
+ 44.25 A bridge whose stream from `/__abide/bridge` ends unasked MUST redial it with its pairing's
3091
+ token, each wait twice the last, until it is refused or 30 seconds have passed.
3092
+
3093
+ 44.26 `/__abide/bridge` MUST hold a pairing whose stream dropped for 30 seconds, and a `GET` bearing
3094
+ its token within them MUST resume the stream with every frame the dropped one had not sent.
3095
+
3096
+ 44.27 `/__abide/bridge` MUST send a comment on a pairing's stream every 15 seconds for as long as
3097
+ the stream is open.
3098
+
3099
+ 44.28 A bridge whose stream from `/__abide/bridge` carries no line for 45 seconds MUST end it and
3100
+ redial it as 44.25 says.