mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
fix: drop harness-pi-ai and its legacy registry aliases from evals
The harness declared peer deps on the pre-rename @mariozechner/pi-ai and @mariozechner/pi-agent-core names, so npm auto-installed our own code from the registry under an alias. sync-versions bumped those aliases in lockstep, which made every release fail because the new version is not published yet. Build the eval harness on createHarness from vitest-evals core instead. The pi-specific code was already ours; the harness only contributed agent-lifecycle plumbing and unused tool replay.
This commit is contained in:
parent
62a7074188
commit
6173017a7b
8 changed files with 66 additions and 226 deletions
|
|
@ -11,21 +11,6 @@ import { findPackageDirectories } from "./package-workspaces.mjs";
|
|||
|
||||
const GENERATED_PACKAGE_SUFFIXES = [join("coding-agent", "install-lock")];
|
||||
|
||||
function synchronizedDependencyVersion(dependencyName, currentSpecifier, versionMap) {
|
||||
const directVersion = versionMap.get(dependencyName);
|
||||
if (directVersion) {
|
||||
return `^${directVersion}`;
|
||||
}
|
||||
if (typeof currentSpecifier !== "string" || !currentSpecifier.startsWith("npm:")) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const separator = currentSpecifier.lastIndexOf("@");
|
||||
const aliasPackage = currentSpecifier.slice("npm:".length, separator);
|
||||
const aliasVersion = versionMap.get(aliasPackage);
|
||||
return aliasVersion ? `npm:${aliasPackage}@${aliasVersion}` : null;
|
||||
}
|
||||
|
||||
const packageRoot = process.argv[2] ?? "packages";
|
||||
const workspacePackages = findPackageDirectories(packageRoot)
|
||||
.filter((directory) => !GENERATED_PACKAGE_SUFFIXES.some((suffix) => directory.endsWith(suffix)))
|
||||
|
|
@ -63,7 +48,10 @@ for (const pkg of workspacePackages) {
|
|||
}
|
||||
|
||||
for (const [dependencyName, currentSpecifier] of Object.entries(dependencies)) {
|
||||
const newSpecifier = synchronizedDependencyVersion(dependencyName, currentSpecifier, versionMap);
|
||||
// Registry aliases such as `npm:@earendil-works/pi-ai@0.1.2` are never workspace-linked,
|
||||
// so lockstep bumping them would point at a version that is not published yet.
|
||||
const version = versionMap.get(dependencyName);
|
||||
const newSpecifier = version ? `^${version}` : null;
|
||||
if (!newSpecifier || currentSpecifier === newSpecifier) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ function runSyncVersions(root) {
|
|||
});
|
||||
}
|
||||
|
||||
test("synchronizes private dependencies without touching generated manifests or relaxing published lockstep", async () => {
|
||||
test("synchronizes private dependencies without touching registry aliases, generated manifests, or published lockstep", async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), "pi-sync-versions-"));
|
||||
try {
|
||||
await writeManifest(root, "packages/ai", {
|
||||
|
|
@ -59,7 +59,7 @@ test("synchronizes private dependencies without touching generated manifests or
|
|||
|
||||
const evalsManifest = await readManifest(root, "packages/evals");
|
||||
assert.equal(evalsManifest.dependencies["@earendil-works/pi-coding-agent"], "^2.0.0");
|
||||
assert.equal(evalsManifest.dependencies["@mariozechner/pi-ai"], "npm:@earendil-works/pi-ai@2.0.0");
|
||||
assert.equal(evalsManifest.dependencies["@mariozechner/pi-ai"], "npm:@earendil-works/pi-ai@1.0.0");
|
||||
const generatedManifest = await readManifest(root, "packages/coding-agent/install-lock");
|
||||
assert.equal(generatedManifest.dependencies["@earendil-works/pi-coding-agent"], "^1.0.0");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue