@abelxiaoxing/cadence 1.3.0 → 1.4.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/README.md +115 -10
- package/package.json +5 -3
- package/prompts/abel-design.md +71 -17
- package/prompts/abel-diagnose.md +10 -1
- package/prompts/abel-implement.md +118 -20
- package/prompts/abel-init.md +9 -2
- package/src/apply-transaction.ts +16 -14
- package/src/artifact-store.ts +17 -0
- package/src/candidate-patch.ts +2 -1
- package/src/canonical.ts +16 -0
- package/src/change-contract.ts +268 -0
- package/src/child-session.ts +4 -3
- package/src/contracts.ts +141 -33
- package/src/control-contracts.ts +51 -1
- package/src/delivery-compiler.ts +148 -31
- package/src/design-control.ts +69 -11
- package/src/design-journal.ts +216 -72
- package/src/durable-workflow.ts +4385 -0
- package/src/implement-graph.ts +11 -16
- package/src/index.ts +380 -981
- package/src/isolation-backend.ts +84 -23
- package/src/package-delivery.ts +486 -0
- package/src/package-verification.ts +509 -0
- package/src/route-policy.ts +1 -11
- package/src/run-state.ts +4 -16
- package/src/run-store.ts +5 -144
- package/src/scoped-grep-worker.mjs +23 -0
- package/src/scoped-tools.ts +312 -116
- package/src/sqlite-schema.ts +171 -0
- package/src/storage-schema.ts +352 -0
- package/src/subagent-activity.ts +14 -1
- package/src/submit-tool.ts +20 -2
- package/src/task-ledger.ts +14 -55
- package/src/verification-capability.ts +298 -102
- package/src/verification-environment.ts +213 -0
- package/src/verification-identity.ts +77 -0
- package/src/worker-broker.ts +97 -34
- package/src/workflow-engine.ts +28 -8285
- package/src/workflow-policy.ts +1427 -0
- package/src/workflow-state-machine.ts +4478 -0
- package/src/workspace-io-entry.mjs +58 -0
- package/src/workspace-io-worker.mjs +984 -0
- package/src/workspace-io.ts +84 -0
- package/src/workspace-store.ts +125 -19
- package/skills/abel-workflow/SKILL.md +0 -205
package/src/implement-graph.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
+
import { canonicalJson } from "./canonical.ts";
|
|
2
3
|
import {
|
|
3
4
|
type ImplementationPhase,
|
|
4
5
|
type ImplementGraphBoundary,
|
|
@@ -16,21 +17,6 @@ import {
|
|
|
16
17
|
validateVerificationAdapterCapability,
|
|
17
18
|
} from "./verification-capability.ts";
|
|
18
19
|
|
|
19
|
-
export function canonicalJson(value: unknown): string {
|
|
20
|
-
if (Array.isArray(value)) {
|
|
21
|
-
return `[${value.map(canonicalJson).join(",")}]`;
|
|
22
|
-
}
|
|
23
|
-
if (value && typeof value === "object") {
|
|
24
|
-
const entries = Object.entries(value as Record<string, unknown>)
|
|
25
|
-
.filter(([, entry]) => entry !== undefined)
|
|
26
|
-
.sort(([left], [right]) => left.localeCompare(right));
|
|
27
|
-
return `{${entries
|
|
28
|
-
.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`)
|
|
29
|
-
.join(",")}}`;
|
|
30
|
-
}
|
|
31
|
-
return JSON.stringify(value) ?? "null";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
20
|
export function hashCanonicalValue(value: unknown): string {
|
|
35
21
|
return createHash("sha256").update(canonicalJson(value)).digest("hex");
|
|
36
22
|
}
|
|
@@ -92,7 +78,14 @@ function taskPhases(
|
|
|
92
78
|
task: ImplementTaskBoundary,
|
|
93
79
|
): Array<[ImplementationPhase, ImplementTaskBoundary["phases"]["red"]]> {
|
|
94
80
|
return [
|
|
95
|
-
|
|
81
|
+
...(!task.verificationMode || task.verificationMode === "behavior"
|
|
82
|
+
? [
|
|
83
|
+
["red", task.phases.red] as [
|
|
84
|
+
ImplementationPhase,
|
|
85
|
+
ImplementTaskBoundary["phases"]["red"],
|
|
86
|
+
],
|
|
87
|
+
]
|
|
88
|
+
: []),
|
|
96
89
|
["green", task.phases.green],
|
|
97
90
|
...(task.phases.refactor
|
|
98
91
|
? ([["refactor", task.phases.refactor]] as Array<
|
|
@@ -576,3 +569,5 @@ export function assessImplementGraphReadiness(
|
|
|
576
569
|
|
|
577
570
|
return { closure, phases, outputs: outputReadiness };
|
|
578
571
|
}
|
|
572
|
+
|
|
573
|
+
export { canonicalJson } from "./canonical.ts";
|