authoring-cli 0.1.31 → 0.1.33

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.31",
3
+ "version": "0.1.33",
4
4
  "description": "CLI for SNOMED CT authoring against authoring-services",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -31,20 +31,31 @@ of truth over anything below; commands and flags get added over time and this fi
31
31
  authoring-cli
32
32
  ```
33
33
 
34
- Every action needs task context, which comes from one of two places:
35
-
36
- - the task recorded in the session file (`<current working directory>/.authoring-cli/session.json`
37
- by default — **not** under the home directory, so it's scoped to whichever directory the CLI is
38
- run from; `$AUTHORING_CLI_HOME` forces a specific location instead) by
39
- `authoring-cli select-task --project <key> --task <key>` — the default target for every
40
- subsequent command, or
41
- - an explicit `--project <key> --task <key>` pair passed on the individual call, which overrides it.
42
-
43
- `authoring-cli current-task` prints the selected task, and — if given `--project`/`--task` — notes
44
- whether they match what's stored. Run it to confirm which task the CLI will actually target before
45
- committing to a sequence of edits. If nothing is selected and no flags are passed, commands fail
46
- rather than guessing. `authoring-cli projects` and `authoring-cli tasks` list what's available to
47
- pick from; a session with no valid cookie needs `authoring-cli login [production|uat|dev]` first.
34
+ Every action needs task context, and the session must name it — there is **no shared "current
35
+ task"**. The login (cookie) in `<current working directory>/.authoring-cli/session.json` is shared
36
+ by everything run from that directory (`$AUTHORING_CLI_HOME` forces another location), so a task
37
+ selection stored there could be changed under a half-finished batch by any other session working
38
+ in the same directory. Selection therefore lives only in one of these:
39
+
40
+ - an explicit `--project <key> --task <key>` pair on the call — targets that task for that call only;
41
+ - a **context** — `--context <name>` on any command (or `AUTHORING_CLI_CONTEXT=<name>`). Run
42
+ `authoring-cli select-task --context 1069 --project <key> --task <key>` once, and every command
43
+ with `--context 1069` targets that task when `--project`/`--task` are omitted. Each context has its
44
+ own file, so `select-task` in one context can never move another's. Name a context after the task;
45
+ `authoring-cli contexts` lists them and flags a task held by two (their writes still contend for
46
+ the branch lock);
47
+ - a **pin** — `AUTHORING_CLI_TASK=<TASK-KEY>` in the process environment (project is derived from
48
+ the key, or set `AUTHORING_CLI_PROJECT`). Nothing on disk, so nothing can move it, and a command
49
+ given a different `--task` is refused, as is `select-task` on another task. Use it for batches.
50
+
51
+ With none of these, task-targeting commands fail and `select-task` refuses, rather than guessing —
52
+ an old selection left in `session.json` is ignored. In a batch script, pin the task (or pass
53
+ `--project`/`--task` on every call) and don't rely on `select-task`/`current-task` between calls.
54
+
55
+ `authoring-cli current-task` prints the task and whether it came from a pin or a context. Run it to
56
+ confirm what the CLI will target before committing to a sequence of edits. `authoring-cli projects`
57
+ and `authoring-cli tasks` list what's available to pick from; a session with no valid cookie needs
58
+ `authoring-cli login [production|uat|dev]` first.
48
59
 
49
60
  **Every mutating command (concept/description/relationship/axiom create/update/delete and
50
61
  `classify`) checks that the signed-in user is the task's Author — its assignee — before doing
@@ -89,8 +100,8 @@ rather than trusting the batch run's exit status alone. See `references/batch-au
89
100
  "Driving a batch of mutating calls" for the fuller reasoning, including why a subagent's
90
101
  self-reported summary isn't ground truth either.
91
102
 
92
- The `--project`/`--task` flags are shown on the examples below for explicitness. When a task is
93
- already selected via `select-task`, you can omit them everywhere.
103
+ The `--project`/`--task` flags are shown on the examples below for explicitness. In a context or
104
+ pinned session you can omit them everywhere.
94
105
 
95
106
  ### Starting a new task
96
107
 
@@ -100,8 +111,8 @@ authoring-cli create-task --project <projectKey> --summary "<title>" [--descript
100
111
 
101
112
  The server mints the task key — you don't supply it. It also returns the task's branch path, but
102
113
  does not create that branch; `create-task` and `select-task` do, so a task is workable the moment
103
- either one returns. The new task is selected automatically, so the commands that follow need no
104
- `--project`/`--task`; pass `--no-select` to leave the current selection alone.
114
+ either one returns. The new task is selected into the active context (so pass `--context <name>`, or `--no-select`;
115
+ without either it refuses before creating anything, and a pinned session always needs `--no-select`).
105
116
 
106
117
  It is assigned to you unless you pass `--assignee <username>` or `--unassigned`. That default is
107
118
  deliberate rather than cosmetic: authoring-services doesn't infer an assignee from the session, and