authoring-cli 0.1.9 → 0.1.11

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.9",
3
+ "version": "0.1.11",
4
4
  "description": "CLI for SNOMED CT authoring against authoring-services",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -43,6 +43,34 @@ committing to a sequence of edits. If nothing is selected and no flags are passe
43
43
  rather than guessing. `authoring-cli projects` and `authoring-cli tasks` list what's available to
44
44
  pick from; a session with no valid cookie needs `authoring-cli login [production|uat|dev]` first.
45
45
 
46
+ **A stale session can fail in a way that looks exactly like a server outage.** Symptoms: `get-concept`
47
+ (and everything else) suddenly returns `"Could not resolve branch path for <project>/<task>"` on a
48
+ branch that worked moments before, while `authoring-cli projects` and `authoring-cli tasks --project
49
+ <P> --summary` both come back empty (`"No projects available"` / `"No tasks in project <P>"`).
50
+ Retrying doesn't help — it isn't a transient blip, the session token expired mid-session. Fix:
51
+ `authoring-cli login uat` (or the relevant environment) reuses an already-signed-in Chrome session
52
+ with no browser popup if you're still logged in there. Confirm the branch/server is actually fine
53
+ with one plain `get-concept` call before concluding a real outage — the fix here takes seconds.
54
+
55
+ ## Concurrency: one mutating caller per task branch, at a time
56
+
57
+ Never run more than one mutating call against the same task branch concurrently, and never
58
+ delegate a batch of mutating calls to a subagent working the same branch alongside you. Even a
59
+ single sequential caller can trigger `branch locked, retrying` from the server's own internal
60
+ locking — true concurrent callers (parallel tool calls, an `xargs -P`-style fan-out, a subagent
61
+ mutating the same branch while you also are) compound this and have exhausted their retry budget
62
+ and failed outright with HTTP 400, silently leaving whatever they were doing half-finished despite
63
+ the command appearing to run to completion. This is a property of the branch lock, not of any one
64
+ command — confirmed for `set-definition-status` under `xargs -P 8`, but the same risk applies to
65
+ `create-concept`/`add-relationship`/`replace-fsn`/`add-description`/etc. equally. Reserve
66
+ parallelism for **read-only** calls (a `get-concept` sweep, independent `search-concepts` lookups)
67
+ — queue every mutating call against a given task branch sequentially, one at a time, whether
68
+ you're driving the sequence yourself or via a background loop. After any batch that hit retries or
69
+ ran under uncertain conditions, re-verify the whole target set with fresh `get-concept` calls
70
+ rather than trusting the batch run's exit status alone. See `references/batch-authoring.md`'s
71
+ "Driving a batch of mutating calls" for the fuller reasoning, including why a subagent's
72
+ self-reported summary isn't ground truth either.
73
+
46
74
  The `--project`/`--task` flags are shown on the examples below for explicitness. When a task is
47
75
  already selected via `select-task`, you can omit them everywhere.
48
76
 
@@ -175,6 +203,10 @@ you catch them during review or read the concept back afterward. Watch for these
175
203
  - **Missing or wrong semantic tag**: every FSN must end with a semantic tag; verify it matches the
176
204
  concept's actual domain. A body-structure concept should end with `(body structure)`, a finding
177
205
  with `(finding)`, etc.
206
+ - **A semantic tag on the PT or a synonym.** Only the FSN ever carries one. A PT/synonym built by
207
+ reusing the same tagged string passed to `--fsn` looks like `"Structure of X (body structure)"`
208
+ where it should just be `"Structure of X"` — check `get-concept --description-full`'s PT/synonym
209
+ terms whenever you passed the same source string to both `--fsn` and `--pt`.
178
210
 
179
211
  **Synonym specificity and meaning:**
180
212
  - **Inappropriate synonyms that shift the concept's meaning**: a synonym must name the same clinical
@@ -191,6 +223,15 @@ Run `review-concepts` before promoting a task to check these mistakes aren't hid
191
223
  pending changes — they save cleanly but are real content errors, not save-time constraint
192
224
  violations.
193
225
 
226
+ **`search-concepts` and `get-concept` put the FSN at different JSON paths — using the wrong one
227
+ silently reads as "no results," not an error.** `get-concept` nests it as `.fsn.term` (an object).
228
+ `search-concepts` returns it flat as `.items[].fsn` (a plain string). Applying `.fsn.term` to a
229
+ `search-concepts` result throws a jq parse error that's easy to let scroll past as "no match" —
230
+ this has produced strings of false negatives across a dozen-plus consecutive existence checks in
231
+ practice, nearly causing duplicate mints of concepts that already existed. Before trusting any
232
+ empty or erroring existence check built on `search-concepts` output, confirm the field path against
233
+ one real response rather than assuming the shape that works for `get-concept`.
234
+
194
235
  ## Ground truth vs. echoed validation results
195
236
 
196
237
  Every concept-mutating command (`create-concept`, `add-description`, `set-acceptability`, ...)
@@ -200,10 +241,12 @@ alongside the outcome. `validate-concept` runs the same check read-only, without
200
241
  Both of these can lag behind a write that just landed on the *same* concept moments earlier —
201
242
  they've been observed printing a warning describing the pre-fix state for several seconds to tens
202
243
  of seconds after the fix was actually saved. Don't take a validation warning that doesn't match
203
- what you expect at face value: re-fetch with `get-concept` and compare its `acceptabilityMap`
204
- values directly. `get-concept`'s response is the one thing that reflects exactly what's persisted
205
- right now. If the warning still contradicts a fresh `get-concept`, then something is actually
206
- wrong; if it matches an old state, it's just this lag and will clear on its own.
244
+ what you expect at face value: re-fetch with `get-concept --description-full` and compare its
245
+ `acceptabilityMap` values directly (plain `get-concept` with no flags returns a lightweight
246
+ FSN/PT/active summary only — no descriptions array). That response is the one thing that reflects
247
+ exactly what's persisted right now. If the warning still contradicts a fresh
248
+ `get-concept --description-full`, then something is actually wrong; if it matches an old state,
249
+ it's just this lag and will clear on its own.
207
250
 
208
251
  ## The hard constraint you must design around
209
252
 
@@ -319,7 +362,9 @@ authoring-cli create-concept --fsn "Edema of digit of hand" --parent 102564009 -
319
362
  # → Created concept <SCTID>
320
363
 
321
364
  # 2. Fetch it to read the server-assigned descriptionId of the PT/synonym just created.
322
- authoring-cli get-concept --id <SCTID> --project <projectKey> --task <taskKey>
365
+ # (--description-full, not a plain get-concept — descriptionId/acceptabilityMap live in the
366
+ # descriptions array, which the flagless default no longer returns.)
367
+ authoring-cli get-concept --id <SCTID> --description-full --project <projectKey> --task <taskKey>
323
368
  # → descriptionId <edemaId>, acceptabilityMap {us: PREFERRED, gb: PREFERRED}
324
369
 
325
370
  # 3. Add the other spelling as a new synonym. --acceptability applies ONE value uniformly to both
@@ -330,7 +375,7 @@ authoring-cli add-description --id <SCTID> --term "Oedema of digit of hand" --ty
330
375
  --acceptability ACCEPTABLE --project <projectKey> --task <taskKey>
331
376
 
332
377
  # 4. Fetch again for the new synonym's descriptionId.
333
- authoring-cli get-concept --id <SCTID> --project <projectKey> --task <taskKey>
378
+ authoring-cli get-concept --id <SCTID> --description-full --project <projectKey> --task <taskKey>
334
379
  # → descriptionId <oedemaId>, acceptabilityMap {us: ACCEPTABLE, gb: ACCEPTABLE}
335
380
 
336
381
  # 5. One atomic save: move "preferred in en-gb" from the US spelling to the GB spelling, AND strip
@@ -347,9 +392,9 @@ authoring-cli validate-concept --id <SCTID> --project <projectKey> --task <taskK
347
392
  # → No validation issues for concept <SCTID>.
348
393
  ```
349
394
 
350
- If step 6 still shows a spelling-variant warning, re-run `get-concept` and compare its
351
- `acceptabilityMap` against the table above before assuming the fix didn't take — see "Ground truth
352
- vs. echoed validation results" above.
395
+ If step 6 still shows a spelling-variant warning, re-run `get-concept --description-full` and
396
+ compare its `acceptabilityMap` against the table above before assuming the fix didn't take — see
397
+ "Ground truth vs. echoed validation results" above.
353
398
 
354
399
  ## Editing relationships and axioms
355
400
 
@@ -370,7 +415,8 @@ authoring-cli update-axiom --id <SCTID> --axiom-id <axiomId> --relationships \
370
415
  {"active":true,"groupId":2,"type":{"conceptId":"42752001"},"target":{"conceptId":"..."}}]'
371
416
  ```
372
417
 
373
- (Get `axiomId` from `get-concept` right after creating the concept.) Single-group concepts — the
418
+ (Get `axiomId` from `get-concept --axioms` right after creating the concept — plain `get-concept`
419
+ with no flags no longer includes classAxioms.) Single-group concepts — the
374
420
  common case — are unaffected; plain `add-relationship` is fine and simpler there.
375
421
 
376
422
  ### Removing a relationship — including from a published axiom
@@ -393,7 +439,7 @@ the whole story for editing an axiom that's already been released:
393
439
 
394
440
  So: **removing one relationship from a published axiom is `remove-relationship`, not
395
441
  `update-axiom`.** Get the target's `relationshipId` (or its array index within that axiom) from
396
- `get-concept`, then:
442
+ `get-concept --axioms`, then:
397
443
 
398
444
  ```
399
445
  authoring-cli remove-relationship --id <SCTID> --axiom-id <axiomId> --relationship-id <relationshipId>
@@ -427,7 +473,7 @@ thing that names it consistently.
427
473
  site = X — occurs in only one role group of the axiom, that single pair is enough: the whole group
428
474
  it belongs to is removed, including any other relationships in it you didn't mention (e.g. an
429
475
  Associated morphology in the same group). You don't need to look up and list every relationship in
430
- the group first. Get candidate pairs from `get-concept`'s `classAxioms[N].relationships[]` (each
476
+ the group first. Get candidate pairs from `get-concept --axioms`'s `classAxioms[N].relationships[]` (each
431
477
  entry's `type.conceptId`/`target.conceptId`, grouped by `groupId` just to see what's likely unique).
432
478
 
433
479
  If the given pair(s) match **more than one** role group in the axiom, the call fails with HTTP 409
@@ -475,11 +521,12 @@ stores `SubClassOf(ObjectIntersectionOf(:64572001 <group 1>) :<SCTID>)` — i.e.
475
521
  with an *Infectious process* is a `<SCTID>`", not "`<SCTID>` is a disease with an infectious
476
522
  process". Get the direction backwards and nothing complains: the axiom saves, validates, and only
477
523
  misbehaves at classification, where it drags unrelated concepts underneath your concept. Read the
478
- axiom back with `get-concept` and check your concept is the one on the right of the `SubClassOf`.
524
+ axiom back with `get-concept --gci` and check your concept is the one on the right of the `SubClassOf`.
479
525
 
480
- **Checking whether a concept already has GCI axioms, before adding another:** a plain `get-concept
481
- --id <SCTID>` already answers this — a non-zero `gciAxioms.length` on that response means the
482
- concept has at least one, no filter needed. To check whether a *specific* attribute type is already
526
+ **Checking whether a concept already has GCI axioms, before adding another:** `get-concept
527
+ --gci-axioms-count --id <SCTID>` already answers this — a non-zero `gciAxiomsCount` on that response
528
+ means the concept has at least one active GCI axiom, no `--attribute-type` filter needed and no need
529
+ to pull the axioms' actual content. To check whether a *specific* attribute type is already
483
530
  asserted inside an existing GCI — e.g. before adding a GCI whose antecedent would duplicate one
484
531
  already there — add `--gci` to `get-concept`'s `--attribute-type` filter (see the substitution
485
532
  pattern below for the flag's base behavior): `get-concept --id <SCTID> --attribute-type <typeId>
@@ -541,8 +588,8 @@ within the same task.
541
588
  The new axiom's `definitionStatus` defaults to `PRIMITIVE` regardless of what the axiom being
542
589
  replaced was. If the axiom you're retiring was the concept's `FULLY_DEFINED` one and the new axiom
543
590
  should take over that role, follow up with `set-definition-status --status FULLY_DEFINED
544
- --axiom-index <N>` (index into `classAxioms` from a fresh `get-concept` — `add-axiom`'s own output
545
- reports the server-assigned `axiomId` for the one you just added).
591
+ --axiom-index <N>` (index into `classAxioms` from a fresh `get-concept --axioms` — `add-axiom`'s own
592
+ output reports the server-assigned `axiomId` for the one you just added).
546
593
 
547
594
  ### Collapsing an axiom to the standard authoring form
548
595
 
@@ -633,7 +680,7 @@ additional parent — commonly triggers: `Concept should not contain any redunda
633
680
  relationships`, because the old, broader parent is now a direct or indirect ancestor of the new,
634
681
  more specific one. Resolve it immediately rather than leaving it as residue:
635
682
 
636
- 1. `get-concept` and find the redundant `Is a` entry inside `classAxioms[0].relationships[]` (the
683
+ 1. `get-concept --axioms` and find the redundant `Is a` entry inside `classAxioms[0].relationships[]` (the
637
684
  warning names both the redundant parent and the more-specific one making it redundant — it's
638
685
  the `groupId: 0` `Is a` relationship whose `target` is the broader, redundant parent). Note its
639
686
  array index and the axiom's `axiomId`.
@@ -685,9 +732,9 @@ axioms as authored — which is what catches a same-session edit (a new relation
685
732
  `Is a`) before classification has run, exactly the situation right after authoring. Neither view
686
733
  alone is a complete answer on a branch with pending, unclassified changes; the inferred view misses
687
734
  what you just stated, and the stated view misses anything the terminology already carries only
688
- through inference. `--limit`/`--offset` page through `referencesByType[].referencingConcepts` on a
689
- heavily-referenced concept — check `total` against what came back, the same caution as any other
690
- paginated search here.
735
+ through inference. Without `--limit`/`--offset`, the command itself pages through and returns every
736
+ referencing concept on a heavily-referenced concept — pass `--limit`/`--offset` only if you want to
737
+ page through `referencesByType[].referencingConcepts` yourself instead.
691
738
 
692
739
  ### 2. Deal with every reference before deleting anything
693
740
 
@@ -831,9 +878,14 @@ axiom's content rather than just retiring it.
831
878
  A common authoring task, especially at scale: mint a new concept whose defining axiom is identical
832
879
  to an existing source concept's except for one substituted attribute value — a different
833
880
  anatomical site, laterality, substance, or similar. (For a worked example of this pattern applied
834
- across a large source list, see `references/batch-authoring.md`.)
835
-
836
- 1. Fetch the source's **real** defining axiom via `get-concept` — not a rendering or a note from an
881
+ across a large source list, see `references/batch-authoring.md`.) When the substituted value is
882
+ itself a body-structure anatomy concept, see `references/anatomy-authoring.md` for the
883
+ SNOMED CT-wide patterns this kind of work runs into: the `Structure of X`/`Entire X` pairing
884
+ convention, the laterality exception to it (and the `FULLY_DEFINED` shape a laterality-only axiom
885
+ needs), and the decomposition procedure for finding a concept's other generalization axes beyond
886
+ whichever one prompted the substitution.
887
+
888
+ 1. Fetch the source's **real** defining axiom via `get-concept --axioms` — not a rendering or a note from an
837
889
  earlier session; it may have changed. Identify exactly which relationship(s) carry the attribute
838
890
  you're substituting (for a site swap: Finding site `363698007`, Procedure site `363704007`,
839
891
  Procedure site - Direct `405813007`, Procedure site - Indirect `405814001`) — `get-concept --id
@@ -909,8 +961,9 @@ and `Classification results accepted and saved.` is the normal outcome.
909
961
 
910
962
  Treat a save timeout as a real problem now rather than noise, but still confirm before acting on
911
963
  it — `classification-status` reports the job's current status directly, and a genuinely saved
912
- classification shows on an affected `FULLY_DEFINED` concept as a `get-concept` `relationships[]`
913
- entry with `typeId == "116680003"` and `characteristicType == "INFERRED_RELATIONSHIP"`.
964
+ classification shows on an affected `FULLY_DEFINED` concept as a `get-concept --inferred`
965
+ `relationships[]` entry with `typeId == "116680003"` (`characteristicType` is always
966
+ `INFERRED_RELATIONSHIP` under this flag, by construction).
914
967
 
915
968
  A `--wait` run logs each status transition and logs when a real STOMP push (rather than a poll
916
969
  tick) woke it, so a long wait is distinguishable from a hung one while it's still running. Silence
@@ -0,0 +1,131 @@
1
+ # Body-structure anatomy authoring patterns
2
+
3
+ General SNOMED CT body-structure modeling rules that recur across any anatomy content authoring project.
4
+
5
+ ## The `Structure of X` / `Entire X` pair
6
+
7
+ SNOMED CT routinely models a body-structure site as **two** concepts:
8
+
9
+ - `Structure of X (body structure)` — the general/partial-structure concept, used as the value of
10
+ a `Finding site`/`Procedure site` attribute elsewhere.
11
+ - `Entire X (body structure)` — Is-a `Structure of X` — representing the site as a whole
12
+ organ/part rather than "some of it".
13
+
14
+ This is not an occasional pattern; it recurs throughout SNOMED CT's body-structure hierarchy. The
15
+ naming isn't always a clean textual pair either — e.g. `Finger joint structure` pairs with
16
+ `Entire joint of finger`, not a mechanical word-order swap — so confirm a candidate pair via the
17
+ real stated parent (`get-concept`'s `classAxioms[].relationships`), never guess from FSN text
18
+ alone.
19
+
20
+ **Whenever you generalize, retarget, or otherwise touch one half of a pair, check the other
21
+ half.** Leaving one half unhandled produces an under-parented `Entire X` concept that falls back
22
+ to a generic ancestor instead of the specific `Structure of X` it should actually be a subtype of,
23
+ and silently strands the pair-mate's own work item even though it was directly relevant to work
24
+ already done. This check runs in **both directions** and needs both:
25
+ - From a `Structure of X` concept, an `Entire X` pair-mate (if one exists) is a **descendant** —
26
+ invisible to an ordinary ancestor/parent walk. Hypothesize the child's FSN and confirm via
27
+ `get-concept` that it actually states the `Structure of X` concept as a parent before treating
28
+ it as a real pair-mate.
29
+ - From an `Entire X` concept, its `Structure of X` pair-mate is among its own **stated parents** —
30
+ already visible from a `get-concept` on it, but `Entire X` concepts can carry 2-4 parents, so
31
+ check every one, not just the first plausible match.
32
+
33
+ **An `Entire X` concept's own parent should be another `Entire X` concept, not a `Structure of X`
34
+ concept, once you're one level up the hierarchy.** Getting this backwards silently produces
35
+ classifier-flagged equivalent concepts, with no save-time validation warning at all — confirmed
36
+ real case: an `Entire X` concept was stated Is-a a `Structure of X` concept (plus a qualifying
37
+ attribute) when it should have been Is-a the broader, already-existing `Entire X` ancestor plus
38
+ the same attribute. The only symptom is `classify`/`review-concepts` reporting
39
+ `equivalentConceptsFound: true` — the CLI has no command listing which concepts are actually
40
+ flagged as equivalent (only the Authoring Workbench UI shows the pair), so whenever that flag
41
+ appears, check every `Entire X` concept touched this session for a stated parent that isn't
42
+ itself `Entire X`-named before searching further; that's the pattern to check first.
43
+
44
+ ## Laterality is an exception to the pairing pattern, not a variant of it
45
+
46
+ **A laterality-specific `Structure of X` never gets its own laterality-specific `Entire X`.**
47
+ `Structure of X of left hand` / `Structure of X of right hand` does not pair with a minted
48
+ `Entire X of left hand` / `Entire X of right hand` — there is exactly one `Entire X`,
49
+ laterality-neutral, the same way there is exactly one `Structure of X`. Laterality is expressed
50
+ as a `Laterality` attribute value applied to the generic pair, not by duplicating the
51
+ whole-structure concept once per side. Skip the pairing check above entirely whenever the source
52
+ concept being processed is itself laterality-qualified (FSN mentions "of left/right X", or it
53
+ carries a stated `Laterality` relationship) — running the pair-mate search anyway either finds
54
+ nothing (correct, but for the wrong apparent reason) or, worse, surfaces the real generic-level
55
+ `Entire X` and risks it being wrongly treated as a duplicate-candidate for renaming.
56
+
57
+ **A laterality-only axiom is a `FULLY_DEFINED` shape, and `create-concept` will not set that for
58
+ you.** If a concept's stated axiom is exactly one Is-a (to a generic parent) plus one `Laterality`
59
+ relationship and nothing else, that combination is definitionally sufficient — SNOMED CT already
60
+ treats it as such. Confirmed against native, decades-old content: `85151006 |Structure of left
61
+ hand|` is `FULLY_DEFINED` off a stated axiom of Is-a `40983000 |Hand structure|` (itself
62
+ `PRIMITIVE`) + `Laterality` = `Left` — the *parent's* own primitiveness is irrelevant; what
63
+ matters is that Laterality is the *sole* distinguishing attribute added. `create-concept` has no
64
+ `--definition-status` flag at all — every newly minted concept starts `PRIMITIVE` regardless of
65
+ its axiom's actual shape, and nothing downstream flags a laterality-specific concept left that way
66
+ as wrong (it doesn't trip any Snowstorm convention check). If the axiom carries *any* other
67
+ relationship beyond the one Is-a and the one Laterality (an extra site, a morphology, a second
68
+ parent from the decomposition check below, etc.), do **not** set `FULLY_DEFINED` — verify the
69
+ exact shape with `get-concept --axioms` every time, then `set-definition-status --id <id> --status
70
+ FULLY_DEFINED`, and re-`get-concept` to confirm it actually changed. When fixing this across a
71
+ batch of concepts, see `SKILL.md`'s "Concurrency: one mutating caller per task branch, at a time"
72
+ — queue the calls sequentially rather than in parallel, and re-verify the whole target set
73
+ afterward with fresh `get-concept` calls rather than trusting the batch run's exit status.
74
+
75
+ ## Additional parents via decomposition — don't assume one axis is universal
76
+
77
+ A body-structure FSN is usually a composite of several semantic entities: a part/region word, a
78
+ tissue- or bone-class word, a containing structure, sometimes an articular/functional
79
+ relationship. Each entity is its own potential generalization axis, and each can have a real,
80
+ already-existing SNOMED CT concept that a concept being generalized or newly minted should also be
81
+ Is-a — beyond whatever single axis it was originally derived from.
82
+
83
+ **Evidence for any given axis has to come from the source's own real relationship history (active
84
+ *and* inactive) or from a genuine relationship between concepts already in the same batch — never
85
+ from analogy to a sibling that happened to have the axis.** A real, confirmed mistake: a
86
+ tissue-type parent (e.g. "soft tissue") was applied uniformly across several concept families in
87
+ one batch because it was correct for two of them — but wrong for others in the same batch that
88
+ had no such relationship at any point in their history (a vein family, correctly classified under
89
+ the vascular hierarchy instead) or that reached the same target only *transitively*, through a
90
+ real chain among the batch's own source concepts, making a direct link redundant on top of being
91
+ the wrong axis to reach for.
92
+
93
+ **Procedure:**
94
+ 1. Decompose the concept's FSN into its semantic entities (part/region, tissue/bone-class,
95
+ containing structure, any articular/functional relationship implied).
96
+ 2. For each entity, hypothesize a more generic categorization concept at the same specificity
97
+ level and `search-concepts` for it.
98
+ 3. For each hit, `get-concept` it and confirm it's a genuine categorization — read its own
99
+ FSN/definition, don't just accept a plausible-sounding name.
100
+ 4. Check whether two of the *current batch's own* source concepts are related to each other at a
101
+ more generic level — if so, mirror that relationship at the level you're working at too; this
102
+ is easy to miss because each source is naturally processed as an independent candidate.
103
+ 5. Add each confirmed axis as its own stated Is-a. Absence of evidence for an axis is a judgment
104
+ call, not an automatic skip or an automatic apply — don't force a categorization without a
105
+ real, confirmable target, and don't assume an axis is universal just because it applied to a
106
+ sibling in the same batch.
107
+ 6. After adding any second (or third+) parent, `classify --wait` and confirm
108
+ `equivalentConceptsFound: false` before treating the axiom as final — two parents in an
109
+ unexpected ancestor/descendant relationship, or that make two sibling concepts equivalent,
110
+ would surface here.
111
+
112
+ This decomposition check applies retroactively too, not just to concepts being minted right now —
113
+ a concept minted before this check was part of your process can just as easily be missing a real
114
+ axis that was sitting on its own source's `get-concept` output the whole time. Treat every batch
115
+ of related concepts as needing this audit, not as a one-time sweep.
116
+
117
+ ## A retrofitted relationship and a renamed/updated description are independent checklist items
118
+
119
+ When generalizing a specific concept into a broader one, the stated Is-a retrofit (the specific
120
+ concept pointing at the new broader one) and any accompanying description change (an FSN
121
+ disambiguation, a new synonym) are two **separately skippable** steps — never treat one as proof
122
+ the other happened. This risk is highest when the retrofit relationship already existed natively
123
+ in the terminology, sometimes for years, before your project touched the concept: it's easy to
124
+ reason "the relationship is already there, so this concept's work is done" and skip the
125
+ description change entirely, even though that change has nothing to do with whether the
126
+ relationship needed adding.
127
+
128
+ On a tracker or project resumed from a prior session, run a live check of the actual current
129
+ description text — not a cached/frozen value from when a tracker row was seeded — for every
130
+ concept marked complete, at least once, rather than assuming an earlier pass gave every one the
131
+ full treatment.
@@ -112,6 +112,45 @@ Either way, such a script should only ever *find candidates*, never decide fitne
112
112
  its own — keep the compound-word/idiom/cardinality judgment calls (see `SKILL.md`) as an explicit
113
113
  manual step after the script (or this flag) narrows the field.
114
114
 
115
+ ## Driving a batch of mutating calls
116
+
117
+ Queue mutating calls sequentially against one task branch; never run them in parallel, and never
118
+ delegate the batch itself to a subagent — see `SKILL.md`'s "Concurrency: one mutating caller per
119
+ task branch, at a time" for why this holds regardless of which command you're batching. The rest
120
+ of this section is the concrete driving mechanics for a large multi-session batch specifically.
121
+
122
+ - **Never run mutating calls in parallel against the same task branch.** Even a single sequential
123
+ caller can surface "branch locked, retrying" from the server's own internal locking — true
124
+ concurrent callers (multiple background loops, or an `xargs -P`-style fan-out) compound this and
125
+ have produced real, silent data loss (a call that appears to succeed but didn't land). Reserve
126
+ parallelism for **read-only** calls (a `get-concept` audit sweep) — never for
127
+ `create-concept`/`add-relationship`/`replace-fsn`/`add-description`/etc.
128
+ - **A real shell array, not an unquoted loop variable.** In zsh, `for id in $VAR; do ... done` does
129
+ **not** word-split an unquoted space-separated variable the way bash does — the loop silently
130
+ runs once with the whole string as one bogus "ID," which looks like a hang (the CLI chokes on
131
+ garbage input) rather than an obvious error. Use a real array (`IDS=(...)` / `"${IDS[@]}"`), which
132
+ is safe and is exactly the right pattern for a backgrounded batch — don't avoid arrays on the
133
+ mistaken belief that all shell-loop batch driving is equally risky; the specific risk is the
134
+ unquoted-variable word-splitting bug and true parallel execution, not arrays or backgrounding
135
+ themselves.
136
+ - **Never delegate the batch itself to a subagent.** A subagent's self-reported summary is not
137
+ ground truth — subagents have been observed to report a relationship added when none existed on
138
+ either concept, and to report an "exact match" for an ID that doesn't correspond to anything
139
+ relevant. Whoever runs the batch should drive it directly and re-verify every created/modified ID
140
+ (and every claimed pre-existing match) against live `get-concept`/`search-concepts` output before
141
+ recording it in the tracker — never trust a delegate's summary as the record of what happened.
142
+ - **Never reimplement the touched-concept list with a hand-tracked file.**
143
+ `authoring-cli get-concepts-for-review` already returns every concept with pending stated changes
144
+ on the task, flags entries created-then-deleted on the same branch (`"deleted": true` — filter
145
+ these out before validating or reporting), and needs no bookkeeping of your own. Call it fresh
146
+ whenever you need the list — for a structural self-check, a validation pass, or close-out — rather
147
+ than trusting a list assembled earlier in the session; a hand-rolled tracking mechanism drifts the
148
+ moment something gets deleted, retried, or added out of band.
149
+ - Don't let one script's early exit (`set -e` plus a transient network blip) silently truncate a
150
+ batch — check the actual per-concept completion count against the expected total before trusting a
151
+ "completed" exit status, and build retry logic for known-transient errors (socket disconnects,
152
+ "branch locked") rather than letting the whole run die on the first one.
153
+
115
154
  ## Closing out a session
116
155
 
117
156
  Report, and record in the tracker: how many created, how many skipped and why (grouped by
@@ -135,7 +135,7 @@ members, if it gets any at all:
135
135
  authoring-cli search-concepts --ecl "<<TARGET_ID>" --limit 1 # read .total, not the row count
136
136
  ```
137
137
 
138
- Then `get-concept` a couple of the hits and check whether they **state** `Is a <target>` in their
138
+ Then `get-concept --axioms` a couple of the hits and check whether they **state** `Is a <target>` in their
139
139
  own class axiom, or arrive purely by inference.
140
140
 
141
141
  - **Many descendants, all stated** → maintained by hand (checklist item 3). A GCI here is likely
@@ -161,12 +161,16 @@ Read the live axioms before assuming anything about what's already there — a c
161
161
  be modelled and simply not annotated as such in whatever list surfaced it:
162
162
 
163
163
  ```
164
- authoring-cli get-concept --id <SCTID>
164
+ authoring-cli get-concept --id <SCTID> --full
165
165
  ```
166
166
 
167
- Read `definitionStatus` and `gciAxioms.length` straight off that JSON — no extraction step needed
168
- for a single concept; a non-zero `gciAxioms.length` is enough to answer "does this concept have a
169
- GCI" without any filter. For each active relationship inside `classAxioms[].relationships[]` and
167
+ (`--full`, not the flagless default or a single `--axioms`/`--gci` — this step needs `classAxioms`
168
+ and `gciAxioms` together, and only `--full` returns both in one call.) Read `definitionStatus` and
169
+ `gciAxioms.length` straight off that JSON — no extraction step needed for a single concept; a
170
+ non-zero `gciAxioms.length` is enough to answer "does this concept have a GCI" without any filter
171
+ (or use `get-concept --gci-axioms-count --id <SCTID>` alone when that's the only question — it
172
+ skips returning the axioms' content entirely). For each active
173
+ relationship inside `classAxioms[].relationships[]` and
170
174
  `gciAxioms[].relationships[]`, the fields that matter are `groupId`, `type.pt.term` (or
171
175
  `type.conceptId`), and `target.fsn.term` (or `target.conceptId`); read `classAxioms` for the
172
176
  target's own definition and `gciAxioms` for what it already asserts as sufficient conditions on
@@ -292,7 +296,7 @@ G=<genus SCTID>
292
296
  authoring-cli search-concepts --ecl "<$G:<candidate-attribute>=*" --limit 300
293
297
  ```
294
298
 
295
- `get-concept` each hit and read its **real axiom**, not its name — a name can mislead about which
299
+ `get-concept --axioms` each hit and read its **real axiom**, not its name — a name can mislead about which
296
300
  attribute actually carries the cause or mechanism, and only the axiom tells you which candidate
297
301
  attribute would actually catch it. ECL matches the **inferred** view, which is the right view: it's
298
302
  what classification itself will match against, and it also surfaces concepts that reach the genus
@@ -347,8 +351,8 @@ for this axiom.
347
351
 
348
352
  See `SKILL.md`'s "Adding a GCI axiom" for the `add-gci-axiom` command itself — the direction of
349
353
  assertion (the target concept ends up as the superclass, not the subclass), building the whole
350
- relationship list including every group in one call, and reading the result back with `get-concept`
351
- rather than trusting the echoed `axiomId` (Snowstorm can reassign ids across the array on save, so
354
+ relationship list including every group in one call, and reading the result back with `get-concept
355
+ --gci` rather than trusting the echoed `axiomId` (Snowstorm can reassign ids across the array on save, so
352
356
  consecutive calls may echo the same id while each having actually saved correctly).
353
357
 
354
358
  After authoring:
@@ -364,7 +368,7 @@ subsumption:
364
368
 
365
369
  ```
366
370
  authoring-cli search-concepts --ecl "<<SCTID>" # did the intended concepts arrive?
367
- authoring-cli get-concept --id <a concept you expected to be caught> # inferred Is a includes the target?
371
+ authoring-cli get-concept --id <a concept you expected to be caught> --inferred # inferred Is a includes the target?
368
372
  ```
369
373
 
370
374
  A concept you predicted would be caught and wasn't is usually a group-partition mistake (see
@@ -71,7 +71,7 @@ hierarchy, confirmed against the guide's `general-naming-conventions/` section:
71
71
 
72
72
  ## Modelling-quality checks
73
73
 
74
- Read the axiom from `get-concept`, not a cached summary, and check:
74
+ Read the axiom from `get-concept --axioms`, not a cached summary, and check:
75
75
 
76
76
  - **Multiple stated parentage is clinically coherent** — each parent should independently be true of
77
77
  the concept, not just "close enough" to the intended meaning. This is a judgment call distinct
@@ -161,8 +161,10 @@ Read the axiom from `get-concept`, not a cached summary, and check:
161
161
 
162
162
  If reviewing a reference chain leads to an inactive concept (an existing inactive target picked up
163
163
  by `search-concepts`, or one you're about to inactivate yourself — see `SKILL.md`'s "Delete or
164
- inactivate?"), `get-concept`'s association data is more informative than the inactivation reason
165
- alone. Read the association type precisely, since each implies a different next step:
164
+ inactivate?"), `get-concept --full`'s association data (`associationTargets`, a top-level field —
165
+ not returned by the flagless default or by `--axioms`/`--description-*`) is more informative than
166
+ the inactivation reason alone. Read the association type precisely, since each implies a different
167
+ next step:
166
168
 
167
169
  - `SAME AS` / `REPLACED BY` — a direct replacement exists; point new references at it.
168
170
  - `WAS A` — only a partial or approximate replacement; don't auto-substitute, review the fit.