@synap-core/workspace-templates 0.69.0 → 0.71.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/dist/index.js +31 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/builder.yaml +46 -10
- package/src/design-pins.template.test.ts +143 -0
- package/src/design-system.template.test.ts +15 -2
- package/src/design-system.yaml +36 -25
- package/src/design-to-implementation.template.test.ts +16 -3
- package/src/templates.ts +31 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synap-core/workspace-templates",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.71.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Canonical workspace definitions — YAML source + typed exports for browser, backend, CLI, and marketplace",
|
|
6
6
|
"license": "PolyForm-Noncommercial-1.0.0",
|
package/src/builder.yaml
CHANGED
|
@@ -2097,9 +2097,14 @@ playbooks:
|
|
|
2097
2097
|
# nothing is implemented from a design a person has not approved; a
|
|
2098
2098
|
# rejection loops to Generate. Verify's check gate and Done's human gate both
|
|
2099
2099
|
# send rework to Implement.
|
|
2100
|
-
#
|
|
2101
|
-
#
|
|
2102
|
-
#
|
|
2100
|
+
# Two workers (plan 48854969 §10.4, founder: the automatic start is back
|
|
2101
|
+
# on). MANUAL, and CREATED → PROPOSE a run on the new design; it replaces
|
|
2102
|
+
# the archived pod automation 34d335f9 (entity.create.completed, ui-design).
|
|
2103
|
+
# Generate creates the sibling variants as ui-designs that already carry
|
|
2104
|
+
# the request's `variant-group`; `unless: variant-group present` leaves them
|
|
2105
|
+
# out, so only a request (created without a group) proposes a run. A person
|
|
2106
|
+
# who creates a design with a variant-group already set starts it by hand.
|
|
2107
|
+
# Never `run`: a person approves each start.
|
|
2103
2108
|
- name: Design to implementation
|
|
2104
2109
|
description: Take a UI design request from three variants built only of real Storybook components, through a rubric critique and a person's review on the canvas, to a pull request verified by the gates, a before/after compare and a walk in the running app.
|
|
2105
2110
|
goalTemplate: >-
|
|
@@ -2126,13 +2131,29 @@ playbooks:
|
|
|
2126
2131
|
guards are green, the implemented story was captured and compared with
|
|
2127
2132
|
the design and the current story, and the screen was walked in the
|
|
2128
2133
|
running app. Move the design's status only through its lifecycle
|
|
2129
|
-
(update_entity with expectedStatus); never invent a status.
|
|
2134
|
+
(update_entity with expectedStatus); never invent a status. PINS: the
|
|
2135
|
+
person annotates the design on the board; each pin is an open comment
|
|
2136
|
+
thread on this design. Read them with synap_get_thread_context
|
|
2137
|
+
{object: {type: entity, id: <the design>}, state: open}: each thread's
|
|
2138
|
+
anchor.locator names the frame (frameId, blockId), the viewport, the
|
|
2139
|
+
point and the contentVersion the person saw. A pin whose contentVersion
|
|
2140
|
+
is not the design's current updatedAt (the entity's own timestamp, in
|
|
2141
|
+
the same ISO form) is stale: say so in its thread and do not apply it
|
|
2142
|
+
blindly. Any write that bumps updatedAt (a save, your own write) makes
|
|
2143
|
+
older pins read stale, so read them before you write the design. Apply every current pin in the next variants and reply
|
|
2144
|
+
in its thread (synap_post_message, comment.replyTo the thread id) with
|
|
2145
|
+
what changed; never resolve a pin: the person resolves it at Review
|
|
2146
|
+
(agents propose, people resolve). A pod run of this playbook has no
|
|
2147
|
+
comment tool: an agent with the MCP doors works these steps.
|
|
2130
2148
|
subjectProfile:
|
|
2131
2149
|
profileSlug: ui-design
|
|
2132
2150
|
# No stage owns these: `approved` and `archived` are a person's call
|
|
2133
2151
|
# (humanOnly on the lifecycle).
|
|
2134
2152
|
activators:
|
|
2135
2153
|
- { on: manual, mode: propose }
|
|
2154
|
+
- on: created
|
|
2155
|
+
mode: propose
|
|
2156
|
+
unless: { property: variant-group, present: true }
|
|
2136
2157
|
params:
|
|
2137
2158
|
- { name: design, type: entity, label: UI design, required: true }
|
|
2138
2159
|
- { name: surface, type: text, label: Target surface }
|
|
@@ -2143,7 +2164,7 @@ playbooks:
|
|
|
2143
2164
|
name: Generate
|
|
2144
2165
|
category: planned
|
|
2145
2166
|
subjectStatus: draft
|
|
2146
|
-
goal: Write three variants as Puck JSON as a canvas of frames, one per screen (one frame for a single screen) — this design and two siblings in its variant-group — from components the Storybook manifest lists, with their declared props, tokens and named motion presets only, each with every state the screen has.
|
|
2167
|
+
goal: First read the design's open pins (synap_get_thread_context with object the design, state open) and mark each stale one (its locator.contentVersion is not the design's current updatedAt), before writing anything to the design. Write three variants as Puck JSON as a canvas of frames, one per screen (one frame for a single screen) — this design and two siblings in its variant-group — from components the Storybook manifest lists, with their declared props, tokens and named motion presets only, each with every state the screen has, applying every current pin. Reply in each pin's thread (synap_post_message, comment.replyTo) with what changed, or why it was stale or not applied; never resolve a pin.
|
|
2147
2168
|
expectedOutputs:
|
|
2148
2169
|
- kind: ui-design
|
|
2149
2170
|
label: Sibling variants (same variant-group)
|
|
@@ -2182,7 +2203,7 @@ playbooks:
|
|
|
2182
2203
|
name: Review
|
|
2183
2204
|
category: started
|
|
2184
2205
|
subjectStatus: in-review
|
|
2185
|
-
goal: A person compares the variants and their critiques on the canvas and approves one, or sends the design back with what to change. A sibling chosen over this design is written into it first, so the run carries the chosen variant.
|
|
2206
|
+
goal: A person compares the variants and their critiques on the canvas and approves one, or sends the design back with what to change. The person resolves the pins the variants answered and pins what is still wrong; sending it back returns the run to Generate, which reads the open pins again. A sibling chosen over this design is written into it first, so the run carries the chosen variant.
|
|
2186
2207
|
# The commitment: implementation starts only from an approved design.
|
|
2187
2208
|
gate: { kind: human }
|
|
2188
2209
|
onFail: { toStage: generate }
|
|
@@ -3578,7 +3599,19 @@ playbooks:
|
|
|
3578
3599
|
an agent pushing main by hand. DONE: reviewed-hash = source-hash and
|
|
3579
3600
|
review-state fresh. Code facts of the record (name, props, stories,
|
|
3580
3601
|
source, composition) belong to the Storybook sync: never edit them on
|
|
3581
|
-
the pod.
|
|
3602
|
+
the pod. PINS: the person may pin the component's stories on the board;
|
|
3603
|
+
each pin is an open comment thread on the component. Read them with
|
|
3604
|
+
synap_get_thread_context {object: {type: entity, id: <the component>},
|
|
3605
|
+
state: open}: each thread's anchor.locator names the story (storyId),
|
|
3606
|
+
the viewport, the point and the contentVersion the person saw. A pin
|
|
3607
|
+
whose contentVersion is not the component's current source-hash is
|
|
3608
|
+
stale: say so in its thread and do not apply it blindly. Every current
|
|
3609
|
+
pin is a finding of the critique; reply in its thread
|
|
3610
|
+
(synap_post_message, comment.replyTo the thread id) with the verdict
|
|
3611
|
+
and, for a fix, what changed; never resolve a pin: the person resolves
|
|
3612
|
+
it at Approve (agents propose, people resolve). A pod run of this
|
|
3613
|
+
playbook has no comment tool: an agent with the MCP doors works these
|
|
3614
|
+
steps.
|
|
3582
3615
|
scope: session
|
|
3583
3616
|
subjectProfile:
|
|
3584
3617
|
profileSlug: ui-component
|
|
@@ -3599,7 +3632,7 @@ playbooks:
|
|
|
3599
3632
|
- key: critique
|
|
3600
3633
|
name: Critique
|
|
3601
3634
|
category: started
|
|
3602
|
-
goal: Set the component's review-state to in-review, then judge each of its stories with the design-critique rubric and write the findings (rule id, tier, severity, confidence, region, evidence) into the critique document.
|
|
3635
|
+
goal: "Set the component's review-state to in-review, then judge each of its stories with the design-critique rubric and write the findings (rule id, tier, severity, confidence, region, evidence) into the critique document. Read the component's open pins too (synap_get_thread_context with object the component, state open): each current pin (its locator.contentVersion equals the component's source-hash) is a finding, with its thread as the evidence; a stale one is listed as stale and not judged."
|
|
3603
3636
|
expectedOutputs:
|
|
3604
3637
|
- kind: document
|
|
3605
3638
|
label: Component critique (findings by story, tier and rule id)
|
|
@@ -3611,6 +3644,9 @@ playbooks:
|
|
|
3611
3644
|
- key: critique-every-story
|
|
3612
3645
|
statement: Every story id of the component (story-ids) is critiqued or named as skipped with why.
|
|
3613
3646
|
check: { kind: judge }
|
|
3647
|
+
- key: critique-pins-read
|
|
3648
|
+
statement: Every pin open on the component when the review started is in the critique, as a finding (its contentVersion equals the component's source-hash) or as stale, and has a reply in its thread from this run; no pin was resolved by the agent.
|
|
3649
|
+
check: { kind: judge }
|
|
3614
3650
|
- key: verdict
|
|
3615
3651
|
name: Verdict
|
|
3616
3652
|
category: started
|
|
@@ -3637,7 +3673,7 @@ playbooks:
|
|
|
3637
3673
|
- key: implement
|
|
3638
3674
|
name: Implement
|
|
3639
3675
|
category: started
|
|
3640
|
-
goal: Build the enhanced version in the component's source with the real components, on a branch of the project's repo, with its story updated, and capture the story before and after. Nothing reaches main here. Record the branch and its full head sha on the session.
|
|
3676
|
+
goal: Build the enhanced version in the component's source with the real components, on a branch of the project's repo, with its story updated, and capture the story before and after; apply each current pin the verdict kept and reply in its thread with what changed. Nothing reaches main here. Record the branch and its full head sha on the session.
|
|
3641
3677
|
criteria:
|
|
3642
3678
|
- key: implement-matches-design
|
|
3643
3679
|
statement: The change builds the enhanced version and nothing else, with no invented component and no hard-coded colour, and its before/after captures are on the session.
|
|
@@ -3662,7 +3698,7 @@ playbooks:
|
|
|
3662
3698
|
- key: approve
|
|
3663
3699
|
name: Approve
|
|
3664
3700
|
category: started
|
|
3665
|
-
goal: "The card shows the before/after capture of the story, the diff summary and the green devbox run at the full head sha. Approving it releases land, publish and done; no later stage asks again. A change touching auth, keys, vault, billing or a migration, or publishing to anyone but this pod, files its own approval instead of riding this one."
|
|
3701
|
+
goal: "The card shows the before/after capture of the story, the diff summary and the green devbox run at the full head sha, and the replies in the pins' threads. Approving it releases land, publish and done; no later stage asks again. The person resolves the pins the fix answered. A change touching auth, keys, vault, billing or a migration, or publishing to anyone but this pod, files its own approval instead of riding this one."
|
|
3666
3702
|
gate: { kind: human }
|
|
3667
3703
|
onFail: { toStage: implement }
|
|
3668
3704
|
expectedOutputs:
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The board's pins in the design playbooks (plan 48854969 §10.3): "Design to
|
|
3
|
+
* implementation" and "Review a UI component" read the open pins on their
|
|
4
|
+
* subject, treat a stale one as stale, reply in each pin's thread, and never
|
|
5
|
+
* resolve one (agents propose, people resolve: backend comments.ts refuses an
|
|
6
|
+
* agent's resolve).
|
|
7
|
+
*
|
|
8
|
+
* What this guards:
|
|
9
|
+
* 1. each playbook's run text reads the pins through the agent read door,
|
|
10
|
+
* `synap_get_thread_context` with `object` + `state: open` (backend#1316),
|
|
11
|
+
* and replies through `synap_post_message` with `comment.replyTo`;
|
|
12
|
+
* 2. the door it names takes those arguments: read from the backend's MCP
|
|
13
|
+
* tool manifest when synap-backend is a sibling checkout (skipped
|
|
14
|
+
* otherwise, and said so);
|
|
15
|
+
* 3. the stale rule compares `locator.contentVersion` with the value the
|
|
16
|
+
* board stamps (lane pins-app, apps/ui-gallery pinModel.ts isStale): the
|
|
17
|
+
* component's `source-hash` property (checked to exist on the kind), the
|
|
18
|
+
* design entity's own `updatedAt` (an entity column, not a property, so
|
|
19
|
+
* only the text is checked);
|
|
20
|
+
* 4. no text tells the agent to resolve a pin, and the person's gate says
|
|
21
|
+
* the person resolves them;
|
|
22
|
+
* 5. the stage that reads the pins owes a reply to every open pin: a
|
|
23
|
+
* criterion on Review a UI component; on Design to implementation, which
|
|
24
|
+
* sits at the pod's 12-criteria cap (build.mjs refuses a 13th), the
|
|
25
|
+
* stage goal says it.
|
|
26
|
+
*
|
|
27
|
+
* Not covered: whether the pod run can call the doors (it cannot: the run has
|
|
28
|
+
* no comment tool, a known gap in run-tools.guard), and the board's stamping.
|
|
29
|
+
*/
|
|
30
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
31
|
+
import { dirname, join } from "node:path";
|
|
32
|
+
import { fileURLToPath } from "node:url";
|
|
33
|
+
import { describe, expect, it } from "vitest";
|
|
34
|
+
import { getWorkspaceTemplate } from "./templates.js";
|
|
35
|
+
|
|
36
|
+
const builder = getWorkspaceTemplate("builder-workspace")!;
|
|
37
|
+
type Stage = { key: string; goal?: string; criteria?: { key: string }[] };
|
|
38
|
+
type Pb = { name: string; goalTemplate: string; stages: Stage[] };
|
|
39
|
+
const playbook = (name: string) => (builder.playbooks as unknown as Pb[]).find((p) => p.name === name)!;
|
|
40
|
+
const props = (slug: string) => new Set(builder.profiles.find((p) => p.slug === slug)!.properties.map((p) => p.slug));
|
|
41
|
+
const textOf = (p: Pb) => [p.goalTemplate, ...p.stages.map((s) => s.goal ?? "")].join("\n");
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* What the board stamps into a pin's contentVersion: the ui-design entity's
|
|
45
|
+
* `updatedAt` (ISO), a component record's `source-hash` property.
|
|
46
|
+
*/
|
|
47
|
+
const CASES = [
|
|
48
|
+
{ name: "Design to implementation", subject: "ui-design", version: "updatedAt", isProperty: false, readStage: "generate", criterion: null, gate: "review" },
|
|
49
|
+
{ name: "Review a UI component", subject: "ui-component", version: "source-hash", isProperty: true, readStage: "critique", criterion: "critique-pins-read", gate: "approve" },
|
|
50
|
+
] as const;
|
|
51
|
+
|
|
52
|
+
describe("design playbooks read the board's pins", () => {
|
|
53
|
+
for (const c of CASES) {
|
|
54
|
+
describe(c.name, () => {
|
|
55
|
+
const p = playbook(c.name);
|
|
56
|
+
|
|
57
|
+
it("reads the open pins through the agent read door and replies in each thread", () => {
|
|
58
|
+
expect(p, c.name).toBeDefined();
|
|
59
|
+
expect(p.goalTemplate).toMatch(/synap_get_thread_context\s*\{object: \{type: entity, id: <the [a-z]+>\},\s*state: open\}/);
|
|
60
|
+
expect(p.goalTemplate).toContain("anchor.locator");
|
|
61
|
+
expect(textOf(p)).toMatch(/synap_post_message, comment\.replyTo/);
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("calls a pin stale against the value the board stamps", () => {
|
|
65
|
+
if (c.isProperty) expect(props(c.subject).has(c.version), `${c.subject}.${c.version}`).toBe(true);
|
|
66
|
+
else expect(props(c.subject).has(c.version), `${c.version} is an entity column, never a property`).toBe(false);
|
|
67
|
+
const rule = p.goalTemplate.match(/contentVersion\s+is not ([^.]*)\./);
|
|
68
|
+
expect(rule, "the goal states the stale rule").not.toBeNull();
|
|
69
|
+
expect(rule![1]).toContain(c.version);
|
|
70
|
+
const stage = p.stages.find((s) => s.key === c.readStage)!;
|
|
71
|
+
expect(stage.goal).toContain(c.version);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("never has the agent resolve a pin; the person does at the gate", () => {
|
|
75
|
+
const text = textOf(p);
|
|
76
|
+
expect(text).not.toMatch(/(?<!never )\bresolve (?:each|every|the|a) pin/i);
|
|
77
|
+
expect(text).toMatch(/never resolve a pin/);
|
|
78
|
+
const gate = p.stages.find((s) => s.key === c.gate)!;
|
|
79
|
+
expect(gate.goal).toMatch(/person resolves? (?:it|them|the pins)/i);
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
it("the reading stage owes a reply to every open pin", () => {
|
|
83
|
+
const stage = p.stages.find((s) => s.key === c.readStage)!;
|
|
84
|
+
expect(stage.goal).toContain("synap_get_thread_context");
|
|
85
|
+
if (c.criterion) expect((stage.criteria ?? []).map((k) => k.key)).toContain(c.criterion);
|
|
86
|
+
else expect(stage.goal).toMatch(/Reply in each pin's thread/);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
it("self-check: the resolve scan catches an imperative and spares the refusal", () => {
|
|
92
|
+
const re = /(?<!never )\bresolve (?:each|every|the|a) pin/i;
|
|
93
|
+
expect(re.test("Apply it, then resolve each pin you applied.")).toBe(true);
|
|
94
|
+
expect(re.test("never resolve a pin: the person does")).toBe(false);
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const MANIFEST = join(
|
|
99
|
+
dirname(fileURLToPath(import.meta.url)),
|
|
100
|
+
"../../../../synap-backend/packages/api/src/routers/mcp/tools/mcp-tools.manifest.json"
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
describe.skipIf(!existsSync(MANIFEST))("the doors the stages name take those arguments (backend MCP manifest)", () => {
|
|
104
|
+
const raw = existsSync(MANIFEST) ? JSON.parse(readFileSync(MANIFEST, "utf8")) : [];
|
|
105
|
+
const tools = (Array.isArray(raw) ? raw : raw.tools) as { name: string; inputSchema?: { properties?: Record<string, { type?: string; enum?: string[]; properties?: Record<string, unknown> }> } }[];
|
|
106
|
+
const tool = (name: string) => tools.find((t) => t.name === name);
|
|
107
|
+
|
|
108
|
+
it("synap_get_thread_context reads an object's threads by state", () => {
|
|
109
|
+
// The manifest declares `object` as an object and spells its {type, id}
|
|
110
|
+
// in the description (backend#1316), so the keys are not checked here.
|
|
111
|
+
const schema = tool("synap_get_thread_context")?.inputSchema?.properties ?? {};
|
|
112
|
+
expect(schema.object?.type).toBe("object");
|
|
113
|
+
expect(schema.state?.enum).toEqual(expect.arrayContaining(["open", "resolved"]));
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("synap_post_message replies in a comment thread", () => {
|
|
117
|
+
const schema = tool("synap_post_message")?.inputSchema?.properties ?? {};
|
|
118
|
+
expect(Object.keys(schema.comment?.properties ?? {})).toContain("replyTo");
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Plan §10.4 (founder: the automatic start is back on): a new ui-design
|
|
124
|
+
* PROPOSES a run of Design to implementation, never runs one, and the
|
|
125
|
+
* variants Generate creates (they carry the request's variant-group) do not.
|
|
126
|
+
* Not covered: the pod honouring `unless` on a created worker (backend
|
|
127
|
+
* jobs playbook-run.ts skippedByUnless, read, not run here).
|
|
128
|
+
*/
|
|
129
|
+
describe("Design to implementation starts itself on a new design, as a proposal", () => {
|
|
130
|
+
type Activator = { on: string; mode?: string; unless?: { property: string; present: boolean } };
|
|
131
|
+
const p = playbook("Design to implementation") as unknown as Pb & { activators?: Activator[] };
|
|
132
|
+
|
|
133
|
+
it("declares a created activator in propose mode that skips the variants", () => {
|
|
134
|
+
const created = (p.activators ?? []).filter((a) => a.on === "created");
|
|
135
|
+
expect(created).toEqual([{ on: "created", mode: "propose", unless: { property: "variant-group", present: true } }]);
|
|
136
|
+
expect(props("ui-design").has("variant-group")).toBe(true);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
it("no activator of it runs without a person", () => {
|
|
140
|
+
expect((p.activators ?? []).length).toBeGreaterThanOrEqual(2);
|
|
141
|
+
for (const a of p.activators ?? []) expect(a.mode, a.on).toBe("propose");
|
|
142
|
+
});
|
|
143
|
+
});
|
|
@@ -14,7 +14,11 @@
|
|
|
14
14
|
* is, which app, which brand identity), each a stage-end ask of one field,
|
|
15
15
|
* and no other stage asks;
|
|
16
16
|
* 4. the storybook.sync parameters the setup names are the verb's own
|
|
17
|
-
* (`STORYBOOK_VERB_PARAMETERS`), so the text cannot drift from the door
|
|
17
|
+
* (`STORYBOOK_VERB_PARAMETERS`), so the text cannot drift from the door;
|
|
18
|
+
* 5. the run it tells to run storybook.sync is GIVEN it: a run gets
|
|
19
|
+
* run_capability only for what its `tools` declare (schema/run-tools.ts
|
|
20
|
+
* `runToolNames`); five stages make it a long run, which creates no
|
|
21
|
+
* automation and hands nothing to a computer, so its text asks neither.
|
|
18
22
|
*
|
|
19
23
|
* Not covered: the install on a pod (CP + backend), whether the pod raises
|
|
20
24
|
* each endAsk at the end of its stage, and the run's resolution of the names.
|
|
@@ -26,12 +30,13 @@ import {
|
|
|
26
30
|
STORYBOOK_VERB_PARAMETERS,
|
|
27
31
|
} from "@synap-core/types/storybook";
|
|
28
32
|
import { getWorkspaceTemplate } from "./templates.js";
|
|
33
|
+
import { RUN_CAPABILITY_TOOL, runClassOf, runToolNames } from "../schema/run-tools.ts";
|
|
29
34
|
|
|
30
35
|
const pack = getWorkspaceTemplate("design-system")!;
|
|
31
36
|
|
|
32
37
|
type EndAsk = { label: string; ask: { mode: string; form?: { fields: { key: string }[] } } };
|
|
33
38
|
type Stage = { key: string; goal: string; endAsk?: EndAsk };
|
|
34
|
-
type Pb = { name: string; goalTemplate: string; stages: Stage[] };
|
|
39
|
+
type Pb = { name: string; goalTemplate: string; executor?: string; tools?: string[]; stages: Stage[] };
|
|
35
40
|
type Dep = { slug: string; kind: string; relation: string };
|
|
36
41
|
|
|
37
42
|
const deps = (pack as unknown as { dependencies: Dep[] }).dependencies;
|
|
@@ -84,4 +89,12 @@ describe("Design system pack", () => {
|
|
|
84
89
|
}
|
|
85
90
|
expect(setup.goalTemplate).toMatch(/brand identity goes only to storybook\.sync/);
|
|
86
91
|
});
|
|
92
|
+
|
|
93
|
+
it("gives its run storybook.sync: the run's tools carry run_capability", () => {
|
|
94
|
+
const cls = runClassOf(setup);
|
|
95
|
+
expect(cls).toBe("long");
|
|
96
|
+
expect(runToolNames(cls)).not.toContain(RUN_CAPABILITY_TOOL);
|
|
97
|
+
expect(runToolNames(cls, setup.tools ?? [])).toContain(RUN_CAPABILITY_TOOL);
|
|
98
|
+
expect(setup.tools).toContain(STORYBOOK_CAPABILITY_KEY);
|
|
99
|
+
});
|
|
87
100
|
});
|
package/src/design-system.yaml
CHANGED
|
@@ -24,13 +24,21 @@
|
|
|
24
24
|
# (`optionsFrom`); there is no subject before the app is named, so "which app"
|
|
25
25
|
# and "which brand identity" are answered by name and the run resolves them.
|
|
26
26
|
#
|
|
27
|
+
# WHAT A RUN CAN DO. Five stages make it a LONG run: the pod's core tools
|
|
28
|
+
# (reads, create_entity as a proposal, its own update_run and post_in_room)
|
|
29
|
+
# plus, for its declared `tools: [storybook]`, run_capability
|
|
30
|
+
# (schema/run-tools.ts). It creates no automation and hands nothing to a
|
|
31
|
+
# computer, so its text asks for neither: it names what only the person (or
|
|
32
|
+
# their computer) does.
|
|
33
|
+
#
|
|
27
34
|
# THE SYNC SCHEDULE. The storybook sync kind is not ticked by the pod
|
|
28
|
-
# (`scheduled: false`, backend storybook-sync.ts)
|
|
29
|
-
# automation holding one person's url and ids (`apply-time-placeholder`)
|
|
30
|
-
#
|
|
31
|
-
#
|
|
32
|
-
# computer
|
|
33
|
-
#
|
|
35
|
+
# (`scheduled: false`, backend storybook-sync.ts), a package cannot carry an
|
|
36
|
+
# automation holding one person's url and ids (`apply-time-placeholder`), and
|
|
37
|
+
# no verb creates an automation. So a URL source is re-synced only by an
|
|
38
|
+
# automation the person turns on (the run names it), and a computer source by
|
|
39
|
+
# that computer's build, upload and sync after each push. The brand identity
|
|
40
|
+
# lives only on the sync SOURCE's config (the contract): storybook.sync stores
|
|
41
|
+
# it there, never on the mirrored records.
|
|
34
42
|
|
|
35
43
|
meta:
|
|
36
44
|
slug: design-system
|
|
@@ -74,24 +82,27 @@ playbooks:
|
|
|
74
82
|
they belong to) and list the apps and brand identities by name, so the
|
|
75
83
|
next answers can name one. APP: resolve the app the person named (an
|
|
76
84
|
existing devplane_app first; never a second record for one that exists;
|
|
77
|
-
a new one is
|
|
78
|
-
project). BRAND: resolve the brand identity they named
|
|
79
|
-
Brand space); none named: the source carries none.
|
|
80
|
-
https URL → run storybook.sync with url, appId and
|
|
81
|
-
computer →
|
|
82
|
-
|
|
83
|
-
file,
|
|
84
|
-
appId and brandIdentityId
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
for a
|
|
89
|
-
|
|
90
|
-
|
|
85
|
+
a new one is proposed with create_entity, filed into the person's
|
|
86
|
+
project). BRAND: resolve the brand identity they named
|
|
87
|
+
(brand-identity, Brand space); none named: the source carries none.
|
|
88
|
+
CONNECT: a public https URL → run storybook.sync with url, appId and
|
|
89
|
+
brandIdentityId; a computer → the build and upload run on the person's
|
|
90
|
+
computer, not in this run: when they uploaded a
|
|
91
|
+
synap.storybook-bundle/v1 file, run storybook.sync with its
|
|
92
|
+
bundleFileId, appId and brandIdentityId; until then, write the three
|
|
93
|
+
values that computer's agent passes and stop. The first run of a source
|
|
94
|
+
is ONE import proposal the person approves; never write the records
|
|
95
|
+
yourself. KEEP CURRENT: the pod does not re-sync a Storybook on its own;
|
|
96
|
+
for a URL, name the daily automation the person turns on (one
|
|
97
|
+
storybook.sync step with the same three values); for a computer, the
|
|
98
|
+
same build, upload and sync run after each push to the app's main. The
|
|
99
|
+
brand identity goes only to storybook.sync (the source's config), never
|
|
100
|
+
onto the records.
|
|
91
101
|
# No activator: a manual activator fires on a subject, and this setup has
|
|
92
102
|
# none (the app is its second answer). It is started by name
|
|
93
103
|
# (run_playbook), by the person or an agent they ask.
|
|
94
104
|
executor: is-agent
|
|
105
|
+
tools: [storybook]
|
|
95
106
|
status: active
|
|
96
107
|
stages:
|
|
97
108
|
- key: where
|
|
@@ -133,7 +144,7 @@ playbooks:
|
|
|
133
144
|
- key: brand
|
|
134
145
|
name: Which brand identity
|
|
135
146
|
category: started
|
|
136
|
-
goal: Resolve the app the person named (an existing devplane_app first, never a twin; a new one
|
|
147
|
+
goal: Resolve the app the person named (an existing devplane_app first, never a twin; a new one proposed with create_entity, filed into their project). Ask nothing yourself; when your turn ends the pod asks which brand identity the Storybook expresses.
|
|
137
148
|
criteria:
|
|
138
149
|
- key: app-resolved-once
|
|
139
150
|
statement: The named app resolves to exactly one devplane_app, an existing one or one proposed in this run; no second record of an existing app was created.
|
|
@@ -155,10 +166,10 @@ playbooks:
|
|
|
155
166
|
- key: connect
|
|
156
167
|
name: Connect and first sync
|
|
157
168
|
category: started
|
|
158
|
-
goal: "Resolve the brand identity the person named (brand-identity in the Brand space; empty: none). A URL: run storybook.sync with url, appId and brandIdentityId. A computer:
|
|
169
|
+
goal: "Resolve the brand identity the person named (brand-identity in the Brand space; empty: none). A URL: run storybook.sync with url, appId and brandIdentityId. A computer: the build and upload run on the person's computer, not in this run; with an uploaded synap.storybook-bundle/v1 file, run storybook.sync with its bundleFileId, appId and brandIdentityId; without one yet, write the values the computer's agent passes and stop. The first run is one import proposal for the person; a refused or failed sync is reported with its reason, never retried blindly."
|
|
159
170
|
criteria:
|
|
160
171
|
- key: sync-ran-with-answers
|
|
161
|
-
statement: storybook.sync ran once with the person's source (url, or a bundle file a computer uploaded), the resolved appId and, when one was named, the brandIdentityId, and its import proposal is filed or its refusal is reported with the reason.
|
|
172
|
+
statement: storybook.sync ran once with the person's source (url, or a bundle file a computer uploaded), the resolved appId and, when one was named, the brandIdentityId, and its import proposal is filed or its refusal is reported with the reason; or, for a computer with no bundle uploaded yet, the run wrote the values its agent passes.
|
|
162
173
|
check: { kind: judge }
|
|
163
174
|
- key: brand-only-on-source
|
|
164
175
|
statement: The brand identity was passed to storybook.sync only; no mirrored record was written by hand.
|
|
@@ -166,8 +177,8 @@ playbooks:
|
|
|
166
177
|
- key: keep-current
|
|
167
178
|
name: Keep it current
|
|
168
179
|
category: completed
|
|
169
|
-
goal: "A URL:
|
|
180
|
+
goal: "A URL: name the daily automation the person turns on to keep it current (one storybook.sync step with the same url, appId and brandIdentityId): the pod does not re-sync a Storybook on its own. A computer: say that its build, upload and sync run after each push to the app's main. Then say how the weekly review of changed components is turned on (the schedule of Review a UI component is installed paused)."
|
|
170
181
|
criteria:
|
|
171
182
|
- key: sync-kept-current
|
|
172
|
-
statement: For a URL
|
|
183
|
+
statement: For a URL the answer names the daily storybook.sync automation with the same three values; for a computer it names the push that triggers the build, upload and sync.
|
|
173
184
|
check: { kind: judge }
|
|
@@ -81,7 +81,15 @@ describe("Design to implementation — the design loop", () => {
|
|
|
81
81
|
expect(critique.onFail).toEqual({ toStage: "generate" });
|
|
82
82
|
});
|
|
83
83
|
|
|
84
|
-
|
|
84
|
+
// A process that creates things of its own subject kind and starts on
|
|
85
|
+
// `created` would start itself on each of them. It may start on `created`
|
|
86
|
+
// only with an `unless` on a property every thing it creates already
|
|
87
|
+
// carries (Design to implementation: its variants carry the request's
|
|
88
|
+
// variant-group, plan §10.4). What is checked: the property is named in
|
|
89
|
+
// the process beyond the filter itself (a name check: it does not prove
|
|
90
|
+
// the process writes the property onto what it creates). An activator with
|
|
91
|
+
// no `unless`, or one on a property the process never names, fails.
|
|
92
|
+
it("no process that produces its own subject kind starts on `created` unfiltered (corpus-wide)", () => {
|
|
85
93
|
const selfProducing: string[] = [];
|
|
86
94
|
const offenders: string[] = [];
|
|
87
95
|
for (const t of Object.values(WORKSPACE_TEMPLATES))
|
|
@@ -95,8 +103,13 @@ describe("Design to implementation — the design loop", () => {
|
|
|
95
103
|
];
|
|
96
104
|
if (!subject || !outs.some((o) => o.kind === subject)) continue;
|
|
97
105
|
selfProducing.push(`${t.meta.slug}:${p.name}`);
|
|
98
|
-
|
|
99
|
-
|
|
106
|
+
const text = JSON.stringify(p);
|
|
107
|
+
for (const a of (p.activators ?? []) as { on: string; unless?: { property: string } }[]) {
|
|
108
|
+
if (a.on !== "created") continue;
|
|
109
|
+
const prop = a.unless?.property;
|
|
110
|
+
const stamped = !!prop && (text.match(new RegExp(`\\b${prop}\\b`, "g")) ?? []).length >= 2;
|
|
111
|
+
if (!stamped) offenders.push(`${t.meta.slug}:${p.name}`);
|
|
112
|
+
}
|
|
100
113
|
}
|
|
101
114
|
expect(selfProducing).toContain(
|
|
102
115
|
"builder-workspace:Design to implementation"
|