@hippo-digital/hippocampus 2.9.1 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,70 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.10.0
4
+
5
+ Releases 2 and 3 of the traceability work, shipped together. Release 2: who did
6
+ each step, prototype components and why they changed, and a trace that can be
7
+ handed over as it stood on the day. Release 3: the intended purpose, hazards and
8
+ the controls against them, risk ratings checked against the project's own
9
+ scales, the stricter checks, and a hazard log export. Everything is additive
10
+ within schemaVersion 1. A knowledge base that has components, intended
11
+ purposes, hazards, controls or any of the new links records that it needs
12
+ 2.10.0.
13
+
14
+ - **Intended purpose, hazards and controls.** Three new record types, in
15
+ `intended-purposes.json`, `hazards.json` and `controls.json`, and five new
16
+ links: `bounded-by`, `assessed-against-purpose` (with `assessment`),
17
+ `identified-from`, `mitigates` and `implemented-by`. `observed-on` now also
18
+ runs from a hazard, and `verified-by` from a control. A `mitigates` or
19
+ `identified-from` link can name the hazard's `cause`. Hazards, controls,
20
+ requirements and decisions take `outsideReferences`. A new **Safety** page
21
+ lists them with their gaps. See
22
+ [Record the intended purpose, hazards and controls](docs/record-intended-purpose-hazards-and-controls.md).
23
+ - **Risk scales are the project's own.** `project.json` takes `riskScales`
24
+ (severity, likelihood, ratings and an optional matrix); the package ships
25
+ none. `validate` warns about a rating off the scale, one the matrix would not
26
+ give, one with no `assessedBy`, a rated hazard still `proposed`, and a
27
+ residual risk above the initial one.
28
+ - **The stricter checks.** `trace export` lists eleven kinds of gap in the
29
+ chain, from no agreed intended purpose to a control nothing builds. With
30
+ `strictTraceability: true` in `project.json`, `validate` reports each as a
31
+ warning, so `validate --strict` fails on them.
32
+ - **Hazard rows and the hazard log export.** `trace export` also writes
33
+ `trace-hazards.csv` and `hazard-log.csv`: the hazards in the hazard log's
34
+ layout, marking which rows are proposals from design work.
35
+ - **IEC 62366-1 fields.** A scenario can say whether it goes to summative
36
+ evaluation and why (`summative`); a finding can record its `useError` and
37
+ `rootCause`.
38
+
39
+ - **Who drafted, reviewed and signed off.** Every record, links included, takes
40
+ `draftedBy`, `reviewedBy`, `reviewedOn`, `signedOffBy` and `signedOffOn`;
41
+ evidence and research rounds also take `sourceConfirmedBy` and
42
+ `sourceConfirmedOn`. None is required. Record pages show them. `validate`
43
+ warns about a date with no name and a record reviewed by its own drafter,
44
+ and counts records with a drafter but no reviewer. See
45
+ [Source model](docs/source-model.md#who-drafted-reviewed-and-signed-off).
46
+ - **`draft promote` writes the review onto the records.** It used to keep the
47
+ reviewer only in `manifests/drafts.json`, where a trace cannot see it. Each
48
+ record it adds now gets `draftedBy` from the draft and `reviewedBy` and
49
+ `reviewedOn` from `--reviewer`, unless the record already names its own. The
50
+ reviewer must not have drafted any record in the draft. `promote research`
51
+ takes an optional `--reviewer` and does the same.
52
+ - **Components.** A new record type, in `components.json`: a prototype macro
53
+ file a production team ports, with its usage guide, screens, production file
54
+ and the commit it was ported from. A new link, `realised-in`, runs from a
55
+ decision, requirement, design action or finding to the component it changed,
56
+ and can carry the `commit` and `pr`. `/components` lists them, with how many
57
+ reasons each has; a component page lists what changed it. `validate` counts
58
+ components with no recorded reason.
59
+ - **`trace export` and `trace verify`.** `npx hippocampus trace export
60
+ --release <label>` writes a readable page, the requirement and component
61
+ trace tables as CSV, every gap in the chain, and a baseline: the date, the
62
+ package version, the git commit and a fingerprint of every source file.
63
+ `trace verify --baseline <file>` says whether the knowledge base still
64
+ matches it. See [Export a trace](docs/export-a-trace.md).
65
+ - `migrate` reads the same collection list as every other command, so it no
66
+ longer misses a collection added later.
67
+
3
68
  ## 2.9.1
4
69
 
5
70
  - **Every route that can add a newer feature records the version it needs.**
@@ -33,6 +33,8 @@ const COMMANDS = {
33
33
  'promote project-context': 'promote-project-context-draft.js',
34
34
  'draft check': 'check-draft.js',
35
35
  'draft promote': 'promote-draft.js',
36
+ 'trace export': 'trace-export.js',
37
+ 'trace verify': 'trace-verify.js',
36
38
  'link insight-needs': 'link-insights-to-needs.js',
37
39
  'source index': 'index-source-artefacts.js',
38
40
  'source audit': 'audit-provenance.js',
@@ -0,0 +1,88 @@
1
+ ---
2
+ section: governance
3
+ order: 20
4
+ audience: [cli]
5
+ summary: Write the trace for a release - every requirement and component with what it rests on, every gap, and a baseline - into a folder you can commit and attach to a safety case.
6
+ ---
7
+ # Export a trace
8
+
9
+ A trace answers "what is this requirement based on, what was decided, where was
10
+ it built, and did it work?" for every requirement at once, and "why is this
11
+ component the way it is?" for every component. The viewer answers the same
12
+ questions one record at a time. The export is for handing over: to a clinical
13
+ safety officer, an assurance review or a production team.
14
+
15
+ It only counts if it shows who did each step and can be handed over as it stood
16
+ on the day. So every row says who drafted, reviewed and signed off, and the
17
+ export records exactly which source files it was made from.
18
+
19
+ ## Export it
20
+
21
+ From your prototype's folder:
22
+
23
+ ```bash
24
+ npx hippocampus trace export --release r17
25
+ ```
26
+
27
+ It writes seven files to `hippocampus/trace/r17/`. Without `--release` the folder
28
+ is named after today's date; `--out <folder>` writes somewhere else.
29
+
30
+ | File | What it holds |
31
+ | --- | --- |
32
+ | `trace.html` | A page that opens anywhere: the gaps, then one row per requirement and one per component |
33
+ | `trace-requirements.csv` | One row per requirement: its needs, the findings it is based on, the decisions weighed against it and who made them, the screens that address its needs, the components it was realised in, its evaluations with their outcome, and who drafted, reviewed and signed it off |
34
+ | `trace-components.csv` | One row per component: its prototype and production files, the commit it was ported from, and every decision, requirement, design action or finding that changed it, with commits and pull requests |
35
+ | `trace-hazards.csv` | One row per hazard: its risk before and after, who assessed it, its causes, the controls against it, what builds each control and the findings that verified them, and where it was identified |
36
+ | `hazard-log.csv` | The hazards in your hazard log's own layout, for the clinical safety officer. See [Record the intended purpose, hazards and controls](record-intended-purpose-hazards-and-controls.md#hand-proposals-to-the-clinical-safety-officer) |
37
+ | `gaps.csv` | Every break in the chain, one per line, with the record it is in |
38
+ | `baseline.json` | When, which Hippocampus version, the git commit, and a SHA-256 fingerprint of every source file |
39
+
40
+ Nothing in `hippocampus/source` changes. Commit the folder with the release.
41
+
42
+ If the knowledge base has uncommitted changes, the export says so: the commit
43
+ alone then does not describe what the trace was made from, but the
44
+ fingerprints still do. Commit first if the two should agree.
45
+
46
+ ## The gaps
47
+
48
+ Each gap is a fact, not a failure. A requirement written this week has not been
49
+ evaluated yet. The list is what someone signing off a release reads.
50
+
51
+ | Gap | What it means |
52
+ | --- | --- |
53
+ | `requirement-without-need` | A user requirement traces back to no user need |
54
+ | `requirement-without-screen` | No screen addresses the needs a user requirement comes from |
55
+ | `requirement-not-evaluated` | No finding says whether a design meets a user requirement (`verified-by`) |
56
+ | `requirement-not-met` | An evaluation found it not met, or only partly |
57
+ | `decision-without-decider`, `decision-without-date` | An accepted decision does not say who decided, or when |
58
+ | `rating-not-signed-off` | A finding rated critical or catastrophic has no sign-off |
59
+ | `component-without-reason` | Nothing records why a component is as it is |
60
+ | `drafted-not-reviewed` | A record names its drafter but nobody has reviewed it |
61
+ | `no-agreed-purpose` | There is no agreed intended purpose (once a project has started on purpose or hazards, or turned on the stricter checks) |
62
+ | `decision-not-assessed-against-purpose` | An accepted decision has not been assessed against the agreed intended purpose |
63
+ | `hazard-without-cause`, `hazard-without-control`, `hazard-without-initial-risk` | A hazard is missing one of the three |
64
+ | `risk-without-assessor` | A risk is rated but nobody is named as the assessor |
65
+ | `control-not-built`, `control-not-verified` | Nothing builds a control, or no finding has verified it |
66
+ | `finding-without-hazard` | A finding rated critical or catastrophic, or about harm, is linked to no hazard |
67
+ | `harm-requirement-not-evaluated` | A requirement about harm has never been evaluated |
68
+ | `decision-rests-on-high-risk-assumption` | An accepted decision rests on a high-risk assumption |
69
+ | `decision-cites-unconfirmed-evidence` | An accepted decision cites evidence whose source has not confirmed the write-up |
70
+
71
+ Organisational and market requirements are not expected to trace to a need or a
72
+ screen, or to be evaluated by users, and retired requirements are left out.
73
+
74
+ ## Check a trace still describes the knowledge base
75
+
76
+ ```bash
77
+ npx hippocampus trace verify --baseline hippocampus/trace/r17/baseline.json
78
+ ```
79
+
80
+ It compares the fingerprints with the source files now. If any file has changed,
81
+ been added or been removed since, it lists them and exits with 1: export again
82
+ if the release should describe the knowledge base as it is now.
83
+
84
+ ## Make the gaps count
85
+
86
+ Set `"strictTraceability": true` in `hippocampus/source/project.json` and
87
+ `validate` reports every gap as a warning, so `validate --strict` fails until
88
+ the chain is complete.
@@ -0,0 +1,202 @@
1
+ ---
2
+ section: governance
3
+ order: 30
4
+ audience: [cli]
5
+ summary: Record what the service is for, the hazards to patients from the clinical safety officer's hazard log, and the controls against them, so the trace runs from a hazard to the design that reduces it.
6
+ ---
7
+ # Record the intended purpose, hazards and controls
8
+
9
+ For a clinical service, the trace has to run from what could harm a patient to
10
+ the design that makes it less likely, and to the evidence that the design works.
11
+ Three kinds of record do that:
12
+
13
+ - **Intended purpose**: what the service is for, who uses it, and what it must
14
+ not do.
15
+ - **Hazards**: what could go wrong for a patient, why, and how bad it is.
16
+ - **Controls**: what is done to reduce each hazard's risk.
17
+
18
+ They are linked into the records you already have: requirements, decisions,
19
+ screens, components and findings. The viewer shows them under **Safety**, and
20
+ `trace export` writes them out, including in your hazard log's own layout.
21
+
22
+ This is not regulatory advice. Whether your service is a medical device, and
23
+ what your clinical safety case needs, is for your clinical safety officer and
24
+ your regulation lead to decide.
25
+
26
+ ## Who decides what
27
+
28
+ - **Your clinical safety officer owns the hazard log.** Where the log is kept
29
+ somewhere controlled, it stays the master. Hippocampus holds each hazard as a
30
+ reference to it: its number and words at a stated version, plus the links to
31
+ design work that the log does not have.
32
+ - **Only a named person sets a risk.** A hazard drafted by a designer or an
33
+ agent is `proposed`, with no rating, until the clinical safety officer
34
+ accepts it. `validate` warns about a rating with no `assessedBy`, and about a
35
+ proposed hazard that has one.
36
+ - **The intended purpose is agreed by someone named**, usually with the
37
+ clinical safety officer and the regulation lead. `agreedBy` says who.
38
+
39
+ ## Set the risk scales first
40
+
41
+ The package ships no risk scales. A severity word means what your hazard log's
42
+ matrix says it means. Copy the scales into `hippocampus/source/project.json`:
43
+
44
+ ```json
45
+ "riskScales": {
46
+ "severity": ["Minor", "Moderate", "Severe"],
47
+ "likelihood": ["Unlikely", "Possible", "Likely"],
48
+ "risk": { "1": "Acceptable", "2": "Tolerable", "3": "Unacceptable" },
49
+ "matrix": {
50
+ "Unlikely": { "Minor": 1, "Moderate": 1, "Severe": 2 },
51
+ "Possible": { "Minor": 1, "Moderate": 2, "Severe": 3 },
52
+ "Likely": { "Minor": 2, "Moderate": 3, "Severe": 3 }
53
+ },
54
+ "source": "the hazard log, version 1.0"
55
+ }
56
+ ```
57
+
58
+ These scales are made up to show the shape. Use your own log's words, ratings
59
+ and matrix exactly as the log has them. A log on the NHS DCB0129 template
60
+ usually has five severities (Minor to Catastrophic), five likelihoods (Very Low
61
+ to Very High) and ratings 1 to 5.
62
+
63
+ `matrix` is optional: `matrix[likelihood][severity]` is the rating. With it,
64
+ `validate` checks each rating is the one the matrix gives. Without
65
+ `riskScales`, ratings are kept but cannot be checked, and `validate` says so.
66
+
67
+ ## The records
68
+
69
+ ### Intended purpose
70
+
71
+ File: `hippocampus/source/intended-purposes.json`. One record per version; an
72
+ agreed version names the one it `supersedes`, which you mark `superseded`.
73
+
74
+ | Field | What it holds |
75
+ | --- | --- |
76
+ | `title`, `version` | Required |
77
+ | `status` | `draft`, `agreed` or `superseded` |
78
+ | `statement` | Required. The purpose, in a paragraph |
79
+ | `indications` | The clinical situation it is used in |
80
+ | `structureAndFunction` | What goes in, what comes out, what the user does, where it sits in the workflow |
81
+ | `population` | `{ "included": "...", "excluded": "..." }` |
82
+ | `userIds` | The user groups already in the knowledge base |
83
+ | `useEnvironment` | Where and how it is used |
84
+ | `foreseeableMisuse` | Each way it could be used outside its purpose |
85
+ | `mustNotDo` | The functions that would change what it is, such as suggesting a diagnosis |
86
+ | `agreedBy`, `agreedOn` | Who agreed it, and when |
87
+
88
+ "Must not do" is not in MHRA's list of elements. It is here because each line
89
+ can become a requirement that design options are weighed against.
90
+
91
+ ### Hazards
92
+
93
+ File: `hippocampus/source/hazards.json`.
94
+
95
+ | Field | What it holds |
96
+ | --- | --- |
97
+ | `title`, `hazard`, `harm` | Required. A short name, the hazard in the log's words, and the possible harm to a patient |
98
+ | `logNumber`, `dateAdded` | The hazard's number in the log, and when it was added |
99
+ | `effect` | What happens in the service |
100
+ | `causes` | `[{ "number": 1, "statement": "..." }]`, numbered as the log numbers them |
101
+ | `initialRisk`, `residualRisk` | `{ "severity", "likelihood", "risk", "justification" }`, before and after the additional controls |
102
+ | `assessedBy`, `assessedOn` | Who set the risk, and when |
103
+ | `status` | `proposed`, `open`, `closed` or `transferred` |
104
+ | `owner` | Who owns it |
105
+ | `reference` | The log, its version and the hazard number |
106
+
107
+ ### Controls
108
+
109
+ File: `hippocampus/source/controls.json`.
110
+
111
+ | Field | What it holds |
112
+ | --- | --- |
113
+ | `statement` | Required. What is done to reduce the risk |
114
+ | `kind` | `hit-design`, `user-training` or `business-process`: the log's three kinds. A test is not a kind; it is the proof a control works |
115
+ | `stage` | `existing` (counted in the initial risk) or `additional` (taken into the residual risk) |
116
+ | `status` | `proposed`, `in-place` or `verified` |
117
+ | `owner` | Who owns it |
118
+
119
+ ### Outside references
120
+
121
+ Hazards, controls, requirements and decisions can carry `outsideReferences`:
122
+ where the chain carries on outside the knowledge base.
123
+
124
+ ```json
125
+ "outsideReferences": [
126
+ { "system": "Jira", "id": "NCRS-1234", "url": "https://...", "kind": "software requirement" }
127
+ ]
128
+ ```
129
+
130
+ The trace export prints them, so the chain does not stop at the screen.
131
+
132
+ ## The links
133
+
134
+ | Link | From | To | What it says |
135
+ | --- | --- | --- | --- |
136
+ | `bounded-by` | requirement | intended purpose | This requirement keeps the product inside its purpose |
137
+ | `assessed-against-purpose` | decision | intended purpose | With `assessment`: `within`, `changes` or `outside` |
138
+ | `identified-from` | hazard | finding, evidence or scenario | Where the hazard was found. May name its `cause` |
139
+ | `observed-on` | hazard | screen | Where it can happen |
140
+ | `mitigates` | control | hazard | What the control is for. May name the `cause` it addresses |
141
+ | `implemented-by` | control | requirement, decision, design action, screen or component | What builds a design control. A design action counts while the work is in progress |
142
+ | `verified-by` | control | finding | The proof it works, with `outcome` |
143
+
144
+ A `cause` must be one the hazard lists.
145
+
146
+ ## Fields for IEC 62366-1
147
+
148
+ - A scenario can say whether it goes to summative evaluation, and why:
149
+ `"summative": { "selected": true, "reason": "..." }`. A scenario that is
150
+ hazard-related is one a hazard is `identified-from`.
151
+ - A finding from a summative round can record the `useError` observed and its
152
+ `rootCause`.
153
+ - A research round's `evaluation` field (`formative` or `summative`) has been
154
+ there since 2.9.0.
155
+
156
+ ## Add them through a draft
157
+
158
+ Write the records into a draft and promote it, like any other: see
159
+ [Review a draft and promote it](review-and-promote-a-draft.md#drafts-of-any-other-record).
160
+ The draft is where the clinical safety officer reviews proposed hazards before
161
+ anything reaches the knowledge base, and `draft promote --reviewer` records who
162
+ did.
163
+
164
+ ```json
165
+ {
166
+ "draft": { "title": "Hazards from the hazard log, version 0.12", "draftedBy": "Service designer" },
167
+ "records": {
168
+ "hazards": [ ... ],
169
+ "controls": [ ... ],
170
+ "relationships": [ ... ]
171
+ }
172
+ }
173
+ ```
174
+
175
+ ## The stricter checks
176
+
177
+ Set `"strictTraceability": true` in `project.json` and every gap in the chain
178
+ becomes a warning, so `validate --strict` fails until it is closed. Without it,
179
+ the same gaps are listed by `trace export` and on the Safety page. They are:
180
+
181
+ - no agreed intended purpose;
182
+ - an accepted decision with no decider or date;
183
+ - an accepted decision not assessed against the agreed intended purpose;
184
+ - a hazard with no cause, no control or no initial risk;
185
+ - a risk rating with nobody named as the assessor;
186
+ - a control that nothing builds, or that no finding has verified;
187
+ - a finding rated critical or catastrophic, or about harm, linked to no hazard;
188
+ - a requirement about harm that has never been evaluated;
189
+ - an accepted decision that rests on a high-risk assumption;
190
+ - an accepted decision that cites evidence whose source has not confirmed the
191
+ write-up;
192
+ - a record with a drafter but no reviewer.
193
+
194
+ ## Hand proposals to the clinical safety officer
195
+
196
+ `trace export` writes `hazard-log.csv`: every hazard in the hazard log's own
197
+ layout, one row per hazard, with its causes numbered, its controls split into
198
+ existing and additional and named by kind, and the risk before and after. The
199
+ **In the log** column says whether each row is already in the log or a proposal
200
+ from design work. The clinical safety officer takes what they accept into the
201
+ log, and the next version's references come back through a draft. See
202
+ [Export a trace](export-a-trace.md).
@@ -98,11 +98,14 @@ From your prototype's folder:
98
98
  2. Promote it:
99
99
 
100
100
  ```bash
101
- npx hippocampus promote research --draft hippocampus/imports/research/<name>.json
101
+ npx hippocampus promote research --draft hippocampus/imports/research/<name>.json --reviewer "User researcher"
102
102
  ```
103
103
 
104
104
  It adds the records to `hippocampus/source/`, checks the whole knowledge
105
- base still holds together, and marks the draft as promoted.
105
+ base still holds together, and marks the draft as promoted. `--reviewer`
106
+ is optional here, but give it: it is written onto every record the draft
107
+ adds as `reviewedBy` and `reviewedOn`, which is how a trace shows the
108
+ findings were checked.
106
109
 
107
110
  3. See what changed and commit it, naming the round:
108
111
 
@@ -269,6 +272,11 @@ npx hippocampus draft promote --draft hippocampus/inbox/<name>.draft.json --revi
269
272
  - It adds the records to the source files and records the promotion in
270
273
  `hippocampus/manifests/drafts.json`: the draft, its title, when, who reviewed
271
274
  it, who drafted it, and how many of each record.
275
+ - It writes the same names onto each record it adds: `draftedBy` from the
276
+ draft and `reviewedBy` and `reviewedOn` from `--reviewer`. A record that
277
+ already names its own drafter or reviewer keeps them, and the reviewer must
278
+ not be any record's drafter either. See
279
+ [Source model](source-model.md#who-drafted-reviewed-and-signed-off).
272
280
  - If the draft uses something an older Hippocampus cannot read, such as a
273
281
  `rests-on` link, it records the version needed in `_meta.json` and says so.
274
282
  See [Source model](source-model.md#which-version-a-knowledge-base-needs).
@@ -228,6 +228,30 @@ Each screen includes:
228
228
  - linked needs
229
229
  - expected NHS components
230
230
 
231
+ ### Components
232
+
233
+ File: `hippocampus/source/components.json`
234
+
235
+ A component is a prototype macro file, or the macros in one, that a production team ports. Screens list the NHS components they use by name; a component record is for the prototype's own components, so that a decision, requirement or finding can say it changed one. A production team comparing its port with the prototype reads these to find out why the prototype moved.
236
+
237
+ | Field | Notes |
238
+ | --- | --- |
239
+ | `title` | Required. The name the team uses |
240
+ | `prototypePath` | Required. The file in the prototype, from the project root, such as `app/views/components/card/card.html` |
241
+ | `macros` | The macros in that file this record covers |
242
+ | `guide` | Its usage guide, from the project root |
243
+ | `screenIds` | Screens it appears on |
244
+ | `productionPath` | Where production keeps its port, once there is one |
245
+ | `portedFromCommit` | The prototype commit the port was made from. A comparison starts here |
246
+
247
+ The reason a component changed is a `realised-in` link to it (see the relationship map), with the commit or pull request that made the change. A component with no such link is counted by `validate` and listed as a gap by `trace export`.
248
+
249
+ ### Intended purpose, hazards and controls
250
+
251
+ Files: `hippocampus/source/intended-purposes.json`, `hazards.json` and `controls.json`. What the service is for and must not do, the hazards to patients from the clinical safety officer's hazard log, and what is done to reduce each one. Risk ratings are checked against `riskScales` in `project.json`; the package ships no scales of its own. See [Record the intended purpose, hazards and controls](record-intended-purpose-hazards-and-controls.md) for every field.
252
+
253
+ Hazards, controls, requirements and decisions may carry `outsideReferences`: `[{ "system", "id", "url", "kind" }]`, where the chain carries on outside the knowledge base. A scenario may say whether it goes to summative evaluation (`summative: { selected, reason }`), and a finding may record the `useError` observed and its `rootCause`.
254
+
231
255
  ### Evidence
232
256
 
233
257
  File: `hippocampus/source/evidence.json`
@@ -323,6 +347,19 @@ Use assumptions when:
323
347
  - a service rule is plausible but unconfirmed
324
348
  - the spike makes a deliberate simplification
325
349
 
350
+ ### Who drafted, reviewed and signed off
351
+
352
+ Every record, links included, may say who did each step. Git records what changed and when; these say who. None is required.
353
+
354
+ | Field | Notes |
355
+ | --- | --- |
356
+ | `draftedBy` | Who or what wrote it: a person, a role or an agent |
357
+ | `reviewedBy`, `reviewedOn` | Someone other than the drafter checked it against its source |
358
+ | `signedOffBy`, `signedOffOn` | The accountable person accepted it. For a hazard or a severity rating, the clinical safety officer |
359
+ | `sourceConfirmedBy`, `sourceConfirmedOn` | On evidence and research rounds: the people quoted confirmed the write-up |
360
+
361
+ Dates are `YYYY-MM-DD`. Each field takes a name or a role; which a project records is a question for its information governance lead. `draft promote` writes `draftedBy`, `reviewedBy` and `reviewedOn` onto every record it adds (see [Review a draft and promote it](review-and-promote-a-draft.md)). `validate` warns about a date with no name, and about a record reviewed by the person who drafted it, and counts records that name a drafter but no reviewer.
362
+
326
363
  ### References
327
364
 
328
365
  Every record type except relationships may carry an optional `reference`: the identifier it already has where it came from, such as a Jira key or a workbook row (`FB-013`, `US-010`). It keeps a decision traceable to the ticket a team works from, and gives an importer a stable key to find a record it wrote before and update it rather than add a second copy. It is not an `id`: ids stay kebab-case and never change; a reference is whatever the source system uses.
@@ -341,6 +378,8 @@ screen -> needs
341
378
  requirement -> needs, insights
342
379
  insight -> research round, participants, evidence
343
380
  participant -> research rounds, user
381
+ component -> screens
382
+ intended purpose -> users, the purpose it supersedes
344
383
  ```
345
384
 
346
385
  Typed links in `relationships.json` point from the record that depends to the record it depends on. The requirements layer adds:
@@ -351,20 +390,26 @@ Typed links in `relationships.json` point from the record that depends to the re
351
390
  | `based-on-insight` | requirement | insight | |
352
391
  | `constrained-by` | requirement | requirement (a rule) | |
353
392
  | `refines-objective` | requirement | quality objective | |
354
- | `verified-by` | requirement | insight | `meets`, `partly`, `fails` |
393
+ | `verified-by` | requirement or control | insight | `meets`, `partly`, `fails` |
355
394
  | `weighed-against` | decision | requirement | `meets`, `partly`, `fails`, `not-assessed` |
356
395
  | `applies-principle` | screen, requirement, decision or journey | principle | |
357
- | `observed-on` | insight | screen | |
396
+ | `observed-on` | insight or hazard | screen | |
358
397
  | `rests-on` | design action, decision or requirement | assumption | |
359
398
  | `challenged-by` | assumption, decision or requirement | evidence or insight | |
399
+ | `realised-in` | decision, requirement, design action or insight | component | |
400
+ | `bounded-by` | requirement | intended purpose | |
401
+ | `assessed-against-purpose` | decision | intended purpose | `assessment`: `within`, `changes`, `outside` |
402
+ | `identified-from` | hazard | insight, evidence or scenario | |
403
+ | `mitigates` | control | hazard | |
404
+ | `implemented-by` | control | requirement, decision, design action, screen or component | |
360
405
 
361
- A relationship may carry a `note` saying why. Validation checks the From and To of these ten; a link written the wrong way round does not fail on its own, it just stops traversal, so validation catches it instead. The older types are listed in [Research knowledge graph](research-knowledge-graph.md).
406
+ A relationship may carry a `note` saying why. A `realised-in` link may also carry the `commit` (a git hash) and `pr` (a pull request) that made the change. A `mitigates` or `identified-from` link may name the hazard's `cause` by its number. Validation checks the From and To of these sixteen; a link written the wrong way round does not fail on its own, it just stops traversal, so validation catches it instead. The older types are listed in [Research knowledge graph](research-knowledge-graph.md).
362
407
 
363
408
  `rests-on` makes an assumption's reach visible: when it turns out to be wrong, the work resting on it is listed on its page. `challenged-by` records the evidence or finding that calls a record into question, without deleting or overwriting it.
364
409
 
365
410
  ### Which version a knowledge base needs
366
411
 
367
- `hippocampus/source/_meta.json` holds the `schemaVersion` and, once a knowledge base uses something an older package cannot read, `requiresPackage`: the lowest version of Hippocampus that understands everything in it. `draft promote`, `promote research` and `import design-actions` write it when they add a newer link type or method, and never lower it. Records added by hand skip those commands, so `validate` warns when the knowledge base uses something `_meta.json` does not record, and `npx hippocampus migrate` records it. An older package refuses the knowledge base and says which version to upgrade to, rather than reading it partially. The `rests-on` and `challenged-by` links and the `expert-review` method need 2.9.0.
412
+ `hippocampus/source/_meta.json` holds the `schemaVersion` and, once a knowledge base uses something an older package cannot read, `requiresPackage`: the lowest version of Hippocampus that understands everything in it. `draft promote`, `promote research` and `import design-actions` write it when they add a newer link type or method, and never lower it. Records added by hand skip those commands, so `validate` warns when the knowledge base uses something `_meta.json` does not record, and `npx hippocampus migrate` records it. An older package refuses the knowledge base and says which version to upgrade to, rather than reading it partially. The `rests-on` and `challenged-by` links and the `expert-review` method need 2.9.0; components, intended purposes, hazards, controls and the links into them need 2.10.0.
368
413
 
369
414
  Project context stays outside the graph: it is briefing material, and organisational requirements are where its rules become checkable.
370
415
 
package/lib/breadcrumb.js CHANGED
@@ -40,12 +40,19 @@ const SECTIONS = [
40
40
  { prefix: '/principles', text: 'Design', listPath: '/design', area: 'design' },
41
41
  { prefix: '/decisions', text: 'Design', listPath: '/design', area: 'design' },
42
42
  { prefix: '/screens', text: 'Screens', area: 'design' },
43
+ { prefix: '/components', text: 'Components', area: 'design' },
43
44
  { prefix: '/evaluation', text: 'Evaluation', area: 'evaluation' },
44
45
  { prefix: '/research', text: 'Research', area: 'evaluation' },
45
46
  { prefix: '/insights', text: 'Research', listPath: '/research', area: 'evaluation' },
46
47
  { prefix: '/graph', text: 'Relationship graph' },
47
48
  { prefix: '/trace', text: 'Trace tree' },
48
49
  { prefix: '/docs', text: 'Documentation' },
50
+ // Intended purpose, hazards and controls cut across the activities: the
51
+ // purpose is set while planning and hazards are found in every one of them.
52
+ { prefix: '/safety', text: 'Safety' },
53
+ { prefix: '/intended-purpose', text: 'Safety', listPath: '/safety' },
54
+ { prefix: '/hazards', text: 'Safety', listPath: '/safety' },
55
+ { prefix: '/controls', text: 'Safety', listPath: '/safety' },
49
56
  // The slice's own handover is a journey view like any other; it just does not
50
57
  // name its journey in the URL. Listing it under Journeys keeps it where the
51
58
  // navigation already puts it.
@@ -122,6 +129,7 @@ function navItems () {
122
129
  ...activities,
123
130
  { href: '/graph', text: 'Graph', match: ['/graph'], secondary: true },
124
131
  { href: '/trace', text: 'Trace', match: ['/trace'], secondary: true },
132
+ { href: '/safety', text: 'Safety', match: ['/safety', '/intended-purpose', '/hazards', '/controls'], secondary: true },
125
133
  { href: '/docs', text: 'Docs', match: ['/docs'], secondary: true }
126
134
  ]
127
135
  }
@@ -25,6 +25,10 @@ const COLLECTION_FILES = {
25
25
  qualityObjectives: 'quality-objectives.json',
26
26
  requirements: 'requirements.json',
27
27
  principles: 'principles.json',
28
+ components: 'components.json',
29
+ intendedPurposes: 'intended-purposes.json',
30
+ hazards: 'hazards.json',
31
+ controls: 'controls.json',
28
32
  relationships: 'relationships.json'
29
33
  }
30
34