agentrinse 0.4.0 → 0.6.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 +71 -48
- package/dist/adapters/claude-cache.d.ts +3 -0
- package/dist/adapters/claude-cache.d.ts.map +1 -0
- package/dist/adapters/claude-cache.js +67 -0
- package/dist/adapters/claude-cache.js.map +1 -0
- package/dist/adapters/claude-debug.d.ts +3 -0
- package/dist/adapters/claude-debug.d.ts.map +1 -0
- package/dist/adapters/claude-debug.js +100 -0
- package/dist/adapters/claude-debug.js.map +1 -0
- package/dist/adapters/claude-retention.d.ts +36 -0
- package/dist/adapters/claude-retention.d.ts.map +1 -0
- package/dist/adapters/claude-retention.js +176 -0
- package/dist/adapters/claude-retention.js.map +1 -0
- package/dist/adapters/copilot-maintenance.d.ts +23 -0
- package/dist/adapters/copilot-maintenance.d.ts.map +1 -0
- package/dist/adapters/copilot-maintenance.js +53 -0
- package/dist/adapters/copilot-maintenance.js.map +1 -0
- package/dist/adapters/cursor-maintenance.d.ts +54 -0
- package/dist/adapters/cursor-maintenance.d.ts.map +1 -0
- package/dist/adapters/cursor-maintenance.js +138 -0
- package/dist/adapters/cursor-maintenance.js.map +1 -0
- package/dist/adapters/docker/adapter.d.ts +13 -4
- package/dist/adapters/docker/adapter.d.ts.map +1 -1
- package/dist/adapters/docker/adapter.js +254 -45
- package/dist/adapters/docker/adapter.js.map +1 -1
- package/dist/adapters/docker/owner.d.ts +70 -0
- package/dist/adapters/docker/owner.d.ts.map +1 -0
- package/dist/adapters/docker/owner.js +359 -0
- package/dist/adapters/docker/owner.js.map +1 -0
- package/dist/adapters/grok-maintenance.d.ts +67 -0
- package/dist/adapters/grok-maintenance.d.ts.map +1 -0
- package/dist/adapters/grok-maintenance.js +193 -0
- package/dist/adapters/grok-maintenance.js.map +1 -0
- package/dist/adapters/opencode-maintenance.d.ts +23 -0
- package/dist/adapters/opencode-maintenance.d.ts.map +1 -0
- package/dist/adapters/opencode-maintenance.js +53 -0
- package/dist/adapters/opencode-maintenance.js.map +1 -0
- package/dist/adapters/provider-adapter.d.ts +3 -0
- package/dist/adapters/provider-adapter.d.ts.map +1 -1
- package/dist/adapters/provider-adapter.js +395 -7
- package/dist/adapters/provider-adapter.js.map +1 -1
- package/dist/adapters/provider-root.d.ts +8 -0
- package/dist/adapters/provider-root.d.ts.map +1 -0
- package/dist/adapters/provider-root.js +50 -0
- package/dist/adapters/provider-root.js.map +1 -0
- package/dist/adapters/provider-specs.d.ts.map +1 -1
- package/dist/adapters/provider-specs.js +39 -4
- package/dist/adapters/provider-specs.js.map +1 -1
- package/dist/adapters/registry.d.ts.map +1 -1
- package/dist/adapters/registry.js +7 -1
- package/dist/adapters/registry.js.map +1 -1
- package/dist/adapters/zed-logs.d.ts +8 -0
- package/dist/adapters/zed-logs.d.ts.map +1 -0
- package/dist/adapters/zed-logs.js +103 -0
- package/dist/adapters/zed-logs.js.map +1 -0
- package/dist/commands/adapters.js +1 -1
- package/dist/commands/adapters.js.map +1 -1
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +2 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/purge.d.ts +7 -1
- package/dist/commands/purge.d.ts.map +1 -1
- package/dist/commands/purge.js +23 -0
- package/dist/commands/purge.js.map +1 -1
- package/dist/commands/show.d.ts.map +1 -1
- package/dist/commands/show.js +3 -0
- package/dist/commands/show.js.map +1 -1
- package/dist/commands/undo.d.ts +4 -1
- package/dist/commands/undo.d.ts.map +1 -1
- package/dist/commands/undo.js +18 -1
- package/dist/commands/undo.js.map +1 -1
- package/dist/contracts/action.d.ts +335 -2
- package/dist/contracts/action.d.ts.map +1 -1
- package/dist/contracts/action.js +52 -1
- package/dist/contracts/action.js.map +1 -1
- package/dist/contracts/finding.d.ts +153 -2
- package/dist/contracts/finding.d.ts.map +1 -1
- package/dist/contracts/plan.d.ts +152 -2
- package/dist/contracts/plan.d.ts.map +1 -1
- package/dist/contracts/plan.js +1 -1
- package/dist/contracts/plan.js.map +1 -1
- package/dist/contracts/provider-file-quarantine.d.ts +221 -0
- package/dist/contracts/provider-file-quarantine.d.ts.map +1 -0
- package/dist/contracts/provider-file-quarantine.js +61 -0
- package/dist/contracts/provider-file-quarantine.js.map +1 -0
- package/dist/contracts/report.d.ts +153 -2
- package/dist/contracts/report.d.ts.map +1 -1
- package/dist/contracts/resource.d.ts +3 -0
- package/dist/contracts/resource.d.ts.map +1 -1
- package/dist/contracts/resource.js +1 -0
- package/dist/contracts/resource.js.map +1 -1
- package/dist/contracts/run.d.ts +94 -0
- package/dist/contracts/run.d.ts.map +1 -1
- package/dist/contracts/run.js +7 -0
- package/dist/contracts/run.js.map +1 -1
- package/dist/core/apply.d.ts +5 -1
- package/dist/core/apply.d.ts.map +1 -1
- package/dist/core/apply.js +74 -3
- package/dist/core/apply.js.map +1 -1
- package/dist/core/no-clobber-rename.d.ts +1 -0
- package/dist/core/no-clobber-rename.d.ts.map +1 -1
- package/dist/core/no-clobber-rename.js +44 -0
- package/dist/core/no-clobber-rename.js.map +1 -1
- package/dist/core/pinned-file.d.ts +37 -0
- package/dist/core/pinned-file.d.ts.map +1 -0
- package/dist/core/pinned-file.js +228 -0
- package/dist/core/pinned-file.js.map +1 -0
- package/dist/core/plan.d.ts.map +1 -1
- package/dist/core/plan.js +4 -1
- package/dist/core/plan.js.map +1 -1
- package/dist/core/process-ownership.d.ts +1 -0
- package/dist/core/process-ownership.d.ts.map +1 -1
- package/dist/core/process-ownership.js +17 -3
- package/dist/core/process-ownership.js.map +1 -1
- package/dist/core/provider-file-executor.d.ts +40 -0
- package/dist/core/provider-file-executor.d.ts.map +1 -0
- package/dist/core/provider-file-executor.js +259 -0
- package/dist/core/provider-file-executor.js.map +1 -0
- package/dist/core/provider-file-identity.d.ts +8 -0
- package/dist/core/provider-file-identity.d.ts.map +1 -0
- package/dist/core/provider-file-identity.js +113 -0
- package/dist/core/provider-file-identity.js.map +1 -0
- package/dist/core/provider-file-policy.d.ts +39 -0
- package/dist/core/provider-file-policy.d.ts.map +1 -0
- package/dist/core/provider-file-policy.js +131 -0
- package/dist/core/provider-file-policy.js.map +1 -0
- package/dist/core/provider-file-recovery.d.ts +25 -0
- package/dist/core/provider-file-recovery.d.ts.map +1 -0
- package/dist/core/provider-file-recovery.js +393 -0
- package/dist/core/provider-file-recovery.js.map +1 -0
- package/dist/core/provider-file-revalidation.d.ts +20 -0
- package/dist/core/provider-file-revalidation.d.ts.map +1 -0
- package/dist/core/provider-file-revalidation.js +60 -0
- package/dist/core/provider-file-revalidation.js.map +1 -0
- package/dist/core/provider-processes.d.ts +18 -0
- package/dist/core/provider-processes.d.ts.map +1 -0
- package/dist/core/provider-processes.js +90 -0
- package/dist/core/provider-processes.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/state/json-file.d.ts +2 -1
- package/dist/state/json-file.d.ts.map +1 -1
- package/dist/state/json-file.js +59 -2
- package/dist/state/json-file.js.map +1 -1
- package/dist/state/layout.d.ts +1 -0
- package/dist/state/layout.d.ts.map +1 -1
- package/dist/state/layout.js +1 -0
- package/dist/state/layout.js.map +1 -1
- package/dist/state/run-journal.d.ts.map +1 -1
- package/dist/state/run-journal.js +8 -2
- package/dist/state/run-journal.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schemas/audit.schema.json +786 -1
- package/schemas/plan.schema.json +785 -1
- package/schemas/provider-file-quarantine.schema.json +741 -0
- package/schemas/run.schema.json +85 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const opencodeNativeMaintenanceFactsSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
3
|
+
provider: z.ZodLiteral<"opencode">;
|
|
4
|
+
kind: z.ZodLiteral<"snapshot-gc">;
|
|
5
|
+
sourceVersion: z.ZodLiteral<"1.18.9">;
|
|
6
|
+
pruneAgeDays: z.ZodLiteral<7>;
|
|
7
|
+
startupDelayMinutes: z.ZodLiteral<1>;
|
|
8
|
+
intervalHours: z.ZodLiteral<1>;
|
|
9
|
+
snapshotsMustBeEnabled: z.ZodLiteral<true>;
|
|
10
|
+
installedSupportKnown: z.ZodLiteral<false>;
|
|
11
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
12
|
+
provider: z.ZodLiteral<"opencode">;
|
|
13
|
+
kind: z.ZodLiteral<"server-log-retention">;
|
|
14
|
+
sourceVersion: z.ZodLiteral<"1.18.9">;
|
|
15
|
+
fileName: z.ZodLiteral<"opencode.log">;
|
|
16
|
+
writeMode: z.ZodLiteral<"append">;
|
|
17
|
+
automaticRetention: z.ZodLiteral<false>;
|
|
18
|
+
desktopRetentionIsSeparate: z.ZodLiteral<true>;
|
|
19
|
+
installedSupportKnown: z.ZodLiteral<false>;
|
|
20
|
+
}, z.core.$strip>], "kind">;
|
|
21
|
+
export type OpenCodeNativeMaintenanceFacts = z.infer<typeof opencodeNativeMaintenanceFactsSchema>;
|
|
22
|
+
export declare function opencodeNativeMaintenanceFor(relativePath: string): OpenCodeNativeMaintenanceFacts | undefined;
|
|
23
|
+
//# sourceMappingURL=opencode-maintenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-maintenance.d.ts","sourceRoot":"","sources":["../../src/adapters/opencode-maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAwBxB,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;2BAG/C,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAElG,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,MAAM,GACnB,8BAA8B,GAAG,SAAS,CA0B5C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const opencodeSnapshotGcFactsSchema = z.object({
|
|
3
|
+
provider: z.literal("opencode"),
|
|
4
|
+
kind: z.literal("snapshot-gc"),
|
|
5
|
+
sourceVersion: z.literal("1.18.9"),
|
|
6
|
+
pruneAgeDays: z.literal(7),
|
|
7
|
+
startupDelayMinutes: z.literal(1),
|
|
8
|
+
intervalHours: z.literal(1),
|
|
9
|
+
snapshotsMustBeEnabled: z.literal(true),
|
|
10
|
+
installedSupportKnown: z.literal(false),
|
|
11
|
+
});
|
|
12
|
+
const opencodeServerLogFactsSchema = z.object({
|
|
13
|
+
provider: z.literal("opencode"),
|
|
14
|
+
kind: z.literal("server-log-retention"),
|
|
15
|
+
sourceVersion: z.literal("1.18.9"),
|
|
16
|
+
fileName: z.literal("opencode.log"),
|
|
17
|
+
writeMode: z.literal("append"),
|
|
18
|
+
automaticRetention: z.literal(false),
|
|
19
|
+
desktopRetentionIsSeparate: z.literal(true),
|
|
20
|
+
installedSupportKnown: z.literal(false),
|
|
21
|
+
});
|
|
22
|
+
export const opencodeNativeMaintenanceFactsSchema = z.discriminatedUnion("kind", [
|
|
23
|
+
opencodeSnapshotGcFactsSchema,
|
|
24
|
+
opencodeServerLogFactsSchema,
|
|
25
|
+
]);
|
|
26
|
+
export function opencodeNativeMaintenanceFor(relativePath) {
|
|
27
|
+
if (relativePath === "snapshot") {
|
|
28
|
+
return {
|
|
29
|
+
provider: "opencode",
|
|
30
|
+
kind: "snapshot-gc",
|
|
31
|
+
sourceVersion: "1.18.9",
|
|
32
|
+
pruneAgeDays: 7,
|
|
33
|
+
startupDelayMinutes: 1,
|
|
34
|
+
intervalHours: 1,
|
|
35
|
+
snapshotsMustBeEnabled: true,
|
|
36
|
+
installedSupportKnown: false,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
if (relativePath === "log") {
|
|
40
|
+
return {
|
|
41
|
+
provider: "opencode",
|
|
42
|
+
kind: "server-log-retention",
|
|
43
|
+
sourceVersion: "1.18.9",
|
|
44
|
+
fileName: "opencode.log",
|
|
45
|
+
writeMode: "append",
|
|
46
|
+
automaticRetention: false,
|
|
47
|
+
desktopRetentionIsSeparate: true,
|
|
48
|
+
installedSupportKnown: false,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=opencode-maintenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"opencode-maintenance.js","sourceRoot":"","sources":["../../src/adapters/opencode-maintenance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IAC9B,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAClC,YAAY,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC1B,mBAAmB,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC3B,sBAAsB,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IACvC,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,4BAA4B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,sBAAsB,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAClC,QAAQ,EAAE,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACnC,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC;IAC9B,kBAAkB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACpC,0BAA0B,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC;IAC3C,qBAAqB,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;CACxC,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,oCAAoC,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/E,6BAA6B;IAC7B,4BAA4B;CAC7B,CAAC,CAAC;AAIH,MAAM,UAAU,4BAA4B,CAC1C,YAAoB;IAEpB,IAAI,YAAY,KAAK,UAAU,EAAE,CAAC;QAChC,OAAO;YACL,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,aAAa;YACnB,aAAa,EAAE,QAAQ;YACvB,YAAY,EAAE,CAAC;YACf,mBAAmB,EAAE,CAAC;YACtB,aAAa,EAAE,CAAC;YAChB,sBAAsB,EAAE,IAAI;YAC5B,qBAAqB,EAAE,KAAK;SAC7B,CAAC;IACJ,CAAC;IACD,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;QAC3B,OAAO;YACL,QAAQ,EAAE,UAAU;YACpB,IAAI,EAAE,sBAAsB;YAC5B,aAAa,EAAE,QAAQ;YACvB,QAAQ,EAAE,cAAc;YACxB,SAAS,EAAE,QAAQ;YACnB,kBAAkB,EAAE,KAAK;YACzB,0BAA0B,EAAE,IAAI;YAChC,qBAAqB,EAAE,KAAK;SAC7B,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -4,9 +4,11 @@ import type { AdapterProbe } from "../contracts/report.js";
|
|
|
4
4
|
import type { ResourceSnapshot } from "../contracts/resource.js";
|
|
5
5
|
import type { ReachabilityIndex } from "../core/reachability.js";
|
|
6
6
|
import { type CodexDatabaseDependencies, type CodexDatabaseInspection } from "./codex-database.js";
|
|
7
|
+
import { type GrokVersionRunner } from "./grok-maintenance.js";
|
|
7
8
|
import type { ProviderSpec } from "./provider-specs.js";
|
|
8
9
|
export type ProviderAdapterOptions = {
|
|
9
10
|
root?: string;
|
|
11
|
+
environment?: NodeJS.ProcessEnv;
|
|
10
12
|
platform?: NodeJS.Platform;
|
|
11
13
|
measureBytes: boolean;
|
|
12
14
|
maxEntries: number;
|
|
@@ -15,6 +17,7 @@ export type ProviderAdapterOptions = {
|
|
|
15
17
|
allowOfflineVacuum?: boolean;
|
|
16
18
|
databaseDependencies?: CodexDatabaseDependencies;
|
|
17
19
|
inspectDatabase?: (path: string, dependencies?: CodexDatabaseDependencies) => Promise<CodexDatabaseInspection>;
|
|
20
|
+
runGrokVersion?: GrokVersionRunner;
|
|
18
21
|
};
|
|
19
22
|
export declare class ProviderAuditAdapter implements AuditAdapter {
|
|
20
23
|
private readonly spec;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/provider-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"provider-adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/provider-adapter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE5F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAUjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAKL,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAC7B,MAAM,qBAAqB,CAAC;AAkB7B,OAAO,EAGL,KAAK,iBAAiB,EACvB,MAAM,uBAAuB,CAAC;AAO/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAGxD,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC3B,YAAY,EAAE,OAAO,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,iBAAiB,CAAC;IACjC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,oBAAoB,CAAC,EAAE,yBAAyB,CAAC;IACjD,eAAe,CAAC,EAAE,CAChB,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,yBAAyB,KACrC,OAAO,CAAC,uBAAuB,CAAC,CAAC;IACtC,cAAc,CAAC,EAAE,iBAAiB,CAAC;CACpC,CAAC;AAYF,qBAAa,oBAAqB,YAAW,YAAY;IAIrD,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAJ1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IAEpB,YACmB,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,sBAAsB,EAGjD;IAED,OAAO,CAAC,IAAI;IAIN,KAAK,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAyFxD;IAEK,OAAO,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,CAAC,CA2QnF;IAEK,QAAQ,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,OAAO,CAAC,CA8ZlF;CACF"}
|
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { lstat } from "node:fs/promises";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import { databaseIdentitySchema } from "../contracts/action.js";
|
|
3
|
+
import { databaseIdentitySchema, providerFileQuarantineActionSchema, providerFileIdentitySchema, } from "../contracts/action.js";
|
|
4
4
|
import { sha256 } from "../core/digest.js";
|
|
5
5
|
import { measurePath } from "../core/measure.js";
|
|
6
|
+
import { PROVIDER_FILE_POLICIES } from "../core/provider-file-policy.js";
|
|
6
7
|
import { codexDatabaseContractMatches, inspectCodexDatabase, inspectCodexProcesses, inspectDatabaseOpenHandles, } from "./codex-database.js";
|
|
8
|
+
import { collectClaudeChangelogCache } from "./claude-cache.js";
|
|
9
|
+
import { collectClaudeDebugLogs } from "./claude-debug.js";
|
|
10
|
+
import { claudeNativeRetentionFactsSchema, inspectClaudeNativeRetention, usesClaudeNativeRetention, } from "./claude-retention.js";
|
|
11
|
+
import { copilotNativeMaintenanceFactsSchema, copilotNativeMaintenanceFor, } from "./copilot-maintenance.js";
|
|
12
|
+
import { cursorNativeMaintenanceFactsSchema, cursorNativeMaintenanceFor, inspectCursorDatabaseCompanions, inspectCursorDatabaseParents, } from "./cursor-maintenance.js";
|
|
13
|
+
import { grokOwnerContractFactsSchema, inspectGrokOwnerContract, } from "./grok-maintenance.js";
|
|
14
|
+
import { opencodeNativeMaintenanceFactsSchema, opencodeNativeMaintenanceFor, } from "./opencode-maintenance.js";
|
|
7
15
|
import { collectProviderReachability } from "./provider-reachability.js";
|
|
16
|
+
import { resolveProviderRoot } from "./provider-root.js";
|
|
17
|
+
import { collectZedRotatedLog } from "./zed-logs.js";
|
|
8
18
|
const DATABASE_RECLAIM_THRESHOLD_BYTES = 512 * 1024 * 1024;
|
|
9
19
|
const DATABASE_RECLAIM_RATIO = 0.25;
|
|
10
20
|
const DATABASE_BACKUP_TTL_MINUTES = 7 * 24 * 60;
|
|
@@ -21,11 +31,28 @@ export class ProviderAuditAdapter {
|
|
|
21
31
|
this.id = spec.id;
|
|
22
32
|
}
|
|
23
33
|
root(context) {
|
|
24
|
-
return
|
|
25
|
-
this.spec.defaultRoot(context.home, this.options.platform ?? process.platform));
|
|
34
|
+
return resolveProviderRoot(this.spec, context.home, this.options);
|
|
26
35
|
}
|
|
27
36
|
async probe(context) {
|
|
28
|
-
|
|
37
|
+
let root;
|
|
38
|
+
try {
|
|
39
|
+
root = this.root(context);
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return {
|
|
43
|
+
adapter: this.id,
|
|
44
|
+
status: "degraded",
|
|
45
|
+
detail: `${this.spec.displayName} root configuration is invalid`,
|
|
46
|
+
diagnostics: [
|
|
47
|
+
{
|
|
48
|
+
severity: "warning",
|
|
49
|
+
code: "PROVIDER_ROOT_INVALID",
|
|
50
|
+
message: error instanceof Error ? error.message : String(error),
|
|
51
|
+
adapter: this.id,
|
|
52
|
+
},
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
29
56
|
try {
|
|
30
57
|
const stats = await lstat(root);
|
|
31
58
|
if (stats.isSymbolicLink()) {
|
|
@@ -105,6 +132,17 @@ export class ProviderAuditAdapter {
|
|
|
105
132
|
detail: `${this.spec.displayName} ownership metadata could not be inspected.`,
|
|
106
133
|
});
|
|
107
134
|
}
|
|
135
|
+
if (this.spec.id === "zed" &&
|
|
136
|
+
probe.status === "absent" &&
|
|
137
|
+
this.options.inventoryResources !== false) {
|
|
138
|
+
return collectZedRotatedLog(context, {
|
|
139
|
+
...(this.options.root === undefined ? {} : { root: this.options.root }),
|
|
140
|
+
...(this.options.platform === undefined ? {} : { platform: this.options.platform }),
|
|
141
|
+
...(this.options.environment === undefined
|
|
142
|
+
? {}
|
|
143
|
+
: { environment: this.options.environment }),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
108
146
|
return { resources: [], diagnostics: [] };
|
|
109
147
|
}
|
|
110
148
|
const resources = [];
|
|
@@ -115,9 +153,53 @@ export class ProviderAuditAdapter {
|
|
|
115
153
|
if (this.options.inventoryResources === false) {
|
|
116
154
|
return { resources: [], diagnostics };
|
|
117
155
|
}
|
|
118
|
-
|
|
156
|
+
const claudeRetention = this.spec.id === "claude"
|
|
157
|
+
? await inspectClaudeNativeRetention(probe.root, this.options.platform ?? process.platform)
|
|
158
|
+
: undefined;
|
|
159
|
+
if (claudeRetention !== undefined) {
|
|
160
|
+
diagnostics.push(...claudeRetention.diagnostics);
|
|
161
|
+
}
|
|
162
|
+
const grokOwnerContract = this.spec.id === "grok"
|
|
163
|
+
? await inspectGrokOwnerContract(probe.root, this.options.environment ?? process.env, this.options.platform ?? process.platform, this.options.runGrokVersion)
|
|
164
|
+
: undefined;
|
|
165
|
+
const candidates = grokOwnerContract !== undefined && grokOwnerContract.installedVersionStatus !== "exact"
|
|
166
|
+
? [
|
|
167
|
+
{
|
|
168
|
+
relativePath: ".",
|
|
169
|
+
displayName: "Grok Build data",
|
|
170
|
+
kind: "agent-home",
|
|
171
|
+
},
|
|
172
|
+
]
|
|
173
|
+
: this.spec.resources;
|
|
174
|
+
for (const candidate of candidates) {
|
|
119
175
|
context.signal?.throwIfAborted();
|
|
120
176
|
const path = candidate.relativePath === "." ? probe.root : join(probe.root, candidate.relativePath);
|
|
177
|
+
const copilotNativeMaintenance = this.spec.id === "copilot"
|
|
178
|
+
? copilotNativeMaintenanceFor(candidate.relativePath)
|
|
179
|
+
: undefined;
|
|
180
|
+
const opencodeNativeMaintenance = this.spec.id === "opencode"
|
|
181
|
+
? opencodeNativeMaintenanceFor(candidate.relativePath)
|
|
182
|
+
: undefined;
|
|
183
|
+
const cursorNativeMaintenance = this.spec.id === "cursor" ? cursorNativeMaintenanceFor(candidate.relativePath) : undefined;
|
|
184
|
+
const canonicalKey = `${this.id}:${candidate.kind}:${resolve(path)}`;
|
|
185
|
+
const resourceId = `${this.id}:${candidate.kind}:${sha256(canonicalKey)}`;
|
|
186
|
+
if (cursorNativeMaintenance !== undefined) {
|
|
187
|
+
const parentInspection = await inspectCursorDatabaseParents(probe.root, candidate.relativePath);
|
|
188
|
+
if (parentInspection.status === "missing") {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
if (parentInspection.status === "blocked") {
|
|
192
|
+
diagnostics.push({
|
|
193
|
+
severity: "warning",
|
|
194
|
+
code: parentInspection.code === "symlink"
|
|
195
|
+
? "RESOURCE_PARENT_SYMLINK_SKIPPED"
|
|
196
|
+
: "RESOURCE_PARENT_INSPECTION_FAILED",
|
|
197
|
+
message: parentInspection.reason,
|
|
198
|
+
adapter: this.id,
|
|
199
|
+
});
|
|
200
|
+
continue;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
121
203
|
try {
|
|
122
204
|
const stats = await lstat(path);
|
|
123
205
|
if (stats.isSymbolicLink()) {
|
|
@@ -147,8 +229,9 @@ export class ProviderAuditAdapter {
|
|
|
147
229
|
const ownerProcesses = databaseInspection === undefined
|
|
148
230
|
? undefined
|
|
149
231
|
: await inspectCodexProcesses(this.options.databaseDependencies);
|
|
150
|
-
const
|
|
151
|
-
|
|
232
|
+
const cursorDatabaseCompanions = cursorNativeMaintenance === undefined
|
|
233
|
+
? undefined
|
|
234
|
+
: await inspectCursorDatabaseCompanions(path, this.options.measureBytes);
|
|
152
235
|
resources.push({
|
|
153
236
|
resource: {
|
|
154
237
|
id: resourceId,
|
|
@@ -170,6 +253,22 @@ export class ProviderAuditAdapter {
|
|
|
170
253
|
entries: measurement?.entries,
|
|
171
254
|
symlinksSkipped: measurement?.symlinksSkipped,
|
|
172
255
|
measurementTruncated: measurement?.truncated,
|
|
256
|
+
...(claudeRetention !== undefined && usesClaudeNativeRetention(candidate.relativePath)
|
|
257
|
+
? { nativeRetention: claudeRetention.facts }
|
|
258
|
+
: {}),
|
|
259
|
+
...(copilotNativeMaintenance === undefined
|
|
260
|
+
? {}
|
|
261
|
+
: { nativeMaintenance: copilotNativeMaintenance }),
|
|
262
|
+
...(opencodeNativeMaintenance === undefined
|
|
263
|
+
? {}
|
|
264
|
+
: { nativeMaintenance: opencodeNativeMaintenance }),
|
|
265
|
+
...(cursorNativeMaintenance === undefined
|
|
266
|
+
? {}
|
|
267
|
+
: {
|
|
268
|
+
nativeMaintenance: cursorNativeMaintenance,
|
|
269
|
+
databaseCompanions: cursorDatabaseCompanions,
|
|
270
|
+
}),
|
|
271
|
+
...(grokOwnerContract === undefined ? {} : { ownerContract: grokOwnerContract }),
|
|
173
272
|
...(databaseInspection === undefined
|
|
174
273
|
? {}
|
|
175
274
|
: {
|
|
@@ -190,6 +289,29 @@ export class ProviderAuditAdapter {
|
|
|
190
289
|
}
|
|
191
290
|
catch (error) {
|
|
192
291
|
if (isMissing(error)) {
|
|
292
|
+
if (cursorNativeMaintenance !== undefined) {
|
|
293
|
+
const cursorDatabaseCompanions = await inspectCursorDatabaseCompanions(path, this.options.measureBytes);
|
|
294
|
+
if (cursorDatabaseCompanions.some((companion) => companion.status !== "missing")) {
|
|
295
|
+
resources.push({
|
|
296
|
+
resource: {
|
|
297
|
+
id: resourceId,
|
|
298
|
+
adapter: this.id,
|
|
299
|
+
kind: candidate.kind,
|
|
300
|
+
canonicalKey,
|
|
301
|
+
displayName: candidate.displayName,
|
|
302
|
+
path: resolve(path),
|
|
303
|
+
},
|
|
304
|
+
observedAt: context.now.toISOString(),
|
|
305
|
+
exists: false,
|
|
306
|
+
facts: {
|
|
307
|
+
reportOnly: true,
|
|
308
|
+
primaryDatabaseStatus: "missing",
|
|
309
|
+
nativeMaintenance: cursorNativeMaintenance,
|
|
310
|
+
databaseCompanions: cursorDatabaseCompanions,
|
|
311
|
+
},
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
}
|
|
193
315
|
continue;
|
|
194
316
|
}
|
|
195
317
|
diagnostics.push({
|
|
@@ -200,10 +322,95 @@ export class ProviderAuditAdapter {
|
|
|
200
322
|
});
|
|
201
323
|
}
|
|
202
324
|
}
|
|
325
|
+
if (this.spec.id === "claude") {
|
|
326
|
+
const debugLogs = await collectClaudeDebugLogs(context, probe.root, this.options.maxEntries);
|
|
327
|
+
const changelogCache = await collectClaudeChangelogCache(context, probe.root);
|
|
328
|
+
resources.push(...debugLogs.resources);
|
|
329
|
+
resources.push(...changelogCache.resources);
|
|
330
|
+
diagnostics.push(...debugLogs.diagnostics);
|
|
331
|
+
diagnostics.push(...changelogCache.diagnostics);
|
|
332
|
+
}
|
|
333
|
+
if (this.spec.id === "zed") {
|
|
334
|
+
const rotatedLog = await collectZedRotatedLog(context, {
|
|
335
|
+
...(this.options.root === undefined ? {} : { root: this.options.root }),
|
|
336
|
+
...(this.options.platform === undefined ? {} : { platform: this.options.platform }),
|
|
337
|
+
...(this.options.environment === undefined
|
|
338
|
+
? {}
|
|
339
|
+
: { environment: this.options.environment }),
|
|
340
|
+
});
|
|
341
|
+
resources.push(...rotatedLog.resources);
|
|
342
|
+
diagnostics.push(...rotatedLog.diagnostics);
|
|
343
|
+
}
|
|
203
344
|
return { resources, diagnostics };
|
|
204
345
|
}
|
|
205
346
|
async classify(context, resource) {
|
|
206
347
|
const observedAt = context.now.toISOString();
|
|
348
|
+
const providerFileIdentity = providerFileIdentitySchema.safeParse(resource.facts.providerFileIdentity);
|
|
349
|
+
const claudeNativeRetention = claudeNativeRetentionFactsSchema.safeParse(resource.facts.nativeRetention);
|
|
350
|
+
const copilotNativeMaintenance = copilotNativeMaintenanceFactsSchema.safeParse(resource.facts.nativeMaintenance);
|
|
351
|
+
const opencodeNativeMaintenance = opencodeNativeMaintenanceFactsSchema.safeParse(resource.facts.nativeMaintenance);
|
|
352
|
+
const cursorNativeMaintenance = cursorNativeMaintenanceFactsSchema.safeParse(resource.facts.nativeMaintenance);
|
|
353
|
+
const grokOwnerContract = grokOwnerContractFactsSchema.safeParse(resource.facts.ownerContract);
|
|
354
|
+
const providerFilePolicy = typeof resource.facts.policyId === "string"
|
|
355
|
+
? PROVIDER_FILE_POLICIES.find((policy) => policy.id === resource.facts.policyId &&
|
|
356
|
+
providerFileIdentity.success &&
|
|
357
|
+
policy.matchesRelativePath(providerFileIdentity.data.relativePath))
|
|
358
|
+
: undefined;
|
|
359
|
+
if (providerFileIdentity.success &&
|
|
360
|
+
providerFileIdentity.data.provider === this.spec.id &&
|
|
361
|
+
providerFilePolicy?.provider === this.spec.id) {
|
|
362
|
+
const identity = providerFileIdentity.data;
|
|
363
|
+
const oldEnough = context.now.getTime() - identity.mtimeMs >= providerFilePolicy.minAgeMinutes * 60_000;
|
|
364
|
+
const candidateActions = oldEnough
|
|
365
|
+
? [
|
|
366
|
+
providerFileQuarantineActionSchema.parse({
|
|
367
|
+
actionId: `provider.file-quarantine:${sha256(`${providerFilePolicy.id}:${identity.fingerprint}`)}`,
|
|
368
|
+
type: "provider.file-quarantine",
|
|
369
|
+
adapter: providerFilePolicy.provider,
|
|
370
|
+
resourceId: resource.resource.id,
|
|
371
|
+
policyId: providerFilePolicy.id,
|
|
372
|
+
risk: "recoverable",
|
|
373
|
+
description: providerFilePolicy.description,
|
|
374
|
+
expectedReclaimBytes: 0,
|
|
375
|
+
pendingQuarantineBytes: identity.measuredBytes,
|
|
376
|
+
quarantineTtlMinutes: providerFilePolicy.quarantineTtlMinutes,
|
|
377
|
+
target: identity,
|
|
378
|
+
}),
|
|
379
|
+
]
|
|
380
|
+
: [];
|
|
381
|
+
return {
|
|
382
|
+
schemaVersion: 1,
|
|
383
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
384
|
+
auditId: context.auditId,
|
|
385
|
+
observedAt,
|
|
386
|
+
resource: resource.resource,
|
|
387
|
+
state: oldEnough ? "eligible" : "protected",
|
|
388
|
+
confidence: "certain",
|
|
389
|
+
roots: [
|
|
390
|
+
{
|
|
391
|
+
code: providerFilePolicy.rootCode,
|
|
392
|
+
source: this.id,
|
|
393
|
+
observedAt,
|
|
394
|
+
detail: providerFilePolicy.rootDetail,
|
|
395
|
+
},
|
|
396
|
+
...(oldEnough
|
|
397
|
+
? []
|
|
398
|
+
: [
|
|
399
|
+
{
|
|
400
|
+
code: "provider-file-too-recent",
|
|
401
|
+
source: this.id,
|
|
402
|
+
observedAt,
|
|
403
|
+
detail: providerFilePolicy.tooRecentDetail,
|
|
404
|
+
},
|
|
405
|
+
]),
|
|
406
|
+
],
|
|
407
|
+
facts: resource.facts,
|
|
408
|
+
candidateActions,
|
|
409
|
+
measuredBytes: identity.measuredBytes,
|
|
410
|
+
estimatedReclaimBytes: 0,
|
|
411
|
+
warnings: [],
|
|
412
|
+
};
|
|
413
|
+
}
|
|
207
414
|
const databaseIdentity = databaseIdentitySchema.safeParse(resource.facts.databaseIdentity);
|
|
208
415
|
if (this.spec.id === "codex" && databaseIdentity.success) {
|
|
209
416
|
const estimatedReclaimBytes = typeof resource.facts.estimatedReclaimBytes === "number"
|
|
@@ -309,6 +516,187 @@ export class ProviderAuditAdapter {
|
|
|
309
516
|
warnings: [],
|
|
310
517
|
};
|
|
311
518
|
}
|
|
519
|
+
if (this.spec.id === "claude" && claudeNativeRetention.success) {
|
|
520
|
+
const uncertain = !["missing", "valid"].includes(claudeNativeRetention.data.userSettingsStatus);
|
|
521
|
+
const configuredDays = claudeNativeRetention.data.userConfiguredDays;
|
|
522
|
+
return {
|
|
523
|
+
schemaVersion: 1,
|
|
524
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
525
|
+
auditId: context.auditId,
|
|
526
|
+
observedAt,
|
|
527
|
+
resource: resource.resource,
|
|
528
|
+
state: "protected",
|
|
529
|
+
confidence: uncertain ? "unknown" : "high",
|
|
530
|
+
roots: [
|
|
531
|
+
{
|
|
532
|
+
code: uncertain
|
|
533
|
+
? "claude-native-retention-uncertain"
|
|
534
|
+
: "claude-native-retention-expected",
|
|
535
|
+
source: this.id,
|
|
536
|
+
observedAt,
|
|
537
|
+
detail: uncertain
|
|
538
|
+
? "Claude user settings could not be validated; Claude may pause native cleanup unless managed settings provide cleanupPeriodDays."
|
|
539
|
+
: configuredDays === undefined
|
|
540
|
+
? "Claude documents a 30-day startup retention sweep; higher-precedence settings were not resolved."
|
|
541
|
+
: `Claude user settings declare a ${configuredDays}-day startup retention sweep; higher-precedence settings were not resolved.`,
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
code: "provider-owned-report-only",
|
|
545
|
+
source: this.id,
|
|
546
|
+
observedAt,
|
|
547
|
+
detail: "Claude owns this retention sweep; AgentRinse does not mutate the resource.",
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
facts: resource.facts,
|
|
551
|
+
candidateActions: [],
|
|
552
|
+
...(resource.measuredBytes === undefined ? {} : { measuredBytes: resource.measuredBytes }),
|
|
553
|
+
warnings: [],
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
if (this.spec.id === "copilot" && copilotNativeMaintenance.success) {
|
|
557
|
+
const detail = copilotNativeMaintenance.data.kind === "session-prune"
|
|
558
|
+
? "Current Copilot CLI documents local-only session pruning with dry-run support; AgentRinse did not probe the installed CLI version."
|
|
559
|
+
: "Copilot CLI 1.0.52 introduced startup pruning for direct process logs older than seven days or beyond the newest 50; AgentRinse did not probe the installed CLI version.";
|
|
560
|
+
return {
|
|
561
|
+
schemaVersion: 1,
|
|
562
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
563
|
+
auditId: context.auditId,
|
|
564
|
+
observedAt,
|
|
565
|
+
resource: resource.resource,
|
|
566
|
+
state: "protected",
|
|
567
|
+
confidence: "unknown",
|
|
568
|
+
roots: [
|
|
569
|
+
{
|
|
570
|
+
code: "copilot-native-maintenance-version-unverified",
|
|
571
|
+
source: this.id,
|
|
572
|
+
observedAt,
|
|
573
|
+
detail,
|
|
574
|
+
},
|
|
575
|
+
{
|
|
576
|
+
code: "provider-owned-report-only",
|
|
577
|
+
source: this.id,
|
|
578
|
+
observedAt,
|
|
579
|
+
detail: "Copilot owns this maintenance path; AgentRinse does not mutate the resource.",
|
|
580
|
+
},
|
|
581
|
+
],
|
|
582
|
+
facts: resource.facts,
|
|
583
|
+
candidateActions: [],
|
|
584
|
+
...(resource.measuredBytes === undefined ? {} : { measuredBytes: resource.measuredBytes }),
|
|
585
|
+
warnings: [],
|
|
586
|
+
};
|
|
587
|
+
}
|
|
588
|
+
if (this.spec.id === "opencode" && opencodeNativeMaintenance.success) {
|
|
589
|
+
const detail = opencodeNativeMaintenance.data.kind === "snapshot-gc"
|
|
590
|
+
? "OpenCode 1.18.9 schedules snapshot Git garbage collection after one minute and hourly, pruning objects older than seven days; AgentRinse did not probe the installed version."
|
|
591
|
+
: "OpenCode 1.18.9 appends server logs to opencode.log without a server-log retention sweep; the desktop application's separate seven-day log cleanup does not cover this directory.";
|
|
592
|
+
return {
|
|
593
|
+
schemaVersion: 1,
|
|
594
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
595
|
+
auditId: context.auditId,
|
|
596
|
+
observedAt,
|
|
597
|
+
resource: resource.resource,
|
|
598
|
+
state: "protected",
|
|
599
|
+
confidence: "unknown",
|
|
600
|
+
roots: [
|
|
601
|
+
{
|
|
602
|
+
code: opencodeNativeMaintenance.data.kind === "snapshot-gc"
|
|
603
|
+
? "opencode-native-snapshot-gc-version-unverified"
|
|
604
|
+
: "opencode-server-log-retention-version-unverified",
|
|
605
|
+
source: this.id,
|
|
606
|
+
observedAt,
|
|
607
|
+
detail,
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
code: "provider-owned-report-only",
|
|
611
|
+
source: this.id,
|
|
612
|
+
observedAt,
|
|
613
|
+
detail: "OpenCode owns this maintenance path; AgentRinse does not mutate the resource.",
|
|
614
|
+
},
|
|
615
|
+
],
|
|
616
|
+
facts: resource.facts,
|
|
617
|
+
candidateActions: [],
|
|
618
|
+
...(resource.measuredBytes === undefined ? {} : { measuredBytes: resource.measuredBytes }),
|
|
619
|
+
warnings: [],
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
if (this.spec.id === "cursor" && cursorNativeMaintenance.success) {
|
|
623
|
+
return {
|
|
624
|
+
schemaVersion: 1,
|
|
625
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
626
|
+
auditId: context.auditId,
|
|
627
|
+
observedAt,
|
|
628
|
+
resource: resource.resource,
|
|
629
|
+
state: "protected",
|
|
630
|
+
confidence: "unknown",
|
|
631
|
+
roots: [
|
|
632
|
+
{
|
|
633
|
+
code: "cursor-native-database-maintenance-version-unverified",
|
|
634
|
+
source: this.id,
|
|
635
|
+
observedAt,
|
|
636
|
+
detail: "Current Cursor guidance exposes command-palette operations for orphaned agent KV cleanup or user-selected chat deletion, both followed by VACUUM; AgentRinse did not prove the installed Cursor version.",
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
code: "provider-owned-report-only",
|
|
640
|
+
source: this.id,
|
|
641
|
+
observedAt,
|
|
642
|
+
detail: "Cursor owns its database schema and maintenance commands; AgentRinse does not open or mutate the database.",
|
|
643
|
+
},
|
|
644
|
+
],
|
|
645
|
+
facts: resource.facts,
|
|
646
|
+
candidateActions: [],
|
|
647
|
+
...(resource.measuredBytes === undefined ? {} : { measuredBytes: resource.measuredBytes }),
|
|
648
|
+
warnings: [],
|
|
649
|
+
};
|
|
650
|
+
}
|
|
651
|
+
if (this.spec.id === "grok" && grokOwnerContract.success) {
|
|
652
|
+
const versionStatus = grokOwnerContract.data.installedVersionStatus;
|
|
653
|
+
const executableStatus = grokOwnerContract.data.ownerExecutableStatus;
|
|
654
|
+
const exact = versionStatus === "exact";
|
|
655
|
+
const detail = exact
|
|
656
|
+
? "The installed Grok version and build revision match the inspected source snapshot. Grok runs its memory GC during session initialization, but exposes no tagged, user-invokable cleanup contract that AgentRinse can bind and revalidate."
|
|
657
|
+
: versionStatus === "version-mismatch"
|
|
658
|
+
? `Installed Grok ${grokOwnerContract.data.installedVersion} does not match inspected source version ${grokOwnerContract.data.sourceVersion}; only the owner root was inventoried.`
|
|
659
|
+
: versionStatus === "revision-mismatch"
|
|
660
|
+
? `Installed Grok build revision ${grokOwnerContract.data.installedRevision} does not match the inspected source revisions; only the owner root was inventoried.`
|
|
661
|
+
: versionStatus === "unparseable"
|
|
662
|
+
? "The installed Grok version output did not match the documented format; only the owner root was inventoried."
|
|
663
|
+
: executableStatus === "unsafe"
|
|
664
|
+
? "The canonical Grok executable escapes or does not resolve to a file inside the audited owner root; only the owner root was inventoried."
|
|
665
|
+
: executableStatus === "unexecutable"
|
|
666
|
+
? "The canonical Grok executable is not executable; only the owner root was inventoried."
|
|
667
|
+
: executableStatus === "unreadable"
|
|
668
|
+
? "The canonical Grok executable could not be inspected; only the owner root was inventoried."
|
|
669
|
+
: executableStatus === "missing"
|
|
670
|
+
? "The audited owner root has no canonical Grok executable; only the owner root was inventoried."
|
|
671
|
+
: "The bound Grok executable version could not be inspected; only the owner root was inventoried.";
|
|
672
|
+
return {
|
|
673
|
+
schemaVersion: 1,
|
|
674
|
+
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|
|
675
|
+
auditId: context.auditId,
|
|
676
|
+
observedAt,
|
|
677
|
+
resource: resource.resource,
|
|
678
|
+
state: "protected",
|
|
679
|
+
confidence: exact ? "high" : "unknown",
|
|
680
|
+
roots: [
|
|
681
|
+
{
|
|
682
|
+
code: "grok-cleanup-owner-contract-unavailable",
|
|
683
|
+
source: this.id,
|
|
684
|
+
observedAt,
|
|
685
|
+
detail,
|
|
686
|
+
},
|
|
687
|
+
{
|
|
688
|
+
code: "provider-owned-report-only",
|
|
689
|
+
source: this.id,
|
|
690
|
+
observedAt,
|
|
691
|
+
detail: "Grok owns sessions, memory, logs, worktrees, plugins, credentials, configuration, and runtime assets; AgentRinse does not mutate them.",
|
|
692
|
+
},
|
|
693
|
+
],
|
|
694
|
+
facts: resource.facts,
|
|
695
|
+
candidateActions: [],
|
|
696
|
+
...(resource.measuredBytes === undefined ? {} : { measuredBytes: resource.measuredBytes }),
|
|
697
|
+
warnings: [],
|
|
698
|
+
};
|
|
699
|
+
}
|
|
312
700
|
return {
|
|
313
701
|
schemaVersion: 1,
|
|
314
702
|
findingId: `${resource.resource.id}:${sha256(context.auditId)}`,
|