feat: add factory repo gate
This commit is contained in:
parent
4b19e7f518
commit
c7b50d867f
|
|
@ -154,6 +154,8 @@ fable-agent plinius godmode "improve explanation quality"
|
||||||
### `factory`
|
### `factory`
|
||||||
|
|
||||||
- `factory check`
|
- `factory check`
|
||||||
|
- `factory gate <task>`
|
||||||
|
- `--repo <path>`
|
||||||
|
|
||||||
### `familiar`
|
### `familiar`
|
||||||
|
|
||||||
|
|
|
||||||
32
src/index.ts
32
src/index.ts
|
|
@ -1426,10 +1426,7 @@ const factory = program
|
||||||
.command("factory")
|
.command("factory")
|
||||||
.description("Factory/VPS status and deployment guards");
|
.description("Factory/VPS status and deployment guards");
|
||||||
|
|
||||||
factory
|
async function printFactoryCheck(): Promise<void> {
|
||||||
.command("check")
|
|
||||||
.description("Check factory status and deploy-webhook health")
|
|
||||||
.action(async () => {
|
|
||||||
const { formatFactoryCheck } = await import("./fable5/factory-status.js");
|
const { formatFactoryCheck } = await import("./fable5/factory-status.js");
|
||||||
const getJson = async (url: string) => {
|
const getJson = async (url: string) => {
|
||||||
const res = await fetch(url);
|
const res = await fetch(url);
|
||||||
|
|
@ -1443,6 +1440,33 @@ factory
|
||||||
]);
|
]);
|
||||||
|
|
||||||
console.log(formatFactoryCheck(factoryStatus, deployHealth));
|
console.log(formatFactoryCheck(factoryStatus, deployHealth));
|
||||||
|
}
|
||||||
|
|
||||||
|
factory
|
||||||
|
.command("check")
|
||||||
|
.description("Check factory status and deploy-webhook health")
|
||||||
|
.action(async () => {
|
||||||
|
await printFactoryCheck();
|
||||||
|
});
|
||||||
|
|
||||||
|
factory
|
||||||
|
.command("gate <task>")
|
||||||
|
.description("Run factory check plus local ZTE/repo verification gate")
|
||||||
|
.option("--repo <path>", "Repo path to verify", ".")
|
||||||
|
.action(async (task: string, opts: { repo?: string }) => {
|
||||||
|
const { spawnSync } = await import("node:child_process");
|
||||||
|
await printFactoryCheck();
|
||||||
|
|
||||||
|
const repo = path.resolve(opts.repo ?? ".");
|
||||||
|
console.log(` ZTE Gate: ${task}`);
|
||||||
|
console.log(` Repo: ${repo}`);
|
||||||
|
console.log(``);
|
||||||
|
|
||||||
|
const args = [process.argv[1], "fable5", "verify", task, "--repo", repo];
|
||||||
|
const check = spawnSync(process.execPath, args, { cwd: repo, stdio: "inherit" });
|
||||||
|
if (check.status !== 0) process.exit(check.status ?? 1);
|
||||||
|
console.log(` ✓ Factory gate passed; deploy still requires explicit token/contract.`);
|
||||||
|
console.log(``);
|
||||||
});
|
});
|
||||||
|
|
||||||
// ── Fable 5 ─────────────────────────────────────────────────
|
// ── Fable 5 ─────────────────────────────────────────────────
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue