clinkx 1.1.0 → 1.1.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.
Files changed (162) hide show
  1. package/CHANGELOG.md +39 -1
  2. package/README.md +210 -177
  3. package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +5 -0
  4. package/clinkx-workflows/dist/architecture-comparison/admission.js +50 -0
  5. package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -0
  6. package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +995 -0
  7. package/clinkx-workflows/dist/architecture-comparison/contract.js +149 -0
  8. package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -0
  9. package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +29 -0
  10. package/clinkx-workflows/dist/architecture-comparison/runtime.js +387 -0
  11. package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -0
  12. package/clinkx-workflows/dist/contained-file.js +1 -1
  13. package/clinkx-workflows/dist/contained-file.js.map +1 -1
  14. package/clinkx-workflows/dist/council-execution-policy.d.ts +4 -2
  15. package/clinkx-workflows/dist/council-execution-policy.js +5 -1
  16. package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
  17. package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +72 -72
  18. package/clinkx-workflows/dist/dashboard/contracts.d.ts +1564 -122
  19. package/clinkx-workflows/dist/dashboard/contracts.js +4 -0
  20. package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -1
  21. package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +12 -12
  22. package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +8 -8
  23. package/clinkx-workflows/dist/dashboard/scanner.d.ts +3 -0
  24. package/clinkx-workflows/dist/dashboard/scanner.js +27 -0
  25. package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -1
  26. package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +48 -48
  27. package/clinkx-workflows/dist/dashboard/session-log-redaction.d.ts +2 -0
  28. package/clinkx-workflows/dist/dashboard/session-log-redaction.js +4 -0
  29. package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -1
  30. package/clinkx-workflows/dist/dashboard/verified-repair-contract.d.ts +191 -0
  31. package/clinkx-workflows/dist/dashboard/verified-repair-contract.js +28 -0
  32. package/clinkx-workflows/dist/dashboard/verified-repair-contract.js.map +1 -0
  33. package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +115 -0
  34. package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +1 -0
  35. package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
  36. package/clinkx-workflows/dist/engine.d.ts +6 -0
  37. package/clinkx-workflows/dist/engine.js +78 -7
  38. package/clinkx-workflows/dist/engine.js.map +1 -1
  39. package/clinkx-workflows/dist/index.d.ts +3 -0
  40. package/clinkx-workflows/dist/index.js +3 -2
  41. package/clinkx-workflows/dist/index.js.map +1 -1
  42. package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
  43. package/clinkx-workflows/dist/reducers/index.js +22 -0
  44. package/clinkx-workflows/dist/reducers/index.js.map +1 -1
  45. package/clinkx-workflows/dist/state.js +17 -7
  46. package/clinkx-workflows/dist/state.js.map +1 -1
  47. package/clinkx-workflows/dist/validators/architecture-comparison.d.ts +2 -0
  48. package/clinkx-workflows/dist/validators/architecture-comparison.js +12 -0
  49. package/clinkx-workflows/dist/validators/architecture-comparison.js.map +1 -0
  50. package/clinkx-workflows/dist/validators/index.js +4 -0
  51. package/clinkx-workflows/dist/validators/index.js.map +1 -1
  52. package/clinkx-workflows/dist/validators/verified-repair.d.ts +2 -0
  53. package/clinkx-workflows/dist/validators/verified-repair.js +12 -0
  54. package/clinkx-workflows/dist/validators/verified-repair.js.map +1 -0
  55. package/clinkx-workflows/dist/verification-proof.d.ts +254 -0
  56. package/clinkx-workflows/dist/verification-proof.js +195 -0
  57. package/clinkx-workflows/dist/verification-proof.js.map +1 -0
  58. package/clinkx-workflows/dist/verified-repair/admission.d.ts +72 -0
  59. package/clinkx-workflows/dist/verified-repair/admission.js +63 -0
  60. package/clinkx-workflows/dist/verified-repair/admission.js.map +1 -0
  61. package/clinkx-workflows/dist/verified-repair/contract.d.ts +1910 -0
  62. package/clinkx-workflows/dist/verified-repair/contract.js +127 -0
  63. package/clinkx-workflows/dist/verified-repair/contract.js.map +1 -0
  64. package/clinkx-workflows/dist/verified-repair/host.d.ts +32 -0
  65. package/clinkx-workflows/dist/verified-repair/host.js +2 -0
  66. package/clinkx-workflows/dist/verified-repair/host.js.map +1 -0
  67. package/clinkx-workflows/dist/verified-repair/prompts.d.ts +12 -0
  68. package/clinkx-workflows/dist/verified-repair/prompts.js +58 -0
  69. package/clinkx-workflows/dist/verified-repair/prompts.js.map +1 -0
  70. package/clinkx-workflows/dist/verified-repair/result.d.ts +16 -0
  71. package/clinkx-workflows/dist/verified-repair/result.js +102 -0
  72. package/clinkx-workflows/dist/verified-repair/result.js.map +1 -0
  73. package/clinkx-workflows/dist/verified-repair/runtime.d.ts +28 -0
  74. package/clinkx-workflows/dist/verified-repair/runtime.js +186 -0
  75. package/clinkx-workflows/dist/verified-repair/runtime.js.map +1 -0
  76. package/clinkx-workflows/dist/workflow-tools.d.ts +3 -0
  77. package/clinkx-workflows/dist/workflow-tools.js +148 -14
  78. package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
  79. package/clinkx-workflows/dist/workflow-verification-contract.d.ts +539 -0
  80. package/clinkx-workflows/dist/workflow-verification-contract.js +52 -0
  81. package/clinkx-workflows/dist/workflow-verification-contract.js.map +1 -0
  82. package/clinkx-workflows/dist/workflow-verification.d.ts +15 -0
  83. package/clinkx-workflows/dist/workflow-verification.js +218 -0
  84. package/clinkx-workflows/dist/workflow-verification.js.map +1 -0
  85. package/clinkx-workflows/templates/architecture-comparison/candidate.txt +29 -0
  86. package/clinkx-workflows/templates/architecture-comparison/judge.txt +31 -0
  87. package/clinkx-workflows/templates/verified-repair/investigate.txt +20 -0
  88. package/clinkx-workflows/templates/verified-repair/repair.txt +11 -0
  89. package/clinkx-workflows/templates/verified-repair/review.txt +18 -0
  90. package/clinkx-workflows/workflows/architecture-comparison.yaml +133 -0
  91. package/clinkx-workflows/workflows/verified-repair.yaml +104 -0
  92. package/dist/allowed-roots.js +4 -1
  93. package/dist/allowed-roots.js.map +1 -1
  94. package/dist/codex/app-server-client.d.ts +1 -0
  95. package/dist/codex/app-server-client.js +3 -2
  96. package/dist/codex/app-server-client.js.map +1 -1
  97. package/dist/context-builder/diagnostics.d.ts +1 -0
  98. package/dist/context-builder/diagnostics.js +1 -1
  99. package/dist/context-builder/diagnostics.js.map +1 -1
  100. package/dist/context-builder/discovery.d.ts +18 -1
  101. package/dist/context-builder/discovery.js +69 -1
  102. package/dist/context-builder/discovery.js.map +1 -1
  103. package/dist/context-builder/handler.js +8 -1
  104. package/dist/context-builder/handler.js.map +1 -1
  105. package/dist/context-builder/lifecycle-contract.d.ts +24 -24
  106. package/dist/context-builder/refine-handler.js +16 -1
  107. package/dist/context-builder/refine-handler.js.map +1 -1
  108. package/dist/context-builder/secrets.d.ts +11 -0
  109. package/dist/context-builder/secrets.js +81 -1
  110. package/dist/context-builder/secrets.js.map +1 -1
  111. package/dist/context-builder/versions.d.ts +5 -2
  112. package/dist/context-builder/versions.js +5 -2
  113. package/dist/context-builder/versions.js.map +1 -1
  114. package/dist/dashboard-cli.js +10 -3
  115. package/dist/dashboard-cli.js.map +1 -1
  116. package/dist/dashboard-gateway/main.js +8 -3
  117. package/dist/dashboard-gateway/main.js.map +1 -1
  118. package/dist/index.d.ts +2 -0
  119. package/dist/index.js +8 -2
  120. package/dist/index.js.map +1 -1
  121. package/dist/project-verification/contract.d.ts +537 -0
  122. package/dist/project-verification/contract.js +40 -0
  123. package/dist/project-verification/contract.js.map +1 -0
  124. package/dist/project-verification/files.d.ts +23 -0
  125. package/dist/project-verification/files.js +80 -0
  126. package/dist/project-verification/files.js.map +1 -0
  127. package/dist/project-verification/process.d.ts +7 -0
  128. package/dist/project-verification/process.js +115 -0
  129. package/dist/project-verification/process.js.map +1 -0
  130. package/dist/project-verification/runner.d.ts +35 -0
  131. package/dist/project-verification/runner.js +185 -0
  132. package/dist/project-verification/runner.js.map +1 -0
  133. package/dist/project-verification/service.d.ts +37 -0
  134. package/dist/project-verification/service.js +151 -0
  135. package/dist/project-verification/service.js.map +1 -0
  136. package/dist/provider-doctor.d.ts +22 -0
  137. package/dist/provider-doctor.js +22 -0
  138. package/dist/provider-doctor.js.map +1 -0
  139. package/dist/server.js +29 -1
  140. package/dist/server.js.map +1 -1
  141. package/dist/verification-tools.d.ts +90 -0
  142. package/dist/verification-tools.js +120 -0
  143. package/dist/verification-tools.js.map +1 -0
  144. package/dist/verified-repair/files.d.ts +22 -0
  145. package/dist/verified-repair/files.js +114 -0
  146. package/dist/verified-repair/files.js.map +1 -0
  147. package/dist/verified-repair/host.d.ts +14 -0
  148. package/dist/verified-repair/host.js +612 -0
  149. package/dist/verified-repair/host.js.map +1 -0
  150. package/docs/configuration.md +493 -0
  151. package/docs/engineering-recipes.md +415 -0
  152. package/docs/security.md +293 -0
  153. package/docs/verification/README.md +59 -0
  154. package/docs/verification/dashboard-real-disk.md +436 -0
  155. package/docs/verification/project-checks.example.json +14 -0
  156. package/docs/verification/project-checks.md +444 -0
  157. package/docs/verification/workflow-handoff.md +113 -0
  158. package/package.json +13 -6
  159. package/scripts/provider-doctor-core.mjs +364 -0
  160. package/scripts/provider-doctor-probe.mjs +34 -0
  161. package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +0 -106
  162. package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +0 -1
@@ -0,0 +1,444 @@
1
+ # Installed project checks
2
+
3
+ `verification_run` and `verification_inspect` are tools on the npm-installed
4
+ ClinkX MCP server. Your MCP client can run explicit commands from your project's
5
+ reviewed JSON manifest and inspect retained evidence through that connection.
6
+ No client shell access, ClinkX checkout, Git, browser, or ClinkX development
7
+ dependencies are required. Install Node 24 or newer, ClinkX, and whatever your
8
+ own check commands require on the MCP server's host.
9
+
10
+ Project execution v1 supports macOS and Linux/POSIX hosts because cleanup owns
11
+ POSIX process groups. A Windows run returns a prerequisite error. Provider
12
+ readiness is a separate tool, [`provider_doctor`](../configuration.md#provider-readiness-doctor).
13
+
14
+ ## Configure project and evidence access
15
+
16
+ Paths refer to the **MCP server's filesystem**. Configure `CLINKX_ALLOWED_ROOTS`
17
+ in your MCP server launch configuration, then reconnect the client. Use narrowly
18
+ scoped project and private evidence directories; both must exist. For example,
19
+ these entries in your MCP client's server configuration authorize one project
20
+ and its separate evidence parent:
21
+
22
+ ```json
23
+ {
24
+ "command": "npx",
25
+ "args": ["-y", "clinkx"],
26
+ "env": {
27
+ "CLINKX_ALLOWED_ROOTS": "/absolute/path/to/your-project,/absolute/path/to/private-evidence/."
28
+ }
29
+ }
30
+ ```
31
+
32
+ The `/.` suffix makes the evidence entry artifact-only: it permits evidence I/O
33
+ without granting it as project source. The project must resolve within an allowed
34
+ source root; an artifact-only root cannot be used as the project. Evidence must
35
+ resolve within an allowed I/O root and outside both the project and installed
36
+ ClinkX package. The server also grants its configured workflow state/artifact
37
+ roots for artifact I/O. These grants do not authorize them as source projects.
38
+ The default project source root is the server's working directory, which may
39
+ differ from the client's project directory; explicit configuration avoids that
40
+ ambiguity.
41
+
42
+ Allow-roots validate the tool's project and evidence paths. They do not sandbox
43
+ manifest commands or grant permission to execute an unreviewed manifest.
44
+
45
+ ## Define the checks
46
+
47
+ Save a manifest such as `verification.json` inside your project. Adapt the
48
+ [packaged example](project-checks.example.json) to files and commands that exist
49
+ in your project. The example declares `tests/unit.test.mjs` as an input and runs
50
+ it with Node's test runner; it does not create that test file or supply its
51
+ assertions.
52
+
53
+ ```json
54
+ {
55
+ "version": 1,
56
+ "inputs": ["tests/unit.test.mjs"],
57
+ "checks": [
58
+ {
59
+ "id": "unit-tests",
60
+ "command": "node",
61
+ "args": ["--test", "tests/unit.test.mjs"],
62
+ "cwd": ".",
63
+ "timeout_seconds": 300,
64
+ "env_allowlist": []
65
+ }
66
+ ]
67
+ }
68
+ ```
69
+
70
+ | Field | Contract |
71
+ | --- | --- |
72
+ | `version` | Exactly `1`. Unknown fields are rejected. |
73
+ | `inputs` | 1–1000 unique project-relative regular files whose bytes must remain unchanged, up to 16 MiB each and 64 MiB total. Include the source, tests, configuration, and lockfiles needed to identify your check's target. Directories, absolute paths, escapes, and symlink traversal are rejected. |
74
+ | `checks` | 1–100 required checks, executed sequentially. |
75
+ | `checks[].id` | Unique identifier, 1–64 ASCII letters, digits, underscores, or hyphens; the first character must be a letter or digit. |
76
+ | `checks[].command` | Executable to spawn. No shell string or template substitution. |
77
+ | `checks[].args` | Required argv array, up to 100 entries. Use `[]` for no arguments. Each value is passed literally. |
78
+ | `checks[].cwd` | Optional project-relative working directory, default `.`. Must remain within the project without traversing symlinks. |
79
+ | `checks[].timeout_seconds` | Optional integer timeout, default `300`, range `1`–`3600`. |
80
+ | `checks[].env_allowlist` | Optional environment-variable names to inherit in addition to `PATH`, `HOME`, `USER`, `LANG`, and `TMPDIR`. Default empty. |
81
+
82
+ Review the manifest before running it. Commands execute with your account's
83
+ permissions and are **not sandboxed**. They can modify your project or access
84
+ resources available to your account. There is no implicit shell, but choosing a
85
+ shell executable explicitly still executes shell code. Keep credentials out of
86
+ arguments and recorded output; allowlist only the environment your check needs.
87
+
88
+ ## Run and retain the owner pin
89
+
90
+ Select an authorized existing project directory and a new evidence directory
91
+ under an authorized existing parent. The attempt directory must not already
92
+ exist. Call the MCP tool with absolute project and evidence paths and a
93
+ project-relative manifest path:
94
+
95
+ ```json
96
+ {
97
+ "name": "verification_run",
98
+ "arguments": {
99
+ "project": "/absolute/path/to/your-project",
100
+ "manifest": "verification.json",
101
+ "evidence": "/absolute/path/to/private-evidence/attempt-001"
102
+ }
103
+ }
104
+ ```
105
+
106
+ The runner creates the attempt directory privately (mode `0700`) and retained
107
+ files with mode `0600`. It records the manifest, declared input hashes, verifier
108
+ runtime identity, Node version, frozen required checks, host results, and bounded
109
+ stdout/stderr captures. The MCP summary does not echo raw check output. Output
110
+ capture is limited to 1 MiB per stream; truncation fails the affected check.
111
+
112
+ Keep the original run's `expectations_sha256` digest separately from the editable
113
+ attempt directory, under the evidence owner's control. Keep it with the review
114
+ record that identifies this run. An expectations file or cached summary inside
115
+ the attempt is not an independent owner pin.
116
+
117
+ Each command's successful exit establishes only that command's contract. Write
118
+ assertions in the test or checking command: a command that prints "passed" and
119
+ exits zero without testing anything provides no useful product proof.
120
+
121
+ ## Inspect the retained evidence
122
+
123
+ Use the same project, manifest, evidence directory, and the original digest:
124
+
125
+ ```json
126
+ {
127
+ "name": "verification_inspect",
128
+ "arguments": {
129
+ "project": "/absolute/path/to/your-project",
130
+ "manifest": "verification.json",
131
+ "evidence": "/absolute/path/to/private-evidence/attempt-001",
132
+ "expectations_sha256": "<digest retained from the original run>"
133
+ }
134
+ }
135
+ ```
136
+
137
+ Inspection executes no project commands. It reparses retained host results,
138
+ checks identities and digests, and recomputes coverage without trusting a cached
139
+ success summary. Missing, changed, extra, or conflicting evidence cannot establish
140
+ a complete result. Keep the same installed verifier version and project input
141
+ bytes available when you intend to inspect the original run; changes make the
142
+ original evidence inapplicable. Run a new attempt to qualify a new state.
143
+
144
+ The runner rehashes declared inputs before and after execution. A command may
145
+ write outputs not listed as inputs, but changing a declared input makes the run
146
+ inapplicable. A command failure, timeout, capture failure, or cleanup failure
147
+ takes precedence over input drift.
148
+
149
+ | MCP outcome | Meaning |
150
+ | --- | --- |
151
+ | `status:"complete"`, `isError:false` | All required checks have complete evidence for the identified state. |
152
+ | `status:"failed"`, `"incomplete"`, or `"inapplicable"`, `isError:true` | Verification did not establish a pass. Read the returned reasons. |
153
+ | Invalid parameters (`-32602`) | Malformed tool arguments or unauthorized project/evidence paths. |
154
+ | Runtime/prerequisite error, `isError:true` | The attempt cannot establish success; use the diagnostic to correct the prerequisite. |
155
+
156
+ Readiness, project verification and workflow attachment share a per-server operation slot. An
157
+ additional overlapping call fails immediately with a busy result; it is not
158
+ queued. Wait for the admitted call to finish before retrying. Calls cannot set a
159
+ tool-level timeout or supply inline commands; individual check timeouts belong
160
+ in the reviewed manifest.
161
+
162
+ The runner owns detached child process groups and stops them on timeout, capture
163
+ failure, MCP request cancellation, and server shutdown, with bounded escalation.
164
+ Cancellation stops remaining checks and drains owned processes before the
165
+ request is released; an interrupted attempt cannot pass. A cancelled request
166
+ has no final MCP result. If an attempt directory was created and you retained
167
+ the original digest, inspect that evidence to establish its status.
168
+ The tool never recursively deletes your evidence directory. Retain evidence
169
+ until review is finished, then remove only the attempts you own.
170
+
171
+ ## Proof limits
172
+
173
+ This control automatically binds the manifest bytes alongside the **declared
174
+ input files**. Verifier identity covers `package.json`, selected compiled MCP
175
+ handler/shared doctor/collector modules, and the coverage evaluator. The Node
176
+ version is also recorded. It does not bind every runtime dependency's bytes, external executables,
177
+ or environment values. It does not snapshot the whole project or discover
178
+ undeclared dependencies, remote services, browser state, or production behavior.
179
+ Include relevant inputs and choose commands that actually observe the behavior
180
+ you need to qualify.
181
+
182
+ Evidence capture is a trusted local collector, not attestation against a
183
+ malicious command or host. Raw captures can contain secrets and belong in private
184
+ storage; the tool does not establish that captured output is safe to share.
185
+ Environment filtering limits what is inherited but does not prevent a command
186
+ from reading credentials available elsewhere on the host.
187
+
188
+ The MCP server does not automatically invoke project verification for workflows.
189
+ Call these tools explicitly from your client. To retain an inspected-at view
190
+ beside an existing workflow, use the attachment tool below.
191
+
192
+ A complete result grants no acceptance, merge, deployment, or publication
193
+ authority. Record the evidence and have the appropriate owner or independent
194
+ verifier make that decision. ClinkX's own source-checkout regression fixtures
195
+ remain separate; see the [verification overview](README.md).
196
+
197
+ ## Attach an inspected-at record to a workflow
198
+
199
+ `workflow_verification_attach` re-runs the existing inspector and appends a
200
+ strict `clinkx-workflow-verification-v1` record to an existing retained workflow
201
+ run. This new command/sidecar contract leaves manifest v1, run-state v1, and the
202
+ existing doctor/run/inspect tool inputs unchanged.
203
+
204
+ ```json
205
+ {
206
+ "name": "workflow_verification_attach",
207
+ "arguments": {
208
+ "schema_version": "clinkx-workflow-verification-v1",
209
+ "request_id": "a9783375-5061-4a43-94b2-5ab9bfe3ba29",
210
+ "run_id": "your-retained-workflow-run",
211
+ "project": "/absolute/path/to/your-project",
212
+ "manifest": "checks.json",
213
+ "evidence": "/absolute/path/to/private-evidence/attempt-001",
214
+ "expectations_sha256": "<ORIGINAL independently retained digest>"
215
+ }
216
+ }
217
+ ```
218
+
219
+ Use a fresh UUID `request_id` for a new inspection. Identical replay returns the
220
+ original record; reusing its UUID with changed evidence/pin/facts fails. History
221
+ is append-only and bounded to 16 records and 160 KiB total per run (128 KiB per
222
+ record). Failed, incomplete, and
223
+ inapplicable inspections are retained with their original supplied pin. A wrong
224
+ pin never authenticates the expected identity or required-check count; both are
225
+ reported as unknown. Neither the attachment nor dashboard substitutes a new pin
226
+ from editable evidence. A run needs retained workflow/input snapshots and its
227
+ original start timestamp; changed snapshot bytes or bindings make the attachment
228
+ unavailable.
229
+
230
+ The records bind run ID, original start timestamp, and verified workflow/input
231
+ snapshot hashes under a separately versioned generation identity. This identity
232
+ survives read-only Docker mount path/device remapping. A byte-identical copied run
233
+ remains the same historical record; the collector is trusted local storage, not
234
+ tamper-resistant attestation.
235
+
236
+ `workflow_run_status` and dashboard detail show **historical inspected-at
237
+ coverage**, original expectations digests, declared identity scope, and missing
238
+ or failed checks. They do not re-inspect current source/runtime applicability.
239
+ Current retention is separate: `unknown` means no authorized probe roots were
240
+ provided; `outside_mount` means the original evidence path is outside the reader's
241
+ known mounted roots; `present` confirms only the directory exists; `missing` and
242
+ `unavailable` cannot establish current retention. The Compose dashboard does not
243
+ mount arbitrary private host evidence roots. Re-run `verification_inspect` with
244
+ the same original pin to assess current evidence, then use a new attachment UUID
245
+ to retain that new inspection.
246
+
247
+ Browser/status projections expose safe digest references and coverage metadata,
248
+ never raw captures or private evidence paths. Caller progress-report test counts
249
+ are self-reported and cannot create a verified badge. Workflow execution,
250
+ verification coverage, and owner acceptance remain independent; acceptance is
251
+ not recorded by this tool.
252
+
253
+
254
+ ## Native verified repair
255
+
256
+ The installed `verified-repair` workflow combines scoped replacements with these
257
+ native checks. Invoke it through [`run_workflow`](../engineering-recipes.md#built-in-native-verified-repair).
258
+ For Claude Code or Codex to prepare the inputs and run the repair, use the
259
+ [agent-runtime prompt](../engineering-recipes.md#using-verified-repair-from-an-agent-runtime).
260
+ This is opt-in repair of existing regular UTF-8 files, with at most eight files
261
+ per batch, 64 KiB per file, 128 KiB replacement text per batch and 256 KiB
262
+ serialized proposals. Create/delete/rename, binary files, symlinks and mode
263
+ changes are rejected. No Git changes are performed.
264
+
265
+ Before invoking, review the defect, source files and manifests and give the run
266
+ exclusive write ownership of the declared paths. Configure three existing,
267
+ nonoverlapping host locations outside the installed package:
268
+
269
+ ```json
270
+ {
271
+ "command": "npx",
272
+ "args": ["-y", "clinkx"],
273
+ "env": {
274
+ "CLINKX_ALLOWED_ROOTS": "/absolute/project,/absolute/private-evidence/.,/absolute/repair-copies"
275
+ }
276
+ }
277
+ ```
278
+
279
+ The selected project and disposable-copy parent require **source** roots.
280
+ Artifact-only evidence roots cannot authorize either. The reviewed contract may
281
+ live in the evidence root: root admission reads it as bounded contract data and
282
+ freezes it without widening engine roots or passing the original path to a
283
+ provider. Evidence and copy locations must be outside the selected project.
284
+ Paths are canonical absolute paths on the MCP server host, not on a remote
285
+ client. Symlink aliases are rejected; on macOS use `/private/tmp/...` rather
286
+ than `/tmp/...` when that is the real path. All three directories must already
287
+ exist. The caller may prepare a missing regression harness before admission;
288
+ the workflow itself cannot create a target file.
289
+
290
+ Write `repair-contract.json` in the evidence directory. Write the regression,
291
+ required-check and copy-preparation manifests inside the selected project at
292
+ the project-relative paths named by the contract. Manifest paths are resolved
293
+ from `project_path`, not from the contract or evidence directory; absolute
294
+ manifest references are invalid. All named source and manifest files must
295
+ already exist on the MCP host before admission.
296
+
297
+ Example `repair-contract.json`:
298
+
299
+ ```json
300
+ {
301
+ "schema_version": "clinkx-verified-repair-input-v1",
302
+ "project_path": "/absolute/project",
303
+ "evidence_parent": "/absolute/private-evidence",
304
+ "verification_copy_parent": "/absolute/repair-copies",
305
+ "defect": {
306
+ "description": "normalize accepts an invalid empty identifier",
307
+ "expected_behavior": "normalize rejects empty identifiers"
308
+ },
309
+ "source_inputs": ["source.mjs", "regression.mjs"],
310
+ "regression_paths": ["regression.mjs"],
311
+ "implementation_paths": ["source.mjs"],
312
+ "regression_manifest": "regression-checks.json",
313
+ "required_manifest": "required-checks.json",
314
+ "copy_preparation": {"status": "declared", "manifest": "copy-preparation.json"},
315
+ "observation": {
316
+ "schema_version": "clinkx-regression-outcome-v1",
317
+ "case_id": "empty_identifier",
318
+ "assertion_id": "rejects_empty",
319
+ "check_id": "regression"
320
+ },
321
+ "exclusive_write_ownership": true
322
+ }
323
+ ```
324
+
325
+ Each reviewed manifest must include exactly the declared `source_inputs`, with
326
+ no missing or undeclared input. The host captures all their bytes, including
327
+ uncommitted changes, and all manifest bytes before provider dispatch. Writable
328
+ paths must be declared inputs and the regression and implementation sets must
329
+ be disjoint; manifests are immutable throughout the run.
330
+
331
+ Credential-like paths and detected credential material are rejected before
332
+ the host persists a capture or applies a batch. Vendor token shapes in repair
333
+ artifacts are rejected before workflow publication. Ambient context-builder
334
+ secret settings cannot waive these gates. Detection is bounded and conservative;
335
+ provider filesystem access still has only prompt restrictions.
336
+
337
+ For the example, `regression-checks.json` uses native manifest v1:
338
+
339
+ ```json
340
+ {
341
+ "version": 1,
342
+ "inputs": ["source.mjs", "regression.mjs"],
343
+ "checks": [{"id": "regression", "command": "node", "args": ["regression.mjs"]}]
344
+ }
345
+ ```
346
+
347
+ The regression manifest must contain exactly its bound observation check.
348
+ `regression.mjs` must print one strict JSON outcome on stdout:
349
+
350
+ ```json
351
+ {"schema_version":"clinkx-regression-outcome-v1","case_id":"empty_identifier","assertion_id":"rejects_empty","outcome":"assertion_failed"}
352
+ ```
353
+
354
+ Use `assertion_failed` plus a nonzero exit only for that exact assertion failure;
355
+ use `assertion_passed` plus exit 0 after it passes. Setup/import/syntax/dependency
356
+ failures must not report an assertion failure. A `harness_error`, wrong identity,
357
+ timeout, signal, excess output, failed cleanup or malformed output blocks
358
+ reproduction. Keep diagnostic noise on bounded stderr; native captures cap each
359
+ stream at 1 MiB. The same test bytes and command must produce the before/fixed
360
+ and independent-copy observations.
361
+
362
+ Complete the minimal self-contained `.mjs` example with
363
+ `required-checks.json`:
364
+
365
+ ```json
366
+ {
367
+ "version": 1,
368
+ "inputs": ["source.mjs", "regression.mjs"],
369
+ "checks": [
370
+ {"id": "syntax", "command": "node", "args": ["--check", "source.mjs"]},
371
+ {"id": "regression", "command": "node", "args": ["regression.mjs"]}
372
+ ]
373
+ }
374
+ ```
375
+
376
+ For a real project, include the relevant build and test commands and capture
377
+ their required source/configuration files too. Required checks need successful
378
+ exit codes; only the bound regression check requires the strict outcome object.
379
+ Manifests are captured automatically, so they need not be listed in
380
+ `source_inputs`.
381
+
382
+ `copy-preparation.json` uses the same native format. This example has no external
383
+ dependencies and explicitly declares a no-op:
384
+
385
+ ```json
386
+ {
387
+ "version": 1,
388
+ "inputs": ["source.mjs", "regression.mjs"],
389
+ "checks": [{"id": "prepare", "command": "node", "args": ["-e", "process.exit(0)"]}]
390
+ }
391
+ ```
392
+
393
+ For a dependency-bearing project, use reviewed commands that supply only
394
+ project-declared dependencies in the captured copy. Preparation must not change
395
+ captured source or regression bytes. It is not sandboxed. Do not copy credentials
396
+ or undeclared dependency trees. Commands run in the project/copy root by default;
397
+ they use literal argv, so shell operators in `args` do not create a shell script.
398
+ If preparation cannot be supplied, declare
399
+ `{"status":"unavailable","reason":"<specific prerequisite>"}` instead;
400
+ the repair cannot become verified without independent execution.
401
+
402
+ All commands use literal argv, without a shell. Providers cannot invent or
403
+ replace reviewed commands. Generic provider filesystem restrictions are prompt
404
+ instructions, not enforced isolation; declared-input drift is detected but the
405
+ workflow does not protect the entire environment from external writers.
406
+
407
+ The host applies admitted batches one file at a time through rename and records
408
+ completed writes. This is not a multi-file transaction. A partial write,
409
+ failed check or cancellation preserves edited files and evidence. Interrupted
410
+ or ambiguous mutations cannot resume; status and inspection remain available.
411
+ Never infer owner acceptance from workflow completion or reviewer approval.
412
+
413
+ Independent review must bind the exact fixed source and original proof pins,
414
+ return `approve` and contain zero material findings. Nonblocking findings are
415
+ retained. The host then runs the frozen regression in its captured disposable
416
+ copy, removes only the admitted implementation changes there, observes the same
417
+ failure, restores the fixed bytes and observes the pass. It never undoes the fix
418
+ in the selected working tree. Final native required coverage and attachment
419
+ identify the actual selected tree; copy evidence identifies the copy only.
420
+
421
+ Read `workflow_run_status` with `include_result:true` for the terminal repair
422
+ record. `verified`, `blocked`, `incomplete` and `failed` remain separate from
423
+ execution status and `owner_acceptance: not_recorded`. The dashboard projects
424
+ historical published facts and inspection history, not a new current-source
425
+ inspection. Retain original expectation pins independently; do not extract a
426
+ replacement pin from editable evidence.
427
+
428
+ Every repair status read validates the retained record within a 256 KiB bound;
429
+ `include_result` controls whether that body is returned. Equal-size corruption
430
+ is unavailable. If a worker dies before terminal publication, the root MCP
431
+ server can read the retained capture and independently pinned admitted batches
432
+ to classify declared files as original, replacement or unknown. This is an
433
+ `inspected_at` interruption record with no successful proof or cleanup claim.
434
+ It executes no commands, performs no writes and cannot resume the mutation.
435
+ An altered proposal cannot authenticate later owner bytes. The dashboard has
436
+ no project capability, so an interrupted run without a published record stays
437
+ unavailable there.
438
+
439
+ A hard process death before rename or cleanup can leave a
440
+ `.clinkx-repair-*.tmp` file beside a declared target. Interrupted inspection
441
+ does not delete it; confirm run ownership before manual cleanup. A cancelled
442
+ command retains its failed native check, while interruption before a command
443
+ has no completed check. Repair qualification and execution status report those
444
+ facts separately.
@@ -0,0 +1,113 @@
1
+ # Workflow evidence handoff
2
+
3
+ This source-checkout procedure qualifies the actual YAML loader, `ClinkSession`,
4
+ `WorkflowEngine`, validators, and `ArtifactStore` using a controlled MCP child.
5
+ Two parallel producers write independently assigned checks; one final consumer
6
+ opens the delivered files and reports their bytes. The host compares the
7
+ persisted artifacts and consumer reads with requirements frozen before dispatch.
8
+ The consumer's `complete` verdict does not establish coverage.
9
+
10
+ The child is a local deterministic fixture. This procedure does not authenticate
11
+ an LLM provider, exercise native Codex execution, or prove dashboard behavior.
12
+ It adds no installed workflow or public MCP tool.
13
+
14
+ Installed project-check evidence can separately be attached to a retained
15
+ workflow through the versioned `workflow_verification_attach` tool; see
16
+ [the project-check guide](project-checks.md#attach-an-inspected-at-record-to-a-workflow).
17
+ The dashboard shows historical inspected-at proof, with current retention and
18
+ owner acceptance separate. This fixture remains a source-checkout procedure and
19
+ does not itself manufacture that project-command attachment.
20
+
21
+ ## Prerequisites and ownership
22
+
23
+ - Node 24 or later, repository dependencies installed, and a full build.
24
+ - A private evidence root outside the source checkout. Each run creates a new
25
+ attempt directory; it refuses to reuse an existing one.
26
+ - One build owner. Do not edit sources, install dependencies, or rebuild while
27
+ an attempt is running. Source and compiled-file byte digests bind the attempt
28
+ to the state it exercises.
29
+ - Retain the original expectations digest outside the attempt. Inspection uses
30
+ that owner-selected digest rather than trusting an editable cached summary.
31
+
32
+ ## Run and inspect
33
+
34
+ Build once:
35
+
36
+ ```bash
37
+ npm run build:all
38
+ ```
39
+
40
+ Choose an existing private root, then a fresh attempt name. The procedure sends
41
+ no provider prompts or credentials. Its stdout is one JSON result; diagnostics
42
+ go to stderr.
43
+
44
+ ```bash
45
+ : "${EVIDENCE_ROOT:?set an existing private evidence root outside the checkout}"
46
+ ATTEMPT="$EVIDENCE_ROOT/workflow-handoff-001"
47
+ node scripts/verify-workflow-handoff.mjs run "$ATTEMPT" \
48
+ > "$EVIDENCE_ROOT/workflow-handoff-001.result.json"
49
+ ```
50
+
51
+ Require exit zero and `status:"complete"`. Preserve `expectations_sha256` from
52
+ the result outside the attempt. For example:
53
+
54
+ ```bash
55
+ EXPECTED_SHA="$(node -e 'const fs=require("node:fs"); const r=JSON.parse(fs.readFileSync(process.argv[1],"utf8")); if(r.status!=="complete" || !/^[a-f0-9]{64}$/.test(r.expectations_sha256)) process.exit(1); process.stdout.write(r.expectations_sha256)' \
56
+ "$EVIDENCE_ROOT/workflow-handoff-001.result.json")"
57
+ node scripts/verify-workflow-handoff.mjs inspect "$ATTEMPT" \
58
+ --expectations-sha256 "$EXPECTED_SHA"
59
+ ```
60
+
61
+ Inspection reparses retained producer, consumer, and execution evidence. It
62
+ ignores the cached coverage in `proof.json`, checks recorded artifact sizes and
63
+ digests, and compares applicability with the current source and build. A changed
64
+ checkout requires a new run. Rebuild only after the earlier run has finished.
65
+
66
+ ## Evidence and outcomes
67
+
68
+ Keep the attempt directory and the owner-selected expectations digest together
69
+ with the command and exit status. The retained records include:
70
+
71
+ - `expected.json`: nonempty check set, producer-to-check ownership, attempt
72
+ identities, expected artifact paths, and source/build/procedure digests.
73
+ - The generated YAML and producer artifacts: the actual loader input and
74
+ validated bytes saved by `ArtifactStore`.
75
+ - The consumer artifact: actual delivered paths, byte sizes, and SHA-256 values.
76
+ - `process-result.json` and the controlled child's exit record: execution and
77
+ cleanup evidence, with the fixture boundary stated explicitly.
78
+ - `proof.json`: record references and digests, published after execution and
79
+ cleanup. Its cached coverage is a convenience, not the inspection oracle.
80
+
81
+ `complete` requires every authorized check with readable matching bytes and
82
+ successful execution. Missing producer evidence is `incomplete`; mismatched
83
+ source/build/attempt identity is `inapplicable`; independently observed execution,
84
+ consumer, or cleanup failures remain `failed` even when identity has drifted.
85
+ Conflicting evidence, wrong ownership, or a failed check is `failed`. Failure takes precedence over gaps,
86
+ and all applicable reasons remain visible. Identical replay is idempotent.
87
+
88
+ Exit `0` means complete coverage, `1` means failed, incomplete, or inapplicable
89
+ evidence, and `2` means invalid input or unavailable prerequisites. None grants
90
+ acceptance, merge, or publication authority.
91
+
92
+ ## Negative cases and cleanup
93
+
94
+ The integration suite executes either producer failing, both producers failing,
95
+ swapped check ownership, an unreadable delivered file, and an empty artifact
96
+ store with no omission records. It requires the final consumer to run even when
97
+ producer evidence is missing. Inspector tests alter raw evidence while leaving
98
+ the cached summary complete, and check changed bytes, path escape, execution
99
+ status, and changes to independently pinned requirements.
100
+
101
+ ```bash
102
+ npx vitest run \
103
+ clinkx-workflows/tests/verification-proof.test.ts \
104
+ clinkx-workflows/tests/integration/verification-handoff.test.ts \
105
+ tests/verify-workflow-handoff.test.ts
106
+ ```
107
+
108
+ The runner owns and stops its child session. It retains evidence after cleanup,
109
+ including failed attempts. An interrupted or unpublished attempt cannot become
110
+ complete merely because earlier artifacts exist. The task owner controls
111
+ retention and may remove an attempt after its review and diagnostic use end.
112
+ These digests identify bytes under a trusted local collector; they are not an
113
+ attestation against a malicious collector or operating system.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "clinkx",
3
- "version": "1.1.0",
4
- "description": "ClinkX MCP STDIO server — CLI-to-CLI bridge tool",
3
+ "version": "1.1.2",
4
+ "description": "ClinkX MCP STDIO server \u2014 CLI-to-CLI bridge tool",
5
5
  "type": "module",
6
6
  "engines": {
7
7
  "node": ">=24.0.0"
@@ -15,6 +15,16 @@
15
15
  "dist",
16
16
  "conf",
17
17
  "CHANGELOG.md",
18
+ "docs/configuration.md",
19
+ "docs/security.md",
20
+ "docs/engineering-recipes.md",
21
+ "docs/verification/README.md",
22
+ "docs/verification/project-checks.md",
23
+ "docs/verification/project-checks.example.json",
24
+ "docs/verification/dashboard-real-disk.md",
25
+ "docs/verification/workflow-handoff.md",
26
+ "scripts/provider-doctor-core.mjs",
27
+ "scripts/provider-doctor-probe.mjs",
18
28
  "clinkx-workflows/dist",
19
29
  "!clinkx-workflows/dist/workflows/!(index).*",
20
30
  "clinkx-workflows/workflows",
@@ -77,10 +87,7 @@
77
87
  },
78
88
  "license": "UNLICENSED",
79
89
  "author": "jim380",
80
- "homepage": "https://github.com/jim380/clink-mcp#readme",
81
- "bugs": {
82
- "url": "https://github.com/jim380/clink-mcp/issues"
83
- },
90
+ "homepage": "https://www.npmjs.com/package/clinkx",
84
91
  "repository": {
85
92
  "type": "git",
86
93
  "url": "https://github.com/jim380/clink-mcp.git"