clinkx 1.4.0 → 1.4.2
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/CHANGELOG.md +35 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/{index-DSOtuS0p.js → index-CX4FrhYN.js} +1 -1
- package/clinkx-workflows/dist/dashboard-ui/index.html +1 -1
- package/clinkx-workflows/dist/settings/registry.js +5 -0
- package/clinkx-workflows/dist/settings/registry.js.map +1 -1
- package/dist/dashboard-cli.d.ts +11 -3
- package/dist/dashboard-cli.js +149 -32
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-companion/client.d.ts +14 -0
- package/dist/dashboard-companion/client.js +16 -0
- package/dist/dashboard-companion/client.js.map +1 -1
- package/dist/dashboard-companion/credential-expectation.d.ts +23 -0
- package/dist/dashboard-companion/credential-expectation.js +50 -0
- package/dist/dashboard-companion/credential-expectation.js.map +1 -0
- package/dist/dashboard-companion/host-channel.d.ts +36 -0
- package/dist/dashboard-companion/host-channel.js +78 -0
- package/dist/dashboard-companion/host-channel.js.map +1 -0
- package/dist/dashboard-companion/host-status.d.ts +179 -0
- package/dist/dashboard-companion/host-status.js +122 -0
- package/dist/dashboard-companion/host-status.js.map +1 -0
- package/dist/dashboard-companion/standalone-assets.d.ts +8 -0
- package/dist/dashboard-companion/standalone-assets.js +7 -1
- package/dist/dashboard-companion/standalone-assets.js.map +1 -1
- package/dist/dashboard-companion/standalone-entry.js +34 -13
- package/dist/dashboard-companion/standalone-entry.js.map +1 -1
- package/dist/desktop-host/child-env.d.ts +23 -0
- package/dist/desktop-host/child-env.js +70 -0
- package/dist/desktop-host/child-env.js.map +1 -0
- package/dist/desktop-host/daemon-entry.d.ts +2 -0
- package/dist/desktop-host/daemon-entry.js +50 -0
- package/dist/desktop-host/daemon-entry.js.map +1 -0
- package/dist/desktop-host/daemon-env.d.ts +12 -0
- package/dist/desktop-host/daemon-env.js +35 -0
- package/dist/desktop-host/daemon-env.js.map +1 -0
- package/dist/desktop-host/daemon-protocol.d.ts +210 -0
- package/dist/desktop-host/daemon-protocol.js +56 -0
- package/dist/desktop-host/daemon-protocol.js.map +1 -0
- package/dist/desktop-host/daemon.d.ts +50 -0
- package/dist/desktop-host/daemon.js +441 -0
- package/dist/desktop-host/daemon.js.map +1 -0
- package/dist/desktop-host/enrollment.d.ts +17 -0
- package/dist/desktop-host/enrollment.js +25 -0
- package/dist/desktop-host/enrollment.js.map +1 -0
- package/dist/desktop-host/import.d.ts +14 -0
- package/dist/desktop-host/import.js +95 -0
- package/dist/desktop-host/import.js.map +1 -0
- package/dist/desktop-host/profile.d.ts +130 -0
- package/dist/desktop-host/profile.js +176 -0
- package/dist/desktop-host/profile.js.map +1 -0
- package/dist/desktop-host/service.d.ts +6 -0
- package/dist/desktop-host/service.js +7 -0
- package/dist/desktop-host/service.js.map +1 -0
- package/dist/desktop-host/supervisor.d.ts +57 -0
- package/dist/desktop-host/supervisor.js +256 -0
- package/dist/desktop-host/supervisor.js.map +1 -0
- package/dist/desktop-host/view-state.d.ts +138 -0
- package/dist/desktop-host/view-state.js +27 -0
- package/dist/desktop-host/view-state.js.map +1 -0
- package/dist/registry.d.ts +7 -0
- package/dist/registry.js +21 -7
- package/dist/registry.js.map +1 -1
- package/docs/verification/README.md +28 -2
- package/docs/verification/workflow-handoff.md +86 -0
- package/package.json +2 -2
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import type { CompanionFailure, CompanionPhase } from "./supervisor.js";
|
|
3
|
+
import type { HostGatewayState, HostSettingsState } from "../dashboard-companion/host-status.js";
|
|
4
|
+
/**
|
|
5
|
+
* Everything the launcher window shows, exchanged between the host daemon
|
|
6
|
+
* (inside the companion executable) and any shell. Secrets never cross: only
|
|
7
|
+
* the transient enrollment code does. Shared by the daemon, the Tauri bridge,
|
|
8
|
+
* and the renderer, so the shape is defined once here.
|
|
9
|
+
*/
|
|
10
|
+
export interface DesktopServiceView {
|
|
11
|
+
readonly origin: string;
|
|
12
|
+
readonly gatewayUrl: string;
|
|
13
|
+
readonly mode: "tenant" | "legacy";
|
|
14
|
+
/** False for the hosted service built into this build. */
|
|
15
|
+
readonly selfHosted: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface DesktopRoots {
|
|
18
|
+
readonly state: string;
|
|
19
|
+
readonly contextRuns: string;
|
|
20
|
+
readonly workspace: string;
|
|
21
|
+
readonly settings: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DesktopLifecycle {
|
|
24
|
+
readonly keepRunningInBackground: boolean;
|
|
25
|
+
readonly startAtLogin: boolean;
|
|
26
|
+
}
|
|
27
|
+
export type RecoveryAction = "new-enrollment" | "reset-binding";
|
|
28
|
+
export interface DesktopViewState {
|
|
29
|
+
readonly platform: NodeJS.Platform;
|
|
30
|
+
readonly setup: "required" | "complete";
|
|
31
|
+
readonly vault: "available" | "unavailable";
|
|
32
|
+
readonly keyStored: boolean;
|
|
33
|
+
readonly service: DesktopServiceView;
|
|
34
|
+
readonly roots: DesktopRoots;
|
|
35
|
+
readonly lifecycle: DesktopLifecycle;
|
|
36
|
+
readonly enrolled: boolean;
|
|
37
|
+
readonly companion: {
|
|
38
|
+
readonly phase: CompanionPhase;
|
|
39
|
+
readonly settings?: HostSettingsState;
|
|
40
|
+
readonly gateway?: HostGatewayState;
|
|
41
|
+
readonly rejectedStatus?: number;
|
|
42
|
+
readonly enrollmentCode?: string;
|
|
43
|
+
readonly failure?: CompanionFailure;
|
|
44
|
+
};
|
|
45
|
+
readonly recovery?: RecoveryAction;
|
|
46
|
+
readonly notice?: {
|
|
47
|
+
readonly kind: "error" | "info";
|
|
48
|
+
readonly message: string;
|
|
49
|
+
};
|
|
50
|
+
readonly busy: boolean;
|
|
51
|
+
}
|
|
52
|
+
export declare const SetupInputSchema: z.ZodObject<{
|
|
53
|
+
workstationKey: z.ZodOptional<z.ZodString>;
|
|
54
|
+
roots: z.ZodObject<{
|
|
55
|
+
state: z.ZodString;
|
|
56
|
+
contextRuns: z.ZodString;
|
|
57
|
+
workspace: z.ZodString;
|
|
58
|
+
settings: z.ZodString;
|
|
59
|
+
}, "strict", z.ZodTypeAny, {
|
|
60
|
+
state: string;
|
|
61
|
+
settings: string;
|
|
62
|
+
contextRuns: string;
|
|
63
|
+
workspace: string;
|
|
64
|
+
}, {
|
|
65
|
+
state: string;
|
|
66
|
+
settings: string;
|
|
67
|
+
contextRuns: string;
|
|
68
|
+
workspace: string;
|
|
69
|
+
}>;
|
|
70
|
+
lifecycle: z.ZodObject<{
|
|
71
|
+
keepRunningInBackground: z.ZodBoolean;
|
|
72
|
+
startAtLogin: z.ZodBoolean;
|
|
73
|
+
}, "strict", z.ZodTypeAny, {
|
|
74
|
+
keepRunningInBackground: boolean;
|
|
75
|
+
startAtLogin: boolean;
|
|
76
|
+
}, {
|
|
77
|
+
keepRunningInBackground: boolean;
|
|
78
|
+
startAtLogin: boolean;
|
|
79
|
+
}>;
|
|
80
|
+
service: z.ZodOptional<z.ZodObject<{
|
|
81
|
+
origin: z.ZodString;
|
|
82
|
+
gatewayUrl: z.ZodString;
|
|
83
|
+
mode: z.ZodEnum<["tenant", "legacy"]>;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
mode: "legacy" | "tenant";
|
|
86
|
+
origin: string;
|
|
87
|
+
gatewayUrl: string;
|
|
88
|
+
}, {
|
|
89
|
+
mode: "legacy" | "tenant";
|
|
90
|
+
origin: string;
|
|
91
|
+
gatewayUrl: string;
|
|
92
|
+
}>>;
|
|
93
|
+
createMissingFolders: z.ZodBoolean;
|
|
94
|
+
importFrom: z.ZodOptional<z.ZodString>;
|
|
95
|
+
}, "strict", z.ZodTypeAny, {
|
|
96
|
+
roots: {
|
|
97
|
+
state: string;
|
|
98
|
+
settings: string;
|
|
99
|
+
contextRuns: string;
|
|
100
|
+
workspace: string;
|
|
101
|
+
};
|
|
102
|
+
lifecycle: {
|
|
103
|
+
keepRunningInBackground: boolean;
|
|
104
|
+
startAtLogin: boolean;
|
|
105
|
+
};
|
|
106
|
+
createMissingFolders: boolean;
|
|
107
|
+
service?: {
|
|
108
|
+
mode: "legacy" | "tenant";
|
|
109
|
+
origin: string;
|
|
110
|
+
gatewayUrl: string;
|
|
111
|
+
} | undefined;
|
|
112
|
+
workstationKey?: string | undefined;
|
|
113
|
+
importFrom?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
roots: {
|
|
116
|
+
state: string;
|
|
117
|
+
settings: string;
|
|
118
|
+
contextRuns: string;
|
|
119
|
+
workspace: string;
|
|
120
|
+
};
|
|
121
|
+
lifecycle: {
|
|
122
|
+
keepRunningInBackground: boolean;
|
|
123
|
+
startAtLogin: boolean;
|
|
124
|
+
};
|
|
125
|
+
createMissingFolders: boolean;
|
|
126
|
+
service?: {
|
|
127
|
+
mode: "legacy" | "tenant";
|
|
128
|
+
origin: string;
|
|
129
|
+
gatewayUrl: string;
|
|
130
|
+
} | undefined;
|
|
131
|
+
workstationKey?: string | undefined;
|
|
132
|
+
importFrom?: string | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
export type SetupInput = z.infer<typeof SetupInputSchema>;
|
|
135
|
+
export type DirectoryKind = keyof DesktopRoots | "import";
|
|
136
|
+
/** Names of the launcher-window operations the daemon performs on request. */
|
|
137
|
+
export declare const DAEMON_OPS: readonly ["get-state", "save-setup", "connect", "disconnect", "recover", "diagnostics", "shutdown", "key-stored"];
|
|
138
|
+
export type DaemonOp = (typeof DAEMON_OPS)[number];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const pathString = z.string().min(1).max(4_096);
|
|
3
|
+
export const SetupInputSchema = z
|
|
4
|
+
.object({
|
|
5
|
+
workstationKey: z.string().trim().min(1).max(256).optional(),
|
|
6
|
+
roots: z.object({ state: pathString, contextRuns: pathString, workspace: pathString, settings: pathString }).strict(),
|
|
7
|
+
lifecycle: z.object({ keepRunningInBackground: z.boolean(), startAtLogin: z.boolean() }).strict(),
|
|
8
|
+
service: z
|
|
9
|
+
.object({ origin: z.string().min(1).max(512), gatewayUrl: z.string().min(1).max(512), mode: z.enum(["tenant", "legacy"]) })
|
|
10
|
+
.strict()
|
|
11
|
+
.optional(),
|
|
12
|
+
createMissingFolders: z.boolean(),
|
|
13
|
+
importFrom: pathString.optional(),
|
|
14
|
+
})
|
|
15
|
+
.strict();
|
|
16
|
+
/** Names of the launcher-window operations the daemon performs on request. */
|
|
17
|
+
export const DAEMON_OPS = [
|
|
18
|
+
"get-state",
|
|
19
|
+
"save-setup",
|
|
20
|
+
"connect",
|
|
21
|
+
"disconnect",
|
|
22
|
+
"recover",
|
|
23
|
+
"diagnostics",
|
|
24
|
+
"shutdown",
|
|
25
|
+
"key-stored",
|
|
26
|
+
];
|
|
27
|
+
//# sourceMappingURL=view-state.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view-state.js","sourceRoot":"","sources":["../../src/desktop-host/view-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuDxB,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAEhD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACrH,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,YAAY,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;IACjG,OAAO,EAAE,CAAC;SACP,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAE,CAAC;SAC1H,MAAM,EAAE;SACR,QAAQ,EAAE;IACb,oBAAoB,EAAE,CAAC,CAAC,OAAO,EAAE;IACjC,UAAU,EAAE,UAAU,CAAC,QAAQ,EAAE;CAClC,CAAC;KACD,MAAM,EAAE,CAAC;AAMZ,8EAA8E;AAC9E,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW;IACX,YAAY;IACZ,SAAS;IACT,YAAY;IACZ,SAAS;IACT,aAAa;IACb,UAAU;IACV,YAAY;CACJ,CAAC"}
|
package/dist/registry.d.ts
CHANGED
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { type CliAdapterConfig } from "./config.js";
|
|
2
|
+
/**
|
|
3
|
+
* A packaged runtime whose modules do not sit beside the package's `conf/`
|
|
4
|
+
* (the Node SEA dashboard extracts it elsewhere) registers the shipped adapter
|
|
5
|
+
* directory here, so discovery tiers and the prompt_file fallback match an
|
|
6
|
+
* npm install. `undefined` restores the package-relative default.
|
|
7
|
+
*/
|
|
8
|
+
export declare function setBuiltinAdaptersDirectory(directory: string | undefined): void;
|
|
2
9
|
export declare class AdapterRegistry {
|
|
3
10
|
private readonly adapters;
|
|
4
11
|
private readonly configSources;
|
package/dist/registry.js
CHANGED
|
@@ -1,11 +1,28 @@
|
|
|
1
1
|
import { readFileSync, readdirSync, statSync, existsSync, } from "node:fs";
|
|
2
|
-
import { join, dirname } from "node:path";
|
|
2
|
+
import { join, dirname, isAbsolute } from "node:path";
|
|
3
3
|
import { homedir } from "node:os";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { getClinkxHome } from "../clinkx-workflows/dist/config.js";
|
|
6
6
|
import { CliAdapterConfigSchema } from "./config.js";
|
|
7
7
|
import { InvalidParamsError } from "./errors.js";
|
|
8
8
|
import { logger } from "./logger.js";
|
|
9
|
+
let builtinAdaptersDirectoryOverride;
|
|
10
|
+
/**
|
|
11
|
+
* A packaged runtime whose modules do not sit beside the package's `conf/`
|
|
12
|
+
* (the Node SEA dashboard extracts it elsewhere) registers the shipped adapter
|
|
13
|
+
* directory here, so discovery tiers and the prompt_file fallback match an
|
|
14
|
+
* npm install. `undefined` restores the package-relative default.
|
|
15
|
+
*/
|
|
16
|
+
export function setBuiltinAdaptersDirectory(directory) {
|
|
17
|
+
if (directory !== undefined && !isAbsolute(directory)) {
|
|
18
|
+
throw new Error(`built-in adapters directory must be absolute; got ${JSON.stringify(directory)}`);
|
|
19
|
+
}
|
|
20
|
+
builtinAdaptersDirectoryOverride = directory;
|
|
21
|
+
}
|
|
22
|
+
function builtinAdaptersDirectory() {
|
|
23
|
+
return builtinAdaptersDirectoryOverride
|
|
24
|
+
?? join(dirname(fileURLToPath(import.meta.url)), "..", "conf", "adapters");
|
|
25
|
+
}
|
|
9
26
|
function discoverConfigPaths() {
|
|
10
27
|
const envPath = process.env["CLINKX_CONFIG_PATH"];
|
|
11
28
|
if (envPath != null && envPath !== "") {
|
|
@@ -19,10 +36,8 @@ function discoverConfigPaths() {
|
|
|
19
36
|
const xdgHome = process.env["XDG_CONFIG_HOME"] ?? join(homedir(), ".config");
|
|
20
37
|
const xdgDir = join(xdgHome, "clinkx", "adapters");
|
|
21
38
|
paths.push(...listJsonFiles(xdgDir));
|
|
22
|
-
// Built-in: conf/adapters/*.json
|
|
23
|
-
|
|
24
|
-
const builtinDir = join(__dirname, "..", "conf", "adapters");
|
|
25
|
-
paths.push(...listJsonFiles(builtinDir));
|
|
39
|
+
// Built-in: conf/adapters/*.json shipped with this runtime
|
|
40
|
+
paths.push(...listJsonFiles(builtinAdaptersDirectory()));
|
|
26
41
|
return paths;
|
|
27
42
|
}
|
|
28
43
|
function resolveConfigPath(configPath) {
|
|
@@ -56,8 +71,7 @@ export class AdapterRegistry {
|
|
|
56
71
|
configSources = new Map();
|
|
57
72
|
builtinAdaptersDir;
|
|
58
73
|
constructor() {
|
|
59
|
-
|
|
60
|
-
this.builtinAdaptersDir = join(__dirname, "..", "conf", "adapters");
|
|
74
|
+
this.builtinAdaptersDir = builtinAdaptersDirectory();
|
|
61
75
|
}
|
|
62
76
|
/**
|
|
63
77
|
* Load adapters from config files discovered via the standard precedence:
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,UAAU,GACX,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,sBAAsB,EAAyB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAA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
|
48
|
-
Each row above maps one feature to one procedure.
|
|
49
|
-
|
|
48
|
+
Each row above maps one feature to one procedure. Declare the maintenance scope
|
|
49
|
+
before work: name the selected rows, affected entry points, and procedures.
|
|
50
|
+
Account for every feature in that scope with an observed result, a correction,
|
|
51
|
+
or a blocker. Name rows that were not inspected; a scoped result does not qualify
|
|
52
|
+
the whole map.
|
|
53
|
+
|
|
54
|
+
When a procedure stops passing, classify the cause before repairing it:
|
|
50
55
|
|
|
51
56
|
| Class | Meaning | Example | Repair in |
|
|
52
57
|
| --- | --- | --- | --- |
|
|
53
58
|
| Documentation drift | The product changed on purpose; the procedure or its selectors did not follow. | A UI redesign moved labels the spec asserted. | The procedure and spec. Keep the assertion's intent; record any check that can no longer be observed. |
|
|
54
59
|
| Harness defect | The fixture, config, or runner misreports the result. | A fixture that treats an unsolicited exit as a clean shutdown; a runner that kills the fixture before its cleanup. | The fixture or config, with a subprocess test or a repeated procedure run that fails without the repair. |
|
|
55
60
|
| Product regression | The feature itself no longer behaves as intended. | The inspector stops refreshing after a state replacement. | The product code, not the procedure. |
|
|
61
|
+
| Environment or access blocker | A required host capability, file, permission, or evidence location is unavailable. | Chromium is missing, or the MCP host's project or private evidence parent is outside authorized roots. | Restore the authorized prerequisite or report the operation blocked. Keep the behavioral assertions. |
|
|
62
|
+
|
|
63
|
+
Paths for installed checks belong to the MCP host. A client without host shell
|
|
64
|
+
access can still invoke a reviewed manifest that already exists there through
|
|
65
|
+
`verification_run`, using its known authorized host paths. If the host manifest
|
|
66
|
+
is missing and no authorized channel can create it, preparation is blocked;
|
|
67
|
+
do not invent a path or start execution. Unavailable access does not authorize
|
|
68
|
+
broader allowed roots or a substitute procedure with different coverage.
|
|
56
69
|
|
|
57
70
|
After any repair, repeat the affected procedure and keep the new attempt's
|
|
58
71
|
evidence. Do not weaken an assertion to make drift pass. Add a row here when a
|
|
59
72
|
new procedure is added, and remove a row only when its feature is removed.
|
|
73
|
+
|
|
74
|
+
Report one maintenance outcome for the declared scope:
|
|
75
|
+
|
|
76
|
+
| Outcome | Required evidence |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `clean` | Every selected feature was inspected, its required procedure passed with applicable evidence, and no correction was needed. |
|
|
79
|
+
| `changed` | A scoped correction was made, every affected procedure was rerun successfully, and the new evidence and changed files are identified. |
|
|
80
|
+
| `blocked` | A selected feature has an unresolved regression, unavailable prerequisite or access, missing evidence, or a required check that was not run or did not pass. Name the affected feature and the next required action. |
|
|
81
|
+
|
|
82
|
+
Any unresolved blocker makes the scoped outcome `blocked`, even when other
|
|
83
|
+
features passed or files changed. Preserve the underlying execution and coverage
|
|
84
|
+
results separately; a maintenance outcome grants no owner acceptance or release
|
|
85
|
+
approval.
|
|
@@ -29,6 +29,10 @@ does not itself manufacture that project-command attachment.
|
|
|
29
29
|
- Retain the original expectations digest outside the attempt. Inspection uses
|
|
30
30
|
that owner-selected digest rather than trusting an editable cached summary.
|
|
31
31
|
|
|
32
|
+
If qualifying an installed companion skill, record that skill's digest and this
|
|
33
|
+
guide's digest separately. The fixture's source identity does not bind either
|
|
34
|
+
document or qualify another running MCP server.
|
|
35
|
+
|
|
32
36
|
## Run and inspect
|
|
33
37
|
|
|
34
38
|
Build once:
|
|
@@ -91,6 +95,85 @@ acceptance, merge, or publication authority.
|
|
|
91
95
|
|
|
92
96
|
## Negative cases and cleanup
|
|
93
97
|
|
|
98
|
+
### Retain a controlled producer failure
|
|
99
|
+
|
|
100
|
+
Run this block from the checkout root after the build above, with the same
|
|
101
|
+
private `EVIDENCE_ROOT`. It invokes the existing source helper directly and
|
|
102
|
+
creates a fresh private attempt. `fixture_a` fails before producing evidence;
|
|
103
|
+
`fixture_b` delivers its file and the final consumer still runs. Host coverage
|
|
104
|
+
must remain `incomplete` although workflow execution and the consumer complete.
|
|
105
|
+
|
|
106
|
+
The block retains the original returned pin, run summary, and inspection summary
|
|
107
|
+
as siblings of the attempt. It writes summaries before checking the assertions,
|
|
108
|
+
so an assertion failure leaves diagnostic evidence. It does not delete attempts.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
: "${EVIDENCE_ROOT:?set an existing private evidence root outside the checkout}"
|
|
112
|
+
node --input-type=module - "$EVIDENCE_ROOT" <<'NODE'
|
|
113
|
+
import assert from 'node:assert/strict';
|
|
114
|
+
import { chmodSync, mkdtempSync, readFileSync, realpathSync, writeFileSync } from 'node:fs';
|
|
115
|
+
import { isAbsolute, join, relative, sep } from 'node:path';
|
|
116
|
+
import { REPOSITORY_ROOT, loadModules, runFixture, inspectFixture } from './scripts/verification/workflow-handoff-fixture.mjs';
|
|
117
|
+
|
|
118
|
+
const evidenceRoot = realpathSync(process.argv[2]);
|
|
119
|
+
const fromCheckout = relative(realpathSync(REPOSITORY_ROOT), evidenceRoot);
|
|
120
|
+
assert.ok(isAbsolute(fromCheckout) || fromCheckout === '..' || fromCheckout.startsWith(`..${sep}`),
|
|
121
|
+
'Evidence root must be outside the source checkout');
|
|
122
|
+
const modules = await loadModules();
|
|
123
|
+
const attempt = mkdtempSync(join(evidenceRoot, 'workflow-handoff-negative-'));
|
|
124
|
+
chmodSync(attempt, 0o700);
|
|
125
|
+
const run = await runFixture(attempt, modules, { fail: ['fixture_a'], manageSignals: true });
|
|
126
|
+
const pinPath = `${attempt}.expectations-sha256`;
|
|
127
|
+
const summaryPath = `${attempt}.result.json`;
|
|
128
|
+
const inspectionPath = `${attempt}.inspection.json`;
|
|
129
|
+
writeFileSync(pinPath, `${run.expectations_sha256}\n`, { flag: 'wx', mode: 0o600 });
|
|
130
|
+
writeFileSync(summaryPath, `${JSON.stringify({ evidence_directory: attempt,
|
|
131
|
+
expectations_sha256: run.expectations_sha256, ...run.coverage,
|
|
132
|
+
diagnostics: run.diagnostics, process_result: run.processResult }, null, 2)}\n`,
|
|
133
|
+
{ flag: 'wx', mode: 0o600 });
|
|
134
|
+
const originalPin = readFileSync(pinPath, 'utf8').trim();
|
|
135
|
+
const inspected = inspectFixture(attempt, modules, originalPin);
|
|
136
|
+
writeFileSync(inspectionPath, `${JSON.stringify({ ...inspected.coverage,
|
|
137
|
+
diagnostics: inspected.diagnostics }, null, 2)}\n`, { flag: 'wx', mode: 0o600 });
|
|
138
|
+
|
|
139
|
+
assert.equal(run.coverage.status, 'incomplete');
|
|
140
|
+
assert.equal(inspected.coverage.status, 'incomplete');
|
|
141
|
+
assert.equal(run.processResult.status, 'completed');
|
|
142
|
+
const calls = run.processResult.stages.flatMap((stage) => stage.calls);
|
|
143
|
+
assert.equal(calls.find((call) => call.stageId === 'producers' && call.callId === 'fixture_a')?.ok, false);
|
|
144
|
+
assert.equal(calls.find((call) => call.stageId === 'producers' && call.callId === 'fixture_b')?.ok, true);
|
|
145
|
+
assert.equal(calls.find((call) => call.stageId === 'consumer' && call.callId === 'read')?.ok, true);
|
|
146
|
+
const consumer = JSON.parse(readFileSync(join(attempt, 'artifacts/consumer/01-read.json'), 'utf8'));
|
|
147
|
+
assert.equal(consumer.verdict, 'complete');
|
|
148
|
+
assert.equal(consumer.reads.length, 1);
|
|
149
|
+
assert.equal(consumer.reads[0].check_id, 'fixture_b');
|
|
150
|
+
assert.equal(run.artifacts.filter((artifact) => artifact.status === 'readable').length, 1);
|
|
151
|
+
assert.equal(run.processResult.terminated, true);
|
|
152
|
+
assert.equal(run.processResult.child_exited, true);
|
|
153
|
+
assert.equal(run.processResult.cleanup_error, undefined);
|
|
154
|
+
assert.equal(run.processResult.child_death, undefined);
|
|
155
|
+
assert.equal(run.interrupted_signal, undefined);
|
|
156
|
+
const child = JSON.parse(readFileSync(join(attempt, 'child-process.json'), 'utf8'));
|
|
157
|
+
assert.equal(child.exit_code, 0);
|
|
158
|
+
process.stdout.write(`${JSON.stringify({ status: inspected.coverage.status,
|
|
159
|
+
evidence_directory: attempt, pin: pinPath, summary: summaryPath, inspection: inspectionPath })}\n`);
|
|
160
|
+
NODE
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Exit zero here means the controlled negative case met these assertions; it does
|
|
164
|
+
not mean complete verification. Stdout is one JSON summary with evidence paths.
|
|
165
|
+
The retained consumer record has at most two reads, and this case requires
|
|
166
|
+
exactly one. Inspection rechecks that read's bytes and its producer ownership.
|
|
167
|
+
Missing or wrong original pins cannot support authenticated inspection; do not
|
|
168
|
+
recover a lost pin from the editable attempt.
|
|
169
|
+
|
|
170
|
+
An interruption or prerequisite failure may prevent final summary publication.
|
|
171
|
+
Keep that attempt as partial evidence and use a fresh directory for a retry.
|
|
172
|
+
The public CLI remains the `run` and `inspect` interface shown above; no failure
|
|
173
|
+
flag or installed fixture API is added.
|
|
174
|
+
|
|
175
|
+
### Automated negative cases
|
|
176
|
+
|
|
94
177
|
The integration suite executes either producer failing, both producers failing,
|
|
95
178
|
swapped check ownership, an unreadable delivered file, and an empty artifact
|
|
96
179
|
store with no omission records. It requires the final consumer to run even when
|
|
@@ -105,6 +188,9 @@ npx vitest run \
|
|
|
105
188
|
tests/verify-workflow-handoff.test.ts
|
|
106
189
|
```
|
|
107
190
|
|
|
191
|
+
These tests remove their temporary attempts. Their passing output does not
|
|
192
|
+
replace the retained negative evidence from the direct helper invocation.
|
|
193
|
+
|
|
108
194
|
The runner owns and stops its child session. It retains evidence after cleanup,
|
|
109
195
|
including failed attempts. An interrupted or unpublished attempt cannot become
|
|
110
196
|
complete merely because earlier artifacts exist. The task owner controls
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clinkx",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "ClinkX MCP STDIO server
|
|
3
|
+
"version": "1.4.2",
|
|
4
|
+
"description": "ClinkX MCP STDIO server — CLI-to-CLI bridge tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=24.0.0"
|