clinkx 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/README.md +34 -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/contained-file.js +1 -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-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/state.js +17 -7
- 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-tools.d.ts +3 -0
- package/clinkx-workflows/dist/workflow-tools.js +148 -14
- 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.js +4 -1
- 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/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/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/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.js +10 -3
- 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/server.js +29 -1
- 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 +68 -1
- package/docs/engineering-recipes.md +415 -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 +364 -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,34 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.1.2 — 2026-10-09
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- 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.
|
|
8
|
+
- 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.
|
|
9
|
+
- 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.
|
|
10
|
+
- 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.
|
|
11
|
+
- 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.
|
|
12
|
+
- `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`.
|
|
13
|
+
- 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.
|
|
14
|
+
- A "Verified bug fix" recipe in `docs/engineering-recipes.md`.
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- Dashboard-doctor Chromium preflight now removes only its owned profile and artifact directory, preserving other concurrent Playwright runs.
|
|
19
|
+
- Provider-doctor interruption stops all concurrent version checks and cancels active authentication probes with their owned descendants before exiting.
|
|
20
|
+
- 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.
|
|
21
|
+
- Workflow-handoff inspection preserves independently observed execution, consumer, and cleanup failures when source/build identity has drifted.
|
|
22
|
+
- Secret-redaction warnings deduplicate line numbers with a `Set`, preserving their ordering and bounded output without quadratic array scans.
|
|
23
|
+
- `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.
|
|
24
|
+
- 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.
|
|
25
|
+
- Codex app-server diagnostics now redact hyphenated vendor tokens (`sk-ant-`, `sk-proj-`, `sk-or-`) in stderr and recent-failure text.
|
|
26
|
+
|
|
27
|
+
### Docs
|
|
28
|
+
|
|
29
|
+
- Recipe wiring pins the merged three-recipe companion revision and records the completed evaluation and settled secret-policy decision.
|
|
30
|
+
- 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.
|
|
31
|
+
|
|
3
32
|
## 1.1.1 — 2026-10-05
|
|
4
33
|
|
|
5
34
|
### Changed
|
package/README.md
CHANGED
|
@@ -60,6 +60,10 @@ 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
69
|
| `workflow_run_status` | Reports the progress and result of a workflow run. |
|
|
@@ -74,6 +78,13 @@ Two more tool groups are off by default:
|
|
|
74
78
|
|
|
75
79
|
Each tool publishes its full input schema through MCP. MCP clients can show the schema with the tool description.
|
|
76
80
|
|
|
81
|
+
Readiness and project verification are available through the same npm-installed
|
|
82
|
+
MCP connection; no ClinkX checkout or client shell access is needed. See
|
|
83
|
+
[provider readiness](docs/configuration.md#provider-readiness-doctor) and
|
|
84
|
+
[project checks](docs/verification/project-checks.md) for tool calls, authorized
|
|
85
|
+
project/evidence roots, and evidence limits. Project execution v1 supports
|
|
86
|
+
macOS/Linux and runs trusted manifest commands with the server account's permissions.
|
|
87
|
+
|
|
77
88
|
## Supported CLIs
|
|
78
89
|
|
|
79
90
|
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:
|
|
@@ -153,6 +164,8 @@ A workflow runs many CLI calls in stages and returns one result. A council workf
|
|
|
153
164
|
|
|
154
165
|
| Workflow | Purpose |
|
|
155
166
|
|---|---|
|
|
167
|
+
| `architecture-comparison` | Compare two designs using frozen shared input and a fresh judge with candidate aliases. |
|
|
168
|
+
| `verified-repair` | Repair declared existing files in place, reproduce the defect, and prove the fix through native checks and independent causal verification. |
|
|
156
169
|
| `council-answer` | Answer one hard question. |
|
|
157
170
|
| `council-code-review` | Review a change set. |
|
|
158
171
|
| `council-debug` | Find the cause of a defect. |
|
|
@@ -161,7 +174,27 @@ A workflow runs many CLI calls in stages and returns one result. A council workf
|
|
|
161
174
|
| `council-default` | General-purpose council. |
|
|
162
175
|
| `plan-review-receipts` | Typed plan review that returns receipt candidates for an external approval process. |
|
|
163
176
|
|
|
164
|
-
Before the first stage,
|
|
177
|
+
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.
|
|
178
|
+
|
|
179
|
+
Select `architecture-comparison` explicitly and provide `user_request`,
|
|
180
|
+
`source_identity`, and optional `context_files` in `variables`. Its built-in
|
|
181
|
+
templates and validators ship in the npm package. Two authors receive the same
|
|
182
|
+
frozen packet; the independent judge receives a separate view with candidate
|
|
183
|
+
aliases. The result reports comparison completeness and leaves owner acceptance
|
|
184
|
+
unrecorded. See [engineering recipes](docs/engineering-recipes.md) for an example,
|
|
185
|
+
route settings, bounds, and evidence limits.
|
|
186
|
+
|
|
187
|
+
For a bug fix, invoke the companion `verified-repair` skill in Claude Code,
|
|
188
|
+
Codex, or another connected MCP agent. It prepares the repair contract and
|
|
189
|
+
native manifests, then calls `run_workflow` with
|
|
190
|
+
`workflow: "verified-repair"`. The workflow needs three explicit provider routes
|
|
191
|
+
and separate authorized project, evidence and verification-copy locations on
|
|
192
|
+
the MCP host. It preserves unrelated changes and retains applied edits on
|
|
193
|
+
failure; qualification never records owner acceptance. See the
|
|
194
|
+
[paste-ready agent prompt and MCP calls](docs/engineering-recipes.md#using-verified-repair-from-an-agent-runtime)
|
|
195
|
+
and [minimal contract and manifests](docs/verification/project-checks.md#native-verified-repair).
|
|
196
|
+
The dashboard's **Verified repair** prompt-builder target prepares this caller
|
|
197
|
+
skill invocation for copying; it does not execute the repair or authorize host paths.
|
|
165
198
|
|
|
166
199
|
### Roster presets
|
|
167
200
|
|
|
@@ -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,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpG,MAAM,eAAe,GAAG,EAAE,qBAAqB,EAAE,aAAa,EAAE,qBAAqB,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAW,CAAC;AAExI,MAAM,UAAU,6BAA6B,CAC3C,UAAwC,EACxC,SAA4C,EAC5C,SAA6B,EAC7B,iBAAqF;IAErF,IAAI,UAAU,CAAC,IAAI,KAAK,qBAAqB;QAAE,OAAO,UAAU,CAAC;IACjE,KAAK,MAAM,IAAI,IAAI,CAAC,cAAc,EAAE,iBAAiB,CAAC,EAAE,CAAC;QACvD,MAAM,KAAK,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC9B,MAAM,GAAG,GAAG,IAAI,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QACvD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,iCAAiC,GAAG,cAAc,CAAC,CAAC;IAC7K,CAAC;IACD,MAAM,YAAY,GAAG,SAAS,CAAC,eAAe,CAAC,IAAI,EAAE,CAAC;IACtD,IAAI,CAAC,KAAK,CAAC,OAAO,C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