@synap-core/workspace-templates 0.24.1 → 0.25.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 +1164 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/builder-dev-playbooks.template.test.ts +66 -0
- package/src/builder.yaml +767 -0
- package/src/templates.ts +1164 -0
package/package.json
CHANGED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The dev playbooks of the Builder template (decision d05, founder
|
|
3
|
+
* instruction 2026-11-05): Build a change, Fix a bug, Investigate, Review a
|
|
4
|
+
* change, Maintain, Fix main red. They ship as DRAFTS with NO activators, so a pod
|
|
5
|
+
* that installs the template gets them off, and a person turns each on
|
|
6
|
+
* (a later template update keeps the pod's own draft/active choice).
|
|
7
|
+
*
|
|
8
|
+
* "Fix a bug" binds to `issue`, a CORE kind the pod seeds on every pod
|
|
9
|
+
* (ensure-system-profiles.ts / ensure-system-lifecycles.ts); Builder declares it
|
|
10
|
+
* to match that seed, so the lifecycle below must not drift from it.
|
|
11
|
+
*/
|
|
12
|
+
import { describe, expect, it } from "vitest";
|
|
13
|
+
import { getWorkspaceTemplate } from "./templates.js";
|
|
14
|
+
|
|
15
|
+
const DEV_PLAYBOOKS = ["Build a change", "Fix a bug", "Investigate", "Review a change", "Maintain", "Fix main red"] as const;
|
|
16
|
+
|
|
17
|
+
type Stage = { key: string; subjectStatus?: string };
|
|
18
|
+
type Playbook = {
|
|
19
|
+
name: string;
|
|
20
|
+
status?: string;
|
|
21
|
+
activators?: unknown;
|
|
22
|
+
stages?: Stage[];
|
|
23
|
+
subjectProfile?: { profileSlug?: string; statusProperty?: string; activators?: unknown };
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const playbooks = (getWorkspaceTemplate("builder-workspace")?.playbooks ?? []) as Playbook[];
|
|
27
|
+
const find = (name: string) => playbooks.find((p) => p.name === name);
|
|
28
|
+
|
|
29
|
+
describe("builder dev playbooks", () => {
|
|
30
|
+
it.each(DEV_PLAYBOOKS)("%s is present, a draft, with no activator", (name) => {
|
|
31
|
+
const pb = find(name);
|
|
32
|
+
expect(pb, `${name} missing from builder.yaml`).toBeDefined();
|
|
33
|
+
expect(pb?.status).toBe("draft");
|
|
34
|
+
expect(pb?.activators).toBeUndefined();
|
|
35
|
+
expect(pb?.subjectProfile?.activators).toBeUndefined();
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it.each(DEV_PLAYBOOKS)("%s names a statusProperty wherever a stage moves a status", (name) => {
|
|
39
|
+
const pb = find(name);
|
|
40
|
+
const moves = (pb?.stages ?? []).some((s) => s.subjectStatus);
|
|
41
|
+
if (moves) expect(pb?.subjectProfile?.statusProperty).toBeTruthy();
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
it("Fix a bug works the core `issue` kind through its declared lifecycle", () => {
|
|
45
|
+
const pb = find("Fix a bug");
|
|
46
|
+
expect(pb?.subjectProfile?.profileSlug).toBe("issue");
|
|
47
|
+
expect(pb?.subjectProfile?.statusProperty).toBe("issueStatus");
|
|
48
|
+
const issue = (getWorkspaceTemplate("builder-workspace")?.profiles ?? []).find((p) => p.slug === "issue") as
|
|
49
|
+
| { lifecycle?: { property: string; options: { key: string; category: string }[] } }
|
|
50
|
+
| undefined;
|
|
51
|
+
expect(issue?.lifecycle?.property).toBe("issueStatus");
|
|
52
|
+
expect(issue?.lifecycle?.options.map((o) => [o.key, o.category])).toEqual([
|
|
53
|
+
["open", "open"],
|
|
54
|
+
["investigating", "active"],
|
|
55
|
+
["fixed", "done"],
|
|
56
|
+
["wont_fix", "lost"],
|
|
57
|
+
]);
|
|
58
|
+
for (const s of pb?.stages ?? []) {
|
|
59
|
+
if (s.subjectStatus) expect(["open", "investigating", "fixed", "wont_fix"]).toContain(s.subjectStatus);
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
it("each name is declared once", () => {
|
|
64
|
+
for (const name of DEV_PLAYBOOKS) expect(playbooks.filter((p) => p.name === name)).toHaveLength(1);
|
|
65
|
+
});
|
|
66
|
+
});
|