@synap-core/workspace-templates 0.56.0 → 0.58.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/capabilities/design.capability.json +2852 -0
- package/capabilities/github-read.capability.json +2 -2
- package/dist/{define-Dto5_E47.d.ts → define-KudS9Ja_.d.ts} +11 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +47 -22
- package/dist/index.js.map +1 -1
- package/dist/wire.d.ts +1 -1
- package/package.json +1 -1
- package/skills/designing-with-real-components/SKILL.md +3 -5
- package/src/brand-library.yaml +1 -0
- package/src/builder.yaml +39 -25
- package/src/crm.yaml +5 -3
- package/src/design-capability.test.ts +69 -0
- package/src/intent.test.ts +41 -0
- package/src/ship-a-change.template.test.ts +83 -0
- package/src/templates.ts +30 -20
- package/src/types.ts +12 -1
- package/src/validate.ts +13 -2
package/dist/wire.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-
|
|
1
|
+
import { g as PackageDefinitionOutput, X as WorkspaceDefinitionInput } from './define-KudS9Ja_.js';
|
|
2
2
|
import '@synap-core/types/presentation';
|
|
3
3
|
import '@synap-core/types/space-brief';
|
|
4
4
|
import '@synap-core/types/capability-intents';
|
package/package.json
CHANGED
|
@@ -123,11 +123,9 @@ page becomes one frame) and every save writes 3.
|
|
|
123
123
|
"y": 0, "w": 390, "h": 844, "pageOf": "f1", "page": { "root": { "props": {} }, "content": [] } }` shows
|
|
124
124
|
f1's page at 390. Never copy a page into a second frame for another width.
|
|
125
125
|
- `Grid` has no `columns` prop (dropped and named on read).
|
|
126
|
-
- Layout blocks take exact values, never pixels: `gap`, `padding`, `paddingX`, `paddingY`
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
`space-1200`); a `Box` `background` takes `none`, `background`, `background-surface` or `paper`;
|
|
130
|
-
`radius` takes `none`, `radius-container` or `radius-floating`; `border` takes `none` or `hairline`.
|
|
126
|
+
- Layout blocks take exact values, never pixels: their spacing (`gap`, `padding`, `paddingX`, `paddingY`),
|
|
127
|
+
`background`, `radius` and `border` props are `select`s whose options are token steps. Read the options
|
|
128
|
+
from `design.catalog` (its `layout` half: block → prop → `{ kind: "select", options }`), never from memory.
|
|
131
129
|
- A label slot (a button's `children`) holds only inline blocks: `Text` or a component whose name ends in
|
|
132
130
|
`Icon` or `Glyph`. Never another button or a layout block.
|
|
133
131
|
- The canvas drops and names, at any depth: an unknown `type`, an undeclared or wrong prop, and a block
|
package/src/brand-library.yaml
CHANGED
|
@@ -508,6 +508,7 @@ profiles:
|
|
|
508
508
|
inputType: textarea
|
|
509
509
|
- slug: token-json
|
|
510
510
|
label: Tokens JSON
|
|
511
|
+
description: A W3C DTCG 2025.10 token file (Synap's own paths, e.g. space.space-200, radius.radius-container, grid.grid-columns-expanded) whose values are this brand's. The Design app draws a project's frames in it; a file that is not DTCG is kept, but frames keep Synap's values.
|
|
511
512
|
valueType: string
|
|
512
513
|
inputType: textarea
|
|
513
514
|
- slug: token-css
|
package/src/builder.yaml
CHANGED
|
@@ -48,10 +48,13 @@ meta:
|
|
|
48
48
|
label: Product
|
|
49
49
|
# The ONE primary output (One model decision 3): the feature is what the dev loop ships (Build a change works one).
|
|
50
50
|
primary: devplane_feature
|
|
51
|
+
# A story and a UI design are worked here to serve the feature, not outputs of their own.
|
|
51
52
|
produces:
|
|
52
53
|
- profile: devplane_feature
|
|
53
54
|
- profile: devplane_story
|
|
55
|
+
as: helper
|
|
54
56
|
- profile: ui-design
|
|
57
|
+
as: helper
|
|
55
58
|
|
|
56
59
|
workspace:
|
|
57
60
|
name: Dev
|
|
@@ -2117,11 +2120,15 @@ playbooks:
|
|
|
2117
2120
|
worktree, commit in verified slices, and run the smallest gate that
|
|
2118
2121
|
answers for each finished slice, with its negative control; quote the
|
|
2119
2122
|
output. PR OPENED: open a draft pull request whose body carries the line
|
|
2120
|
-
"Pod session: <this session id>", and
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
+
"Pod session: <this session id>", and complete THIS stage's output
|
|
2124
|
+
pull-request with its url (completeOutput pull-request, ref.url): this
|
|
2125
|
+
step's criterion pr-opened names it, so Checks waits for that one, and
|
|
2126
|
+
the Merged step's criterion merged names it too, so the merge grades it
|
|
2127
|
+
there. A second pull request, in another repo, is its own outcome
|
|
2128
|
+
pr-<repo>-<number> (kind pull_request, ref url), with a session
|
|
2129
|
+
criterion that names it with outputKey pr-<repo>-<number>,
|
|
2123
2130
|
"<repo>#<number> is merged", checked by the capability
|
|
2124
|
-
github_check_pr_merged, so the pod grades
|
|
2131
|
+
github_check_pr_merged, so the pod grades that merge itself. CHECKS: read the checks on the pull request's head with
|
|
2125
2132
|
github_pr_checks (the github-read capability, on the person's own token)
|
|
2126
2133
|
or wait for the ci.finished event; a red check sends the work back to
|
|
2127
2134
|
Build. MERGE: a person merges; never merge and never push to main. The
|
|
@@ -2173,14 +2180,16 @@ playbooks:
|
|
|
2173
2180
|
category: started
|
|
2174
2181
|
tier: standard
|
|
2175
2182
|
subjectStatus: in_review
|
|
2176
|
-
goal: 'Open a draft pull request whose body carries the line "Pod session: <this session id>" and
|
|
2183
|
+
goal: 'Open a draft pull request whose body carries the line "Pod session: <this session id>" and complete THIS output, pull-request, with its url (completeOutput pull-request, ref.url). A second pull request in another repo is its own outcome pr-<repo>-<number>.'
|
|
2177
2184
|
expectedOutputs:
|
|
2178
|
-
-
|
|
2179
|
-
|
|
2185
|
+
- key: pull-request
|
|
2186
|
+
kind: pull_request
|
|
2187
|
+
label: 'Pull request: complete this output with its url (completeOutput pull-request, ref.url)'
|
|
2180
2188
|
relationToSubject: none
|
|
2181
2189
|
criteria:
|
|
2182
2190
|
- key: pr-opened
|
|
2183
|
-
statement: A pull request for this change is open and recorded
|
|
2191
|
+
statement: A pull request for this change is open and recorded as this stage's pull-request output with its url.
|
|
2192
|
+
outputKey: pull-request
|
|
2184
2193
|
check: { kind: evidence, evidenceKey: pr-opened }
|
|
2185
2194
|
- key: pr-names-session
|
|
2186
2195
|
statement: The pull request body carries the line naming this Pod session.
|
|
@@ -2202,10 +2211,11 @@ playbooks:
|
|
|
2202
2211
|
name: Merged
|
|
2203
2212
|
category: started
|
|
2204
2213
|
tier: standard
|
|
2205
|
-
goal: A person merges the pull request; the merge
|
|
2214
|
+
goal: A person merges the pull request; the merge meets its output, graded by the criterion that names it by outputKey (merged for pull-request; for a second pull request its own, github_check_pr_merged on GitHub's own answer). Never merge and never push to main.
|
|
2206
2215
|
criteria:
|
|
2207
2216
|
- key: merged
|
|
2208
2217
|
statement: The pull request is merged.
|
|
2218
|
+
outputKey: pull-request
|
|
2209
2219
|
check:
|
|
2210
2220
|
kind: evidence
|
|
2211
2221
|
evidenceKey: merged
|
|
@@ -2363,17 +2373,18 @@ playbooks:
|
|
|
2363
2373
|
- key: change-recorded
|
|
2364
2374
|
check:
|
|
2365
2375
|
kind: judge
|
|
2366
|
-
statement: 'The change is recorded on the session
|
|
2376
|
+
statement: 'The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo.'
|
|
2367
2377
|
- key: pr-names-session
|
|
2368
2378
|
check:
|
|
2369
2379
|
kind: judge
|
|
2370
2380
|
statement: A pull request body, when there is one, carries the line naming this Pod session.
|
|
2371
|
-
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then
|
|
2381
|
+
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.'
|
|
2372
2382
|
tier: standard
|
|
2373
2383
|
subjectStatus: in_review
|
|
2374
2384
|
expectedOutputs:
|
|
2375
|
-
-
|
|
2376
|
-
|
|
2385
|
+
- key: pull-request
|
|
2386
|
+
kind: pull_request
|
|
2387
|
+
label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
|
|
2377
2388
|
optional: true
|
|
2378
2389
|
- key: checks
|
|
2379
2390
|
gate:
|
|
@@ -2547,16 +2558,17 @@ playbooks:
|
|
|
2547
2558
|
- key: change-recorded
|
|
2548
2559
|
check:
|
|
2549
2560
|
kind: judge
|
|
2550
|
-
statement: 'The change is recorded on the session
|
|
2561
|
+
statement: 'The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo.'
|
|
2551
2562
|
- key: pr-names-session
|
|
2552
2563
|
check:
|
|
2553
2564
|
kind: judge
|
|
2554
2565
|
statement: A pull request body, when there is one, carries the line naming this Pod session.
|
|
2555
|
-
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then
|
|
2566
|
+
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.'
|
|
2556
2567
|
tier: standard
|
|
2557
2568
|
expectedOutputs:
|
|
2558
|
-
-
|
|
2559
|
-
|
|
2569
|
+
- key: pull-request
|
|
2570
|
+
kind: pull_request
|
|
2571
|
+
label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
|
|
2560
2572
|
optional: true
|
|
2561
2573
|
- key: checks
|
|
2562
2574
|
gate:
|
|
@@ -2791,16 +2803,17 @@ playbooks:
|
|
|
2791
2803
|
- key: change-recorded
|
|
2792
2804
|
check:
|
|
2793
2805
|
kind: judge
|
|
2794
|
-
statement: 'The change is recorded on the session
|
|
2806
|
+
statement: 'The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo.'
|
|
2795
2807
|
- key: pr-names-session
|
|
2796
2808
|
check:
|
|
2797
2809
|
kind: judge
|
|
2798
2810
|
statement: A pull request body, when there is one, carries the line naming this Pod session.
|
|
2799
|
-
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then
|
|
2811
|
+
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.'
|
|
2800
2812
|
tier: standard
|
|
2801
2813
|
expectedOutputs:
|
|
2802
|
-
-
|
|
2803
|
-
|
|
2814
|
+
- key: pull-request
|
|
2815
|
+
kind: pull_request
|
|
2816
|
+
label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
|
|
2804
2817
|
optional: true
|
|
2805
2818
|
- key: checks
|
|
2806
2819
|
gate:
|
|
@@ -2952,16 +2965,17 @@ playbooks:
|
|
|
2952
2965
|
- key: change-recorded
|
|
2953
2966
|
check:
|
|
2954
2967
|
kind: judge
|
|
2955
|
-
statement: 'The change is recorded on the session
|
|
2968
|
+
statement: 'The change is recorded on the session with its url: the pull-request output of this stage for a public repo (a second PR in another repo: its own outcome pr-<repo>-<number>), commit-<repo>-<sha8> for a private repo.'
|
|
2956
2969
|
- key: pr-names-session
|
|
2957
2970
|
check:
|
|
2958
2971
|
kind: judge
|
|
2959
2972
|
statement: A pull request body, when there is one, carries the line naming this Pod session.
|
|
2960
|
-
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then
|
|
2973
|
+
description: 'Shared land stage. Public repo (backend, synap-cli): open a DRAFT pull request whose body carries the line "Pod session: <session id>", then complete the pull-request output of THIS stage with its url (completeOutput pull-request, ref.url); a second pull request in another repo is its own outcome pr-<repo>-<number> (kind pull_request, ref url). Private repo (app-bases, browser, relay-app, control-plane-api, control-plane-dashboard, synap-bridge): no PR; rebase on origin/main, push the branch and queue the smallest devbox gate on its full sha with GATE_POD_SESSION set. One session, one PR per repo. Done by the ship flow and the outcome verbs, not by free reasoning. Rules: work-units, github-ci, devbox-gates. Tools: git, gh, devbox queue, synap_update_session. Gate: none.'
|
|
2961
2974
|
tier: standard
|
|
2962
2975
|
expectedOutputs:
|
|
2963
|
-
-
|
|
2964
|
-
|
|
2976
|
+
- key: pull-request
|
|
2977
|
+
kind: pull_request
|
|
2978
|
+
label: 'Draft pull request: complete this output with its url (completeOutput pull-request, ref.url); public repo only'
|
|
2965
2979
|
optional: true
|
|
2966
2980
|
- key: checks
|
|
2967
2981
|
gate:
|
package/src/crm.yaml
CHANGED
|
@@ -2409,9 +2409,11 @@ playbooks:
|
|
|
2409
2409
|
table (entities.list, entities.get, views.list, profiles.list,
|
|
2410
2410
|
lifecycle.board, flow.of, lifecycle.throughput, attention.needsYou,
|
|
2411
2411
|
attention.count, sessions.list, lifecycle.home, lifecycle.moving,
|
|
2412
|
-
documents.get, lens.page
|
|
2413
|
-
|
|
2414
|
-
|
|
2412
|
+
documents.get, lens.page, sessions.get, playbook.process,
|
|
2413
|
+
playbook.scorecard, project.pillars) and only that op's params; the
|
|
2414
|
+
host stamps the space, so never put a workspaceId, a token, a pod URL
|
|
2415
|
+
or a fetch in the page. What the bridge reads stays live: query it in
|
|
2416
|
+
the page, never
|
|
2415
2417
|
paste its rows. What it cannot read yet (messages, replies, sends: the
|
|
2416
2418
|
bridge has no message op) you read now with your own tools
|
|
2417
2419
|
(synap_get_channel, synap_get_entities) and write into the page as a
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `design` capability (plan 0fc746f4 §2.6, wave W5): the package that
|
|
3
|
+
* makes the pod's design door runnable. Its verbs are BUILTINS of the pod
|
|
4
|
+
* (backend `services/capabilities/builtin-verbs.ts`, `services/designs`); this
|
|
5
|
+
* package carries their declarations and Synap's catalog snapshot.
|
|
6
|
+
*
|
|
7
|
+
* Pinned here, where the package is authored:
|
|
8
|
+
* - its key is the one the pod reads the snapshot from (`DESIGN_CAPABILITY_KEY`);
|
|
9
|
+
* - it declares exactly the three verbs, each `kind: "builtin"`, and each
|
|
10
|
+
* verb's `parameters` IS `DESIGN_VERB_PARAMETERS` (the ONE param contract;
|
|
11
|
+
* the backend's catalog-coherence tripwire reads that constant as the
|
|
12
|
+
* catalog advertising these verbs, so the two halves cannot drift);
|
|
13
|
+
* - the read verbs declare `readOnly`, `design.apply` does not (it gates
|
|
14
|
+
* itself through the entity door);
|
|
15
|
+
* - the snapshot sits at `spec.metadata.designCatalog` and reads clean the way
|
|
16
|
+
* the pod reads it (`readDesignCatalog`).
|
|
17
|
+
*
|
|
18
|
+
* NOT covered here: that the snapshot is current (ui-gallery
|
|
19
|
+
* `designCatalog.freshness.test.ts`), and the verbs' behaviour (backend
|
|
20
|
+
* `design-door.test.ts`).
|
|
21
|
+
*/
|
|
22
|
+
import { readFileSync } from "node:fs";
|
|
23
|
+
import { join } from "node:path";
|
|
24
|
+
import { describe, expect, it } from "vitest";
|
|
25
|
+
import {
|
|
26
|
+
DESIGN_CAPABILITY_KEY,
|
|
27
|
+
DESIGN_CATALOG_METADATA_KEY,
|
|
28
|
+
DESIGN_VERBS,
|
|
29
|
+
DESIGN_VERB_PARAMETERS,
|
|
30
|
+
readDesignCatalog,
|
|
31
|
+
} from "@synap-core/types/design-board";
|
|
32
|
+
|
|
33
|
+
const manifest = JSON.parse(
|
|
34
|
+
readFileSync(join(__dirname, "..", "capabilities", "design.capability.json"), "utf8"),
|
|
35
|
+
) as {
|
|
36
|
+
meta: { slug: string };
|
|
37
|
+
spec: {
|
|
38
|
+
key: string;
|
|
39
|
+
skills: Array<{ name: string; kind: string; parameters: unknown; metadata?: { readOnly?: boolean } }>;
|
|
40
|
+
metadata?: Record<string, unknown>;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const skill = (name: string) => manifest.spec.skills.find((s) => s.name === name);
|
|
44
|
+
|
|
45
|
+
describe("the design capability", () => {
|
|
46
|
+
it("is the package the pod reads the catalog from", () => {
|
|
47
|
+
expect(manifest.spec.key).toBe(DESIGN_CAPABILITY_KEY);
|
|
48
|
+
expect(manifest.meta.slug).toBe(DESIGN_CAPABILITY_KEY);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it("declares exactly the three builtin verbs, with the one param contract", () => {
|
|
52
|
+
expect(manifest.spec.skills.map((s) => s.name).sort()).toEqual([...DESIGN_VERBS].sort());
|
|
53
|
+
for (const verb of DESIGN_VERBS) {
|
|
54
|
+
expect(skill(verb)?.kind, verb).toBe("builtin");
|
|
55
|
+
expect(skill(verb)?.parameters, verb).toEqual(DESIGN_VERB_PARAMETERS[verb]);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it("marks the two reads read-only, never the write", () => {
|
|
60
|
+
expect(skill("design.read")?.metadata?.readOnly).toBe(true);
|
|
61
|
+
expect(skill("design.catalog")?.metadata?.readOnly).toBe(true);
|
|
62
|
+
expect(skill("design.apply")?.metadata?.readOnly).toBeUndefined();
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it("carries a catalog snapshot the pod can read", () => {
|
|
66
|
+
const read = readDesignCatalog(manifest.spec.metadata?.[DESIGN_CATALOG_METADATA_KEY]);
|
|
67
|
+
expect(read.ok ? null : read.error).toBeNull();
|
|
68
|
+
});
|
|
69
|
+
});
|
package/src/intent.test.ts
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
* lifecycle may be declared there (a role foundation owns);
|
|
10
10
|
* - one `primary` output per producing space, one of `produces`; a library
|
|
11
11
|
* names none (`intent-primary-*`, One model decision 3);
|
|
12
|
+
* - a produced kind's `as` (output or helper): the primary is never a
|
|
13
|
+
* helper, and both doors carry it;
|
|
12
14
|
* - (the catalog header half lives in `schema/intent-header.test.ts`);
|
|
13
15
|
* - BOTH install doors carry it (top-level `intent` on both), driven through
|
|
14
16
|
* the real converters.
|
|
@@ -121,6 +123,25 @@ describe("meta.intent — validator rules", () => {
|
|
|
121
123
|
expect(errs.map((e) => e.rule)).toEqual(["intent-primary-library"]);
|
|
122
124
|
});
|
|
123
125
|
|
|
126
|
+
// Negative control: goes red with the `as` checks removed from checkIntent.
|
|
127
|
+
it("a helper kind: the primary is never a helper; an unknown `as` is a shape error", () => {
|
|
128
|
+
const profiles = [lifecycled("feature"), lifecycled("story")];
|
|
129
|
+
const ok = make("t", profiles, {
|
|
130
|
+
label: "P",
|
|
131
|
+
primary: "feature",
|
|
132
|
+
produces: [{ profile: "feature", as: "output" }, { profile: "story", as: "helper" }],
|
|
133
|
+
});
|
|
134
|
+
expect(intentErrors(ok)).toEqual([]);
|
|
135
|
+
const helperPrimary = make("t", profiles, { label: "P", primary: "feature", produces: [{ profile: "feature", as: "helper" }, { profile: "story" }] });
|
|
136
|
+
expect(intentErrors(helperPrimary).map((e) => e.rule)).toEqual(["intent-primary-helper"]);
|
|
137
|
+
const unknownAs = make("t", profiles, {
|
|
138
|
+
label: "P",
|
|
139
|
+
primary: "feature",
|
|
140
|
+
produces: [{ profile: "feature" }, { profile: "story", as: "sidekick" }],
|
|
141
|
+
} as unknown as TemplateIntent);
|
|
142
|
+
expect(intentErrors(unknownAs).map((e) => e.rule)).toEqual(["intent-shape"]);
|
|
143
|
+
});
|
|
144
|
+
|
|
124
145
|
it("an unresolvable dependency does not fabricate an unknown-profile error", () => {
|
|
125
146
|
const t = make("t", [lifecycled("thing")], { label: "P", produces: [{ profile: "elsewhere" }] }, ["not-in-corpus"]);
|
|
126
147
|
expect(intentErrors(t)).toEqual([]);
|
|
@@ -141,6 +162,17 @@ describe("meta.intent — both install doors carry it", () => {
|
|
|
141
162
|
expect(toWorkspaceDefinition(t).definition.intent).toEqual(intent);
|
|
142
163
|
});
|
|
143
164
|
|
|
165
|
+
it("a helper kind reaches both doors as declared", () => {
|
|
166
|
+
const helper = {
|
|
167
|
+
label: "Product",
|
|
168
|
+
primary: "thing",
|
|
169
|
+
produces: [{ profile: "thing" }, { profile: "step", as: "helper" as const }],
|
|
170
|
+
};
|
|
171
|
+
const h = make("t", [lifecycled("thing"), lifecycled("step")], helper);
|
|
172
|
+
expect(toPackageDefinition(h).intent).toEqual(helper);
|
|
173
|
+
expect(toWorkspaceDefinition(h).definition.intent).toEqual(helper);
|
|
174
|
+
});
|
|
175
|
+
|
|
144
176
|
it("no intent → no field on either door", () => {
|
|
145
177
|
const none = make("t", [lifecycled("thing")]);
|
|
146
178
|
expect("intent" in toPackageDefinition(none)).toBe(false);
|
|
@@ -176,6 +208,15 @@ describe("meta.intent — the catalog", () => {
|
|
|
176
208
|
expect(table["research-base"]).toEqual(["Research", "hypothesis", "research-finding"]);
|
|
177
209
|
});
|
|
178
210
|
|
|
211
|
+
it("Builder: stories and UI designs are helpers of the feature", () => {
|
|
212
|
+
const builder = corpus.find((t) => t.meta.slug === "builder-workspace")!;
|
|
213
|
+
expect(builder.meta.intent!.produces).toEqual([
|
|
214
|
+
{ profile: "devplane_feature" },
|
|
215
|
+
{ profile: "devplane_story", as: "helper" },
|
|
216
|
+
{ profile: "ui-design", as: "helper" },
|
|
217
|
+
]);
|
|
218
|
+
});
|
|
219
|
+
|
|
179
220
|
it("every producing space names its primary (One model decision 3)", () => {
|
|
180
221
|
const primaries = Object.fromEntries(corpus.filter((t) => t.meta.intent?.produces?.length).map((t) => [t.meta.slug, t.meta.intent!.primary]));
|
|
181
222
|
expect(primaries).toEqual({
|
|
@@ -204,3 +204,86 @@ describe("Ship a change - binds with no feature (structural guard P4 d)", () =>
|
|
|
204
204
|
expect(pb.goalTemplate).not.toContain("({feature})");
|
|
205
205
|
});
|
|
206
206
|
});
|
|
207
|
+
|
|
208
|
+
describe("the merge criterion names the PR outcome (work-model W4)", () => {
|
|
209
|
+
// The pod pairs a criterion with an outcome by `outputKey` only; a shared key
|
|
210
|
+
// pairs nothing, so a text that teaches "keyed the same" leaves the merge
|
|
211
|
+
// check without its PR (the evaluator hands over no outcome).
|
|
212
|
+
const cap = JSON.parse(
|
|
213
|
+
readFileSync(join(HERE, "../capabilities/github-read.capability.json"), "utf8")
|
|
214
|
+
).spec as { skills: { name: string; description: string; code?: string }[] };
|
|
215
|
+
const merged = cap.skills.find((v) => v.name === "github_check_pr_merged");
|
|
216
|
+
|
|
217
|
+
it("Ship a change teaches outputKey pr-<repo>-<number>, never a criterion keyed the same", () => {
|
|
218
|
+
expect(pb.goalTemplate).toContain("outputKey pr-<repo>-<number>");
|
|
219
|
+
const merge = pb.stages.find((s) => s.key === "merge") as unknown as { goal: string };
|
|
220
|
+
expect(merge.goal).toContain("by outputKey");
|
|
221
|
+
for (const text of [pb.goalTemplate, merge.goal]) {
|
|
222
|
+
expect(text).not.toMatch(/keyed the same|of the same key/);
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
it("github_check_pr_merged tells the caller to name the outcome by outputKey", () => {
|
|
227
|
+
expect(merged).toBeDefined();
|
|
228
|
+
for (const text of [merged!.description, merged!.code ?? ""]) {
|
|
229
|
+
expect(text).toContain("outputKey");
|
|
230
|
+
expect(text).not.toMatch(/key the criterion like/i);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
describe("a declared PR slot is completed, never shadowed by a new outcome (W6)", () => {
|
|
236
|
+
// The session check gate reads the outputs the stage left declares
|
|
237
|
+
// (backend#1179): a PR recorded only as a NEW outcome pr-<repo>-<n> leaves the
|
|
238
|
+
// declared slot owed and holds the run. Every catalog stage that declares a
|
|
239
|
+
// pull request tells the agent to complete THAT output.
|
|
240
|
+
type Stage = {
|
|
241
|
+
key: string;
|
|
242
|
+
goal?: string;
|
|
243
|
+
description?: string;
|
|
244
|
+
expectedOutputs?: { key?: string; kind?: string; label?: string }[];
|
|
245
|
+
};
|
|
246
|
+
const declaring = (getWorkspaceTemplate("builder-workspace")!.playbooks ?? []).flatMap((p) => {
|
|
247
|
+
const q = p as unknown as { name: string; goalTemplate?: string; stages?: Stage[] };
|
|
248
|
+
return (q.stages ?? []).flatMap((stage) =>
|
|
249
|
+
(stage.expectedOutputs ?? [])
|
|
250
|
+
.filter((o) => o.kind === "pull_request")
|
|
251
|
+
.map((out) => ({ playbook: q.name, goalTemplate: q.goalTemplate ?? "", stage, out }))
|
|
252
|
+
);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
it("Ship a change: the PR step's and the merge step's criteria name the declared slot (W6: a step counts only its own and earlier criteria)", () => {
|
|
256
|
+
const named = pb.stages.flatMap((st) =>
|
|
257
|
+
((st as unknown as { criteria?: { key: string; outputKey?: string }[] }).criteria ?? [])
|
|
258
|
+
.filter((c) => c.outputKey === "pull-request")
|
|
259
|
+
.map((c) => `${st.key}/${c.key}`)
|
|
260
|
+
);
|
|
261
|
+
expect(named).toEqual(["pr-opened/pr-opened", "merge/merged"]);
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
it("finds the stages it checks (an empty scan is a blind guard)", () => {
|
|
265
|
+
expect(declaring.map((d) => d.playbook)).toEqual(
|
|
266
|
+
expect.arrayContaining(["Ship a change", "Build a change", "Fix a bug", "Maintain", "Fix main red"])
|
|
267
|
+
);
|
|
268
|
+
});
|
|
269
|
+
|
|
270
|
+
it("each names its slot and says to complete that output with the PR's url", () => {
|
|
271
|
+
for (const { playbook, goalTemplate, stage, out } of declaring) {
|
|
272
|
+
const where = `${playbook} / ${stage.key}`;
|
|
273
|
+
const text = `${stage.goal ?? ""} ${stage.description ?? ""}`;
|
|
274
|
+
expect(out.label, where).not.toMatch(/outcome pr-<repo>-<number>/);
|
|
275
|
+
if (out.key) {
|
|
276
|
+
expect(out.key, where).toBe("pull-request");
|
|
277
|
+
expect(out.label, where).toContain(
|
|
278
|
+
"complete this output with its url (completeOutput pull-request, ref.url)"
|
|
279
|
+
);
|
|
280
|
+
expect(text, where).toMatch(
|
|
281
|
+
/complete (THIS output, pull-request,|the pull-request output of THIS stage) with its url/
|
|
282
|
+
);
|
|
283
|
+
} else {
|
|
284
|
+
// A slot named by its label (Merged fix, Fix PR): the text names THAT output.
|
|
285
|
+
expect(`${text} ${goalTemplate}`, where).toContain(out.label!);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
});
|