@thanh01.pmt/domain-kit 0.2.1 → 0.3.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/{chunk-HUDFN4IX.mjs → chunk-LKSVTRQE.mjs} +74 -4
- package/dist/chunk-LKSVTRQE.mjs.map +1 -0
- package/dist/{chunk-23TQPTHG.mjs → chunk-MCHHEBH3.mjs} +5 -5
- package/dist/{chunk-23TQPTHG.mjs.map → chunk-MCHHEBH3.mjs.map} +1 -1
- package/dist/{chunk-HH4UX65C.mjs → chunk-MSRKUZLY.mjs} +21 -4
- package/dist/chunk-MSRKUZLY.mjs.map +1 -0
- package/dist/{chunk-WHBAGJWN.mjs → chunk-VCPIWJ7R.mjs} +4 -4
- package/dist/chunk-VCPIWJ7R.mjs.map +1 -0
- package/dist/{chunk-CRN6D4HG.mjs → chunk-Y7MRFFDJ.mjs} +31 -7
- package/dist/chunk-Y7MRFFDJ.mjs.map +1 -0
- package/dist/curriculumFeedEmitter-FYAWMPE6.mjs +4 -0
- package/dist/{curriculumFeedEmitter-E5DAJYUZ.mjs.map → curriculumFeedEmitter-FYAWMPE6.mjs.map} +1 -1
- package/dist/{curriculumFeedSchema-TEeQg2bY.d.ts → curriculumFeedSchema-C8ZP3XMi.d.cts} +8 -8
- package/dist/{curriculumFeedSchema-TEeQg2bY.d.cts → curriculumFeedSchema-C8ZP3XMi.d.ts} +8 -8
- package/dist/feed/index.cjs +90 -3
- package/dist/feed/index.cjs.map +1 -1
- package/dist/feed/index.d.cts +1 -1
- package/dist/feed/index.d.ts +1 -1
- package/dist/feed/index.mjs +2 -2
- package/dist/graph/index.cjs +29 -5
- package/dist/graph/index.cjs.map +1 -1
- package/dist/graph/index.d.cts +2 -2
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.mjs +1 -1
- package/dist/{hybridGraphPipeline-DmWRKYXf.d.cts → hybridGraphPipeline-BhFyh3cm.d.cts} +1 -1
- package/dist/{hybridGraphPipeline-DVZYLCAQ.d.ts → hybridGraphPipeline-NZAWAPt_.d.ts} +1 -1
- package/dist/{hybridGraphSchema-BCgXicgA.d.ts → hybridGraphSchema-nrUeSwpU.d.cts} +15 -15
- package/dist/{hybridGraphSchema-BCgXicgA.d.cts → hybridGraphSchema-nrUeSwpU.d.ts} +15 -15
- package/dist/index.cjs +121 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.mjs +5 -5
- package/dist/pipeline/index.cjs +119 -8
- package/dist/pipeline/index.cjs.map +1 -1
- package/dist/pipeline/index.d.cts +3 -3
- package/dist/pipeline/index.d.ts +3 -3
- package/dist/pipeline/index.mjs +4 -4
- package/dist/schemas/index.cjs +21 -4
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +2 -2
- package/dist/schemas/index.d.ts +2 -2
- package/dist/schemas/index.mjs +2 -2
- package/package.json +10 -9
- package/LICENSE +0 -21
- package/dist/chunk-CRN6D4HG.mjs.map +0 -1
- package/dist/chunk-HH4UX65C.mjs.map +0 -1
- package/dist/chunk-HUDFN4IX.mjs.map +0 -1
- package/dist/chunk-WHBAGJWN.mjs.map +0 -1
- package/dist/curriculumFeedEmitter-E5DAJYUZ.mjs +0 -4
package/dist/graph/index.cjs
CHANGED
|
@@ -2305,6 +2305,8 @@ function auditPhasePlan(plan, features, concepts, links, warnings, log) {
|
|
|
2305
2305
|
const phases = [];
|
|
2306
2306
|
const featurePhase = /* @__PURE__ */ new Map();
|
|
2307
2307
|
const newIntroPhase = /* @__PURE__ */ new Map();
|
|
2308
|
+
const previewsSeen = /* @__PURE__ */ new Set();
|
|
2309
|
+
const previewPhase = /* @__PURE__ */ new Map();
|
|
2308
2310
|
const errors = [];
|
|
2309
2311
|
plan.forEach((rp, idx) => {
|
|
2310
2312
|
const id = String(rp.id || "PH" + (idx + 1));
|
|
@@ -2336,7 +2338,22 @@ function auditPhasePlan(plan, features, concepts, links, warnings, log) {
|
|
|
2336
2338
|
errors.push("Phase " + id + ": introduces unknown concept " + cid);
|
|
2337
2339
|
continue;
|
|
2338
2340
|
}
|
|
2339
|
-
const
|
|
2341
|
+
const rawAspect = String(ri.aspect || "new");
|
|
2342
|
+
const aspect = rawAspect === "advanced" || rawAspect === "preview" ? rawAspect : "new";
|
|
2343
|
+
if (aspect === "preview") {
|
|
2344
|
+
if (newIntroPhase.has(cid)) {
|
|
2345
|
+
errors.push("Phase " + id + ": preview of " + cid + " after its new introduction in phase " + newIntroPhase.get(cid) + " - preview must precede the anchor teach");
|
|
2346
|
+
continue;
|
|
2347
|
+
}
|
|
2348
|
+
if (previewsSeen.has(cid)) {
|
|
2349
|
+
errors.push("Phase " + id + ": duplicate preview of " + cid);
|
|
2350
|
+
continue;
|
|
2351
|
+
}
|
|
2352
|
+
previewsSeen.add(cid);
|
|
2353
|
+
previewPhase.set(cid, order);
|
|
2354
|
+
introductions.push({ concept_id: cid, aspect, note: String(ri.note || "") });
|
|
2355
|
+
continue;
|
|
2356
|
+
}
|
|
2340
2357
|
if (aspect === "advanced") {
|
|
2341
2358
|
const first = newIntroPhase.get(cid);
|
|
2342
2359
|
if (first === void 0) {
|
|
@@ -2384,10 +2401,17 @@ function auditPhasePlan(plan, features, concepts, links, warnings, log) {
|
|
|
2384
2401
|
}
|
|
2385
2402
|
for (const [cid, consumerOrder] of firstConsumerPhase) {
|
|
2386
2403
|
const intro = newIntroPhase.get(cid);
|
|
2387
|
-
|
|
2404
|
+
const prev = previewPhase.get(cid);
|
|
2405
|
+
if (intro === void 0 && prev === void 0) {
|
|
2388
2406
|
errors.push("Concept " + cid + " is consumed from phase " + consumerOrder + " but never introduced in any phase");
|
|
2389
|
-
} else if (intro > consumerOrder) {
|
|
2390
|
-
errors.push("Concept " + cid + " introduced in phase " + intro + " but first consumed in phase " + consumerOrder + " - introduction must come no later than first consumption");
|
|
2407
|
+
} else if (intro !== void 0 && intro > consumerOrder && (prev === void 0 || prev > consumerOrder)) {
|
|
2408
|
+
errors.push("Concept " + cid + " introduced in phase " + intro + " but first consumed in phase " + consumerOrder + " - introduction must come no later than first consumption (or a preview must cover the dependency)");
|
|
2409
|
+
}
|
|
2410
|
+
}
|
|
2411
|
+
for (const [cid, pOrder] of previewPhase) {
|
|
2412
|
+
const anchor = newIntroPhase.get(cid);
|
|
2413
|
+
if (anchor !== void 0 && anchor <= pOrder) {
|
|
2414
|
+
errors.push("Concept " + cid + " previewed in phase " + pOrder + " but fully introduced in phase " + anchor + " - preview must precede the anchor introduction");
|
|
2391
2415
|
}
|
|
2392
2416
|
}
|
|
2393
2417
|
return { phases, errors };
|
|
@@ -2403,7 +2427,7 @@ async function decomposePhases(args) {
|
|
|
2403
2427
|
const linkList = links.map(
|
|
2404
2428
|
(l) => "- " + l.feature_id + " -> " + l.concept_id + " (" + l.depth + ")"
|
|
2405
2429
|
).join("\n") || "(none)";
|
|
2406
|
-
const systemPrompt =
|
|
2430
|
+
const systemPrompt = 'You decompose a software project build into PROGRESSIVE COMPLETION PHASES for learning purposes.\n\nA phase is NOT a feature and NOT a milestone list: it is a cross-feature slice of the\nproduct whose completion yields a DEMONSTRABLY more complete product. Build up gradually:\nthe product grows feature by feature across phases, and each phase adds its features to\nwhat previous phases already built.\n\nRULES:\n1. Every feature must be assigned to EXACTLY ONE phase (no feature reused, none skipped).\n2. Phases are ordered; later phases depend on earlier ones and yield a more complete product.\n3. product_completion describes concretely what the product can DO once the phase is done.\n4. introduces lists which concepts the phase must teach BEFORE its feature work starts:\n - aspect new: first time the concept appears in the course\n - aspect advanced: a concept introduced in an EARLIER phase, revisited here at a\n higher depth (an advanced aspect of the same concept, e.g. validation rules on top\n of basic data modeling). Use the note field to say which aspect.\n - aspect preview: a light awareness pass ("know it exists", ULO depth only, ~5 min)\n placed in an EARLIER phase when its feature work needs the vocabulary before the\n full teach. The anchor phase still owns the full new introduction.\n5. A concept MUST be introduced (new) no later than the first phase that consumes it.\n6. A concept must not be introduced before its own prerequisites are introduced.\n7. Typically 3-6 phases for a small project; keep phases balanced.\n8. Phase 1 usually covers project setup/foundation features plus the first minimal slice.\n9. Return JSON only.';
|
|
2407
2431
|
const baseUserPrompt = "FEATURES:\n" + featureList + "\n\nCONCEPTS:\n" + conceptList + "\n\nFEATURE-CONCEPT LINKS:\n" + linkList + "\n\nReturn JSON with a phases array. Each phase: { id: PH1, name, product_completion, feature_ids: [F0, F1], introduces: [{ concept_id: C1, aspect: new or advanced, note }] }.\n";
|
|
2408
2432
|
const MAX_DECOMPOSE_ATTEMPTS = 3;
|
|
2409
2433
|
let auditErrors = [];
|