@abelxiaoxing/cadence 1.8.4 → 2.0.1
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 +324 -117
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/agents/design-explorer.md +14 -18
- package/agents/diagnosis-worker.md +14 -14
- package/agents/implementation-worker.md +16 -17
- package/config/workflow-task.example.json +7 -0
- package/docs/remote-access.md +60 -0
- package/docs/reuse-and-distribution.md +44 -0
- package/docs/service-management.md +108 -0
- package/licenses/bundled-web.txt +6245 -0
- package/licenses/pi-web-ui-MIT.txt +21 -0
- package/licenses/pi-web-ui-reuse.md +22 -0
- package/package.json +92 -20
- package/src/index.ts +21 -1802
- package/src/native-build.ts +6 -0
- package/src/native-client.ts +103 -0
- package/src/native-export.ts +58 -0
- package/src/native-history.ts +359 -0
- package/src/operator-cli.mjs +453 -1937
- package/src/plan-proposal.ts +87 -0
- package/src/sdk-worker.mjs +549 -0
- package/src/service/contracts/active.ts +82 -0
- package/src/service/contracts/budget.ts +148 -0
- package/src/service/contracts/build.ts +67 -0
- package/src/service/contracts/capture.ts +48 -0
- package/src/service/contracts/core.ts +33 -0
- package/src/service/contracts/current.ts +261 -0
- package/src/service/contracts/domain.ts +68 -0
- package/src/service/contracts/history.ts +2245 -0
- package/src/service/contracts/models.ts +139 -0
- package/src/service/coordination.ts +862 -0
- package/src/service/private-files.ts +204 -0
- package/src/service-cli.mjs +5592 -0
- package/src/service-client.ts +747 -0
- package/src/service-contract.ts +245 -0
- package/src/service-host.mjs +22382 -0
- package/src/service-http-client.ts +425 -0
- package/src/service-wire.ts +372 -0
- package/src/task-shell.ts +1045 -0
- package/src/task-store.ts +479 -0
- package/src/task-types.ts +184 -0
- package/src/verification-diagnostics.ts +29 -72
- package/src/worker-capture.mjs +1197 -0
- package/src/worker-public.mjs +1753 -0
- package/src/worker-redaction.mjs +608 -0
- package/src/worker-tools.mjs +202 -0
- package/web/dist/assets/KaTeX_AMS-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_AMS-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Bold.woff2 +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Caligraphic-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold.woff +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Bold.woff2 +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Fraktur-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Bold.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Bold.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Bold.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic.woff +0 -0
- package/web/dist/assets/KaTeX_Main-BoldItalic.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Italic.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Italic.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Italic.woff2 +0 -0
- package/web/dist/assets/KaTeX_Main-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Main-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Main-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic.woff +0 -0
- package/web/dist/assets/KaTeX_Math-BoldItalic.woff2 +0 -0
- package/web/dist/assets/KaTeX_Math-Italic.ttf +0 -0
- package/web/dist/assets/KaTeX_Math-Italic.woff +0 -0
- package/web/dist/assets/KaTeX_Math-Italic.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Bold.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Italic.woff2 +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_SansSerif-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Script-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Script-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Script-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Size1-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Size2-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Size3-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Size4-Regular.woff2 +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular.ttf +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular.woff +0 -0
- package/web/dist/assets/KaTeX_Typewriter-Regular.woff2 +0 -0
- package/web/dist/assets/cadence.css +2 -0
- package/web/dist/assets/cadence.js +7 -0
- package/web/dist/assets/markdown.js +296 -0
- package/web/dist/assets/react.js +9 -0
- package/web/dist/assets/rolldown-runtime.js +1 -0
- package/web/dist/assets/timeline-client.js +41 -0
- package/web/dist/assets/vis-timeline.css +1274 -0
- package/web/dist/assets/vis-timeline.js +32 -0
- package/web/dist/index.html +18 -0
- package/web/dist/manifest.json +505 -0
- package/config/plan-draft.example.json +0 -125
- package/config/plan-draft.multiple-tasks.example.json +0 -375
- package/config/plan-draft.quick.example.json +0 -78
- package/prompts/abel-design.md +0 -382
- package/prompts/abel-diagnose.md +0 -71
- package/prompts/abel-implement.md +0 -284
- package/prompts/abel-init.md +0 -52
- package/src/activation.ts +0 -44
- package/src/activity-contracts.ts +0 -82
- package/src/agent-registry.ts +0 -53
- package/src/apply-transaction.ts +0 -1437
- package/src/artifact-store.ts +0 -213
- package/src/build-windows-job.mjs +0 -95
- package/src/candidate-artifact.ts +0 -143
- package/src/candidate-context.ts +0 -289
- package/src/candidate-patch.ts +0 -271
- package/src/candidate-workspace.ts +0 -80
- package/src/canonical.ts +0 -16
- package/src/change-contract-schema.ts +0 -191
- package/src/change-contract.ts +0 -324
- package/src/change-verification.ts +0 -1617
- package/src/contracts.ts +0 -2466
- package/src/control-contracts.ts +0 -382
- package/src/delivery-compiler.ts +0 -1805
- package/src/delivery-revision.ts +0 -42
- package/src/design-control.ts +0 -1299
- package/src/design-diagnostics.ts +0 -181
- package/src/design-journal.ts +0 -1773
- package/src/directory-sync.ts +0 -36
- package/src/durable-contracts.ts +0 -227
- package/src/durable-workflow.ts +0 -822
- package/src/evidence-draft.ts +0 -122
- package/src/execution-profile.ts +0 -64
- package/src/execution-retention.ts +0 -77
- package/src/file-snapshot.ts +0 -163
- package/src/implement-continuation.ts +0 -559
- package/src/implement-graph.ts +0 -690
- package/src/implement-plan.ts +0 -72
- package/src/install-config.d.mts +0 -6
- package/src/isolation-backend.ts +0 -353
- package/src/model-source.ts +0 -22
- package/src/openspec-cli.ts +0 -494
- package/src/operator-cli-entry.mjs +0 -24
- package/src/operator-tools.ts +0 -309
- package/src/package-candidate-process.ts +0 -206
- package/src/package-candidate.ts +0 -24
- package/src/package-delivery.ts +0 -486
- package/src/package-state.ts +0 -320
- package/src/package-verification.ts +0 -635
- package/src/package-workflow.ts +0 -305
- package/src/packet-runtime.ts +0 -459
- package/src/phase-execution.ts +0 -2163
- package/src/pi-adapter.ts +0 -19
- package/src/plan-draft-summary.ts +0 -527
- package/src/plan-draft.ts +0 -502
- package/src/remove-path.ts +0 -32
- package/src/run-state.ts +0 -420
- package/src/run-store.ts +0 -1179
- package/src/safe-path.ts +0 -77
- package/src/scoped-grep-worker.mjs +0 -23
- package/src/scoped-tools.ts +0 -775
- package/src/single-task-draft.ts +0 -142
- package/src/sqlite-schema.ts +0 -171
- package/src/state-root.ts +0 -215
- package/src/storage-schema.ts +0 -360
- package/src/subagent-activity.ts +0 -1417
- package/src/subagent-process.ts +0 -476
- package/src/task-ledger.ts +0 -1338
- package/src/transport-budget.ts +0 -50
- package/src/verification-capability.ts +0 -1191
- package/src/verification-environment-io.ts +0 -389
- package/src/verification-environment.ts +0 -162
- package/src/verification-identity.ts +0 -77
- package/src/verification-scan.ts +0 -64
- package/src/windows-job-backend.ts +0 -419
- package/src/windows-job.c +0 -149
- package/src/workflow-engine.ts +0 -28
- package/src/workflow-policy.ts +0 -1670
- package/src/workflow-recovery-policy.ts +0 -97
- package/src/workflow-scheduling.ts +0 -105
- package/src/workflow-state-machine.ts +0 -4341
- package/src/workflow-status.ts +0 -576
- package/src/workspace-io-entry.mjs +0 -76
- package/src/workspace-io-worker.mjs +0 -1312
- package/src/workspace-io.ts +0 -89
- package/src/workspace-store.ts +0 -634
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { canonicalJson, compareCanonicalStrings } from "./canonical.ts";
|
|
2
|
-
import { isValidRelativePath } from "./contracts.ts";
|
|
3
|
-
|
|
4
|
-
export type SafeDesignDiagnostic = Record<string, string | boolean | string[]>;
|
|
5
|
-
const CODE = /^[a-z0-9](?:[a-z0-9._:-]{0,126}[a-z0-9])?$/iu;
|
|
6
|
-
const IDENTITIES = new Set([
|
|
7
|
-
"code",
|
|
8
|
-
"taskId",
|
|
9
|
-
"phase",
|
|
10
|
-
"field",
|
|
11
|
-
"category",
|
|
12
|
-
"owner",
|
|
13
|
-
"verificationId",
|
|
14
|
-
"acceptanceId",
|
|
15
|
-
"outputId",
|
|
16
|
-
"dependencyTaskId",
|
|
17
|
-
"producerTaskId",
|
|
18
|
-
"producerPhase",
|
|
19
|
-
"command",
|
|
20
|
-
"reason",
|
|
21
|
-
"systemCode",
|
|
22
|
-
"exitCode",
|
|
23
|
-
]);
|
|
24
|
-
const HINTS = new Map<string, string>(
|
|
25
|
-
Object.entries({
|
|
26
|
-
"duplicate-path":
|
|
27
|
-
"Remove the repeated path at the indicated index; keep the existing declaration and do not widen phase permissions.",
|
|
28
|
-
enum: "Use one of allowedValues at the indicated field. For public impact, choose the actual changed surface; do not substitute none to bypass closure checks.",
|
|
29
|
-
"public-impact-incomplete":
|
|
30
|
-
"Public impact requires non-empty searchEvidence, relatedTests and affectedSuite; every affectedSuite path must have a relatedTests entry. Keep the actual changedSurfaces; do not substitute none.",
|
|
31
|
-
"search-evidence-required":
|
|
32
|
-
"Add non-empty searchEvidence strings describing actual searches of changed public surfaces, callers and existing tests. Do not invent evidence or substitute none for changedSurfaces.",
|
|
33
|
-
"related-tests-required":
|
|
34
|
-
"Add relatedTests entries with path and non-empty evidence for actual tests under test/ or tests/, within the task's declared read/write scope. In PlanDraft omit disposition to derive ownership from task writes; do not widen writes or substitute none.",
|
|
35
|
-
"affected-suite-required":
|
|
36
|
-
"Add actual affected test paths under test/ or tests/ to affectedSuite and declare each in relatedTests. Bind their execution in affectedVerification; retained snapshot validation requires at least one existing test. Do not invent paths or substitute none.",
|
|
37
|
-
"related-test-missing":
|
|
38
|
-
"Add this affected-suite test to relatedTests with evidence and its actual owner. Do not remove public impact or widen writes to satisfy ownership.",
|
|
39
|
-
"change-contract-acceptance-missing":
|
|
40
|
-
"Read the current approved ChangeContract from Design status and include each accepted verification obligation in the plan's phase, affected, full-suite or post-apply verification. Command, arguments, inputs and classification must match; copying only its ID is insufficient. Keep accepted IDs, statements and scope unchanged.",
|
|
41
|
-
"script-command-mismatch":
|
|
42
|
-
"command must equal the literal package.json scripts[script] value, not an invocation such as npm run test. In PlanDraft, omit command to bind it from the manifest. Explicit commands, including approved Gate acceptance verifiers, remain exact and must be corrected rather than silently replaced.",
|
|
43
|
-
"design-traceability-input-unavailable":
|
|
44
|
-
"Write tasks.md with author task checkboxes and exact owned Scenario references, plus the referenced spec artifacts, before compilation and finalization.",
|
|
45
|
-
"traceability-managed-region-invalid":
|
|
46
|
-
"Repair the paired ABEL:VERIFICATION-BINDINGS markers in tasks.md without removing author evidence, then compile again. Code replaces only one complete managed region.",
|
|
47
|
-
"traceability-managed-region-stale":
|
|
48
|
-
"Compile the current draft again to regenerate phase verification bindings; do not copy verifier identities by hand.",
|
|
49
|
-
"traceability-task-unmapped":
|
|
50
|
-
"Put each planned task ID in backticks on its author checkbox outside the generated bindings region.",
|
|
51
|
-
"traceability-verification-unmapped":
|
|
52
|
-
"Compile after writing tasks.md so code installs phase verification bindings while preserving the author evidence.",
|
|
53
|
-
"traceability-reference-empty":
|
|
54
|
-
"Add exact backticked specs/<capability>/spec.md#Requirement title/Scenario title references under the owning author tasks. Code does not infer Scenario ownership.",
|
|
55
|
-
"change-contract-field-invalid":
|
|
56
|
-
"Correct the indicated ChangeContract field using the tool schema. Keep accepted scope and evidence unchanged.",
|
|
57
|
-
"design-control-field-invalid":
|
|
58
|
-
"Use the exact operation envelope and returned runId; inspect the indicated field in the tool schema.",
|
|
59
|
-
"verification-reference-unavailable":
|
|
60
|
-
"Use a declared verificationDefinitions name or an explicit verification contract.",
|
|
61
|
-
"verification-reference-invalid":
|
|
62
|
-
"A verification reference contains only use and optional Red expectedFailure. Put executable fields in its definition.",
|
|
63
|
-
"verification-definition-invalid":
|
|
64
|
-
"Define one supported atomic verifier without id, classification, executionBindings or references.",
|
|
65
|
-
"current-task-outside-write-set":
|
|
66
|
-
"Omit disposition to derive the test owner from task writes. Keep path and evidence; do not widen writes to satisfy this label.",
|
|
67
|
-
"related-test-owner-ambiguous":
|
|
68
|
-
"Several other tasks edit this test. Choose the intended regression-task owner explicitly, or resolve overlapping task ownership.",
|
|
69
|
-
"verification-input-binding-mismatch":
|
|
70
|
-
"For a phase binding, omit verificationInputs to derive exact bindings from the contract and outputs. For affected, repair or full-suite fields, retain declared new tests as executable inputs. Keep supporting source files in read.",
|
|
71
|
-
"workspace-input-unavailable":
|
|
72
|
-
"Bind original baselineVerification and baseline.fullSuite to safe files in the original snapshot. For later consumers, declare an available producer and preserve its output through consumption. Do not create future tests in the original baseline.",
|
|
73
|
-
"producer-output-unavailable":
|
|
74
|
-
"Keep the declared producer output available at this consumer, including after intermediate deletes and AGENTS checkpoints. Preserve the accepted verification coverage.",
|
|
75
|
-
"workspace-input-has-producer":
|
|
76
|
-
"Omit verificationInputs or bind this path to its declared outputId instead of workspace.",
|
|
77
|
-
"multiple-output-producers":
|
|
78
|
-
"Declare one producer per output path before deriving input bindings. Do not choose a producer by list order.",
|
|
79
|
-
"producer-not-dependency":
|
|
80
|
-
"The producing task must be an explicit dependency of this task. Input inference does not add dependency authority.",
|
|
81
|
-
"producer-phase-after-consumer":
|
|
82
|
-
"This verification needs an output from a later phase. Correct the producer or phase order; input inference cannot make that output available earlier.",
|
|
83
|
-
"verification-input-not-declared":
|
|
84
|
-
"The verification contract requires a path outside this phase's read/write declarations. Correct the contract or explicitly declare the approved input path.",
|
|
85
|
-
}),
|
|
86
|
-
);
|
|
87
|
-
function safePath(value: unknown): value is string {
|
|
88
|
-
return isValidRelativePath(value) && !/[\p{Cc}\p{Cf}]/u.test(value);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** One bounded projection for tool feedback and TUI; guidance is code-owned. */
|
|
92
|
-
export function projectDesignDiagnostic(
|
|
93
|
-
value: unknown,
|
|
94
|
-
): SafeDesignDiagnostic | undefined {
|
|
95
|
-
if (typeof value === "string") value = { code: value.split(":", 1)[0] };
|
|
96
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
97
|
-
return undefined;
|
|
98
|
-
const record = value as Record<string, unknown>;
|
|
99
|
-
if (typeof record.code !== "string" || !CODE.test(record.code))
|
|
100
|
-
return undefined;
|
|
101
|
-
const result: SafeDesignDiagnostic = {};
|
|
102
|
-
for (const [key, entry] of Object.entries(record)) {
|
|
103
|
-
if (IDENTITIES.has(key) && typeof entry === "string" && CODE.test(entry))
|
|
104
|
-
result[key] = entry;
|
|
105
|
-
else if (
|
|
106
|
-
(key === "retryable" || key === "pathsTruncated") &&
|
|
107
|
-
typeof entry === "boolean"
|
|
108
|
-
)
|
|
109
|
-
result[key] =
|
|
110
|
-
key === "pathsTruncated"
|
|
111
|
-
? result.pathsTruncated === true || entry
|
|
112
|
-
: entry;
|
|
113
|
-
else if (key === "path" && safePath(entry)) result.path = entry;
|
|
114
|
-
else if (
|
|
115
|
-
(key === "allowedValues" || key === "mismatchedFields") &&
|
|
116
|
-
Array.isArray(entry)
|
|
117
|
-
) {
|
|
118
|
-
result[key] = [
|
|
119
|
-
...new Set(
|
|
120
|
-
entry.filter(
|
|
121
|
-
(item): item is string =>
|
|
122
|
-
typeof item === "string" && CODE.test(item),
|
|
123
|
-
),
|
|
124
|
-
),
|
|
125
|
-
].slice(0, 32);
|
|
126
|
-
} else if (
|
|
127
|
-
(key === "expectedPaths" || key === "actualPaths") &&
|
|
128
|
-
Array.isArray(entry)
|
|
129
|
-
) {
|
|
130
|
-
const paths = [...new Set(entry.filter(safePath))].sort(
|
|
131
|
-
compareCanonicalStrings,
|
|
132
|
-
);
|
|
133
|
-
result[key] = paths.slice(0, 32);
|
|
134
|
-
if (entry.some((path) => !safePath(path)) || paths.length > 32)
|
|
135
|
-
result.pathsTruncated = true;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
const hint = HINTS.get(String(result.category)) ?? HINTS.get(record.code);
|
|
139
|
-
if (hint) result.hint = hint;
|
|
140
|
-
return result;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export interface DesignPlanDiagnostic {
|
|
144
|
-
code: string;
|
|
145
|
-
taskId?: string;
|
|
146
|
-
phase?: string;
|
|
147
|
-
field?: string;
|
|
148
|
-
category?: string;
|
|
149
|
-
owner?: string;
|
|
150
|
-
verificationId?: string;
|
|
151
|
-
acceptanceId?: string;
|
|
152
|
-
allowedValues?: string[];
|
|
153
|
-
mismatchedFields?: string[];
|
|
154
|
-
outputId?: string;
|
|
155
|
-
dependencyTaskId?: string;
|
|
156
|
-
producerTaskId?: string;
|
|
157
|
-
producerPhase?: string;
|
|
158
|
-
path?: string;
|
|
159
|
-
expectedPaths?: string[];
|
|
160
|
-
actualPaths?: string[];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export class DesignPlanValidationError extends Error {
|
|
164
|
-
readonly diagnostics: readonly DesignPlanDiagnostic[];
|
|
165
|
-
|
|
166
|
-
constructor(message: string, diagnostics: readonly DesignPlanDiagnostic[]) {
|
|
167
|
-
const normalized = [
|
|
168
|
-
...new Map(
|
|
169
|
-
diagnostics
|
|
170
|
-
.map((diagnostic) => structuredClone(diagnostic))
|
|
171
|
-
.sort((left, right) =>
|
|
172
|
-
compareCanonicalStrings(canonicalJson(left), canonicalJson(right)),
|
|
173
|
-
)
|
|
174
|
-
.map((diagnostic) => [canonicalJson(diagnostic), diagnostic]),
|
|
175
|
-
).values(),
|
|
176
|
-
];
|
|
177
|
-
super(message);
|
|
178
|
-
this.name = "DesignPlanValidationError";
|
|
179
|
-
this.diagnostics = Object.freeze(normalized);
|
|
180
|
-
}
|
|
181
|
-
}
|