@kaddo/cli 3.132.0 → 3.133.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/admin-dist/assets/{architectureDiagram-3BPJPVTR-B0OuhO94.js → architectureDiagram-3BPJPVTR-DR1_1O3v.js} +1 -1
- package/dist/admin-dist/assets/{chunk-727SXJPM-CaqXII8F.js → chunk-727SXJPM-COmzRt04.js} +1 -1
- package/dist/admin-dist/assets/{chunk-AQP2D5EJ-Bg4-fugM.js → chunk-AQP2D5EJ-CXMsTGWW.js} +1 -1
- package/dist/admin-dist/assets/{classDiagram-v2-Q7XG4LA2-CckXCSJd.js → classDiagram-4FO5ZUOK-D2dQFgos.js} +1 -1
- package/dist/admin-dist/assets/{classDiagram-4FO5ZUOK-CckXCSJd.js → classDiagram-v2-Q7XG4LA2-D2dQFgos.js} +1 -1
- package/dist/admin-dist/assets/{dagre-BM42HDAG-C0-ZkGqx.js → dagre-BM42HDAG-BMRsOxw1.js} +1 -1
- package/dist/admin-dist/assets/{diagram-2AECGRRQ-CXx8vdld.js → diagram-2AECGRRQ-CRXNCxDY.js} +1 -1
- package/dist/admin-dist/assets/{diagram-5GNKFQAL-DsmIj164.js → diagram-5GNKFQAL-C9bO8FnC.js} +1 -1
- package/dist/admin-dist/assets/{diagram-LMA3HP47-BwY_Oswl.js → diagram-LMA3HP47-ye8rGB9h.js} +1 -1
- package/dist/admin-dist/assets/{diagram-OG6HWLK6-DZmoKiat.js → diagram-OG6HWLK6-BL0joNkk.js} +1 -1
- package/dist/admin-dist/assets/{erDiagram-TEJ5UH35-DnkbNH-3.js → erDiagram-TEJ5UH35-lqVTGIq-.js} +1 -1
- package/dist/admin-dist/assets/{flowDiagram-I6XJVG4X-0M5AwmbD.js → flowDiagram-I6XJVG4X-DA2CLejf.js} +1 -1
- package/dist/admin-dist/assets/{ganttDiagram-6RSMTGT7-p0YbWB-q.js → ganttDiagram-6RSMTGT7-Dkr4jLLp.js} +1 -1
- package/dist/admin-dist/assets/index-CZPZGMX7.js +96 -0
- package/dist/admin-dist/assets/{infoDiagram-5YYISTIA-CizIjxWP.js → infoDiagram-5YYISTIA-PZDUmGz-.js} +1 -1
- package/dist/admin-dist/assets/{ishikawaDiagram-YF4QCWOH-DZKlVu1h.js → ishikawaDiagram-YF4QCWOH-BByxhIgY.js} +1 -1
- package/dist/admin-dist/assets/{kanban-definition-UN3LZRKU-G70NiHFN.js → kanban-definition-UN3LZRKU-BSTqfNBc.js} +1 -1
- package/dist/admin-dist/assets/{linear-BBYNswBY.js → linear-DJE08IfY.js} +1 -1
- package/dist/admin-dist/assets/{mindmap-definition-RKZ34NQL-CSed8LsK.js → mindmap-definition-RKZ34NQL-CmiCyDY8.js} +1 -1
- package/dist/admin-dist/assets/{pieDiagram-4H26LBE5-BMiHTdzs.js → pieDiagram-4H26LBE5-BlMxq332.js} +1 -1
- package/dist/admin-dist/assets/{quadrantDiagram-W4KKPZXB-xAoJMAFV.js → quadrantDiagram-W4KKPZXB-Cy0zZxaY.js} +1 -1
- package/dist/admin-dist/assets/{requirementDiagram-4Y6WPE33-BqxSHuU_.js → requirementDiagram-4Y6WPE33-CAfQqVXA.js} +1 -1
- package/dist/admin-dist/assets/{sequenceDiagram-3UESZ5HK-CEQr2xzT.js → sequenceDiagram-3UESZ5HK-CZYFDyTc.js} +1 -1
- package/dist/admin-dist/assets/{stateDiagram-AJRCARHV-DxYDejoz.js → stateDiagram-AJRCARHV-BTWDzbes.js} +1 -1
- package/dist/admin-dist/assets/{stateDiagram-v2-BHNVJYJU-DXEhlcga.js → stateDiagram-v2-BHNVJYJU-BcExDjN4.js} +1 -1
- package/dist/admin-dist/assets/{timeline-definition-PNZ67QCA-BAUnT8tD.js → timeline-definition-PNZ67QCA-Db_z8PtC.js} +1 -1
- package/dist/admin-dist/assets/{vennDiagram-CIIHVFJN-DAWIyWJZ.js → vennDiagram-CIIHVFJN-Dkj99o7j.js} +1 -1
- package/dist/admin-dist/assets/{wardleyDiagram-YWT4CUSO-B5sNcSKa.js → wardleyDiagram-YWT4CUSO-DG8V20tb.js} +1 -1
- package/dist/admin-dist/assets/{xychartDiagram-2RQKCTM6-0N6T1yeV.js → xychartDiagram-2RQKCTM6-B6EVudFe.js} +1 -1
- package/dist/admin-dist/index.html +1 -1
- package/dist/admin-server/index.js +169 -1
- package/dist/core.js +197 -11
- package/dist/index.js +5 -4
- package/package.json +1 -1
- package/dist/admin-dist/assets/index-DE-FwnK7.js +0 -94
package/dist/core.js
CHANGED
|
@@ -1891,6 +1891,7 @@ function suggestInitiativesForExternalItem(dir, integration, externalId) {
|
|
|
1891
1891
|
}
|
|
1892
1892
|
|
|
1893
1893
|
// src/core/delivery-planning.ts
|
|
1894
|
+
import { createHash } from "crypto";
|
|
1894
1895
|
import matter4 from "gray-matter";
|
|
1895
1896
|
var DELIVERY_PLANS_DIR = "knowledge/delivery/plans";
|
|
1896
1897
|
var EPICS_DIR = "knowledge/delivery/epics";
|
|
@@ -2176,6 +2177,35 @@ function validatePlanningGraph(dir) {
|
|
|
2176
2177
|
findings.push({ level: "warning", kind: "pending_dependency", subject: e.id, message: `Epic ${e.id} is blocked by unfinished dependency ${d}.` });
|
|
2177
2178
|
return findings;
|
|
2178
2179
|
}
|
|
2180
|
+
function revisionOf(content) {
|
|
2181
|
+
return createHash("sha256").update(content, "utf8").digest("hex").slice(0, 16);
|
|
2182
|
+
}
|
|
2183
|
+
function validateEpicDependencyChange(dir, epicId, deps) {
|
|
2184
|
+
const epics = discoverEpics(dir);
|
|
2185
|
+
const epicIds = new Set(epics.map((e) => e.id.toLowerCase()));
|
|
2186
|
+
const self = epicId.toLowerCase();
|
|
2187
|
+
const errors = [];
|
|
2188
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2189
|
+
for (const d of deps) {
|
|
2190
|
+
const key = d.toLowerCase();
|
|
2191
|
+
if (key === self) {
|
|
2192
|
+
errors.push(`Epic ${epicId} cannot depend on itself.`);
|
|
2193
|
+
continue;
|
|
2194
|
+
}
|
|
2195
|
+
if (!epicIds.has(key)) {
|
|
2196
|
+
errors.push(`Epic ${epicId} depends on missing Epic ${d}.`);
|
|
2197
|
+
continue;
|
|
2198
|
+
}
|
|
2199
|
+
if (seen.has(key)) errors.push(`Epic ${epicId} declares duplicate dependency ${d}.`);
|
|
2200
|
+
seen.add(key);
|
|
2201
|
+
}
|
|
2202
|
+
if (errors.length > 0) return errors;
|
|
2203
|
+
const edges = new Map(epics.map((e) => [e.id.toLowerCase(), e.dependsOn.map((d) => d.toLowerCase())]));
|
|
2204
|
+
edges.set(self, deps.map((d) => d.toLowerCase()));
|
|
2205
|
+
const cycle = findCycle([...epicIds, self], edges);
|
|
2206
|
+
if (cycle) errors.push(`Dependency cycle among Epics: ${cycle.join(" \u2192 ")}.`);
|
|
2207
|
+
return errors;
|
|
2208
|
+
}
|
|
2179
2209
|
|
|
2180
2210
|
// src/core/resources.ts
|
|
2181
2211
|
import matter5 from "gray-matter";
|
|
@@ -4150,13 +4180,13 @@ function readPocSummary(dir) {
|
|
|
4150
4180
|
}
|
|
4151
4181
|
|
|
4152
4182
|
// src/core/poc-report.ts
|
|
4153
|
-
import { createHash } from "crypto";
|
|
4183
|
+
import { createHash as createHash2 } from "crypto";
|
|
4154
4184
|
import matter8 from "gray-matter";
|
|
4155
4185
|
var POC_REPORT_PREFIX = "poc-report-v";
|
|
4156
4186
|
var SECRET_LINE = /(^|\s)(?:[A-Z][A-Z0-9_]*(?:TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY)|(?:token|secret|password|api[_-]?key))\s*[:=]\s*\S+/i;
|
|
4157
4187
|
var reportName = /^poc-report-v(\d{3,})\.md$/;
|
|
4158
4188
|
function sha(value) {
|
|
4159
|
-
return
|
|
4189
|
+
return createHash2("sha256").update(value).digest("hex");
|
|
4160
4190
|
}
|
|
4161
4191
|
function posix(value) {
|
|
4162
4192
|
return value.replace(/\\/g, "/");
|
|
@@ -11095,6 +11125,31 @@ var DeliveryPlanningWriteError = class extends Error {
|
|
|
11095
11125
|
this.name = "DeliveryPlanningWriteError";
|
|
11096
11126
|
}
|
|
11097
11127
|
};
|
|
11128
|
+
var PlanningConflictError = class extends Error {
|
|
11129
|
+
constructor(id, expectedRevision, actualRevision) {
|
|
11130
|
+
super(`"${id}" was modified since it was loaded (expected revision ${expectedRevision}, found ${actualRevision}). Reload and try again.`);
|
|
11131
|
+
this.id = id;
|
|
11132
|
+
this.expectedRevision = expectedRevision;
|
|
11133
|
+
this.actualRevision = actualRevision;
|
|
11134
|
+
this.name = "PlanningConflictError";
|
|
11135
|
+
}
|
|
11136
|
+
id;
|
|
11137
|
+
expectedRevision;
|
|
11138
|
+
actualRevision;
|
|
11139
|
+
};
|
|
11140
|
+
function assertFreshRevision(id, currentContent, opts) {
|
|
11141
|
+
if (!opts?.expectedRevision) return;
|
|
11142
|
+
const actual = revisionOf(currentContent);
|
|
11143
|
+
if (actual !== opts.expectedRevision) throw new PlanningConflictError(id, opts.expectedRevision, actual);
|
|
11144
|
+
}
|
|
11145
|
+
function cleanList(v) {
|
|
11146
|
+
return v.map((x) => typeof x === "string" ? x.trim() : String(x)).filter(Boolean);
|
|
11147
|
+
}
|
|
11148
|
+
function setListOrDelete(data, key, list2) {
|
|
11149
|
+
const cleaned = cleanList(list2);
|
|
11150
|
+
if (cleaned.length > 0) data[key] = cleaned;
|
|
11151
|
+
else delete data[key];
|
|
11152
|
+
}
|
|
11098
11153
|
function slugify3(s) {
|
|
11099
11154
|
return s.trim().toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "item";
|
|
11100
11155
|
}
|
|
@@ -11155,9 +11210,134 @@ function associateInitiativeWithEpic(dir, initiativeId, epicId) {
|
|
|
11155
11210
|
if (!getEpic(dir, epicId)) throw new DeliveryPlanningWriteError(`Epic ${epicId} does not exist.`);
|
|
11156
11211
|
return updateInitiative(dir, ini.id, { epic: epicId });
|
|
11157
11212
|
}
|
|
11213
|
+
function disassociateInitiativeFromEpic(dir, initiativeId) {
|
|
11214
|
+
const ini = getInitiative(dir, initiativeId);
|
|
11215
|
+
if (!ini) throw new DeliveryPlanningWriteError(`Initiative ${initiativeId} not found.`);
|
|
11216
|
+
if (!ini.epic) return ini;
|
|
11217
|
+
return updateInitiative(dir, ini.id, { epic: null });
|
|
11218
|
+
}
|
|
11219
|
+
function normalizeMilestones(planId, input) {
|
|
11220
|
+
const seen = /* @__PURE__ */ new Set();
|
|
11221
|
+
const data = [];
|
|
11222
|
+
const model = [];
|
|
11223
|
+
for (const m of input) {
|
|
11224
|
+
const id = m.id?.trim();
|
|
11225
|
+
if (!id) throw new DeliveryPlanningWriteError("Each milestone needs an id.");
|
|
11226
|
+
const key = id.toLowerCase();
|
|
11227
|
+
if (seen.has(key)) throw new DeliveryPlanningWriteError(`Plan ${planId} declares milestone ${id} more than once.`);
|
|
11228
|
+
seen.add(key);
|
|
11229
|
+
const title = m.title?.trim() || id;
|
|
11230
|
+
const exit = cleanList(m.exitCriteria ?? []);
|
|
11231
|
+
const entry = { id, title };
|
|
11232
|
+
if (exit.length > 0) entry.exit_criteria = exit;
|
|
11233
|
+
data.push(entry);
|
|
11234
|
+
model.push({ id, title, exitCriteria: exit });
|
|
11235
|
+
}
|
|
11236
|
+
return { data, model };
|
|
11237
|
+
}
|
|
11238
|
+
function updateDeliveryPlan(dir, id, patch, opts) {
|
|
11239
|
+
const plan = getPlan(dir, id);
|
|
11240
|
+
if (!plan) throw new DeliveryPlanningWriteError(`Plan ${id} does not exist.`);
|
|
11241
|
+
const raw = readFile(plan.filePath);
|
|
11242
|
+
assertFreshRevision(plan.id, raw, opts);
|
|
11243
|
+
const { data, content } = matter13(raw, {});
|
|
11244
|
+
if (patch.title !== void 0) {
|
|
11245
|
+
if (!patch.title.trim()) throw new DeliveryPlanningWriteError("Plan title cannot be empty.");
|
|
11246
|
+
data.title = patch.title.trim();
|
|
11247
|
+
}
|
|
11248
|
+
if (patch.objective !== void 0) {
|
|
11249
|
+
if (patch.objective === null || patch.objective.trim() === "") delete data.objective;
|
|
11250
|
+
else data.objective = patch.objective.trim();
|
|
11251
|
+
}
|
|
11252
|
+
if (patch.successCriteria !== void 0) setListOrDelete(data, "success_criteria", patch.successCriteria);
|
|
11253
|
+
if (patch.risks !== void 0) setListOrDelete(data, "risks", patch.risks);
|
|
11254
|
+
if (patch.dependsOn !== void 0) setListOrDelete(data, "depends_on", patch.dependsOn);
|
|
11255
|
+
if (patch.references !== void 0) setListOrDelete(data, "references", patch.references);
|
|
11256
|
+
if (patch.milestones !== void 0) {
|
|
11257
|
+
const { data: msData, model } = normalizeMilestones(plan.id, patch.milestones);
|
|
11258
|
+
const newIds = new Set(model.map((m) => m.id.toLowerCase()));
|
|
11259
|
+
const referencedByEpic = /* @__PURE__ */ new Map();
|
|
11260
|
+
for (const e of epicsInPlan(dir, plan.id)) {
|
|
11261
|
+
if (!e.milestone) continue;
|
|
11262
|
+
const key = e.milestone.toLowerCase();
|
|
11263
|
+
if (!newIds.has(key)) {
|
|
11264
|
+
const list2 = referencedByEpic.get(e.milestone) ?? [];
|
|
11265
|
+
list2.push(e.id);
|
|
11266
|
+
referencedByEpic.set(e.milestone, list2);
|
|
11267
|
+
}
|
|
11268
|
+
}
|
|
11269
|
+
if (referencedByEpic.size > 0) {
|
|
11270
|
+
const detail = [...referencedByEpic.entries()].map(([ms, epics]) => `${ms} (used by ${epics.join(", ")})`).join("; ");
|
|
11271
|
+
throw new DeliveryPlanningWriteError(`Cannot remove or rename milestone(s) still referenced by an Epic: ${detail}. Reassign the Epic first.`);
|
|
11272
|
+
}
|
|
11273
|
+
data.milestones = msData;
|
|
11274
|
+
}
|
|
11275
|
+
const newContent = matter13.stringify(content, data);
|
|
11276
|
+
writeFile(plan.filePath, newContent);
|
|
11277
|
+
const updated = parseDeliveryPlan(dir, plan.filePath, newContent);
|
|
11278
|
+
if (!updated) throw new DeliveryPlanningWriteError("Failed to parse the Plan after update.");
|
|
11279
|
+
return updated;
|
|
11280
|
+
}
|
|
11281
|
+
function updateEpic(dir, id, patch, opts) {
|
|
11282
|
+
const epic = getEpic(dir, id);
|
|
11283
|
+
if (!epic) throw new DeliveryPlanningWriteError(`Epic ${id} does not exist.`);
|
|
11284
|
+
const raw = readFile(epic.filePath);
|
|
11285
|
+
assertFreshRevision(epic.id, raw, opts);
|
|
11286
|
+
const { data, content } = matter13(raw, {});
|
|
11287
|
+
const finalPlan = patch.plan !== void 0 ? patch.plan?.trim() || null : epic.plan;
|
|
11288
|
+
let finalMilestone = patch.milestone !== void 0 ? patch.milestone?.trim() || null : epic.milestone;
|
|
11289
|
+
if (!finalPlan) {
|
|
11290
|
+
if (patch.milestone !== void 0 && finalMilestone) {
|
|
11291
|
+
throw new DeliveryPlanningWriteError("A milestone can only be set together with its plan.");
|
|
11292
|
+
}
|
|
11293
|
+
finalMilestone = null;
|
|
11294
|
+
} else {
|
|
11295
|
+
if (patch.plan !== void 0 && !getPlan(dir, finalPlan)) {
|
|
11296
|
+
throw new DeliveryPlanningWriteError(`Plan ${finalPlan} does not exist.`);
|
|
11297
|
+
}
|
|
11298
|
+
if (finalMilestone) {
|
|
11299
|
+
const plan = getPlan(dir, finalPlan);
|
|
11300
|
+
if (!plan) throw new DeliveryPlanningWriteError(`Plan ${finalPlan} does not exist.`);
|
|
11301
|
+
if (!plan.milestones.some((m) => m.id.toLowerCase() === finalMilestone.toLowerCase())) {
|
|
11302
|
+
throw new DeliveryPlanningWriteError(`Milestone ${finalMilestone} is not defined in ${finalPlan}.`);
|
|
11303
|
+
}
|
|
11304
|
+
}
|
|
11305
|
+
}
|
|
11306
|
+
if (patch.dependsOn !== void 0) {
|
|
11307
|
+
const deps = cleanList(patch.dependsOn);
|
|
11308
|
+
const errs = validateEpicDependencyChange(dir, epic.id, deps);
|
|
11309
|
+
if (errs.length > 0) throw new DeliveryPlanningWriteError(errs.join(" "));
|
|
11310
|
+
}
|
|
11311
|
+
if (patch.title !== void 0) {
|
|
11312
|
+
if (!patch.title.trim()) throw new DeliveryPlanningWriteError("Epic title cannot be empty.");
|
|
11313
|
+
data.title = patch.title.trim();
|
|
11314
|
+
}
|
|
11315
|
+
if (patch.outcome !== void 0) {
|
|
11316
|
+
delete data.expected_outcome;
|
|
11317
|
+
if (patch.outcome === null || patch.outcome.trim() === "") delete data.outcome;
|
|
11318
|
+
else data.outcome = patch.outcome.trim();
|
|
11319
|
+
}
|
|
11320
|
+
if (patch.plan !== void 0) {
|
|
11321
|
+
if (finalPlan) data.plan = finalPlan;
|
|
11322
|
+
else delete data.plan;
|
|
11323
|
+
}
|
|
11324
|
+
if (patch.plan !== void 0 || patch.milestone !== void 0) {
|
|
11325
|
+
if (finalMilestone) data.milestone = finalMilestone;
|
|
11326
|
+
else delete data.milestone;
|
|
11327
|
+
}
|
|
11328
|
+
if (patch.successCriteria !== void 0) setListOrDelete(data, "success_criteria", patch.successCriteria);
|
|
11329
|
+
if (patch.dependsOn !== void 0) setListOrDelete(data, "depends_on", patch.dependsOn);
|
|
11330
|
+
if (patch.relatedCapabilities !== void 0) setListOrDelete(data, "related_capabilities", patch.relatedCapabilities);
|
|
11331
|
+
if (patch.decisions !== void 0) setListOrDelete(data, "decisions", patch.decisions);
|
|
11332
|
+
const newContent = matter13.stringify(content, data);
|
|
11333
|
+
writeFile(epic.filePath, newContent);
|
|
11334
|
+
const updated = parseEpic(dir, epic.filePath, newContent);
|
|
11335
|
+
if (!updated) throw new DeliveryPlanningWriteError("Failed to parse the Epic after update.");
|
|
11336
|
+
return updated;
|
|
11337
|
+
}
|
|
11158
11338
|
|
|
11159
11339
|
// src/core/knowledge-consolidation.ts
|
|
11160
|
-
import { createHash as
|
|
11340
|
+
import { createHash as createHash3 } from "crypto";
|
|
11161
11341
|
import matter14 from "gray-matter";
|
|
11162
11342
|
var KNOWLEDGE5 = "knowledge";
|
|
11163
11343
|
var CONSOLIDATION_CATEGORIES = [
|
|
@@ -11177,7 +11357,7 @@ function relFromDir(dir, filePath) {
|
|
|
11177
11357
|
return f.startsWith(d + "/") ? f.slice(d.length + 1) : f;
|
|
11178
11358
|
}
|
|
11179
11359
|
function sha256(content) {
|
|
11180
|
-
return
|
|
11360
|
+
return createHash3("sha256").update(content, "utf-8").digest("hex");
|
|
11181
11361
|
}
|
|
11182
11362
|
var SHINGLE_SIZE = 6;
|
|
11183
11363
|
var MIN_SHARED_RUN = 6;
|
|
@@ -12908,7 +13088,7 @@ var WorkItemWriteError = class extends Error {
|
|
|
12908
13088
|
var VALID_COVERAGE = /* @__PURE__ */ new Set(["affected", "reviewed-not-affected", "unknown", "not-applicable"]);
|
|
12909
13089
|
var VALID_CONFIDENCE = /* @__PURE__ */ new Set(["high", "medium", "low"]);
|
|
12910
13090
|
var EDITABLE_STATES = ["draft"];
|
|
12911
|
-
function
|
|
13091
|
+
function revisionOf2(raw) {
|
|
12912
13092
|
return crypto2.createHash("sha256").update(raw, "utf-8").digest("hex");
|
|
12913
13093
|
}
|
|
12914
13094
|
function slugify4(s) {
|
|
@@ -13181,7 +13361,7 @@ function getWorkItemForEdit(dir, id) {
|
|
|
13181
13361
|
...input,
|
|
13182
13362
|
id,
|
|
13183
13363
|
status,
|
|
13184
|
-
revision:
|
|
13364
|
+
revision: revisionOf2(raw),
|
|
13185
13365
|
path: relPath,
|
|
13186
13366
|
editable,
|
|
13187
13367
|
...editable ? {} : { editableReason: status === "ready" ? "This Work Item is Ready. Reopen it as Draft to edit its scope." : `This Work Item is ${status} and cannot be edited from the structured editor.` }
|
|
@@ -13253,7 +13433,7 @@ function createWorkItem(dir, opts) {
|
|
|
13253
13433
|
if (exists(filePath)) throw new WorkItemWriteError("INVALID_INPUT", `Work Item file already exists: ${relPath}`);
|
|
13254
13434
|
const raw = serialize2(data, body);
|
|
13255
13435
|
atomicWrite3(filePath, raw);
|
|
13256
|
-
return { id, path: relPath, revision:
|
|
13436
|
+
return { id, path: relPath, revision: revisionOf2(raw) };
|
|
13257
13437
|
}
|
|
13258
13438
|
function validateInput(input) {
|
|
13259
13439
|
if (!input.title.trim()) throw new WorkItemWriteError("INVALID_INPUT", "Title is required.");
|
|
@@ -13263,7 +13443,7 @@ function updateWorkItem(dir, id, input, expectedRevision) {
|
|
|
13263
13443
|
validateInput(input);
|
|
13264
13444
|
const { filePath, relPath } = findArtifact(dir, id);
|
|
13265
13445
|
const raw = readFile(filePath);
|
|
13266
|
-
if (
|
|
13446
|
+
if (revisionOf2(raw) !== expectedRevision) {
|
|
13267
13447
|
throw new WorkItemWriteError("WORK_ITEM_CONFLICT", "This Work Item changed outside Kaddo Admin. Reload the latest version before saving.");
|
|
13268
13448
|
}
|
|
13269
13449
|
const { data, content } = matter17(raw);
|
|
@@ -13275,7 +13455,7 @@ function updateWorkItem(dir, id, input, expectedRevision) {
|
|
|
13275
13455
|
const nextBody = mergeBody(content, input);
|
|
13276
13456
|
const nextRaw = serialize2(nextData, nextBody);
|
|
13277
13457
|
atomicWrite3(filePath, nextRaw);
|
|
13278
|
-
return { revision:
|
|
13458
|
+
return { revision: revisionOf2(nextRaw), path: relPath };
|
|
13279
13459
|
}
|
|
13280
13460
|
function validateWorkItem(dir, id) {
|
|
13281
13461
|
const { filePath } = findArtifact(dir, id);
|
|
@@ -13330,7 +13510,7 @@ var ALLOWED = { draft: ["ready"], ready: ["draft"] };
|
|
|
13330
13510
|
function transitionWorkItem(dir, id, to, expectedRevision) {
|
|
13331
13511
|
const { filePath } = findArtifact(dir, id);
|
|
13332
13512
|
const raw = readFile(filePath);
|
|
13333
|
-
if (
|
|
13513
|
+
if (revisionOf2(raw) !== expectedRevision) {
|
|
13334
13514
|
throw new WorkItemWriteError("WORK_ITEM_CONFLICT", "This Work Item changed outside Kaddo Admin. Reload the latest version before continuing.");
|
|
13335
13515
|
}
|
|
13336
13516
|
const { data, content } = matter17(raw);
|
|
@@ -13354,7 +13534,7 @@ function transitionWorkItem(dir, id, to, expectedRevision) {
|
|
|
13354
13534
|
} catch {
|
|
13355
13535
|
}
|
|
13356
13536
|
}
|
|
13357
|
-
return { revision:
|
|
13537
|
+
return { revision: revisionOf2(nextRaw), status: to, path: targetRel };
|
|
13358
13538
|
}
|
|
13359
13539
|
|
|
13360
13540
|
// src/core/system-map.ts
|
|
@@ -17413,6 +17593,7 @@ export {
|
|
|
17413
17593
|
POC_REPORT_PREFIX,
|
|
17414
17594
|
PRODUCTION_RUNBOOKS_DIR,
|
|
17415
17595
|
PRODUCTION_RUNBOOK_ARTIFACT_TYPE,
|
|
17596
|
+
PlanningConflictError,
|
|
17416
17597
|
ProductionRunbookError,
|
|
17417
17598
|
REDACTED_COORDINATE,
|
|
17418
17599
|
RESOURCE_ARTIFACT_TYPE,
|
|
@@ -17477,6 +17658,7 @@ export {
|
|
|
17477
17658
|
deriveUnusedConfidence,
|
|
17478
17659
|
detectFormat,
|
|
17479
17660
|
disableIntegration,
|
|
17661
|
+
disassociateInitiativeFromEpic,
|
|
17480
17662
|
discoverDeliveryPlans,
|
|
17481
17663
|
discoverEpics,
|
|
17482
17664
|
discoverExternalWorkItems,
|
|
@@ -17585,6 +17767,7 @@ export {
|
|
|
17585
17767
|
renderDriftMarkdown,
|
|
17586
17768
|
renderImpactMarkdown,
|
|
17587
17769
|
renderSavingsMarkdown,
|
|
17770
|
+
revisionOf,
|
|
17588
17771
|
searchSystemNodes,
|
|
17589
17772
|
serializeConsolidationJson,
|
|
17590
17773
|
serializeDriftJson,
|
|
@@ -17598,6 +17781,8 @@ export {
|
|
|
17598
17781
|
topologyRevision,
|
|
17599
17782
|
transitionInitiative,
|
|
17600
17783
|
transitionWorkItem,
|
|
17784
|
+
updateDeliveryPlan,
|
|
17785
|
+
updateEpic,
|
|
17601
17786
|
updateInitiative,
|
|
17602
17787
|
updateIntegration,
|
|
17603
17788
|
updateIntegrationFilters,
|
|
@@ -17605,6 +17790,7 @@ export {
|
|
|
17605
17790
|
updateTarget,
|
|
17606
17791
|
updateWorkItem,
|
|
17607
17792
|
validateConfigAgainstSchema,
|
|
17793
|
+
validateEpicDependencyChange,
|
|
17608
17794
|
validateOkf,
|
|
17609
17795
|
validatePlan,
|
|
17610
17796
|
validatePlanningGraph,
|
package/dist/index.js
CHANGED
|
@@ -11532,6 +11532,7 @@ function computeInitiativeProgress(dir, ini) {
|
|
|
11532
11532
|
}
|
|
11533
11533
|
|
|
11534
11534
|
// src/core/delivery-planning.ts
|
|
11535
|
+
import { createHash } from "crypto";
|
|
11535
11536
|
import matter5 from "gray-matter";
|
|
11536
11537
|
var DELIVERY_PLANS_DIR = "knowledge/delivery/plans";
|
|
11537
11538
|
var EPICS_DIR = "knowledge/delivery/epics";
|
|
@@ -13839,13 +13840,13 @@ function buildTechDecisions(dir) {
|
|
|
13839
13840
|
}
|
|
13840
13841
|
|
|
13841
13842
|
// src/core/poc-report.ts
|
|
13842
|
-
import { createHash } from "crypto";
|
|
13843
|
+
import { createHash as createHash2 } from "crypto";
|
|
13843
13844
|
import matter9 from "gray-matter";
|
|
13844
13845
|
var POC_REPORT_PREFIX = "poc-report-v";
|
|
13845
13846
|
var SECRET_LINE = /(^|\s)(?:[A-Z][A-Z0-9_]*(?:TOKEN|SECRET|PASSWORD|API_KEY|PRIVATE_KEY)|(?:token|secret|password|api[_-]?key))\s*[:=]\s*\S+/i;
|
|
13846
13847
|
var reportName = /^poc-report-v(\d{3,})\.md$/;
|
|
13847
13848
|
function sha(value) {
|
|
13848
|
-
return
|
|
13849
|
+
return createHash2("sha256").update(value).digest("hex");
|
|
13849
13850
|
}
|
|
13850
13851
|
function posix(value) {
|
|
13851
13852
|
return value.replace(/\\/g, "/");
|
|
@@ -26250,7 +26251,7 @@ async function runVerify(workItemId, opts = {}) {
|
|
|
26250
26251
|
}
|
|
26251
26252
|
|
|
26252
26253
|
// src/core/knowledge-consolidation.ts
|
|
26253
|
-
import { createHash as
|
|
26254
|
+
import { createHash as createHash3 } from "crypto";
|
|
26254
26255
|
import matter27 from "gray-matter";
|
|
26255
26256
|
var KNOWLEDGE6 = "knowledge";
|
|
26256
26257
|
var CONSOLIDATION_CATEGORIES = [
|
|
@@ -26270,7 +26271,7 @@ function relFromDir(dir, filePath) {
|
|
|
26270
26271
|
return f.startsWith(d + "/") ? f.slice(d.length + 1) : f;
|
|
26271
26272
|
}
|
|
26272
26273
|
function sha256(content) {
|
|
26273
|
-
return
|
|
26274
|
+
return createHash3("sha256").update(content, "utf-8").digest("hex");
|
|
26274
26275
|
}
|
|
26275
26276
|
var SHINGLE_SIZE = 6;
|
|
26276
26277
|
var MIN_SHARED_RUN = 6;
|