@remits/remits-cli 0.1.146 → 0.1.149

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": "@remits/remits-cli",
3
- "version": "0.1.146",
3
+ "version": "0.1.149",
4
4
  "description": "Local CLI for auth, component sync, and live test execution against Remits",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -83,7 +83,8 @@ reference named after it.
83
83
  it. Each agent works in its own **clone**, never a same-branch worktree: worktrees share the branch
84
84
  ref, so one agent's pull moves `HEAD` under the others, and `components commit` refuses there.
85
85
  A supervised `agent serve` ticket worker is the narrow exception: it may use a per-ticket worktree under
86
- one ticket, one lease, one staging workspace and an explicit freshness check. (`component-resolution.md`,
86
+ one ticket, one lease, one staging workspace and an explicit freshness check. Prune finished worktrees
87
+ safely with `remits-cli agent prune-worktrees`. (`component-resolution.md`,
87
88
  `support-tickets.md`)
88
89
  - **Use the full vocabulary in reports and handoffs.** Say **git branch** / `branchName` for the
89
90
  checkout and staging namespace, **staging lane** for the account+user+git branch+workspace Redis
@@ -216,7 +217,10 @@ reference named after it.
216
217
  proof that a code change works. And never copy live customer data into another account's test
217
218
  collection to get realistic verification. (`development-loop.md`)
218
219
  - **`remits-cli agent serve` is the whole answer to "work support tickets".** No flags, no setup, no need
219
- to be in an account repo. `agent register` makes the session routable and starts nothing.
220
+ to be in an account repo. Pass `--role <role>` (e.g. `developer`, `triage`, `release_manager`) to declare
221
+ what kind of agent the session is; the account's `remits-policy` rules match it, and it is fixed until
222
+ the session is released. `agent register` makes the session
223
+ routable and starts nothing. Use `remits-cli agent prune-worktrees` to clean up finished ticket worktrees.
220
224
  (`support-tickets.md`)
221
225
  - **`remits-cli ticket` is the platform's own ticket surface** and works on every Remits platform.
222
226
  `mcp_support_ticket` is one System Account's convention and refuses tickets it does not own.
@@ -231,6 +231,7 @@ remits-cli ticket participant --ticket ID --email E [--role watcher|requester|ag
231
231
  remits-cli ticket field --ticket ID --key K --value V # the ORGANIZATION's own field, outside the planning slots
232
232
  remits-cli ticket reclaim [--ticket ID | --account-id ID] [--stale-hours 24] [--apply] # OPERATOR: take back an agent's abandoned ticket
233
233
  remits-cli ticket queue --account-id ID [--status ...] [--unrouted] [--unassigned] [--awaiting-response] [--min-runs N] [--workstream W] [--board-stage S] [--planned-in P] [--search "..."] [--sort-by ...] [--json]
234
+ remits-cli ticket queue --all-accounts [--account-ids 4,11] [--status ...] [--inactive-days N|--updated-before YYYY-MM-DD] [--limit N] [--json] # operator sweep across indexed account repos; de-dupes overlapping child queues
234
235
  remits-cli ticket create --account-id ID --subject "..." --type defect|question|task|incident|enhancement [--priority P] [--description "..."] [--tags a,b] [--workstream W] [--affected-component C] [--implementation-account-id ID] [--reference-id KEY]
235
236
  remits-cli start [--foreground true] [--port 8787]
236
237
  remits-cli stop
@@ -245,7 +246,7 @@ remits-cli components status [--branch <name>] [--component-type <type>] [--comp
245
246
  remits-cli components lanes [--json] # every indexed staging lane on the account
246
247
  remits-cli components entries --lane-id <id> [--json|--verbose] # authoritative staged files for one lane
247
248
  remits-cli components clear [--branch <name>] [--component-type <type>] [--component-id <id>] [--all] [--json|--verbose] # id alone scopes to one component when unambiguous (ids are type-local; add --component-type if the same id is staged in multiple families); no filter clears the whole branch scope; --all forces the full wipe
248
- remits-cli components sync [--safe [--yes]] [--branch <name>] [--data-mode test|prod] [--force-tombstones] [--dry-run] [--create-variant-branch] [--summary] [--changed-only [--changed-since <ref>]] # gated; on trunk = full repo->DB reconcile, on a variant branch = ComponentVariant overlays only
249
+ remits-cli components sync [--safe [--yes]] [--branch <name>] [--data-mode test|prod] [--force-tombstones] [--dry-run] [--create-variant-branch] [--summary] [--changed-only [--changed-since <ref>]] [--timeout-ms <ms>] # gated; on trunk = full repo->DB reconcile, on a variant branch = ComponentVariant overlays only
249
250
  remits-cli components sync doctor [--branch <name>] [--json] # read-only: local/remote/platform sync facts, staging shadow risk, promotion freshness, recommended next action
250
251
  remits-cli components commit [--yes] [--safe] [--allow-shared-branch] [--create-variant-branch] [--message|-m "msg"] [--data-mode test|prod] [--force-tombstones] [--json [--summary]] # phase 1 merge-stages + compile-validates changed source (never reconciles the lane); on TRUNK refuses before any git write unless --yes; --safe gates variant sync writes
251
252
  remits-cli components branches [--json] # branches carrying committed variants, with counts + drift
@@ -580,6 +581,8 @@ For tests specifically:
580
581
  - `--summary` on `components sync` prints compact counts plus named updated (with the fields that
581
582
  changed), renamed, skipped, removal/tombstone, error, and gate details instead of the full payload. A
582
583
  trunk sync reports an untouched component under `unchanged`, not `updated`.
584
+ - `--timeout-ms` on `components sync` controls the per-request HTTP timeout for every sync request,
585
+ including `--safe` status/preflight and the durable sync write.
583
586
  - `components sync doctor` does not mutate. Use it when a sync timed out, status/promotion disagree, or
584
587
  you need to know whether staged entries would shadow committed-variant verification. It prints local
585
588
  `HEAD`, `origin/<branch>`, platform last-sync SHA, overlay freshness, repository mismatch, and a
@@ -17,6 +17,8 @@
17
17
  - [Before you edit anything: where you are, and whether you may](#before-you-edit-anything-where-you-are-and-whether-you-may)
18
18
  - [Your account's process is binding, and it is already in your brief](#your-accounts-process-is-binding-and-it-is-already-in-your-brief)
19
19
  - [Some of that process is enforced, not requested](#some-of-that-process-is-enforced-not-requested)
20
+ - [Roles and who may launch them](#roles-and-who-may-launch-them)
21
+ - [Cleaning up ticket worktrees](#cleaning-up-ticket-worktrees)
20
22
  - [Verification envelopes on tickets](#verification-envelopes-on-tickets)
21
23
  - [Seeing the queue as a human does](#seeing-the-queue-as-a-human-does)
22
24
  - [Agent components are workers too](#agent-components-are-workers-too)
@@ -81,13 +83,18 @@ and it expires on its own so a killed worker cannot park a ticket forever. You d
81
83
 
82
84
  ```bash
83
85
  remits-cli agent serve # workers are whichever agent THIS session is
84
- remits-cli agent serve --worker-agent codex --max-concurrent 2
85
- remits-cli agent serve --mode investigate # read-only workers: no file edits
86
+ remits-cli agent serve --role developer --worker-agent codex --max-concurrent 2
87
+ remits-cli agent serve --role triage --mode investigate # read-only workers: no file edits
86
88
  remits-cli agent serve --serves support,sdlc # only these workstreams are routed here
87
89
  remits-cli agent workers # what is running right now
90
+ remits-cli agent prune-worktrees # safely clean up finished ticket worktrees
88
91
  remits-cli agent release # stop serving, go offline
89
92
  ```
90
93
 
94
+ `--role` (and optionally `--persona`) declares what kind of agent this session is — opaque names the
95
+ account's `remits-policy` rules match. It is fixed for the life of the session; see
96
+ [Roles and who may launch them](#roles-and-who-may-launch-them).
97
+
91
98
  `--mode investigate` is still autonomous ticket work. The supervisor claims a ticket, launches a
92
99
  worker, and the worker should read/reproduce/localize the issue and update the ticket with useful
93
100
  findings or a handoff. What it must **not** do is become the repository editor: investigation-mode
@@ -325,12 +332,44 @@ discouraged.
325
332
  absence of an agent run identity, which your commands always carry. Record what you found with
326
333
  `ticket progress` and hand off.
327
334
  - **`[warn]` rules let the call through and write a `policy` worklog entry.** Mention it in your handoff.
335
+ - **Rules can name your role** (`"when":{"role":"triage"}`, or `"role":{"not":["release_manager"]}` for
336
+ "only release managers"). Your role is the one your session registered with; you cannot change it from a
337
+ worker, and passing one on a call does nothing. A refusal naming your role means hand off to the role that
338
+ may.
328
339
  - **If you see "POLICY NOT ENFORCED"**, the account's rules could not be parsed. Do not read the absence
329
340
  of a refusal as permission — say so on the ticket. It is a defect in the account's `OPERATIONS` prompt.
330
341
 
331
342
  The same rules govern `components stage` and `components commit`. A `no-commit` rule is why
332
343
  `remits-cli components commit` refuses rather than asks.
333
344
 
345
+ ### Roles and who may launch them
346
+
347
+ ```bash
348
+ remits-cli agent serve --role developer --serves sdlc
349
+ remits-cli agent serve --role triage --mode investigate --serves support
350
+ ```
351
+
352
+ The role is checked when the session registers against the person's own limits — `allowedAgentRoles`,
353
+ `allowAutonomousAgents`, `allowedWorkstreams`, `maxAgentConcurrent` on their user record or home account —
354
+ and re-checked on every supervisor poll. A refusal names the limit and what to pass instead (a
355
+ workstream-restricted person must name `--serves`). To change role, `agent release` and start again.
356
+
357
+ Every entry you write records the person you act for (`createdBy`) and your session (`agent`: id, run id,
358
+ role), and your brief shows earlier entries the same way — so you can tell which run established what.
359
+
360
+ ### Cleaning up ticket worktrees
361
+
362
+ ```bash
363
+ remits-cli agent prune-worktrees # every indexed account repo on this machine
364
+ remits-cli agent prune-worktrees --dry-run # preview
365
+ remits-cli agent prune-worktrees --account-id 52 # one account's checkouts
366
+ remits-cli agent prune-worktrees --force # also remove worktrees with uncommitted changes
367
+ ```
368
+
369
+ It keeps a worktree whose ticket still has a running worker, one with uncommitted changes (unless
370
+ `--force`), one git cannot report on, and — always — one holding commits no branch or remote has. Push those
371
+ or give them a branch first.
372
+
334
373
  ### Seeing the queue as a human does
335
374
 
336
375
  `remits-cli start` opens a browser control center showing the same facts you are acting on: which
@@ -391,11 +430,17 @@ ticket.
391
430
  remits-cli ticket queue --account-id 49 # triage order, most urgent first
392
431
  remits-cli ticket queue --account-id 49 --unrouted --status open
393
432
  remits-cli ticket queue --account-id 49 --search "firestore index"
433
+ remits-cli ticket queue --all-accounts --inactive-days 45 # stale cleanup candidates across indexed repos
394
434
  ```
395
435
 
396
436
  The `repo` column is the account the **edit lease** excludes on, so it also tells you which of these
397
437
  could be worked at the same time and which will serialize behind one another.
398
438
 
439
+ For operator cleanup, prefer `--all-accounts` over hand-looping account ids. It scans indexed account
440
+ repos with descendants included, de-dupes child queues that are already covered by a parent/root queue,
441
+ and reports per-account read failures in `--json` so one inaccessible account does not hide the rest of
442
+ the queue.
443
+
399
444
  Found a second, unrelated problem while working yours? **File it rather than widening the ticket you
400
445
  were given** — a ticket that describes two things cannot be closed by either fix.
401
446
 
@@ -216,10 +216,12 @@ test-lane Firestore fields moved.
216
216
  - `action: 'reparent'` — move the account's **primary** edge (and `Account.parentId`) to `parentAccountId`.
217
217
 
218
218
  > **The namespace guard.** An account's storage namespace resolves as
219
- > `databaseName ?: platform.code ?: code`, and `Account.setName` **regenerates `code`** — so renaming an
220
- > account whose namespace falls through to its own code silently repoints its storage. Any write that would
221
- > move the resolved namespace is **refused** unless you pass `confirmSegmentChange: true`, and the refusal
222
- > names both namespaces. To rename without moving storage, pin `code` to the old value in the same call.
219
+ > `databaseName ?: platform.code ?: code`. `code` is derived from the name once, at creation (with `_2`,
220
+ > `_3`, … appended when it is taken), and **never changes on a rename** — so renaming is always safe. Any
221
+ > write that WOULD move the resolved namespace — an own `databaseName` set or cleared, a `type` change into
222
+ > or out of `PLATFORM`, an explicit `code` change, an edge `databaseName` — is **refused** unless you pass
223
+ > `confirmSegmentChange: true`, and the refusal names both namespaces. An explicit `code` another account
224
+ > holds is refused, never adjusted.
223
225
  >
224
226
  > Because the namespace follows the **path** (see *Account Structure* in `platform-overview.md`), an
225
227
  > `edge_update` that sets `databaseName` repoints storage for **everything below that edge**, and the