chore(routes): close Shanghai mission and unify code channel
This commit is contained in:
parent
5e2ba5b006
commit
2bf4b63cff
24 changed files with 246 additions and 129 deletions
|
|
@ -20,13 +20,14 @@ test("canonical AI and persona entry files route to the domestic map", () => {
|
|||
assert.match(key, /禁止从本路径恢复.*\/exec/);
|
||||
});
|
||||
|
||||
test("code map resolves only REPO-012 and REPO-014 as current push routes", () => {
|
||||
test("code map resolves only REPO-012, REPO-014 and REPO-015 as current push routes", () => {
|
||||
const codeMap = read(".code-map");
|
||||
assert.match(codeMap, /^REPO-001=HISTORICAL_READ_ONLY_NO_PUSH$/m);
|
||||
assert.match(codeMap, /^REPO-001-HISTORICAL-URL=https:\/\/guanghulab\.com\/fifth-domain\/bingshuo\/fifth-domain\.git$/m);
|
||||
assert.match(codeMap, /^REPO-012=https:\/\/guanghulab\.com\/code\/bingshuo\/guanghu-ice-heart\.git$/m);
|
||||
assert.match(codeMap, /^REPO-014=https:\/\/guanghulab\.com\/code\/bingshuo\/hololake-system-architecture\.git$/m);
|
||||
assert.match(codeMap, /^CURRENT-PUSH-ALLOWLIST=REPO-012,REPO-014$/m);
|
||||
assert.match(codeMap, /^REPO-015=https:\/\/guanghulab\.com\/code\/bingshuo\/grok-build-upstream-mirror\.git$/m);
|
||||
assert.match(codeMap, /^CURRENT-PUSH-ALLOWLIST=REPO-012,REPO-014,REPO-015$/m);
|
||||
assert.match(codeMap, /^REPO-001-LEGACY-SG=/m);
|
||||
assert.match(codeMap, /^FD-REPO-MAP-001=routing\/repository-route-map\.json$/m);
|
||||
assert.match(codeMap, /^FD-WORLD-TREE-001=routing\/fifth-domain-world-tree\.json$/m);
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ const {
|
|||
resolveSubjectId, search, searchAll,
|
||||
} = require("./server");
|
||||
|
||||
test("repository map exposes only the two current code-channel repositories", () => {
|
||||
test("repository map exposes only the three current code-channel repositories", () => {
|
||||
const map = loadMap();
|
||||
const expectedCodes = ["REPO-012", "REPO-014"];
|
||||
const expectedCodes = ["REPO-012", "REPO-014", "REPO-015"];
|
||||
assert.deepEqual(map.repositories.map(item => item.code), expectedCodes);
|
||||
assert.equal(new Set(map.repositories.map(item => item.code)).size, expectedCodes.length);
|
||||
for (const item of map.repositories) {
|
||||
|
|
|
|||
|
|
@ -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 上的本地协调运行时已经部署到服务器。运行时
|
||||
升级、仓库发布和服务器部署仍分别举证。
|
||||
|
||||
|
|
|
|||
|
|
@ -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",
|
||||
]);
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue