@forwardimpact/libsyntheticprose 0.1.1 → 0.1.3

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/engine/pathway.js CHANGED
@@ -133,7 +133,10 @@ async function generatePathwayData({
133
133
  b.id,
134
134
  buildBehaviourPrompt(b, ctx, schemas.behaviour),
135
135
  proseEngine,
136
- ).then((data) => ({ ...data, _id: b.id })),
136
+ ).then((data) => ({
137
+ ...data,
138
+ _id: b.id,
139
+ })),
137
140
  ),
138
141
  );
139
142
 
@@ -149,7 +152,10 @@ async function generatePathwayData({
149
152
  schemas.capability,
150
153
  ),
151
154
  proseEngine,
152
- ).then((data) => ({ ...data, _id: c.id })),
155
+ ).then((data) => ({
156
+ ...data,
157
+ _id: c.id,
158
+ })),
153
159
  ),
154
160
  );
155
161
 
@@ -183,7 +189,10 @@ async function generatePathwayData({
183
189
  schemas.discipline,
184
190
  ),
185
191
  proseEngine,
186
- ).then((data) => ({ ...data, _id: d.id })),
192
+ ).then((data) => ({
193
+ ...data,
194
+ _id: d.id,
195
+ })),
187
196
  ),
188
197
  );
189
198
 
@@ -200,7 +209,10 @@ async function generatePathwayData({
200
209
  schemas.track,
201
210
  ),
202
211
  proseEngine,
203
- ).then((data) => ({ ...data, _id: t.id })),
212
+ ).then((data) => ({
213
+ ...data,
214
+ _id: t.id,
215
+ })),
204
216
  ),
205
217
  );
206
218
 
@@ -267,7 +279,7 @@ function createRng(seed) {
267
279
  function jitter(rng, base, max) {
268
280
  const r = rng();
269
281
  // 50% same, 20% +1, 15% -1, 10% +2, 5% -2
270
- let offset = 0;
282
+ let offset;
271
283
  if (r < 0.5) offset = 0;
272
284
  else if (r < 0.7) offset = 1;
273
285
  else if (r < 0.85) offset = -1;
@@ -323,7 +335,7 @@ function generateSelfAssessments(framework, skillIds, behaviourIds) {
323
335
  for (const behaviourId of behaviourIds) {
324
336
  // Behaviours use tighter variance: ±1 only (no ±2 outliers)
325
337
  const r = rng();
326
- let offset = 0;
338
+ let offset;
327
339
  if (r < 0.55) offset = 0;
328
340
  else if (r < 0.8) offset = 1;
329
341
  else offset = -1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forwardimpact/libsyntheticprose",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "LLM-based prose and pathway generation for synthetic data",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -19,9 +19,9 @@
19
19
  "@forwardimpact/libutil": "^0.1.61",
20
20
  "@forwardimpact/libtelemetry": "^0.1.23",
21
21
  "@forwardimpact/libprompt": "^0.1.0",
22
- "ajv": "^8.12.0",
23
- "ajv-formats": "^2.1.1",
24
- "yaml": "^2.3.0"
22
+ "ajv": "^8.18.0",
23
+ "ajv-formats": "^3.0.1",
24
+ "yaml": "^2.8.3"
25
25
  },
26
26
  "engines": {
27
27
  "node": ">=18.0.0"
@@ -54,7 +54,7 @@ export function buildCapabilityPrompt(skeleton, ctx, schema) {
54
54
  " Not all skills need all 6 stages. Use these criteria:",
55
55
  " - specify: include if the skill informs what to build or constrains requirements",
56
56
  " - plan: include if the skill drives architecture or design decisions",
57
- " - onboard: include if the skill requires tooling, dependencies, or env setup",
57
+ " - scaffold: include if the skill requires tooling, dependencies, or env setup",
58
58
  " - code: include if the skill is directly exercised during implementation",
59
59
  " - review: include if the skill has quality criteria to verify",
60
60
  " - deploy: include if the skill has production or operational concerns",
@@ -28,7 +28,7 @@ export function buildStagePrompt(stageIds, ctx, schema) {
28
28
  "## Instructions",
29
29
  "- Output a JSON array of stage objects.",
30
30
  "- For each stage ID, generate:",
31
- " - id: The stage ID (must be one of: specify, plan, onboard, code, review, deploy).",
31
+ ` - id: The stage ID (must be one of: ${stageIds.join(", ")}).`,
32
32
  ' - name: Human-readable name (e.g., "Specify", "Plan").',
33
33
  " - emojiIcon: A single emoji for this stage.",
34
34
  ' - description: 2-3 sentences in second person ("You...").',