源码快照 @ 2026-09-01 (source-only, 剔除非源码素材)
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
Publish Claude Code Binaries / Stage and publish binaries (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-arm64 (push) Canceled after 0s
Publish Tutti App Runtime / Build darwin-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build linux-amd64 (push) Canceled after 0s
Publish Tutti App Runtime / Build windows-amd64 (push) Canceled after 0s
Sync Tutti Agent Skills / sync (push) Canceled after 0s
Windows Agent Adapters / Test Windows agent adapters (push) Canceled after 0s
Windows Daemon Adapters / Test Windows daemon adapters (push) Canceled after 0s
Publish Tutti App Runtime / Publish runtime catalog (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,105 @@
|
||||
import assert from "node:assert/strict";
|
||||
import { readFile } from "node:fs/promises";
|
||||
import { join } from "node:path";
|
||||
import test from "node:test";
|
||||
|
||||
import { rewriteInternalGoModuleDependencies } from "./go-module-release.mjs";
|
||||
import { workspaceRoot } from "./npm-release-packages.mjs";
|
||||
|
||||
test("rewrites internal requirements and removes local replaces", () => {
|
||||
const input = `module example.test/consumer
|
||||
|
||||
require (
|
||||
github.com/tutti-os/tutti/packages/agent/daemon v0.0.0
|
||||
example.test/external v1.2.3
|
||||
)
|
||||
|
||||
replace (
|
||||
github.com/tutti-os/tutti/packages/agent/daemon => ../daemon
|
||||
example.test/external => ../external
|
||||
)
|
||||
|
||||
replace github.com/tutti-os/tutti/packages/workspace/files => ../files
|
||||
`;
|
||||
|
||||
assert.equal(
|
||||
rewriteInternalGoModuleDependencies(input, "0.0.110"),
|
||||
`module example.test/consumer
|
||||
|
||||
require (
|
||||
github.com/tutti-os/tutti/packages/agent/daemon v0.0.110
|
||||
example.test/external v1.2.3
|
||||
)
|
||||
|
||||
replace (
|
||||
example.test/external => ../external
|
||||
)
|
||||
`
|
||||
);
|
||||
});
|
||||
|
||||
test("published activity contract keeps a light canonical-only module graph", async () => {
|
||||
const source = await readFile(
|
||||
join(workspaceRoot, "packages/agent/activity-replication/go.mod"),
|
||||
"utf8"
|
||||
);
|
||||
const released = rewriteInternalGoModuleDependencies(source, "0.0.110");
|
||||
|
||||
assert.match(
|
||||
released,
|
||||
/github\.com\/tutti-os\/tutti\/packages\/agent\/store-sqlite\/canonical v0\.0\.110/
|
||||
);
|
||||
assert.doesNotMatch(released, /replace .*github\.com\/tutti-os\/tutti/);
|
||||
assert.doesNotMatch(released, /packages\/agent\/daemon|modernc\.org\/sqlite/);
|
||||
});
|
||||
|
||||
test("published store module resolves every internal dependency at the release version", async () => {
|
||||
const source = await readFile(
|
||||
join(workspaceRoot, "packages/agent/store-sqlite/go.mod"),
|
||||
"utf8"
|
||||
);
|
||||
const released = rewriteInternalGoModuleDependencies(source, "0.0.110");
|
||||
|
||||
for (const modulePath of ["activity-replication", "store-sqlite/canonical"]) {
|
||||
assert.match(
|
||||
released,
|
||||
new RegExp(
|
||||
`github\\.com/tutti-os/tutti/packages/agent/${modulePath.replace("/", "\\/")} v0\\.0\\.110`
|
||||
)
|
||||
);
|
||||
}
|
||||
assert.doesNotMatch(released, /replace .*github\.com\/tutti-os\/tutti/);
|
||||
assert.doesNotMatch(released, /packages\/agent\/daemon/);
|
||||
});
|
||||
|
||||
test("published host contract contains only reusable agent package dependencies", async () => {
|
||||
const source = await readFile(
|
||||
join(workspaceRoot, "packages/agent/host/go.mod"),
|
||||
"utf8"
|
||||
);
|
||||
const released = rewriteInternalGoModuleDependencies(source, "0.0.110");
|
||||
|
||||
for (const modulePath of [
|
||||
"activity-replication",
|
||||
"store-sqlite",
|
||||
"store-sqlite/canonical"
|
||||
]) {
|
||||
assert.match(
|
||||
released,
|
||||
new RegExp(
|
||||
`github\\.com/tutti-os/tutti/packages/agent/${modulePath.replace("/", "\\/")} v0\\.0\\.110`
|
||||
)
|
||||
);
|
||||
}
|
||||
assert.doesNotMatch(released, /replace .*github\.com\/tutti-os\/tutti/);
|
||||
assert.doesNotMatch(
|
||||
released,
|
||||
/packages\/agent\/daemon|services\/tuttid|sidecar/
|
||||
);
|
||||
});
|
||||
|
||||
test("leaves modules without internal dependencies byte-for-byte unchanged", () => {
|
||||
const source =
|
||||
"module example.test/standalone\n\nrequire example.test/api v1.2.3\n\n";
|
||||
assert.equal(rewriteInternalGoModuleDependencies(source, "0.0.110"), source);
|
||||
});
|
||||
Reference in New Issue
Block a user