@abelxiaoxing/cadence 1.0.13 → 1.1.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.
Files changed (46) hide show
  1. package/README.md +29 -13
  2. package/agents/contract-reviewer.md +2 -2
  3. package/agents/design-explorer.md +1 -1
  4. package/agents/diagnosis-worker.md +6 -3
  5. package/agents/implementation-worker.md +14 -9
  6. package/config/.env.example +5 -17
  7. package/config/routes.example.json +42 -0
  8. package/package.json +3 -3
  9. package/prompts/abel-design.md +150 -228
  10. package/prompts/abel-diagnose.md +37 -18
  11. package/prompts/abel-implement.md +111 -178
  12. package/prompts/abel-init.md +36 -33
  13. package/skills/abel-workflow/SKILL.md +156 -168
  14. package/src/apply-transaction.ts +1427 -0
  15. package/src/artifact-store.ts +204 -0
  16. package/src/child-session.ts +136 -17
  17. package/src/contracts.ts +105 -696
  18. package/src/control-contracts.ts +259 -0
  19. package/src/delivery-compiler.ts +1088 -0
  20. package/src/file-snapshot.ts +5 -0
  21. package/src/implement-graph.ts +11 -4
  22. package/src/index.ts +1465 -133
  23. package/src/isolation-backend.ts +269 -0
  24. package/src/packet-runtime.ts +533 -0
  25. package/src/parent-provider.ts +23 -4
  26. package/src/route-policy.ts +483 -0
  27. package/src/run-state.ts +393 -0
  28. package/src/run-store.ts +918 -0
  29. package/src/safe-path.ts +11 -0
  30. package/src/scoped-tools.ts +36 -0
  31. package/src/state-root.ts +215 -0
  32. package/src/subagent-activity.ts +526 -27
  33. package/src/submit-tool.ts +274 -0
  34. package/src/task-ledger.ts +1380 -0
  35. package/src/verification-capability.ts +529 -42
  36. package/src/worker-broker.ts +703 -0
  37. package/src/workflow-engine.ts +7391 -0
  38. package/src/workspace-store.ts +544 -0
  39. package/src/candidate-preflight.ts +0 -1618
  40. package/src/drain.ts +0 -20
  41. package/src/patch.ts +0 -505
  42. package/src/result-store.ts +0 -312
  43. package/src/runtime.ts +0 -2436
  44. package/src/scheduler.ts +0 -384
  45. package/src/subagent-endpoint.ts +0 -158
  46. package/src/worker.ts +0 -204
@@ -30,6 +30,11 @@ function sha256(bytes: Buffer): string {
30
30
  return createHash("sha256").update(bytes).digest("hex");
31
31
  }
32
32
 
33
+ /** Hash bytes with the same identity used by file and workspace snapshots. */
34
+ export function snapshotContentHash(bytes: Uint8Array): string {
35
+ return createHash("sha256").update(bytes).digest("hex");
36
+ }
37
+
33
38
  /** Snapshot one existing regular file under root. */
34
39
  export function snapshotFile(root: string, relPath: string): FileBound | null {
35
40
  if (observeSafePath(root, relPath).kind !== "file") return null;
@@ -11,9 +11,12 @@ import {
11
11
  verificationInputPaths,
12
12
  } from "./contracts.ts";
13
13
  import { isSafeRegularFile } from "./safe-path.ts";
14
- import { validateVerificationAdapterCapability } from "./verification-capability.ts";
14
+ import {
15
+ type VerificationRunnerEnvironment,
16
+ validateVerificationAdapterCapability,
17
+ } from "./verification-capability.ts";
15
18
 
16
- function canonicalJson(value: unknown): string {
19
+ export function canonicalJson(value: unknown): string {
17
20
  if (Array.isArray(value)) {
18
21
  return `[${value.map(canonicalJson).join(",")}]`;
19
22
  }
@@ -28,7 +31,7 @@ function canonicalJson(value: unknown): string {
28
31
  return JSON.stringify(value) ?? "null";
29
32
  }
30
33
 
31
- export function hashImplementGraphBoundary(value: unknown): string {
34
+ export function hashCanonicalValue(value: unknown): string {
32
35
  return createHash("sha256").update(canonicalJson(value)).digest("hex");
33
36
  }
34
37
 
@@ -41,6 +44,7 @@ export interface ImplementExecutionFacts {
41
44
  }>;
42
45
  candidate?: { taskId: string; phase: ImplementationPhase };
43
46
  dependencyOwner?: string;
47
+ verificationRunnerEnvironment?: VerificationRunnerEnvironment;
44
48
  }
45
49
 
46
50
  export interface ImplementPhaseReadiness {
@@ -358,7 +362,10 @@ export function assessImplementGraphReadiness(
358
362
  const capability = validateVerificationAdapterCapability(
359
363
  root,
360
364
  boundary.verification,
361
- { dependencyOwner: facts.dependencyOwner ?? root },
365
+ {
366
+ dependencyOwner: facts.dependencyOwner ?? root,
367
+ runnerEnvironment: facts.verificationRunnerEnvironment,
368
+ },
362
369
  );
363
370
  if (!capability.ok) {
364
371
  const { message: _message, ...diagnostic } = capability.diagnostic;