@radicaltools/cli 0.3.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +229 -47
  2. package/dist/index.js +9944 -7520
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -24,7 +24,7 @@ Connects your coding agents to a model folder, step by step:
24
24
 
25
25
  ```sh
26
26
  npx @radicaltools/cli setup # asks for the folder, the agents and the hooks
27
- npx @radicaltools/cli setup architecture --client claude-code --client codex --yes
27
+ npx @radicaltools/cli setup --client claude-code --client codex --yes
28
28
  ```
29
29
 
30
30
  No Node.js yet? Start from an empty folder with the launcher, which finds Node.js or
@@ -40,7 +40,7 @@ The launcher (`radical.sh`, `radical.cmd`) takes Node.js 20.11 or later with `np
40
40
  beside it from the `PATH`, else from `~/.radical/node`. With neither, it asks (or takes
41
41
  `--yes`) and downloads the latest Node.js 24 for the platform from nodejs.org into
42
42
  `~/.radical/node`, checked against its SHA-256 sum. It runs any command:
43
- `sh radical.sh check architecture`, and `sh radical.sh mcp --folder …` runs the MCP
43
+ `sh radical.sh check`, and `sh radical.sh mcp --folder …` runs the MCP
44
44
  server without asking anything. `radical setup` run through it pins its version line
45
45
  (`default_version`, `DEFAULT_VERSION` in `radical.cmd`) to the CLI's, makes `radical.sh`
46
46
  executable, and has every agent and the git hooks start the server and the CLI through
@@ -132,9 +132,9 @@ publishes it through the Confluence adapter.
132
132
  Find a view and preview it without Confluence credentials:
133
133
 
134
134
  ```sh
135
- radical export confluence architecture --list-views
136
- radical export confluence architecture --view "Specification" --format html --output wiki-preview.html
137
- radical export confluence architecture --view "Specification" --format markdown --output wiki.md
135
+ radical export confluence --list-views
136
+ radical export confluence --view "Specification" --format html --output wiki-preview.html
137
+ radical export confluence --view "Specification" --format markdown --output wiki.md
138
138
  ```
139
139
 
140
140
  `--view` accepts an exact view ID or an unambiguous name. `--format storage`
@@ -148,7 +148,7 @@ To publish to Confluence Cloud, set `CONFLUENCE_URL`, `CONFLUENCE_EMAIL` and
148
148
  `CONFLUENCE_API_TOKEN` in your shell or CI secret environment, then run:
149
149
 
150
150
  ```sh
151
- radical export confluence architecture --view "Specification" --publish --space-id 123 --parent-id 456
151
+ radical export confluence --view "Specification" --publish --space-id 123 --parent-id 456
152
152
  ```
153
153
 
154
154
  Use the numeric space ID, not its key. `--parent-id` is optional. `--url` can
@@ -178,7 +178,7 @@ To move an existing managed export under another page, pass its root page
178
178
  ID with `--parent-id`; its children follow it:
179
179
 
180
180
  ```sh
181
- radical export confluence architecture --view "Specification" --publish --page-id 789 --parent-id 456
181
+ radical export confluence --view "Specification" --publish --page-id 789 --parent-id 456
182
182
  ```
183
183
 
184
184
  Use a destination parent in the same Confluence space. Changing the view's
@@ -203,6 +203,25 @@ Exit status: 0 exported/published, 2 could not export/publish. Credentials
203
203
  are not accepted as command-line arguments or included in error output.
204
204
  The transport follows Atlassian's [Cloud page API](https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/).
205
205
 
206
+ ## radical implement
207
+
208
+ Says where the repository builds an element of the model, in
209
+ `.radical/radical.json`, which the repository's sensors (`element.paths` in
210
+ their `--context`), `radical check` and Studio's element card read.
211
+
212
+ ```sh
213
+ radical implement "Orders API" --path services/orders-api
214
+ radical implement 8c66e024-… --path apps/cli --path apps/cli-shared
215
+ radical implement "Orders API" # where it is built
216
+ radical implement "Orders API" --remove
217
+ ```
218
+
219
+ The element is its id or its name (an element of another model of the
220
+ federation, as fetched, too); a name two elements share needs the id. Paths
221
+ are from the working directory and kept from the repository's root; they
222
+ replace the element's paths. An element without an entry is built where its
223
+ nearest parent with one is.
224
+
206
225
  ## radical diff
207
226
 
208
227
  ```sh
@@ -223,7 +242,7 @@ change. Exit status: 0 the list was written, 2 it could not be made (not a
223
242
  git repository, an unknown ref).
224
243
 
225
244
  `--save-base` also writes the model at the base (its elements and relations,
226
- the commit, the branch and the time) to `.radical/base.json` in the folder,
245
+ the commit, the branch and the time) to `.state/base.json` in the folder,
227
246
  out of git like the rest of `.radical/`. Studio has no git: it compares the
228
247
  open model with that file as it is edited and shows the changes with
229
248
  Changes on branch, in the list of views, on the properties card and in the
@@ -259,7 +278,48 @@ the git command. A hook written in another language than sh (Python, say)
259
278
  is left as it is: the command exits 2 and says what to call from it.
260
279
  It runs the CLI that installed it, with the `node` on the PATH, else the one
261
280
  that installed it. In this repository `npm run hooks` builds the CLI,
262
- installs the hooks for `architecture/` and saves its base once.
281
+ installs the hooks for `.radical/model/` and saves its base once.
282
+
283
+ ## radical federation
284
+
285
+ ```sh
286
+ node apps/cli/dist/index.js federation open|sync|watch path/to/model [--force]
287
+ ```
288
+
289
+ One model across many repositories. A model folder names the models it
290
+ depends on in `deps.json`:
291
+
292
+ ```json
293
+ {
294
+ "name": "payments",
295
+ "dependencies": [
296
+ { "name": "orders", "repo": "git@github.com:acme/orders.git", "path": ".radical/model", "ref": "v2.3.0" }
297
+ ]
298
+ }
299
+ ```
300
+
301
+ `repo` is a git address or a path relative to the model folder, `path` the
302
+ model folder in that repository, `ref` a branch, tag or commit.
303
+
304
+ - `open` fetches each dependency at its ref into the cache (`$RADICAL_CACHE`,
305
+ else the user's cache directory; one bare partial clone per repository, so
306
+ only the model files are downloaded) and composes one model folder in
307
+ `.radical/federation/`: the folder's own elements, relations, views and
308
+ metamodel as they are, and every dependency's elements and relations with
309
+ `origin: "<name>@<commit>"`. Studio and the MCP server open that folder;
310
+ they draw elements with an origin dashed and refuse every change to them
311
+ but their place. The composed folder gets a base composed the same way
312
+ (Changes on branch shows only this model's changes), `check.json` and the
313
+ test results. Changes not carried home yet are carried first.
314
+ - `sync` writes what has no origin back to the model folder, and names each
315
+ change to an element or relation with an origin, which it keeps out and
316
+ undoes in the composed folder (exit 1). When the model folder changed too,
317
+ nothing is carried unless `--force`; `open --force` composes again from the
318
+ model folder and drops the composed folder's changes.
319
+ - `watch` opens, then keeps both in step until stopped (Ctrl-C).
320
+
321
+ Dependencies are not composed transitively. With a `deps.json`,
322
+ `radical check` checks the model composed with its dependencies (see below).
263
323
 
264
324
  ## radical check
265
325
 
@@ -284,6 +344,12 @@ With test reports it also checks that the tests the model names passed, and
284
344
  with measurements that the values it holds to were met (see below). `radical check --list-rules` lists every rule and every metric a goal can
285
345
  be set for. It reads the files only and never writes the model.
286
346
 
347
+ With a `deps.json` the model is checked composed with the models it names,
348
+ at their pinned refs: its relations to their elements hold, one to an element
349
+ no model has is the error `rel-end-missing`, and what is found about their own
350
+ elements is left to their check. It names the dependencies and commits
351
+ (`federation` in the JSON). `--alone` checks the folder without them.
352
+
287
353
  Exit status: 0 no errors (warnings allowed), 1 errors, 2 the check could not
288
354
  run. `--format json` prints the result as JSON, `--format github` as GitHub
289
355
  Actions annotations.
@@ -338,28 +404,39 @@ its meaning as the model grows.
338
404
  names. It looks only at the files its `include` matches, so that unit tests of
339
405
  internals stay out of it; a scenario has to name a test by its title or its
340
406
  describe block, since a fitness function that names a whole file or directory
341
- (`apps/e2e/tests`) is an umbrella over many behaviours:
407
+ (`apps/e2e/tests`) is an umbrella over many behaviours. The files are the
408
+ repository's, so they are set in its `.radical/radical.json`, and the rule's
409
+ severity in the model's `check.json` (one there from before still counts,
410
+ with the warning `repository-settings-in-model`):
342
411
 
343
412
  ```json
344
- { "rules": { "test-unbound": { "severity": "warning", "include": ["apps/e2e/**"], "exclude": ["**/known-issues.spec.ts"] } } }
413
+ { "tests": { "include": ["apps/e2e/**"], "exclude": ["**/known-issues.spec.ts"] } }
345
414
  ```
346
415
 
347
416
  `--verbose` and the Inspector list the titles of those tests.
348
417
 
349
418
  ### Tests and evidence
350
419
 
351
- A scenario or a fitness function says what checks it in its `metrics`
352
- property, one condition per line. A test that has to pass is named as Vitest
353
- and Playwright print it:
420
+ The model names no test: the repository binds its tests to the model's
421
+ scenarios and fitness functions in `.radical/radical.json` ("verifies"), and
422
+ a scenario or fitness function passes when every test bound to it passed and
423
+ its `metrics` (metric conditions only) hold. A test is named as Vitest and
424
+ Playwright print it, from the repository's root:
354
425
 
355
- ```
356
- test(apps/cli/src/cli.test.ts › radical check › prints the result as JSON) passed
357
- test(apps/e2e/tests/studio/forge.spec.ts › Forge files each stage into its view) passed
358
- test(packages/layout/tests/geometry.test.ts › createBatchPlacer) passed
359
- test(apps/e2e/tests) passed
426
+ ```sh
427
+ radical verify "Prints JSON" --test "apps/cli/src/cli.test.ts › radical check › prints the result as JSON"
428
+ radical verify "Forge files its stages" --test "apps/e2e/tests/studio/forge.spec.ts › Forge files each stage into its view"
429
+ radical verify "Placement" --test "packages/layout/tests/geometry.test.ts › createBatchPlacer"
430
+ radical verify "E2E regression" --test apps/e2e/tests
431
+ radical verify "Prints JSON" # its tests
432
+ radical verify "Prints JSON" --drop "<test>" # take one off
360
433
  ```
361
434
 
362
- An id names the test whose title it ends, otherwise every test in the
435
+ `radical check` warns about a scenario the repository must verify (an
436
+ element it builds satisfies its requirement) that has no test bound and no
437
+ metric condition (`scenario-not-verified-here`), and about a test still
438
+ named in Metrics (`model-names-tests`; it still counts, and `radical setup`
439
+ moves such tests into the file). An id names the test whose title it ends, otherwise every test in the
363
440
  describe block it starts; one without a title names every test in a file or
364
441
  directory. File paths match by suffix, so absolute paths in a report and
365
442
  workspace-relative ones in a JUnit file both do.
@@ -376,7 +453,7 @@ directory of them (its .json and .xml files), and may be repeated.
376
453
  In this repository `npm run test:reports` runs every workspace's tests and
377
454
  leaves a report per workspace in `reports/`, the e2e suite adds
378
455
  `reports/e2e.json`, and `npm run check:architecture` checks the local
379
- `architecture/` model against them. CI keeps `reports/` as the
456
+ `.radical/model/` model against them. CI keeps `reports/` as the
380
457
  `test-reports` artifact (and `reports/e2e.json` in `e2e-report`). A named
381
458
  test that failed or is gone from the report of its file (renamed, deleted)
382
459
  is an error; one that was skipped, or whose file no report has, a warning.
@@ -388,8 +465,8 @@ fitness functions, with each condition's outcome); it never writes into the
388
465
  model.
389
466
 
390
467
  With `--report` the command also keeps the test cases it read in the model
391
- folder's `.radical/test-results.json` (out of git, like the rest of
392
- `.radical/`). Studio's Inspector perspective reads them and the model's
468
+ folder's `.state/test-results.json` (out of git, like the rest of
469
+ `.state/`). Studio's Inspector perspective reads them and the model's
393
470
  `check.json`, and runs the same check on the model as it is edited: Model
394
471
  quality and Implementation show the result by dimension, and Settings edit
395
472
  `check.json` (goals, severities, baselines), marking a change that loosens
@@ -409,14 +486,15 @@ HEAD's first-parent history that a completed GitHub Actions run tested; a
409
486
  commit merged from a pull request (a squash merge has no run of its own)
410
487
  stands for the pull request's head. For each artifact it takes the latest
411
488
  completed run that kept it, downloads it, and reads the `.json` and `.xml`
412
- test reports in it. Which artifacts hold reports is set in `check.json`:
489
+ test reports in it. Which artifacts hold reports is set in the repository's
490
+ `.radical/radical.json` (`check.json`'s still counts):
413
491
 
414
492
  ```json
415
493
  { "ci": { "artifacts": ["test-reports", "e2e-report"] } }
416
494
  ```
417
495
 
418
496
  (every artifact of the run without it). The results are kept in
419
- `.radical/test-results.json` with the commit they stand for, the runs, when
497
+ `.state/test-results.json` with the commit they stand for, the runs, when
420
498
  each ran and how many commits HEAD is past it, which the Inspector's *Tests*
421
499
  chip shows; the same runs a second time download nothing. Results read with
422
500
  `--report` at that commit or a later one are kept, and checked. `--quiet`
@@ -441,7 +519,7 @@ condition's; units of one kind convert (ms and s, KB and MB). The element's
441
519
  be: an older one is stale, and never passes.
442
520
 
443
521
  `radical check` reads the measurements kept in the model folder's
444
- `.radical/measurements.json`, and with `--metrics <file|dir>` the
522
+ `.state/measurements.json`, and with `--metrics <file|dir>` the
445
523
  radical-metrics/1 files another job wrote, which it adds there. A condition
446
524
  that does not hold is an error (`metric-failed`); a stale one
447
525
  (`metric-stale`) or one nothing measured (`metric-not-measured`) a warning;
@@ -465,7 +543,7 @@ radical sense json coverage-summary.json --metric 'coverage.lines=total.lines.pc
465
543
  - `json <file> --metric <metric>=<path>[@<unit>]`: a number from a JSON file,
466
544
  by dotted keys with `[index]` or a JSON pointer starting with `/`.
467
545
  - `--folder <dir>`: the model folder (default: the working directory); the
468
- values go into its `.radical/measurements.json`, the latest of each metric
546
+ values go into its `.state/measurements.json`, the latest of each metric
469
547
  and labels.
470
548
  - `--out <file>`: a radical-metrics/1 file instead, for `radical check
471
549
  --metrics` in another job.
@@ -481,18 +559,18 @@ threshold. Pull requests welcome.
481
559
  ## radical fuzz
482
560
 
483
561
  Runs a project's fuzz files (Radical Crucible): tests that do random sequences
484
- of actions to a system and check its rules after every step. `crucible.json`
562
+ of actions to a system and check its rules after every step. `.radical/crucible/crucible.json`
485
563
  in the working directory lists them, and the folder findings go to:
486
564
 
487
565
  ```json
488
566
  {
489
- "findings": "crucible/findings",
567
+ "findings": ".radical/crucible/findings",
490
568
  "fuzz": [{ "file": "packages/ui/tests/invariants.test.ts", "cwd": "packages/ui" }]
491
569
  }
492
570
  ```
493
571
 
494
572
  Each file runs with `npx vitest run <file>` in its `cwd`, or with its own
495
- `command` (a list). Paths are from the folder `crucible.json` is in.
573
+ `command` (a list). Paths are from the repository's root.
496
574
 
497
575
  ```sh
498
576
  radical fuzz # plan ci: each file's fixed seeds and runs
@@ -505,16 +583,15 @@ radical fuzz --report reports # a Vitest JSON report per file, for radical che
505
583
 
506
584
  `--survey` goes on after each failure and writes each one whose signature (its
507
585
  rule, its last action and the shape of what differs, with the ids taken out) no
508
- finding has yet as `crucible/findings/F-NNNN.md`, status `open`, with the
586
+ finding has yet as `.radical/crucible/findings/F-NNNN.md`, status `open`, with the
509
587
  world, seed, path and length that replay it, the steps and what differs.
510
588
  `--no-known` lets the fuzz files' known failures filter nothing, `--no-shrink`
511
589
  reports the first failure as found.
512
590
 
513
- A fuzz file is written with the engine, `@radical/crucible`, which is not
514
- published yet: so far the fuzz files are this repository's own
515
- (`packages/ui/tests/invariants.test.ts`). It reports a test case per world and
516
- one per world and rule (`on the bookstore model: undoRestores holds`), which a
517
- scenario or a fitness function can name in its Metrics.
591
+ A fuzz file is written with the engine,
592
+ [`@radicaltools/crucible`](https://www.npmjs.com/package/@radicaltools/crucible). It reports
593
+ a test case per world and one per world and rule (`on the bookstore model: undoRestores
594
+ holds`), which `radical verify` can bind to a scenario or a fitness function.
518
595
 
519
596
  Exit status: 0 every file passed, 1 one failed, 2 radical fuzz could not run.
520
597
 
@@ -531,18 +608,19 @@ radical harden --gate --test "apps/e2e/tests/studio/views.spec.ts › a view kee
531
608
  A fuzz finding is hardened by its own steps: the finding is marked `hardened`,
532
609
  and its fuzz file replays the shrunk sequence as the test
533
610
  `<fuzz file> › F-0003 stays fixed: <title>`, once and without the known
534
- failures, so it fails until the bug is fixed. The command prints that test as a
535
- `test(…) passed` line for the scenario's Metrics and keeps the scenario's name
536
- in the finding; it does not change the model's files.
611
+ failures, so it fails until the bug is fixed. With `--scenario` it binds that
612
+ test to the scenario in `.radical/radical.json` (as `radical verify` does) and
613
+ keeps the scenario's name in the finding; it does not change the model's
614
+ files.
537
615
 
538
616
  `--gate` checks a test before it is bound: with the source files changed since
539
617
  the base (default: the merge base with `origin/main`) set back to it, the test
540
618
  must fail; put back, it must pass; and it must pass `--runs` runs at once
541
- (default 5). Tests, findings and `crucible.json` are not set back, and the
619
+ (default 5). Tests, findings and `.radical/crucible/crucible.json` are not set back, and the
542
620
  working tree is left as it was (files are copied aside, never stashed), also
543
621
  when the gate is interrupted: Ctrl+C, `kill` or a closed terminal stops the
544
622
  test, puts the changed files back and ends with exit status 2. A test
545
- runs through the runner `crucible.json` gives for its folder, else with
623
+ runs through the runner `.radical/crucible/crucible.json` gives for its folder, else with
546
624
  `npx vitest run <file> -t <name>` in the file's package:
547
625
 
548
626
  ```json
@@ -553,7 +631,7 @@ runs through the runner `crucible.json` gives for its folder, else with
553
631
  "--repeat-each", "{runs}", "--workers", "{runs}", "--reporter", "line"] }] }
554
632
  ```
555
633
 
556
- A runner's `build` (commands run from `crucible.json`'s folder) is made before
634
+ A runner's `build` (commands run from the repository's root) is made before
557
635
  the run without the fix and before the run with it, so a test of a build (an
558
636
  e2e test) runs on what the files are at each step; its `repeat` (with
559
637
  `{runs}`) makes the runs at once one run of that command, for runs that
@@ -573,18 +651,18 @@ checks what comes back; a coding agent's session starts the agents.
573
651
  ```sh
574
652
  radical explore prepare --runs 5 --areas "layout under edits; milestones and undo"
575
653
  radical explore verify 70 "f1-row.mjs 2" "f2-undo.mjs"
576
- radical explore record .crucible/rounds/round-70-74/run-70/REPORT.md
654
+ radical explore record .radical/crucible/rounds/round-70-74/run-70/REPORT.md
577
655
  ```
578
656
 
579
657
  `prepare` builds the project once, copies what the runs need into
580
- `.crucible/rounds/round-<from>-<to>/build`, and gives each run a folder, its
658
+ `.radical/crucible/rounds/round-<from>-<to>/build`, and gives each run a folder, its
581
659
  ports (`<ports>+NN`, `+100+NN`, `+200+NN`) and a `PROMPT.md` with its area;
582
660
  `BRIEF.md` names the commit, the commits and the model elements changed since
583
661
  the last round (by area), the open findings, the setup, the rules and the
584
662
  report's JSON form. `--since`, `--from` and `--no-build` change what it
585
663
  counts from, the first run's number and whether it builds. The brief asks
586
664
  that scripts name no absolute path (they find the repository by walking up to
587
- `crucible.json`), since a finding's script is copied out of the round.
665
+ `.radical/crucible/crucible.json`), since a finding's script is copied out of the round.
588
666
  `verify` serves a run's build on its ports (each server `serve` lists, on the
589
667
  run's port it names: `app`, `hub` or `other`), runs its scripts from its
590
668
  folder and stops the servers. `record` writes a report's findings (`open`, or
@@ -594,8 +672,8 @@ absolute paths.
594
672
 
595
673
  ```json
596
674
  { "explore": {
597
- "rounds": ".crucible/rounds", "brief": "docs/EXPLORATORY-TESTING.md",
598
- "known": ["docs/IMPROVEMENTS.md"], "model": "architecture",
675
+ "rounds": ".radical/crucible/rounds", "brief": "docs/EXPLORATORY-TESTING.md",
676
+ "known": ["docs/IMPROVEMENTS.md"], "model": ".radical/model",
599
677
  "build": [["npm", "run", "build:web"]],
600
678
  "copy": { "renderer": "apps/studio/out/renderer" },
601
679
  "serve": [
@@ -687,3 +765,107 @@ To validate the archive without a release, use **Actions → Publish to npm →
687
765
  Run workflow**, select `main`, choose **package: cli**, and leave **dry-run**
688
766
  enabled. With **dry-run** disabled it publishes, but only from `main`.
689
767
 
768
+
769
+ ## Sync node discussions with Confluence (experimental)
770
+
771
+ Publish a wiki as a managed page tree first (`export confluence --publish
772
+ --structure tree`). Run discussion sync from one designated machine or CI job.
773
+ Configure `CONFLUENCE_EMAIL` and `CONFLUENCE_API_TOKEN` in that runner's environment.
774
+ The account needs read access to the landing and node pages and permission to
775
+ create footer comments in the space. Tokens never belong in command arguments,
776
+ model files, sync journals, or source control.
777
+
778
+ ```sh
779
+ radical discussions confluence connect ./model --view <wiki-id> --page <landing-url>
780
+ # Read the preview, including existing conversations, account and limitations.
781
+ # Repeat the same command with the returned confirmation token:
782
+ radical discussions confluence connect ./model --view <wiki-id> --page <landing-url> --apply --expect <token>
783
+ radical discussions confluence sync ./model
784
+ radical discussions confluence sync ./model --apply --expect <fresh-token>
785
+ radical discussions confluence status ./model
786
+ ```
787
+
788
+ Preview writes neither local sync state nor remote comments. Apply reads again
789
+ and refuses if the preview token no longer matches. A preview token authorizes
790
+ only that snapshot and its exclusions. Add `--json` for structured output.
791
+ Use `--node <node-id>` (repeatable) on both preview and apply to limit a run to
792
+ selected nodes within the current wiki view. Other node pages are not read or
793
+ written. The filter applies to that invocation; use it again on subsequent runs.
794
+
795
+ Exit 0 means success, 1 means review/partial results or exclusions, and 2 means
796
+ an operational error. Review can be required even when some comments succeeded.
797
+
798
+ All supported existing footer comments on the currently selected node pages are
799
+ imported, including pre-connection comments. Existing local and remote threads
800
+ remain separate even when their text matches. To leave a conversation out,
801
+ repeat `--exclude local:<thread-uuid>` or `--exclude remote:<comment-id>` on the
802
+ preview and apply commands. Exclusions are stored and include descendants on
803
+ later runs; they are not automatically removed. Landing, inline, retained pages
804
+ outside the current view and unmanaged page comments are excluded. Missing or
805
+ replaced pages need review; sync never recreates or rebinds them.
806
+
807
+ The supported comment subset is paragraphs, bold, italic, inline code, line
808
+ breaks and absolute HTTP(S) links without credentials. Images, tables, macros,
809
+ mentions, attachments, raw HTML, lists and other unsupported content are held
810
+ with their source page for review; descendants are held too. The original remote
811
+ body is never modified or partially imported. This subset has automated tests
812
+ but **has not passed a live Confluence editor round trip yet**. Do not treat
813
+ these tests as evidence that editor normalization, republishing, permissions or
814
+ rate limits have been verified on a live site.
815
+
816
+ The connected account authors outbound posts. Local email addresses are never
817
+ exported or inferred as remote identity. Imported authors use Confluence account
818
+ IDs; display names are shown if present in provenance. The first import upgrades
819
+ discussions.json losslessly to version 2, preserving local UUIDs, email, nesting,
820
+ resolution and timestamps. **Older Studio versions cannot read version 2.**
821
+ Update all writers first and back up the folder before importing. Local-only
822
+ files keep their existing format. Studio displays source links, imported account
823
+ identity and resolved-thread review warnings; sync itself runs through the CLI.
824
+
825
+ Edits, deletions and resolution are not synchronized. Linked local/remote edits
826
+ and remote disappearance are reported for manual review without overwriting.
827
+ A remote reply to a resolved local thread is imported and flagged; the thread
828
+ stays resolved. After reviewing it, reopen the thread in Studio to acknowledge the imported
829
+ reply. Until then the preview continues to report it for review.
830
+
831
+ ### Interrupted runs and runner handoff
832
+
833
+ Keep these files together as durable collaboration state:
834
+
835
+ - `discussions.json`: human content and imported provenance;
836
+ - `discussions-confluence-sync.json`: checksummed, versioned mappings, pending
837
+ imports, exact staged outbound payloads, exclusions and last result;
838
+ - `discussions-confluence-connection.json`: connection receipt detecting a missing
839
+ or mismatched journal.
840
+
841
+ Choose whether to commit all three. Never merge competing journals in Git or
842
+ start another clone while the designated runner is running. Stop the old runner
843
+ before transferring these files together. Local process locks do not coordinate
844
+ different computers. Do not discard a missing/corrupt/conflicted journal and
845
+ reconnect: restore a consistent backup and review the corresponding remote
846
+ comments. A crash creating the first connection receipt before its journal also
847
+ stops safely for manual review, before any comments are posted or imported.
848
+
849
+ Imports stage a stable local ID before acquiring the ordinary short discussion
850
+ writer lock. Recovery verifies or finishes the same import, preserving concurrent
851
+ Studio posts. Network calls never hold that writer lock. Outbound posts are staged
852
+ as uncertain before the request. No create is automatically retried, even for a
853
+ 429. If its acknowledgement is lost, sync pauses the entire affected page:
854
+ inspect Confluence and the intended payload in the journal, then preview and
855
+ apply one of these recovery commands:
856
+
857
+ ```sh
858
+ radical discussions confluence sync ./model --bind <local-comment-uuid>=<verified-remote-id>
859
+ # Repeat with --apply --expect <token> after inspecting the remote page/parent.
860
+ # Only if you checked and decided to post again:
861
+ radical discussions confluence sync ./model --retry <local-comment-uuid>
862
+ ```
863
+
864
+ Binding verifies page, parent and uniqueness, retaining the original local UUID.
865
+ An explicit retry can duplicate a comment if the first request actually succeeded;
866
+ never retry merely because the CLI timed out. Recovery returns review status and
867
+ requires a fresh sync preview afterward. Other pages can continue when one page
868
+ is held. Stale `.discussions-confluence-sync.lock` files may be removed only after
869
+ verifying their recorded process has stopped; locks are never automatically stolen.
870
+ External editors and Git do not honor locks: observed changes stop the runner,
871
+ but ordinary filesystems cannot prevent every change in the final rename window.