Skip to content

Commit e8994ce

Browse files
fix(uipath-maestro-bpmn): edit a target outside /solution in /tmp, never init a project for it (Studio Web) (#4809) (#4878)
* fix(uipath-maestro-bpmn): edit a target outside /solution in /tmp, never init a project for it (Studio Web) The in-page SDK verbs and node reach only /solution and /tmp. A loose target elsewhere made agents scaffold a project to satisfy refresh, leaving a stray template that fails validate and stamping an entryPointId the user did not author. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * test(studioweb): guard the outside-/solution edit rule for BPMN Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): quote the SDK's refusal, make the loose-target steps runnable, scope the entryPointId rule in draft mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): a loose target skips the connector step, since only refresh writes bindings_v2.json Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): name the connector bullet a loose target skips; drop the unbacked reply instruction Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): scope the outside-/solution rule to an existing file, override the Workflow's refresh, add cd and undo Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): name Critical Rule 5 in the no-refresh override; narrow the /solution copy refusal to its evidence Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): the Studio Web merge baseline is a compile of the unedited source, never a copy of the target A copy of the target holds pools and lanes the SDK does not model, so merge reads them as deleted (preserve-lanes-conditions, run 43959425762: Removed 9, plane re-targeted after format). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(uipath-maestro-bpmn): one baseline rule for both wrong baselines (target copy, edited file); mkdir and re-merge in the recovery Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e37d8f7 commit e8994ce

3 files changed

Lines changed: 33 additions & 2 deletions

File tree

‎skill-flavors/studioweb/uipath-maestro-bpmn/SKILL.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,14 @@ The target is the `.bpmn` the user names, else the `.bpmn` at `CurrentFile.Absol
1818

1919
**Drafts live in two places.** `/solution/<Project>/.flow-sdk/` keeps `<Name>.bpmn.ts`, the undo copy `original/<Name>.bpmn` and the `registry prepare` output. `<Draft>/baseline/` and `<Draft>/edited/` hold throw-away copies: each turn rebuilds them, and a page reload clears `/tmp`.
2020

21+
**An existing `.bpmn` outside a `/solution` project** — a mounted file, for example under `/sandbox`, or a loose file in `/tmp` — has no `project.uiproj`. Outside `/solution` and `/tmp`, your file tools, `cp` and `validate` reach it, but `decompile`, `compile`, `merge` and `node` do not: they answer `ENOENT`, `the builder SDK works only on files under /solution and /tmp` or `path is outside /solution and /tmp`. Ignore the hint to pass a copy under `/solution`: copying the file from outside into a project there fails (`binary writes are not supported`). Edit a copy:
22+
23+
1. Run `cd /tmp && mkdir -p /tmp/bpmn-work/<Name>`, then copy the target there as `<Name>.bpmn`. That folder stands in for `/solution/<Project>` in the [Workflow](#workflow) and the [Validation loop](#validation-loop), and `<Draft>` is `/tmp/bpmn-draft/<Name>`.
24+
2. Run the loop there without `refresh`, even where the Critical Rules, the Workflow or the loop say to run it every time: with no `project.uiproj`, `refresh` fails. Keep a seeded `.metadata({ entryPointId: false })`; only `refresh` needs the id, and deleting it stamps a new one on the start event. Skip the loop's **A process with connectors** bullet too: it reads `bindings_v2.json`, which only `refresh` writes.
25+
3. `cp` the result back over the target (`node` cannot reach it), then `validate` the target. To undo, `cp .flow-sdk/original/<Name>.bpmn` from the work folder back over the target the same way.
26+
27+
Never run `init` to give an existing file outside `/solution` a project. The user did not ask for one, and its template is a second process that fails `validate`.
28+
2129
**Never delete or rename a file under `/solution`.** The project file system refuses both. Overwrite the file instead. `ls -l` shows every file there as 0 bytes: use `wc -c` for a size.
2230

2331
**A read-only page refuses every write.** When the page shows "Locked by you" and an Edit button, a write fails, sometimes as `[object Object]`. Tell the user to click Edit, then try again.
@@ -65,7 +73,7 @@ When a reference tells you to run a command that is not available, use the Studi
6573
4. Seed the source every turn by decompiling the target —
6674
`uip maestro bpmn decompile <Name>.bpmn -o .flow-sdk/<Name>.bpmn.ts --style nested` — rather than
6775
hand-writing the skeleton. A new project's `.bpmn` is the template Studio Web or `init` wrote: decompile it too.
68-
Its source has `.metadata({ entryPointId: false })`: delete that key, or `refresh` fails. The SDK then derives the id.
76+
When its source has `.metadata({ entryPointId: false })` and the target is in a project, delete that key, or `refresh` fails. The SDK then derives the id, as the canvas mints one for a start event without it. A [target outside a project](#studio-web) keeps the key.
6977
<!--skill-flavor:workflow-seed:end-->
7078

7179
<!--skill-flavor:workflow-compile:start-->
@@ -128,6 +136,13 @@ uip maestro bpmn format <Name>.bpmn
128136
- **Step 1 runs once per turn.** When a later step fails, fix the source and
129137
start again at step 2. Step 1 again would copy the merged file over the undo
130138
copy and the baseline.
139+
- **The baseline is step 1's compile of the unedited source, never a copy of the target or the edited file.**
140+
`merge` reads what the baseline holds and the edit lacks as deleted. A copy of the
141+
target holds the pools, lanes and diagram the SDK does not model, so `merge` deletes
142+
them; the edited file shows `merge` no change, so it writes the target back as it was.
143+
When `merge` cannot open the baseline, run `mkdir -p <Draft>/baseline`, decompile `.flow-sdk/original/<Name>.bpmn`
144+
to `<Draft>/<Name>.baseline.bpmn.ts`, compile that to `<Draft>/baseline/<Name>.bpmn`,
145+
and run step 3's `merge` again.
131146
- **Step 5 lays out the whole canvas again.** `merge` keeps every shape of the
132147
target, also where the user moved it. A newer SDK also draws the shapes of
133148
new elements; an older one draws none, and step 4 then reports

‎skill-flavors/studioweb/uipath-maestro-bpmn/references/draft-skeleton.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
2. Run step 1 of the [Validation loop](../SKILL.md#validation-loop) to seed `.flow-sdk/<Name>.bpmn.ts` from the target.
55
When the target is empty, write the skeleton as the loop's empty-target rule says instead.
66
3. Rewrite the chain as the skeleton, in one write, keeping the seeded process id and start event id.
7-
When the seeded source has `.metadata({ entryPointId: false })`, delete that key, or `refresh` fails.
7+
When the seeded source has `.metadata({ entryPointId: false })` and the target is in a project, delete that key, or `refresh` fails. A [target outside a project](../SKILL.md#studio-web) keeps the key and skips `refresh`.
88
4. Run steps 2 to 5 of the [Validation loop](../SKILL.md#validation-loop): `check`, compile into `<Draft>/edited/`, `merge` into the target, `refresh` and `validate`.
99
Merge keeps the shapes the user already has on the canvas. An empty target is the one exception: compile straight over it, then lay it out with `format`.
1010
`validate` must report `Status: Valid`.

‎tests/scripts/studioweb-flavor-contract.test.mjs‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,22 @@ test("the studioweb BPMN skill says evals are not available, in the routing tabl
338338
assert.ok(evaluate.includes("**Not available in Studio Web.**"));
339339
});
340340

341+
// The in-page SDK verbs and `node` reach only /solution and /tmp (coder_eval
342+
// studio-web run 2026-11-16_09-25-49: `decompile: ENOENT /sandbox/…`, `Node
343+
// sandbox path is outside /solution and /tmp`). Agents that scaffolded a
344+
// project for a loose target left a stray template that fails validate, and
345+
// deleting a seeded `entryPointId: false` stamped an id on an untouched start
346+
// event (add-node in a project, move-node in /tmp).
347+
test("the studioweb BPMN skill edits a target outside /solution as a /tmp copy, never via init", (t) => {
348+
const skill = readFileSync(join(buildStudioweb(t), "uipath-maestro-bpmn", "SKILL.md"), "utf8");
349+
350+
assert.ok(skill.includes("**An existing `.bpmn` outside a `/solution` project**"));
351+
assert.ok(skill.includes("Run `cd /tmp && mkdir -p /tmp/bpmn-work/<Name>`"));
352+
assert.ok(skill.includes("Never run `init` to give an existing file outside `/solution` a project."));
353+
assert.ok(skill.includes("**The baseline is step 1's compile of the unedited source, never a copy of the target or the edited file.**"));
354+
assert.ok(skill.includes("and the target is in a project, delete that key"));
355+
});
356+
341357
// `debug-instance` is a terminal-CLI alias of `debug-instances`. The browser
342358
// snapshot (assets/uip-browser-commands-snapshot.json) lists only the plural,
343359
// and the studioweb operate page and SKILL.md teach it, so diagnose must too.

0 commit comments

Comments
 (0)