operbe 1.0.0-rc.2 → 1.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/README.md +26 -22
  2. package/conformance/describe/edge/body.json +1 -1
  3. package/conformance/describe/edge/digest +1 -1
  4. package/conformance/describe/edge/project/operbe.md +1 -1
  5. package/conformance/describe/example/body.json +1 -1
  6. package/conformance/describe/example/digest +1 -1
  7. package/conformance/describe/example/project/behaviors/B-0001.md +13 -9
  8. package/conformance/describe/example/project/behaviors/B-0002.md +1 -1
  9. package/conformance/describe/example/project/behaviors/B-0003.md +2 -2
  10. package/conformance/describe/example/project/behaviors/B-0004.md +2 -2
  11. package/conformance/describe/example/project/behaviors/B-0005.md +2 -2
  12. package/conformance/describe/example/project/behaviors/coverage/mcp.md +9 -0
  13. package/conformance/describe/example/project/operbe.md +9 -5
  14. package/conformance/diff/core/a/behaviors/B-0002.md +1 -1
  15. package/conformance/diff/core/a/behaviors/B-0003.md +1 -1
  16. package/conformance/diff/core/a/operbe.md +5 -5
  17. package/conformance/diff/core/b/behaviors/B-0002.md +1 -1
  18. package/conformance/diff/core/b/behaviors/B-0003.md +1 -1
  19. package/conformance/diff/core/b/operbe.md +5 -5
  20. package/conformance/diff/core/changes.json +45 -17
  21. package/conformance/diff/declared/a/operbe.md +1 -1
  22. package/conformance/diff/declared/b/operbe.md +1 -1
  23. package/conformance/diff/reworded/a/behaviors/B-0002.md +1 -1
  24. package/conformance/diff/reworded/a/behaviors/B-0003.md +1 -1
  25. package/conformance/diff/reworded/a/operbe.md +5 -5
  26. package/conformance/diff/reworded/b/behaviors/B-0002.md +1 -1
  27. package/conformance/diff/reworded/b/behaviors/B-0003.md +1 -1
  28. package/conformance/diff/reworded/b/operbe.md +5 -5
  29. package/dist/check.d.ts +1 -1
  30. package/dist/check.js +124 -67
  31. package/dist/cli.js +19 -15
  32. package/dist/describe.js +23 -20
  33. package/dist/diff.js +35 -24
  34. package/dist/indexes.js +20 -12
  35. package/dist/read.d.ts +8 -6
  36. package/dist/read.js +39 -15
  37. package/dist/reconcile.d.ts +2 -2
  38. package/dist/reconcile.js +12 -13
  39. package/dist/version.d.ts +1 -1
  40. package/dist/version.js +1 -1
  41. package/package.json +3 -3
  42. package/schema/description.schema.json +26 -9
  43. package/skills/operbe/SKILL.md +42 -16
  44. package/skills/operbe/example/behaviors/B-0001.md +13 -9
  45. package/skills/operbe/example/behaviors/B-0002.md +1 -1
  46. package/skills/operbe/example/behaviors/B-0003.md +2 -2
  47. package/skills/operbe/example/behaviors/B-0004.md +2 -2
  48. package/skills/operbe/example/behaviors/B-0005.md +2 -2
  49. package/skills/operbe/example/behaviors/coverage/mcp.md +9 -0
  50. package/skills/operbe/example/operbe.md +9 -5
  51. package/skills/operbe/references/actions.md +226 -0
  52. package/skills/operbe/references/adopting.md +6 -6
  53. package/skills/operbe/references/behaviors.md +75 -59
  54. package/skills/operbe/references/formats.md +69 -51
  55. package/skills/operbe/references/operations.md +13 -14
  56. package/skills/operbe/references/tandem.md +31 -30
  57. package/skills/operbe/templates/{client-action.md → action.md} +3 -3
  58. package/skills/operbe/templates/behavior.md +1 -1
  59. package/skills/operbe/templates/coverage.md +1 -1
  60. package/skills/operbe/templates/operbe.md +1 -1
  61. package/skills/operbe/references/client-actions.md +0 -211
  62. /package/conformance/describe/example/project/{client-actions → actions}/archive-conversation.md +0 -0
  63. /package/conformance/describe/example/project/{client-actions → actions}/show-conversations.md +0 -0
  64. /package/conformance/describe/example/project/{client-actions → actions}/start-retitle.md +0 -0
  65. /package/conformance/describe/example/project/{client-actions → actions}/unarchive-conversation.md +0 -0
  66. /package/conformance/diff/core/a/{client-actions → actions}/archive-conversation.md +0 -0
  67. /package/conformance/diff/core/a/{client-actions → actions}/show-conversations.md +0 -0
  68. /package/conformance/diff/core/a/{client-actions → actions}/start-retitle.md +0 -0
  69. /package/conformance/diff/core/a/{client-actions → actions}/unarchive-conversation.md +0 -0
  70. /package/conformance/diff/core/b/{client-actions → actions}/archive-conversation.md +0 -0
  71. /package/conformance/diff/core/b/{client-actions → actions}/show-conversations.md +0 -0
  72. /package/conformance/diff/core/b/{client-actions → actions}/unarchive-conversation.md +0 -0
  73. /package/conformance/diff/reworded/a/{client-actions → actions}/archive-conversation.md +0 -0
  74. /package/conformance/diff/reworded/a/{client-actions → actions}/show-conversations.md +0 -0
  75. /package/conformance/diff/reworded/a/{client-actions → actions}/start-retitle.md +0 -0
  76. /package/conformance/diff/reworded/a/{client-actions → actions}/unarchive-conversation.md +0 -0
  77. /package/conformance/diff/reworded/b/{client-actions → actions}/archive-conversation.md +0 -0
  78. /package/conformance/diff/reworded/b/{client-actions → actions}/show-conversations.md +0 -0
  79. /package/conformance/diff/reworded/b/{client-actions → actions}/start-retitle.md +0 -0
  80. /package/conformance/diff/reworded/b/{client-actions → actions}/unarchive-conversation.md +0 -0
  81. /package/skills/operbe/example/{client-actions → actions}/archive-conversation.md +0 -0
  82. /package/skills/operbe/example/{client-actions → actions}/show-conversations.md +0 -0
  83. /package/skills/operbe/example/{client-actions → actions}/start-retitle.md +0 -0
  84. /package/skills/operbe/example/{client-actions → actions}/unarchive-conversation.md +0 -0
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: operbe
3
- description: The operations and behaviors method (operbe) for projects with a server and front ends (UI, MCP, command line, API). Use when a project has an operbe.md file or the user asks to use operbe. Covers adding, sizing or reviewing an operation (a server call or API endpoint, anything that crosses the server membrane), writing or changing a behavior (a UI spec item, anything the designer wants to hold true in a UI), adding a client action (a command a palette, a shortcut or an assistant can ask a UI to run) in an operbe project, building or checking a UI against the behavior list and its coverage, and adopting operbe in a project.
3
+ description: The operations and behaviors method (operbe) for projects with a server and front ends (native apps, web, a command line, an MCP server, an API). Use when a project has an operbe.md file or the user asks to use operbe. Covers adding, sizing or reviewing an operation (a server call or API endpoint, anything that crosses the server membrane), writing or changing a behavior (anything the designer wants to hold true on the front ends), adding an action (something a front end does for a person, asked for by a control, a palette, a shortcut, a command, an MCP tool or an assistant), building or checking a front end against the behavior list and its coverage, offering Actions and Operations from an API or MCP server, and adopting operbe in a project.
4
4
  compatibility: The operbe command needs Node.js 22 or later (npx operbe). --at also needs jj.
5
5
  metadata:
6
6
  version: "1"
@@ -8,21 +8,47 @@ metadata:
8
8
 
9
9
  # operbe
10
10
 
11
- operbe has each project keep two lists, and offers a third.
11
+ operbe has each project keep three lists, for the front ends it names.
12
12
 
13
- Operations are everything that crosses the server membrane. There is one set, every front end uses it, and it is code.
13
+ A **front end** is anything that acts for a person: a native app, the web app, a command line a person types into, an assistant working over MCP, an API's Actions. The project's profile names each one in `front-ends`, and may name groups of them in `groups` (such as `screens`, the ones with a screen).
14
14
 
15
- Behaviors are everything the designer wants to hold true in a UI. They are documentation that UIs are built from and checked against. Front ends that aren't UIs have no behaviors and go straight to operations.
15
+ **Operations** are everything that crosses the server membrane. There is one set, defined once, and it is code at the server.
16
16
 
17
- The third list is optional. Client actions are everything a UI can be asked to do on its own screen, by a command palette, a shortcut or an assistant. They are code in the UI. Each is classed show, prepare or do, and each names the behavior it carries out.
17
+ **Behaviors** are everything the designer wants to hold true on the front ends. They are the parity contract: front ends built with different code (two native platforms, the web, an MCP server) are all built from the same behaviors and checked against them. Behaviors are documentation.
18
18
 
19
- The one rule: nothing crosses the membrane except an operation, and nothing the designer cares about in a UI is off the behavior list.
19
+ **Actions** are what a front end does for a person: show a list, archive a conversation, send a reply. Each is classed show, prepare or do. An action is code in the front end. It is the layer that turns what was asked for (by a control, a palette, a shortcut, a command or an assistant) into calls to operations: a front end never calls an operation except through an action.
20
+
21
+ The one rule: nothing crosses the membrane except an operation, and nothing the designer cares about on a front end is off the behavior list.
20
22
 
21
23
  operbe covers how these are thought about, written down and checked. It doesn't prescribe architecture, language or tooling. Those belong to the project.
22
24
 
25
+ ## How the three lists relate
26
+
27
+ There are two relationships, and they don't form a line.
28
+
29
+ ```
30
+ behaviors ──describe──▶ front ends: their actions and their screens
31
+
32
+ actions ────call──────▶ operations (front end code calling server code)
33
+ ```
34
+
35
+ - **Behaviors describe front ends.** A behavior says what must hold in an action or on a screen, on every front end it applies to. A behavior is never a step that leads to something: it doesn't call an operation or run an action, it describes them.
36
+ - **Actions call operations.** That is the only way a front end reaches the server.
37
+
38
+ So a behavior's `operations` names the operations whose outcome it describes; an action's `operations` names the operations it calls; and an action's `behaviors` names the behaviors that describe it.
39
+
40
+ ## An API or MCP server offers two sets
41
+
42
+ A surface that outsiders reach, such as an API or an MCP server, may offer two sets, under the same names as the records:
43
+
44
+ - **Actions**: "Use Actions to act for a person." At `…/actions/<name>`. A surface that offers Actions is a front end with no screen: the profile names it, behaviors describe its actions, and it keeps coverage. An MCP server offers Actions by default.
45
+ - **Operations**: "Use Operations to build your own front end." At `…/operations/<name>`, granular, with their facts stated. Each still checks its `needs`, so the set is never a back door. The profile's `operations-offered-on` names the surfaces that offer it.
46
+
47
+ Server-to-server plumbing with no person behind it (webhooks, sync) is outside both sets.
48
+
23
49
  ## Start here
24
50
 
25
- Read the project's `operbe.md`. It says where the lists live, which UIs exist, what the project decided, and which rules it doesn't follow yet. If the project has no `operbe.md`, read `references/adopting.md`.
51
+ Read the project's `operbe.md`. It says where the lists live, which front ends exist, what the project decided, and which rules it doesn't follow yet. If the project has no `operbe.md`, read `references/adopting.md`.
26
52
 
27
53
  ## Which reference to read
28
54
 
@@ -30,8 +56,8 @@ Read the project's `operbe.md`. It says where the lists live, which UIs exist, w
30
56
  |---|---|
31
57
  | work out a feature | `references/tandem.md` first; it sends you to the others as you need them |
32
58
  | add, split, merge or question an operation | `references/operations.md` |
33
- | add or change a behavior, or build or check a UI | `references/behaviors.md` |
34
- | add a client action, build a command palette, or let an assistant work a UI | `references/client-actions.md` |
59
+ | add or change a behavior, or build or check a front end | `references/behaviors.md` |
60
+ | add an action, build a command palette, a command line or an MCP server, or let an assistant work a front end | `references/actions.md` |
35
61
  | write or edit a record file | `references/formats.md` |
36
62
  | set operbe up in a project | `references/adopting.md` |
37
63
 
@@ -40,11 +66,11 @@ Read what the task needs and leave the rest. `example/` is a small project done
40
66
  ## While you work
41
67
 
42
68
  - Work from one record at a time, plus the index (`npx operbe index`). Don't load the whole list.
43
- - When you change what a UI does, update the behavior record and that UI's coverage line in the same change.
44
- - If a UI does something the designer would care about and it isn't on the list, stop and raise it. Don't add or remove it yourself.
69
+ - When you change what a front end does, update the behavior record and that front end's coverage line in the same change.
70
+ - If a front end does something the designer would care about and it isn't on the list, stop and raise it. Don't add or remove it yourself.
45
71
  - Behaviors belong to the designer. Propose a change to a statement; don't rewrite one to match what was built.
46
- - A client action does what doing it by hand does and stops at any review or confirmation. It never takes an input from the selection without naming it; a person's selection may fill a named input.
47
- - Don't add a client action of class `do` without asking. Propose it.
72
+ - An action does what doing it by hand does and stops at any review or confirmation. It never takes an input from the selection without naming it; a person's selection may fill a named input.
73
+ - Don't add an action of class `do` without asking. Propose it.
48
74
  - If a feature needs something the designer didn't ask for (a way to take an action back, say), ask before adding it.
49
75
 
50
76
  ## The operbe command
@@ -53,8 +79,8 @@ Run it from the project root (the folder with `operbe.md`), or give the root as
53
79
 
54
80
  | To | Run |
55
81
  |---|---|
56
- | see the behavior index, the coverage table and the client action index | `npx operbe index` |
57
- | start a new record from its template (a behavior gets the next free id) | `npx operbe new behavior "<name>"`, `npx operbe new operation <name>`, `npx operbe new client-action <name>` |
82
+ | see the behavior index, the coverage table and the action index | `npx operbe index` |
83
+ | start a new record from its template (a behavior gets the next free id) | `npx operbe new behavior "<name>"`, `npx operbe new operation <name>`, `npx operbe new action <name>` |
58
84
  | check the records | `npx operbe check` |
59
85
  | see what changed between two versions, and how much it matters | `npx operbe diff --at main --at @` (jj), or `npx operbe diff <a> <b>` for two folders |
60
86
  | compare the records with the names the code has | `npx operbe reconcile --kind operation --names <file>` |
@@ -66,4 +92,4 @@ Never write an index or a coverage table into the project: `operbe index` prints
66
92
 
67
93
  Run `npx operbe check` (run it, don't read it) and fix every error it reports.
68
94
 
69
- Lines marked `gap` are information: a behavior or a client action some UI hasn't built yet, a UI that differs from a record, or a behavior that sends a change and has no client action. They don't fail the check.
95
+ Lines marked `gap` are information: a behavior or an action some front end hasn't built yet, a front end that differs from a record, or a behavior that describes no action on a front end it applies to. They don't fail the check.
@@ -9,28 +9,32 @@ replaced-by:
9
9
  ---
10
10
 
11
11
  ## Statement
12
- A person can put a conversation out of the way without deleting it. It leaves the active list at once, and for a few seconds the product offers Undo.
12
+ A person can put a conversation out of the way without deleting it. It leaves the active conversations at once and is among the archived ones, and the person is offered a way to take it back straight away.
13
13
 
14
14
  ## Flow
15
15
  1. The person chooses to archive a conversation.
16
- 2. The product removes it from the active list and says it was archived.
17
- 3. The product offers Undo for at least five seconds.
16
+ 2. It leaves the active conversations, and the person is told it was archived.
17
+ 3. The person is offered Undo straight away.
18
18
 
19
19
  ## Appears when
20
20
  The person may change the conversation.
21
21
 
22
22
  ## Usable when
23
- The conversation is not already archived. Otherwise it is shown but can't be used, with "Already archived."
23
+ The conversation is not already archived. Otherwise it is refused with "Already archived."
24
24
 
25
25
  ## Undo
26
- Returns the conversation to the active list, where it was.
26
+ Returns the conversation to the active conversations, where it was.
27
+
28
+ ## Differs on
29
+ - phone, desktop: Undo is a button, shown for at least five seconds.
30
+ - mcp: there is no button; the result names `unarchive-conversation`, which takes it back.
27
31
 
28
32
  ## Examples
29
- - **Usual.** Given an active conversation I may change, when I archive it, then it leaves the active list, appears in the archive, and Undo is offered.
33
+ - **Usual.** Given an active conversation I may change, when I archive it, then it leaves the active conversations, is among the archived ones, and Undo is offered.
30
34
  - **Not allowed.** Given a conversation I may only read, then archiving isn't offered at all.
31
- - **Wrong moment.** Given an archived conversation, then archiving is shown but can't be used, with "Already archived."
32
- - **Offline.** Given I have no connection, when I archive it, then it leaves the active list and is marked as waiting; when I'm back it completes.
33
- - **Refused.** Given the server refuses, then the conversation returns to the active list and I'm told why.
35
+ - **Wrong moment.** Given an archived conversation, then archiving is refused with "Already archived."
36
+ - **Offline.** Given I have no connection, when I archive it, then it leaves the active conversations and is marked as waiting; when I'm back it completes.
37
+ - **Refused.** Given the server refuses, then the conversation is back among the active ones and I'm told why.
34
38
 
35
39
  ## Changes
36
40
  - form 1: first version.
@@ -6,7 +6,7 @@ form: 1
6
6
  applies-to: [phone]
7
7
  operations: [archive-conversation]
8
8
  replaced-by:
9
- client-actions: none # a gesture; it runs the same action as B-0001
9
+ actions: none # a gesture; it runs archive-conversation, which B-0001 describes
10
10
  ---
11
11
 
12
12
  ## Statement
@@ -3,10 +3,10 @@ id: B-0003
3
3
  name: Archived looks dimmed
4
4
  status: rough
5
5
  form: 1
6
- applies-to: all
6
+ applies-to: screens
7
7
  operations: []
8
8
  replaced-by:
9
- client-actions: none # a rule about appearance; nothing to call
9
+ actions: none # a rule about appearance; nothing to ask for
10
10
  ---
11
11
 
12
12
  ## Statement
@@ -9,10 +9,10 @@ replaced-by:
9
9
  ---
10
10
 
11
11
  ## Statement
12
- Tapping a conversation's title opens it for editing in place. It may open already holding a suggested title. Saving changes the title for everyone who has the conversation; cancelling leaves it as it was.
12
+ A person can give a conversation a new title, which everyone who has the conversation then sees. A title may be suggested to them first; the person still decides whether to save it, and if they don't, the title stays as it was.
13
13
 
14
14
  ## Examples
15
- - **Usual.** When I change "Trip" to "Trip to Leeds" and save, the list shows the new title.
15
+ - **Usual.** When I change "Trip" to "Trip to Leeds" and save, the conversation is called "Trip to Leeds" for everyone who has it.
16
16
 
17
17
  ## Changes
18
18
  - form 1: first version.
@@ -9,10 +9,10 @@ replaced-by:
9
9
  ---
10
10
 
11
11
  ## Statement
12
- Conversations are shown in two lists, active and archived, and a person can go from either to the other in one step. Each says which list it is.
12
+ Conversations are kept in two lists, active and archived. A person can ask for either one in one step, and is always told which one they have.
13
13
 
14
14
  ## Examples
15
- - **Usual.** When I choose the archive, the list shows archived conversations and is headed "Archive".
15
+ - **Usual.** When I ask for the archive, I get the archived conversations, and they are marked as the archive (on a screen, headed "Archive").
16
16
 
17
17
  ## Changes
18
18
  - form 1: first version.
@@ -0,0 +1,9 @@
1
+ # Coverage: mcp
2
+
3
+ | id | value | form | note |
4
+ |---|---|---|---|
5
+ | B-0001 | honours | 1 | |
6
+ | B-0005 | honours | 1 | |
7
+ | show-conversations | honours | 1 | |
8
+ | archive-conversation | honours | 1 | |
9
+ | unarchive-conversation | honours | 1 | |
@@ -2,14 +2,18 @@
2
2
  operbe: 1
3
3
  operations: operations
4
4
  behaviors: behaviors
5
- client-actions: client-actions
6
- uis: [phone, desktop]
5
+ actions: actions
6
+ front-ends: [phone, desktop, mcp]
7
+ groups:
8
+ screens: [phone, desktop]
9
+ operations-offered-on: [api]
7
10
  ---
8
11
 
9
12
  ## 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
+ - Front ends: a phone app, a desktop app, and an MCP server through which a person's assistant works for them. The phone app is built first.
14
+ - `screens` groups the front ends with a screen.
15
+ - The MCP server offers Actions. The server's API offers Operations to outside builders and no Actions, so it is not a front end.
13
16
  - Renaming in place is on the phone only for now, so `start-retitle` applies to the phone.
17
+ - B-0004 is described only by `start-retitle`, on the phone, so the check reports it as a gap on the desktop and over MCP. That is on purpose: the example shows the gap. Don't fix it by widening `start-retitle`.
14
18
 
15
19
  ## Known deviations
@@ -0,0 +1,226 @@
1
+ # Actions
2
+
3
+ *Part of operbe. This guide covers actions: what an action is, its three classes, what each declares, who asks for one, how behaviors describe them, and the two sets a surface such as an API or an MCP server offers. Record formats are in `formats.md`.*
4
+
5
+ ## Contents
6
+ - 1. What an action is
7
+ - 2. Not a behavior, not an operation
8
+ - 3. Three classes: show, prepare, do
9
+ - 4. One list, every caller
10
+ - 5. What every action declares
11
+ - 6. Results
12
+ - 7. Rules that hold everywhere
13
+ - 8. How big
14
+ - 9. Behaviors describe actions
15
+ - 10. Actions and Operations: the two sets a surface offers
16
+ - 11. Reaching a screen from outside
17
+ - 12. What to guard against
18
+ - 13. Checklist for adding an action
19
+ - 14. What each project decides
20
+ - Where this comes from
21
+
22
+ Two words used throughout. A **front end** is anything that acts for a person: a native app, the web app, a command line, an MCP server, an API's Actions. A **screen** is one running copy of a front end that has one, in front of one person.
23
+
24
+ ## 1. What an action is
25
+
26
+ An action is one named thing a front end does for a person: show the archive, open a conversation, start a draft, archive a conversation, send a reply. It has a name, stated inputs, and a result. It is code, and it lives in the front end.
27
+
28
+ Actions are the layer inside every front end that turns what was asked for into operations. A tap, a palette entry, a shortcut, a command typed at a prompt and a tool an assistant calls all reach the same action, and the action calls the operations. A front end never calls an operation except through an action.
29
+
30
+ The test: is this something a person can ask the front end to do, by a control or any other way? If so, it is an action.
31
+
32
+ An operation is asked of the server. An action is asked of a front end, and the front end runs it. The server runs none.
33
+
34
+ ## 2. Not a behavior, not an operation
35
+
36
+ A **behavior** says, in words for a designer, what must hold for the person. It may be rough, and its wording may change freely. An **action** is a contract with a name and inputs that callers depend on. Behaviors describe actions; they are separate records for four reasons:
37
+
38
+ - Some behaviors describe no action. "Archived rows are dimmed" is a rule about a screen.
39
+ - The counts differ. One behavior may describe several actions, and one action may be described by several behaviors.
40
+ - They change at different speeds. Rewording a behavior breaks nobody. Changing an action's inputs breaks its callers.
41
+ - They answer different questions: "what must be true for the person?" and "what can I ask this front end to do, with what, and what comes back?"
42
+
43
+ Every action **must** name at least one behavior that describes it. An action no behavior describes is the front end 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.
44
+
45
+ An action is not an operation. It never crosses the membrane by itself. When it needs the server, it calls operations exactly as it would for a person at the control.
46
+
47
+ ## 3. Three classes: show, prepare, do
48
+
49
+ Every action is exactly one of these.
50
+
51
+ | Class | What it does | Example |
52
+ |---|---|---|
53
+ | **show** | Changes nothing but what this person is shown, or handed back | Show the archive; open a conversation |
54
+ | **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 |
55
+ | **do** | Commits something: other people see it or are bound by it, or the person can't take it back by looking elsewhere | Archive the conversation; send the reply; clear what this device has kept |
56
+
57
+ The class is the line a person cares about: it showed me something, it set something up for me, or it acted.
58
+
59
+ - A `show` **must not** call any operation except queries, unless the project decided otherwise for it (below) and its record says why in `show-because`.
60
+ - 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.
61
+ - A `do` **must** list the operations it calls, 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`.
62
+
63
+ Three cases come up often.
64
+
65
+ - **A view that also sends something.** If opening a conversation marks it read and the other person sees that, the action calls 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`.
66
+ - **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`. Asked for by anything other than the person, that `do` stops at the review (rule 2).
67
+ - **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.
68
+
69
+ **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 calls destroys something, changes who may do what, or can't be taken back. Those facts are already on the operation.
70
+
71
+ ## 4. One list, every caller
72
+
73
+ A project has one list of actions. Every way of asking a front end to do something reaches it:
74
+
75
+ - **The front end's own controls**: buttons, gestures, menus.
76
+ - **The command palette and shortcuts.** A shortcut is a key bound to an action.
77
+ - **The commands of a command line.** A command is an action, with its inputs as arguments.
78
+ - **The tools of an MCP server**, and the Actions of an API (section 10).
79
+ - **An assistant acting for the person**, built into a front end or reaching a screen from outside (section 11).
80
+
81
+ A front end's controls, palette and shortcuts **must** run on the same definitions that its 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.
82
+
83
+ The record is the place the project agrees on an action. A project that defines its 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.
84
+
85
+ Where an action is offered (which menu, which group, whether the palette lists it) is each front end's business and is not in the record.
86
+
87
+ ## 5. What every action declares
88
+
89
+ | Fact | Meaning |
90
+ |---|---|
91
+ | Name | A verb, then the thing: `open-conversation`. The name is the action's identity and never changes. |
92
+ | Class | `show`, `prepare` or `do`. |
93
+ | Status | `rough`, `firm` or `retired`, as for a behavior. |
94
+ | Behaviors | The behaviors that describe it. At least one. |
95
+ | Operations | The operations it calls. |
96
+ | Available when | The condition under which it can run. `always` if there is none. |
97
+ | Applies to | The front ends that have it. |
98
+ | Sentence | One sentence, inputs in `{braces}`. |
99
+ | Inputs | One line for each input: what it is, how a caller names it, and whether it is needed. |
100
+ | Result | What the caller is told afterwards (section 6). |
101
+
102
+ **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 front end fills the named input from what is selected. When anything else asks for it, the caller names the thing. Unnamed inputs are what made recorded macros impossible to replay.
103
+
104
+ **Availability is said twice.** The record declares the condition, so a caller can read it without a screen. A front end also reports, live, which actions can run now and, for one that can't, why. `available-when` restates, for a caller, the *Appears when* and *Usable when* of the behaviors that describe it. 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 front end and an assistant can read it.
105
+
106
+ ## 6. Results
107
+
108
+ A call never finishes in silence. Every call finishes with exactly one of these.
109
+
110
+ | Result | Meaning |
111
+ |---|---|
112
+ | **done** | It happened. Says where the person is now. A `show` also hands back what it showed, as far as the caller may see it. |
113
+ | **refused** | Nothing changed. Says why. |
114
+ | **waiting for the person** | The front end is asking the person something: a review, a confirmation, a choice. Says what. |
115
+ | **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. |
116
+ | **unknown** | The front end went away or the call timed out after it may have sent something. |
117
+
118
+ 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 front end put things back.
119
+
120
+ After **unknown**, a caller **must not** simply ask 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.
121
+
122
+ A front end that shows a change before the server has agreed reports **started**, not done, until the server agrees.
123
+
124
+ ## 7. Rules that hold everywhere
125
+
126
+ 1. **The same as by hand.** Running an action leaves the front end, 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 called.
127
+ 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.
128
+ 3. **Who asked is carried.** When an action calls 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.
129
+ 4. **Nothing outside the list.** A caller does nothing through a front end except by an action. The method has no "press whatever is at this position".
130
+ 5. **An action never widens rights.** It can do what the person it acts for can do, and no more.
131
+ 6. **The person can see it.** When something other than the person runs an action on their screen, the screen shows that it happened and what asked.
132
+
133
+ ## 8. How big
134
+
135
+ Size an action for what a person would ask for.
136
+
137
+ - Too small: `click-archive-button`. That is a control, and it means nothing on a front end that archives by swiping, or that has no screen.
138
+ - Too big: `clean-up-inbox`. That is a task, and belongs to whoever is calling.
139
+ - Right: `archive-conversation`, with the conversation as its input.
140
+
141
+ Two tests. **The same on every front end:** if the action only makes sense on one front end's layout, it is named after a control. **One result:** if it can half happen, it is two actions.
142
+
143
+ A filter or a choice among a few is usually an input, not an action of its own: `show-conversations {which: active or archived}`. Moving around is usually one action for each kind of place, with the place as the input. Where a front end's places have addresses (URLs, deep links), a `show` and the address for the same place **should** agree.
144
+
145
+ A gesture is a way of running an action. Swiping to archive runs `archive-conversation`; it gets no action of its own.
146
+
147
+ ## 9. Behaviors describe actions
148
+
149
+ An action names the behaviors that describe it, in `behaviors`. From the other side, every behavior that a person can ask for, a `show` included, describes at least one action, or it says `actions: none`. That covers the behaviors with nothing to ask for (a placement, a look, a gesture) and the ones the designer chose not to offer to callers; a comment on the line says which.
150
+
151
+ Nothing is inferred. Whether a behavior describes an action, and which front ends an action and a behavior apply to, are only ever what the records say.
152
+
153
+ - An action applies to a front end only where a behavior that describes it does. An action that applies more widely than every behavior that describes it is an error: the front end would be doing something no behavior there describes.
154
+ - Each front end a behavior applies to has an action described by it on that front end, or the check reports a gap for that front end. Adding a front end later shows a gap for each behavior until its actions are built and recorded there.
155
+ - Each front end'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`. An action applies to every front end unless its record says otherwise in `applies-to`.
156
+
157
+ The check reports as gaps: a firm action a front end hasn't built, an action a front end has built while a behavior that describes it has no line there, and a behavior with no action on a front end it applies to.
158
+
159
+ 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.
160
+
161
+ A project that keeps no actions at all leaves the `actions` line out of its profile, and none of this is checked.
162
+
163
+ ## 10. Actions and Operations: the two sets a surface offers
164
+
165
+ A surface that outsiders reach, such as an API or an MCP server, may offer two sets. They are for different things, and they are named the same way everywhere.
166
+
167
+ | Set | Say it as | Path | What it is |
168
+ |---|---|---|---|
169
+ | **Actions** | Use Actions to act for a person. | `…/actions/<name>` | The project's actions, under the same names as their records. A surface that offers them is a front end with no screen. |
170
+ | **Operations** | Use Operations to build your own front end. | `…/operations/<name>` | The project's operations, granular, each with its facts stated (`needs`, `safe-to-repeat`, `taken-back-by`, `risk`). |
171
+
172
+ - **A surface that offers Actions is a front end.** The profile names it in `front-ends`, behaviors describe its actions, and it keeps a coverage file like any other front end. Its actions run the same rules as on a screen: a review is never skipped (the result is "waiting for the person"), and who asked is carried.
173
+ - **An MCP server offers Actions by default.** An assistant over MCP is acting for a person.
174
+ - **Operations are offered on purpose.** The profile's `operations-offered-on` names each surface that offers them. Each operation still checks its `needs` on every call, so the set is never a back door: it reaches nothing a person couldn't do themselves.
175
+ - **Plumbing is outside both.** Server-to-server traffic with no person behind it, such as webhooks and sync, is neither set.
176
+
177
+ A protection that must hold against every caller belongs on the operation. Rule 2 guards the Actions path only. If deleting for good must always have the person's fresh agreement, the operation has to require proof of it, or a caller with Operations could go around the review.
178
+
179
+ ## 11. Reaching a screen from outside
180
+
181
+ Sometimes an assistant should work the person's own screen, so they see it happen, reviews appear there and Undo is offered there. 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:
182
+
183
+ **Built in.** The front end sends the assistant the actions that can run now with each request. The assistant answers with the ones to run. The front end runs them and reports each result on the next turn.
184
+
185
+ **Through the server.** The server passes an action 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.
186
+
187
+ - The actions offered are the whole list the person may use. They don't change with what is on screen.
188
+ - The screen list gives, for each screen, a **screen handle**, which front end it is, where it is, which actions can run there now, and the form of each.
189
+ - Every action passed this way takes a screen handle.
190
+ - With several screens, the caller **should** use the one the person is using now, and ask if that is unclear.
191
+ - With no screen, the caller may ask the person to open one, or use the surface's own Actions.
192
+ - A connection to a screen is temporary. Nothing is lost when it ends; the caller lists the screens again.
193
+ - The server knows who is asking because it passed the call along, so it, and not the screen, says who asked (rule 3).
194
+
195
+ **From the page.** Where a browser lets a page offer tools to the browser's own assistant, a web front end can offer its list that way.
196
+
197
+ 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.
198
+
199
+ ## 12. What to guard against
200
+
201
+ - **Text that addresses the assistant.** Content is not instruction. The classes limit the harm: the worst a tricked caller does through a `show` is change what is shown.
202
+ - **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.
203
+ - **The front end changing between asking and running.** The front end checks again when the call arrives, and refuses with the reason if the action can no longer run.
204
+ - **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.
205
+ - **Drift.** An action that names a retired behavior is an error. An action built against an older form of its record is a gap.
206
+
207
+ ## 13. Checklist for adding an action
208
+
209
+ 1. Which behavior describes it? If none, raise it with the designer first.
210
+ 2. Is there already an action for this that could take it as an input?
211
+ 3. Is it named for what a person would ask, not for a control or a gesture?
212
+ 4. Which class is it? If `do`, which operations does it call, or is it local?
213
+ 5. What are its inputs, each named, with how a caller names the thing?
214
+ 6. When can it run, in the behavior's own words?
215
+ 7. What does it report for each result that can happen?
216
+ 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.
217
+ 9. If it can be taken back, which action takes it back?
218
+ 10. Which front ends have it? No more than the behaviors that describe it apply to.
219
+
220
+ ## 14. What each project decides
221
+
222
+ Whether to keep actions at all. Who settles a new action or a change to one. Which callers exist, which surfaces offer Actions and which offer Operations, and which of the ways in section 11 it supports. 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.
223
+
224
+ ## Where this comes from
225
+
226
+ 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 an 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 every front end, the two sets, and the screen handle are operbe's own.
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## A new project
6
6
 
7
- 1. Copy `templates/operbe.md` to the project's root. Name the UIs.
7
+ 1. Copy `templates/operbe.md` to the project's root. Name the front ends: everything that acts for a person, with a screen or without (a command line, an MCP server, an API that offers Actions). If several have a screen, name them as a group too, under `groups` (`screens: [phone, web]`).
8
8
  2. Create the two folders it names.
9
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
10
  4. Run `npx operbe check`.
@@ -15,18 +15,18 @@
15
15
  You don't need to stop and document everything.
16
16
 
17
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.
18
+ 2. Make new work conform. Every new operation gets a record, and every new or changed piece of a front end gets a behavior.
19
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.
20
+ 4. List what doesn't conform under "Known deviations" in `operbe.md`, for example "`phone` calls two server routes that aren't operations yet". That list may only shrink.
21
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
22
 
23
23
  ## Who owns what
24
24
 
25
25
  The designer owns the behavior list. Anyone may propose a behavior or a change, and the designer decides.
26
26
 
27
- Whoever builds the server owns the operation list. Each UI's builder owns that UI's coverage file.
27
+ Whoever builds the server owns the operation list. Each front end's builder owns that front end's coverage file.
28
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.
29
+ Where a project keeps 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 front ends owns names, inputs and results. An agent may propose an action; it doesn't add a `do` by itself.
30
30
 
31
31
  One person may hold all three roles. They still matter, because they say whose word settles a disagreement.
32
32
 
@@ -34,7 +34,7 @@ One person may hold all three roles. They still matter, because they say whose w
34
34
 
35
35
  - Give a building agent one behavior record and the index. Don't give it the whole list.
36
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.
37
+ - An agent that finds a front end doing something off the list raises it. It doesn't add or remove it.
38
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
39
 
40
40
  ## Keeping up with the method