authoring-cli 0.1.24 → 0.1.26

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "authoring-cli",
3
- "version": "0.1.24",
3
+ "version": "0.1.26",
4
4
  "description": "CLI for SNOMED CT authoring against authoring-services",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -46,6 +46,21 @@ committing to a sequence of edits. If nothing is selected and no flags are passe
46
46
  rather than guessing. `authoring-cli projects` and `authoring-cli tasks` list what's available to
47
47
  pick from; a session with no valid cookie needs `authoring-cli login [production|uat|dev]` first.
48
48
 
49
+ **Every mutating command (concept/description/relationship/axiom create/update/delete and
50
+ `classify`) checks that the signed-in user is the task's Author — its assignee — before doing
51
+ anything, and refuses outright otherwise.** `select-task`/`--project`/`--task` let you *target*
52
+ any task by key, including one assigned to someone else; that targeting always succeeds (so
53
+ `current-task`, `get-concept`, `search-concepts`, `review-concepts`, and every other read-only
54
+ command work regardless of who the task is assigned to), but the first mutating call against it
55
+ fails with a clear HTTP 403 naming both the actual assignee and your own signed-in username.
56
+ There's no reassign-task command in this CLI — either have the Task Author make the change, or
57
+ reassign the task to yourself first (Authoring Workbench, or authoring-services directly).
58
+ `review-concepts` is worth calling out by name here: it used to also classify the branch and run
59
+ `transform-axiom` as part of building its review packet, which made it a mutating command subject
60
+ to this same restriction; it's purely read-only now (see "Reviewing concepts against SNOMED CT
61
+ terminology standards" below) specifically so a reviewer who isn't the task's assignee can still
62
+ use it.
63
+
49
64
  **A stale session can fail in a way that looks exactly like a server outage.** Symptoms: `get-concept`
50
65
  (and everything else) suddenly returns `"Could not resolve branch path for <project>/<task>"` on a
51
66
  branch that worked moments before, while `authoring-cli projects` and `authoring-cli tasks --project
@@ -644,21 +659,21 @@ see it, `classify --wait` the task first, then retry. If the axiom already match
644
659
  `transform-axiom` checks that before writing anything and reports `alreadyConformed: true` rather
645
660
  than reaching Snowstorm at all — avoiding a pointless rewrite-to-identical-content PUT.
646
661
 
647
- **`validate-concept`/`validate-review-concepts` deliberately don't run this check.** They're meant
648
- to be a quick, synchronous, single-concept (or per-concept-in-a-loop) check, and authoring-form
649
- resolution has a hard prerequisite this check doesn't otherwise have: the concept must already be
650
- classified. Folding it in there would mean every validate call pays for a classification job it
651
- didn't ask for. Instead, **`review-concepts` fixes it automatically** for the whole review batch:
652
- it classifies the task once, then runs `transform-axiom` on every concept in the batch — relying on
653
- `transform-axiom`'s own `alreadyConformed: true` no-op rather than checking first and only writing
654
- to the ones that need it, since that check is exactly what `transform-axiom` computes internally
655
- anyway — alongside the (axiom-free) editorial check `validate-review-concepts` also runs — see
656
- "Reviewing concepts against SNOMED CT terminology standards" below. You don't need to run anything
657
- yourself to notice or fix this on a concept `review-concepts` already covers; the commands below are
658
- for checking outside a full review pass. Concepts `review-concepts`'s pass can't determine authoring
659
- form for (an ambiguous multi-axiom concept, or one that stayed unclassifiable even after the
660
- classify step) land in its `axiomsSkipped` bucket — same "can't-tell, not conforming" distinction as
661
- the `skippedConcepts` bucket below.
662
+ **Neither `validate-concept`/`validate-review-concepts` nor `review-concepts` runs this check for
663
+ you.** `validate-concept`/`validate-review-concepts` are meant to be a quick, synchronous,
664
+ single-concept (or per-concept-in-a-loop) check, and authoring-form resolution has a hard
665
+ prerequisite this check doesn't otherwise have: the concept must already be classified. Folding it
666
+ in there would mean every validate call pays for a classification job it didn't ask for.
667
+ `review-concepts` is purely read-only (see "Reviewing concepts against SNOMED CT terminology
668
+ standards" below) and no longer classifies or transforms anything either — it used to, but that
669
+ made it a mutating command, blocked for anyone but the task's own assignee (see the role-based
670
+ authoring note near the top of this file), which defeats its real purpose as a review tool anyone
671
+ can run. **So this is on you to run explicitly** as part of finishing your own authoring work,
672
+ before reviewing: `classify --wait` the task once, then run `transform-axiom --id <id>` over every
673
+ concept you touched (or a broader candidate list — see below). `transform-axiom` itself reports
674
+ `alreadyConformed: true` without writing anything for a concept that already matches, so looping it
675
+ over the whole batch unconditionally (rather than checking first) costs nothing extra on the
676
+ concepts that didn't need it.
662
677
 
663
678
  **Finding candidates across a batch**: `search-concepts` takes a `--check-stated-parents-definition-status`
664
679
  filter — it runs the ordinary search to define scope, then checks every result's stated Is-a
@@ -678,12 +693,14 @@ attribute the inferred view has (in practice, the more common failure mode — a
678
693
  attributes at all, still non-conforming because the inferred Laterality/whatever attribute was never
679
694
  added). Those concepts simply won't appear in this filter's results; there is no `--conformed`
680
695
  toggle, because "stated parents are primitive" is not the same claim as "conforms" and this command
681
- never asserts the stronger one. Run `transform-axiom` on a broader candidate list (e.g. from
682
- `review-concepts`, which does run the complete check) if you need that case caught too.
696
+ never asserts the stronger one. Run `transform-axiom` on a broader candidate list (e.g. every
697
+ concept in `get-concepts-for-review`'s/`review-concepts`'s own `concepts` array — `transform-axiom`
698
+ itself runs the complete check, this filter is only a cheap, classify-free way to narrow the list
699
+ first) if you need that case caught too.
683
700
 
684
701
  Runs with up to 8 concepts in flight at once rather than one at a time — each check is just one
685
702
  cheap concept fetch, so this is purely about not serializing network round trips on a broad ECL, not
686
- about the expensive-endpoint concurrency `transform-axiom`/`review-concepts` don't need here at all.
703
+ about the expensive-endpoint concurrency `transform-axiom` doesn't need here at all.
687
704
  Concepts that can't even be checked for this — an ambiguous multi-axiom concept, or a fetch failure
688
705
  — are reported separately under `skippedConcepts`.
689
706
 
@@ -760,24 +777,53 @@ authoring-cli add-property-axiom --property-id 127489000 \
760
777
  --project <projectKey> --task <taskKey>
761
778
  ```
762
779
 
763
- Two things this command does *not* do, unlike every other axiom-mutating command in this skill:
780
+ **Get the expression right before running this — a malformed one is a materially bigger risk here
781
+ than a normal failed write.** Confirmed live: sending a garbage expression
782
+ (`"ThisIsNotValidOwlSyntax((("`) got the expected failure back, but it also left the *entire task
783
+ branch permanently locked* — still locked hours later, blocking every subsequent write to that
784
+ branch, not just another property-axiom call. Worse, there is no self-service fix: the branch-unlock
785
+ action is admin-only, and a normal author/project-lead account gets refused outright trying it. If
786
+ this happens to you, the task is effectively stuck until a Snowstorm admin intervenes — treat it as
787
+ a reason to double- and triple-check the expression text, not as "I'll just retry." The command
788
+ itself now refuses obviously-broken input before ever sending it (unbalanced parentheses, or text
789
+ that doesn't start with a recognized OWL keyword like `SubObjectPropertyOf`/`TransitiveObjectProperty`/
790
+ etc.) — but this is a shallow syntax sanity check, not a real OWL parser, so a wrong-but-plausible
791
+ expression (right keyword, wrong structure) can still get through and, in principle, still cause this.
792
+ When the command does fail with an HTTP 500 (meaning the expression reached Snowstorm and its parser
793
+ rejected it), it prints a warning about this risk — don't dismiss that warning as boilerplate; follow
794
+ its advice and check with a plain read before assuming the branch is still usable.
795
+
796
+ Two other things this command does *not* do, unlike every other axiom-mutating command in this skill:
764
797
 
765
798
  - **No structured validation output.** `POST /{branch}/members` (the endpoint this goes through)
766
- has no `?validate=true` equivalent, so there's no `validationResults` to check. That doesn't mean
767
- anything goes, though — confirmed live, Snowstorm still parses the OWL expression on this write and
768
- rejects syntactically invalid input immediately, just as an unstructured HTTP 500 carrying the raw
769
- OWL-parser error text (`Encountered "..." ... Was expecting one of: ... SubObjectPropertyOf ...`)
770
- rather than every other command's clean 400 + validationResults. What it will *not* catch is a
771
- syntactically valid but semantically wrong expression (wrong property id, a class-axiom shape
772
- pointed at a property concept, etc.) — that's accepted and stored, and would only surface later,
773
- e.g. as a classification failure. Run `get-property-axioms` afterwards to confirm the new member
774
- looks right, since there's no save-time validation summary to read instead.
799
+ has no `?validate=true` equivalent, so there's no `validationResults` to check. A syntactically
800
+ invalid expression that gets past the shallow client-side check is still rejected by Snowstorm's own
801
+ parser (see above), just as an unstructured HTTP 500 rather than every other command's clean 400 +
802
+ validationResults. What it will *not* catch is a syntactically valid but semantically wrong
803
+ expression (wrong property id, a class-axiom shape pointed at a property concept, etc.) — that's
804
+ accepted and stored, and would only surface later, e.g. as a classification failure. Run
805
+ `get-property-axioms` afterwards to confirm the new member looks right, since there's no save-time
806
+ validation summary to read instead.
775
807
  - **No `axiomId` to use afterwards.** The response's `memberId` (a server-assigned UUID, also the
776
- `memberId` `get-property-axioms` reports) is the closest equivalent, but there is currently no
777
- `update-property-axiom`/`delete-property-axiom` command — this skill covers creation and retrieval
778
- only. Changing or removing a property axiom once added needs a direct reference-set-member call
779
- outside the CLI (`PUT`/`DELETE /{branch}/members/{uuid}`) or the Authoring Workbench's own OWL
780
- axiom editor.
808
+ `memberId` `get-property-axioms` reports) is what `delete-property-axiom` (below) takes instead.
809
+
810
+ **Removing one: `delete-property-axiom`.** Only for a member that's never been released — Snowstorm
811
+ itself enforces this server-side, no client-side pre-check needed:
812
+
813
+ ```
814
+ authoring-cli delete-property-axiom --id 127489000 --member-id <memberId>
815
+ ```
816
+
817
+ Both `--id` (the property concept) and `--member-id` (from `get-property-axioms`'s output) are
818
+ required, and must actually match each other — the command refuses if `--member-id` turns out to
819
+ belong to a different concept, to guard a copy-paste mistake across two `get-property-axioms` calls.
820
+ Deleting a member that's already been released fails with a clean `HTTP 400` naming the member and
821
+ branch (not `409`, unlike `delete-axiom`/`delete-concept`'s refusal for the same situation — a
822
+ Snowstorm quirk specific to this endpoint, not a CLI inconsistency); there's no `--force` override,
823
+ since RF2 has no "delete a released component" operation. A released property axiom can only be
824
+ retired by editing its `owlExpression` directly via `PUT /{branch}/members/{uuid}` outside the CLI,
825
+ or the Authoring Workbench's own OWL axiom editor — there is no `update-property-axiom`/
826
+ `inactivate-property-axiom` command.
781
827
 
782
828
  ## Redundant stated Is-a relationships
783
829
 
@@ -1130,10 +1176,11 @@ job, like `classify`); `validate-concept` is a synchronous, read-only check of a
1130
1176
  description constraints, etc.), but it does *not* catch content errors that save cleanly — duplicate
1131
1177
  semantic tags in FSNs, inappropriate synonyms, synonym conflation, or other modeling mistakes — nor
1132
1178
  does it check class-axiom authoring-form conformance (see "Collapsing an axiom to the standard
1133
- authoring form" above for why that moved out). Those require editorial review, or the axiom-specific
1134
- fix. Always follow `validate-review-concepts` with `review-concepts` to check for these issues before
1135
- promoting a task. See "Common authoring mistakes to avoid" above and the full
1136
- `references/review-concepts.md` checklist for what to watch for.
1179
+ authoring form" above for the `classify --wait` + `transform-axiom` sequence that fixes it — nothing
1180
+ runs it for you automatically). Those require editorial review, or the axiom-specific fix. Always
1181
+ follow `validate-review-concepts` with the authoring-form fix and then `review-concepts` to check
1182
+ for these issues before promoting a task. See "Common authoring mistakes to avoid" above and the
1183
+ full `references/review-concepts.md` checklist for what to watch for.
1137
1184
 
1138
1185
  ## Reviewing concepts against SNOMED CT terminology standards
1139
1186
 
@@ -1141,23 +1188,27 @@ promoting a task. See "Common authoring mistakes to avoid" above and the full
1141
1188
  authoring-cli review-concepts
1142
1189
  ```
1143
1190
 
1144
- This is the end-of-task review pipeline, not a pure data-gathering step: it classifies the task,
1145
- then runs `transform-axiom` on every concept with pending stated changes whose class axiom doesn't
1146
- already match the standard authoring form, then fetches each concept's final representation —
1147
- descriptions, relationships, axioms — so a transform that just ran shows up in its new,
1148
- post-transform shape rather than the stale pre-transform one. The response carries `classification`
1149
- (the classify outcome), each concept's `axiom` outcome (`conformed` | `transformed` | `skipped` |
1150
- `failed`), and the fetched `concept` itself.
1151
-
1152
- It deliberately does *not* also re-run Snowstorm's own convention check — every concept-mutating
1153
- command already requests that on its own save and reports whatever came back at edit time, so
1154
- re-checking it again here in batch would just repeat what editing already surfaced. Run
1155
- `validate-review-concepts` yourself if you specifically want that re-checked across the whole batch.
1156
-
1157
- Everything mechanically decidable is covered by that pipeline. What's left — is the naming correct,
1158
- is the semantic tag right, is the concept appropriately primitive or sufficiently defined, is the
1159
- modelling sound — is a judgment call against the SNOMED CT Editorial Guide, not something any
1160
- command can decide. See `references/review-concepts.md` for that checklist.
1191
+ This is purely read-only — a data-gathering step, not a pipeline that fixes anything: it fetches
1192
+ each concept's full current representation (descriptions, relationships, axioms) for every concept
1193
+ with pending stated changes on the task, the same list `get-concepts-for-review` returns, so an
1194
+ editorial review has everything it needs in one call without a manual `get-concept` loop. It does
1195
+ *not* classify the branch or run `transform-axiom` — see the role-based authoring note near the top
1196
+ of this file for why that changed — and it does *not* re-run Snowstorm's own convention check
1197
+ either: every concept-mutating command already requests that on its own save and reports whatever
1198
+ came back at edit time, so re-checking it again here in batch would just repeat what editing
1199
+ already surfaced. Run `validate-review-concepts` yourself if you want that re-checked across the
1200
+ whole batch.
1201
+
1202
+ **Axiom-authoring-form conformance is consequently on you to fix *before* running this**, if it
1203
+ matters for your review (typically: you're the task author finishing your own work). See
1204
+ "Collapsing an axiom to the standard authoring form" above for the `classify --wait` +
1205
+ `transform-axiom` sequence — do that first, then run `review-concepts`, so what you read back
1206
+ already reflects any transform rather than the stale pre-transform shape.
1207
+
1208
+ Everything else mechanically decidable (axiom conformance, aside) still needs a judgment call: is
1209
+ the naming correct, is the semantic tag right, is the concept appropriately primitive or
1210
+ sufficiently defined, is the modelling sound — against the SNOMED CT Editorial Guide, not something
1211
+ any command can decide. See `references/review-concepts.md` for that checklist.
1161
1212
 
1162
1213
  ## Large multi-session batches
1163
1214
 
@@ -1,20 +1,21 @@
1
1
  # Reviewing concepts against SNOMED CT terminology standards
2
2
 
3
- `authoring-cli review-concepts` runs the end-of-task review pipeline for every concept with pending
4
- stated changes on the task: it classifies the branch, transforms any class axiom that doesn't
5
- already match the standard authoring form, and fetches each concept's final representation —
6
- descriptions, relationships, axioms — reflecting any transform just applied. It does not re-run
7
- Snowstorm's own convention check (MRCM cardinality, description constraints, and the like) — every
8
- concept-mutating command already requests that on its own save and reports whatever came back at
9
- edit time, so re-checking it again here in batch would just repeat what editing already surfaced;
10
- run `validate-review-concepts` yourself if you want it re-checked on demand. Authoring-form
11
- conformance is the one piece that's mechanically decidable and worth fixing automatically here (it
12
- has a hard classify-first prerequisite a per-edit check can't afford to wait on); this file is the
13
- judgment that's left after that: a checklist for whether the content is *right*, not whether it
14
- saves. A concept can be perfectly well-formed by Snowstorm's own rules and still be wrong SNOMED CT
15
- content — a bad FSN, an inappropriate semantic tag, an under-modelled definition, a primitive
16
- concept that should be sufficiently defined — because none of that is a save-time constraint
17
- Snowstorm enforces. It's an editorial judgment call, which is what this checklist is for.
3
+ `authoring-cli review-concepts` is a read-only data-gathering step, not a pipeline that fixes
4
+ anything: it fetches each concept's full current representation — descriptions, relationships,
5
+ axioms — for every concept with pending stated changes on the task, so an editorial review has
6
+ everything it needs in one call without a manual `get-concept` loop. It does not classify the
7
+ branch or run `transform-axiom` for you (see SKILL.md's "Collapsing an axiom to the standard
8
+ authoring form" for that — run it yourself first, before this, if axiom-authoring-form conformance
9
+ matters for your review), and it does not re-run Snowstorm's own convention check either (MRCM
10
+ cardinality, description constraints, and the like) — every concept-mutating command already
11
+ requests that on its own save and reports whatever came back at edit time, so re-checking it again
12
+ here in batch would just repeat what editing already surfaced; run `validate-review-concepts`
13
+ yourself if you want it re-checked on demand. This file is the judgment that's left after both of
14
+ those: a checklist for whether the content is *right*, not whether it saves. A concept can be
15
+ perfectly well-formed by Snowstorm's own rules and still be wrong SNOMED CT content — a bad FSN, an
16
+ inappropriate semantic tag, an under-modelled definition, a primitive concept that should be
17
+ sufficiently defined — because none of that is a save-time constraint Snowstorm enforces. It's an
18
+ editorial judgment call, which is what this checklist is for.
18
19
 
19
20
  Read each concept's real, current descriptions and axioms from `review-concepts`'s output — not a
20
21
  note from earlier in the session; a concept can have changed since you last looked at it.
@@ -108,16 +109,19 @@ Read the axiom from `get-concept --axioms`, not a cached summary, and check:
108
109
  - **The axiom should already be in authoring form** — Is-a the proximal primitive parent(s) plus
109
110
  every currently-inferred attribute, not a more specific stated parent the classifier could
110
111
  re-derive on its own. Unlike the judgment calls elsewhere in this checklist, this one is
111
- mechanically checkable rather than a call to weigh, and `review-concepts` already fixes it for
112
- you — it classifies the branch and runs `transform-axiom` on every non-conforming concept in the
113
- batch before you ever see this checklist, so nothing here needs a second pass. Its output's
114
- `axiom` field per concept tells you the outcome: `conformed` (already fine), `transformed` (just
115
- rewritten — read the concept's fresh axiom, not a stale note from before this run), `skipped`
116
- (couldn't be determined — an ambiguous multi-axiom concept, or one that stayed unclassifiable even
117
- after the classify step; run `transform-axiom --id <id>` by hand to see the same error it hit —
118
- pass `--axiom-id` if it names more than one active class axiom), or `failed` (the transform itself
119
- errored — read the accompanying error and fix by hand with `transform-axiom`).
120
- See `SKILL.md`'s "Collapsing an axiom to the standard authoring form" for what the transform does.
112
+ mechanically checkable rather than a call to weigh — but nothing fixes it for you automatically
113
+ anymore: `review-concepts` is read-only, so this needs its own pass *before* you run it, not
114
+ after. Classify the task once (`classify --wait`), then run `transform-axiom --id <id>` over
115
+ every concept in your batch (it reports `alreadyConformed: true` without writing anything for one
116
+ that already matches, so looping it over the whole batch unconditionally costs nothing extra on
117
+ the concepts that didn't need it — no need to check first). Pass `--axiom-id` if a concept has
118
+ more than one active class axiom. A concept `transform-axiom` can't determine conformance for
119
+ (ambiguous multi-axiom, or one that stayed unclassifiable even after `classify --wait`) still
120
+ needs a by-hand look at the error it reports. Do this fix pass before re-running
121
+ `review-concepts`, so what you read back for this checklist already reflects the transform rather
122
+ than the stale pre-transform axiom. See `SKILL.md`'s "Collapsing an axiom to the standard
123
+ authoring form" for what the transform does and how to find a candidate list beyond "everything I
124
+ just edited" (`search-concepts`/`get-concepts-for-review --check-stated-parents-definition-status`).
121
125
  - **MRCM domain/range conformance isn't fully visible from `get-concept` or `validate-concept`.**
122
126
  Both surface Snowstorm's save-time checks, which catch cardinality and some domain/range
123
127
  violations, but not every MRCM constraint is enforced synchronously at save. If an attribute's
@@ -256,5 +260,6 @@ edit's own save, and `validate-review-concepts` re-checks it in batch on demand
256
260
  Almost nothing here can be delegated to a CLI flag: the whole point of this pass is judging whether
257
261
  content is *right*, not whether it saves, which is exactly the kind of residue no command can
258
262
  absorb. Authoring-form conformance is the one exception — it has a single correct shape, not a
259
- range of defensible ones, which is exactly why `review-concepts` fixes it outright instead of just
260
- flagging it; everything else above still needs a human or agent's editorial read.
263
+ range of defensible ones, which is exactly why it's mechanically fixable (`classify --wait` +
264
+ `transform-axiom`, run by hand — see "The axiom should already be in authoring form" above) rather
265
+ than a judgment call; everything else above still needs a human or agent's editorial read.