@openengio/cli 0.0.0-stage → 0.24.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.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: new-use-case
3
+ description: Use when a person wants types for a use case their organisation's catalogue does not yet model, from the platform's own agent or from your own agent using `openeng`.
4
+ ---
5
+
6
+ # Design the types for a new use case
7
+
8
+ Work through the steps in order. Do not skip a stop point: at each one, show the person what you
9
+ have and wait for their agreement. Ask at most three questions at a time, each with lettered options
10
+ and your recommendation. Draft nothing in a change set before step 7. Read `openeng skill conventions` before
11
+ step 3; it holds the rules every step below relies on.
12
+
13
+ ## The tools, by step
14
+
15
+ | step | in the platform's agent | with `openeng` |
16
+ |---|---|---|
17
+ | read the catalogue | `read_catalogue` | `openeng types list --project <id>`; `openeng types export --project <id>` for every type's whole document |
18
+ | read one type | `describe_type` | the type's key in `openeng types export --project <id>` |
19
+ | read the change set | `read_change_set` | `openeng types draft current`; `openeng types draft show --change-set <id> --project <id>` |
20
+ | read sample objects | `sample_objects` | `openeng objects-sdk queryObjects` |
21
+ | open a change set | `open_change_set` | `openeng types draft open` |
22
+ | save the changed types | `revise_change_set` | `openeng types draft revise --change-set <id> --revision <token> --from <file> [--rail-groups <json>]` |
23
+ | validate | `validate_change_set` | `openeng types draft validate --change-set <id> --revision <token>` (exit 4 with violations) |
24
+ | try a sample against a draft type | `try_instance` | none yet; validate, and after acceptance write one object on a throwaway branch |
25
+ | publish | never: the person publishes | `openeng types draft accept` only after the person says so, for that change set |
26
+ | search the web | `web_search`, `web_fetch` | your own tools, under the same rule: never put anything read from the platform into a query or an address |
27
+
28
+ ## 1. Understand the use case
29
+
30
+ Ask what the team does, who uses the model, and which questions it must answer. Write the questions
31
+ down in the team's own words, for example "which requirements have no verification".
32
+
33
+ - [ ] The use case in one or two sentences.
34
+ - [ ] Three to seven questions the model must answer.
35
+
36
+ Stop: the person agrees the use case and the questions.
37
+
38
+ ## 1b. Orient in the existing catalogue
39
+
40
+ Read the whole published catalogue and every type that might touch the use case. Other use cases built
41
+ it, and this one should join it. An organisation with no published types starts from the examples in
42
+ `openeng skill conventions`; there is nothing to export.
43
+
44
+ - [ ] Each concept mapped to an existing type, a close type, or nothing yet.
45
+ - [ ] For each close type: reuse with an extension (an optional property in a new version), or a new
46
+ type, with the cost of each and a recommendation.
47
+ - [ ] The existing types the new ones must connect to, and by which edge.
48
+ - [ ] The catalogue's naming, icons and rail groups, to follow.
49
+
50
+ Stop: show the person the map, and agree what is reused, what is extended and what is new.
51
+
52
+ ## 2. Survey the domain
53
+
54
+ Read the domain playbook with `openeng skill playbook <name>`, when there is one.
55
+ `openeng help skill` lists the available playbooks. Then check it against the
56
+ established tools and standards the team names, and where sources disagree, say what each choice
57
+ costs.
58
+
59
+ - [ ] The concepts most sources share.
60
+ - [ ] Where sources disagree, and the cost of each choice.
61
+ - [ ] Any standard the team follows, by name.
62
+
63
+ Stop: a summary of no more than ten lines, and ask what the team does differently.
64
+
65
+ ## 3. Propose the core
66
+
67
+ Propose five to ten object types and the edges between them. Say what one object of each type is, in
68
+ one sentence, and what fact each edge records. Reuse and extend what step 1b agreed. Where the shape is
69
+ a real choice, offer one or two alternatives with their cost, and recommend one.
70
+
71
+ - [ ] Each type is a kind of thing, not a document or a state.
72
+ - [ ] Each relationship is an edge; no property holds another object's identifier.
73
+ - [ ] One edge type per meaning.
74
+ - [ ] No new type is a near-copy of an existing one.
75
+ - [ ] Every question from step 1 is answered by following edges and reading properties.
76
+
77
+ Stop: the person chooses the core.
78
+
79
+ ## 4. Decide the edges and the trees
80
+
81
+ For each edge type, decide what `openeng skill conventions` lists: kind, source and target, which end is upstream,
82
+ labels for both ends, the parent end, and the read rule. Then decide each object type's ranked
83
+ relationships and any named views.
84
+
85
+ - [ ] One direction convention for the whole model, chosen with the person and written in the types'
86
+ descriptions: "flow of work" or "points at what is proved" (`openeng skill conventions`, section 3). Every
87
+ edge follows it; a model never mixes the two.
88
+ - [ ] Every structural edge has a parent end.
89
+ - [ ] If a type declares any named view, the tree the person uses most is declared as a view too, and
90
+ first, because declaring views replaces the relationship picker.
91
+
92
+ Stop: show the person the tree each type will produce and the direction it gives the graph view, drawn as text.
93
+
94
+ ## 5. Decide properties, titles, icons and the rail
95
+
96
+ - [ ] Scalars rather than arrays.
97
+ - [ ] Few required keys: a later version cannot add one.
98
+ - [ ] State as an enumeration whose members the team will keep: a member cannot be removed.
99
+ - [ ] `presentationBindings.title`, a required string property that names the object.
100
+ - [ ] `presentationBindings.typeIcon`, a Material Symbols glyph name.
101
+ - [ ] The rail: the organisation's groups, and each type's group and order; or no rail entry for a type
102
+ that is the detail of another, not a destination.
103
+
104
+ Stop: the person agrees the properties and the rail.
105
+
106
+ ## 6. Decide views, if any
107
+
108
+ An **App** is an organisation entity with its own pages and drafts, linked by `openeng link app`.
109
+ An **App view** is a type's collection content in `presentationBindings.views.app`, root `AppBody`,
110
+ and cannot be linked by `link app`.
111
+
112
+ An object view shapes the object's drawer; an App view shapes the type's page. Propose one only when the
113
+ default layout does not answer step 1's questions. Use only the components the view catalogue admits.
114
+
115
+ - [ ] For each view: its kind, its root component, and the properties and derived values it shows.
116
+
117
+ ## 7. Draft small and validate
118
+
119
+ Propose a plan for the change set. Once it is approved, open the change set and save the core: the
120
+ object types and the edge types between them, nothing more. Then validate until it answers no
121
+ violations. Where the tool exists, try one realistic sample of each type, and one that lacks a required
122
+ key.
123
+
124
+ ## 8. Iterate
125
+
126
+ Add the rest in small saves, validating after each. Each save holds the whole set of changed types.
127
+ When a save is refused as stale, read the change set again and build on it.
128
+
129
+ Stop: walk the person through the draft, type by type, and take their changes.
130
+
131
+ ## 9. Hand over
132
+
133
+ Tell the person, in a few lines: the types and edges drafted, the tree and the direction each produces,
134
+ the rail, any choice you made that they did not ask for, and what a later version can and cannot
135
+ change. Show the change set's diff. The person publishes; with `openeng`, accept only on their word naming
136
+ this change set.
@@ -0,0 +1,340 @@
1
+ ---
2
+ name: openeng
3
+ description: >-
4
+ Use when you need to work with an OpenEngineering platform through its command line, `openeng`.
5
+ Signing in, listing projects and types, editing object types, writing objects on an agreed ref
6
+ and submitting branches for review.
7
+ ---
8
+
9
+ # Working with the platform through `openeng`
10
+
11
+ `openeng` is the platform's command line. Install the public npm package:
12
+
13
+ ```
14
+ npm install -g @openengio/cli
15
+ ```
16
+
17
+ This skill gives the commands and their order. It gives no input shapes, because the commands print
18
+ their own. Before you send a generated command (`objects-sdk`, `branches-sdk` and the other
19
+ `<module> <method>` commands), run `openeng help <module> <method>`. It prints the fields, the kinds a
20
+ field may take, the selector keys and one example input, and needs no sign-in.
21
+
22
+ ## Read the topic for your task
23
+
24
+ - A person new to OpenEngineering who wants a tour, or has just signed in with no task of their own: `openeng skill demo`.
25
+
26
+ - Designing a new use case: `openeng skill new-use-case`.
27
+ - Building an object drawer or App view: `openeng skill build-ui`.
28
+ - Field meanings, edge direction, trees and type versions: `openeng skill conventions`.
29
+ - A domain model: `openeng skill playbook engineering-requirements`,
30
+ `openeng skill playbook product-lifecycle`, or `openeng skill playbook project-management`.
31
+
32
+ ## Rules that hold for every command
33
+
34
+ - Add `--json` when you read the answer yourself. It prints one JSON value on standard output.
35
+ - Exit code 0 is success. Any other exit code is a refusal or a failure, and its message says what
36
+ to do. Read it; do not retry the same command unchanged.
37
+ - When you report a refusal to the person, quote its `reference:` line (the `reference` field under
38
+ `--json`) exactly. The line is how the platform's operators find the request. A refusal with no
39
+ such line was built by `openeng` itself, or the host sent no id with it.
40
+ - A refusal of a field names the field, such as `input.correlation`, and the kinds it may take.
41
+ Fix that field and send the command again.
42
+ - `openeng help` lists every command. `openeng help <command words>` prints one command's help: what it
43
+ does, an example and the shape of its output. `openeng help <group>` lists a group's commands.
44
+ `openeng --version` prints the published version.
45
+ - `openeng` has no host built in. The production host is `https://api.openeng.io`: pass
46
+ `--host https://api.openeng.io` on every command, or prefix it as
47
+ `OPENENG_HOST=https://api.openeng.io openeng ...`. An export in `~/.zshrc` does not reach
48
+ an agent's shell or a Claude Code `!` shell. In zsh, persist it in `~/.zshenv`.
49
+ Fix `no-host` by adding the flag or prefix.
50
+ - `openeng orgs list` and `openeng organisations list` mean `openeng org list`; `openeng project list` means
51
+ `openeng projects list`.
52
+ - A mutation or a branch command that needs a `correlation` mints it for you when your input has
53
+ none. Leave it out unless you have a reason to send your own.
54
+ - Generated commands take `--selector <json>` for what they act on and `--input <json>`,
55
+ `--input -` or `--input-file <path>` for what they send. Read the ids you need from `--json`
56
+ output and never invent one.
57
+
58
+ ## 1. Sign in and orient
59
+
60
+ 1. `openeng help` to see what exists.
61
+ 2. Run `openeng login` yourself with the host flag. It opens the person's browser and waits;
62
+ tell the person to finish sign-in there. Do not ask the person to run it. If your tool cuts a
63
+ command off before it returns, run it in the background or use `openeng login --no-open`
64
+ with the host flag and give the person the printed address.
65
+ 3. `openeng whoami` to confirm who you are.
66
+ 4. `openeng org list --json` prints the organisations you belong to. `openeng org attach <id>` attaches
67
+ your session to one. If you have no organisation, create one with
68
+ `openeng org create --name <name>`, then attach to the organisation it created.
69
+ 5. Until you attach, these commands run without an organisation: `openeng login`, `openeng logout`,
70
+ `openeng whoami`, `openeng help`, `openeng skill`, `openeng org list`, `openeng org attach <id>`,
71
+ `openeng org create --name <name>`, and `openeng org current`. The generated command
72
+ `openeng admin-sdk createOrganisation` also runs unattached. Other commands refuse with "not attached
73
+ to an organisation" before they send anything.
74
+ 6. `openeng projects list --json`. Note each project's id and its namespace; later steps need both.
75
+ 7. `openeng types list --project <project id>` to see the project's published types, each with its
76
+ published version.
77
+
78
+ For a generic open-cycle gas turbine demonstration project, run `openeng demo seed --project <project id> [--size standard|full]`.
79
+
80
+ ### Which organisation you are in
81
+
82
+ - `openeng org current` prints the organisation your session is attached to, or none.
83
+ `openeng org detach` removes the attachment, and the commands refuse again until you attach.
84
+ - The CLI passes no scope for `openeng login`, `openeng logout`, `openeng whoami`, `openeng help`, `openeng skill`,
85
+ `openeng org list`, `openeng org attach <id>`, `openeng org create --name <name>`, `openeng org current`,
86
+ `openeng org detach`, and `openeng admin-sdk createOrganisation`. Other commands print their scope on
87
+ standard error when the platform answers them, as
88
+ `org: <name> (<id>)`, then `· project: <id>` and `· ref: <ref>` when you named them. Read it
89
+ before you trust an answer.
90
+ - With `--json`, the one value on standard output carries the same scope as a `scope` object:
91
+ `{"organisation": {"id", "name"}, "project"?, "ref"?}`. An object value normally gains a `scope` key.
92
+ A value that is an array or null, such as the list from `openeng projects list`, comes wrapped as
93
+ `{"scope": {...}, "value": <the original value>}`. Rules command successes always use this wrapper
94
+ to preserve the rule's own `scope` field. Organisation-ref, lock, ceiling and schema-update
95
+ successes also always use `{ scope, value }`. A command with no scope carries no `scope` field.
96
+ - A `not-found` in an organisation is often a project or a ref that belongs to another one. The
97
+ command prints "not found in organisation <name>: check that you are attached to the correct
98
+ organisation (openeng org current)". Run `openeng org current`; if it names the wrong organisation,
99
+ `openeng org list` and `openeng org attach <id>`.
100
+
101
+ ## 2. Define or change object types
102
+
103
+ Edit a file, not the published types directly. The change is a draft that is checked, reviewed and
104
+ then accepted.
105
+
106
+ If `openeng types list` says `no published types`, start the type file from the `changes` map in the
107
+ example input printed by `openeng help ontology-sdk reviseChangeSet`. Read `openeng help types draft revise`
108
+ to understand each part, then design the model with the person before you draft it.
109
+
110
+ 1. If the project has published types, run `openeng types export --project <project id> > draft.json`;
111
+ it writes them as one JSON object keyed by type key, each at the next version, ready to send
112
+ with revise. If it has no published types, create `draft.json` from the `changes` map in the
113
+ example input printed by `openeng help ontology-sdk reviseChangeSet`.
114
+ 2. Make `draft.json` hold only the types you change: delete every other key, and keep each type you
115
+ keep whole, as the export wrote it. Accepting a type you did not change publishes an identical
116
+ new version of it.
117
+ 3. `openeng types draft open` opens a change set on your organisation's namespace. It prints the change
118
+ set id and a revision. If one is already open, `openeng types draft current` shows it.
119
+ 4. `openeng types draft revise --change-set <id> --revision <revision> --from draft.json` sends your
120
+ file. It prints the new revision. Use the newest revision in every later step.
121
+ 5. `openeng types draft validate --change-set <id> --revision <revision>` must report no violations.
122
+ It exits 0 when there are no violations, and exits 4 with the violations on standard output
123
+ otherwise; then edit the file and revise again.
124
+ 6. `openeng types draft show --change-set <id> --project <project id>` shows what changes against the
125
+ published types, per type and per field. Check that it is exactly the change you meant.
126
+ 7. `openeng types draft accept --change-set <id> --revision <revision>` publishes it. The new version
127
+ is now the published one: from here on, take a type's version for data writes from
128
+ `openeng types list`.
129
+
130
+ To abandon a draft, `openeng types draft discard --change-set <id>`.
131
+
132
+ `presentationBindings.typeIcon` is a Material Symbols Rounded name from the installed
133
+ `@material-symbols/font-400` set, such as `memory` or `developer_board`, not an arbitrary label
134
+ (for example, `cpu` is invalid). `openeng types icons <text>` lists valid names and needs no sign-in; the full list is at https://docs.openeng.io/reference/icons/.
135
+ Publication refuses unknown or empty names. Existing unknown icons show an empty box and
136
+ must be corrected before publishing that type again.
137
+
138
+ An object type's `subscriptionRoles` field declares which roles it admits: owner, approver or watcher.
139
+ Owner is limited to one; approver and watcher may have optional maxima. Without the field, only
140
+ watchers are admitted; the publication validator decides whether a declaration is valid.
141
+
142
+ ## 3. Write data
143
+
144
+ Write on the ref agreed with the person and within their authority. That may be `main` when
145
+ the applicable protections permit the write; an approved agent plan may also name an unprotected
146
+ project's `main`. Use a branch and review when a rule protects the ref or the person asks for it.
147
+
148
+ 1. `openeng help objects-sdk mutate` and `openeng help branches-sdk createBranch` for the fields, the
149
+ selector keys and an example each.
150
+ 2. When a branch is needed, `openeng branches-sdk createBranch` makes one in the project. It
151
+ answers the branch's ref, written `<project id>/<name>`.
152
+ 3. `openeng objects-sdk mutate` creates, changes or deletes an object or an edge on that ref. A ref in
153
+ a selector takes one of three forms: the organisation trunk is the bare `main`; a project
154
+ branch is its whole ref, `<project id>/<name>`; an organisation ref is its bare name.
155
+ The server derives the organisation from the token. Use the agreed ref for writes and read
156
+ back from that same ref with
157
+ `openeng objects-sdk readObject` and `openeng objects-sdk queryObjects`.
158
+ 4. Read back what you wrote: `openeng objects-sdk readObject` for one object, or
159
+ `openeng objects-sdk queryObjects` for a list. Use the type key and version the project's
160
+ `openeng types list` showed. For an object's edges use `openeng objects-sdk queryGraph`;
161
+ for paths use `openeng objects-sdk findPaths`. Confirm relationships through the CLI;
162
+ do not hand the check to the web app.
163
+ 5. `openeng objects-sdk executeVerb` runs a verb a type defines. `openeng objects-sdk discoverVerbs` lists
164
+ the verbs available.
165
+ 6. When using a branch for review, `openeng branches-sdk submitProposal` sends it for review. It
166
+ names the branch by its `name` alone, the part of the ref after the slash.
167
+
168
+ If a command is refused, the refusal names the field and its allowed kinds. Run
169
+ `openeng help <module> <method>` again and compare.
170
+
171
+ ### Read relationships back after a write
172
+
173
+ Run `openeng help objects-sdk queryGraph` first. Take the project and object identifiers from
174
+ the confirmed write and replace the placeholders below. One start address and one hop step
175
+ read that object's connections, including the edges in the answer:
176
+
177
+ ```sh
178
+ openeng objects-sdk queryGraph --host https://api.openeng.io --selector '{"projectId":"<project-id>","ref":"<project-id>/<branch>"}' --input '{"kind":"graph","start":{"kind":"objects","objects":[{"projectId":"<project-id>","objectId":"<object-id>"}]},"steps":[{"depth":1}]}' --json
179
+ ```
180
+
181
+ Check the returned hops against the relationships you wrote. Use `findPaths` for paths across
182
+ several objects; read its help before supplying input.
183
+
184
+ ## Project ref rules
185
+
186
+ A project rule may protect `main` or refs under that project's identifier. A matching
187
+ `merge-only` rule requires changes through a branch and merge. A `locked-rows-only` rule binds
188
+ merge-only row locks on the matching ref while leaving unlocked rows direct.
189
+
190
+ Rule management is the person's workflow: they must hold `administer projects` on the project
191
+ and run these commands themselves. Never add or remove rules on their behalf, including to
192
+ get past a refusal.
193
+
194
+ 1. The person runs `openeng rules add --project <id> --pattern main --consequence merge-only`
195
+ to protect the project's trunk. The answer includes the rule's identifier. Adding the same
196
+ content again returns the existing rule.
197
+ 2. `openeng rules list --project <id>` reads the visible rules, their identifiers, patterns and
198
+ consequences; it needs `read` on the project.
199
+ 3. To lift one rule, the person runs `openeng rules remove --project <id> --rule-id <id>` with
200
+ the identifier from the list. An absent identifier or one from another project answers
201
+ `not-found`. Removal is audited, as is addition, and takes effect on the next request.
202
+ Other matching rules and row locks may still protect the ref's rows.
203
+
204
+ ## Organisation rules, refs, locks and agent ceilings
205
+
206
+ These protections are managed by the person. Never change rules, refs or locks yourself,
207
+ including to get past a refusal. Read their current state and ask the person to make a change.
208
+ Each command's `--help` names the person's capability. A `not-permitted` refusal carries no
209
+ capability; read the help line before asking the person to seek permission.
210
+
211
+ - The person uses the rules commands above with `--organisation` instead of `--project <id>`
212
+ for organisation rules, for example
213
+ `openeng rules add --organisation --pattern release-v1 --consequence merge-only`.
214
+ Choose exactly one flag. `--organisation` takes no value and uses the attached organisation.
215
+ `openeng rules list --organisation` reads the rules;
216
+ `openeng rules remove --organisation --rule-id <id>` removes one by its identifier.
217
+ Adding or removing needs `administer projects` in the attached organisation; listing needs `read`.
218
+ - `openeng org-refs list` reads organisation refs and their read-only state. The person creates
219
+ one with `openeng org-refs create --name <name> [--read-only]`, marks it read-only with
220
+ `openeng org-refs mark-read-only --name <name>`, or deletes a writable one with
221
+ `openeng org-refs delete --name <name>`. Names are single segments, such as `release-v1`.
222
+ Creating, deleting and marking need `administer projects` in the attached organisation;
223
+ listing needs `read`.
224
+ - The person sets or lifts an object's lock with
225
+ `openeng locks set --project <id> --ref <ref> --object <objectId> --lock <none|merge-only|frozen>`.
226
+ `none` lifts it. The lock also applies to its existing structural child edges in the selected
227
+ project. New children on a live ref are not thereby frozen. Use a read-only organisation ref
228
+ for a fixed baseline. This needs `lock objects` on the selected project.
229
+ - `openeng ceiling show --project <id>` reads the maximum agent role. The person sets it with
230
+ `openeng ceiling set --project <id> --ceiling <contributor|maintainer>`.
231
+ Showing needs `read`; setting needs `administer projects` on the selected project.
232
+
233
+ ## Protection refusals
234
+
235
+ When a command returns one of these rules, follow its action and do not repeat the same request:
236
+
237
+ - `immutable`: the type forbids changing or deleting the record on every ref. Leave it unchanged.
238
+ - `owned`: a connected system alone writes the record. Ask that system to make the change.
239
+ - `frozen`: someone with the lock capability must lift the lock. Ask that person; do not try a
240
+ different ref.
241
+ - `protected`: a rule allows the record to change only through a merge from a branch. Make the
242
+ change on a branch and merge it.
243
+ - `not-a-ref-head`: the commit is not the head of a ref you can use. Read the usable refs and
244
+ choose one of their heads; the refusal does not identify which commit or ref was involved.
245
+ - `branch-needs-schema-update`: the ref's schema must be updated before writing. The
246
+ person can run `openeng schema-update request --ref <ref>` to record a request, then
247
+ `openeng schema-update show --ref <ref>` to read its state or `no request`. Stop writing while
248
+ the ref needs an update; recording a request does not execute the update. Requesting needs
249
+ `write ref` on the branch's home project, or `administer projects` for an organisation ref;
250
+ showing reads only the requester's records in the token organisation and needs no project read
251
+ access. A branch whose name contains `/` cannot request or show a schema update today.
252
+ - `organisation-not-ready`: the organisation's trunk is not ready. Try again shortly.
253
+ - `read-only-ref`: nothing can be written or merged into this ref. Choose a writable ref.
254
+
255
+ ## 4. Link to a page
256
+
257
+ To give the person a page, run `openeng link` and hand them the address it prints; never write a path
258
+ or an address yourself. `openeng link <kind> --project <id> --ref <ref>` takes `explore`, `branch-diff`
259
+ or `project`; `openeng link <kind> <identifier> --project <id> --ref <ref>` takes `object`, `type`, `proposal` or
260
+ `app` (the app's first page); `openeng link app-page <appKey> <pageKey> --project <id> --ref <ref>` takes
261
+ one page of an app; `openeng link app-draft <appKey> --ref <ref>` takes the app's draft screen and no
262
+ project. `openeng link ontology --ref <ref>` and `openeng link change-set --ref <ref>` take a ref and no
263
+ project, and `openeng link organisation-page <page>` takes neither flag. The organisation is the one
264
+ your session is attached to.
265
+
266
+ Every kind with `--ref`, including `ontology` and `change-set`, takes `main` or
267
+ `<projectId>/<branch>`, the ref the platform returns. A bare branch name or change-set id is
268
+ refused by `openeng link`. Before printing, the command reads the ref and the page's own subject;
269
+ a subject it cannot find is a refusal with a reason and no printed address.
270
+
271
+ An **App** is an organisation entity with its own pages and drafts, linked by `openeng link app`.
272
+ An **App view** is a type's collection content in `presentationBindings.views.app`, root `AppBody`,
273
+ and cannot be linked by `link app`.
274
+
275
+ ## 5. Show data to the person
276
+
277
+ The CLI draws nothing. Read the `--json` output of a query or a read and draw it yourself, as a
278
+ table or a tree in ASCII, or as a Mermaid diagram when the person's tool renders it. Draw only
279
+ what the output holds.
280
+
281
+ ## 6. Connect an Onshape account
282
+
283
+ The connector commands import an Onshape account's documents into a mirror project. Each
284
+ command's help, such as `openeng help connector create` or `openeng help connector run`, names the
285
+ capability it needs. Through the CLI you act with the signed-in person's user token, so you can do
286
+ what that person may and nothing more.
287
+
288
+ Before you create a connection, tell the person this, because create prints it on standard error
289
+ and the person must know it: "Everyone with access to this project sees every document this
290
+ Onshape account can see."
291
+
292
+ The order, from no connection to a first imported document:
293
+
294
+ 1. `openeng connector create --system onshape --stack <stack> --name <text> [--company <id>]
295
+ [--team <id> | --owner <id>] [--label <text>]`. `--stack` is the Onshape stack label, as in
296
+ `cad`. At most one of `--team` and `--owner`. With neither, `--company` is required and must be the
297
+ company's own identifier, never a user's. It prints the connection identifier and the change
298
+ set it drafted for the connector's types, or the rule that stopped the drafting.
299
+ 2. `set-credential <connection>`: the command reads the access key and the secret key at a terminal
300
+ prompt only, with no flag and no environment variable. Do not ask for the Onshape keys, do not
301
+ accept them in the conversation, and do not type them on the person's behalf. Ask the person to
302
+ run `openeng connector set-credential <connection>` at their own terminal. Setting it again replaces
303
+ the stored credential. The person can cancel at either prompt with Control-C; the command then
304
+ says no keys were set.
305
+ 3. A person who holds `administer types` reviews the change set (`openeng types draft show
306
+ --change-set <id> --project <mirror project id>`) and accepts it (`openeng types draft accept
307
+ --change-set <id> --revision <token>`). Until then a run refuses with `types-not-approved`.
308
+ `openeng connector draft-types <connection>` drafts again.
309
+ 4. `openeng connector run <connection>` prints the run identifier. `openeng connector runs <connection>`
310
+ lists the runs newest first with state, counts and failure kind; read it until the state is
311
+ `succeeded` or `failed`.
312
+ 5. `openeng connector revoke <connection>` ends the connection.
313
+
314
+ The connected system alone writes records of its owned types. A person's write is refused as
315
+ `owned`. People put their own information in separate rows and link those rows to the mirrored
316
+ records. The importer counts updates to mirrored properties as `overwritten`. If a mirrored
317
+ record is absent, the importer creates it with a new identifier and counts it as `created`.
318
+
319
+ Refusals you will meet, with what each means and what to do:
320
+
321
+ - `types-not-approved`: the connector's types wait for approval by a person who holds the
322
+ permission to administer types. Ask such a person to review and accept the connector's change
323
+ set; read it with `openeng types draft current`.
324
+ - `import-running`: a run of this connection is already running. List the connection's runs with
325
+ `openeng connector runs <connection>`.
326
+ - `connection-revoked`: the connection is revoked, so it takes no further change or run. A new
327
+ connection makes a new mirror project.
328
+ - `not-permitted`: the operation was refused. What the request names may not exist, or the person
329
+ may not have permission for it; the answer is the same either way. Check that the request names
330
+ something the person can reach; if it does, the person must ask an administrator for the
331
+ permission.
332
+ - `credential-not-valid`: Onshape did not accept the credential, and nothing was stored. The person
333
+ checks the keys and runs `set-credential` again.
334
+ - `connection-exists`: the organisation already has a live connection to this account on this
335
+ stack. List the connections with `openeng admin-sdk listConnections` rather than creating another.
336
+ - `connector-template-missing`: this deployment holds no type template for the connector's system.
337
+ No remedy is in your reach; tell the person.
338
+ - `change-set-open`: the organisation already has an open change set, so drafting the types
339
+ stopped. Read it with `openeng types draft current` and continue with it; the connection exists, and
340
+ `openeng connector draft-types <connection>` drafts once that change set is settled.
@@ -0,0 +1,121 @@
1
+ # Playbook: an engineering requirements platform
2
+
3
+ For a team that wants what DOORS or Jama gives it: requirements, their decomposition, how designs meet
4
+ them, how they are verified, and the risks against them, all traced. Read `openeng skill conventions` first.
5
+
6
+ ## Reference products, and what sets them apart
7
+
8
+ | product | organised around | what that means for a model |
9
+ |---|---|---|
10
+ | IBM DOORS (classic) and DOORS Next | **documents**: a module is a specification, an ordered outline of headings and "shall" statements; links run between objects in different modules | a document type and section headings, with order, become types of their own |
11
+ | Jama Connect | **items** in a project tree organised by components (a system or subsystem), sets and folders; typed relationships with rules from an upstream item type to a downstream one; coverage from those rules | the system tree is the backbone and every item hangs off a system; a document is a view or an export, not a type |
12
+ | SysML tools | **model elements** with «satisfy», «verify», «deriveReqt» relationships that point at the requirement | the same item model, with arrows drawn at what is proved |
13
+
14
+ On this platform the item-centric shape fits best: every item is an object, every relationship an edge,
15
+ and a specification document is a view of a system's subtree. Choose the document-centric shape only
16
+ when the team's deliverable is the document itself and its order matters more than its traces.
17
+
18
+ ## The decisions that shape the model
19
+
20
+ 1. **Organised around systems or around documents.** Recommend systems. A document-centric model needs a
21
+ `document` and a `section` type, an `order` property, and one structural edge per pair of parent and
22
+ child types, because each edge end takes one type.
23
+ 2. **One requirement type, or one per level** (stakeholder need, system, subsystem). Recommend one type
24
+ whose level comes from where it sits in the system tree: one decomposition edge then serves every
25
+ level. One type per level gives each level its own fields, but every pair of levels needs its own
26
+ decomposition edge.
27
+ 3. **Requirement against specification.** The requirement is the need (what must be true); the
28
+ specification is the design's answer (a chosen value or standard), joined by a satisfaction edge. The
29
+ alternative, a specification as a stricter requirement, joins them by decomposition instead.
30
+ 4. **What a verification proves.** Recommend requirements only. Jama's design-control practice puts the
31
+ acceptance criteria in the requirement and links the test to it; the specification is proved through
32
+ the requirement it satisfies. Proving specifications directly takes a second verification edge.
33
+ 5. **How a risk relates.** Recommend the risk upstream of the requirement that mitigates it
34
+ (`mitigated-by`), as Jama's traceability runs "from risks to mitigation", so "a risk with no
35
+ mitigation" is a coverage question. The
36
+ alternative, a risk hanging downstream of the requirement it threatens, keeps the requirement as the
37
+ anchor.
38
+ 6. **The direction convention**, "flow of work" or "points at what is proved" (`openeng skill conventions`,
39
+ section 3). The two worked models below take one each.
40
+ 7. **Identifiers.** The platform keeps no counter, so a human-readable identifier such as `SYS-042` is a
41
+ string the author or agent sets, by a prefix per system or level.
42
+
43
+ ## Worked model A: flow of work
44
+
45
+ Every edge's source is its upstream end.
46
+
47
+ | object type | one object is | title | required |
48
+ |---|---|---|---|
49
+ | `system` | a system, subsystem or component; systems nest | `name` | `identifier`, `name`, `level` |
50
+ | `requirement` | one "shall" statement, owned by one system | `title` | `identifier`, `title`, `statement`, `category`, `status`, `priority` |
51
+ | `specification` | the design's answer to a requirement | `title` | `identifier`, `title`, `statement`, `status` |
52
+ | `verification` | a planned test, analysis, inspection or demonstration | `title` | `identifier`, `title`, `method`, `status` |
53
+ | `verification-result` | one execution of a verification | `identifier` | `identifier`, `outcome`, `runDate` |
54
+ | `risk` | something that could go wrong | `title` | `identifier`, `title`, `severity`, `likelihood`, `status` |
55
+
56
+ Enumerations: requirement `category` (functional, performance, interface, constraint, safety,
57
+ regulatory), `status` (draft, in-review, approved, released, rejected, deprecated), `priority` (must,
58
+ should, could), `verificationMethod` (test, analysis, inspection, demonstration); verification `status`
59
+ (planned, ready, obsolete); result `outcome` (pass, fail, blocked, inconclusive); risk `severity`
60
+ (negligible to catastrophic), `likelihood` (rare to almost-certain), `status` (open, mitigated, closed).
61
+ Performance requirements carry optional `unit`, `targetValue` and `tolerance`.
62
+
63
+ | edge type | source to target | kind | parent end | reads from the source / the target |
64
+ |---|---|---|---|---|
65
+ | `contains` | system to system | structural | source | contains / part of |
66
+ | `has-requirement`, `has-specification`, `has-verification`, `has-risk` | system to each | structural | source | has … / … of |
67
+ | `has-result` | verification to verification-result | structural | source | has result / result of |
68
+ | `derives` | parent requirement to child requirement | traceability | source | derives / derived from |
69
+ | `satisfied-by` | requirement to specification | traceability | null | satisfied by / satisfies |
70
+ | `verified-by` | requirement to verification | traceability | null | verified by / verifies |
71
+ | `mitigated-by` | risk to requirement | traceability | null | mitigated by / mitigates |
72
+
73
+ Every edge reads `both-endpoints`. `requirement` lists `["has-requirement", "derives"]` and declares two
74
+ views, "By system" (`has-requirement`) first and "Decomposition" (`derives`). The rail has one group,
75
+ "Requirements management", in the order system, requirement, specification, verification, result, risk.
76
+ The trace reads left to right: system, requirement, child requirement, specification, verification,
77
+ result.
78
+
79
+ ## Worked model B: points at what is proved
80
+
81
+ The platform's own agent's teaching example. The arrow points at the requirement.
82
+
83
+ | edge type | source to target | kind | parent end |
84
+ |---|---|---|---|
85
+ | `contains` | system to system | structural | source |
86
+ | `has-requirement`, `has-specification`, `has-verification`, `has-risk` | system to each | structural | source |
87
+ | `derives` | child requirement to parent requirement | traceability | target |
88
+ | `satisfies` | specification to requirement | traceability | null |
89
+ | `verifies` | verification to requirement | traceability | null |
90
+ | `threatens-requirement` | risk to requirement | traceability | null |
91
+
92
+ Choose B for a team whose engineers read SysML or whose model will meet a SysML tool.
93
+
94
+ ## Questions the model answers, and how
95
+
96
+ | question | how |
97
+ |---|---|
98
+ | which requirements have no verification | requirements with no `verified-by` edge (model A: outgoing; model B: no incoming `verifies`) |
99
+ | which risks have no mitigation | risks with no `mitigated-by` edge |
100
+ | what a requirement breaks down into | the "Decomposition" tree, or `derives` from it |
101
+ | how a requirement is proved | the path requirement to verification to result |
102
+ | what a system must do | the "By system" tree under that system |
103
+
104
+ ## Sensible hybrids
105
+
106
+ - **Document views over the item model**: keep the system-centric types and give a system's subtree a
107
+ page that reads as a specification, rather than adding document and section types.
108
+ - **Requirements beside a product structure**: where the organisation already has parts (a PLM model),
109
+ link requirements to the parts that meet them instead of duplicating systems as parts.
110
+
111
+ ## Joining an existing catalogue
112
+
113
+ - Reuse an existing `system`, `part` or `component` type for the breakdown rather than add a second one.
114
+ - Use the existing model's direction convention, even where this playbook recommends the other.
115
+ - Follow its rail groups, naming and icons; add a "Requirements" group only when none fits.
116
+
117
+ ## Not on the platform today
118
+
119
+ - **Suspect links**: DOORS and Jama mark a link when its upstream end changes. Nothing does this yet; a
120
+ team can review changes through a proposal's diff and an object's history.
121
+ - **Coverage percentages** across levels: a count per question is a query; a roll-up is not built.