clinkx 1.1.2 → 1.3.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/CHANGELOG.md +63 -0
- package/README.md +67 -14
- package/clinkx-workflows/dist/allowed-roots.js +2 -0
- package/clinkx-workflows/dist/allowed-roots.js.map +1 -1
- package/clinkx-workflows/dist/architecture-arena/admission.d.ts +16 -0
- package/clinkx-workflows/dist/architecture-arena/admission.js +107 -0
- package/clinkx-workflows/dist/architecture-arena/admission.js.map +1 -0
- package/clinkx-workflows/dist/architecture-arena/contract.d.ts +1368 -0
- package/clinkx-workflows/dist/architecture-arena/contract.js +254 -0
- package/clinkx-workflows/dist/architecture-arena/contract.js.map +1 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.d.ts +53 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.js +511 -0
- package/clinkx-workflows/dist/architecture-arena/runtime.js.map +1 -0
- package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +17 -1
- package/clinkx-workflows/dist/architecture-comparison/admission.js +27 -4
- package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -1
- package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +59 -62
- package/clinkx-workflows/dist/architecture-comparison/contract.js +4 -21
- package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -1
- package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +4 -3
- package/clinkx-workflows/dist/architecture-comparison/runtime.js +22 -67
- package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -1
- package/clinkx-workflows/dist/artifacts.d.ts +19 -4
- package/clinkx-workflows/dist/artifacts.js +16 -7
- package/clinkx-workflows/dist/artifacts.js.map +1 -1
- package/clinkx-workflows/dist/backend.d.ts +30 -0
- package/clinkx-workflows/dist/child-env.d.ts +3 -1
- package/clinkx-workflows/dist/child-env.js +6 -2
- package/clinkx-workflows/dist/child-env.js.map +1 -1
- package/clinkx-workflows/dist/clink-client.d.ts +8 -2
- package/clinkx-workflows/dist/clink-client.js +4 -2
- package/clinkx-workflows/dist/clink-client.js.map +1 -1
- package/clinkx-workflows/dist/config.d.ts +28 -5
- package/clinkx-workflows/dist/config.js +137 -20
- package/clinkx-workflows/dist/config.js.map +1 -1
- package/clinkx-workflows/dist/contained-file.js +9 -0
- package/clinkx-workflows/dist/contained-file.js.map +1 -1
- package/clinkx-workflows/dist/context-preflight.d.ts +6 -0
- package/clinkx-workflows/dist/context-preflight.js.map +1 -1
- package/clinkx-workflows/dist/council-execution-policy.d.ts +3 -1
- package/clinkx-workflows/dist/council-execution-policy.js +4 -0
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +586 -586
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +28 -28
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +32 -32
- package/clinkx-workflows/dist/dashboard/session-log-identity.js +2 -1
- package/clinkx-workflows/dist/dashboard/session-log-identity.js.map +1 -1
- package/clinkx-workflows/dist/dashboard-ui/assets/index-DRId2DVA.js +119 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-CHAw57y5.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
- package/clinkx-workflows/dist/delegate-signature.d.ts +4 -3
- package/clinkx-workflows/dist/delegate-signature.js +4 -3
- package/clinkx-workflows/dist/delegate-signature.js.map +1 -1
- package/clinkx-workflows/dist/durable-file.d.ts +69 -0
- package/clinkx-workflows/dist/durable-file.js +145 -0
- package/clinkx-workflows/dist/durable-file.js.map +1 -0
- package/clinkx-workflows/dist/engine.d.ts +42 -7
- package/clinkx-workflows/dist/engine.js +196 -24
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/ping-pong/admission.d.ts +127 -0
- package/clinkx-workflows/dist/ping-pong/admission.js +522 -0
- package/clinkx-workflows/dist/ping-pong/admission.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/contract.d.ts +2539 -0
- package/clinkx-workflows/dist/ping-pong/contract.js +819 -0
- package/clinkx-workflows/dist/ping-pong/contract.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/control.d.ts +67 -0
- package/clinkx-workflows/dist/ping-pong/control.js +12 -0
- package/clinkx-workflows/dist/ping-pong/control.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.d.ts +24 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.js +55 -0
- package/clinkx-workflows/dist/ping-pong/runtime-handle.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/runtime.d.ts +235 -0
- package/clinkx-workflows/dist/ping-pong/runtime.js +1183 -0
- package/clinkx-workflows/dist/ping-pong/runtime.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/settle.d.ts +57 -0
- package/clinkx-workflows/dist/ping-pong/settle.js +58 -0
- package/clinkx-workflows/dist/ping-pong/settle.js.map +1 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.d.ts +65 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.js +138 -0
- package/clinkx-workflows/dist/ping-pong/sidecar.js.map +1 -0
- package/clinkx-workflows/dist/plan-review/publication.d.ts +2 -1
- package/clinkx-workflows/dist/plan-review/publication.js +5 -6
- package/clinkx-workflows/dist/plan-review/publication.js.map +1 -1
- package/clinkx-workflows/dist/plan-review/snapshot.d.ts +3 -2
- package/clinkx-workflows/dist/plan-review/snapshot.js +8 -8
- package/clinkx-workflows/dist/plan-review/snapshot.js.map +1 -1
- package/clinkx-workflows/dist/recipe-host.d.ts +315 -0
- package/clinkx-workflows/dist/recipe-host.js +183 -0
- package/clinkx-workflows/dist/recipe-host.js.map +1 -0
- package/clinkx-workflows/dist/recipe-seats.d.ts +96 -0
- package/clinkx-workflows/dist/recipe-seats.js +163 -0
- package/clinkx-workflows/dist/recipe-seats.js.map +1 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.d.ts +67 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.js +111 -0
- package/clinkx-workflows/dist/recipe-shared/evidence.js.map +1 -0
- package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
- package/clinkx-workflows/dist/reducers/index.js +30 -0
- package/clinkx-workflows/dist/reducers/index.js.map +1 -1
- package/clinkx-workflows/dist/root-path-validation.d.ts +12 -0
- package/clinkx-workflows/dist/root-path-validation.js +63 -0
- package/clinkx-workflows/dist/root-path-validation.js.map +1 -0
- package/clinkx-workflows/dist/rosters.d.ts +1 -0
- package/clinkx-workflows/dist/rosters.js +16 -6
- package/clinkx-workflows/dist/rosters.js.map +1 -1
- package/clinkx-workflows/dist/run-lock-reclaim.d.ts +44 -0
- package/clinkx-workflows/dist/run-lock-reclaim.js +86 -0
- package/clinkx-workflows/dist/run-lock-reclaim.js.map +1 -0
- package/clinkx-workflows/dist/server.js +5 -2
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +24 -0
- package/clinkx-workflows/dist/state-schema.js +4 -1
- package/clinkx-workflows/dist/state-schema.js.map +1 -1
- package/clinkx-workflows/dist/state.d.ts +185 -4
- package/clinkx-workflows/dist/state.js +684 -88
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/transport.d.ts +2 -1
- package/clinkx-workflows/dist/transport.js +5 -0
- package/clinkx-workflows/dist/transport.js.map +1 -1
- package/clinkx-workflows/dist/validators/architecture-arena.d.ts +6 -0
- package/clinkx-workflows/dist/validators/architecture-arena.js +16 -0
- package/clinkx-workflows/dist/validators/architecture-arena.js.map +1 -0
- package/clinkx-workflows/dist/validators/index.js +4 -0
- package/clinkx-workflows/dist/validators/index.js.map +1 -1
- package/clinkx-workflows/dist/validators/ping-pong.d.ts +6 -0
- package/clinkx-workflows/dist/validators/ping-pong.js +10 -0
- package/clinkx-workflows/dist/validators/ping-pong.js.map +1 -0
- package/clinkx-workflows/dist/workflow-completion.d.ts +83 -0
- package/clinkx-workflows/dist/workflow-completion.js +250 -0
- package/clinkx-workflows/dist/workflow-completion.js.map +1 -0
- package/clinkx-workflows/dist/workflow-tools.d.ts +53 -6
- package/clinkx-workflows/dist/workflow-tools.js +1123 -65
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workflow-verification-contract.d.ts +4 -4
- package/clinkx-workflows/templates/architecture-arena/candidate.txt +39 -0
- package/clinkx-workflows/templates/architecture-arena/judge.txt +34 -0
- package/clinkx-workflows/templates/ping-pong/implement.txt +14 -0
- package/clinkx-workflows/templates/ping-pong/remediate.txt +14 -0
- package/clinkx-workflows/templates/ping-pong/review.txt +27 -0
- package/clinkx-workflows/workflows/architecture-arena.yaml +127 -0
- package/clinkx-workflows/workflows/ping-pong.yaml +158 -0
- package/dist/allowed-roots.d.ts +1 -1
- package/dist/allowed-roots.js +124 -14
- package/dist/allowed-roots.js.map +1 -1
- package/dist/context-builder/bundle.js +4 -3
- package/dist/context-builder/bundle.js.map +1 -1
- package/dist/context-builder/config.d.ts +1 -0
- package/dist/context-builder/config.js +21 -9
- package/dist/context-builder/config.js.map +1 -1
- package/dist/context-builder/delegate-packet.d.ts +1 -0
- package/dist/context-builder/delegate-packet.js +66 -7
- package/dist/context-builder/delegate-packet.js.map +1 -1
- package/dist/context-builder/delegate-validation.d.ts +12 -3
- package/dist/context-builder/delegate-validation.js +23 -13
- package/dist/context-builder/delegate-validation.js.map +1 -1
- package/dist/context-builder/external-gaps.d.ts +14 -3
- package/dist/context-builder/external-gaps.js +124 -18
- package/dist/context-builder/external-gaps.js.map +1 -1
- package/dist/context-builder/handler.js +108 -191
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/mutation-lock.d.ts +4 -0
- package/dist/context-builder/mutation-lock.js +7 -1
- package/dist/context-builder/mutation-lock.js.map +1 -1
- package/dist/context-builder/review-coverage.js +27 -1
- package/dist/context-builder/review-coverage.js.map +1 -1
- package/dist/context-builder/secrets.js +1 -1
- package/dist/context-builder/secrets.js.map +1 -1
- package/dist/context-builder/storage.d.ts +10 -2
- package/dist/context-builder/storage.js +213 -16
- package/dist/context-builder/storage.js.map +1 -1
- package/dist/context-builder/versions.d.ts +10 -4
- package/dist/context-builder/versions.js +10 -4
- package/dist/context-builder/versions.js.map +1 -1
- package/dist/context-builder/workflow-runner.js +33 -24
- package/dist/context-builder/workflow-runner.js.map +1 -1
- package/dist/dashboard-cli.d.ts +8 -0
- package/dist/dashboard-cli.js +155 -86
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-companion/client.d.ts +10 -0
- package/dist/dashboard-companion/client.js +43 -1
- package/dist/dashboard-companion/client.js.map +1 -1
- package/dist/dashboard-companion/config.d.ts +19 -1
- package/dist/dashboard-companion/config.js +104 -3
- package/dist/dashboard-companion/config.js.map +1 -1
- package/dist/dashboard-companion/protocol.d.ts +16 -0
- package/dist/dashboard-companion/protocol.js +38 -1
- package/dist/dashboard-companion/protocol.js.map +1 -1
- package/dist/dashboard-companion/workstation-binding.d.ts +69 -0
- package/dist/dashboard-companion/workstation-binding.js +192 -0
- package/dist/dashboard-companion/workstation-binding.js.map +1 -0
- package/dist/dashboard-gateway/admin-cli.d.ts +10 -0
- package/dist/dashboard-gateway/admin-cli.js +266 -0
- package/dist/dashboard-gateway/admin-cli.js.map +1 -0
- package/dist/dashboard-gateway/config.d.ts +50 -0
- package/dist/dashboard-gateway/config.js +235 -1
- package/dist/dashboard-gateway/config.js.map +1 -1
- package/dist/dashboard-gateway/connection-registry.d.ts +100 -0
- package/dist/dashboard-gateway/connection-registry.js +228 -0
- package/dist/dashboard-gateway/connection-registry.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/account-auth.d.ts +78 -0
- package/dist/dashboard-gateway/control-plane/account-auth.js +198 -0
- package/dist/dashboard-gateway/control-plane/account-auth.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/billing.d.ts +264 -0
- package/dist/dashboard-gateway/control-plane/billing.js +787 -0
- package/dist/dashboard-gateway/control-plane/billing.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/contracts.d.ts +1293 -0
- package/dist/dashboard-gateway/control-plane/contracts.js +280 -0
- package/dist/dashboard-gateway/control-plane/contracts.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/cookies.d.ts +13 -0
- package/dist/dashboard-gateway/control-plane/cookies.js +46 -0
- package/dist/dashboard-gateway/control-plane/cookies.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/credentials.d.ts +63 -0
- package/dist/dashboard-gateway/control-plane/credentials.js +66 -0
- package/dist/dashboard-gateway/control-plane/credentials.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/entitlements.d.ts +118 -0
- package/dist/dashboard-gateway/control-plane/entitlements.js +329 -0
- package/dist/dashboard-gateway/control-plane/entitlements.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/errors.d.ts +17 -0
- package/dist/dashboard-gateway/control-plane/errors.js +23 -0
- package/dist/dashboard-gateway/control-plane/errors.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/hosts.d.ts +6 -0
- package/dist/dashboard-gateway/control-plane/hosts.js +16 -0
- package/dist/dashboard-gateway/control-plane/hosts.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/http.d.ts +34 -0
- package/dist/dashboard-gateway/control-plane/http.js +331 -0
- package/dist/dashboard-gateway/control-plane/http.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/schema.d.ts +9 -0
- package/dist/dashboard-gateway/control-plane/schema.js +247 -0
- package/dist/dashboard-gateway/control-plane/schema.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/secrets.d.ts +20 -0
- package/dist/dashboard-gateway/control-plane/secrets.js +39 -0
- package/dist/dashboard-gateway/control-plane/secrets.js.map +1 -0
- package/dist/dashboard-gateway/control-plane/store.d.ts +579 -0
- package/dist/dashboard-gateway/control-plane/store.js +1115 -0
- package/dist/dashboard-gateway/control-plane/store.js.map +1 -0
- package/dist/dashboard-gateway/cookie-boundary.d.ts +60 -0
- package/dist/dashboard-gateway/cookie-boundary.js +205 -0
- package/dist/dashboard-gateway/cookie-boundary.js.map +1 -0
- package/dist/dashboard-gateway/index.js +271 -494
- package/dist/dashboard-gateway/index.js.map +1 -1
- package/dist/dashboard-gateway/main.js +7 -2
- package/dist/dashboard-gateway/main.js.map +1 -1
- package/dist/dashboard-gateway/routing.d.ts +43 -0
- package/dist/dashboard-gateway/routing.js +65 -0
- package/dist/dashboard-gateway/routing.js.map +1 -0
- package/dist/dashboard-gateway/tenant-gateway.d.ts +56 -0
- package/dist/dashboard-gateway/tenant-gateway.js +989 -0
- package/dist/dashboard-gateway/tenant-gateway.js.map +1 -0
- package/dist/dashboard-gateway/tenant-main.d.ts +41 -0
- package/dist/dashboard-gateway/tenant-main.js +303 -0
- package/dist/dashboard-gateway/tenant-main.js.map +1 -0
- package/dist/dashboard-gateway/tunnel-errors.d.ts +16 -0
- package/dist/dashboard-gateway/tunnel-errors.js +22 -0
- package/dist/dashboard-gateway/tunnel-errors.js.map +1 -0
- package/dist/dashboard-gateway/tunnel-http.d.ts +21 -0
- package/dist/dashboard-gateway/tunnel-http.js +175 -0
- package/dist/dashboard-gateway/tunnel-http.js.map +1 -0
- package/dist/handler.d.ts +6 -0
- package/dist/handler.js +17 -1
- package/dist/handler.js.map +1 -1
- package/dist/local-clink-backend.d.ts +2 -1
- package/dist/local-clink-backend.js +28 -4
- package/dist/local-clink-backend.js.map +1 -1
- package/dist/parsers/extract.d.ts +19 -1
- package/dist/parsers/extract.js +68 -3
- package/dist/parsers/extract.js.map +1 -1
- package/dist/pipeline.d.ts +17 -1
- package/dist/pipeline.js +34 -6
- package/dist/pipeline.js.map +1 -1
- package/dist/process-group.d.ts +65 -0
- package/dist/process-group.js +153 -0
- package/dist/process-group.js.map +1 -0
- package/dist/progress-report/schema.d.ts +23 -23
- package/dist/project-verification/files.js +1 -1
- package/dist/project-verification/files.js.map +1 -1
- package/dist/project-verification/process.js +23 -44
- package/dist/project-verification/process.js.map +1 -1
- package/dist/project-verification/service.js +9 -1
- package/dist/project-verification/service.js.map +1 -1
- package/dist/prompt.d.ts +7 -0
- package/dist/prompt.js +18 -1
- package/dist/prompt.js.map +1 -1
- package/dist/recipe-host/git-trust.d.ts +43 -0
- package/dist/recipe-host/git-trust.js +360 -0
- package/dist/recipe-host/git-trust.js.map +1 -0
- package/dist/recipe-host/git.d.ts +42 -0
- package/dist/recipe-host/git.js +207 -0
- package/dist/recipe-host/git.js.map +1 -0
- package/dist/recipe-host/native-recipe-host.d.ts +127 -0
- package/dist/recipe-host/native-recipe-host.js +880 -0
- package/dist/recipe-host/native-recipe-host.js.map +1 -0
- package/dist/recipe-host/seat-cwd.d.ts +16 -0
- package/dist/recipe-host/seat-cwd.js +170 -0
- package/dist/recipe-host/seat-cwd.js.map +1 -0
- package/dist/registry.d.ts +1 -1
- package/dist/registry.js +5 -1
- package/dist/registry.js.map +1 -1
- package/dist/runner.d.ts +43 -1
- package/dist/runner.js +234 -35
- package/dist/runner.js.map +1 -1
- package/dist/server.js +21 -6
- package/dist/server.js.map +1 -1
- package/docs/configuration.md +181 -15
- package/docs/engineering-recipes.md +291 -0
- package/docs/security.md +87 -0
- package/docs/verification/project-checks.md +24 -2
- package/package.json +5 -1
- package/scripts/provider-doctor-core.mjs +21 -5
- package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +0 -115
- package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +0 -1
|
@@ -129,6 +129,297 @@ qualify ClinkX; use the installed project-check control for your own project's
|
|
|
129
129
|
commands through the same MCP connection. `npx clinkx` starts the MCP server;
|
|
130
130
|
readiness and verification are tools on that server.
|
|
131
131
|
|
|
132
|
+
## Built-in architecture arena (2-4 candidates)
|
|
133
|
+
|
|
134
|
+
`architecture-arena` (v2.0.0) generalizes the comparison to 2-4 design authors
|
|
135
|
+
and keeps `architecture-comparison` (v1) unchanged. Seats use the council seat
|
|
136
|
+
parameters: `members` are the authors (2..4; each member's optional `stance` is
|
|
137
|
+
its exploration direction under one shared acceptance contract) and `chairman`
|
|
138
|
+
is the judge (required; there is no YAML default judge). `roster` is rejected.
|
|
139
|
+
Model and effort follow adapter `invocation_overrides`, as for council seats.
|
|
140
|
+
|
|
141
|
+
```json
|
|
142
|
+
{
|
|
143
|
+
"name": "run_workflow",
|
|
144
|
+
"arguments": {
|
|
145
|
+
"workflow": "architecture-arena",
|
|
146
|
+
"run_id": "arena-001",
|
|
147
|
+
"members": [
|
|
148
|
+
{"cli_name": "codex", "stance": "minimize new modules"},
|
|
149
|
+
{"cli_name": "claude", "stance": "optimize for testability"},
|
|
150
|
+
{"cli_name": "glm"}
|
|
151
|
+
],
|
|
152
|
+
"chairman": "codex",
|
|
153
|
+
"variables": {
|
|
154
|
+
"user_request": "Design the change. State caller usage, signatures, ownership, failures and rejected alternatives.",
|
|
155
|
+
"source_identity": "my-project at reviewed revision; declared attached files only",
|
|
156
|
+
"context_files": ["/absolute/path/to/project/design-context.md"]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
- **Seat binding.** Admission materializes one author call per member before any
|
|
163
|
+
state exists and stores the seat plan (stance text included) in the
|
|
164
|
+
server-owned `arena_seat_plan` variable; a caller-supplied value is rejected.
|
|
165
|
+
Resume and inspection read the persisted plan, never the caller input. Stance
|
|
166
|
+
text is inserted literally; `$&`, `` $` ``, `$'` and `$$` are not expanded.
|
|
167
|
+
- **Capacity.** n outside 2..4 is rejected before preflight. The 32-file freeze
|
|
168
|
+
cap is checked at admission against the merged `context_files` and
|
|
169
|
+
`context_bundle_files` plus the slots a selecting preflight appends (2, or 3
|
|
170
|
+
with `include_selected_context_artifact`), so an overflow is a pre-state
|
|
171
|
+
`-32602`, not a freeze failure after preflight. The reserve is 0 for
|
|
172
|
+
`cb_context_mode: "off"` or on a server without a context runner; an inherited
|
|
173
|
+
server default of `off` is not visible at admission and still reserves. v1
|
|
174
|
+
`architecture-comparison` shares the check (its golden digests are unchanged). After the freeze,
|
|
175
|
+
the per-candidate cap is `min(16 KiB, floor((98,304 - 3,072 - frozen shared
|
|
176
|
+
bytes) / n))` with a 4 KiB floor; each author is told its cap through the
|
|
177
|
+
sealed packet. With a worst-case 48 KiB shared packet the caps are 16,384 B
|
|
178
|
+
(n=2), 15,360 B (n=3) and 11,520 B (n=4); the n=4 judge view then measures
|
|
179
|
+
98,046 B against the 98,304 B ceiling. The floor cannot trigger under today's
|
|
180
|
+
ceilings and is kept as a guard, so `capacity_rejected` is unreachable today.
|
|
181
|
+
Below-floor freezes write `architecture-arena.capacity.v2.json`; async runs
|
|
182
|
+
end `failed` and status shows `comparison.status: "capacity_rejected"`.
|
|
183
|
+
Nothing is truncated. A declared `judge_prompt_token_limit` must cover the
|
|
184
|
+
judge's byte-token bound (98,304 B view + 12,288 B judge output + 100,000 B
|
|
185
|
+
reserve + judge prompt bytes, about 212.5K); a smaller value is rejected at
|
|
186
|
+
admission.
|
|
187
|
+
- **Complete fan-in.** Every admitted author must produce a valid candidate
|
|
188
|
+
before the judge runs. A missing, invalid or busy author blocks the judge and
|
|
189
|
+
the owner record lists `missing_participants` with a reason (`busy`, `failed`,
|
|
190
|
+
`invalid`, `not_dispatched`, `integrity`). A surviving subset is never
|
|
191
|
+
compared. The judge must assess and rank exactly the admitted aliases; exact
|
|
192
|
+
duplicates are recorded as `duplicate_of`. `owner_acceptance` stays
|
|
193
|
+
`not_recorded`.
|
|
194
|
+
- **Busy seats.** Author and judge calls retry transport-class failures
|
|
195
|
+
(`transport_only`, 2 retries). A full root clink semaphore is a transient
|
|
196
|
+
failure; an author still busy after its retries is recorded `missing: busy`.
|
|
197
|
+
Busy detection uses the persisted `failureKind: "busy_before_spawn"`; legacy
|
|
198
|
+
and stdio records without it count as busy only when `failureClass` is
|
|
199
|
+
`transient` and the error starts with the root semaphore message.
|
|
200
|
+
- **Blind judging.** Presentation order is a deterministic permutation from
|
|
201
|
+
`frozen_digest` and `run_id`; aliases follow it. Routes, CLI names and stances
|
|
202
|
+
never enter the judge view.
|
|
203
|
+
- **Evidence.** The owner record has n+3 evidence entries (shared input, n
|
|
204
|
+
candidates, judge view, judge output) and stays within 128 KiB. Status projects
|
|
205
|
+
`comparison` with `status` (`complete`, `incomplete`, `unrecorded`,
|
|
206
|
+
`unavailable`, `capacity_rejected`), `missing_participants`,
|
|
207
|
+
`candidate_count` and `candidate_max_bytes`. `workflow_verification_attach`
|
|
208
|
+
works as for v1.
|
|
209
|
+
- **Runtime.** The arena runs in standalone `createWorkflowServer` with no
|
|
210
|
+
recipe host. Authors and the judge run with the server's `process.cwd()` and
|
|
211
|
+
their stock write-capable adapter flags; read-only behavior is a prompt
|
|
212
|
+
instruction, not a boundary. The run is resumable through `resume_workflow`
|
|
213
|
+
like v1; unlike v1, a failed freeze aborts the run.
|
|
214
|
+
|
|
215
|
+
## Built-in native code ping-pong
|
|
216
|
+
|
|
217
|
+
`ping-pong` (v1.0.0) runs implement → verify → review rounds on a code task in a
|
|
218
|
+
host-owned git worktree, and pauses after every review round so the calling
|
|
219
|
+
agent (the "main agent") admits or rejects each finding. It is root-server only
|
|
220
|
+
(standalone `createWorkflowServer` rejects it) and requires `async: true`.
|
|
221
|
+
`list_workflows` advertises both as `async_only: true` and `root_only: true` (keys
|
|
222
|
+
omitted for every other workflow), and the standalone server leaves `ping-pong`
|
|
223
|
+
out of its listing.
|
|
224
|
+
Contracts: `.ai/plans/arena-ping-pong-orchestration/CONTRACTS.md`.
|
|
225
|
+
|
|
226
|
+
```json
|
|
227
|
+
{
|
|
228
|
+
"name": "run_workflow",
|
|
229
|
+
"arguments": {
|
|
230
|
+
"workflow": "ping-pong",
|
|
231
|
+
"run_id": "pp-001",
|
|
232
|
+
"async": true,
|
|
233
|
+
"members": [
|
|
234
|
+
{"cli_name": "codex", "model": "gpt-6.1-sol", "effort": "high"},
|
|
235
|
+
{"cli_name": "claude", "model": "claude-sonnet-5-5", "effort": "max"}
|
|
236
|
+
],
|
|
237
|
+
"variables": {
|
|
238
|
+
"user_request": "Make parseCsv honor quoted fields with embedded commas and newlines.",
|
|
239
|
+
"rounds": 3,
|
|
240
|
+
"acceptance_manifest": "verification.json"
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
- **Seats.** `members[0]` is the implementer; `members[1..k]` are 1-4 reviewers
|
|
247
|
+
(members 2-5). `chairman`, `chairman_model`, `chairman_effort` and `roster` are
|
|
248
|
+
rejected, and so is a `stance` on any seat (the recipe owns every seat
|
|
249
|
+
prompt). Reviewer seat k in finding ids `R{round}-S{k}-{n}` is `members[k]`.
|
|
250
|
+
- **Inputs.** `user_request` (≤ 16 KiB), `rounds` (1..8, default 3),
|
|
251
|
+
`sign_off_threshold` (integer 0..10, default 9), `active_budget_seconds`
|
|
252
|
+
(default 7200, max 28800; execution time only), `deadline_seconds` (default
|
|
253
|
+
86400, max 259200; absolute, includes decision wait), `acceptance_manifest`
|
|
254
|
+
(required, repository-relative project-check manifest),
|
|
255
|
+
`copy_preparation_manifest`, `acceptance_inputs` (≤ 30), and the usual `cb_*`
|
|
256
|
+
context variables. `pp_seat_plan` and `pp_admission` are server-owned and
|
|
257
|
+
rejected if supplied, as is a non-empty `context_bundle_files`.
|
|
258
|
+
- **Admission (all `-32602` before any state).** Async required; recipe host
|
|
259
|
+
present; an unmarked `CLINKX_ALLOWED_ROOTS` entry covering
|
|
260
|
+
`${CLINKX_HOME}/workspaces` that is not an ancestor of the state dir; a fresh
|
|
261
|
+
run id (no existing recipe run or workspace directory); every acceptance path
|
|
262
|
+
must be a regular file in the pinned baseline commit. The baseline is `HEAD` of
|
|
263
|
+
`CLINKX_WORKFLOWS_WORKSPACE_ROOT`; uncommitted changes are excluded and flagged
|
|
264
|
+
as `baseline_uncommitted_changes_excluded`.
|
|
265
|
+
- **Context.** Preflight reads the implementer worktree at the baseline
|
|
266
|
+
commit, never your checkout. Admission rebases `cb_roots` (empty = the
|
|
267
|
+
workspace root's location inside the worktree, which is the worktree itself
|
|
268
|
+
only when the workspace root is the repository toplevel) and absolute
|
|
269
|
+
`cb_focus_paths` onto the worktree path and records the original → rebased
|
|
270
|
+
mapping in `pp_admission.context_roots`. A path is anchored at the repository
|
|
271
|
+
toplevel or an alias of it (resolved component by component; symlinks and
|
|
272
|
+
`..` are followed only outside the repository, spelling is the on-disk
|
|
273
|
+
name); symlinks inside the repository are never followed, so a path through
|
|
274
|
+
one is judged by the baseline rule below, and a `..` inside the repository
|
|
275
|
+
(or after a named component of a relative focus path) is `-32602`. A root or absolute focus path outside the
|
|
276
|
+
repository, or absent from the baseline commit (uncommitted, untracked, or a
|
|
277
|
+
submodule), is `-32602`; a tracked file with uncommitted edits is accepted
|
|
278
|
+
and bundled at its baseline content. In the baseline tree a root must be a
|
|
279
|
+
directory and a focus path a file or directory; a symlink, or a path below
|
|
280
|
+
one, is `-32602` (the worktree holds the baseline symlink, which could point
|
|
281
|
+
back into your checkout). A relative focus path must name such an entry
|
|
282
|
+
under at least one root (joined onto each root, `..` escapes skipped), else
|
|
283
|
+
`-32602`. After the worktree is created, and before the ack, every rebased
|
|
284
|
+
root and absolute focus path must still canonicalize inside it, or the start
|
|
285
|
+
fails. Recipe runs bypass the
|
|
286
|
+
workflow context cache (no lookup, promotion, eviction or workspace-signature
|
|
287
|
+
git). The bundle is built once and reused by every decide, so in later rounds
|
|
288
|
+
it is stale by design: seats are told the worktree is authoritative, and
|
|
289
|
+
reviewers get the round delta.
|
|
290
|
+
- **Round.** The implementer works in `${CLINKX_HOME}/workspaces/<run_id>/implementer`
|
|
291
|
+
(detached HEAD). After its process group exit is confirmed, the host captures
|
|
292
|
+
the candidate identity (temporary-index `git write-tree`) and delta, checks
|
|
293
|
+
HEAD did not move, rechecks acceptance pins, and runs host verification on the
|
|
294
|
+
worktree. Reviewers then run serially in the same worktree and return strict
|
|
295
|
+
`pp-review-v1` JSON (`sign_off.{approved, score}`, `findings[]` with severity
|
|
296
|
+
`blocker|major|minor|nit`). Rounds ≥ 2 carry a simplification-audit mandate,
|
|
297
|
+
the admitted findings, and bounded `rejected[]` history (`{id, summary?,
|
|
298
|
+
reason}`; no summary for rejections recorded by older builds).
|
|
299
|
+
- **Withhold must be justified.** Each review packet binds, inside its digest,
|
|
300
|
+
`sign_off_threshold` and `findings_budget_remaining` (24 minus the findings
|
|
301
|
+
earlier seats reported this round). A withhold (`approved:false`, or a score
|
|
302
|
+
below the threshold) must cite at least one finding or list ids from the
|
|
303
|
+
packet's `rejected` list in `sign_off.blocking_rejected`, unless the budget is
|
|
304
|
+
0; otherwise the seat fails `unjustified_withhold` (an id outside that list
|
|
305
|
+
fails `schema`). Unverified behavior is reported as an `unverified: …`
|
|
306
|
+
finding. There is no review-only round: a false-positive finding with a
|
|
307
|
+
withheld reviewer cannot be cleared without remediation.
|
|
308
|
+
- **Reviewer retry.** A reviewer attempt that fails `pp-review-v1` validation
|
|
309
|
+
(`invalid_json`, `schema`, `oversize`, `echo_mismatch`, `self_contradictory`,
|
|
310
|
+
`finding_overflow`, `unjustified_withhold`) or with a provider error the child
|
|
311
|
+
classified `transient` that is not a timeout is retried once per seat per
|
|
312
|
+
round, before later seats, only when its process-group exit is confirmed, its
|
|
313
|
+
operation result is durably recorded, the candidate is unchanged and nothing
|
|
314
|
+
stopped the run; budgets are re-checked first. The retry packet adds
|
|
315
|
+
`attempt: 2` and `retry_reason` (a code, never provider text) and has a new
|
|
316
|
+
digest, so echoing attempt 1 fails `echo_mismatch`. Each attempt records its
|
|
317
|
+
own operation, written before dispatch with `attempt`, `retry_reason` (on
|
|
318
|
+
attempt 2), `packet_digest`, and the dispatched packet saved as
|
|
319
|
+
`recipe-evidence/round-<i>/review-<operation id>.json` (`packet_file`,
|
|
320
|
+
`packet_sha256`); a second failure leaves the seat `failed` with that reason.
|
|
321
|
+
The retried dispatch's session log is its own `attempt:2` lane of the same
|
|
322
|
+
call (observability only; the call state still shows one attempt).
|
|
323
|
+
Timeouts, permanent provider errors, unconfirmed exits and engine-side
|
|
324
|
+
failures (output fidelity, artifact write) are not retried; writers never are.
|
|
325
|
+
- **Pause and decide.** After each review round the execution ends as an
|
|
326
|
+
ordinary terminal `succeeded` envelope with the recipe phase
|
|
327
|
+
`awaiting_decision`. `workflow_run_status` adds a `recipe` block
|
|
328
|
+
(`execution_id`, `revision`, `phase`, `pending_findings` (untrusted data),
|
|
329
|
+
`reviewers[{seat, outcome, reason?, score?}]`, `sign_off_threshold`,
|
|
330
|
+
`rounds_used`, `round_cap`, budgets, `deadline_expired` (read-time, only while
|
|
331
|
+
paused at or past `deadline_at`), `worktrees`, `unresolved_operations`,
|
|
332
|
+
`effects_stopped`, `outcome`, `stop_reason`). A paused run is terminal, so it
|
|
333
|
+
is never `orphaned`; `effects_stopped` appears only on a run cancelled or
|
|
334
|
+
failed without its own terminal record. The main agent calls
|
|
335
|
+
`workflow_recipe_decide {run_id, execution_id, revision,
|
|
336
|
+
decision:{admit[{id, rationale}], reject[{id, reason}], audit_requests[], stop}}`
|
|
337
|
+
with every pending id exactly once; with `stop:true` pending ids may be left
|
|
338
|
+
out (recorded unresolved, their bodies kept in `pending_findings`), but
|
|
339
|
+
unknown or duplicate ids are still rejected.
|
|
340
|
+
The wall deadline is checked before completeness: a decision at or after
|
|
341
|
+
`deadline_at`, complete or not, stops the run `deadline_exceeded`. Identical
|
|
342
|
+
retries replay the stored receipt; `stale_decision` returns the current
|
|
343
|
+
execution and revision; `recovery_required` is refused while operations are
|
|
344
|
+
unresolved. `run_busy` and a full admission cap
|
|
345
|
+
(`CLINKX_WORKFLOWS_MAX_CONCURRENT_ASYNC`, default 1, shared with every
|
|
346
|
+
workflow run) are retryable, and the cap also refuses a paused-run cancel
|
|
347
|
+
(`{status:"running", cancellable:false, reason:"run_busy", retryable:true}`).
|
|
348
|
+
`resume_workflow` never resumes a recipe run.
|
|
349
|
+
- **Transitions.** Admitted findings whose set of (severity, path, normalized
|
|
350
|
+
summary) equals the previous decision's → `no_progress` (checked at decide
|
|
351
|
+
time; line and detail do not count); a remediation
|
|
352
|
+
round that leaves the candidate identity unchanged → `no_progress` at the gate,
|
|
353
|
+
with that round's reviewer evidence recorded. Otherwise admitted findings with rounds left → remediation round;
|
|
354
|
+
no rounds left → `round_budget_exhausted` (admitting any finding in the final
|
|
355
|
+
round, even a nit, ends here); nothing admitted and every reviewer
|
|
356
|
+
signed off (approved and score ≥ threshold) → final verification → `qualified`
|
|
357
|
+
or `final_verification_failed`; a failed reviewer seat → `seat_unavailable`;
|
|
358
|
+
withheld sign-off → `no_sign_off`; `stop:true` → `main_agent_stop`.
|
|
359
|
+
- **Stops.** Closed enum: `main_agent_stop`, `round_budget_exhausted`,
|
|
360
|
+
`no_sign_off`, `seat_unavailable`, `no_progress`, `final_verification_failed`,
|
|
361
|
+
`acceptance_input_changed`, `target_changed_during_review`,
|
|
362
|
+
`recovery_required`, `permission_failure`, `deadline_exceeded`,
|
|
363
|
+
`active_budget_exhausted`, `evidence_capacity`, `cancelled`. Recipe outcome
|
|
364
|
+
(`qualified | stopped | failed | cancelled`) is separate from execution status.
|
|
365
|
+
- **Safety rules.** No seat advances while its process-group exit is
|
|
366
|
+
unconfirmed; an uncertain writer operation stops `recovery_required` and is
|
|
367
|
+
never redispatched. Any candidate identity change after the writer's exit
|
|
368
|
+
(by a reviewer or the verifier) voids that round's sign-offs. In-place
|
|
369
|
+
retries are a root-semaphore busy failure before spawn (typed marker, 3
|
|
370
|
+
attempts) and the one reviewer retry; a writer is never retried. A busy
|
|
371
|
+
verification slot is waited on (bounded) without consuming a round. When a
|
|
372
|
+
seat's leader exits, the runner sweeps its process group at once: anything
|
|
373
|
+
the seat left running in the group (a dev server, a watcher) gets SIGKILL
|
|
374
|
+
with no SIGTERM first. This is intended. A descendant that left the group
|
|
375
|
+
and holds no stdio pipe is not detected.
|
|
376
|
+
- **Delivery and retention.** The qualified worktree is delivered in place; it is
|
|
377
|
+
not merged into your checkout. Recipe runs use the failed-run retention TTL
|
|
378
|
+
(`CLINKX_WORKFLOWS_RETAIN_FAILED_DAYS`, default 30) for every terminal status;
|
|
379
|
+
it is also the effective decision TTL of a paused run, and the delivered
|
|
380
|
+
worktree is removed with the run directory, so copy or merge it before then.
|
|
381
|
+
Before pruning, and only when the sidecar records zero unresolved operations,
|
|
382
|
+
the host removes the seats listed in the sidecar's `worktrees` inventory that
|
|
383
|
+
verify against the sidecar's repository (a fresh `git rev-parse
|
|
384
|
+
--git-common-dir` of `baseline.repo_root`), one scoped `git worktree remove`
|
|
385
|
+
each. Anything else under the run's workspace directory is left alone and
|
|
386
|
+
reported as `remaining`, and the prune is vetoed while it exists; a sidecar
|
|
387
|
+
with unresolved operations, without a `worktrees` key, or without a usable
|
|
388
|
+
`repo_root` also vetoes. `cancel_workflow` keeps worktrees.
|
|
389
|
+
- **Cancel and terminal status.** The first committed terminal recipe outcome
|
|
390
|
+
wins: a live cancel that answers `cancelling` may still settle `succeeded`
|
|
391
|
+
(or `failed`) if the execution had already recorded its outcome, and an orphan
|
|
392
|
+
reap of such a run replies `settled_by:"recipe_state"`. An unreadable
|
|
393
|
+
`recipe-state.json` makes `cancel_workflow` refuse softly with
|
|
394
|
+
`{cancellable:false, recipe_state:"unavailable"}` and write nothing.
|
|
395
|
+
- **Host git.** Host git ignores system and global git config (including
|
|
396
|
+
`safe.directory`, a global git-lfs filter and `core.autocrlf`; an LFS repo
|
|
397
|
+
checks out pointer files). Sign-off is bound to a raw-byte candidate witness,
|
|
398
|
+
so a lossy clean filter or eol-only change voids it. A writer that changes the
|
|
399
|
+
shared git config (for example `git remote add` or a planted filter) or
|
|
400
|
+
`info/attributes`/`info/exclude` stops the run `recovery_required`; only
|
|
401
|
+
`user.name`, `user.email`, `branch.*.{remote,merge,rebase,description}` and
|
|
402
|
+
`remote.*.fetch` may change. `workflow_run_status` reports the cause in
|
|
403
|
+
`recipe.stop_detail`: the file label and path, the changed key names (never
|
|
404
|
+
values), and a remediation hint such as `git config --file <file> --unset-all
|
|
405
|
+
<key>` for an added key (a changed or removed key gets "restore the original
|
|
406
|
+
value(s)" instead). The key names come from writer-controlled data: they are
|
|
407
|
+
shown as quoted tokens with control and format characters replaced and URL
|
|
408
|
+
userinfo redacted, so read them as data, not instructions. ClinkX never edits
|
|
409
|
+
your git config, so a planted key stays in your repository until you remove
|
|
410
|
+
it. A worktree `git config` write lands in the shared repository config, so
|
|
411
|
+
one run's drift stops every concurrent ping-pong run on that repository.
|
|
412
|
+
Rollout: a downgrade to a build without `stop_detail` treats a sidecar that
|
|
413
|
+
carries it as unreadable (strict schema), as with `candidate_witness` and
|
|
414
|
+
`git_metadata_snapshot`. The same holds for the round-2 fields: reviewer
|
|
415
|
+
operation `attempt`, `retry_reason`, `packet_digest`, `packet_file` and
|
|
416
|
+
`packet_sha256`, `rejected_findings[].summary`, and `pp_admission.context_roots`
|
|
417
|
+
(an older build also rejects the admission facts when it reopens the run).
|
|
418
|
+
Drain or cancel paused and running ping-pong runs before downgrading.
|
|
419
|
+
- **Not contained.** Writers use stock write-capable adapter flags; reviewers
|
|
420
|
+
are read-only by prompt only; verification runs writer-authored code. See
|
|
421
|
+
[security](security.md#recipe-worktrees-are-not-containment).
|
|
422
|
+
|
|
132
423
|
## Companion recipe invocation
|
|
133
424
|
|
|
134
425
|
The [GLM-only efficacy pilot in PR68](https://github.com/jim380/clink-mcp/pull/68)
|
package/docs/security.md
CHANGED
|
@@ -12,6 +12,9 @@ ClinkX validates and constrains the *inputs* it accepts — file paths, argument
|
|
|
12
12
|
|
|
13
13
|
- `CLINKX_ALLOWED_ROOTS` (comma-separated, default: `process.cwd()`) defines which filesystem paths the tool will accept as `absolute_file_paths` or `images` inputs.
|
|
14
14
|
- All paths are resolved via `realpath` — symlink escapes are blocked.
|
|
15
|
+
- A directory entry admits that directory and its descendants. An existing regular-file entry is an exact-file grant: it resolves to the canonical file and admits only that path, never siblings, name prefixes such as `file.bak`, or child paths.
|
|
16
|
+
- An entry that is a dangling symlink, inaccessible (`EACCES`, `EPERM`, `ENOTDIR`, `ELOOP`), or neither a directory nor a regular file fails startup (`-32602` on tool paths) with `CLINKX_ALLOWED_ROOTS entry "<entry>" is unusable: <reason>. Fix or remove this entry from CLINKX_ALLOWED_ROOTS.` A nonexistent entry is still accepted.
|
|
17
|
+
- The server also admits its workflow state and artifact roots as artifact-only, directory-only entries. A state or artifacts override equal to the home directory or one of its ancestors is accepted with a startup warning, because any file in that tree can then be passed as a direct file reference that subprocess CLIs read, and ClinkX child processes may write anywhere in it; a filesystem root is rejected, including a TMPDIR-derived artifacts default that resolves to one. See [Durable storage roots](configuration.md#durable-storage-roots).
|
|
15
18
|
- Startup refuses to run from filesystem root (`/` or drive root) unless `CLINKX_ALLOWED_ROOTS` is explicitly set.
|
|
16
19
|
|
|
17
20
|
### Context builder validation
|
|
@@ -221,6 +224,90 @@ The subprocess shares the user's filesystem. The run directory is a convenience
|
|
|
221
224
|
|
|
222
225
|
`context_builder` artifacts are also not a security boundary. They are durable files intended to be attached to later `clink` calls. Treat `manifest.json`, `bundle.md`, and candidate artifacts as local working artifacts with manual retention and cleanup expectations.
|
|
223
226
|
|
|
227
|
+
### Recipe worktrees are not containment
|
|
228
|
+
|
|
229
|
+
The `ping-pong` recipe runs writer seats in host-owned git worktrees under
|
|
230
|
+
`${CLINKX_HOME}/workspaces/<run_id>/<seat>`. Worktrees separate directories, not
|
|
231
|
+
privileges:
|
|
232
|
+
|
|
233
|
+
- Every recipe seat uses its stock adapter flags (`--dangerously-bypass-approvals-and-sandbox`,
|
|
234
|
+
`--permission-mode acceptEdits`, `--dangerously-skip-permissions`, `--always-approve`).
|
|
235
|
+
A writer can change anything the host user can change, including peer
|
|
236
|
+
worktrees and the source repository. Reviewer and judge seats are read-only by
|
|
237
|
+
prompt only. `architecture-arena` authors and judge run in the server's
|
|
238
|
+
`process.cwd()` with the same flags.
|
|
239
|
+
- Host verification (`verification_run` machinery) runs writer-authored code on
|
|
240
|
+
the host. Copy-preparation manifests are not sandboxed. Check cleanup routes
|
|
241
|
+
every group probe and signal through the same retiring process-group handle
|
|
242
|
+
as the runner: SIGKILL only for a group a probe saw alive, never past EPERM,
|
|
243
|
+
and a PGID is never addressed again after ESRCH.
|
|
244
|
+
- Recipe admission requires an unmarked `CLINKX_ALLOWED_ROOTS` entry covering
|
|
245
|
+
`${CLINKX_HOME}/workspaces`; that grant also makes the directory an eligible
|
|
246
|
+
`context_builder` source root when a call names it. Ping-pong context
|
|
247
|
+
preflight reads the implementer worktree at the baseline commit (roots and
|
|
248
|
+
absolute focus paths rebased at admission, anything outside the repository
|
|
249
|
+
rejected), not the live checkout. Because admission canonicalizes against the
|
|
250
|
+
live checkout but the worktree holds the baseline tree, a root or focus path
|
|
251
|
+
that is (or sits below) a symlink in the baseline is rejected, relative
|
|
252
|
+
focus paths must exist in the baseline under a root, and the start fails
|
|
253
|
+
before the ack if any rebased anchor canonicalizes outside the worktree.
|
|
254
|
+
Preflight skips the workflow context cache, so it
|
|
255
|
+
never runs the cache's workspace-signature git, which is not isolated
|
|
256
|
+
(`git diff --binary` with inherited environment and config).
|
|
257
|
+
- The host performs every git operation with hardened argv (`core.hooksPath=/dev/null`,
|
|
258
|
+
`core.fsmonitor=false`, `core.attributesFile=/dev/null`, forced
|
|
259
|
+
`core.filemode`/`core.symlinks` for identity) and an isolated environment
|
|
260
|
+
(`GIT_CONFIG_NOSYSTEM=1`, `GIT_CONFIG_GLOBAL=/dev/null`, `GIT_ATTR_NOSYSTEM=1`;
|
|
261
|
+
`GIT_CONFIG_PARAMETERS`/`GIT_CONFIG_COUNT`/`GIT_CONFIG_SYSTEM` dropped), so
|
|
262
|
+
only the repository's own config applies; global-only settings such as
|
|
263
|
+
`safe.directory`, a global git-lfs filter or `core.autocrlf` no longer affect
|
|
264
|
+
host git. It re-binds the directory chain from `$CLINKX_HOME` down around every
|
|
265
|
+
git call, and never runs a repository-wide `git worktree prune`. A same-user
|
|
266
|
+
process can still race the final re-check and git's own path resolution inside
|
|
267
|
+
one call.
|
|
268
|
+
- A writer can still reach the shared repository metadata. The host snapshots
|
|
269
|
+
shared config, `config.worktree` and `info/attributes`/`info/exclude` digests
|
|
270
|
+
at worktree creation (persisted in the sidecar) and rechecks them before every
|
|
271
|
+
later host git spawn, and the git dir and common dir that git resolves for the
|
|
272
|
+
seat must still be the snapshotted ones (a re-pointed `.git` link drifts); a
|
|
273
|
+
change outside `user.name`, `user.email`,
|
|
274
|
+
`branch.*.{remote,merge,rebase,description}` and `remote.*.fetch` (for example
|
|
275
|
+
a planted clean filter or `git remote add`) stops the run `recovery_required`
|
|
276
|
+
before host git runs it, naming the file and keys but never values. The
|
|
277
|
+
sidecar and `workflow_run_status` carry that cause as a bounded
|
|
278
|
+
`recipe.stop_detail` (at most 600 characters) with a remediation hint. ClinkX
|
|
279
|
+
never edits or reverts the user's git metadata, because it cannot tell a
|
|
280
|
+
writer-planted key from one the user added: a planted key persists in the
|
|
281
|
+
repository until the user removes it. Worktree `git config` writes go to the
|
|
282
|
+
shared repository config, so drift from one run stops every concurrent
|
|
283
|
+
ping-pong run on the same repository. Not covered: a file reached through
|
|
284
|
+
`include.path`, or a change landing between the recheck and git's own read.
|
|
285
|
+
- Reviewer sign-off binds to a raw-byte candidate witness (mode, path, raw bytes
|
|
286
|
+
or symlink target over the throwaway-index path list), not only the git tree
|
|
287
|
+
id, so a lossy clean filter or eol-only change cannot carry a stale sign-off
|
|
288
|
+
forward.
|
|
289
|
+
- Cleanup removes only sidecar-inventoried seats that verify against the
|
|
290
|
+
sidecar's repository; foreign or unverified entries under the run's workspace
|
|
291
|
+
directory are preserved and veto the prune.
|
|
292
|
+
- The recipe cwd is accepted only for a real linked worktree seat (gitfile,
|
|
293
|
+
admin back-pointer and commondir checks) and is not reachable from the public
|
|
294
|
+
`clink` schema. Binding a seat to its run is the recipe runtime's job.
|
|
295
|
+
- Runner exit confirmation (`recipeExitConfirm`) sweeps the child's process
|
|
296
|
+
group on leader exit and, unless exit is already confirmed, after `close`, sending SIGKILL only after a
|
|
297
|
+
`kill(-pid, 0)` probe shows the group alive. Only ESRCH confirms exit; EPERM
|
|
298
|
+
never does. After any ESRCH the group handle is retired and its (reusable)
|
|
299
|
+
PGID is never probed or signalled again, for recipe and non-recipe children
|
|
300
|
+
alike. An unconfirmed recipe call settles after a bounded deadline with
|
|
301
|
+
`exited:false` and stays registered for shutdown. Host `runGit` runs detached
|
|
302
|
+
in its own process group, is swept at shutdown, and refuses to spawn after the
|
|
303
|
+
shutdown latch. A recipe child that emits `'error'` after spawn stays
|
|
304
|
+
registered until a sweep confirms its exit. Descendants that leave the process
|
|
305
|
+
group (`setsid`, daemonizing) are not covered unless they still hold a stdio
|
|
306
|
+
pipe: one that also closes its stdio is reported `exited:true` while alive
|
|
307
|
+
(a residual pinned by `tests/runner.test.ts`). On Linux, a group left
|
|
308
|
+
with only unreaped zombies (non-reaping PID 1 in a container) reports
|
|
309
|
+
"unconfirmed", and the recipe stops with `recovery_required`.
|
|
310
|
+
|
|
224
311
|
### Delegate mode is not a sandbox
|
|
225
312
|
|
|
226
313
|
When `context_builder` runs with `delegate.enabled:true`, curator and finalizer
|
|
@@ -8,7 +8,10 @@ dependencies are required. Install Node 24 or newer, ClinkX, and whatever your
|
|
|
8
8
|
own check commands require on the MCP server's host.
|
|
9
9
|
|
|
10
10
|
Project execution v1 supports macOS and Linux/POSIX hosts because cleanup owns
|
|
11
|
-
POSIX process groups
|
|
11
|
+
POSIX process groups: each check's group gets SIGTERM, then SIGKILL only if a
|
|
12
|
+
probe still sees it alive. Only ESRCH confirms cleanup; EPERM reports
|
|
13
|
+
`cleanup_failure`, and a group seen gone is never signalled again. A Windows
|
|
14
|
+
run returns a prerequisite error. Provider
|
|
12
15
|
readiness is a separate tool, [`provider_doctor`](../configuration.md#provider-readiness-doctor).
|
|
13
16
|
|
|
14
17
|
## Configure project and evidence access
|
|
@@ -139,7 +142,10 @@ checks identities and digests, and recomputes coverage without trusting a cached
|
|
|
139
142
|
success summary. Missing, changed, extra, or conflicting evidence cannot establish
|
|
140
143
|
a complete result. Keep the same installed verifier version and project input
|
|
141
144
|
bytes available when you intend to inspect the original run; changes make the
|
|
142
|
-
original evidence inapplicable.
|
|
145
|
+
original evidence inapplicable. The verifier identity digests its installed
|
|
146
|
+
runtime files (including the process-group cleanup module), so an upgrade that
|
|
147
|
+
changes any of them also makes older evidence inapplicable. Run a new attempt
|
|
148
|
+
to qualify a new state.
|
|
143
149
|
|
|
144
150
|
The runner rehashes declared inputs before and after execution. A command may
|
|
145
151
|
write outputs not listed as inputs, but changing a declared input makes the run
|
|
@@ -251,6 +257,22 @@ verification coverage, and owner acceptance remain independent; acceptance is
|
|
|
251
257
|
not recorded by this tool.
|
|
252
258
|
|
|
253
259
|
|
|
260
|
+
## Recipe worktree verification
|
|
261
|
+
|
|
262
|
+
The `ping-pong` recipe reuses this verification service on its host-owned
|
|
263
|
+
worktree (see [engineering recipes](../engineering-recipes.md#built-in-native-code-ping-pong)).
|
|
264
|
+
The acceptance manifest, optional copy-preparation manifest and declared
|
|
265
|
+
acceptance inputs must be regular files in the pinned baseline commit; their
|
|
266
|
+
digests are pinned by the controller and re-compared immediately before every
|
|
267
|
+
verification attempt and after it. A mismatch stops the run
|
|
268
|
+
(`acceptance_input_changed`). Evidence is kept under
|
|
269
|
+
`<runDir>/recipe-evidence/` (outside the worktree), one operation per
|
|
270
|
+
verification sequence. The evidence directory must be absolute, and the host
|
|
271
|
+
rejects it before creating anything when its canonical path is inside the
|
|
272
|
+
worktree or contains it. A check whose process-group cleanup is unconfirmed
|
|
273
|
+
reports `failed`, never `passed`, and stops the run `recovery_required`. The recipe shares the single verification slot with
|
|
274
|
+
`verification_run` and verified-repair and waits for it with a bounded policy.
|
|
275
|
+
|
|
254
276
|
## Native verified repair
|
|
255
277
|
|
|
256
278
|
The installed `verified-repair` workflow combines scoped replacements with these
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "clinkx",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "ClinkX MCP STDIO server \u2014 CLI-to-CLI bridge tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"test:dashboard:e2e:synthetic": "playwright test --config clinkx-workflows/dashboard-ui/playwright.config.ts",
|
|
49
49
|
"test:dashboard:e2e:real-disk": "playwright test --config clinkx-workflows/dashboard-ui/playwright.real-disk.config.ts",
|
|
50
50
|
"test:dashboard:e2e:dual-origin": "playwright test --config clinkx-workflows/dashboard-ui/playwright.dual-origin.config.ts",
|
|
51
|
+
"test:dashboard:e2e:multitenant": "playwright test --config clinkx-workflows/dashboard-ui/playwright.multitenant.config.ts",
|
|
52
|
+
"test:dashboard:e2e:webmcp-hosted-native": "playwright test --config clinkx-workflows/dashboard-ui/playwright.webmcp-hosted.config.ts",
|
|
51
53
|
"bench:light-caller": "node scripts/benchmark/light-caller/run.mjs",
|
|
52
54
|
"prepublishOnly": "node -e \"const root=require('./package.json').dependencies;const sub=require('./clinkx-workflows/package.json').dependencies;const missing=Object.keys(sub).filter(d=>!root[d]);if(missing.length){console.error('Missing from root deps:',missing);process.exit(1);}\""
|
|
53
55
|
},
|
|
@@ -78,9 +80,11 @@
|
|
|
78
80
|
"@vitejs/plugin-react": "^5.2.0",
|
|
79
81
|
"esbuild": "0.27.3",
|
|
80
82
|
"jsdom": "^25.0.1",
|
|
83
|
+
"openid-client": "^6.8.8",
|
|
81
84
|
"postject": "1.0.0-alpha.6",
|
|
82
85
|
"react": "^19.2.7",
|
|
83
86
|
"react-dom": "^19.2.7",
|
|
87
|
+
"stripe": "22.6.2",
|
|
84
88
|
"typescript": "^5.7.0",
|
|
85
89
|
"vite": "^7.3.6",
|
|
86
90
|
"vitest": "^3.0.0"
|
|
@@ -31,6 +31,7 @@ async function loadModules(withProbe) {
|
|
|
31
31
|
redactSecrets: env.redactSecrets,
|
|
32
32
|
redactCredentials: (text) => redaction.redactWithOptions(text, {}),
|
|
33
33
|
preflightEnabled: () => process.env["CLINKX_WORKFLOWS_CONTEXT_PREFLIGHT_ENABLED"]?.trim().toLowerCase() !== "false",
|
|
34
|
+
getClinkxHome: workflowsConfig.getClinkxHome,
|
|
34
35
|
getChildConfigPath: workflowsConfig.getChildConfigPath,
|
|
35
36
|
getDefaultCurator: workflowsConfig.getWorkflowsContextDefaultCurator,
|
|
36
37
|
getContextDefault: workflowsConfig.getWorkflowsContextDefault,
|
|
@@ -242,13 +243,28 @@ function configFiles(path) {
|
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
|
|
245
|
-
function
|
|
246
|
+
function jsonFilesInDirectory(dir) {
|
|
247
|
+
if (!existsSync(dir)) return [];
|
|
248
|
+
try {
|
|
249
|
+
return readdirSync(dir).filter((file) => file.endsWith(".json")).sort().map((file) => join(dir, file));
|
|
250
|
+
} catch {
|
|
251
|
+
return [];
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Mirrors discoverConfigPaths() in src/registry.ts; a CLINKX_HOME error has already failed AdapterRegistry.load() with its own message.
|
|
256
|
+
function standardConfigFiles(getClinkxHome) {
|
|
246
257
|
const envPath = process.env["CLINKX_CONFIG_PATH"];
|
|
247
258
|
if (envPath != null && envPath !== "") return configFiles(envPath);
|
|
248
259
|
const xdgHome = process.env["XDG_CONFIG_HOME"] ?? join(homedir(), ".config");
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
260
|
+
let homeTier = [];
|
|
261
|
+
try {
|
|
262
|
+
homeTier = [join(getClinkxHome(), "adapters")];
|
|
263
|
+
} catch {
|
|
264
|
+
homeTier = [];
|
|
265
|
+
}
|
|
266
|
+
return [...homeTier, join(xdgHome, "clinkx", "adapters"), join(PACKAGE_ROOT, "conf", "adapters")]
|
|
267
|
+
.flatMap(jsonFilesInDirectory);
|
|
252
268
|
}
|
|
253
269
|
|
|
254
270
|
function jsonErrorLocation(message, raw) {
|
|
@@ -297,7 +313,7 @@ export async function runDoctor(probes, signal) {
|
|
|
297
313
|
try {
|
|
298
314
|
standard = m.AdapterRegistry.load();
|
|
299
315
|
} catch (error) {
|
|
300
|
-
fail(null, `adapter registry failed to load: ${describeLoadError(error, standardConfigFiles())}`);
|
|
316
|
+
fail(null, `adapter registry failed to load: ${describeLoadError(error, standardConfigFiles(m.getClinkxHome))}`);
|
|
301
317
|
}
|
|
302
318
|
|
|
303
319
|
const childPath = m.getChildConfigPath();
|