mirror of
https://github.com/Youzini-afk/ST-Bionic-Memory-Ecology.git
synced 2026-06-14 02:40:45 +08:00
refactor(rebirth): isolate vector and reroll gates
This commit is contained in:
60
tests/vector-gate.mjs
Normal file
60
tests/vector-gate.mjs
Normal file
@@ -0,0 +1,60 @@
|
||||
// ST-BME restrained rebirth — Phase 4 vector readiness boundary tests.
|
||||
|
||||
import assert from "node:assert/strict";
|
||||
import { planVectorReadyCheck } from "../vector/vector-gate.js";
|
||||
|
||||
assert.deepEqual(planVectorReadyCheck({ hasGraph: false }), {
|
||||
action: "skip",
|
||||
reason: "missing-graph",
|
||||
});
|
||||
|
||||
assert.deepEqual(
|
||||
planVectorReadyCheck({
|
||||
hasGraph: true,
|
||||
metadataWriteAllowed: false,
|
||||
mutationContextAllowed: false,
|
||||
repairAttempted: false,
|
||||
}),
|
||||
{ action: "repair-identity", reason: "missing-mutation-context" },
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
planVectorReadyCheck({
|
||||
hasGraph: true,
|
||||
metadataWriteAllowed: false,
|
||||
mutationContextAllowed: false,
|
||||
repairAttempted: true,
|
||||
}),
|
||||
{ action: "block", reason: "missing-mutation-context" },
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
planVectorReadyCheck({
|
||||
hasGraph: true,
|
||||
metadataWriteAllowed: true,
|
||||
dirty: false,
|
||||
}),
|
||||
{ action: "skip", reason: "vector-clean" },
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
planVectorReadyCheck({
|
||||
hasGraph: true,
|
||||
metadataWriteAllowed: true,
|
||||
dirty: true,
|
||||
configValid: false,
|
||||
}),
|
||||
{ action: "skip", reason: "invalid-vector-config" },
|
||||
);
|
||||
|
||||
assert.deepEqual(
|
||||
planVectorReadyCheck({
|
||||
hasGraph: true,
|
||||
metadataWriteAllowed: true,
|
||||
dirty: true,
|
||||
configValid: true,
|
||||
}),
|
||||
{ action: "sync", reason: "vector-dirty" },
|
||||
);
|
||||
|
||||
console.log("vector-gate tests passed");
|
||||
Reference in New Issue
Block a user