Remove pre-1.0 bridge governance scaffolding

This commit is contained in:
npc0-hue
2026-08-21 09:46:25 +08:00
parent da6c8d607e
commit b5a366e30d
42 changed files with 520 additions and 1066 deletions
@@ -16,7 +16,6 @@ const safeCommand = {
commandType: "scum.player.lookup",
priority: 10,
state: "succeeded",
approvalState: "not_required",
requesterId: "user-1",
result: { status: "succeeded", summary: "player found", payload: { found: true }, completedAt: now },
expiresAt: now,
@@ -45,14 +44,14 @@ const safeSnapshotList = {
};
describe("Game Client Bridge safe projection schema", () => {
it("preserves declarations, approval, result, retention and typed snapshot payloads", () => {
it("preserves declarations, result, retention and typed snapshot payloads", () => {
expect(parseSafeGameClientBridgeStatus({
serverInstanceId: "server-1",
pluginId: "game.scum",
available: true,
profiles: [{ pluginId: "game.scum", profileKey: "scum-client", available: true, commandTypes: ["scum.player.lookup"], snapshotTypes: ["scum.players"], queryTemplateKeys: ["scum.player.search"] }]
})).toMatchObject({ available: true, profiles: [{ queryTemplateKeys: ["scum.player.search"] }] });
expect(parseSafeGameClientBridgeCommand(safeCommand)).toMatchObject({ approvalState: "not_required", result: { payload: { found: true } } });
expect(parseSafeGameClientBridgeCommand(safeCommand)).toMatchObject({ result: { payload: { found: true } } });
expect(parseSafeGameClientBridgeSnapshotList(safeSnapshotList)).toMatchObject({ count: 1, items: [{ retention: { maxRecords: 24 } }] });
expect(parseSafeGameClientBridgeSnapshotList({
...safeSnapshotList,
-9
View File
@@ -1,5 +1,4 @@
import type {
GameClientBridgeApprovalState,
GameClientBridgeCancelResponse,
GameClientBridgeCommandCancellationResponse,
GameClientBridgeCommandListResponse,
@@ -16,7 +15,6 @@ import type {
} from "../api/types";
const commandStates = new Set<GameClientBridgeCommandState>(["pending", "claimed", "succeeded", "failed", "cancelled", "expired", "unknown"]);
const approvalStates = new Set<GameClientBridgeApprovalState>(["not_required", "pending", "approved", "rejected"]);
const resultStatuses = new Set<GameClientBridgeResultStatus>(["succeeded", "failed", "cancelled", "unknown"]);
const forbiddenKeys = new Set([
"apikey",
@@ -84,7 +82,6 @@ export function parseSafeGameClientBridgeCommand(value: unknown): GameClientBrid
commandType: string(record.commandType, "commandType"),
priority: number(record.priority, "priority"),
state: commandState(record.state),
approvalState: approvalState(record.approvalState),
expiresAt: string(record.expiresAt, "expiresAt"),
createdAt: string(record.createdAt, "createdAt"),
updatedAt: string(record.updatedAt, "updatedAt")
@@ -284,12 +281,6 @@ function commandState(value: unknown): GameClientBridgeCommandState {
return parsed;
}
function approvalState(value: unknown): GameClientBridgeApprovalState {
const parsed = string(value, "approvalState") as GameClientBridgeApprovalState;
if (!approvalStates.has(parsed)) throw new Error("Game Client Bridge approval state is invalid");
return parsed;
}
function resultStatus(value: unknown): GameClientBridgeResultStatus {
const parsed = string(value, "result.status") as GameClientBridgeResultStatus;
if (!resultStatuses.has(parsed)) throw new Error("Game Client Bridge result status is invalid");
@@ -23,7 +23,7 @@ const plugin: GamePluginResponse = {
pages: [],
tags: [],
aiPurposes: [],
productionLifecycle: { operations: ["install", "enable", "disable", "upgrade", "rollback", "retire", "dependency-check"], dependencyPolicy: "optional", approvalRequired: ["disable", "rollback", "retire"] },
productionLifecycle: { operations: ["install", "enable", "disable", "upgrade", "rollback", "retire", "dependency-check"], dependencyPolicy: "optional" },
status: "installed",
runtimeProfiles: {
discovery: [{ key: "root-check", kind: "file.exists", targetKey: "server-root", required: true }],