chore(routes): close Shanghai mission and unify code channel

This commit is contained in:
冰朔 2026-08-03 23:51:32 +08:00
commit 2bf4b63cff
24 changed files with 246 additions and 129 deletions

View file

@ -3,11 +3,11 @@
本目录保存小湖灯本地协调 Agent 已采用的可公开恢复策略:
- 代码频道 Web 根只有 `https://guanghulab.com/code/`
- 当前只允许 REPO-012 与 REPO-014。
- 当前只允许 REPO-012、REPO-014 与隔离学习镜像 REPO-015。
- REPO-015 只保存外部上游源码、许可证、固定提交和净化研究,不得作为光湖运行时、人格系统或部署来源。
- HTTPS、`.git``repo://` 先归一化为同一个仓库身份。
- 实际写租约必须是 `repo://.../<repository>#<exact-branch>`
- 旧 `/fifth-domain/`、其他主机、未登记仓库和含凭证 URL 失败关闭。
本模块是策略事实源和回归样例,不代表 JZAO 上的本地协调运行时已经部署到服务器。运行时
升级、仓库发布和服务器部署仍分别举证。

View file

@ -3,6 +3,7 @@ const PREFIX = "/code/bingshuo/";
const REPOSITORIES = new Set([
"guanghu-ice-heart",
"hololake-system-architecture",
"grok-build-upstream-mirror",
]);
export function normalizeCodeChannelRepository(value) {
@ -23,7 +24,7 @@ export function normalizeCodeChannelRepository(value) {
: "";
if (url.hostname !== HOST || !REPOSITORIES.has(slug)) {
throw new Error(
"NON_CANONICAL_CODE_CHANNEL_REPOSITORY: only the two registered /code/ repositories are current",
"NON_CANONICAL_CODE_CHANNEL_REPOSITORY: only the three registered /code/ repositories are current",
);
}
return `repo://${HOST}${PREFIX}${slug}`;
@ -50,5 +51,5 @@ export function publishLeaseResource(repository, target = "main") {
export const currentCodeChannelRepositories = Object.freeze([
"repo://guanghulab.com/code/bingshuo/guanghu-ice-heart",
"repo://guanghulab.com/code/bingshuo/hololake-system-architecture",
"repo://guanghulab.com/code/bingshuo/grok-build-upstream-mirror",
]);

View file

@ -19,8 +19,14 @@ test("HTTPS, .git and repo forms resolve to one repository identity", () => {
assert.equal(publishLeaseResource(expected), `${expected}#main`);
});
test("only the two current repositories are allowed", () => {
assert.equal(currentCodeChannelRepositories.length, 2);
test("only the three current repositories are allowed", () => {
assert.equal(currentCodeChannelRepositories.length, 3);
assert.equal(
normalizeCodeChannelRepository(
"https://guanghulab.com/code/bingshuo/grok-build-upstream-mirror.git",
),
"repo://guanghulab.com/code/bingshuo/grok-build-upstream-mirror",
);
for (const invalid of [
"https://guanghulab.com/fifth-domain/bingshuo/fifth-domain.git",
"https://guanghubingshuo.com/code/bingshuo/guanghulab.git",
@ -39,4 +45,3 @@ test("credential-bearing remotes are rejected", () => {
/CREDENTIALS_FORBIDDEN/u,
);
});