@nanobpm/nano-workforce 0.187.0 → 0.187.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.
- package/CHANGELOG.md +6 -0
- package/app/contracts.ts +1 -1
- package/app/deliveryGraphCompiler.ts +11 -7
- package/app/deliveryRunner.test.ts +66 -1
- package/app/deliveryRunner.ts +22 -5
- package/app/repoEnvelope.ts +22 -6
- package/openapi.yaml +4 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## [0.187.1](https://github.com/nanobpm/nano-workforce/compare/v0.187.0...v0.187.1) (2026-09-12)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* **delivery-graph:** emit a deterministic branch.create so agent cells never commit on the base branch ([#781](https://github.com/nanobpm/nano-workforce/issues/781)) ([56f6488](https://github.com/nanobpm/nano-workforce/commit/56f6488344b439a5ac12f5069567facd9519bf66)), closes [#776](https://github.com/nanobpm/nano-workforce/issues/776) [pre-#776](https://github.com/nanobpm/pre-/issues/776) [#776](https://github.com/nanobpm/nano-workforce/issues/776)
|
|
6
|
+
|
|
1
7
|
## [0.187.0](https://github.com/nanobpm/nano-workforce/compare/v0.186.4...v0.187.0) (2026-09-12)
|
|
2
8
|
|
|
3
9
|
### Features
|
package/app/contracts.ts
CHANGED
|
@@ -399,7 +399,7 @@ export const WIRE_CONTRACTS = {
|
|
|
399
399
|
name: "io.nanobpm.agentTask.repository",
|
|
400
400
|
owner: "app/repoEnvelope.ts",
|
|
401
401
|
semantics:
|
|
402
|
-
"Repo-provisioning envelope the app emits as a `createInstance` process variable (`repoEnvelopeVars`, app/repoEnvelope.ts) and the c8ctl worker harness consumes to provision an isolated clone — instead of the agent inheriting the worker's launch dir (issue #684). `ref` is the branch checked out: the PR HEAD branch on the PR-based paths (review-round / fix-ci / rebase), or — on the PRE-PR implementation path (feature.bpmn / plan-fanout's `implement-cell`, issue #684; the delivery-graph runner's agent cells, issue #686) — the BASE branch, off which the harness cuts a new feature branch named by the optional `branch.create` (the deterministic `feat/<task.id>`, emitted
|
|
402
|
+
"Repo-provisioning envelope the app emits as a `createInstance` process variable (`repoEnvelopeVars`, app/repoEnvelope.ts) and the c8ctl worker harness consumes to provision an isolated clone — instead of the agent inheriting the worker's launch dir (issue #684). `ref` is the branch checked out: the PR HEAD branch on the PR-based paths (review-round / fix-ci / rebase), or — on the PRE-PR implementation path (feature.bpmn / plan-fanout's `implement-cell`, issue #684; the delivery-graph runner's agent cells, issue #686) — the BASE branch, off which the harness cuts a new feature branch named by the optional `branch.create` (the deterministic `feat/<task.id>`, emitted for a single-task feature run AND — per issue #776 — the deterministic `feat/<node.id>` for each single-instance delivery-graph agent cell, injected per-cell by `agentNodeRepoEnvelope`/`app/deliveryRunner.ts` so a forgetful agent can never be left committing on the base branch and stranding its run on a non-ff push; the epic plan-fanout seed still omits it because its MI children each cut a per-child `feat/<task.id>` the app can't name at compile time, so those agents branch themselves). Beyond `{provider,url,ref}`, it carries clone-shaping fields for large monorepos (issue #287): `singleBranch:true` + `filter:\"blob:none\"` (a branch-scoped, blobless partial clone — trees fetched up-front, blobs lazily, no `--depth 1` so the merge-base/3-dot diff stays valid) and an optional `baseRef` (the PR base branch, emitted only when resolvable, so the harness fetches its tip and keeps `origin/<base>` reachable) and a `cloneTimeoutMs` (from `NANO_PR_CLONE_TIMEOUT_MS`, default 600000 = 10 min) that raises the harness's 120s default so a large monorepo's blobless single-branch clone provisions instead of dying at 120s (issue #694). World-restore (issue #324, ADR 0062 Slice 4/5): an optional `sha` — the last durable push-checkpoint — is emitted so a REPLACEMENT activation on a fresh worktree reconstructs the tree to the EXACT pushed SHA (inverting the round's `git push` into `git fetch && git checkout <sha>`), omitted when the PR has no checkpoint yet. The field is named `sha` because that is the field the c8ctl harness's `provisionRepo` reads to drive the checkout — an earlier `commitSha` key was a silent no-op (issue #695). Alongside the `repository` slice the envelope carries a sibling `task.allowPr: true` (issue #770): c8ctl-plugin-nano (≥1.60.2) only resolves the git credential (GITHUB_TOKEN, or the `gh` default) for repo provisioning behind that flag, so every repo-backed envelope sets it or the clone dies with `unable to get password from user`; the repoless path emits no envelope and so no `task`. Gated on c8ctl provisioner support (jwulf/c8ctl-plugin-nano#91, branch-cut guard jwulf/c8ctl-plugin-nano#231).",
|
|
403
403
|
shape:
|
|
404
404
|
'io.nanobpm.agentTask: { repository: { provider: "github", url: string, ref?: string, singleBranch: true, filter: "blob:none", cloneTimeoutMs: number, baseRef?: string, sha?: string, branch?: { create: string } }, task: { allowPr: true } }',
|
|
405
405
|
},
|
|
@@ -1057,15 +1057,19 @@ function innerBodyLines(w: NodeWiring, requiredEmits: ReadonlySet<string>): stri
|
|
|
1057
1057
|
|
|
1058
1058
|
/** Render the DECLARED per-node repository-spec marker task header (#739) for an `agent` node — a single
|
|
1059
1059
|
* `<zeebe:taskHeaders>` block carrying {@link AGENT_REPO_SPEC_HEADER} with a compact JSON of the node's
|
|
1060
|
-
* DECLARED `{ repository, baseBranch }` (each `null` when absent). It is emitted on EVERY
|
|
1061
|
-
* task (even one with no declared repo → `{"repository":null,"baseBranch":null}`) so the
|
|
1062
|
-
* single, uniform anchor to replace with the effective envelope on every cell.
|
|
1063
|
-
*
|
|
1064
|
-
*
|
|
1065
|
-
*
|
|
1060
|
+
* `id` and its DECLARED `{ repository, baseBranch }` (each `null` when absent). It is emitted on EVERY
|
|
1061
|
+
* agent service task (even one with no declared repo → `{"repository":null,"baseBranch":null}`) so the
|
|
1062
|
+
* runner has a single, uniform anchor to replace with the effective envelope on every cell. The node
|
|
1063
|
+
* `id` is carried here (issue #776) so the runner can emit the deterministic per-node `feat/<node.id>`
|
|
1064
|
+
* `branch.create` on the injected envelope — the identity is not otherwise recoverable from the isolated
|
|
1065
|
+
* `<zeebe:taskHeaders>` block the runner rewrites. Digest-stable and env-free — only the node id and
|
|
1066
|
+
* declared values (pure graph content) appear here; the run-level fallback and the env-dependent
|
|
1067
|
+
* `cloneTimeoutMs` are injected by the runner POST-digest. The id + declared values pass the
|
|
1068
|
+
* `owner/repo` + node-id/branch-name allowlists (validator/OpenAPI), so the JSON carries no XML-hostile
|
|
1069
|
+
* chars. */
|
|
1066
1070
|
function agentRepoSpecHeaderLines(node: Extract<DeliveryNode, { kind: "agent" }>): string[] {
|
|
1067
1071
|
const trimOrNull = (v: unknown): string | null => (typeof v === "string" && v.trim() !== "" ? v.trim() : null);
|
|
1068
|
-
const spec = JSON.stringify({ repository: trimOrNull(node.agent.repository), baseBranch: trimOrNull(node.agent.baseBranch) });
|
|
1072
|
+
const spec = JSON.stringify({ nodeId: node.id, repository: trimOrNull(node.agent.repository), baseBranch: trimOrNull(node.agent.baseBranch) });
|
|
1069
1073
|
return [
|
|
1070
1074
|
" <zeebe:taskHeaders>",
|
|
1071
1075
|
` <zeebe:header key="${AGENT_REPO_SPEC_HEADER}" ${attr("value", spec)} />`,
|
|
@@ -13,7 +13,7 @@ import { test } from "node:test";
|
|
|
13
13
|
import { assert, assertEquals, assertRejects } from "#test-assert";
|
|
14
14
|
import { AGENT_TERMINAL_SUCCESS_STATUSES } from "./deliveryGraphCompiler.ts";
|
|
15
15
|
import { prepareDeliveryGraph, renderEmitContract, renderIdempotencyPreamble, renderProducerContract, runDeliveryGraph } from "./deliveryRunner.ts";
|
|
16
|
-
import { RepoEnvelopeConflictError, RepoEnvelopeUnresolvedError } from "./repoEnvelope.ts";
|
|
16
|
+
import { RepoEnvelopeConflictError, RepoEnvelopeUnresolvedError, agentNodeRepoEnvelope } from "./repoEnvelope.ts";
|
|
17
17
|
import type { DeliveryGraph } from "../nano-generated/api-io.d.ts";
|
|
18
18
|
|
|
19
19
|
const GRAPH: DeliveryGraph = {
|
|
@@ -488,6 +488,9 @@ test("prepareDeliveryGraph injects the repository envelope PER agent cell from t
|
|
|
488
488
|
// Repo-provisioning auth gate (issue #770): the per-cell envelope carries `task.allowPr:true` so the
|
|
489
489
|
// c8ctl harness resolves the git credential for the clone instead of failing on password prompt.
|
|
490
490
|
assert(headers.some((h) => h.includes('task.allowPr" value="true"')), `expected a task.allowPr header, got ${JSON.stringify(headers)}`);
|
|
491
|
+
// The deterministic per-node isolation branch (issue #776): the harness cuts `feat/<node.id>` itself,
|
|
492
|
+
// so the agent can never be left committing on the base branch (a non-ff push that strands the run).
|
|
493
|
+
assert(headers.some((h) => h.includes('repository.branch.create" value="feat/open-b"')), `expected a per-node branch.create header, got ${JSON.stringify(headers)}`);
|
|
491
494
|
// No `__repoSpec` marker survives injection — it is the compiler's digest-stable anchor only.
|
|
492
495
|
assert(!p.bpmn.includes("__repoSpec"), "the __repoSpec marker is fully replaced");
|
|
493
496
|
// No run-root `io.nanobpm.agentTask` variable — the envelope rides headers now, not a run variable.
|
|
@@ -542,6 +545,68 @@ test("a declared repository WITHOUT a base branch omits ref/baseRef — the harn
|
|
|
542
545
|
assert(headers.some((h) => h.includes('repository.url" value="https://github.com/acme/one.git"')), "url present");
|
|
543
546
|
assert(!headers.some((h) => h.includes("repository.ref")), "no ref → clone the repo default branch");
|
|
544
547
|
assert(!headers.some((h) => h.includes("repository.baseRef")), "no baseRef either");
|
|
548
|
+
// Even without a known base, the deterministic isolation branch is still emitted (issue #776): the
|
|
549
|
+
// harness cuts `feat/<node.id>` off the cloned default tip, so the agent never commits on the default.
|
|
550
|
+
assert(headers.some((h) => h.includes('repository.branch.create" value="feat/a"')), `expected branch.create even without a base, got ${JSON.stringify(headers)}`);
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
test("each agent cell gets its OWN deterministic feat/<node.id> branch.create — never a shared branch (#776)", async () => {
|
|
554
|
+
const graph: DeliveryGraph = {
|
|
555
|
+
name: "deterministic isolation branches",
|
|
556
|
+
nodes: [
|
|
557
|
+
{ id: "impl-a", kind: "agent", agent: { jobType: "senior:feature", prompt: "a", repository: "acme/one" } },
|
|
558
|
+
{ id: "impl-b", kind: "agent", agent: { jobType: "senior:feature", prompt: "b", repository: "acme/two" } },
|
|
559
|
+
],
|
|
560
|
+
edges: [{ from: "impl-a", to: "impl-b" }],
|
|
561
|
+
};
|
|
562
|
+
const p = await prepareOk(graph, {});
|
|
563
|
+
const branches = agentHeaders(p.bpmn).filter((h) => h.includes("repository.branch.create"));
|
|
564
|
+
// Two distinct cells → two distinct per-node branches, so no two agents can collide on one branch.
|
|
565
|
+
assert(branches.some((h) => h.includes('value="feat/impl-a"')), `expected feat/impl-a, got ${JSON.stringify(branches)}`);
|
|
566
|
+
assert(branches.some((h) => h.includes('value="feat/impl-b"')), `expected feat/impl-b, got ${JSON.stringify(branches)}`);
|
|
567
|
+
assertEquals(branches.length, 2, "exactly one branch.create per agent cell");
|
|
568
|
+
});
|
|
569
|
+
|
|
570
|
+
test("an explicit repoless run emits NO branch.create — no envelope at all (#776/#729)", async () => {
|
|
571
|
+
const p = await prepareOk(GRAPH, { repoless: true });
|
|
572
|
+
assert(!p.bpmn.includes("repository.branch.create"), "a repoless run carries no isolation branch either");
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
test("a node id that derives an invalid git ref degrades to NO branch.create — never emits an unusable feat/... (#776)", async () => {
|
|
576
|
+
// Node ids are only constrained by `^[A-Za-z_][A-Za-z0-9_.-]*$`, laxer than git's ref rules: `a..b` and
|
|
577
|
+
// `a.lock` pass id validation but produce ill-formed `feat/...` refs the harness cannot create. The
|
|
578
|
+
// runner must degrade to the pre-#776 agent-cuts-its-own-branch behaviour (no branch.create) for those,
|
|
579
|
+
// not emit a branch the harness will choke on — while a sibling with a valid id still gets its branch.
|
|
580
|
+
const graph: DeliveryGraph = {
|
|
581
|
+
name: "invalid-ref node ids degrade",
|
|
582
|
+
nodes: [
|
|
583
|
+
{ id: "a..b", kind: "agent", agent: { jobType: "senior:feature", prompt: "a", repository: "acme/one" } },
|
|
584
|
+
{ id: "a.lock", kind: "agent", agent: { jobType: "senior:feature", prompt: "b", repository: "acme/two" } },
|
|
585
|
+
{ id: "ok", kind: "agent", agent: { jobType: "senior:feature", prompt: "c", repository: "acme/three" } },
|
|
586
|
+
],
|
|
587
|
+
edges: [{ from: "a..b", to: "a.lock" }, { from: "a.lock", to: "ok" }],
|
|
588
|
+
};
|
|
589
|
+
const p = await prepareOk(graph, {});
|
|
590
|
+
const branches = agentHeaders(p.bpmn).filter((h) => h.includes("repository.branch.create"));
|
|
591
|
+
// Only the valid-id cell keeps a branch.create; the two invalid-ref ids emit none (their agents still
|
|
592
|
+
// provision an isolated clone, they just cut their own branch inside it — the pre-#776 fallback).
|
|
593
|
+
assertEquals(branches.length, 1, `only the valid id keeps a branch.create, got ${JSON.stringify(branches)}`);
|
|
594
|
+
assert(branches[0].includes('value="feat/ok"'), `expected feat/ok, got ${JSON.stringify(branches)}`);
|
|
595
|
+
});
|
|
596
|
+
|
|
597
|
+
test("agentNodeRepoEnvelope emits branch.create off the base when known, off the default when not, and omits it when blank (#776)", () => {
|
|
598
|
+
const withBase = (agentNodeRepoEnvelope("acme/one", "main", "feat/n1") as any)["io.nanobpm.agentTask"].repository;
|
|
599
|
+
assertEquals(withBase.ref, "main", "known base → checked-out ref");
|
|
600
|
+
assertEquals(withBase.branch.create, "feat/n1", "the harness cuts feat/<node.id> off the base");
|
|
601
|
+
const noBase = (agentNodeRepoEnvelope("acme/one", null, "feat/n2") as any)["io.nanobpm.agentTask"].repository;
|
|
602
|
+
assertEquals("ref" in noBase, false, "no base → clone the default branch");
|
|
603
|
+
assertEquals(noBase.branch.create, "feat/n2", "branch.create is still emitted off the default tip");
|
|
604
|
+
// A whitespace-tainted branch is trimmed; a blank/absent one omits the `branch` key (pre-#776 behaviour).
|
|
605
|
+
assertEquals((agentNodeRepoEnvelope("acme/one", "main", " feat/n3 ") as any)["io.nanobpm.agentTask"].repository.branch.create, "feat/n3");
|
|
606
|
+
for (const blank of [null, undefined, "", " "]) {
|
|
607
|
+
const r = (agentNodeRepoEnvelope("acme/one", "main", blank as any) as any)["io.nanobpm.agentTask"].repository;
|
|
608
|
+
assertEquals("branch" in r, false, `expected no branch key for ${JSON.stringify(blank)}`);
|
|
609
|
+
}
|
|
545
610
|
});
|
|
546
611
|
|
|
547
612
|
test("prepareDeliveryGraph seeds NO envelope ONLY on an EXPLICIT repoless run — the conscious opt-out (#729)", async () => {
|
package/app/deliveryRunner.ts
CHANGED
|
@@ -18,6 +18,7 @@ import { createHash, randomUUID } from "node:crypto";
|
|
|
18
18
|
import type { EngineClient } from "@nanobpm/urban";
|
|
19
19
|
import type { DeliveryFact, DeliveryGraph, DeliveryNode } from "../nano-generated/api-io.d.ts";
|
|
20
20
|
import { TRANSCRIPT_URL_BASE_VAR, transcriptUrlBaseFor } from "./agentic/transcript-url.ts";
|
|
21
|
+
import { isPlausibleBranchName } from "./baseBranch.ts";
|
|
21
22
|
import { AGENT_REPO_SPEC_HEADER, AGENT_TERMINAL_SUCCESS_STATUSES, assertNever, compileDeliveryGraph, DELIVERY_GRAPH_PROCESS_ID } from "./deliveryGraphCompiler.ts";
|
|
22
23
|
import { DEFAULT_EVERY_MS, msToIsoDuration, parseProbe, readinessPollEvery, readinessTimeout } from "./readiness.ts";
|
|
23
24
|
import { agentNodeRepoEnvelope, flattenAgentTaskEnvelope, isResolvableRepo, RepoEnvelopeConflictError, RepoEnvelopeUnresolvedError } from "./repoEnvelope.ts";
|
|
@@ -80,9 +81,10 @@ export interface DeliveryRunOptions extends DeliveryRunTimeouts {
|
|
|
80
81
|
repository?: string | null;
|
|
81
82
|
/** OPTIONAL run-level base-branch DEFAULT for `agent` nodes that declare a `repository` but no
|
|
82
83
|
* `baseBranch` — the `ref` the harness checks out in the isolated clone (the PRE-PR shape: no PR head
|
|
83
|
-
* exists yet
|
|
84
|
-
*
|
|
85
|
-
*
|
|
84
|
+
* exists yet). Per issue #776 the harness itself cuts the deterministic `feat/<node.id>` branch off
|
|
85
|
+
* this base (emitted as `branch.create`) so a forgetful agent can never be left committing on the base
|
|
86
|
+
* branch; a node with a resolvable repository but no base clones the repo's default branch, so this is
|
|
87
|
+
* a convenience default, not a hard requirement. */
|
|
86
88
|
baseBranch?: string | null;
|
|
87
89
|
/** EXPLICIT opt-out of repository provisioning (issue #729). `true` → the run is dispatched with NO
|
|
88
90
|
* isolation envelope on ANY node (the per-node headers are stripped, the legacy launch-dir behaviour),
|
|
@@ -345,13 +347,28 @@ function injectAgentRepoEnvelopes(bpmn: string, graph: DeliveryGraph, options: D
|
|
|
345
347
|
);
|
|
346
348
|
return bpmn.replace(blockRe, (_full, indent: string, sq: string | undefined, dq: string | undefined, tail: string) => {
|
|
347
349
|
const raw = sq ?? (dq ?? "").replace(/'/g, "'").replace(/"/g, '"').replace(/</g, "<").replace(/>/g, ">").replace(/&/g, "&");
|
|
348
|
-
const declared: { repository: string | null; baseBranch: string | null } = JSON.parse(raw);
|
|
350
|
+
const declared: { nodeId?: string; repository: string | null; baseBranch: string | null } = JSON.parse(raw);
|
|
349
351
|
// `repoless` → strip the block entirely (no isolation envelope, the launch-dir fallback).
|
|
350
352
|
if (repoless) return "";
|
|
351
353
|
const effRepo = trimOrNull(declared.repository) ?? runRepo;
|
|
352
354
|
const effBase = trimOrNull(declared.baseBranch) ?? runBase;
|
|
355
|
+
// The deterministic per-node isolation branch (issue #776): the harness cuts `feat/<node.id>` itself
|
|
356
|
+
// so a cell can never leave its agent committing on the checked-out base branch (a non-ff push that
|
|
357
|
+
// strands the run — merlin job 20974). The node id rides the marker so it survives into this
|
|
358
|
+
// per-block rewrite; delivery-graph agent cells are single-instance, so the static per-node branch
|
|
359
|
+
// never collides across siblings. Omitted when the marker predates the id (a blank id degrades to the
|
|
360
|
+
// pre-#776 agent-cuts-its-own-branch behaviour rather than an ill-formed `feat/`).
|
|
361
|
+
// A graph node id is only constrained by `^[A-Za-z_][A-Za-z0-9_.-]*$` (deliveryGraph.ts), which is
|
|
362
|
+
// laxer than git's ref rules: ids like `a..b`, `a.`, or `a.lock` pass id validation yet produce an
|
|
363
|
+
// ill-formed `feat/...` ref the harness cannot create — turning the isolation guarantee into a
|
|
364
|
+
// launch/checkout failure. Validate the DERIVED branch with the same `isPlausibleBranchName` gate the
|
|
365
|
+
// dispatch doors use and degrade to null (the pre-#776 agent-cuts-its-own-branch behaviour) rather
|
|
366
|
+
// than emit an unusable branch.create.
|
|
367
|
+
const nodeId = trimOrNull(declared.nodeId);
|
|
368
|
+
const derivedBranch = nodeId ? `feat/${nodeId}` : null;
|
|
369
|
+
const branchCreate = derivedBranch !== null && isPlausibleBranchName(derivedBranch) ? derivedBranch : null;
|
|
353
370
|
// The unresolved invariant above guarantees a resolvable repo here on a non-repoless run.
|
|
354
|
-
const envelope = agentNodeRepoEnvelope(effRepo ?? "", effBase);
|
|
371
|
+
const envelope = agentNodeRepoEnvelope(effRepo ?? "", effBase, branchCreate);
|
|
355
372
|
const flat = flattenAgentTaskEnvelope(envelope);
|
|
356
373
|
const headerLines = Object.entries(flat).map(([k, v]) => `${indent} <zeebe:header key="${xmlAttr(k)}" value="${xmlAttr(v)}" />`);
|
|
357
374
|
if (headerLines.length === 0) return "";
|
package/app/repoEnvelope.ts
CHANGED
|
@@ -211,13 +211,26 @@ export function repoEnvelopeVars(
|
|
|
211
211
|
* `ref`): a cross-repo graph node carries only its `owner/repo` (an issue ref names no branch), so when
|
|
212
212
|
* neither the node nor the run declares a base the cell must still provision an isolated clone — of the
|
|
213
213
|
* repository's DEFAULT branch. The harness `provisionRepo` omits `--branch` when `ref` is blank, so a
|
|
214
|
-
* `ref`-less envelope clones the default branch
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
|
|
214
|
+
* `ref`-less envelope clones the default branch. Returns `{}` for a `repo` that is not a plain
|
|
215
|
+
* `owner/repo` (an unresolved cell — the runner's invariant rejects the run before this degrades to a
|
|
216
|
+
* launch-dir share). Blobless single-branch shaping + `cloneTimeoutMs` (issues #287/#694) are emitted on
|
|
217
|
+
* every cell.
|
|
218
|
+
*
|
|
219
|
+
* Deterministic isolation branch (issue #776): `branchCreate` (the per-node `feat/<node.id>`) is emitted
|
|
220
|
+
* as `branch.create` so the harness cuts the isolation branch ITSELF — mirroring the single-feature path
|
|
221
|
+
* (`repoEnvelopeVars`/`feature.ts`) — instead of delegating branch-cutting to agent prompt discipline. A
|
|
222
|
+
* forgetful agent that never branched used to commit on the checked-out BASE branch; its `git push
|
|
223
|
+
* origin <base>` was then rejected non-fast-forward and the whole run's work was stranded (merlin job
|
|
224
|
+
* 20974; harness counterpart jwulf/c8ctl-plugin-nano#231). Emitting `branch.create` makes it impossible
|
|
225
|
+
* for a cell to leave its agent committing on the base. Emitted independently of `ref`: when the base is
|
|
226
|
+
* unknown the harness cuts the branch off the cloned default tip; when known, off `ref`. Omitted for a
|
|
227
|
+
* blank `branchCreate` (falls back to the pre-#776 agent-cuts-its-own-branch behaviour). Delivery-graph
|
|
228
|
+
* agent cells are single-instance, so a static per-node `feat/<node.id>` never collides across siblings
|
|
229
|
+
* (the MI-child collision the issue flags does not arise in the current single-instance cells). */
|
|
230
|
+
export function agentNodeRepoEnvelope(repo: string, base: string | null, branchCreate: string | null = null): Record<string, unknown> {
|
|
219
231
|
if (!isPlainOwnerRepo(repo)) return {};
|
|
220
232
|
const ref = typeof base === "string" && base.trim() !== "" ? base.trim() : null;
|
|
233
|
+
const create = typeof branchCreate === "string" && branchCreate.trim() !== "" ? branchCreate.trim() : null;
|
|
221
234
|
return {
|
|
222
235
|
[AGENT_TASK_NS]: {
|
|
223
236
|
repository: {
|
|
@@ -226,9 +239,12 @@ export function agentNodeRepoEnvelope(repo: string, base: string | null): Record
|
|
|
226
239
|
singleBranch: true,
|
|
227
240
|
filter: "blob:none",
|
|
228
241
|
cloneTimeoutMs: cloneTimeoutMs(),
|
|
229
|
-
// A per-node base (declared, or defaulted from the run level) — the branch the
|
|
242
|
+
// A per-node base (declared, or defaulted from the run level) — the branch the harness cuts its
|
|
230
243
|
// `feat/<node.id>` off. Omitted when unknown so the harness clones the repo's default branch.
|
|
231
244
|
...(ref ? { ref, baseRef: ref } : {}),
|
|
245
|
+
// The deterministic isolation branch the harness cuts (issue #776), so the agent can never be
|
|
246
|
+
// left committing on the checked-out base branch. Off `ref` when known, else off the default tip.
|
|
247
|
+
...(create ? { branch: { create } } : {}),
|
|
232
248
|
},
|
|
233
249
|
// Repo-provisioning auth gate (issue #770): as in `repoEnvelopeVars`, a repo-backed cell must
|
|
234
250
|
// opt the harness into git-credential resolution (`task.allowPr`) or the clone fails with
|
package/openapi.yaml
CHANGED
|
@@ -2112,8 +2112,9 @@ components:
|
|
|
2112
2112
|
pattern: '^(?![/.-])(?!.*[/.]$)(?!.*\.\.)(?!.*//)(?!.*/\.)(?!.*\.lock(?:/|$))[A-Za-z0-9._/-]+$'
|
|
2113
2113
|
description: >-
|
|
2114
2114
|
OPTIONAL per-node base branch this agent node branches off (#739) — the `ref` the
|
|
2115
|
-
harness checks out in the isolated clone (the pre-PR shape: the
|
|
2116
|
-
`feat/<node.id>` branch off this base
|
|
2115
|
+
harness checks out in the isolated clone (the pre-PR shape: the harness cuts the
|
|
2116
|
+
deterministic `feat/<node.id>` branch off this base itself, per #776, so a forgetful
|
|
2117
|
+
agent can never be left committing on the base branch). Absent → the run-level dispatch `baseBranch`
|
|
2117
2118
|
(else the node's repository default branch). A value that is not a plausible git
|
|
2118
2119
|
branch name is rejected at submit; the pattern mirrors the authoritative server-side
|
|
2119
2120
|
gate (`isPlausibleBranchName`, app/baseBranch.ts).
|
|
@@ -5005,7 +5006,7 @@ paths:
|
|
|
5005
5006
|
type: string
|
|
5006
5007
|
maxLength: 255
|
|
5007
5008
|
pattern: ^(?![/.-])(?!.*[/.]$)(?!.*\.\.)(?!.*//)(?!.*/\.)(?!.*\.lock(?:/|$))[A-Za-z0-9._/-]+$
|
|
5008
|
-
description: "OPTIONAL per-node base branch this agent node branches off (#739) — the `ref` the harness checks out in the isolated clone (the pre-PR shape: the
|
|
5009
|
+
description: "OPTIONAL per-node base branch this agent node branches off (#739) — the `ref` the harness checks out in the isolated clone (the pre-PR shape: the harness cuts the deterministic `feat/<node.id>` branch off this base itself, per #776, so a forgetful agent can never be left committing on the base branch). Absent → the run-level dispatch `baseBranch` (else the node's repository default branch). A value that is not a plausible git branch name is rejected at submit; the pattern mirrors the authoritative server-side gate (`isPlausibleBranchName`, app/baseBranch.ts)."
|
|
5009
5010
|
converge:
|
|
5010
5011
|
type: boolean
|
|
5011
5012
|
description: 'OPTIONAL first-class CONVERGE policy (ADR 0006 §3 / S5) — a DECLARED, compiler- validated completion-policy flag on this cell node. It declares that the node''s opened PR is to be driven through the review-convergence loop to green as an edge-gated completion policy; this slice adds and validates the flag, with the delivery-graph execution wiring that consumes it landing in a follow-up slice. It supersedes (in intent) the emergent `feature.bpmn` `gw-converge` gateway and the "un-draft + merge #B" prompt prose a delivery-graph `agent` node used to smuggle. Converge and merge are SEPARABLE phases; a node may converge without merging (stop at green and gate the landing behind a downstream node).'
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nanobpm/nano-workforce",
|
|
3
|
-
"version": "0.187.
|
|
3
|
+
"version": "0.187.1",
|
|
4
4
|
"description": "Nano Workforce — an Agent Graph Orchestration application for Agentic SDLC: durable BPMN processes that coordinate a graph of AI agents across the software delivery lifecycle.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "main.ts",
|