operbe 0.0.0-stage → 1.0.0-rc.2

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 (165) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -2
  3. package/conformance/describe/edge/body.json +1 -0
  4. package/conformance/describe/edge/digest +1 -0
  5. package/conformance/describe/edge/project/acme/architecture.md +18 -0
  6. package/conformance/describe/edge/project/behaviors/B-7.md +15 -0
  7. package/conformance/describe/edge/project/behaviors/coverage/web.md +8 -0
  8. package/conformance/describe/edge/project/operations/broken-file.md +1 -0
  9. package/conformance/describe/edge/project/operations/read-note.md +4 -0
  10. package/conformance/describe/edge/project/operations/send-note.md +20 -0
  11. package/conformance/describe/edge/project/operbe.md +15 -0
  12. package/conformance/describe/example/body.json +1 -0
  13. package/conformance/describe/example/digest +1 -0
  14. package/conformance/describe/example/project/behaviors/B-0001.md +36 -0
  15. package/conformance/describe/example/project/behaviors/B-0002.md +21 -0
  16. package/conformance/describe/example/project/behaviors/B-0003.md +19 -0
  17. package/conformance/describe/example/project/behaviors/B-0004.md +18 -0
  18. package/conformance/describe/example/project/behaviors/B-0005.md +18 -0
  19. package/conformance/describe/example/project/behaviors/coverage/desktop.md +8 -0
  20. package/conformance/describe/example/project/behaviors/coverage/phone.md +12 -0
  21. package/conformance/describe/example/project/client-actions/archive-conversation.md +22 -0
  22. package/conformance/describe/example/project/client-actions/show-conversations.md +21 -0
  23. package/conformance/describe/example/project/client-actions/start-retitle.md +22 -0
  24. package/conformance/describe/example/project/client-actions/unarchive-conversation.md +21 -0
  25. package/conformance/describe/example/project/operations/archive-conversation.md +16 -0
  26. package/conformance/describe/example/project/operations/list-conversations.md +16 -0
  27. package/conformance/describe/example/project/operations/set-conversation-title.md +16 -0
  28. package/conformance/describe/example/project/operations/unarchive-conversation.md +16 -0
  29. package/conformance/describe/example/project/operbe.md +15 -0
  30. package/conformance/diff/core/a/behaviors/B-0001.md +36 -0
  31. package/conformance/diff/core/a/behaviors/B-0002.md +21 -0
  32. package/conformance/diff/core/a/behaviors/B-0003.md +19 -0
  33. package/conformance/diff/core/a/behaviors/B-0004.md +18 -0
  34. package/conformance/diff/core/a/behaviors/B-0005.md +18 -0
  35. package/conformance/diff/core/a/behaviors/coverage/desktop.md +8 -0
  36. package/conformance/diff/core/a/behaviors/coverage/phone.md +12 -0
  37. package/conformance/diff/core/a/client-actions/archive-conversation.md +22 -0
  38. package/conformance/diff/core/a/client-actions/show-conversations.md +21 -0
  39. package/conformance/diff/core/a/client-actions/start-retitle.md +22 -0
  40. package/conformance/diff/core/a/client-actions/unarchive-conversation.md +21 -0
  41. package/conformance/diff/core/a/operations/archive-conversation.md +16 -0
  42. package/conformance/diff/core/a/operations/list-conversations.md +16 -0
  43. package/conformance/diff/core/a/operations/set-conversation-title.md +16 -0
  44. package/conformance/diff/core/a/operations/unarchive-conversation.md +16 -0
  45. package/conformance/diff/core/a/operbe.md +15 -0
  46. package/conformance/diff/core/b/behaviors/B-0001.md +36 -0
  47. package/conformance/diff/core/b/behaviors/B-0002.md +22 -0
  48. package/conformance/diff/core/b/behaviors/B-0003.md +19 -0
  49. package/conformance/diff/core/b/behaviors/B-0004.md +18 -0
  50. package/conformance/diff/core/b/behaviors/B-0005.md +18 -0
  51. package/conformance/diff/core/b/behaviors/coverage/desktop.md +8 -0
  52. package/conformance/diff/core/b/behaviors/coverage/phone.md +12 -0
  53. package/conformance/diff/core/b/client-actions/archive-conversation.md +22 -0
  54. package/conformance/diff/core/b/client-actions/show-conversations.md +21 -0
  55. package/conformance/diff/core/b/client-actions/unarchive-conversation.md +21 -0
  56. package/conformance/diff/core/b/operations/archive-conversation.md +16 -0
  57. package/conformance/diff/core/b/operations/list-conversations.md +16 -0
  58. package/conformance/diff/core/b/operations/set-conversation-name.md +16 -0
  59. package/conformance/diff/core/b/operations/unarchive-conversation.md +16 -0
  60. package/conformance/diff/core/b/operbe.md +16 -0
  61. package/conformance/diff/core/changes.json +192 -0
  62. package/conformance/diff/declared/a/acme/architecture.md +18 -0
  63. package/conformance/diff/declared/a/behaviors/B-7.md +15 -0
  64. package/conformance/diff/declared/a/behaviors/coverage/web.md +8 -0
  65. package/conformance/diff/declared/a/operations/broken-file.md +1 -0
  66. package/conformance/diff/declared/a/operations/read-note.md +4 -0
  67. package/conformance/diff/declared/a/operations/send-note.md +20 -0
  68. package/conformance/diff/declared/a/operbe.md +15 -0
  69. package/conformance/diff/declared/b/acme/architecture.md +18 -0
  70. package/conformance/diff/declared/b/behaviors/B-7.md +15 -0
  71. package/conformance/diff/declared/b/behaviors/coverage/web.md +8 -0
  72. package/conformance/diff/declared/b/operations/broken-file.md +1 -0
  73. package/conformance/diff/declared/b/operations/read-note.md +5 -0
  74. package/conformance/diff/declared/b/operations/send-note.md +19 -0
  75. package/conformance/diff/declared/b/operbe.md +15 -0
  76. package/conformance/diff/declared/changes.json +73 -0
  77. package/conformance/diff/reworded/a/behaviors/B-0001.md +36 -0
  78. package/conformance/diff/reworded/a/behaviors/B-0002.md +21 -0
  79. package/conformance/diff/reworded/a/behaviors/B-0003.md +19 -0
  80. package/conformance/diff/reworded/a/behaviors/B-0004.md +18 -0
  81. package/conformance/diff/reworded/a/behaviors/B-0005.md +18 -0
  82. package/conformance/diff/reworded/a/behaviors/coverage/desktop.md +8 -0
  83. package/conformance/diff/reworded/a/behaviors/coverage/phone.md +12 -0
  84. package/conformance/diff/reworded/a/client-actions/archive-conversation.md +22 -0
  85. package/conformance/diff/reworded/a/client-actions/show-conversations.md +21 -0
  86. package/conformance/diff/reworded/a/client-actions/start-retitle.md +22 -0
  87. package/conformance/diff/reworded/a/client-actions/unarchive-conversation.md +21 -0
  88. package/conformance/diff/reworded/a/operations/archive-conversation.md +16 -0
  89. package/conformance/diff/reworded/a/operations/list-conversations.md +16 -0
  90. package/conformance/diff/reworded/a/operations/set-conversation-title.md +16 -0
  91. package/conformance/diff/reworded/a/operations/unarchive-conversation.md +16 -0
  92. package/conformance/diff/reworded/a/operbe.md +18 -0
  93. package/conformance/diff/reworded/b/behaviors/B-0001.md +36 -0
  94. package/conformance/diff/reworded/b/behaviors/B-0002.md +21 -0
  95. package/conformance/diff/reworded/b/behaviors/B-0003.md +19 -0
  96. package/conformance/diff/reworded/b/behaviors/B-0004.md +18 -0
  97. package/conformance/diff/reworded/b/behaviors/B-0005.md +18 -0
  98. package/conformance/diff/reworded/b/behaviors/coverage/desktop.md +8 -0
  99. package/conformance/diff/reworded/b/behaviors/coverage/phone.md +12 -0
  100. package/conformance/diff/reworded/b/client-actions/archive-conversation.md +22 -0
  101. package/conformance/diff/reworded/b/client-actions/show-conversations.md +21 -0
  102. package/conformance/diff/reworded/b/client-actions/start-retitle.md +22 -0
  103. package/conformance/diff/reworded/b/client-actions/unarchive-conversation.md +21 -0
  104. package/conformance/diff/reworded/b/operations/archive-conversation.md +16 -0
  105. package/conformance/diff/reworded/b/operations/list-conversations.md +16 -0
  106. package/conformance/diff/reworded/b/operations/set-conversation-title.md +16 -0
  107. package/conformance/diff/reworded/b/operations/unarchive-conversation.md +16 -0
  108. package/conformance/diff/reworded/b/operbe.md +18 -0
  109. package/conformance/diff/reworded/changes.json +43 -0
  110. package/dist/check.d.ts +21 -0
  111. package/dist/check.js +422 -0
  112. package/dist/cli.d.ts +2 -0
  113. package/dist/cli.js +272 -0
  114. package/dist/describe.d.ts +22 -0
  115. package/dist/describe.js +201 -0
  116. package/dist/diff.d.ts +13 -0
  117. package/dist/diff.js +249 -0
  118. package/dist/findings.d.ts +11 -0
  119. package/dist/findings.js +6 -0
  120. package/dist/index.d.ts +19 -0
  121. package/dist/index.js +11 -0
  122. package/dist/indexes.d.ts +2 -0
  123. package/dist/indexes.js +27 -0
  124. package/dist/jcs.d.ts +1 -0
  125. package/dist/jcs.js +16 -0
  126. package/dist/jj.d.ts +12 -0
  127. package/dist/jj.js +82 -0
  128. package/dist/read.d.ts +83 -0
  129. package/dist/read.js +249 -0
  130. package/dist/reconcile.d.ts +9 -0
  131. package/dist/reconcile.js +46 -0
  132. package/dist/source.d.ts +5 -0
  133. package/dist/source.js +29 -0
  134. package/dist/version.d.ts +1 -0
  135. package/dist/version.js +2 -0
  136. package/package.json +40 -4
  137. package/schema/description.schema.json +481 -0
  138. package/skills/operbe/SKILL.md +69 -0
  139. package/skills/operbe/example/behaviors/B-0001.md +36 -0
  140. package/skills/operbe/example/behaviors/B-0002.md +21 -0
  141. package/skills/operbe/example/behaviors/B-0003.md +19 -0
  142. package/skills/operbe/example/behaviors/B-0004.md +18 -0
  143. package/skills/operbe/example/behaviors/B-0005.md +18 -0
  144. package/skills/operbe/example/behaviors/coverage/desktop.md +8 -0
  145. package/skills/operbe/example/behaviors/coverage/phone.md +12 -0
  146. package/skills/operbe/example/client-actions/archive-conversation.md +22 -0
  147. package/skills/operbe/example/client-actions/show-conversations.md +21 -0
  148. package/skills/operbe/example/client-actions/start-retitle.md +22 -0
  149. package/skills/operbe/example/client-actions/unarchive-conversation.md +21 -0
  150. package/skills/operbe/example/operations/archive-conversation.md +16 -0
  151. package/skills/operbe/example/operations/list-conversations.md +16 -0
  152. package/skills/operbe/example/operations/set-conversation-title.md +16 -0
  153. package/skills/operbe/example/operations/unarchive-conversation.md +16 -0
  154. package/skills/operbe/example/operbe.md +15 -0
  155. package/skills/operbe/references/adopting.md +48 -0
  156. package/skills/operbe/references/behaviors.md +168 -0
  157. package/skills/operbe/references/client-actions.md +211 -0
  158. package/skills/operbe/references/formats.md +408 -0
  159. package/skills/operbe/references/operations.md +146 -0
  160. package/skills/operbe/references/tandem.md +69 -0
  161. package/skills/operbe/templates/behavior.md +18 -0
  162. package/skills/operbe/templates/client-action.md +20 -0
  163. package/skills/operbe/templates/coverage.md +4 -0
  164. package/skills/operbe/templates/operation.md +14 -0
  165. package/skills/operbe/templates/operbe.md +10 -0
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: archive-conversation
3
+ class: do
4
+ status: firm
5
+ form: 1
6
+ behaviors: [B-0001]
7
+ operations: [archive-conversation]
8
+ available-when: the conversation is not already archived and I may change it
9
+ applies-to: all
10
+ replaced-by:
11
+ ---
12
+
13
+ ## Sentence
14
+ Archive {conversation}.
15
+
16
+ ## Inputs
17
+ - conversation: a conversation, by its id. Needed.
18
+
19
+ ## Result
20
+ - done: the conversation has left the active list, and Undo is offered.
21
+ - started: offline; it is marked as waiting and completes when the connection returns.
22
+ - refused: says why, and nothing changed. If the server refuses after the list has changed, the conversation returns to it.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: show-conversations
3
+ class: show
4
+ status: firm
5
+ form: 1
6
+ behaviors: [B-0005]
7
+ operations: [list-conversations]
8
+ available-when: always
9
+ applies-to: all
10
+ replaced-by:
11
+ ---
12
+
13
+ ## Sentence
14
+ Show {which} conversations.
15
+
16
+ ## Inputs
17
+ - which: one of active or archived. Needed.
18
+
19
+ ## Result
20
+ - done: the screen is that list. Hands back each conversation shown: its id, its title, and whether it is archived.
21
+ - refused: says why (for example, offline with nothing kept).
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: start-retitle
3
+ class: prepare
4
+ status: firm
5
+ form: 1
6
+ behaviors: [B-0004]
7
+ operations: []
8
+ available-when: I may change the conversation
9
+ applies-to: [phone]
10
+ replaced-by:
11
+ ---
12
+
13
+ ## Sentence
14
+ Open the title of {conversation} for editing, filled with {text}.
15
+
16
+ ## Inputs
17
+ - conversation: a conversation, by its id. Needed.
18
+ - text: the title to suggest. If left out, the field holds the present title.
19
+
20
+ ## Result
21
+ - done: the title field is open with the text in it. The person saves or cancels; which they did is reported afterwards.
22
+ - refused: says why.
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: unarchive-conversation
3
+ class: do
4
+ status: firm
5
+ form: 1
6
+ behaviors: [B-0001]
7
+ operations: [unarchive-conversation]
8
+ available-when: the conversation is archived and I may change it
9
+ applies-to: all
10
+ replaced-by:
11
+ ---
12
+
13
+ ## Sentence
14
+ Return {conversation} to the active list.
15
+
16
+ ## Inputs
17
+ - conversation: a conversation, by its id. Needed.
18
+
19
+ ## Result
20
+ - done: the conversation is back in the active list, where it was.
21
+ - refused: says why, and nothing changed.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: archive-conversation
3
+ class: change
4
+ named-because: restricted-state
5
+ needs: may change the conversation
6
+ safe-to-repeat: yes
7
+ taken-back-by: unarchive-conversation
8
+ risk: changes
9
+ many-at-once: none
10
+ ---
11
+
12
+ ## Sentence
13
+ Archive {conversation}.
14
+
15
+ ## Holds only if
16
+ The conversation is not already archived.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: list-conversations
3
+ class: query
4
+ named-because:
5
+ needs: nothing
6
+ safe-to-repeat: yes
7
+ taken-back-by: nothing
8
+ risk: reads
9
+ many-at-once: none
10
+ ---
11
+
12
+ ## Sentence
13
+ List the conversations the caller has that are {active or archived}.
14
+
15
+ ## Holds only if
16
+ Always.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: set-conversation-title
3
+ class: change
4
+ named-because:
5
+ needs: may change the conversation
6
+ safe-to-repeat: yes
7
+ taken-back-by: itself
8
+ risk: changes
9
+ many-at-once: none
10
+ ---
11
+
12
+ ## Sentence
13
+ Set the title of {conversation} to {title}.
14
+
15
+ ## Holds only if
16
+ Always.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: unarchive-conversation
3
+ class: change
4
+ named-because: restricted-state
5
+ needs: may change the conversation
6
+ safe-to-repeat: yes
7
+ taken-back-by: archive-conversation
8
+ risk: changes
9
+ many-at-once: none
10
+ ---
11
+
12
+ ## Sentence
13
+ Return {conversation} from the archive.
14
+
15
+ ## Holds only if
16
+ The conversation is archived.
@@ -0,0 +1,15 @@
1
+ ---
2
+ operbe: 1
3
+ operations: operations
4
+ behaviors: behaviors
5
+ client-actions: client-actions
6
+ uis: [phone, desktop]
7
+ ---
8
+
9
+ ## Decisions
10
+ - Front ends: a phone UI, a desktop UI and a command line.
11
+ - The phone UI is built first.
12
+ - Client actions are kept, for the desktop's command palette and for an assistant built into both UIs.
13
+ - Renaming in place is on the phone only for now, so `start-retitle` applies to the phone.
14
+
15
+ ## Known deviations
@@ -0,0 +1,48 @@
1
+ # Adopting operbe
2
+
3
+ *Part of operbe. This guide covers how a project starts using the method and how it keeps up as the method changes.*
4
+
5
+ ## A new project
6
+
7
+ 1. Copy `templates/operbe.md` to the project's root. Name the UIs.
8
+ 2. Create the two folders it names.
9
+ 3. Work the first feature through the loop in `tandem.md`. Don't try to list everything up front. The lists grow as the features do.
10
+ 4. Run `npx operbe check`.
11
+ 5. Make the check part of finishing work: a change isn't done until the check passes.
12
+
13
+ ## A project that already exists
14
+
15
+ You don't need to stop and document everything.
16
+
17
+ 1. Add `operbe.md` as above.
18
+ 2. Make new work conform. Every new operation gets a record, and every new or changed piece of UI gets a behavior.
19
+ 3. Write old work down when it is next touched. Whoever changes an existing screen or call adds its records then.
20
+ 4. List what doesn't conform under "Known deviations" in `operbe.md`, for example "the phone UI calls two server routes that aren't operations yet". That list may only shrink.
21
+ 5. Do one sweep for the easy part. Everything that already crosses the membrane is an operation whether or not it is written down, and listing the names is quick.
22
+
23
+ ## Who owns what
24
+
25
+ The designer owns the behavior list. Anyone may propose a behavior or a change, and the designer decides.
26
+
27
+ Whoever builds the server owns the operation list. Each UI's builder owns that UI's coverage file.
28
+
29
+ Where a project keeps client actions, the designer settles which behaviors are offered to callers and each action's class, since the class decides when an assistant must ask. Whoever builds the UIs owns names, inputs and results. An agent may propose a client action; it doesn't add a `do` by itself.
30
+
31
+ One person may hold all three roles. They still matter, because they say whose word settles a disagreement.
32
+
33
+ ## Working with agents
34
+
35
+ - Give a building agent one behavior record and the index. Don't give it the whole list.
36
+ - Have a different agent, or a person, check the result against the examples.
37
+ - An agent that finds a UI doing something off the list raises it. It doesn't add or remove it.
38
+ - Put anything that must hold every time in `operbe check`, an architecture's declaration, or the project's own checks. Instructions are advice, and agents sometimes skip advice.
39
+
40
+ ## Keeping up with the method
41
+
42
+ `operbe.md` records the version the project follows. The method's changelog (`CHANGELOG.md` in the operbe repository, github.com/trevorschoeny/operbe) says what changed in each version and what a project must do about it.
43
+
44
+ A rule in the method is experimental until it has worked in two projects. Experimental rules may change without a new major version.
45
+
46
+ ## When the method doesn't fit
47
+
48
+ Record the deviation in `operbe.md` and carry on. If the same deviation shows up in a second project, the method is probably wrong, and it should be fixed at the source.
@@ -0,0 +1,168 @@
1
+ # Behaviors
2
+
3
+ *Part of operbe, the operations and behaviors method. This guide covers how to think about behaviors and how to write them down. It doesn't say what a designer should decide, or how a UI is built.*
4
+
5
+ ## Contents
6
+ 1. What a behavior is
7
+ 2. Behaviors are for UIs only
8
+ 3. Not an operation
9
+ 4. What is fixed and what is free
10
+ 5. One behavior, one decision
11
+ 6. The record
12
+ 7. Writing it so two builders read it the same
13
+ 8. Coverage
14
+ 9. Keeping the list true
15
+ 10. Checklist for adding a behavior
16
+ 11. What each project decides
17
+
18
+ ## 1. What a behavior is
19
+
20
+ A **behavior** is anything the designer wants to hold true in the user interface.
21
+
22
+ It can be a flow ("archiving a conversation moves it out of the way and offers Undo"). It can be a placement ("you always reach your profile through a bubble at the bottom right"). It can be a gesture, a motion, a piece of wording, or a rule that holds across many screens ("destructive buttons are always red"). If the designer wants it to be so everywhere it applies, it is a behavior.
23
+
24
+ Behaviors are documentation. They are never code, and nothing reads them at runtime. The **behavior list** is the source of truth for the UI: every UI is built from it and checked against it. Nothing keeps a UI in line automatically, so builders, human or agent, go back to the list and check their work.
25
+
26
+ ## 2. Behaviors are for UIs only
27
+
28
+ A command line, an MCP server or an API has no behaviors. Those front ends go straight to operations (see `operations.md`).
29
+
30
+ The list matters most when a product has several UIs built separately. It is still useful with one UI, because it is what the designer hands the builder and what the builder is checked against.
31
+
32
+ ## 3. Not an operation
33
+
34
+ | | Behavior | Operation |
35
+ |---|---|---|
36
+ | Says | what the experience is | what the system can do |
37
+ | Owned by | design | engineering |
38
+ | Is | documentation | code |
39
+ | Lives | on the UI side | at the server membrane |
40
+
41
+ What separates them is who owns each and which side of the membrane it sits on. Level of detail has nothing to do with it: a behavior can be as specific as a corner of the screen.
42
+
43
+ Many behaviors touch no operation at all, such as how Back works or how one screen gives way to another. And where an operation is involved, the two still say different things. "You can't archive without the right" is the operation's business. What the UI shows when that happens is a behavior.
44
+
45
+ ## 4. What is fixed and what is free
46
+
47
+ Whatever the designer states is fixed. Whatever the designer leaves unstated is free.
48
+
49
+ Nothing is off limits for a behavior to mention. If the designer cares where something sits, the behavior says so. If they don't care, the behavior is silent on it and each builder decides.
50
+
51
+ The more a behavior fixes, the fewer UIs can honour it. A corner bubble may not exist on a watch. That trade is the designer's to make, and the record says which UIs the behavior applies to.
52
+
53
+ ## 5. One behavior, one decision
54
+
55
+ A behavior is one thing the designer decided, small enough to be right or wrong by itself. Three questions help:
56
+
57
+ - Could a builder get this right while getting the neighbouring thing wrong? Then they are two behaviors.
58
+ - Would the designer ever change this without changing that? Then they are two behaviors.
59
+ - Is it a yes-or-no question whether a given UI honours it? If not, it is too vague or too big.
60
+
61
+ There is no fixed size beyond that. A behavior can be a single sentence about a colour, or a flow of several steps.
62
+
63
+ Some things are not behaviors:
64
+
65
+ - what the system permits or does (those are operations);
66
+ - how the UI is built (frameworks, components, code);
67
+ - why the designer decided it (keep reasons elsewhere, because the list is reference);
68
+ - anything about a front end that isn't a UI.
69
+
70
+ ## 6. The record
71
+
72
+ Each behavior is one file, named by its id. Here is a whole record:
73
+
74
+ ```
75
+ ---
76
+ id: B-0031
77
+ name: Profile bubble
78
+ status: firm
79
+ form: 1
80
+ applies-to: all
81
+ operations: []
82
+ replaced-by:
83
+ ---
84
+
85
+ ## Statement
86
+ The person's own profile is always reached through a round bubble showing their picture, fixed at the bottom right of the screen. It is present on every screen and never covered by other content.
87
+
88
+ ## Examples
89
+ - **Usual.** On any screen, the bubble is at the bottom right; choosing it opens my profile.
90
+ - **Scrolling.** When I scroll a long list, the bubble stays where it is.
91
+ - **Keyboard up.** When the on-screen keyboard is showing, the bubble sits above it, still at the right.
92
+ - **Signed out.** When nobody is signed in, there is no bubble.
93
+
94
+ ## Changes
95
+ - form 1: first version.
96
+ ```
97
+
98
+ The header identifies the behavior and says where it stands:
99
+
100
+ - The id is permanent and separate from the name, so a rename costs nothing. Cite the id in code, tickets and tests.
101
+ - The status is `rough` while the behavior is still being worked out, `firm` once at least one real UI has built it and it reads the same to everyone, and `retired` when it is no longer wanted.
102
+ - The form is a number that goes up when the meaning changes. Fixing the wording doesn't raise it.
103
+ - `applies-to` is `all`, or the UIs the behavior applies to.
104
+ - `operations` lists the operations it ends in, if any.
105
+
106
+ Three sections are required. The Statement is the behavior itself: what must be so, as specific as the designer wants. The Examples are concrete cases a builder can check on a real UI, covering the usual case and the edges. Changes has one line per form.
107
+
108
+ Five more sections may be used when they fit, always under these names: Flow (numbered steps, for a behavior that is a sequence), Appears when, Usable when, Undo, and Differs on (a UI where the behavior deliberately takes another form). No other sections are allowed.
109
+
110
+ The exact rules, which a script checks, are in `formats.md`.
111
+
112
+ ## 7. Writing it so two builders read it the same
113
+
114
+ Say what must be so. Use must, should and may with their strict meanings, and treat anything unmarked as a must.
115
+
116
+ Write for a stranger. Someone who has never seen the product should picture the same thing the designer does.
117
+
118
+ Use one word for one thing, and keep a short word list beside the behavior list.
119
+
120
+ Be exact where you care and silent where you don't. Vague wording such as "near the bottom" or "quickly" neither fixes anything nor frees anything.
121
+
122
+ Lean on the examples. People read a one-line statement differently, and the examples are what pin it down. A behavior with no checkable example stays rough.
123
+
124
+ ## 8. Coverage
125
+
126
+ Each UI keeps one line for each behavior it has built:
127
+
128
+ | Value | Meaning |
129
+ |---|---|
130
+ | honours | Built, and matches the form named on the line. |
131
+ | differs | Built, but not as written. The line says how. This is temporary: either the UI or the record is wrong. |
132
+ | limited | Honours part of it. The line says which part. |
133
+ | not-here | Deliberately absent. The line says why and who decided. |
134
+
135
+ A behavior with no line on a UI hasn't been built there yet. A rough behavior may already have coverage lines; a UI building it is how it becomes firm.
136
+
137
+ Coverage is checked in both directions. Forward: has every UI built every firm behavior that applies to it? Backward: does any UI do something the designer cares about that isn't on the list? If so, it either becomes a behavior or comes out of the UI.
138
+
139
+ ## 9. Keeping the list true
140
+
141
+ A written list drifts unless people check it on purpose. These practices help, and each project decides how strictly to apply them.
142
+
143
+ - Keep records small and uniform. People keep current what is short, regular and used every day.
144
+ - Let the list show only what is true now. How it got there is history, and belongs somewhere else.
145
+ - Treat the list as a gate. A UI change that alters a behavior isn't finished until the record and that UI's coverage line are updated.
146
+ - When a UI differs from a record, decide which one is wrong and fix it.
147
+ - Let `operbe check` check the form of the records (required fields, allowed values, unique ids, operations that exist), and `operbe index` print the index and the coverage table. People write the statements; never generate a statement from a UI.
148
+ - Build from one record at a time, plus the index (`operbe index`). Have someone other than the builder do the check.
149
+
150
+ ## 10. Checklist for adding a behavior
151
+
152
+ 1. Is it something the designer wants to hold true in the UI? If it's about what the system does, it's an operation.
153
+ 2. Is it already on the list?
154
+ 3. Is it one decision? Could it be right while its neighbour is wrong?
155
+ 4. Write the statement, exact where it matters and silent where it doesn't.
156
+ 5. Write the examples: the usual case, then the edges.
157
+ 6. Say which UIs it applies to.
158
+ 7. Name the operations it ends in, if any. If one is missing, that is a finding for the operation list.
159
+ 8. Give it the next id, with status `rough` and form 1. `operbe new behavior "<name>"` does both.
160
+
161
+ A behavior that a palette, a shortcut or an assistant could ask a UI to do is carried out by one or more client actions, where the project keeps them. See `client-actions.md`.
162
+
163
+ ## 11. What each project decides
164
+
165
+ - Which UIs exist, and which is built first.
166
+ - How its behaviors are grouped.
167
+ - How strict its change process is, and who owns the list.
168
+ - Its word list.
@@ -0,0 +1,211 @@
1
+ # Client actions
2
+
3
+ *Part of operbe. This guide covers the third list: what a client action is, its three classes, what each declares, who calls it, and how an assistant reaches one. The list is optional. A project takes it up when it wants a command palette, shortcuts, or an assistant that can work a UI for a person. Record formats are in `formats.md`.*
4
+
5
+ ## Contents
6
+ - 1. What a client action is
7
+ - 2. Not a behavior, not an operation
8
+ - 3. Three classes: show, prepare, do
9
+ - 4. One list, several callers
10
+ - 5. What every client action declares
11
+ - 6. Results
12
+ - 7. Rules that hold everywhere
13
+ - 8. How big
14
+ - 9. Client actions or operations
15
+ - 10. Reaching a screen from outside
16
+ - 11. Keeping UIs in step
17
+ - 12. What to guard against
18
+ - 13. Checklist for adding a client action
19
+ - 14. What each project decides
20
+ - Where this comes from
21
+
22
+ Two words used throughout. A **UI** is a kind of front end the project builds (the phone app, the desktop app). A **screen** is one running copy of a UI in front of one person.
23
+
24
+ ## 1. What a client action is
25
+
26
+ A client action is one named thing a UI can be asked to do on its own screen: open something, go somewhere, filter a list, start a draft, press Send. It has a name, stated inputs, and a result. It is code, and it lives in the UI.
27
+
28
+ The test: could something other than a finger on the control ask for this, and would the UI know what to do? If so, it is a client action.
29
+
30
+ An operation is asked of the server. A client action is asked of a screen, and the screen runs it. The server runs none.
31
+
32
+ ## 2. Not a behavior, not an operation
33
+
34
+ A **behavior** says, in words for a designer, what must hold in a UI. It may be rough, and its wording may change freely. A **client action** is a contract with a name and inputs that callers depend on. They are separate records for four reasons:
35
+
36
+ - Some behaviors have nothing to call. "Archived conversations look dimmed" is a rule.
37
+ - The counts differ. One behavior may need several actions, and one action may serve several behaviors.
38
+ - They change at different speeds. Rewording a behavior breaks nobody. Changing an action's inputs breaks its callers.
39
+ - They answer different questions: "what must be true on screen?" and "what can I ask this screen to do, with what, and what comes back?"
40
+
41
+ Every client action **must** name at least one behavior it carries out. An action with no behavior behind it is the UI doing something the designer never decided. For plain moving around (open this, go back), the behavior is usually a general one, such as "Anything shown in a list can be opened". If no such behavior exists, write it first.
42
+
43
+ A client action is not an operation. It never crosses the membrane by itself. When it needs the server, the UI sends operations exactly as it would for a person.
44
+
45
+ ## 3. Three classes: show, prepare, do
46
+
47
+ Every client action is exactly one of these.
48
+
49
+ | Class | What it does | Example |
50
+ |---|---|---|
51
+ | **show** | Changes only what this person sees on this screen | Show the archive; open a conversation |
52
+ | **prepare** | Sets something up and leaves it for the person to commit or drop | Open the title for editing with some text in it; bring up the review for a delete |
53
+ | **do** | Commits something: other people see it or are bound by it, or the person can't take it back by moving their view | Archive the conversation; send the reply; clear what this device has kept |
54
+
55
+ The class is the line a person cares about: it moved my view, it set something up for me, or it acted.
56
+
57
+ - A `show` **must not** send any operation except queries, unless the project decided otherwise for it (below) and its record says why in `show-because`.
58
+ - A `prepare` **must not** leave anything other people can see or are bound by. Saving a draft that only the person can see is allowed.
59
+ - A `do` **must** list the operations it ends in, at least one of them a change or a signal. A `do` that commits something on the device alone lists none and says `local: yes`.
60
+
61
+ Three cases come up often.
62
+
63
+ - **A view that also sends something.** If opening a conversation marks it read and the other person sees that, the action sends a change, so it is a `do`. A project may decide that such a change is a consequence the person has already agreed to (a setting), record that decision, and class the action `show`. It still lists the operation, and the record says why in `show-because`.
64
+ - **An act with a review.** An action that only brings up the review is a `prepare` and lists no operations. Committing is a separate `do`. Run by anything other than the person, that `do` stops at the review (rule 2).
65
+ - **Taking it back.** If a `do` can be taken back, there **should** be an action that takes it back. Otherwise a caller that archives by mistake can't undo it through the UI.
66
+
67
+ **When a caller asks first.** A caller that acts for a person, such as an assistant, **should** not ask before a `show` or a `prepare`, and **must** have the person's ask before a `do`. A clear request from the person for this act on these inputs is the ask. The caller **should** ask again when an operation the action ends in destroys something, changes who may do what, or can't be taken back. Those facts are already on the operation.
68
+
69
+ ## 4. One list, several callers
70
+
71
+ A project has one list of client actions. Everything that can ask a UI to do something goes through it:
72
+
73
+ - **The command palette.** It offers client actions, which read better to a person than operations do.
74
+ - **Shortcuts and menus.** A shortcut is a key bound to a client action.
75
+ - **An assistant acting for the person**, built into the app or reaching it from outside (section 10).
76
+
77
+ The UI's own palette and shortcuts **must** run on the same definitions that outside callers reach. A list kept beside the app for outside callers only will drift from it, which is what happened to scripting dictionaries kept by hand.
78
+
79
+ The record is the place the project agrees on an action. A project that defines its client actions in code **may** generate the records from the code, or check one against the other. Either way the two **must** agree, and the code is what runs.
80
+
81
+ Where an action is shown (which menu, which group, whether the palette lists it) is each UI's business and is not in the record.
82
+
83
+ ## 5. What every client action declares
84
+
85
+ | Fact | Meaning |
86
+ |---|---|
87
+ | Name | A verb, then the thing: `open-conversation`. The name is the action's identity and never changes. |
88
+ | Class | `show`, `prepare` or `do`. |
89
+ | Status | `rough`, `firm` or `retired`, as for a behavior. |
90
+ | Behaviors | The behaviors it carries out. At least one. |
91
+ | Operations | The operations it sends. |
92
+ | Available when | The condition under which it can run. `always` if there is none. |
93
+ | Applies to | The UIs that have it. |
94
+ | Sentence | One sentence, inputs in `{braces}`. |
95
+ | Inputs | One line for each input: what it is, how a caller names it, and whether it is needed. |
96
+ | Result | What the caller is told afterwards (section 6). |
97
+
98
+ **Inputs are stated.** An action never takes an input from the selection without naming it. When a person runs an action from a control, the UI fills the named input from what is selected. When anything else runs it, the caller names the thing. Unnamed inputs are what made recorded macros impossible to replay.
99
+
100
+ **Availability is said twice.** The record declares the condition, so a caller can read it without a screen. The screen also reports, live, which actions can run now and, for one that can't, why. `available-when` restates the behavior's *Appears when* and *Usable when* for a caller. Where they differ, the behavior is right and the action is wrong. A condition written as words or data **should** be preferred to code that answers "can I run?", because another UI and an assistant can read it.
101
+
102
+ ## 6. Results
103
+
104
+ A call never ends in silence. Every call ends in exactly one of these.
105
+
106
+ | Result | Meaning |
107
+ |---|---|
108
+ | **done** | It happened. Says where the screen is now. A `show` also hands back what it showed, as far as the caller may see it. |
109
+ | **refused** | Nothing changed. Says why. |
110
+ | **waiting for the person** | The screen is asking the person something: a review, a confirmation, a choice. Says what. |
111
+ | **started** | It was accepted and hasn't finished: it is queued while offline, or it takes a while. Says how the caller will learn the end. |
112
+ | **unknown** | The screen went away or the call timed out after it may have sent something. |
113
+
114
+ What happens later is reported the same way, on the caller's next turn or as an event the project defines: the person confirmed or cancelled, the queued change went through, the server refused and the screen put things back.
115
+
116
+ After **unknown**, a caller **must not** simply run the action again. It asks the server what is true (a query), and looks at whether the operations are safe to repeat. That fact is on each operation.
117
+
118
+ A UI that shows a change before the server has agreed reports **started**, not done, until the server agrees.
119
+
120
+ ## 7. Rules that hold everywhere
121
+
122
+ 1. **The same as by hand.** Running a client action leaves the screen, and the server, as if the person had done it with the control. The same checks run, the same reviews appear, the same operations are sent.
123
+ 2. **A review is never skipped.** If doing it by hand shows a review or a confirmation, the action stops there and its result is "waiting for the person". Nothing a caller passes can answer for the person.
124
+ 3. **Who asked is carried.** When an action sends operations, the server learns who asked: the person, or an assistant for them. Otherwise the record would say the person did something an assistant chose.
125
+ 4. **Nothing outside the list.** A caller does nothing through a UI except by a client action. The method has no "press whatever is at this position".
126
+ 5. **An action never widens rights.** It can do what the person at that screen can do, and no more.
127
+ 6. **The person can see it.** When something other than the person runs an action, the screen shows that it happened and what asked.
128
+
129
+ ## 8. How big
130
+
131
+ Size a client action for what a person would ask for.
132
+
133
+ - Too small: `click-archive-button`. That is a control, and it means nothing on a UI that archives by swiping.
134
+ - Too big: `clean-up-inbox`. That is a task, and belongs to whoever is calling.
135
+ - Right: `archive-conversation`, with the conversation as its input.
136
+
137
+ Two tests. **The same on every UI:** if the action only makes sense on one UI's layout, it is named after a control. **One result:** if it can half happen, it is two actions.
138
+
139
+ A filter or a choice among a few is usually an input, not an action of its own: `show-conversations {which: all, active or archived}`. Moving around is usually one action for each kind of place, with the place as the input. Where a UI's places have addresses (URLs, deep links), a `show` and the address for the same place **should** agree.
140
+
141
+ A gesture is a way of running an action. Swiping to archive runs `archive-conversation`; it gets no action of its own.
142
+
143
+ ## 9. Client actions or operations
144
+
145
+ An assistant may be able to reach both. They are for different things.
146
+
147
+ - **Client actions** are for working with the person on their screen: they see it happen, reviews appear, Undo is offered.
148
+ - **Operations** are for acting with no screen, as any other front end does.
149
+
150
+ A protection that must hold against every caller belongs on the operation. Rule 2 guards the UI path only. If deleting for good must always have the person's fresh agreement, the operation has to require proof of it, or an assistant with the operation could go around the review.
151
+
152
+ ## 10. Reaching a screen from outside
153
+
154
+ The rules are that a screen runs its own actions, that only the person or their assistant may ask, and that the caller always gets a result. How a call reaches a screen is the project's choice. Three ways that work:
155
+
156
+ **Built in.** The UI sends the assistant the actions that can run now with each request. The assistant answers with the ones to run. The UI runs them and reports each result on the next turn.
157
+
158
+ **Through the server.** The server offers the client action list to outside assistants beside its operations, for example as tools on an MCP server, and passes each call to one of the person's screens. Passing a call to a screen crosses the membrane, so it is an operation like any other: the project keeps a query that lists the person's screens and an operation that passes a call to one.
159
+
160
+ - The tools offered are the whole list the person may use. They don't change with what is on screen.
161
+ - The screen list gives, for each screen, a **screen handle**, which UI it is, where it is, which actions can run there now, and the form of each.
162
+ - Every client action takes a screen handle.
163
+ - With several screens, the caller **should** use the one the person is using now, and ask if that is unclear.
164
+ - With no screen, the caller may ask the person to open one, or use operations.
165
+ - A connection to a screen is temporary. Nothing is lost when it ends; the caller lists the screens again.
166
+ - The server knows who is asking because it passed the call along, so it, and not the screen, says who asked (rule 3).
167
+
168
+ **From the page.** Where a browser lets a page offer tools to the browser's own assistant, a web UI can offer its list that way.
169
+
170
+ A server that passes calls along **must** first check that the caller is the person whose screen it is, or acts with a grant from that person that the server can check.
171
+
172
+ ## 11. Keeping UIs in step
173
+
174
+ A client action applies to every UI unless its record says otherwise. Each UI's coverage file has a line for each action it has built, with the same values as for a behavior: `honours`, `differs`, `limited`, `not-here`.
175
+
176
+ An action that exists on one UI only is an exception, and the record says so in `applies-to`, as a behavior's does.
177
+
178
+ A behavior a person can trigger is carried out by at least one client action, or it says `client-actions: none`. That covers two cases: there is nothing to call (a rule, a gesture), or the designer has chosen not to offer it to callers. A note on the line says which.
179
+
180
+ The check reports as gaps: a firm action a UI hasn't built, an action a UI has built whose behavior it hasn't, and a firm behavior that sends a change or a signal and has neither an action nor `client-actions: none`. It doesn't look for missing actions on behaviors that only show something.
181
+
182
+ An action is retired the way a behavior is: its status becomes `retired` and it says what replaced it. Renaming is retiring one and adding another.
183
+
184
+ ## 12. What to guard against
185
+
186
+ - **Text on screen that addresses the assistant.** Content is not instruction. The classes limit the harm: the worst a tricked caller does through a `show` is move the view.
187
+ - **A class that lies.** The check compares each action's class with the operations it lists. A `show` that lists a change is an error, unless its `show-because` says why.
188
+ - **The screen changing between asking and running.** The screen checks again when the call arrives, and refuses with the reason if the action can no longer run.
189
+ - **A crowded palette.** Not every action belongs in a palette. Leave out one that needs an input the palette can neither ask for nor take from the selection.
190
+ - **Drift.** An action that names a retired behavior is an error. An action built against an older form of its record is a gap.
191
+
192
+ ## 13. Checklist for adding a client action
193
+
194
+ 1. Which behavior does it carry out? If none, raise it with the designer first.
195
+ 2. Is there already an action for this that could take it as an input?
196
+ 3. Is it named for what a person would ask, not for a control or a gesture?
197
+ 4. Which class is it? If `do`, which operations does it end in, or is it local?
198
+ 5. What are its inputs, each named, with how a caller names the thing?
199
+ 6. When can it run, in the behavior's own words?
200
+ 7. What does it report for each result that can happen?
201
+ 8. Does doing it by hand show a review or a confirmation? Then it stops there, and bringing up the review may be a `prepare` of its own.
202
+ 9. If it can be taken back, which action takes it back?
203
+ 10. Which UIs have it?
204
+
205
+ ## 14. What each project decides
206
+
207
+ Whether to keep client actions at all. Who settles a new action or a change to one. Which callers exist, and which of the ways in section 10 it offers. How availability conditions are written. How an assistant is told to ask before a `do`. How a grant to an assistant is given and checked. How a screen shows that something else is working it. How later outcomes reach a caller. Whether its palette lists every action.
208
+
209
+ ## Where this comes from
210
+
211
+ Editors and creative tools that keep one command registry for menus, shortcuts and scripts. Operating systems that let an app declare actions for the system's assistant. Protocols in which a front end sends its own tools to an assistant and runs them itself. The tool shape of the Model Context Protocol, which a client action's record can be turned into: a name, a description, inputs, a result. The three classes, the link to a design record, one list across several UIs, and the screen handle are operbe's own.