@imricci/zaker 0.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.
- package/dist/commands/align.d.ts +3 -0
- package/dist/commands/align.js +28 -0
- package/dist/commands/align.js.map +1 -0
- package/dist/commands/audit.d.ts +3 -0
- package/dist/commands/audit.js +59 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/confirm.d.ts +3 -0
- package/dist/commands/confirm.js +22 -0
- package/dist/commands/confirm.js.map +1 -0
- package/dist/commands/dialog.d.ts +9 -0
- package/dist/commands/dialog.js +396 -0
- package/dist/commands/dialog.js.map +1 -0
- package/dist/commands/init.d.ts +3 -0
- package/dist/commands/init.js +31 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/models.d.ts +9 -0
- package/dist/commands/models.js +65 -0
- package/dist/commands/models.js.map +1 -0
- package/dist/commands/plan.d.ts +3 -0
- package/dist/commands/plan.js +69 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/run.d.ts +40 -0
- package/dist/commands/run.js +310 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/status.d.ts +3 -0
- package/dist/commands/status.js +39 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/tui.d.ts +14 -0
- package/dist/commands/tui.js +394 -0
- package/dist/commands/tui.js.map +1 -0
- package/dist/core/auditor.d.ts +13 -0
- package/dist/core/auditor.js +122 -0
- package/dist/core/auditor.js.map +1 -0
- package/dist/core/c3fi.d.ts +10 -0
- package/dist/core/c3fi.js +305 -0
- package/dist/core/c3fi.js.map +1 -0
- package/dist/core/challenge.d.ts +8 -0
- package/dist/core/challenge.js +29 -0
- package/dist/core/challenge.js.map +1 -0
- package/dist/core/checkpoint.d.ts +20 -0
- package/dist/core/checkpoint.js +192 -0
- package/dist/core/checkpoint.js.map +1 -0
- package/dist/core/execution-provider.d.ts +2 -0
- package/dist/core/execution-provider.js +125 -0
- package/dist/core/execution-provider.js.map +1 -0
- package/dist/core/executor.d.ts +16 -0
- package/dist/core/executor.js +68 -0
- package/dist/core/executor.js.map +1 -0
- package/dist/core/memory.d.ts +11 -0
- package/dist/core/memory.js +105 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/planner.d.ts +146 -0
- package/dist/core/planner.js +152 -0
- package/dist/core/planner.js.map +1 -0
- package/dist/core/preflight.d.ts +6 -0
- package/dist/core/preflight.js +140 -0
- package/dist/core/preflight.js.map +1 -0
- package/dist/core/provider-onboarding.d.ts +12 -0
- package/dist/core/provider-onboarding.js +32 -0
- package/dist/core/provider-onboarding.js.map +1 -0
- package/dist/core/run-loop.d.ts +32 -0
- package/dist/core/run-loop.js +205 -0
- package/dist/core/run-loop.js.map +1 -0
- package/dist/core/scope.d.ts +3 -0
- package/dist/core/scope.js +75 -0
- package/dist/core/scope.js.map +1 -0
- package/dist/core/types.d.ts +288 -0
- package/dist/core/types.js +11 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/verdict-panel.d.ts +29 -0
- package/dist/core/verdict-panel.js +120 -0
- package/dist/core/verdict-panel.js.map +1 -0
- package/dist/core/verifier.d.ts +2 -0
- package/dist/core/verifier.js +47 -0
- package/dist/core/verifier.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -0
- package/dist/infra/config.d.ts +36 -0
- package/dist/infra/config.js +397 -0
- package/dist/infra/config.js.map +1 -0
- package/dist/infra/git.d.ts +6 -0
- package/dist/infra/git.js +35 -0
- package/dist/infra/git.js.map +1 -0
- package/dist/infra/hashing.d.ts +1 -0
- package/dist/infra/hashing.js +8 -0
- package/dist/infra/hashing.js.map +1 -0
- package/dist/infra/intent.d.ts +30 -0
- package/dist/infra/intent.js +357 -0
- package/dist/infra/intent.js.map +1 -0
- package/dist/infra/memory.d.ts +10 -0
- package/dist/infra/memory.js +94 -0
- package/dist/infra/memory.js.map +1 -0
- package/dist/infra/model-catalog.d.ts +27 -0
- package/dist/infra/model-catalog.js +273 -0
- package/dist/infra/model-catalog.js.map +1 -0
- package/dist/infra/process.d.ts +12 -0
- package/dist/infra/process.js +32 -0
- package/dist/infra/process.js.map +1 -0
- package/package.json +39 -0
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
export type Verdict = "PASS" | "CHALLENGE" | "FAIL";
|
|
2
|
+
export type ChallengeType = "C1" | "C2" | "C3" | "C3-FI" | "C4" | "C5" | "C6";
|
|
3
|
+
export type ExecutionProviderKind = "local" | "cheap_cloud" | "ollama";
|
|
4
|
+
export declare const SOP_SCHEMA_VERSION = "molo.sop.v1";
|
|
5
|
+
export declare const CHECKPOINT_SCHEMA_VERSION = "molo.checkpoint.v1";
|
|
6
|
+
export declare const AUDIT_SCHEMA_VERSION = "molo.audit.v1";
|
|
7
|
+
export declare const MEMORY_SCHEMA_VERSION = "molo.memory.v1";
|
|
8
|
+
export declare const INTENT_SCHEMA_VERSION = "molo.intent.v1";
|
|
9
|
+
export declare const SESSION_SCHEMA_VERSION = "molo.session.v1";
|
|
10
|
+
export declare const MEMORY_HYDRATION_SOURCE_LOCAL_FILE = "local_memory_file";
|
|
11
|
+
export type IntentStatus = "DRAFT" | "CONFIRMED";
|
|
12
|
+
export type SessionState = "ALIGN" | "READY" | "RUNNING" | "RESULT";
|
|
13
|
+
export type SessionDialogRole = "user" | "system";
|
|
14
|
+
export type SessionDialogKind = "message" | "command" | "status" | "result";
|
|
15
|
+
export interface SessionDialogEntry {
|
|
16
|
+
turn: number;
|
|
17
|
+
timestamp: string;
|
|
18
|
+
role: SessionDialogRole;
|
|
19
|
+
kind: SessionDialogKind;
|
|
20
|
+
content: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SessionDialogRound {
|
|
23
|
+
round: number;
|
|
24
|
+
started_at: string;
|
|
25
|
+
completed_at: string;
|
|
26
|
+
verdict: Verdict;
|
|
27
|
+
reason_code: string;
|
|
28
|
+
checkpoint_id?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SessionDialogState {
|
|
31
|
+
debug: boolean;
|
|
32
|
+
turn: number;
|
|
33
|
+
rounds: SessionDialogRound[];
|
|
34
|
+
history: SessionDialogEntry[];
|
|
35
|
+
}
|
|
36
|
+
export interface SOPScope {
|
|
37
|
+
allowed_paths: string[];
|
|
38
|
+
forbidden_paths: string[];
|
|
39
|
+
}
|
|
40
|
+
export interface IntentCard {
|
|
41
|
+
schema_version: string;
|
|
42
|
+
intent_id: string;
|
|
43
|
+
status: IntentStatus;
|
|
44
|
+
title: string;
|
|
45
|
+
goal: string;
|
|
46
|
+
scope: SOPScope;
|
|
47
|
+
acceptance: string[];
|
|
48
|
+
constraints: string[];
|
|
49
|
+
updated_at: string;
|
|
50
|
+
confirmed_at?: string;
|
|
51
|
+
}
|
|
52
|
+
export interface IntentBinding {
|
|
53
|
+
intent_id: string;
|
|
54
|
+
intent_sha256: string;
|
|
55
|
+
intent_confirmed_at: string;
|
|
56
|
+
}
|
|
57
|
+
export interface SessionStore {
|
|
58
|
+
schema_version: string;
|
|
59
|
+
state: SessionState;
|
|
60
|
+
updated_at: string;
|
|
61
|
+
current_intent_id?: string;
|
|
62
|
+
last_run_verdict?: Verdict;
|
|
63
|
+
last_checkpoint_id?: string;
|
|
64
|
+
last_run_completed_at?: string;
|
|
65
|
+
dialog?: SessionDialogState;
|
|
66
|
+
}
|
|
67
|
+
export interface SOPVerificationCommand {
|
|
68
|
+
id: string;
|
|
69
|
+
command: string;
|
|
70
|
+
timeout_sec: number;
|
|
71
|
+
required: boolean;
|
|
72
|
+
}
|
|
73
|
+
export interface SOPVerification {
|
|
74
|
+
commands: SOPVerificationCommand[];
|
|
75
|
+
}
|
|
76
|
+
export interface SOPLimits {
|
|
77
|
+
max_runtime_minutes: number;
|
|
78
|
+
max_challenges: number;
|
|
79
|
+
}
|
|
80
|
+
export interface SOPSkill {
|
|
81
|
+
type: string;
|
|
82
|
+
}
|
|
83
|
+
export interface SOPTask {
|
|
84
|
+
id: string;
|
|
85
|
+
title: string;
|
|
86
|
+
acceptance: string[];
|
|
87
|
+
}
|
|
88
|
+
export interface ExecutionSettings {
|
|
89
|
+
provider: ExecutionProviderKind;
|
|
90
|
+
model: string;
|
|
91
|
+
ollama_host: string;
|
|
92
|
+
max_attempts: number;
|
|
93
|
+
}
|
|
94
|
+
export interface SOP {
|
|
95
|
+
schema_version: string;
|
|
96
|
+
sop_id: string;
|
|
97
|
+
goal: string;
|
|
98
|
+
scope: SOPScope;
|
|
99
|
+
verification: SOPVerification;
|
|
100
|
+
limits: SOPLimits;
|
|
101
|
+
skills: SOPSkill[];
|
|
102
|
+
tasks: SOPTask[];
|
|
103
|
+
patches: string[];
|
|
104
|
+
}
|
|
105
|
+
export interface VerificationCommandResult {
|
|
106
|
+
id: string;
|
|
107
|
+
command: string;
|
|
108
|
+
exit_code: number;
|
|
109
|
+
stdout_excerpt: string;
|
|
110
|
+
stderr_excerpt: string;
|
|
111
|
+
stdout_sha256: string;
|
|
112
|
+
success: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface VerificationReport {
|
|
115
|
+
commands: VerificationCommandResult[];
|
|
116
|
+
all_passed: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface RunnerAttestation {
|
|
119
|
+
runner_id: string;
|
|
120
|
+
runner_version: string;
|
|
121
|
+
generated_at: string;
|
|
122
|
+
attestation_sha256: string;
|
|
123
|
+
metadata: RunnerMetadata;
|
|
124
|
+
}
|
|
125
|
+
export interface RunnerCommandSignature {
|
|
126
|
+
id: string;
|
|
127
|
+
command: string;
|
|
128
|
+
command_sha256: string;
|
|
129
|
+
}
|
|
130
|
+
export interface RunnerMetadata {
|
|
131
|
+
preflight_checked_at: string;
|
|
132
|
+
lockfile_path: string;
|
|
133
|
+
lockfile_sha256: string;
|
|
134
|
+
verification_commands: RunnerCommandSignature[];
|
|
135
|
+
risk_paths_file: string;
|
|
136
|
+
risk_paths_sha256: string;
|
|
137
|
+
execution: {
|
|
138
|
+
provider: ExecutionProviderKind;
|
|
139
|
+
model: string;
|
|
140
|
+
ollama_host?: string;
|
|
141
|
+
max_attempts: number;
|
|
142
|
+
attempts_used: number;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
export interface SelfCritiqueItem {
|
|
146
|
+
severity: "LOW" | "MEDIUM" | "HIGH";
|
|
147
|
+
item: string;
|
|
148
|
+
evidence?: string;
|
|
149
|
+
}
|
|
150
|
+
export interface MemoryRecord {
|
|
151
|
+
id: string;
|
|
152
|
+
timestamp: string;
|
|
153
|
+
source: string;
|
|
154
|
+
supersedes: string;
|
|
155
|
+
confidence: number;
|
|
156
|
+
content: string;
|
|
157
|
+
}
|
|
158
|
+
export interface ExecutionFailureRecord extends MemoryRecord {
|
|
159
|
+
}
|
|
160
|
+
export interface MemoryStore {
|
|
161
|
+
schema_version: string;
|
|
162
|
+
facts: MemoryRecord[];
|
|
163
|
+
decisions: MemoryRecord[];
|
|
164
|
+
constraints: MemoryRecord[];
|
|
165
|
+
execution_failures: ExecutionFailureRecord[];
|
|
166
|
+
}
|
|
167
|
+
export type MemorySummaryStatus = "HYDRATED" | "DEGRADED";
|
|
168
|
+
export interface MemorySummary {
|
|
169
|
+
status: MemorySummaryStatus;
|
|
170
|
+
source: string;
|
|
171
|
+
hydrated_at: string;
|
|
172
|
+
facts_count: number;
|
|
173
|
+
decisions_count: number;
|
|
174
|
+
constraints_count: number;
|
|
175
|
+
execution_failure_count: number;
|
|
176
|
+
used_ids: string[];
|
|
177
|
+
warning?: string;
|
|
178
|
+
}
|
|
179
|
+
export interface MemoryHydration {
|
|
180
|
+
status: MemorySummaryStatus;
|
|
181
|
+
source: string;
|
|
182
|
+
hydrated_at: string;
|
|
183
|
+
facts: MemoryRecord[];
|
|
184
|
+
decisions: MemoryRecord[];
|
|
185
|
+
constraints: MemoryRecord[];
|
|
186
|
+
execution_failures: ExecutionFailureRecord[];
|
|
187
|
+
warning?: string;
|
|
188
|
+
summary: MemorySummary;
|
|
189
|
+
}
|
|
190
|
+
export interface CheckpointBudget {
|
|
191
|
+
cloud_plan_calls: number;
|
|
192
|
+
cloud_audit_calls: number;
|
|
193
|
+
challenge_used: number;
|
|
194
|
+
}
|
|
195
|
+
export interface ChallengeHistoryEntry {
|
|
196
|
+
round: number;
|
|
197
|
+
challenge_id: string;
|
|
198
|
+
type: ChallengeType;
|
|
199
|
+
fingerprint: string;
|
|
200
|
+
instruction: string;
|
|
201
|
+
audit_call: number;
|
|
202
|
+
status: "APPLIED" | "SKIPPED" | "REJECTED";
|
|
203
|
+
applied_patches: number;
|
|
204
|
+
verification_all_passed: boolean;
|
|
205
|
+
reason?: string;
|
|
206
|
+
recorded_at: string;
|
|
207
|
+
}
|
|
208
|
+
export type C3FIRiskLevel = "HIGH" | "CRITICAL";
|
|
209
|
+
export type C3FIStatus = "SKIPPED" | "PASSED" | "FAILED";
|
|
210
|
+
export interface C3FIReport {
|
|
211
|
+
status: C3FIStatus;
|
|
212
|
+
required: boolean;
|
|
213
|
+
trigger_reason: string;
|
|
214
|
+
risk_level?: C3FIRiskLevel;
|
|
215
|
+
target_file?: string;
|
|
216
|
+
target_function?: string;
|
|
217
|
+
injected_line?: number;
|
|
218
|
+
injection_verification: {
|
|
219
|
+
all_passed: boolean;
|
|
220
|
+
failed_command_ids: string[];
|
|
221
|
+
};
|
|
222
|
+
post_rollback_verification: {
|
|
223
|
+
all_passed: boolean;
|
|
224
|
+
failed_command_ids: string[];
|
|
225
|
+
};
|
|
226
|
+
rollback: {
|
|
227
|
+
strategy: "snapshot_restore";
|
|
228
|
+
success: boolean;
|
|
229
|
+
detail?: string;
|
|
230
|
+
};
|
|
231
|
+
message: string;
|
|
232
|
+
recorded_at: string;
|
|
233
|
+
}
|
|
234
|
+
export interface Checkpoint {
|
|
235
|
+
schema_version: string;
|
|
236
|
+
checkpoint_id: string;
|
|
237
|
+
sop_id?: string;
|
|
238
|
+
intent_id?: string;
|
|
239
|
+
intent_sha256?: string;
|
|
240
|
+
intent_confirmed_at?: string;
|
|
241
|
+
base_commit: string;
|
|
242
|
+
head_commit: string;
|
|
243
|
+
diffstat: string;
|
|
244
|
+
diff_excerpt: string;
|
|
245
|
+
changed_files: string[];
|
|
246
|
+
verification: VerificationReport;
|
|
247
|
+
runner_attestation?: RunnerAttestation;
|
|
248
|
+
memory_summary: MemorySummary;
|
|
249
|
+
self_critique: SelfCritiqueItem[];
|
|
250
|
+
c3_fi_report: C3FIReport;
|
|
251
|
+
challenge_history: ChallengeHistoryEntry[];
|
|
252
|
+
budget: CheckpointBudget;
|
|
253
|
+
}
|
|
254
|
+
export interface AuditChallenge {
|
|
255
|
+
challenge_id: string;
|
|
256
|
+
type: ChallengeType;
|
|
257
|
+
fingerprint: string;
|
|
258
|
+
instruction: string;
|
|
259
|
+
remaining_budget?: number;
|
|
260
|
+
remediation_patches: string[];
|
|
261
|
+
}
|
|
262
|
+
export interface AuditResult {
|
|
263
|
+
schema_version: string;
|
|
264
|
+
verdict: Verdict;
|
|
265
|
+
reason_code: string;
|
|
266
|
+
message: string;
|
|
267
|
+
challenge?: AuditChallenge;
|
|
268
|
+
}
|
|
269
|
+
export interface ExecutionProviderInput {
|
|
270
|
+
goal: string;
|
|
271
|
+
tasks: SOPTask[];
|
|
272
|
+
scope: SOPScope;
|
|
273
|
+
limits: {
|
|
274
|
+
max_attempts: number;
|
|
275
|
+
};
|
|
276
|
+
patches: string[];
|
|
277
|
+
}
|
|
278
|
+
export interface ExecutionProviderOutput {
|
|
279
|
+
patches: string[];
|
|
280
|
+
attempts_used: number;
|
|
281
|
+
}
|
|
282
|
+
export interface ExecutionProvider {
|
|
283
|
+
execute(input: ExecutionProviderInput): Promise<ExecutionProviderOutput>;
|
|
284
|
+
}
|
|
285
|
+
export interface LLMProvider {
|
|
286
|
+
plan(prompt: string): Promise<SOP>;
|
|
287
|
+
audit(checkpoint: any): Promise<AuditResult>;
|
|
288
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MEMORY_HYDRATION_SOURCE_LOCAL_FILE = exports.SESSION_SCHEMA_VERSION = exports.INTENT_SCHEMA_VERSION = exports.MEMORY_SCHEMA_VERSION = exports.AUDIT_SCHEMA_VERSION = exports.CHECKPOINT_SCHEMA_VERSION = exports.SOP_SCHEMA_VERSION = void 0;
|
|
4
|
+
exports.SOP_SCHEMA_VERSION = "molo.sop.v1";
|
|
5
|
+
exports.CHECKPOINT_SCHEMA_VERSION = "molo.checkpoint.v1";
|
|
6
|
+
exports.AUDIT_SCHEMA_VERSION = "molo.audit.v1";
|
|
7
|
+
exports.MEMORY_SCHEMA_VERSION = "molo.memory.v1";
|
|
8
|
+
exports.INTENT_SCHEMA_VERSION = "molo.intent.v1";
|
|
9
|
+
exports.SESSION_SCHEMA_VERSION = "molo.session.v1";
|
|
10
|
+
exports.MEMORY_HYDRATION_SOURCE_LOCAL_FILE = "local_memory_file";
|
|
11
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":";;;AAIa,QAAA,kBAAkB,GAAG,aAAa,CAAC;AACnC,QAAA,yBAAyB,GAAG,oBAAoB,CAAC;AACjD,QAAA,oBAAoB,GAAG,eAAe,CAAC;AACvC,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AACzC,QAAA,qBAAqB,GAAG,gBAAgB,CAAC;AACzC,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,kCAAkC,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AuditResult, ChallengeType, Checkpoint, Verdict } from "./types";
|
|
2
|
+
type SkillStatusValue = "PASS" | "FAIL";
|
|
3
|
+
type TestStatus = "PASS" | "FAIL" | "PENDING";
|
|
4
|
+
export interface SkillStatusItem {
|
|
5
|
+
skill: "preflight" | "core_execution" | "audit_checkpoint";
|
|
6
|
+
status: SkillStatusValue;
|
|
7
|
+
detail: string;
|
|
8
|
+
}
|
|
9
|
+
export interface VerdictPanel {
|
|
10
|
+
verdict: Verdict;
|
|
11
|
+
reason_code: string;
|
|
12
|
+
trigger_rule: string;
|
|
13
|
+
rule_hits: string[];
|
|
14
|
+
audit_conclusion: string;
|
|
15
|
+
changed_files: number;
|
|
16
|
+
tests_passed: number;
|
|
17
|
+
tests_total: number;
|
|
18
|
+
test_status: TestStatus;
|
|
19
|
+
risk_hit: string;
|
|
20
|
+
challenge_type?: ChallengeType;
|
|
21
|
+
objections: string[];
|
|
22
|
+
required_evidence: string[];
|
|
23
|
+
evidence_refs: string[];
|
|
24
|
+
retry_allowed: boolean;
|
|
25
|
+
retry_reason: string;
|
|
26
|
+
skill_statuses: SkillStatusItem[];
|
|
27
|
+
}
|
|
28
|
+
export declare function buildVerdictPanel(finalAudit: AuditResult, checkpoint?: Checkpoint): VerdictPanel;
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildVerdictPanel = buildVerdictPanel;
|
|
4
|
+
function dedupeStrings(values) {
|
|
5
|
+
return [...new Set(values.map((value) => value.trim()).filter((value) => value.length > 0))];
|
|
6
|
+
}
|
|
7
|
+
function requiredEvidenceByType(type) {
|
|
8
|
+
if (!type) {
|
|
9
|
+
return [];
|
|
10
|
+
}
|
|
11
|
+
const table = {
|
|
12
|
+
C1: ["测试覆盖补充", "失败到通过的验证证据"],
|
|
13
|
+
C2: ["依赖影响分析", "调用方更新证据", "集成验证证据"],
|
|
14
|
+
C3: ["Runner 验证哈希", "runner_attestation"],
|
|
15
|
+
"C3-FI": ["故障注入报告", "回滚恢复验证证据"],
|
|
16
|
+
C4: ["兼容性评估", "迁移/回滚方案"],
|
|
17
|
+
C5: ["安全审计证据", "风险路径解释"],
|
|
18
|
+
C6: ["预算与调用统计", "挑战轮次消耗证明"]
|
|
19
|
+
};
|
|
20
|
+
return table[type];
|
|
21
|
+
}
|
|
22
|
+
function computeRetryAllowed(reasonCode) {
|
|
23
|
+
const blocked = new Set([
|
|
24
|
+
"C3_FI_GUARD_FAILED",
|
|
25
|
+
"CHALLENGE_LIMIT_EXCEEDED",
|
|
26
|
+
"DUPLICATE_CHALLENGE_FINGERPRINT",
|
|
27
|
+
"HUMAN_INTERVENTION_REQUIRED",
|
|
28
|
+
"PRECONDITION_FAILED"
|
|
29
|
+
]);
|
|
30
|
+
return !blocked.has(reasonCode);
|
|
31
|
+
}
|
|
32
|
+
function computeRetryReason(reasonCode, allowed) {
|
|
33
|
+
if (allowed) {
|
|
34
|
+
return `retry allowed by rule ${reasonCode}`;
|
|
35
|
+
}
|
|
36
|
+
return `retry blocked by rule ${reasonCode}`;
|
|
37
|
+
}
|
|
38
|
+
function computeTestStatus(passed, total) {
|
|
39
|
+
if (total === 0) {
|
|
40
|
+
return "PENDING";
|
|
41
|
+
}
|
|
42
|
+
return passed === total ? "PASS" : "FAIL";
|
|
43
|
+
}
|
|
44
|
+
function computeSkillStatuses(checkpoint) {
|
|
45
|
+
const hasPreflightMetadata = Boolean(checkpoint?.runner_attestation?.metadata &&
|
|
46
|
+
checkpoint.runner_attestation.metadata.verification_commands.length > 0);
|
|
47
|
+
const hasAuditBinding = Boolean(checkpoint?.runner_attestation &&
|
|
48
|
+
checkpoint?.intent_id &&
|
|
49
|
+
checkpoint?.intent_sha256 &&
|
|
50
|
+
checkpoint?.intent_confirmed_at);
|
|
51
|
+
const hasExecutionEvidence = Boolean(checkpoint && Array.isArray(checkpoint.changed_files));
|
|
52
|
+
return [
|
|
53
|
+
{
|
|
54
|
+
skill: "preflight",
|
|
55
|
+
status: hasPreflightMetadata ? "PASS" : "FAIL",
|
|
56
|
+
detail: hasPreflightMetadata ? "runner metadata present" : "missing runner metadata"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
skill: "core_execution",
|
|
60
|
+
status: hasExecutionEvidence ? "PASS" : "FAIL",
|
|
61
|
+
detail: hasExecutionEvidence
|
|
62
|
+
? `changed_files tracked (${checkpoint?.changed_files.length ?? 0})`
|
|
63
|
+
: "missing execution evidence"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
skill: "audit_checkpoint",
|
|
67
|
+
status: hasAuditBinding ? "PASS" : "FAIL",
|
|
68
|
+
detail: hasAuditBinding ? "intent binding + attestation present" : "missing checkpoint binding"
|
|
69
|
+
}
|
|
70
|
+
];
|
|
71
|
+
}
|
|
72
|
+
function computeRiskHit(checkpoint) {
|
|
73
|
+
if (!checkpoint?.c3_fi_report?.required) {
|
|
74
|
+
return "无命中";
|
|
75
|
+
}
|
|
76
|
+
return `命中(${checkpoint.c3_fi_report.risk_level ?? "HIGH"})`;
|
|
77
|
+
}
|
|
78
|
+
function buildVerdictPanel(finalAudit, checkpoint) {
|
|
79
|
+
const verification = checkpoint?.verification.commands ?? [];
|
|
80
|
+
const testsPassed = verification.filter((entry) => entry.success).length;
|
|
81
|
+
const testsTotal = verification.length;
|
|
82
|
+
const challengeType = finalAudit.challenge?.type;
|
|
83
|
+
const reasonCode = finalAudit.reason_code || "UNKNOWN";
|
|
84
|
+
const retryAllowed = computeRetryAllowed(reasonCode);
|
|
85
|
+
const objections = dedupeStrings(finalAudit.verdict === "CHALLENGE"
|
|
86
|
+
? [finalAudit.message, finalAudit.challenge?.instruction ?? ""]
|
|
87
|
+
: finalAudit.verdict === "FAIL"
|
|
88
|
+
? [finalAudit.message]
|
|
89
|
+
: []);
|
|
90
|
+
const ruleHits = dedupeStrings([
|
|
91
|
+
reasonCode,
|
|
92
|
+
challengeType ?? "",
|
|
93
|
+
checkpoint?.c3_fi_report?.status === "FAILED" ? "C3_FI_GUARD_FAILED" : ""
|
|
94
|
+
]);
|
|
95
|
+
return {
|
|
96
|
+
verdict: finalAudit.verdict,
|
|
97
|
+
reason_code: reasonCode,
|
|
98
|
+
trigger_rule: reasonCode,
|
|
99
|
+
rule_hits: ruleHits,
|
|
100
|
+
audit_conclusion: finalAudit.verdict === "PASS" ? "无结构性风险" : finalAudit.message,
|
|
101
|
+
changed_files: checkpoint?.changed_files.length ?? 0,
|
|
102
|
+
tests_passed: testsPassed,
|
|
103
|
+
tests_total: testsTotal,
|
|
104
|
+
test_status: computeTestStatus(testsPassed, testsTotal),
|
|
105
|
+
risk_hit: computeRiskHit(checkpoint),
|
|
106
|
+
challenge_type: challengeType,
|
|
107
|
+
objections,
|
|
108
|
+
required_evidence: requiredEvidenceByType(challengeType),
|
|
109
|
+
evidence_refs: dedupeStrings([
|
|
110
|
+
"checkpoint.runner_attestation.attestation_sha256",
|
|
111
|
+
"checkpoint.verification.commands[*].stdout_sha256",
|
|
112
|
+
"checkpoint.c3_fi_report",
|
|
113
|
+
"checkpoint.challenge_history[*]"
|
|
114
|
+
]),
|
|
115
|
+
retry_allowed: retryAllowed,
|
|
116
|
+
retry_reason: computeRetryReason(reasonCode, retryAllowed),
|
|
117
|
+
skill_statuses: computeSkillStatuses(checkpoint)
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=verdict-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdict-panel.js","sourceRoot":"","sources":["../../src/core/verdict-panel.ts"],"names":[],"mappings":";;AAsHA,8CA6CC;AApID,SAAS,aAAa,CAAC,MAAgB;IACrC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAoB;IAClD,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,KAAK,GAAoC;QAC7C,EAAE,EAAE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AW,EAAE,UAAU,CAAC;QACvD,QAAQ,EAAE,cAAc,CAAC,UAAU,CAAC;QACpC,cAAc,EAAE,aAAa;QAC7B,UAAU;QACV,iBAAiB,EAAE,sBAAsB,CAAC,aAAa,CAAC;QACxD,aAAa,EAAE,aAAa,CAAC;YAC3B,kDAAkD;YAClD,mDAAmD;YACnD,yBAAyB;YACzB,iCAAiC;SAClC,CAAC;QACF,aAAa,EAAE,YAAY;QAC3B,YAAY,EAAE,kBAAkB,CAAC,UAAU,EAAE,YAAY,CAAC;QAC1D,cAAc,EAAE,oBAAoB,CAAC,UAAU,CAAC;KACjD,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runVerification = runVerification;
|
|
4
|
+
const hashing_1 = require("../infra/hashing");
|
|
5
|
+
const process_1 = require("../infra/process");
|
|
6
|
+
function excerpt(output, maxLines = 20) {
|
|
7
|
+
return output.split(/\r?\n/).slice(0, maxLines).join("\n");
|
|
8
|
+
}
|
|
9
|
+
function tokenizeCommand(command) {
|
|
10
|
+
return command
|
|
11
|
+
.trim()
|
|
12
|
+
.split(/\s+/)
|
|
13
|
+
.filter((part) => part.length > 0);
|
|
14
|
+
}
|
|
15
|
+
async function runVerification(signedCommands, cwd = process.cwd()) {
|
|
16
|
+
if (signedCommands.length === 0) {
|
|
17
|
+
throw new Error("Verification failed: no signed verification commands provided.");
|
|
18
|
+
}
|
|
19
|
+
const commands = [];
|
|
20
|
+
for (const entry of signedCommands) {
|
|
21
|
+
const computedCommandHash = (0, hashing_1.sha256)(entry.command);
|
|
22
|
+
if (computedCommandHash !== entry.command_sha256) {
|
|
23
|
+
throw new Error(`Verification failed: command signature mismatch for ${entry.id}.`);
|
|
24
|
+
}
|
|
25
|
+
const tokens = tokenizeCommand(entry.command);
|
|
26
|
+
if (tokens.length === 0) {
|
|
27
|
+
throw new Error(`Verification failed: invalid command for ${entry.id}.`);
|
|
28
|
+
}
|
|
29
|
+
const binary = tokens[0];
|
|
30
|
+
const args = tokens.slice(1);
|
|
31
|
+
const result = await (0, process_1.runCommand)(binary, args, { cwd });
|
|
32
|
+
commands.push({
|
|
33
|
+
id: entry.id,
|
|
34
|
+
command: entry.command,
|
|
35
|
+
exit_code: result.exitCode,
|
|
36
|
+
stdout_excerpt: excerpt(result.stdout),
|
|
37
|
+
stderr_excerpt: excerpt(result.stderr),
|
|
38
|
+
stdout_sha256: (0, hashing_1.sha256)(result.stdout),
|
|
39
|
+
success: result.exitCode === 0
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
commands,
|
|
44
|
+
all_passed: commands.every((entry) => entry.success)
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=verifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifier.js","sourceRoot":"","sources":["../../src/core/verifier.ts"],"names":[],"mappings":";;AAeA,0CAwCC;AAvDD,8CAA0C;AAC1C,8CAA8C;AAG9C,SAAS,OAAO,CAAC,MAAc,EAAE,QAAQ,GAAG,EAAE;IAC5C,OAAO,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7D,CAAC;AAED,SAAS,eAAe,CAAC,OAAe;IACtC,OAAO,OAAO;SACX,IAAI,EAAE;SACN,KAAK,CAAC,KAAK,CAAC;SACZ,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACvC,CAAC;AAEM,KAAK,UAAU,eAAe,CACnC,cAAwC,EACxC,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IAEnB,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAA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AC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;KACrD,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const audit_1 = require("./commands/audit");
|
|
6
|
+
const align_1 = require("./commands/align");
|
|
7
|
+
const confirm_1 = require("./commands/confirm");
|
|
8
|
+
const dialog_1 = require("./commands/dialog");
|
|
9
|
+
const init_1 = require("./commands/init");
|
|
10
|
+
const models_1 = require("./commands/models");
|
|
11
|
+
const plan_1 = require("./commands/plan");
|
|
12
|
+
const run_1 = require("./commands/run");
|
|
13
|
+
const status_1 = require("./commands/status");
|
|
14
|
+
const tui_1 = require("./commands/tui");
|
|
15
|
+
async function main() {
|
|
16
|
+
if (process.argv.length <= 2) {
|
|
17
|
+
await (0, dialog_1.runDialogueSession)();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const program = new commander_1.Command();
|
|
21
|
+
program.name("zaker").description("zaker-cli");
|
|
22
|
+
(0, init_1.registerInitCommand)(program);
|
|
23
|
+
(0, align_1.registerAlignCommand)(program);
|
|
24
|
+
(0, confirm_1.registerConfirmCommand)(program);
|
|
25
|
+
(0, status_1.registerStatusCommand)(program);
|
|
26
|
+
(0, models_1.registerModelsCommand)(program);
|
|
27
|
+
(0, plan_1.registerPlanCommand)(program);
|
|
28
|
+
(0, audit_1.registerAuditCommand)(program);
|
|
29
|
+
(0, run_1.registerRunCommand)(program);
|
|
30
|
+
(0, tui_1.registerTuiCommand)(program);
|
|
31
|
+
(0, dialog_1.registerDialogCommand)(program);
|
|
32
|
+
await program.parseAsync(process.argv);
|
|
33
|
+
}
|
|
34
|
+
main().catch((error) => {
|
|
35
|
+
if (error instanceof Error) {
|
|
36
|
+
console.error(error.message);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
console.error(String(error));
|
|
40
|
+
}
|
|
41
|
+
process.exitCode = 1;
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,4CAAwD;AACxD,4CAAwD;AACxD,gDAA4D;AAC5D,8CAA8E;AAC9E,0CAAsD;AACtD,8CAA0D;AAC1D,0CAAsD;AACtD,wCAAoD;AACpD,8CAA0D;AAC1D,wCAAoD;AAEpD,KAAK,UAAU,IAAI;IACjB,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAA,2BAAkB,GAAE,CAAC;QAC3B,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;IAC9B,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAE/C,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;IAC7B,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,IAAA,gCAAsB,EAAC,OAAO,CAAC,CAAC;IAChC,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;IAC/B,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;IAC/B,IAAA,0BAAmB,EAAC,OAAO,CAAC,CAAC;IAC7B,IAAA,4BAAoB,EAAC,OAAO,CAAC,CAAC;IAC9B,IAAA,wBAAkB,EAAC,OAAO,CAAC,CAAC;IAC5B,IAAA,wBAAkB,EAAC,OAAO,CAAC,CAAC;IAC5B,IAAA,8BAAqB,EAAC,OAAO,CAAC,CAAC;IAE/B,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC9B,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ExecutionSettings, LLMProvider } from "../core/types";
|
|
2
|
+
export declare const CONFIG_SCHEMA_VERSION = "molo.config.v1";
|
|
3
|
+
export interface MoloConfig {
|
|
4
|
+
schema_version: string;
|
|
5
|
+
scope: {
|
|
6
|
+
allowed_paths: string[];
|
|
7
|
+
forbidden_paths: string[];
|
|
8
|
+
};
|
|
9
|
+
model: {
|
|
10
|
+
provider: "mock" | "http" | "openai_codex_team";
|
|
11
|
+
endpoint?: string;
|
|
12
|
+
api_key_env?: string;
|
|
13
|
+
api_key?: string;
|
|
14
|
+
models_path?: string;
|
|
15
|
+
planner_model: string;
|
|
16
|
+
auditor_model: string;
|
|
17
|
+
timeout_ms?: number;
|
|
18
|
+
};
|
|
19
|
+
risk: {
|
|
20
|
+
risk_paths_file: string;
|
|
21
|
+
};
|
|
22
|
+
memory: {
|
|
23
|
+
memory_file: string;
|
|
24
|
+
max_items_per_category: number;
|
|
25
|
+
};
|
|
26
|
+
execution: ExecutionSettings;
|
|
27
|
+
}
|
|
28
|
+
export interface InitMoloResult {
|
|
29
|
+
created: string[];
|
|
30
|
+
updated: string[];
|
|
31
|
+
skipped: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare function writeMoloConfig(config: MoloConfig, cwd?: string): Promise<void>;
|
|
34
|
+
export declare function initMoloFiles(cwd?: string, force?: boolean): Promise<InitMoloResult>;
|
|
35
|
+
export declare function readConfig(cwd?: string): Promise<MoloConfig>;
|
|
36
|
+
export declare function createLLMProvider(config: MoloConfig): LLMProvider;
|