@kody-ade/kody-engine 0.4.628 → 0.4.630
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/bin/kody.js +43 -18
- package/dist/implementations/types.ts +2 -0
- package/package.json +1 -1
package/dist/bin/kody.js
CHANGED
|
@@ -15,7 +15,7 @@ var init_package = __esm({
|
|
|
15
15
|
"package.json"() {
|
|
16
16
|
package_default = {
|
|
17
17
|
name: "@kody-ade/kody-engine",
|
|
18
|
-
version: "0.4.
|
|
18
|
+
version: "0.4.630",
|
|
19
19
|
description: "kody \u2014 autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
|
|
20
20
|
license: "MIT",
|
|
21
21
|
repository: {
|
|
@@ -12739,6 +12739,7 @@ var init_commitAndPush = __esm({
|
|
|
12739
12739
|
const replay = JSON.parse(fs33.readFileSync(sentinel, "utf-8"));
|
|
12740
12740
|
ctx.data.commitResult = replay.commitResult ?? { committed: false, pushed: false };
|
|
12741
12741
|
if (Array.isArray(replay.changedFiles)) ctx.data.changedFiles = replay.changedFiles;
|
|
12742
|
+
if (Array.isArray(replay.deliveryOmissions)) ctx.data.deliveryOmissions = replay.deliveryOmissions;
|
|
12742
12743
|
if (typeof replay.hasCommitsAhead === "boolean") ctx.data.hasCommitsAhead = replay.hasCommitsAhead;
|
|
12743
12744
|
if (replay.salvagedFromMissingMarker) ctx.data.salvagedFromMissingMarker = true;
|
|
12744
12745
|
if (typeof replay.commitCrash === "string") {
|
|
@@ -12806,6 +12807,7 @@ var init_commitAndPush = __esm({
|
|
|
12806
12807
|
{
|
|
12807
12808
|
commitResult: ctx.data.commitResult,
|
|
12808
12809
|
changedFiles: ctx.data.changedFiles,
|
|
12810
|
+
deliveryOmissions: ctx.data.deliveryOmissions,
|
|
12809
12811
|
hasCommitsAhead: ctx.data.hasCommitsAhead,
|
|
12810
12812
|
salvagedFromMissingMarker: ctx.data.salvagedFromMissingMarker === true,
|
|
12811
12813
|
commitCrash: typeof ctx.data.commitCrash === "string" ? ctx.data.commitCrash : void 0,
|
|
@@ -18388,6 +18390,11 @@ function computeFailureSuffix(input) {
|
|
|
18388
18390
|
}
|
|
18389
18391
|
function renderMessage(input) {
|
|
18390
18392
|
const suffix = computeFailureSuffix(input);
|
|
18393
|
+
if (input.isFailure && input.partialDelivery) {
|
|
18394
|
+
const destination = renderDeliveryDestination(input);
|
|
18395
|
+
const proof = input.partialDelivery.pushedSha ? ` (${input.partialDelivery.pushedSha.slice(0, 7)})` : "";
|
|
18396
|
+
return `\u26A0\uFE0F kody PARTIAL: pushed allowed changes to ${destination}${proof}; omitted protected files: ${input.partialDelivery.omittedFiles.join(", ")}`;
|
|
18397
|
+
}
|
|
18391
18398
|
if (input.isFailure) {
|
|
18392
18399
|
return `\u26A0\uFE0F kody FAILED: ${truncate2(input.failureReason, 1500)}${suffix}`;
|
|
18393
18400
|
}
|
|
@@ -18404,6 +18411,15 @@ function renderMessage(input) {
|
|
|
18404
18411
|
return `\u26A0\uFE0F kody finished but PR step did not run${suffix}`;
|
|
18405
18412
|
}
|
|
18406
18413
|
}
|
|
18414
|
+
function renderDeliveryDestination(input) {
|
|
18415
|
+
if (input.prResult?.kind === "created" || input.prResult?.kind === "updated") {
|
|
18416
|
+
return `PR ${input.prResult.url}`;
|
|
18417
|
+
}
|
|
18418
|
+
if (input.branch && input.githubOwner && input.githubRepo) {
|
|
18419
|
+
return `branch https://github.com/${input.githubOwner}/${input.githubRepo}/tree/${input.branch}`;
|
|
18420
|
+
}
|
|
18421
|
+
return "the pushed branch";
|
|
18422
|
+
}
|
|
18407
18423
|
function renderDeliveryProof(ctx) {
|
|
18408
18424
|
const quality = ctx.config.quality;
|
|
18409
18425
|
const gates = quality ? [
|
|
@@ -18420,7 +18436,7 @@ function renderDeliveryProof(ctx) {
|
|
|
18420
18436
|
Proof: ${verification}; ${delivery}.`;
|
|
18421
18437
|
}
|
|
18422
18438
|
function computeFailureReason2(ctx) {
|
|
18423
|
-
const omissions =
|
|
18439
|
+
const omissions = readDeliveryOmissions(ctx.data);
|
|
18424
18440
|
if (omissions.length > 0) {
|
|
18425
18441
|
return `delivery blocked protected files: ${omissions.join(", ")}`;
|
|
18426
18442
|
}
|
|
@@ -18433,6 +18449,9 @@ function computeFailureReason2(ctx) {
|
|
|
18433
18449
|
if (ctx.data.verifyOk === false) return ctx.data.verifyReason || "verify failed";
|
|
18434
18450
|
return "";
|
|
18435
18451
|
}
|
|
18452
|
+
function readDeliveryOmissions(data) {
|
|
18453
|
+
return Array.isArray(data.deliveryOmissions) ? data.deliveryOmissions.filter((file) => typeof file === "string") : [];
|
|
18454
|
+
}
|
|
18436
18455
|
function actionFailureReason2(action) {
|
|
18437
18456
|
if (!action || typeof action !== "object" || Array.isArray(action)) return "";
|
|
18438
18457
|
const payload = action.payload;
|
|
@@ -18537,6 +18556,8 @@ var init_postIssueComment = __esm({
|
|
|
18537
18556
|
}
|
|
18538
18557
|
const failureReason = computeFailureReason2(ctx);
|
|
18539
18558
|
const isFailure = failureReason.length > 0;
|
|
18559
|
+
const deliveryOmissions = readDeliveryOmissions(ctx.data);
|
|
18560
|
+
const isPartialDelivery = commitResult?.pushed === true && deliveryOmissions.length > 0;
|
|
18540
18561
|
const branch = ctx.data.branch;
|
|
18541
18562
|
const msg = renderMessage({
|
|
18542
18563
|
prResult,
|
|
@@ -18547,7 +18568,8 @@ var init_postIssueComment = __esm({
|
|
|
18547
18568
|
branchPushed: commitResult?.committed === true,
|
|
18548
18569
|
githubOwner: ctx.config.github?.owner,
|
|
18549
18570
|
githubRepo: ctx.config.github?.repo,
|
|
18550
|
-
deliveryProof: renderDeliveryProof(ctx)
|
|
18571
|
+
deliveryProof: renderDeliveryProof(ctx),
|
|
18572
|
+
partialDelivery: isPartialDelivery ? { omittedFiles: deliveryOmissions, pushedSha: commitResult.sha } : void 0
|
|
18551
18573
|
});
|
|
18552
18574
|
postWith(targetType, targetNumber, msg, ctx.cwd);
|
|
18553
18575
|
const prIsDraft = (prResult?.kind === "created" || prResult?.kind === "updated") && prResult.draft === true;
|
|
@@ -19461,7 +19483,9 @@ async function publishWorkflowReport(input) {
|
|
|
19461
19483
|
const generatedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
19462
19484
|
const title = input.publication.title ?? input.workflowTitle;
|
|
19463
19485
|
const summary = input.state.status === "done" ? `${input.workflowTitle} completed` : `${input.workflowTitle} ${input.state.status}${input.state.blocker ? `: ${input.state.blocker}` : ""}`;
|
|
19464
|
-
const
|
|
19486
|
+
const body = stringValue5(resolveDotted(input.state.facts, input.publication.bodyFact));
|
|
19487
|
+
const reportFacts = input.publication.bodyFact ? omitKeys(input.state.facts, [input.publication.bodyFact.split(".")[0]]) : input.state.facts;
|
|
19488
|
+
const generatedMarkdown = buildRuntimeReportMarkdown({
|
|
19465
19489
|
generatedAt,
|
|
19466
19490
|
reportType: input.publication.type,
|
|
19467
19491
|
reportTypeVersion: input.publication.version ?? 1,
|
|
@@ -19475,7 +19499,7 @@ async function publishWorkflowReport(input) {
|
|
|
19475
19499
|
status: input.state.status,
|
|
19476
19500
|
completedStepIds: input.state.completedStepIds,
|
|
19477
19501
|
transitionCounts: input.state.transitionCounts,
|
|
19478
|
-
facts:
|
|
19502
|
+
facts: reportFacts,
|
|
19479
19503
|
evidence: input.state.evidence,
|
|
19480
19504
|
artifacts: input.state.artifacts,
|
|
19481
19505
|
...input.state.blocker ? { blocker: input.state.blocker } : {}
|
|
@@ -19484,6 +19508,10 @@ async function publishWorkflowReport(input) {
|
|
|
19484
19508
|
...input.publication.reviewStatus ? { reviewStatus: input.publication.reviewStatus } : {},
|
|
19485
19509
|
...input.publication.reviewArea ? { reviewArea: input.publication.reviewArea } : {}
|
|
19486
19510
|
});
|
|
19511
|
+
const markdown = body ? `${generatedMarkdown.trimEnd()}
|
|
19512
|
+
|
|
19513
|
+
${body}
|
|
19514
|
+
` : generatedMarkdown;
|
|
19487
19515
|
const runId = generatedAt.replace(/\.\d{3}Z$/, "Z").replace(/:/g, "-");
|
|
19488
19516
|
if (hasStateBackendConfig()) {
|
|
19489
19517
|
await createStateBackendFromEnv().saveReport(
|
|
@@ -24415,20 +24443,17 @@ async function runCapabilityWorkflow(parent, workflow, capability, base, checkpo
|
|
|
24415
24443
|
await checkpoint?.(state);
|
|
24416
24444
|
return { exitCode: 64, reason: resumeBlocker, workflowState: state };
|
|
24417
24445
|
}
|
|
24418
|
-
|
|
24419
|
-
|
|
24420
|
-
|
|
24421
|
-
|
|
24422
|
-
|
|
24423
|
-
|
|
24424
|
-
|
|
24425
|
-
|
|
24426
|
-
|
|
24427
|
-
});
|
|
24428
|
-
}
|
|
24429
|
-
return result;
|
|
24446
|
+
const result = isGraphWorkflow(workflow) ? await runGraphCapabilityWorkflow(parent, workflow, capability, base, checkpoint) : await runLinearCapabilityWorkflow(parent, workflow, capability, base, checkpoint);
|
|
24447
|
+
if (workflow.report && result.workflowState) {
|
|
24448
|
+
await publishWorkflowReport({
|
|
24449
|
+
config: base.config ?? loadConfig(base.cwd),
|
|
24450
|
+
publication: workflow.report,
|
|
24451
|
+
workflowId: capability.slug,
|
|
24452
|
+
workflowTitle: capability.title,
|
|
24453
|
+
state: result.workflowState
|
|
24454
|
+
});
|
|
24430
24455
|
}
|
|
24431
|
-
return
|
|
24456
|
+
return result;
|
|
24432
24457
|
}
|
|
24433
24458
|
async function runLinearCapabilityWorkflow(parent, workflow, capability, base, checkpoint) {
|
|
24434
24459
|
const state = initialWorkflowState(parent, workflow);
|
|
@@ -550,6 +550,8 @@ export interface ReportPublicationConfig {
|
|
|
550
550
|
slugFact?: string
|
|
551
551
|
title?: string
|
|
552
552
|
titleFact?: string
|
|
553
|
+
/** Dotted path in workflow facts containing a ready-to-render Markdown body. */
|
|
554
|
+
bodyFact?: string
|
|
553
555
|
publishWhenFact?: string
|
|
554
556
|
reviewStatus?: string
|
|
555
557
|
reviewArea?: string
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kody-ade/kody-engine",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.630",
|
|
4
4
|
"description": "kody — autonomous development engine. Single-session Claude Code agent behind a generic executor + declarative implementation profiles.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|