clinkx 1.1.1 → 1.2.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 +60 -0
- package/README.md +97 -13
- package/clinkx-workflows/dist/allowed-roots.js +2 -0
- package/clinkx-workflows/dist/allowed-roots.js.map +1 -1
- package/clinkx-workflows/dist/architecture-comparison/admission.d.ts +5 -0
- package/clinkx-workflows/dist/architecture-comparison/admission.js +50 -0
- package/clinkx-workflows/dist/architecture-comparison/admission.js.map +1 -0
- package/clinkx-workflows/dist/architecture-comparison/contract.d.ts +995 -0
- package/clinkx-workflows/dist/architecture-comparison/contract.js +149 -0
- package/clinkx-workflows/dist/architecture-comparison/contract.js.map +1 -0
- package/clinkx-workflows/dist/architecture-comparison/runtime.d.ts +29 -0
- package/clinkx-workflows/dist/architecture-comparison/runtime.js +387 -0
- package/clinkx-workflows/dist/architecture-comparison/runtime.js.map +1 -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/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 +10 -1
- package/clinkx-workflows/dist/contained-file.js.map +1 -1
- package/clinkx-workflows/dist/council-execution-policy.d.ts +4 -2
- package/clinkx-workflows/dist/council-execution-policy.js +5 -1
- package/clinkx-workflows/dist/council-execution-policy.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/activity-contract.d.ts +72 -72
- package/clinkx-workflows/dist/dashboard/contracts.d.ts +1564 -122
- package/clinkx-workflows/dist/dashboard/contracts.js +4 -0
- package/clinkx-workflows/dist/dashboard/contracts.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/progress-report-contract.d.ts +12 -12
- package/clinkx-workflows/dist/dashboard/progress-report-status-overlay.d.ts +8 -8
- package/clinkx-workflows/dist/dashboard/scanner.d.ts +3 -0
- package/clinkx-workflows/dist/dashboard/scanner.js +27 -0
- package/clinkx-workflows/dist/dashboard/scanner.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/session-log-contract.d.ts +48 -48
- 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/session-log-redaction.d.ts +2 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js +4 -0
- package/clinkx-workflows/dist/dashboard/session-log-redaction.js.map +1 -1
- package/clinkx-workflows/dist/dashboard/verified-repair-contract.d.ts +191 -0
- package/clinkx-workflows/dist/dashboard/verified-repair-contract.js +28 -0
- package/clinkx-workflows/dist/dashboard/verified-repair-contract.js.map +1 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-BdpmbPps.js +115 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/style-Im5i1iAs.css +1 -0
- package/clinkx-workflows/dist/dashboard-ui/index.html +2 -2
- package/clinkx-workflows/dist/engine.d.ts +6 -0
- package/clinkx-workflows/dist/engine.js +78 -7
- package/clinkx-workflows/dist/engine.js.map +1 -1
- package/clinkx-workflows/dist/index.d.ts +3 -0
- package/clinkx-workflows/dist/index.js +3 -2
- package/clinkx-workflows/dist/index.js.map +1 -1
- package/clinkx-workflows/dist/reducers/index.d.ts +9 -1
- package/clinkx-workflows/dist/reducers/index.js +22 -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/server.js +5 -2
- package/clinkx-workflows/dist/server.js.map +1 -1
- package/clinkx-workflows/dist/state-schema.d.ts +13 -0
- package/clinkx-workflows/dist/state.d.ts +7 -1
- package/clinkx-workflows/dist/state.js +90 -19
- package/clinkx-workflows/dist/state.js.map +1 -1
- package/clinkx-workflows/dist/validators/architecture-comparison.d.ts +2 -0
- package/clinkx-workflows/dist/validators/architecture-comparison.js +12 -0
- package/clinkx-workflows/dist/validators/architecture-comparison.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/verified-repair.d.ts +2 -0
- package/clinkx-workflows/dist/validators/verified-repair.js +12 -0
- package/clinkx-workflows/dist/validators/verified-repair.js.map +1 -0
- package/clinkx-workflows/dist/verification-proof.d.ts +254 -0
- package/clinkx-workflows/dist/verification-proof.js +195 -0
- package/clinkx-workflows/dist/verification-proof.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/admission.d.ts +72 -0
- package/clinkx-workflows/dist/verified-repair/admission.js +63 -0
- package/clinkx-workflows/dist/verified-repair/admission.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/contract.d.ts +1910 -0
- package/clinkx-workflows/dist/verified-repair/contract.js +127 -0
- package/clinkx-workflows/dist/verified-repair/contract.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/host.d.ts +32 -0
- package/clinkx-workflows/dist/verified-repair/host.js +2 -0
- package/clinkx-workflows/dist/verified-repair/host.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/prompts.d.ts +12 -0
- package/clinkx-workflows/dist/verified-repair/prompts.js +58 -0
- package/clinkx-workflows/dist/verified-repair/prompts.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/result.d.ts +16 -0
- package/clinkx-workflows/dist/verified-repair/result.js +102 -0
- package/clinkx-workflows/dist/verified-repair/result.js.map +1 -0
- package/clinkx-workflows/dist/verified-repair/runtime.d.ts +28 -0
- package/clinkx-workflows/dist/verified-repair/runtime.js +186 -0
- package/clinkx-workflows/dist/verified-repair/runtime.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 +7 -3
- package/clinkx-workflows/dist/workflow-tools.js +487 -46
- package/clinkx-workflows/dist/workflow-tools.js.map +1 -1
- package/clinkx-workflows/dist/workflow-verification-contract.d.ts +539 -0
- package/clinkx-workflows/dist/workflow-verification-contract.js +52 -0
- package/clinkx-workflows/dist/workflow-verification-contract.js.map +1 -0
- package/clinkx-workflows/dist/workflow-verification.d.ts +15 -0
- package/clinkx-workflows/dist/workflow-verification.js +218 -0
- package/clinkx-workflows/dist/workflow-verification.js.map +1 -0
- package/clinkx-workflows/templates/architecture-comparison/candidate.txt +29 -0
- package/clinkx-workflows/templates/architecture-comparison/judge.txt +31 -0
- package/clinkx-workflows/templates/verified-repair/investigate.txt +20 -0
- package/clinkx-workflows/templates/verified-repair/repair.txt +11 -0
- package/clinkx-workflows/templates/verified-repair/review.txt +18 -0
- package/clinkx-workflows/workflows/architecture-comparison.yaml +133 -0
- package/clinkx-workflows/workflows/verified-repair.yaml +104 -0
- package/dist/allowed-roots.d.ts +1 -1
- package/dist/allowed-roots.js +128 -15
- package/dist/allowed-roots.js.map +1 -1
- package/dist/codex/app-server-client.d.ts +1 -0
- package/dist/codex/app-server-client.js +3 -2
- package/dist/codex/app-server-client.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/diagnostics.d.ts +1 -0
- package/dist/context-builder/diagnostics.js +1 -1
- package/dist/context-builder/diagnostics.js.map +1 -1
- package/dist/context-builder/discovery.d.ts +18 -1
- package/dist/context-builder/discovery.js +69 -1
- package/dist/context-builder/discovery.js.map +1 -1
- package/dist/context-builder/handler.js +8 -1
- package/dist/context-builder/handler.js.map +1 -1
- package/dist/context-builder/lifecycle-contract.d.ts +24 -24
- 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/refine-handler.js +16 -1
- package/dist/context-builder/refine-handler.js.map +1 -1
- package/dist/context-builder/secrets.d.ts +11 -0
- package/dist/context-builder/secrets.js +75 -0
- 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 +5 -2
- package/dist/context-builder/versions.js +5 -2
- package/dist/context-builder/versions.js.map +1 -1
- package/dist/dashboard-cli.d.ts +6 -0
- package/dist/dashboard-cli.js +18 -32
- package/dist/dashboard-cli.js.map +1 -1
- package/dist/dashboard-gateway/main.js +8 -3
- package/dist/dashboard-gateway/main.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/project-verification/contract.d.ts +537 -0
- package/dist/project-verification/contract.js +40 -0
- package/dist/project-verification/contract.js.map +1 -0
- package/dist/project-verification/files.d.ts +23 -0
- package/dist/project-verification/files.js +80 -0
- package/dist/project-verification/files.js.map +1 -0
- package/dist/project-verification/process.d.ts +7 -0
- package/dist/project-verification/process.js +115 -0
- package/dist/project-verification/process.js.map +1 -0
- package/dist/project-verification/runner.d.ts +35 -0
- package/dist/project-verification/runner.js +185 -0
- package/dist/project-verification/runner.js.map +1 -0
- package/dist/project-verification/service.d.ts +37 -0
- package/dist/project-verification/service.js +151 -0
- package/dist/project-verification/service.js.map +1 -0
- package/dist/provider-doctor.d.ts +22 -0
- package/dist/provider-doctor.js +22 -0
- package/dist/provider-doctor.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/server.js +41 -6
- package/dist/server.js.map +1 -1
- package/dist/verification-tools.d.ts +90 -0
- package/dist/verification-tools.js +120 -0
- package/dist/verification-tools.js.map +1 -0
- package/dist/verified-repair/files.d.ts +22 -0
- package/dist/verified-repair/files.js +114 -0
- package/dist/verified-repair/files.js.map +1 -0
- package/dist/verified-repair/host.d.ts +14 -0
- package/dist/verified-repair/host.js +612 -0
- package/dist/verified-repair/host.js.map +1 -0
- package/docs/configuration.md +224 -12
- package/docs/engineering-recipes.md +415 -0
- package/docs/security.md +3 -0
- package/docs/verification/README.md +59 -0
- package/docs/verification/dashboard-real-disk.md +436 -0
- package/docs/verification/project-checks.example.json +14 -0
- package/docs/verification/project-checks.md +444 -0
- package/docs/verification/workflow-handoff.md +113 -0
- package/package.json +10 -2
- package/scripts/provider-doctor-core.mjs +380 -0
- package/scripts/provider-doctor-probe.mjs +34 -0
- package/clinkx-workflows/dist/dashboard-ui/assets/index-JPHQVtn9.js +0 -106
- package/clinkx-workflows/dist/dashboard-ui/assets/style-DOMHk-j6.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,65 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.2.0 — 2026-10-20
|
|
4
|
+
|
|
5
|
+
### Upgrade notes
|
|
6
|
+
|
|
7
|
+
- There is no automatic migration. Durable data now lives under `~/.clinkx`; data written by earlier builds stays under `~/.local/state/clinkx-workflows` and `~/.local/state/clinkx/context-builder/runs` until you act. Pick one path from [Migrating to `CLINKX_HOME`](docs/configuration.md#migrating-to-clinkx_home): start fresh and keep the old directories as an archive; copy workflow state and user configuration into `~/.clinkx` with producers stopped, merging rather than overwriting; or pin the old directories with `CLINKX_WORKFLOWS_STATE_DIR` and `CLINKX_CONTEXT_BUILDER_RUNS_DIR`. Do not move `context-builder/runs`.
|
|
8
|
+
- Runs moved from the previous default stay non-resumable because the state path is part of their resume fingerprint. `CLINKX_HOME` itself is not part of that fingerprint.
|
|
9
|
+
- A dashboard that still mounts or reads the old directories shows only runs written before the upgrade. Point it at the producers' current directories and recreate the dashboard companion or local stack.
|
|
10
|
+
- `CLINKX_ALLOWED_ROOTS` entries that are dangling symlinks, inaccessible, or neither a directory nor a regular file now fail startup instead of being kept leniently. Fix or remove them before upgrading.
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `workflow_run_wait({run_id, expected_execution_id?})` observes a local workflow execution until its cleanup fence, for a fixed 30-second server-owned budget per call, and returns the metadata-only status projection plus `wait:{outcome, execution_id?, budget_ms, elapsed_ms}`. Outcomes are `settled`, `budget_elapsed`, `not_owned`, `orphaned`, `not_found`, `identity_changed` and `identity_unavailable`; they are observation outcomes, not new run statuses. Re-arm `budget_elapsed` with the same pin; cancelling a wait detaches only that observation.
|
|
15
|
+
- Workflow executions carry an opaque `execution_id`: on the async `run_workflow` acknowledgement, and in one trailing identity block `{resolved_roster?, execution_id?}` on blocking `run_workflow` and `resume_workflow` results. It is a fence, not a capability. `workflow_run_status` accepts an optional `expected_execution_id`; a pinned read of a different or unprovable execution returns `isError` `identity_changed` / `identity_unavailable` with no result, and a persistently changing active state returns the retryable `state_read_unstable`. Unpinned calls are unchanged.
|
|
16
|
+
- The execution id is persisted in `state.json` (optional `executionId`, `state_version` stays 1), so a pin settles from disk after a ClinkX restart or eviction from the 128-entry settled window when the run is terminal, stamped with that id, carries a matching `executionCompletedAt` witness, and its `run.lock` is released. A run last written by an older ClinkX (which carries the id forward without the witness) fails closed as `identity_unavailable` instead of settling on that build's outcome. Contract: `.ai/plans/workflow-completion-wait/CONTRACT.md`.
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
|
|
20
|
+
- Durable ClinkX data now defaults to `~/.clinkx`, configurable with `CLINKX_HOME` (absolute; its canonical identity must not be a filesystem root, the effective home directory, or an ancestor of that home such as `/Users`). Workflow state moves from `~/.local/state/clinkx-workflows`; context-builder runs move from `~/.local/state/clinkx/context-builder/runs` to `~/.clinkx/context-builder/runs`; user adapters and rosters search `~/.clinkx/{adapters,rosters}` before the retained XDG config tier. Per-area overrides still take precedence, and temporary scratch paths are unchanged.
|
|
21
|
+
- `XDG_STATE_HOME` no longer controls durable storage. Standalone workflow children receive resolved `CLINKX_HOME` and `CLINKX_WORKFLOWS_STATE_DIR` after environment scrubbing. The parent's context-run override is scrubbed; child context artifacts use `CLINKX_HOME/context-builder/runs`.
|
|
22
|
+
- State and artifact roots remain automatically admitted even with an explicit workspace allowlist. Under the consolidated default, direct `clink` references can read adapters, rosters and context artifacts without context-builder secret filtering. Use a separate state override to keep configuration outside the automatic state grant. Deleting the whole ClinkX home also deletes user adapters and rosters.
|
|
23
|
+
- `CLINKX_WORKFLOWS_STATE_DIR` and `CLINKX_WORKFLOWS_ARTIFACTS_DIR` reject a filesystem root or an alias of one at every entrypoint, including the standalone workflow server and an unset artifacts override whose TMPDIR-derived default resolves to one; before, only the root server rejected it. A relative `CLINKX_WORKFLOWS_ARTIFACTS_DIR` is now rejected instead of resolving against the process cwd. A value equal to the effective home, an alias of it, or an ancestor of it is still accepted, but both STDIO servers log one startup warning because it is auto-admitted as an artifact-only allowed root. Generic `CLINKX_ALLOWED_ROOTS` entries and `CLINKX_CONTEXT_BUILDER_RUNS_DIR` rules are unchanged. See the storage-root policy table in `docs/configuration.md`.
|
|
24
|
+
- A `CLINKX_ALLOWED_ROOTS` entry that names an existing regular file is an exact-file grant: it resolves to the canonical file and admits only that file, not its siblings, name prefixes, or child paths. A dangling symlink, an inaccessible path (`EACCES`, `EPERM`, `ENOTDIR`, `ELOOP`), or an entry that is neither a directory nor a regular file fails startup with `CLINKX_ALLOWED_ROOTS entry "<entry>" is unusable: <reason>. Fix or remove this entry from CLINKX_ALLOWED_ROOTS.` (`-32602` on tool paths). Nonexistent plain entries are still accepted. Automatically produced state and artifact roots stay directory-only.
|
|
25
|
+
- The local and companion dashboard Compose files default the state and context-run bind sources to `${HOME}/.clinkx` and `${HOME}/.clinkx/context-builder/runs`. The workspace mount stays required, the sources must already exist, and the cloud file keeps explicit sources. One gateway deployment accepts one live companion; a second gets HTTP 409. `DASHBOARD_DEPLOYMENT_SLUG` only names Docker resources on one host.
|
|
26
|
+
- When the adapter registry fails to load on a JSON syntax error, `provider_doctor` names the broken file by searching in registry order: `CLINKX_CONFIG_PATH` when set, otherwise `$CLINKX_HOME/adapters`, then the XDG config tier, then the packaged adapters. `scripts/verified-repair/qualify-installed.mjs` derives its state directory from `getStateDir()` instead of a fixed path.
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Home validation rejects symlink aliases to the effective home or filesystem root, including aliases in the default `.clinkx` path. Valid narrow symlinks and nonexistent first-run directories remain supported; accepted spelling is preserved for resume identity.
|
|
31
|
+
- Individual workspace, state, artifact and context-run roots reject commas in supplied, canonical and prospective canonical paths before allow-root serialization. Relevant path checks run before reconciliation scheduling or context-directory creation. These checks are snapshots, not protection against later symlink retargeting.
|
|
32
|
+
- A workflow context cache entry (`wfctx-*`) moved from another runs root no longer blocks its cache id. Its manifest names the old location, so it can never be admitted; eviction or a promotion conflict now renames it to `.stale-<runId>-<epochms>-<hex>`, the call rebuilds once, and the next identical call hits. Quarantined directories are deleted after the temp TTL (`min(cache TTL, 3600s)`). `wfpre-*`, `ctx_*` and named runs are not touched.
|
|
33
|
+
|
|
34
|
+
## 1.1.2 — 2026-10-09
|
|
35
|
+
|
|
36
|
+
### Added
|
|
37
|
+
|
|
38
|
+
- Built-in `architecture-comparison` through `run_workflow`: two parallel authors receive the same bounded frozen packet, a fresh judge receives a separate semantic view with candidate aliases, and a deterministic reducer writes a strict owner-facing comparison record. References, output bounds, retained artifact digests, route bindings, and resume inputs are checked; incomplete evidence stays incomplete. The record preserves independent owner acceptance and states the limits of caller-declared source identity and free-text anonymity.
|
|
39
|
+
- Native `workflow_verification_attach` re-inspects project proof with the owner's original expectations digest and retains a bounded, separately versioned inspection history on a workflow run. MCP status and dashboard detail expose inspected-at applicability, required coverage, check failures and safe digest references, with retention and owner acceptance kept separate. Progress-report test counts remain caller-reported.
|
|
40
|
+
- Native MCP tools `provider_doctor`, `verification_run`, and `verification_inspect` work from an npm installation without a ClinkX clone or client shell access. Readiness is structured and authentication probes are explicit. Project verification runs reviewed argv commands within allowed roots, binds required checks to declared input and verifier identities, and retains private evidence for inspection with the owner's original expectations digest. The proposed standalone doctor/verifier npm CLI entry points were withdrawn before release. No Git or browser is required for project checks.
|
|
41
|
+
- Packaged engineering-recipe wiring, verification overview, project-check guide, and example manifest. Recipe instructions remain in the separately installed companion `chief-of-staff` skill; ClinkX's dashboard and workflow-handoff regression fixtures remain source-only.
|
|
42
|
+
- A source-checkout workflow-handoff verification procedure using the real YAML loader, MCP child session, workflow engine, validators, and artifact store. A host coverage evaluator checks frozen requirements and retained evidence; offline inspection requires the owner's original expectations digest and ignores cached success claims.
|
|
43
|
+
- `scripts/provider-doctor.mjs` remains a source-checkout JSONL wrapper over the shared provider-doctor core. The MCP tool returns structured adapter readiness and a final verdict; all diagnostics are credential-redacted. Documented in `docs/configuration.md`.
|
|
44
|
+
- A real-disk doctor (`clinkx-workflows/dashboard-ui/e2e/real-disk-doctor.mjs`) gates the dashboard real-disk e2e procedure: `preflight` checks node, dist freshness, chromium, the test-child seam, and an isolated `EVIDENCE_ROOT` before exercising the real fixture, `classify` maps a finished run to passed / blocked / not_run / harness_drift / failed_assertion / failed_fixture, and `identity` binds a run to its checkout and built artifacts. `docs/verification/dashboard-real-disk.md` documents the repeatable procedure.
|
|
45
|
+
- A "Verified bug fix" recipe in `docs/engineering-recipes.md`.
|
|
46
|
+
|
|
47
|
+
### Fixed
|
|
48
|
+
|
|
49
|
+
- Dashboard-doctor Chromium preflight now removes only its owned profile and artifact directory, preserving other concurrent Playwright runs.
|
|
50
|
+
- Provider-doctor interruption stops all concurrent version checks and cancels active authentication probes with their owned descendants before exiting.
|
|
51
|
+
- Provider-doctor probes enforce their own 120-second cancellation deadline regardless of an adapter's timeout floor and require an exit-zero stdout or validated result-contract-file result with the exact trimmed `OK` answer before reporting authentication success.
|
|
52
|
+
- Workflow-handoff inspection preserves independently observed execution, consumer, and cleanup failures when source/build identity has drifted.
|
|
53
|
+
- Secret-redaction warnings deduplicate line numbers with a `Set`, preserving their ordering and bounded output without quadratic array scans.
|
|
54
|
+
- `context_builder` opt-out secret redaction (`allow_secrets:false`) can no longer gut ordinary code: a quote inside a regex literal or a mid-value `key: quote` no longer opens a redaction span that runs to the end of the file, an in-place redaction that would move line breaks or span more than three lines omits the body fail-closed instead of shipping it redacted, and remaining redactions surface as one aggregate `content_secret_redacted` warning. `CONTEXT_DISCOVERY_ALGORITHM_VERSION` advances to 6.
|
|
55
|
+
- A repeated SIGTERM no longer kills the dashboard, dashboard gateway, and server mid-shutdown: SIGTERM/SIGHUP handlers stay installed for repeats, teardown exits explicitly, and the dashboard and gateway close under an 8-second deadline that forces exit if closing stalls.
|
|
56
|
+
- Codex app-server diagnostics now redact hyphenated vendor tokens (`sk-ant-`, `sk-proj-`, `sk-or-`) in stderr and recent-failure text.
|
|
57
|
+
|
|
58
|
+
### Docs
|
|
59
|
+
|
|
60
|
+
- Recipe wiring pins the merged three-recipe companion revision and records the completed evaluation and settled secret-policy decision.
|
|
61
|
+
- The pstack integration evaluation for ClinkX (reports, three-arm evaluation protocol, and implementation plan under `.ai/plans/`), the dashboard verification runbook (`docs/verification/`), and the opt-out redaction bound in the context-builder notes.
|
|
62
|
+
|
|
3
63
|
## 1.1.1 — 2026-10-05
|
|
4
64
|
|
|
5
65
|
### Changed
|
package/README.md
CHANGED
|
@@ -60,9 +60,14 @@ ClinkX starts the Codex CLI, sends the prompt and the file references, and retur
|
|
|
60
60
|
| `clink` | Runs one task on one configured CLI and returns the result. |
|
|
61
61
|
| `context_builder` | Selects a bounded set of files from permitted roots and writes a reusable context bundle to disk. |
|
|
62
62
|
| `refine_context_run` | Makes a new bundle from an earlier one. You can add, remove, promote, or demote files, or set their slices. |
|
|
63
|
+
| `provider_doctor` | Checks provider configuration, executables, and startup readiness. Optional explicit probes make real authentication calls. |
|
|
64
|
+
| `verification_run` | Runs a reviewed project-check manifest and retains private evidence with a digest for later inspection. |
|
|
65
|
+
| `verification_inspect` | Reassesses retained evidence using the original owner-held digest, without running project commands. |
|
|
66
|
+
| `workflow_verification_attach` | Re-inspects proof with the original owner-held digest and records its historical coverage on a workflow run. |
|
|
63
67
|
| `list_workflows` | Lists the available workflows, CLIs, and roster presets. |
|
|
64
68
|
| `run_workflow` | Starts a multi-stage workflow. Runs in blocking mode by default, or in the background with `async: true`. |
|
|
65
|
-
| `workflow_run_status` | Reports
|
|
69
|
+
| `workflow_run_status` | Reports persisted progress and results; optional `expected_execution_id` guards the selected local execution. |
|
|
70
|
+
| `workflow_run_wait` | Observes local execution completion for up to 30 seconds without cancelling the worker when observation stops. |
|
|
66
71
|
| `resume_workflow` | Continues a workflow run that stopped before completion. |
|
|
67
72
|
| `cancel_workflow` | Cancels a workflow run. |
|
|
68
73
|
| `progress_report_start`, `progress_report_update`, `progress_report_get`, `progress_report_list` | Keep a live progress report that the dashboard shows. |
|
|
@@ -74,6 +79,13 @@ Two more tool groups are off by default:
|
|
|
74
79
|
|
|
75
80
|
Each tool publishes its full input schema through MCP. MCP clients can show the schema with the tool description.
|
|
76
81
|
|
|
82
|
+
Readiness and project verification are available through the same npm-installed
|
|
83
|
+
MCP connection; no ClinkX checkout or client shell access is needed. See
|
|
84
|
+
[provider readiness](docs/configuration.md#provider-readiness-doctor) and
|
|
85
|
+
[project checks](docs/verification/project-checks.md) for tool calls, authorized
|
|
86
|
+
project/evidence roots, and evidence limits. Project execution v1 supports
|
|
87
|
+
macOS/Linux and runs trusted manifest commands with the server account's permissions.
|
|
88
|
+
|
|
77
89
|
## Supported CLIs
|
|
78
90
|
|
|
79
91
|
An adapter file tells ClinkX how to start one CLI, how to pass the prompt, and how to read the output. These adapters are included:
|
|
@@ -103,10 +115,11 @@ The `conf/adapters/hapi/` directory in the package holds optional templates that
|
|
|
103
115
|
ClinkX reads adapter JSON files from these locations, in this order. ClinkX uses the first file with a given `name`.
|
|
104
116
|
|
|
105
117
|
1. `CLINKX_CONFIG_PATH`, a file or a directory. When you set it, ClinkX reads only this location and does not load the included adapters. The location must also contain a `codex` adapter with a `json` role, or you must set `CLINKX_WORKFLOWS_CONTEXT_PREFLIGHT_ENABLED=false`.
|
|
106
|
-
2. `${
|
|
107
|
-
3.
|
|
118
|
+
2. `${CLINKX_HOME:-~/.clinkx}/adapters/*.json`.
|
|
119
|
+
3. `${XDG_CONFIG_HOME:-~/.config}/clinkx/adapters/*.json`.
|
|
120
|
+
4. The `conf/adapters/` directory inside the installed package.
|
|
108
121
|
|
|
109
|
-
To change an included adapter, copy its file to `~/.config/clinkx/adapters/` and edit the copy. The copy replaces the included file completely. ClinkX does not merge the two files. After you upgrade ClinkX, compare your copy with the new included file. Copy the new file again if necessary.
|
|
122
|
+
To change an included adapter, copy its file to `${CLINKX_HOME:-~/.clinkx}/adapters/` (or `~/.config/clinkx/adapters/`) and edit the copy. The copy replaces the included file completely. ClinkX does not merge the two files. After you upgrade ClinkX, compare your copy with the new included file. Copy the new file again if necessary.
|
|
110
123
|
|
|
111
124
|
To add a CLI that is not included, write a new file in the same directory. This example adapter returns the prompt unchanged:
|
|
112
125
|
|
|
@@ -127,10 +140,11 @@ These are the variables that most installations set. Every variable has a defaul
|
|
|
127
140
|
|
|
128
141
|
| Variable | Default | Function |
|
|
129
142
|
|---|---|---|
|
|
130
|
-
| `CLINKX_ALLOWED_ROOTS` | Current directory of the server process | Comma-separated list of directories that tool calls can reference. Set it so path checks do not depend on the directory in which the client starts ClinkX. |
|
|
143
|
+
| `CLINKX_ALLOWED_ROOTS` | Current directory of the server process | Comma-separated list of directories that tool calls can reference. An entry that is an existing file allows only that file. An entry that is a broken symlink, that ClinkX cannot access, or that is neither a directory nor a file stops the server at startup. Set it so path checks do not depend on the directory in which the client starts ClinkX. |
|
|
131
144
|
| `CLINKX_WORKFLOWS_WORKSPACE_ROOT` | Current directory of the server process | Workspace for workflows. Set it to the same directory as the allowed root. |
|
|
132
|
-
| `
|
|
133
|
-
| `
|
|
145
|
+
| `CLINKX_HOME` | `~/.clinkx` | Root directory for durable state, context-builder runs, user adapters and rosters. |
|
|
146
|
+
| `CLINKX_WORKFLOWS_STATE_DIR` | `${CLINKX_HOME:-~/.clinkx}` | Directory for workflow runs, progress reports, and dashboard state. |
|
|
147
|
+
| `CLINKX_CONTEXT_BUILDER_RUNS_DIR` | `${CLINKX_HOME:-~/.clinkx}/context-builder/runs` | Directory for `context_builder` runs and bundles. |
|
|
134
148
|
| `CLINKX_CONFIG_PATH` | not set | Replaces the adapter search path. See [Adapter files](#adapter-files). |
|
|
135
149
|
| `CLINKX_ROSTERS_PATH` | not set | Replaces the roster-preset search path. See [Workflows](#workflows). |
|
|
136
150
|
| `CLINKX_MAX_CONCURRENT` | `5` | Maximum number of `clink` processes at one time. ClinkX returns an error when the limit is reached. It does not queue requests. |
|
|
@@ -145,6 +159,10 @@ These are the variables that most installations set. Every variable has a defaul
|
|
|
145
159
|
| `CLINKX_APP_SERVER_ENABLED` | `false` | Set to `true` to publish the Codex app-server tools. |
|
|
146
160
|
| `CLINKX_ELARIS_ENABLED` | `false` | Set to `true` to publish the Elaris tools. |
|
|
147
161
|
|
|
162
|
+
`CLINKX_HOME` resolves to the explicit value, then `$HOME/.clinkx`, then the OS account home plus `/.clinkx` when `HOME` is unset or empty. It must be absolute and must not be a filesystem root, the home directory itself, or a parent of the home directory (for example `/Users`). The root server validates it at startup even when per-area overrides are set. `CLINKX_WORKFLOWS_STATE_DIR` and `CLINKX_WORKFLOWS_ARTIFACTS_DIR` must be absolute and must not be a filesystem root. If one of them is the home directory or a parent of it, the server starts but logs a warning.
|
|
163
|
+
|
|
164
|
+
Earlier versions kept data in `${XDG_STATE_HOME:-~/.local/state}`. ClinkX does not move this data. To keep, copy, or pin the old data, see [Migrating to `CLINKX_HOME`](docs/configuration.md#migrating-to-clinkx_home).
|
|
165
|
+
|
|
148
166
|
ClinkX writes only MCP JSON-RPC to stdout. All logs go to stderr. The server detects the exit of its parent process and stops.
|
|
149
167
|
|
|
150
168
|
## Workflows
|
|
@@ -153,6 +171,8 @@ A workflow runs many CLI calls in stages and returns one result. A council workf
|
|
|
153
171
|
|
|
154
172
|
| Workflow | Purpose |
|
|
155
173
|
|---|---|
|
|
174
|
+
| `architecture-comparison` | Compare two designs using frozen shared input and a fresh judge with candidate aliases. |
|
|
175
|
+
| `verified-repair` | Repair declared existing files in place, reproduce the defect, and prove the fix through native checks and independent causal verification. |
|
|
156
176
|
| `council-answer` | Answer one hard question. |
|
|
157
177
|
| `council-code-review` | Review a change set. |
|
|
158
178
|
| `council-debug` | Find the cause of a defect. |
|
|
@@ -161,7 +181,27 @@ A workflow runs many CLI calls in stages and returns one result. A council workf
|
|
|
161
181
|
| `council-default` | General-purpose council. |
|
|
162
182
|
| `plan-review-receipts` | Typed plan review that returns receipt candidates for an external approval process. |
|
|
163
183
|
|
|
164
|
-
Before the first stage,
|
|
184
|
+
Before the first stage, ordinary workflows run `context_builder` with Codex as curator and finalizer. This step selects the repository files that the members receive. The `codex` command must be on your `PATH`. To skip this step, set `CLINKX_WORKFLOWS_CONTEXT_PREFLIGHT_ENABLED=false`. `verified-repair` uses its host-frozen declared inputs instead of this context preflight.
|
|
185
|
+
|
|
186
|
+
Select `architecture-comparison` explicitly and provide `user_request`,
|
|
187
|
+
`source_identity`, and optional `context_files` in `variables`. Its built-in
|
|
188
|
+
templates and validators ship in the npm package. Two authors receive the same
|
|
189
|
+
frozen packet; the independent judge receives a separate view with candidate
|
|
190
|
+
aliases. The result reports comparison completeness and leaves owner acceptance
|
|
191
|
+
unrecorded. See [engineering recipes](docs/engineering-recipes.md) for an example,
|
|
192
|
+
route settings, bounds, and evidence limits.
|
|
193
|
+
|
|
194
|
+
For a bug fix, invoke the companion `verified-repair` skill in Claude Code,
|
|
195
|
+
Codex, or another connected MCP agent. It prepares the repair contract and
|
|
196
|
+
native manifests, then calls `run_workflow` with
|
|
197
|
+
`workflow: "verified-repair"`. The workflow needs three explicit provider routes
|
|
198
|
+
and separate authorized project, evidence and verification-copy locations on
|
|
199
|
+
the MCP host. It preserves unrelated changes and retains applied edits on
|
|
200
|
+
failure; qualification never records owner acceptance. See the
|
|
201
|
+
[paste-ready agent prompt and MCP calls](docs/engineering-recipes.md#using-verified-repair-from-an-agent-runtime)
|
|
202
|
+
and [minimal contract and manifests](docs/verification/project-checks.md#native-verified-repair).
|
|
203
|
+
The dashboard's **Verified repair** prompt-builder target prepares this caller
|
|
204
|
+
skill invocation for copying; it does not execute the repair or authorize host paths.
|
|
165
205
|
|
|
166
206
|
### Roster presets
|
|
167
207
|
|
|
@@ -178,14 +218,58 @@ A roster preset names the members, the chairman, and the context delegate of a c
|
|
|
178
218
|
The included `default-council` preset uses Codex, Claude, and GLM as members and Codex as chairman. ClinkX reads these locations in this order and uses the first file with a given name:
|
|
179
219
|
|
|
180
220
|
1. `CLINKX_ROSTERS_PATH`, a file or a directory. When you set it, ClinkX reads only this location.
|
|
181
|
-
2. `${
|
|
182
|
-
3.
|
|
221
|
+
2. `${CLINKX_HOME:-~/.clinkx}/rosters/*.json`.
|
|
222
|
+
3. `${XDG_CONFIG_HOME:-~/.config}/clinkx/rosters/*.json`.
|
|
223
|
+
4. The `conf/rosters/` directory inside the installed package.
|
|
183
224
|
|
|
184
|
-
To write your own preset, copy `conf/rosters/default-council.json` to `~/.config/clinkx/rosters/<name>.json` and edit the copy. The file name is the preset name. The preset name must match `^[a-z0-9][a-z0-9_-]{0,63}$`. A request that gives `roster` together with `members`, `chairman`, `chairman_model`, `chairman_effort`, or a non-empty `cb_delegate` returns error `-32602` and starts no run.
|
|
225
|
+
To write your own preset, copy `conf/rosters/default-council.json` to `${CLINKX_HOME:-~/.clinkx}/rosters/<name>.json` (or `~/.config/clinkx/rosters/<name>.json`) and edit the copy. The file name is the preset name. The preset name must match `^[a-z0-9][a-z0-9_-]{0,63}$`. A request that gives `roster` together with `members`, `chairman`, `chairman_model`, `chairman_effort`, or a non-empty `cb_delegate` returns error `-32602` and starts no run.
|
|
185
226
|
|
|
186
227
|
### Background runs
|
|
187
228
|
|
|
188
|
-
Pass `async: true` to `run_workflow` to get a `run_id`
|
|
229
|
+
Pass `async: true` to `run_workflow` to get a `run_id` and an opaque
|
|
230
|
+
`execution_id` immediately. Use the identity to wait for that execution:
|
|
231
|
+
|
|
232
|
+
```json
|
|
233
|
+
{
|
|
234
|
+
"run_id": "my-council-run",
|
|
235
|
+
"expected_execution_id": "<execution_id from launch>"
|
|
236
|
+
}
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
Call `workflow_run_wait` with those arguments. It returns persisted status metadata
|
|
240
|
+
and a `wait` block with `outcome`, optional `execution_id`, `budget_ms`, and
|
|
241
|
+
`elapsed_ms`. On `budget_elapsed`, repeat the wait with the same identity. On
|
|
242
|
+
`settled`, fetch `workflow_run_status` with the same arguments plus
|
|
243
|
+
`include_result: true` to obtain the final result. The wait has a fixed server-owned
|
|
244
|
+
30-second budget; it takes no caller timeout input, and `budget_ms` always reports
|
|
245
|
+
that configured budget. Stopping a wait only detaches that observation. Use
|
|
246
|
+
`cancel_workflow` to stop the worker.
|
|
247
|
+
|
|
248
|
+
A blocking `run_workflow` and `resume_workflow` also return the `execution_id`, in
|
|
249
|
+
a trailing content block `{resolved_roster?, execution_id?}`. Use the returned id
|
|
250
|
+
as the pin. Leave the pin out of a first wait only when no id was returned; it then
|
|
251
|
+
binds to the latest local execution and returns its identity. The id is a fence,
|
|
252
|
+
not a capability: it only selects which execution a read must match.
|
|
253
|
+
|
|
254
|
+
`settled` witnesses completion and cleanup in the owning server process, followed
|
|
255
|
+
by an identity-checked persisted read. `not_owned`, `orphaned` and `not_found`
|
|
256
|
+
return immediately. `not_owned` requires explicit persisted status recovery;
|
|
257
|
+
`orphaned` and `not_found` require checking the run. A run that is still being
|
|
258
|
+
admitted can briefly report `not_found` to an unpinned wait. A rejected start or
|
|
259
|
+
resume never replaces an earlier execution's pin. Identity
|
|
260
|
+
errors (`identity_changed` or `identity_unavailable`) must be surfaced without
|
|
261
|
+
dropping the pin to fetch another execution's result. A pinned
|
|
262
|
+
`workflow_run_status` can return `state_read_unstable` when the state file keeps
|
|
263
|
+
changing during the read; retry it with the same pin after a short pause. The server retains up to 128
|
|
264
|
+
settled metadata identities without active readers, without result text. Active
|
|
265
|
+
executions are never evicted; active observations stay protected until their
|
|
266
|
+
request ends. Eligible inactive settled entries are evicted FIFO. Each run's
|
|
267
|
+
state also records its execution id, so after a restart or eviction a pinned
|
|
268
|
+
wait or status still settles once that execution's state is terminal and its
|
|
269
|
+
run lock is released. A pin on a run that is unfinished, or still locked (for
|
|
270
|
+
example by a crashed owner on another host), reports `identity_unavailable`. Waits do not keep workers alive
|
|
271
|
+
after server exit, and this tool does not promise unsolicited client wakeups.
|
|
272
|
+
Completed runs stay on disk for the retention period given above.
|
|
189
273
|
|
|
190
274
|
## Context bundles
|
|
191
275
|
|
|
@@ -214,7 +298,7 @@ npx -p clinkx clinkx-workflows-dashboard --port 4180
|
|
|
214
298
|
|
|
215
299
|
The dashboard listens on `127.0.0.1` and `::1` and prints `http://localhost:<port>`. Passkey sign-in is the default. On the first start, the dashboard prints one enrollment code. Register a passkey with that code, then sign in. For local tests only, `CLINKX_WORKFLOWS_DASHBOARD_AUTH_MODE=none` disables sign-in.
|
|
216
300
|
|
|
217
|
-
Point the dashboard at the same `CLINKX_WORKFLOWS_STATE_DIR` as the ClinkX server. If the two directories differ, the dashboard shows a different run set, often an empty one. If you set `CLINKX_CONTEXT_BUILDER_RUNS_DIR` for the server, set the same value for the dashboard.
|
|
301
|
+
Point the dashboard at the same `CLINKX_WORKFLOWS_STATE_DIR` as the ClinkX server. If the two directories differ, the dashboard shows a different run set, often an empty one. If you set `CLINKX_CONTEXT_BUILDER_RUNS_DIR` for the server, set the same value for the dashboard. If the dashboard shows only runs from before an upgrade, it still reads the old directories.
|
|
218
302
|
|
|
219
303
|
The dashboard does not start, cancel, or approve anything. The data that it shows can contain prompts, outputs, and file contents from your workspace. Access is local and needs a passkey, but any process that runs as the same OS user can read the state directory.
|
|
220
304
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { sep } from "node:path";
|
|
2
|
+
import { assertRootRepresentable } from "./root-path-validation.js";
|
|
2
3
|
export function artifactOnlyEnvEntry(root) {
|
|
4
|
+
assertRootRepresentable(root, "Allowed root");
|
|
3
5
|
return root.endsWith(sep) ? `${root}.` : `${root}${sep}.`;
|
|
4
6
|
}
|
|
5
7
|
//# sourceMappingURL=allowed-roots.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"allowed-roots.js","sourceRoot":"","sources":["../src/allowed-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"allowed-roots.js","sourceRoot":"","sources":["../src/allowed-roots.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEpE,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,uBAAuB,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAC9C,OAAO,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,GAAG,GAAG,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { NormalizedWorkflowDefinition } from "../definition-normalizer.js";
|
|
2
|
+
export declare function materializeArchitectureRoutes(definition: NormalizedWorkflowDefinition, variables: Readonly<Record<string, unknown>>, available?: readonly string[], validateOverrides?: (cli: string, knobs: {
|
|
3
|
+
model?: string;
|
|
4
|
+
effort?: string;
|
|
5
|
+
}) => void): NormalizedWorkflowDefinition;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getMaxPromptBytes } from "../config.js";
|
|
2
|
+
import { DEFAULT_RESERVE_BYTES } from "../prompt-budget.js";
|
|
3
|
+
import { ARCHITECTURE_WORKFLOW, MAX_JUDGE_BYTES, MAX_VIEW_BYTES, RouteSchema } from "./contract.js";
|
|
4
|
+
const ROUTE_VARIABLES = { "candidates.author_a": "candidate_a", "candidates.author_b": "candidate_b", "judge.judge": "judge" };
|
|
5
|
+
export function materializeArchitectureRoutes(definition, variables, available, validateOverrides) {
|
|
6
|
+
if (definition.name !== ARCHITECTURE_WORKFLOW)
|
|
7
|
+
return definition;
|
|
8
|
+
for (const name of ["user_request", "source_identity"]) {
|
|
9
|
+
const value = variables[name];
|
|
10
|
+
const cap = name === "user_request" ? 16 * 1024 : 2000;
|
|
11
|
+
if (typeof value !== "string" || value.trim() === "" || Buffer.byteLength(value, "utf8") > cap)
|
|
12
|
+
throw new Error(`${name} must be nonblank and at most ${cap} UTF-8 bytes`);
|
|
13
|
+
}
|
|
14
|
+
const contextFiles = variables["context_files"] ?? [];
|
|
15
|
+
if (!Array.isArray(contextFiles) || contextFiles.length > 32 || new Set(contextFiles).size !== contextFiles.length)
|
|
16
|
+
throw new Error("context_files must contain at most 32 distinct source files");
|
|
17
|
+
const judge = definition.stages.find((stage) => stage.id === "judge")?.calls[0];
|
|
18
|
+
const worstCase = MAX_VIEW_BYTES + MAX_JUDGE_BYTES + DEFAULT_RESERVE_BYTES + Buffer.byteLength(judge?.prompt ?? "", "utf8");
|
|
19
|
+
if (worstCase > getMaxPromptBytes())
|
|
20
|
+
throw new Error(`architecture worst-case judge input and response reserve (${worstCase} bytes) exceeds workflow prompt budget`);
|
|
21
|
+
const tokenLimit = variables["judge_prompt_token_limit"];
|
|
22
|
+
if (tokenLimit !== undefined && (!Number.isSafeInteger(tokenLimit) || tokenLimit < worstCase))
|
|
23
|
+
throw new Error(`judge_prompt_token_limit must cover the conservative byte-token upper bound ${worstCase}; shorten the contract or use a larger route`);
|
|
24
|
+
const materialized = {
|
|
25
|
+
...definition,
|
|
26
|
+
stages: definition.stages.map((stage) => ({ ...stage, calls: stage.calls.map((call) => {
|
|
27
|
+
const prefix = ROUTE_VARIABLES[`${stage.id}.${call.id}`];
|
|
28
|
+
if (prefix === undefined)
|
|
29
|
+
return call;
|
|
30
|
+
const cli = variables[`${prefix}_cli`];
|
|
31
|
+
const model = variables[`${prefix}_model`];
|
|
32
|
+
const effort = variables[`${prefix}_effort`];
|
|
33
|
+
const route = RouteSchema.parse({ cli_name: typeof cli === "string" ? cli.trim() : cli, ...(model !== undefined ? { model } : {}), ...(effort !== undefined ? { effort } : {}) });
|
|
34
|
+
if (!/^[A-Za-z0-9_-]+$/.test(route.cli_name))
|
|
35
|
+
throw new Error(`invalid ${prefix}_cli`);
|
|
36
|
+
if (route.model !== undefined && !/^[^\s\u0000-][^\s\u0000]*$/.test(route.model))
|
|
37
|
+
throw new Error(`invalid ${prefix}_model`);
|
|
38
|
+
if (route.effort !== undefined && !/^[a-z0-9][a-z0-9_-]*$/.test(route.effort))
|
|
39
|
+
throw new Error(`invalid ${prefix}_effort`);
|
|
40
|
+
if (available !== undefined && !available.includes(route.cli_name))
|
|
41
|
+
throw new Error(`${prefix}_cli ${route.cli_name} is not an available JSON-capable route`);
|
|
42
|
+
validateOverrides?.(route.cli_name, { ...(route.model !== undefined ? { model: route.model } : {}), ...(route.effort !== undefined ? { effort: route.effort } : {}) });
|
|
43
|
+
const { model: _model, effort: _effort, ...base } = call;
|
|
44
|
+
return { ...base, ...route, role: "json" };
|
|
45
|
+
}) })),
|
|
46
|
+
};
|
|
47
|
+
const judgeCli = String(variables["judge_cli"]);
|
|
48
|
+
return { ...materialized, stages: materialized.stages.map((stage) => ({ ...stage, calls: stage.calls.map((call) => call.reducer === undefined ? call : { ...call, cli_name: judgeCli }) })) };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=admission.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admission.js","sourceRoot":"","sources":["../../src/architecture-comparison/admission.ts"],"names":[],"mappings":"AACA,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