@miroshnik/elves 2026.1029.0 → 2026.1105.1

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.
@@ -1398,7 +1398,7 @@ function dispatcherBatch(io, slug, recent, file) {
1398
1398
  io.out(`+ batch branch ${name} from origin/${base} (${sha.slice(0, 7)}) pushed${previous}: the executors branch from it and merge into it`);
1399
1399
  return name;
1400
1400
  };
1401
- return kept ? { batch: null, start } : { batch: start(), start: null };
1401
+ return { batch: null, start };
1402
1402
  }
1403
1403
  function prRef(p) {
1404
1404
  if (p.head && typeof p.head === "object") {
@@ -2344,7 +2344,7 @@ function cmdTaskQueue(io, slug, o) {
2344
2344
  if (ready.length)
2345
2345
  batch = dispatched.start();
2346
2346
  else
2347
- io.out(`○ no new batch branch: the previous one is released, nothing ready to hand out — a queue with a ready task starts it`);
2347
+ io.out(`○ no new batch branch: nothing ready to hand out — a queue with a ready task starts it`);
2348
2348
  }
2349
2349
  if (file) {
2350
2350
  mkdirSync(path.dirname(file), { recursive: true });
@@ -4821,18 +4821,18 @@ waits for the task's closing (ci-wait issue N, background) and closes it locally
4821
4821
  queue's = line names that wait. --session — printed by the dispatcher: the prompt of an app executor session
4822
4822
  (start_session in the folder of another project, its own worktree) — a session by its project's canon and mode, named
4823
4823
  by the task, waiting in the background, ending with the canon's last line — and how to start it; the hand-out has no
4824
- worktree, the task is = in the queue. A batch project ("batch": true in .agents/elves.json): the first queue pushes the
4825
- dispatcher's batch branch batch/<YYYY-MM-DD>-<k> from a fresh origin/<base> (+), the next ones take the same (○), it is
4826
- kept in the marker; the assignment — the task branch from it and the PR into it, merged after the checks before a
4827
- commit and pr premerge: no CI wait (a PR into the batch runs no CI), no deploy, no epic refresh and no task close — the
4824
+ worktree, the task is = in the queue. A batch project ("batch": true in .agents/elves.json): the first queue with a ready
4825
+ task pushes the dispatcher's batch branch batch/<YYYY-MM-DD>-<k> from a fresh origin/<base> (+), nothing ready — no branch
4826
+ (○), the next ones take the same (○), it is kept in the marker; the assignment — the task branch from it and the PR
4827
+ into it, merged after the checks before a commit and pr premerge: no CI wait (a PR into the batch runs no CI), no deploy, no epic refresh and no task close — the
4828
4828
  release's, the task closes with it; a task merged into it is = in the queue, a blocker merged into it doesn't hold; a
4829
4829
  cloud executor isn't in the batch — its PR goes into the default branch. Nothing ready and every task of the batch
4830
4830
  merged into it — Next: names batch release, a task past the batch (a PR into the default branch, a cloud executor)
4831
4831
  doesn't hold it; its release PR open — ready tasks are held (○), no new executors; red —
4832
4832
  Next: names its guilty task by the labels and the fix with its executor's prompt (otherwise batch release names it), the
4833
4833
  assignment of a task in a red release — the fix's (a new branch from the batch, the PR into it with Refs #N; --cloud
4834
- refused); released — a new batch, a released batch branch without an open PR into it is deleted (+). --main — the
4835
- owner's word «past the batch»: the assignment as in a project without batches (the branch from origin/<base>, the PR
4834
+ refused); released — a new batch with a ready task, a released batch branch without an open PR into it is deleted (+).
4835
+ --main — the owner's word «past the batch»: the assignment as in a project without batches (the branch from origin/<base>, the PR
4836
4836
  into it with the full CI, the deploy, the epic refresh, task close), the hand-out marked — a restart keeps it, task
4837
4837
  finish opens the PR into the default branch, the queue's = line says «past the batch» and the release doesn't wait for
4838
4838
  it; a task of a red release refuses it; with --cloud — the same, a cloud executor isn't in the batch anyway.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@miroshnik/elves",
3
- "version": "2026.1029.0",
3
+ "version": "2026.1105.1",
4
4
  "type": "module",
5
5
  "description": "Elves — a development flow with AI agents: shared rules and skills for any agent; install — bunx @miroshnik/elves install -g; the installer and skill scripts — TypeScript under Bun, tests — bun test in tests/",
6
6
  "repository": {
@@ -72,5 +72,5 @@
72
72
  "eslint-plugin-boundaries": "^7.2.0",
73
73
  "knip": "^6.41.0"
74
74
  },
75
- "gitHead": "293d7b8e52929a23c58bffe49de33c84f4b8cd12"
75
+ "gitHead": "339b95668410844065b1be68aedac49b040f2d6e"
76
76
  }
@@ -1095,13 +1095,14 @@ dispatcher's checkout (`install` and `update` carry it over): the dispatcher's
1095
1095
  tasks go into the default branch with one release — one full CI run and one
1096
1096
  deploy — instead of each its own, and a task PR into the batch runs no CI
1097
1097
  (`skills/spec/ci.md`, "Batches").
1098
- The first `task queue` creates the batch branch
1098
+ The first `task queue` with a ready task creates the batch branch
1099
1099
  `batch/<YYYY-MM-DD>-<k>` (not `release/*`: git-flow projects have it) from a
1100
1100
  fresh `origin/<base>`, `k` — the first free number of the day, and pushes it
1101
- without a local branch — a `+` line; the next ones take the same — an `○`
1102
- line: the marker keeps it as `batch <owner/repo> <branch>` after the queue
1103
- command (`task resume` reads only the command). Gone from origin — released or
1104
- deleted — a new one. No session id, not a checkout of the repository, git
1101
+ without a local branch — a `+` line; nothing ready — no branch, an `○` line
1102
+ (#787). The next ones take the same — an `○` line: the marker keeps it as
1103
+ `batch <owner/repo> <branch>` after the queue command (`task resume` reads only
1104
+ the command). Gone from origin — released or deleted — a new one, with a ready
1105
+ task too. No session id, not a checkout of the repository, git
1105
1106
  failed — an `○`/`!` line, no batch: executors go into the default branch.
1106
1107
  GitHub links a PR to a task and closes it only by a merge into the default
1107
1108
  branch, so the script finds a batch PR itself, by the task branch or `Closes
@@ -1165,9 +1166,11 @@ task's earlier branch (rebase-merged into the batch already, so no restart
1165
1166
  line), the commits and the PR body with `Refs #N`; `--cloud` — refused: a
1166
1167
  cloud executor isn't in the batch. Released — its release PR merged,
1167
1168
  the branch maybe still on origin — the next batch starts only with a ready
1168
- task to hand out (`○ no new batch branch` otherwise): a dispatcher that is
1169
- done leaves no empty batch branch on origin, and the marker drops the batch
1170
- line. A released batch branch still on origin without an open PR into it is
1169
+ task to hand out (`○ no new batch branch` otherwise), like the first one: a
1170
+ dispatcher with nothing to hand out leaves no empty batch branch on origin, and
1171
+ the marker drops the batch line. Nothing is merged into a new batch yet, so
1172
+ starting it after the readiness check changes no blocker's reading. A released
1173
+ batch branch still on origin without an open PR into it is
1171
1174
  deleted (`+`), with one — kept (`○`) till its executor moves the PR (`pr
1172
1175
  premerge`); a new batch's `k` skips the names of the recent PRs' branches too:
1173
1176
  a released name taken again would read as released at once.
@@ -1941,17 +1941,18 @@ function localDay(): string {
1941
1941
  }
1942
1942
 
1943
1943
  /**
1944
- * The dispatcher's batch branch of the repository (epic #645). The first queue of a batch project (`batchProject` of
1945
- * the locale module — `"batch": true` in `.agents/elves.json` of the checkout's root: a project setting, not the owner's
1946
- * word on a run — a batch saves only with the project's CI that runs nothing on a PR into a batch branch)
1947
- * creates it from a fresh origin/<base> and pushes it without a local branch — the dispatcher's checkout stays where it
1948
- * is; `k` — the first free number of the day on origin, in the marker and among the recent PRs' branches: a released
1949
- * batch's name taken again would read as released at once. The next queues take the same one: the marker keeps it
1950
- * (`batchesIn`). Released — its release PR merged (#649), the branch may still be on origin — or gone from origin: the
1951
- * next batch is `start`, called by the queue only with a ready task to hand out — a dispatcher that is done leaves no
1952
- * empty batch branch on origin; its `+` line names the previous one. A released batch branch on origin without an open
1953
- * PR into it goes (`dropReleased`). Not a batch project — null, no line; the session not identified, the directory not
1954
- * the repository's checkout — a `○`/`!` line and null: the executors go into the default branch, as without batches.
1944
+ * The dispatcher's batch branch of the repository (epic #645). A batch project (`batchProject` of the locale module —
1945
+ * `"batch": true` in `.agents/elves.json` of the checkout's root: a project setting, not the owner's word on a run — a
1946
+ * batch saves only with the project's CI that runs nothing on a PR into a batch branch) without a batch in the marker
1947
+ * gets `start`, called by the queue only with a ready task to hand out (#787): a dispatcher with nothing to hand out
1948
+ * leaves no empty batch branch on origin. It creates the branch from a fresh origin/<base> and pushes it without a local
1949
+ * branch — the dispatcher's checkout stays where it is; `k` — the first free number of the day on origin, in the marker
1950
+ * and among the recent PRs' branches: a released batch's name taken again would read as released at once. The next
1951
+ * queues take the same one: the marker keeps it (`batchesIn`). Released — its release PR merged (#649), the branch may
1952
+ * still be on origin — or gone from origin: `start` too, its `+` line names the previous one. A released batch branch on
1953
+ * origin without an open PR into it goes (`dropReleased`). Not a batch project — null, no line; the session not
1954
+ * identified, the directory not the repository's checkout — a `○`/`!` line and null: the executors go into the default
1955
+ * branch, as without batches.
1955
1956
  * Origin not read — the kept one stays (a `!` line): a new batch next to it would split the dispatcher's tasks; a new
1956
1957
  * one not created — null.
1957
1958
  */
@@ -1992,8 +1993,7 @@ function dispatcherBatch(io: Io, slug: string, recent: Recent, file: string | nu
1992
1993
  io.out(`+ batch branch ${name} from origin/${base} (${sha.slice(0, 7)}) pushed${previous}: the executors branch from it and merge into it`);
1993
1994
  return name;
1994
1995
  };
1995
- // the first queue starts the batch at once; after a release — the queue, once it has a task to hand out
1996
- return kept ? { batch: null, start } : { batch: start(), start: null };
1996
+ return { batch: null, start };
1997
1997
  }
1998
1998
 
1999
1999
  /**
@@ -3136,8 +3136,8 @@ export function cmdTaskQueue(io: Io, slug: string, o: QueueFilter): number {
3136
3136
  const openPr = openPrOf(io, slug, recent);
3137
3137
  const args = [o.epic !== undefined && `--epic ${o.epic}`, o.tasks !== undefined && `--tasks ${numbers.join(",")}`, o.type !== undefined && `--type ${o.type}`, o.priority?.length && `--priority ${o.priority.join(",")}`].filter(Boolean).join(" ");
3138
3138
  const file = dispatcherFile(io);
3139
- // the batch branch before the readiness: a blocker merged into it doesn't hold a task of the same batch (#648); the
3140
- // next one after a release — after it, only with a task to hand out (nothing is merged into a new batch yet)
3139
+ // the kept batch before the readiness: a blocker merged into it doesn't hold a task of the same batch (#648); a new one
3140
+ // — after it, only with a task to hand out (#787): nothing is merged into a new batch yet, the readiness reads the same
3141
3141
  const dispatched = dispatcherBatch(io, slug, recent, file);
3142
3142
  let batch = dispatched.batch;
3143
3143
  const inBatch = batch === null ? null : batchPrOf(recent, batch);
@@ -3231,7 +3231,7 @@ export function cmdTaskQueue(io: Io, slug: string, o: QueueFilter): number {
3231
3231
  ready.sort((a, b) => priorityRank(a.priority) - priorityRank(b.priority) || a.number - b.number);
3232
3232
  if (dispatched.start) {
3233
3233
  if (ready.length) batch = dispatched.start();
3234
- else io.out(`○ no new batch branch: the previous one is released, nothing ready to hand out — a queue with a ready task starts it`);
3234
+ else io.out(`○ no new batch branch: nothing ready to hand out — a queue with a ready task starts it`);
3235
3235
  }
3236
3236
  if (file) {
3237
3237
  mkdirSync(path.dirname(file), { recursive: true });
@@ -6510,18 +6510,18 @@ waits for the task's closing (ci-wait issue N, background) and closes it locally
6510
6510
  queue's = line names that wait. --session — printed by the dispatcher: the prompt of an app executor session
6511
6511
  (start_session in the folder of another project, its own worktree) — a session by its project's canon and mode, named
6512
6512
  by the task, waiting in the background, ending with the canon's last line — and how to start it; the hand-out has no
6513
- worktree, the task is = in the queue. A batch project ("batch": true in .agents/elves.json): the first queue pushes the
6514
- dispatcher's batch branch batch/<YYYY-MM-DD>-<k> from a fresh origin/<base> (+), the next ones take the same (○), it is
6515
- kept in the marker; the assignment — the task branch from it and the PR into it, merged after the checks before a
6516
- commit and pr premerge: no CI wait (a PR into the batch runs no CI), no deploy, no epic refresh and no task close — the
6513
+ worktree, the task is = in the queue. A batch project ("batch": true in .agents/elves.json): the first queue with a ready
6514
+ task pushes the dispatcher's batch branch batch/<YYYY-MM-DD>-<k> from a fresh origin/<base> (+), nothing ready — no branch
6515
+ (○), the next ones take the same (○), it is kept in the marker; the assignment — the task branch from it and the PR
6516
+ into it, merged after the checks before a commit and pr premerge: no CI wait (a PR into the batch runs no CI), no deploy, no epic refresh and no task close — the
6517
6517
  release's, the task closes with it; a task merged into it is = in the queue, a blocker merged into it doesn't hold; a
6518
6518
  cloud executor isn't in the batch — its PR goes into the default branch. Nothing ready and every task of the batch
6519
6519
  merged into it — Next: names batch release, a task past the batch (a PR into the default branch, a cloud executor)
6520
6520
  doesn't hold it; its release PR open — ready tasks are held (○), no new executors; red —
6521
6521
  Next: names its guilty task by the labels and the fix with its executor's prompt (otherwise batch release names it), the
6522
6522
  assignment of a task in a red release — the fix's (a new branch from the batch, the PR into it with Refs #N; --cloud
6523
- refused); released — a new batch, a released batch branch without an open PR into it is deleted (+). --main — the
6524
- owner's word «past the batch»: the assignment as in a project without batches (the branch from origin/<base>, the PR
6523
+ refused); released — a new batch with a ready task, a released batch branch without an open PR into it is deleted (+).
6524
+ --main — the owner's word «past the batch»: the assignment as in a project without batches (the branch from origin/<base>, the PR
6525
6525
  into it with the full CI, the deploy, the epic refresh, task close), the hand-out marked — a restart keeps it, task
6526
6526
  finish opens the PR into the default branch, the queue's = line says «past the batch» and the release doesn't wait for
6527
6527
  it; a task of a red release refuses it; with --cloud — the same, a cloud executor isn't in the batch anyway.
@@ -79,16 +79,18 @@ function api<T>(endpoint: string): T {
79
79
  const time = (iso: string | undefined): number => Date.parse(iso ?? "");
80
80
 
81
81
  /**
82
- * Ids of the runs with a live artifact, newest first. Only this repository's runs count: a PR run from a fork can upload
83
- * an artifact with any name too. `before` — only artifacts uploaded by then: a run finished by a moment uploaded its
84
- * artifact before it. A page of 100: newer artifacts keep coming while a run lasts, an older source stays on it.
82
+ * Ids of the runs with a live artifact, newest upload first. Only this repository's runs count: a PR run from a fork can
83
+ * upload an artifact with any name too. `before` — only artifacts uploaded by then: a run finished by a moment uploaded
84
+ * its artifact before it. The API lists artifacts by id, descending, not by upload time — the two differ by tens of
85
+ * minutes, so they are sorted by `created_at` here. A page of 100: the id order strays from time by minutes, not by a
86
+ * page, and newer artifacts keep coming while a run lasts — an older source stays on it.
85
87
  */
86
88
  function runIds(artifact: string, before?: number): number[] {
87
89
  const { artifacts } = api<{ artifacts: Artifact[] }>(`repos/{owner}/{repo}/actions/artifacts?name=${encodeURIComponent(artifact)}&per_page=100`);
88
- const own = artifacts.filter(
89
- (a) => !a.expired && a.workflow_run && a.workflow_run.head_repository_id === a.workflow_run.repository_id && !(time(a.created_at) > (before ?? Infinity)),
90
- );
91
- // a rerun uploads the artifact again under the same run id
90
+ const own = artifacts
91
+ .filter((a) => !a.expired && a.workflow_run && a.workflow_run.head_repository_id === a.workflow_run.repository_id && !(time(a.created_at) > (before ?? Infinity)))
92
+ .sort((a, b) => time(b.created_at) - time(a.created_at));
93
+ // a rerun uploads the artifact again under the same run id: the run counts by its newest upload
92
94
  return [...new Set(own.map((a) => a.workflow_run!.id))];
93
95
  }
94
96