bootproof 0.3.0 → 0.4.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 +844 -152
- package/dist/agent-plan.d.ts +44 -0
- package/dist/agent-plan.js +826 -0
- package/dist/agent-run.d.ts +117 -0
- package/dist/agent-run.js +459 -0
- package/dist/ai-repair.d.ts +58 -0
- package/dist/ai-repair.js +380 -0
- package/dist/cli.js +730 -46
- package/dist/diagnosis.js +101 -16
- package/dist/diff.d.ts +29 -0
- package/dist/diff.js +569 -0
- package/dist/exec.d.ts +30 -2
- package/dist/exec.js +329 -51
- package/dist/external-health.d.ts +16 -0
- package/dist/external-health.js +214 -0
- package/dist/infer.js +238 -39
- package/dist/plan.js +2 -0
- package/dist/proof.d.ts +78 -2
- package/dist/proof.js +265 -12
- package/dist/receipt.d.ts +52 -0
- package/dist/receipt.js +356 -0
- package/dist/redact.d.ts +4 -0
- package/dist/redact.js +86 -2
- package/dist/registry.d.ts +82 -30
- package/dist/registry.js +355 -53
- package/dist/remote.js +3 -3
- package/dist/repair-playbooks.d.ts +24 -0
- package/dist/repair-playbooks.js +593 -0
- package/dist/repair-safety.d.ts +130 -0
- package/dist/repair-safety.js +766 -0
- package/dist/repair.d.ts +43 -11
- package/dist/repair.js +716 -7
- package/dist/run.d.ts +3 -0
- package/dist/run.js +218 -41
- package/dist/sbom.d.ts +22 -0
- package/dist/sbom.js +99 -0
- package/dist/taxonomy.d.ts +8 -3
- package/dist/taxonomy.js +404 -8
- package/dist/types.d.ts +40 -1
- package/docs/AGENT_IN_THE_LOOP.md +171 -0
- package/docs/AGENT_RUN_RECEIPTS.md +38 -0
- package/docs/CI_ACTION.md +67 -2
- package/docs/DETERMINISTIC_REPAIR_SAFETY_MODEL.md +705 -0
- package/docs/DISTRIBUTION.md +83 -0
- package/docs/FAILURE_TAXONOMY.md +28 -1
- package/docs/HONESTY_CONTRACT.md +34 -12
- package/docs/LAUNCH_PLAYBOOK.md +232 -0
- package/docs/REAL_WORLD_FIXTURES.md +105 -0
- package/docs/REGISTRY.md +48 -28
- package/docs/REPAIR_RECEIPT.md +54 -8
- package/docs/agent-loop-gap-analysis.md +188 -0
- package/docs/examples/registry-seeds/advertised-port-mismatch.json +28 -0
- package/docs/examples/registry-seeds/airbyte-abctl-external-orchestrator.json +36 -0
- package/docs/examples/registry-seeds/go-ollama-service.json +36 -0
- package/docs/examples/registry-seeds/laravel-vite-sqlite.json +36 -0
- package/docs/examples/registry-seeds/monorepo-ambiguous-health.json +29 -0
- package/docs/examples/registry-seeds/php-composer.json +33 -0
- package/docs/examples/registry-seeds/rails-bundler.json +32 -0
- package/docs/examples/registry-seeds/sentry-devenv-direnv.json +41 -0
- package/docs/schemas/action-verdict-v1.schema.json +64 -0
- package/docs/schemas/agent-plan-v1.schema.json +148 -0
- package/docs/schemas/agent-run-receipts-v1.schema.json +192 -0
- package/docs/schemas/ai-repair-suggestion-v1.schema.json +70 -0
- package/docs/schemas/ci-context-v1.schema.json +63 -0
- package/docs/schemas/diff-result-v1.schema.json +66 -0
- package/docs/schemas/federated-receipt-v1.schema.json +51 -0
- package/docs/schemas/registry-entry-v1.schema.json +95 -0
- package/docs/schemas/registry-seed-example-v1.schema.json +102 -0
- package/docs/schemas/repair-action-v1.schema.json +136 -0
- package/docs/schemas/repair-receipt-v1.schema.json +221 -0
- package/package.json +21 -11
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { FailureClass } from "./types.js";
|
|
2
|
+
export type RepairActionType = "command" | "patch" | "instruction";
|
|
3
|
+
export type RepairActionSource = "deterministic_playbook" | "ai_suggested";
|
|
4
|
+
export declare const ACTION_MUTATION_SCOPES: readonly ["none", "repo_only", "project_cache", "container_runtime", "host_tool_install", "host_network", "kubernetes_cluster", "database", "service", "credentials", "unknown"];
|
|
5
|
+
export declare const ACTION_RISK_LEVELS: readonly ["none", "low", "medium", "high", "blocked"];
|
|
6
|
+
export type RepairMutationScope = typeof ACTION_MUTATION_SCOPES[number];
|
|
7
|
+
export type RepairRiskLevel = typeof ACTION_RISK_LEVELS[number];
|
|
8
|
+
export interface RepairCommand {
|
|
9
|
+
executable: string;
|
|
10
|
+
args: string[];
|
|
11
|
+
display: string;
|
|
12
|
+
}
|
|
13
|
+
export interface RepairPatch {
|
|
14
|
+
format: "unified-diff";
|
|
15
|
+
content: string;
|
|
16
|
+
files: string[];
|
|
17
|
+
}
|
|
18
|
+
export interface RepairAction {
|
|
19
|
+
schema: "bootproof/repair-action/v1";
|
|
20
|
+
actionType: RepairActionType;
|
|
21
|
+
mutationScope: RepairMutationScope;
|
|
22
|
+
riskLevel: RepairRiskLevel;
|
|
23
|
+
requiresApproval: boolean;
|
|
24
|
+
approvalPrompt: string;
|
|
25
|
+
blockedReason: string;
|
|
26
|
+
verificationStep: string;
|
|
27
|
+
command: RepairCommand | null;
|
|
28
|
+
patch: RepairPatch | null;
|
|
29
|
+
instruction: string | null;
|
|
30
|
+
explanation: string;
|
|
31
|
+
evidenceRefs: string[];
|
|
32
|
+
deterministic: boolean;
|
|
33
|
+
source: RepairActionSource;
|
|
34
|
+
}
|
|
35
|
+
export interface RepairActionInput {
|
|
36
|
+
actionType: RepairActionType;
|
|
37
|
+
mutationScope: RepairMutationScope;
|
|
38
|
+
riskLevel: RepairRiskLevel;
|
|
39
|
+
requiresApproval?: boolean;
|
|
40
|
+
blockedReason?: string;
|
|
41
|
+
verificationStep?: string;
|
|
42
|
+
command?: RepairCommand | null;
|
|
43
|
+
patch?: RepairPatch | null;
|
|
44
|
+
instruction?: string | null;
|
|
45
|
+
explanation: string;
|
|
46
|
+
evidenceRefs: string[];
|
|
47
|
+
}
|
|
48
|
+
export type RepairApplyStatus = "not_applied" | "applied" | "failed";
|
|
49
|
+
export interface RepairApplyResultRecord {
|
|
50
|
+
status: RepairApplyStatus;
|
|
51
|
+
exitCode: number | null;
|
|
52
|
+
filesChanged: string[];
|
|
53
|
+
evidence: string | null;
|
|
54
|
+
}
|
|
55
|
+
export interface RepairReceiptBase {
|
|
56
|
+
schema: "bootproof/repair-receipt/v1";
|
|
57
|
+
repairId: string;
|
|
58
|
+
createdAt: string;
|
|
59
|
+
bootproofVersion: string;
|
|
60
|
+
source: RepairActionSource;
|
|
61
|
+
beforeFailureClass: FailureClass;
|
|
62
|
+
beforeEvidenceHash: string;
|
|
63
|
+
proposedAction: RepairAction;
|
|
64
|
+
actionType: RepairActionType;
|
|
65
|
+
mutationScope: RepairMutationScope;
|
|
66
|
+
riskLevel: RepairRiskLevel;
|
|
67
|
+
userApprovalRequired: boolean;
|
|
68
|
+
approvedAt?: string;
|
|
69
|
+
appliedAt?: string;
|
|
70
|
+
applyResult: RepairApplyResultRecord;
|
|
71
|
+
afterFailureClass?: FailureClass;
|
|
72
|
+
progressed: boolean;
|
|
73
|
+
verified: boolean;
|
|
74
|
+
explanation: string;
|
|
75
|
+
redactionsApplied: string[];
|
|
76
|
+
}
|
|
77
|
+
export interface RepairReceiptBaseInput {
|
|
78
|
+
repairId: string;
|
|
79
|
+
createdAt: string;
|
|
80
|
+
bootproofVersion: string;
|
|
81
|
+
beforeFailureClass: FailureClass;
|
|
82
|
+
beforeEvidenceHash: string;
|
|
83
|
+
proposedAction: RepairAction;
|
|
84
|
+
approvedAt?: string;
|
|
85
|
+
appliedAt?: string;
|
|
86
|
+
applyResult?: RepairApplyResultRecord;
|
|
87
|
+
afterFailureClass?: FailureClass;
|
|
88
|
+
progressed?: boolean;
|
|
89
|
+
verified?: boolean;
|
|
90
|
+
explanation: string;
|
|
91
|
+
redactionsApplied?: string[];
|
|
92
|
+
}
|
|
93
|
+
export interface RepairSafetyValidation {
|
|
94
|
+
valid: boolean;
|
|
95
|
+
errors: string[];
|
|
96
|
+
}
|
|
97
|
+
export interface ActionRiskAssessment {
|
|
98
|
+
actionType: RepairActionType;
|
|
99
|
+
command: string;
|
|
100
|
+
riskLevel: RepairRiskLevel;
|
|
101
|
+
mutationScope: RepairMutationScope;
|
|
102
|
+
requiresApproval: boolean;
|
|
103
|
+
approvalPrompt: string;
|
|
104
|
+
blockedReason: string;
|
|
105
|
+
verificationStep: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ActionRiskInput {
|
|
108
|
+
actionType: RepairActionType;
|
|
109
|
+
command?: RepairCommand | null;
|
|
110
|
+
mutationScope?: RepairMutationScope;
|
|
111
|
+
riskLevel?: RepairRiskLevel;
|
|
112
|
+
requiresApproval?: boolean;
|
|
113
|
+
blockedReason?: string;
|
|
114
|
+
verificationStep?: string;
|
|
115
|
+
}
|
|
116
|
+
export declare function renderRepairCommand(executable: string, args: string[]): string;
|
|
117
|
+
export declare function createRepairCommand(executable: string, args: string[]): RepairCommand;
|
|
118
|
+
export declare function isProtectedEnvPath(value: string): boolean;
|
|
119
|
+
export declare function isBlockedRepairPath(value: string): boolean;
|
|
120
|
+
export declare function assessActionRisk(input: ActionRiskInput): ActionRiskAssessment;
|
|
121
|
+
export declare function validateActionRiskAssessment(value: unknown): RepairSafetyValidation;
|
|
122
|
+
export declare function validateRepairCommand(command: unknown): RepairSafetyValidation;
|
|
123
|
+
export declare function validateRepairPatch(patchValue: unknown): RepairSafetyValidation;
|
|
124
|
+
export declare function validateRepairAction(value: unknown): RepairSafetyValidation;
|
|
125
|
+
export declare function buildRepairAction(input: RepairActionInput): RepairAction;
|
|
126
|
+
export declare const createRepairAction: typeof buildRepairAction;
|
|
127
|
+
export declare function buildAiSuggestedRepairAction(input: RepairActionInput): RepairAction;
|
|
128
|
+
export declare function validateRepairReceiptBase(value: unknown): RepairSafetyValidation;
|
|
129
|
+
export declare function buildRepairReceiptBase(input: RepairReceiptBaseInput): RepairReceiptBase;
|
|
130
|
+
export declare function serializeRepairReceiptBase(receipt: RepairReceiptBase): string;
|