@minicor/mcp-server 4.3.0 → 4.5.0
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/README.md +19 -8
- package/dist/__tests__/jobs-tools.test.js +230 -0
- package/dist/__tests__/jobs-tools.test.js.map +1 -1
- package/dist/__tests__/middleware-service-client.test.js +83 -0
- package/dist/__tests__/middleware-service-client.test.js.map +1 -1
- package/dist/bootstrap.js +10 -0
- package/dist/bootstrap.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/lib.js +1 -1
- package/dist/middleware-service-client.d.ts +68 -0
- package/dist/middleware-service-client.d.ts.map +1 -1
- package/dist/middleware-service-client.js +20 -0
- package/dist/middleware-service-client.js.map +1 -1
- package/dist/prompts/build-rpa.d.ts.map +1 -1
- package/dist/prompts/build-rpa.js +6 -1
- package/dist/prompts/build-rpa.js.map +1 -1
- package/dist/prompts/nestjs-to-job.js +3 -3
- package/dist/prompts/nestjs-to-job.js.map +1 -1
- package/dist/server-surface.d.ts.map +1 -1
- package/dist/server-surface.js +4 -0
- package/dist/server-surface.js.map +1 -1
- package/dist/sync.js +7 -3
- package/dist/sync.js.map +1 -1
- package/dist/tools/jobs.d.ts.map +1 -1
- package/dist/tools/jobs.js +135 -12
- package/dist/tools/jobs.js.map +1 -1
- package/dist/tools/vm-rpa.js +3 -3
- package/dist/tools/vm-rpa.js.map +1 -1
- package/package.json +1 -1
- package/skills/general/job-build-loop.md +35 -3
- package/skills/general/nestjs-middleware-to-job.md +7 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: job-build-loop
|
|
3
|
-
description: The Minicor test-case-first build/debug loop for Jobs. Jobs are the macroscope (test cases, step graph, executions); Dev Mode is the microscope (one workflow's internal flow steps). Prescriptive tool sequences for teaching, building drafts, running the green-gate, drilling failures top-down, step-range replays with seeded ctx, cooperative stop, and publishing. Use EVERY TIME you build or debug a Job.
|
|
3
|
+
description: The Minicor test-case-first build/debug loop for Jobs. Jobs are the macroscope (test cases grouped into scenarios, step graph, executions); Dev Mode is the microscope (one workflow's internal flow steps). Prescriptive tool sequences for teaching, building drafts, running the green-gate, drilling failures top-down, step-range replays with seeded ctx, cooperative stop, and publishing. Use EVERY TIME you build or debug a Job.
|
|
4
4
|
category: general
|
|
5
|
-
tags: [jobs, testing, build-loop, debugging, test-cases, mandatory]
|
|
5
|
+
tags: [jobs, testing, build-loop, debugging, test-cases, scenarios, mandatory]
|
|
6
6
|
priority: 100
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -13,6 +13,14 @@ platform's Jobs UI (Overview = macroscope, Build = microscope) and is **test-cas
|
|
|
13
13
|
the test cases ARE the definition of done. Never build a step graph before you can say what
|
|
14
14
|
"green" means.
|
|
15
15
|
|
|
16
|
+
Vocabulary: customers teach a job by sending **sample API calls** (JSON inputs). Samples
|
|
17
|
+
group into **scenarios** — named buckets for the distinct paths/outcomes a job can take
|
|
18
|
+
(happy path, a validation rejection, a not-found branch, ...). Scenarios are FIRST-CLASS:
|
|
19
|
+
each sample is one test case, and its scenario is its `scenarioId` (manage scenarios with
|
|
20
|
+
`list_scenarios` / `create_scenario` / `update_scenario` / `delete_scenario`). The legacy
|
|
21
|
+
`scenario:<slug>` tag on cases is dual-written as a compatibility layer — a scenarioId
|
|
22
|
+
write rewrites the tag, and a tag-only write finds-or-creates the Scenario.
|
|
23
|
+
|
|
16
24
|
```
|
|
17
25
|
teach / add_test_case <- 1. green-gate first
|
|
18
26
|
-> update_job variant=draft <- 2. build the macroscope (step graph)
|
|
@@ -58,6 +66,22 @@ Before writing any definition:
|
|
|
58
66
|
- Tighten or disable cases later with `update_test_case` (e.g. `enabled: false` instead of
|
|
59
67
|
deleting history).
|
|
60
68
|
|
|
69
|
+
**Group cases into scenarios as you go.** Each case is one sample input; its scenario is the
|
|
70
|
+
path/outcome it exercises. Set it via the `scenarioId` param on `add_test_case` /
|
|
71
|
+
`update_test_case` (create with `create_scenario`, or find ids with `list_scenarios`).
|
|
72
|
+
`teach_job` can't set it directly — after every test/teach run the service auto-groups
|
|
73
|
+
ungrouped cases by the execution path they took (manual grouping is never overridden);
|
|
74
|
+
rename auto-created scenarios with `update_scenario`, or move a case with
|
|
75
|
+
`update_test_case scenarioId` (null ungroups):
|
|
76
|
+
|
|
77
|
+
- Name the scenario after the path/outcome, not the input: `rejects-missing-last-name`,
|
|
78
|
+
`books-earliest-slot` — NOT `john-smith`.
|
|
79
|
+
- All cases in a scenario share IDENTICAL assertions — the assertions are the scenario's
|
|
80
|
+
definition of its outcome. Add more samples to a scenario by adding more cases with the
|
|
81
|
+
same scenarioId + assertions. Ungrouped cases are treated as one-sample scenarios.
|
|
82
|
+
- Compatibility: the legacy `scenario:<slug>` tag still works (it finds-or-creates the
|
|
83
|
+
Scenario) and is kept in sync on every scenarioId write — prefer scenarioId.
|
|
84
|
+
|
|
61
85
|
A job with zero test cases is not buildable — there is no definition of correct.
|
|
62
86
|
|
|
63
87
|
## Step 2: Build the draft (macroscope)
|
|
@@ -77,7 +101,10 @@ run_tests(variant="draft") # all enabled cases
|
|
|
77
101
|
run_tests(variant="draft", testCaseIds=[...]) # a subset while iterating
|
|
78
102
|
```
|
|
79
103
|
|
|
80
|
-
- Returns totals + per-case results, each linking a `jobExecutionId` for drill-down
|
|
104
|
+
- Returns totals + per-case results, each linking a `jobExecutionId` for drill-down —
|
|
105
|
+
plus a per-scenario `scenarios` grouping with prebuilt summaries
|
|
106
|
+
("Refund Flow: 3/3 samples passed"). A scenario is green only when ALL of its sample
|
|
107
|
+
cases pass; ungrouped cases land in a trailing "Ungrouped" bucket.
|
|
81
108
|
- Green -> Step 6 (publish). Red -> Step 4.
|
|
82
109
|
|
|
83
110
|
## Step 4: Drill failures top-down (macroscope)
|
|
@@ -158,6 +185,11 @@ runs, fixes through the executor).
|
|
|
158
185
|
## Anti-patterns
|
|
159
186
|
|
|
160
187
|
- Building a definition before any test case exists (no green-gate).
|
|
188
|
+
- Cases in one scenario with divergent assertions (a scenario has ONE definition of its
|
|
189
|
+
outcome — if two cases expect different outcomes, they are different scenarios).
|
|
190
|
+
- Naming a scenario after its input instead of its path/outcome (`john-smith`).
|
|
191
|
+
- Leaving auto-created scenarios named "Scenario N" — rename them (update_scenario) to
|
|
192
|
+
describe the behavior they capture.
|
|
161
193
|
- Re-running the entire job to debug one mid-graph step (use fromStepId + seedExecutionId).
|
|
162
194
|
- Using a range run WITHOUT `seedExecutionId` for a mid-graph start (ctx will be empty).
|
|
163
195
|
- Editing a workflow's Dev Mode branch and re-running job tests without `dev_mode_publish`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: nestjs-middleware-to-job
|
|
3
|
-
description: Turn an existing NestJS customer middleware endpoint (a controller that orchestrates Minicor workflows) into a Job — a structured JobDefinition step graph registered via register_job, with test cases as the green-gate. Use when migrating customers/middlewares/* controllers onto the Jobs layer.
|
|
3
|
+
description: Turn an existing NestJS customer middleware endpoint (a controller that orchestrates Minicor workflows) into a Job — a structured JobDefinition step graph registered via register_job, with test cases (sample inputs tagged into scenarios) as the green-gate. Use when migrating customers/middlewares/* controllers onto the Jobs layer.
|
|
4
4
|
category: task
|
|
5
5
|
tags: [jobs, middleware, nestjs, migration, testing, register_job]
|
|
6
6
|
priority: 80
|
|
@@ -66,13 +66,16 @@ the controller's `WORKFLOW_IDS` constants.
|
|
|
66
66
|
4. Build the step graph per the table. Login/smart-launch → a `cache`d workflow step. Each
|
|
67
67
|
downstream workflow → a workflow step with templated `input`. Munging → the `output` block.
|
|
68
68
|
5. **Define the green-gate FIRST**: `add_test_case` with a representative (test-only) input and
|
|
69
|
-
assertions over the expected output, e.g. `output.web_agent_video_url != null`.
|
|
69
|
+
assertions over the expected output, e.g. `output.web_agent_video_url != null`. Tag each case
|
|
70
|
+
into a scenario (`scenario:<slug>`, named after the path/outcome — one per distinct path the
|
|
71
|
+
endpoint can take); cases in a scenario share identical assertions, one sample input each.
|
|
70
72
|
6. `register_job(workspaceId, middlewareId, path, definition)` (create a router first with
|
|
71
73
|
`create_router` if needed).
|
|
72
74
|
7. `run_job` with the test input; inspect the JobExecution — each workflow step carries
|
|
73
75
|
`workflowExecutionId` + `region` to deep-link the real Minicor run.
|
|
74
|
-
8. **Green-gate**: `run_tests` until `green: true`.
|
|
75
|
-
|
|
76
|
+
8. **Green-gate**: `run_tests` until `green: true`. Read results per-scenario (group cases by
|
|
77
|
+
their `scenario:` tag; a scenario is green only when all its samples pass). Drill into
|
|
78
|
+
failures → job execution → step → Minicor run; fix with `update_job` and re-run.
|
|
76
79
|
|
|
77
80
|
## Rules
|
|
78
81
|
|