@biffo/cli 0.276.9 → 0.277.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +65 -56
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10077,7 +10077,7 @@ async function runBranchProtectionCheck(explicitRepo, options = {}) {
|
|
|
10077
10077
|
}
|
|
10078
10078
|
|
|
10079
10079
|
// src/scripts/check-codeql-suppression.ts
|
|
10080
|
-
import {
|
|
10080
|
+
import { existsSync as existsSync36 } from "fs";
|
|
10081
10081
|
import { join as join38, relative as relative6 } from "path";
|
|
10082
10082
|
import { execa as execa8 } from "execa";
|
|
10083
10083
|
|
|
@@ -10134,6 +10134,9 @@ function walkSourceFiles(root) {
|
|
|
10134
10134
|
walk2(root);
|
|
10135
10135
|
return out.sort();
|
|
10136
10136
|
}
|
|
10137
|
+
function countSourceFiles(root) {
|
|
10138
|
+
return walkSourceFiles(root).length;
|
|
10139
|
+
}
|
|
10137
10140
|
function sweepCodeqlSuppressionComments(root) {
|
|
10138
10141
|
const hits = [];
|
|
10139
10142
|
for (const path of walkSourceFiles(root)) {
|
|
@@ -10148,7 +10151,14 @@ function sweepCodeqlSuppressionComments(root) {
|
|
|
10148
10151
|
// src/scripts/check-codeql-suppression.ts
|
|
10149
10152
|
async function runCodeqlSuppressionCheck() {
|
|
10150
10153
|
const root = (await execa8("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
10151
|
-
const
|
|
10154
|
+
const scanRoot = join38(root, "cli", "src");
|
|
10155
|
+
if (!existsSync36(scanRoot)) {
|
|
10156
|
+
console.log(
|
|
10157
|
+
"\u2014 codeql-suppression guard: skipped \u2014 no cli/src in this repo, so there is no CLI source to scan."
|
|
10158
|
+
);
|
|
10159
|
+
return;
|
|
10160
|
+
}
|
|
10161
|
+
const hits = sweepCodeqlSuppressionComments(scanRoot);
|
|
10152
10162
|
if (hits.length > 0) {
|
|
10153
10163
|
console.error(
|
|
10154
10164
|
"\u2717 codeql-suppression guard: found a `codeql[...]`-shaped comment, which does not suppress anything in this repo (#1491) \u2014 dismiss the real alert instead (UI, or `PATCH .../code-scanning/alerts/<n>` with a recorded reason)\n"
|
|
@@ -10158,9 +10168,8 @@ async function runCodeqlSuppressionCheck() {
|
|
|
10158
10168
|
}
|
|
10159
10169
|
process.exit(1);
|
|
10160
10170
|
}
|
|
10161
|
-
|
|
10162
|
-
|
|
10163
|
-
console.error("\u2717 codeql-suppression guard: scan target read empty \u2014 refusing a false green.");
|
|
10171
|
+
if (countSourceFiles(root) === 0) {
|
|
10172
|
+
console.error("\u2717 codeql-suppression guard: scanned zero files \u2014 refusing a false green.");
|
|
10164
10173
|
process.exit(1);
|
|
10165
10174
|
}
|
|
10166
10175
|
console.log("\u2713 codeql-suppression guard: no dead `codeql[...]` suppression comment found");
|
|
@@ -10170,7 +10179,7 @@ async function runCodeqlSuppressionCheck() {
|
|
|
10170
10179
|
import { execa as execa9 } from "execa";
|
|
10171
10180
|
|
|
10172
10181
|
// src/lib/cognito-invite-template-guard.ts
|
|
10173
|
-
import { readdirSync as readdirSync15, readFileSync as
|
|
10182
|
+
import { readdirSync as readdirSync15, readFileSync as readFileSync28, statSync as statSync8 } from "fs";
|
|
10174
10183
|
import { join as join39 } from "path";
|
|
10175
10184
|
var REQUIRED_INVITE_MEMBERS = ["email_subject", "email_message", "sms_message"];
|
|
10176
10185
|
var REQUIRED_INVITE_PLACEHOLDERS = ["{username}", "{####}"];
|
|
@@ -10268,7 +10277,7 @@ function findModuleTerraformFiles(repoRoot) {
|
|
|
10268
10277
|
}
|
|
10269
10278
|
function checkCognitoInviteTemplates(repoRoot) {
|
|
10270
10279
|
return findModuleTerraformFiles(repoRoot).flatMap(
|
|
10271
|
-
(file) => checkInviteTemplateSource(file,
|
|
10280
|
+
(file) => checkInviteTemplateSource(file, readFileSync28(join39(repoRoot, file), "utf8"))
|
|
10272
10281
|
);
|
|
10273
10282
|
}
|
|
10274
10283
|
|
|
@@ -10300,7 +10309,7 @@ import { join as join41 } from "path";
|
|
|
10300
10309
|
import { execa as execa10 } from "execa";
|
|
10301
10310
|
|
|
10302
10311
|
// src/lib/core-direct-paths-audit.ts
|
|
10303
|
-
import { existsSync as
|
|
10312
|
+
import { existsSync as existsSync37, readFileSync as readFileSync29, readdirSync as readdirSync16, statSync as statSync9 } from "fs";
|
|
10304
10313
|
import { join as join40 } from "path";
|
|
10305
10314
|
var EXTERNAL_BASE_IDENTIFIERS = ["CORE_API_URL"];
|
|
10306
10315
|
var API_ROUTE_PREFIX = "/api/v1";
|
|
@@ -10495,7 +10504,7 @@ function auditFrontendExtraction(frontendSrcDir, externalBases = EXTERNAL_BASE_I
|
|
|
10495
10504
|
const extracted = [];
|
|
10496
10505
|
let rawTotal = 0;
|
|
10497
10506
|
for (const file of files) {
|
|
10498
|
-
const text =
|
|
10507
|
+
const text = readFileSync29(file, "utf8");
|
|
10499
10508
|
rawTotal += countRawExternalOccurrences(text, externalBases);
|
|
10500
10509
|
extracted.push(...extractCoreDirectPaths(text, file, externalBases));
|
|
10501
10510
|
}
|
|
@@ -10544,7 +10553,7 @@ function auditCoreRouteExtraction(apiSrcDir) {
|
|
|
10544
10553
|
const prefixSet = /* @__PURE__ */ new Set();
|
|
10545
10554
|
let rawApiRouterCount = 0;
|
|
10546
10555
|
for (const file of files) {
|
|
10547
|
-
const text =
|
|
10556
|
+
const text = readFileSync29(file, "utf8");
|
|
10548
10557
|
const extraction = extractCoreRoutePrefixes(text);
|
|
10549
10558
|
rawApiRouterCount += extraction.rawApiRouterCount;
|
|
10550
10559
|
for (const p of extraction.prefixes) prefixSet.add(normalizePrefix(p));
|
|
@@ -10563,7 +10572,7 @@ function resolveSiblingCoreSrc(params) {
|
|
|
10563
10572
|
const configPath = join40(estateDir, sibling, "biffo.sibling.json");
|
|
10564
10573
|
let raw;
|
|
10565
10574
|
try {
|
|
10566
|
-
raw =
|
|
10575
|
+
raw = readFileSync29(configPath, "utf8");
|
|
10567
10576
|
} catch (err) {
|
|
10568
10577
|
throw new Error(
|
|
10569
10578
|
`cannot resolve ${sibling}'s core: ${configPath} does not exist or is unreadable (${err.message}) -- refusing to guess which core serves this sibling.`
|
|
@@ -10584,7 +10593,7 @@ function resolveSiblingCoreSrc(params) {
|
|
|
10584
10593
|
);
|
|
10585
10594
|
}
|
|
10586
10595
|
const coreApiSrcDir = join40(estateDir, coreProject, "services", "api", "src");
|
|
10587
|
-
if (!
|
|
10596
|
+
if (!existsSync37(coreApiSrcDir)) {
|
|
10588
10597
|
throw new Error(
|
|
10589
10598
|
`cannot resolve ${sibling}'s core: biffo.sibling.json names core_project "${coreProject}", but ${coreApiSrcDir} does not exist -- the instance is missing from this estate checkout, not merely unmatched. Refusing to silently skip ${sibling} and shrink the audit's denominator.`
|
|
10590
10599
|
);
|
|
@@ -10709,8 +10718,8 @@ async function runOwnershipCheck(argv) {
|
|
|
10709
10718
|
const { stdout } = await execa11("git", ["diff", "--cached", "--name-status"], { cwd: root });
|
|
10710
10719
|
({ changed: changedFiles, deleted: deletedFiles } = parseNameStatus(stdout));
|
|
10711
10720
|
if (messageFile) {
|
|
10712
|
-
const { readFileSync:
|
|
10713
|
-
if (
|
|
10721
|
+
const { readFileSync: readFileSync38, existsSync: existsSync46 } = await import("fs");
|
|
10722
|
+
if (existsSync46(messageFile)) commitMessage = readFileSync38(messageFile, "utf8");
|
|
10714
10723
|
}
|
|
10715
10724
|
} else {
|
|
10716
10725
|
const base = process.env["GITHUB_BASE_REF"] ?? args[0];
|
|
@@ -10814,7 +10823,7 @@ ${BOLD}If the divergence is deliberate${OFF}
|
|
|
10814
10823
|
import { execa as execa12 } from "execa";
|
|
10815
10824
|
|
|
10816
10825
|
// src/lib/eventbridge-log-permission-guard.ts
|
|
10817
|
-
import { readFileSync as
|
|
10826
|
+
import { readFileSync as readFileSync30, readdirSync as readdirSync17, statSync as statSync10 } from "fs";
|
|
10818
10827
|
import { join as join42 } from "path";
|
|
10819
10828
|
var SKIP_DIRS2 = /* @__PURE__ */ new Set(["node_modules", ".git", ".terraform", ".worktrees", "dist"]);
|
|
10820
10829
|
var EVENT_TARGET_TYPE = "aws_cloudwatch_event_target";
|
|
@@ -10935,7 +10944,7 @@ function auditEventBridgeLogPermissions(root) {
|
|
|
10935
10944
|
let rawEventTargetCount = 0;
|
|
10936
10945
|
let rawLogPolicyCount = 0;
|
|
10937
10946
|
for (const file of files) {
|
|
10938
|
-
const text =
|
|
10947
|
+
const text = readFileSync30(file, "utf8");
|
|
10939
10948
|
rawEventTargetCount += countRawResourceDeclarations(text, EVENT_TARGET_TYPE);
|
|
10940
10949
|
rawLogPolicyCount += countRawResourceDeclarations(text, LOG_RESOURCE_POLICY_TYPE);
|
|
10941
10950
|
eventTargetBlocks.push(...findResourceBlocks(text, file, EVENT_TARGET_TYPE));
|
|
@@ -11028,11 +11037,11 @@ async function runEventBridgeLogPermissionCheck() {
|
|
|
11028
11037
|
import { execa as execa13 } from "execa";
|
|
11029
11038
|
|
|
11030
11039
|
// src/lib/lambda-output-guard.ts
|
|
11031
|
-
import { readFileSync as
|
|
11040
|
+
import { readFileSync as readFileSync32 } from "fs";
|
|
11032
11041
|
import { join as join44 } from "path";
|
|
11033
11042
|
|
|
11034
11043
|
// src/lib/terraform-input-guard.ts
|
|
11035
|
-
import { readdirSync as readdirSync18, readFileSync as
|
|
11044
|
+
import { readdirSync as readdirSync18, readFileSync as readFileSync31, statSync as statSync11 } from "fs";
|
|
11036
11045
|
import { join as join43 } from "path";
|
|
11037
11046
|
var GUARDED_SUBCOMMANDS = [
|
|
11038
11047
|
"init",
|
|
@@ -11101,7 +11110,7 @@ function checkWorkflowSource(file, rawSource) {
|
|
|
11101
11110
|
}
|
|
11102
11111
|
function checkTerraformInput(repoRoot) {
|
|
11103
11112
|
return findWorkflowFiles(repoRoot).flatMap(
|
|
11104
|
-
(file) => checkWorkflowSource(file,
|
|
11113
|
+
(file) => checkWorkflowSource(file, readFileSync31(join43(repoRoot, file), "utf8"))
|
|
11105
11114
|
);
|
|
11106
11115
|
}
|
|
11107
11116
|
|
|
@@ -11159,7 +11168,7 @@ function checkWorkflowSource2(file, rawSource) {
|
|
|
11159
11168
|
}
|
|
11160
11169
|
function checkLambdaOutput(repoRoot) {
|
|
11161
11170
|
return findWorkflowFiles(repoRoot).flatMap(
|
|
11162
|
-
(file) => checkWorkflowSource2(file,
|
|
11171
|
+
(file) => checkWorkflowSource2(file, readFileSync32(join44(repoRoot, file), "utf8"))
|
|
11163
11172
|
);
|
|
11164
11173
|
}
|
|
11165
11174
|
|
|
@@ -11187,7 +11196,7 @@ async function runLambdaOutputCheck() {
|
|
|
11187
11196
|
}
|
|
11188
11197
|
|
|
11189
11198
|
// src/scripts/check-pipe-trap.ts
|
|
11190
|
-
import { readFileSync as
|
|
11199
|
+
import { readFileSync as readFileSync33, readdirSync as readdirSync19 } from "fs";
|
|
11191
11200
|
import { join as join45, relative as relative7 } from "path";
|
|
11192
11201
|
import { execa as execa14 } from "execa";
|
|
11193
11202
|
|
|
@@ -11311,7 +11320,7 @@ async function runPipeTrapCheck() {
|
|
|
11311
11320
|
process.exit(1);
|
|
11312
11321
|
}
|
|
11313
11322
|
const findings = files.flatMap(
|
|
11314
|
-
(file) => findPipeTraps(
|
|
11323
|
+
(file) => findPipeTraps(readFileSync33(file, "utf8")).map(
|
|
11315
11324
|
(t) => `${relative7(root, file)}:${t.line} ${t.text}
|
|
11316
11325
|
${t.reason}`
|
|
11317
11326
|
)
|
|
@@ -11328,17 +11337,17 @@ async function runPipeTrapCheck() {
|
|
|
11328
11337
|
}
|
|
11329
11338
|
|
|
11330
11339
|
// src/scripts/check-plugin-collisions.ts
|
|
11331
|
-
import { existsSync as
|
|
11340
|
+
import { existsSync as existsSync39 } from "fs";
|
|
11332
11341
|
import { join as join47 } from "path";
|
|
11333
11342
|
import { execa as execa15 } from "execa";
|
|
11334
11343
|
|
|
11335
11344
|
// src/lib/plugin-collision-guard.ts
|
|
11336
|
-
import { existsSync as
|
|
11345
|
+
import { existsSync as existsSync38, readdirSync as readdirSync20, statSync as statSync12 } from "fs";
|
|
11337
11346
|
import { join as join46 } from "path";
|
|
11338
11347
|
var PYTEST_SPECIAL = /* @__PURE__ */ new Set(["conftest.py"]);
|
|
11339
11348
|
var IGNORED_DIRS = /* @__PURE__ */ new Set([".venv", "node_modules", "__pycache__", ".git", "dist", "build"]);
|
|
11340
11349
|
function subdirectories(dir) {
|
|
11341
|
-
if (!
|
|
11350
|
+
if (!existsSync38(dir)) return [];
|
|
11342
11351
|
return readdirSync20(dir).filter((entry) => {
|
|
11343
11352
|
if (IGNORED_DIRS.has(entry) || entry.startsWith(".")) return false;
|
|
11344
11353
|
try {
|
|
@@ -11349,12 +11358,12 @@ function subdirectories(dir) {
|
|
|
11349
11358
|
});
|
|
11350
11359
|
}
|
|
11351
11360
|
function regularPackagesOf(pluginDir2) {
|
|
11352
|
-
return subdirectories(pluginDir2).filter((name) =>
|
|
11361
|
+
return subdirectories(pluginDir2).filter((name) => existsSync38(join46(pluginDir2, name, "__init__.py"))).sort();
|
|
11353
11362
|
}
|
|
11354
11363
|
function bareTestModulesOf(pluginDir2) {
|
|
11355
11364
|
const testsDir = join46(pluginDir2, "tests");
|
|
11356
|
-
if (!
|
|
11357
|
-
if (
|
|
11365
|
+
if (!existsSync38(testsDir)) return [];
|
|
11366
|
+
if (existsSync38(join46(testsDir, "__init__.py"))) return [];
|
|
11358
11367
|
return readdirSync20(testsDir).filter((f) => f.endsWith(".py") && !PYTEST_SPECIAL.has(f)).sort();
|
|
11359
11368
|
}
|
|
11360
11369
|
function findCollisions(servicesDir, pluginDirs) {
|
|
@@ -11402,7 +11411,7 @@ function formatCollisions(collisions) {
|
|
|
11402
11411
|
async function runPluginCollisionCheck() {
|
|
11403
11412
|
const root = (await execa15("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
11404
11413
|
const servicesDir = join47(root, "services");
|
|
11405
|
-
if (!
|
|
11414
|
+
if (!existsSync39(servicesDir)) {
|
|
11406
11415
|
console.log("\u2713 plugin collision guard: no services/ directory \u2014 nothing to compare");
|
|
11407
11416
|
return;
|
|
11408
11417
|
}
|
|
@@ -11422,7 +11431,7 @@ async function runPluginCollisionCheck() {
|
|
|
11422
11431
|
import { execa as execa16 } from "execa";
|
|
11423
11432
|
|
|
11424
11433
|
// src/lib/plugin-terraform-guard.ts
|
|
11425
|
-
import { existsSync as
|
|
11434
|
+
import { existsSync as existsSync40, readFileSync as readFileSync34, readdirSync as readdirSync21 } from "fs";
|
|
11426
11435
|
import { dirname as dirname10, join as join48, relative as relative8, sep as sep3 } from "path";
|
|
11427
11436
|
var SKIP_DIRS3 = /* @__PURE__ */ new Set(["node_modules", ".git", ".worktrees", "dist", ".venv", "__pycache__"]);
|
|
11428
11437
|
var PLUGIN_MANIFEST_FILE2 = "biffo.plugin.json";
|
|
@@ -11450,7 +11459,7 @@ function findPluginManifests(root) {
|
|
|
11450
11459
|
function readSubscriptions(absManifestPath) {
|
|
11451
11460
|
let parsed;
|
|
11452
11461
|
try {
|
|
11453
|
-
parsed = JSON.parse(
|
|
11462
|
+
parsed = JSON.parse(readFileSync34(absManifestPath, "utf8"));
|
|
11454
11463
|
} catch {
|
|
11455
11464
|
return null;
|
|
11456
11465
|
}
|
|
@@ -11465,14 +11474,14 @@ function readSubscriptions(absManifestPath) {
|
|
|
11465
11474
|
}
|
|
11466
11475
|
function checkPluginTerraform(root) {
|
|
11467
11476
|
const violations = [];
|
|
11468
|
-
const coreManifest =
|
|
11477
|
+
const coreManifest = existsSync40(join48(root, CORE_MANIFEST_FILE)) ? readCoreManifest(root) : null;
|
|
11469
11478
|
for (const manifest of findPluginManifests(root)) {
|
|
11470
11479
|
if (coreManifest && !isTemplateOwned(manifest, coreManifest)) continue;
|
|
11471
11480
|
const absManifest = join48(root, manifest);
|
|
11472
11481
|
const subscriptions = readSubscriptions(absManifest);
|
|
11473
11482
|
if (subscriptions === null) continue;
|
|
11474
11483
|
const pluginDir2 = dirname10(absManifest);
|
|
11475
|
-
if (
|
|
11484
|
+
if (existsSync40(join48(pluginDir2, "terraform"))) continue;
|
|
11476
11485
|
const relPluginDir = relative8(root, pluginDir2).split(sep3).join("/");
|
|
11477
11486
|
violations.push({
|
|
11478
11487
|
manifest,
|
|
@@ -11503,12 +11512,12 @@ async function runPluginTerraformCheck() {
|
|
|
11503
11512
|
}
|
|
11504
11513
|
|
|
11505
11514
|
// src/scripts/check-plugin-tool-supply.ts
|
|
11506
|
-
import { existsSync as
|
|
11515
|
+
import { existsSync as existsSync42 } from "fs";
|
|
11507
11516
|
import { join as join50 } from "path";
|
|
11508
11517
|
import { execa as execa17 } from "execa";
|
|
11509
11518
|
|
|
11510
11519
|
// src/lib/plugin-tool-supply-audit.ts
|
|
11511
|
-
import { existsSync as
|
|
11520
|
+
import { existsSync as existsSync41, readFileSync as readFileSync35, readdirSync as readdirSync22, statSync as statSync13 } from "fs";
|
|
11512
11521
|
import { join as join49 } from "path";
|
|
11513
11522
|
|
|
11514
11523
|
// src/lib/openrouter-model-snapshot.ts
|
|
@@ -12242,8 +12251,8 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
12242
12251
|
const now = options.now ?? /* @__PURE__ */ new Date();
|
|
12243
12252
|
const configPath = join49(repoRoot, CONFIG_PY_PATH);
|
|
12244
12253
|
const orchestrationPath = join49(repoRoot, ORCHESTRATION_SCHEMA_PATH);
|
|
12245
|
-
const configMissing = !
|
|
12246
|
-
const orchestrationSchemaMissing = !
|
|
12254
|
+
const configMissing = !existsSync41(configPath);
|
|
12255
|
+
const orchestrationSchemaMissing = !existsSync41(orchestrationPath);
|
|
12247
12256
|
const knownSet = new Set(knownModelIds);
|
|
12248
12257
|
const snapshotEmpty = knownModelIds.length === 0;
|
|
12249
12258
|
const snapshotStale = isSnapshotStale(snapshotFetchedAt, now);
|
|
@@ -12261,13 +12270,13 @@ function auditDeclaredModelIds(repoRoot, options = {}) {
|
|
|
12261
12270
|
};
|
|
12262
12271
|
let settingsBlind = false;
|
|
12263
12272
|
if (!configMissing) {
|
|
12264
|
-
const settingsFields = extractSettingsModelFields(
|
|
12273
|
+
const settingsFields = extractSettingsModelFields(readFileSync35(configPath, "utf8"));
|
|
12265
12274
|
if (settingsFields.length === 0) settingsBlind = true;
|
|
12266
12275
|
for (const { field, value } of settingsFields) record(`${CONFIG_PY_PATH}#${field}`, value);
|
|
12267
12276
|
}
|
|
12268
12277
|
let curatedFieldsBlind = false;
|
|
12269
12278
|
if (!orchestrationSchemaMissing) {
|
|
12270
|
-
const curated = extractCuratedModelFields(
|
|
12279
|
+
const curated = extractCuratedModelFields(readFileSync35(orchestrationPath, "utf8"));
|
|
12271
12280
|
if (curated.rawFieldCount > 0 && curated.fields.every((f) => f.defaultValue === null && f.optionValues.length === 0)) {
|
|
12272
12281
|
curatedFieldsBlind = true;
|
|
12273
12282
|
}
|
|
@@ -12328,7 +12337,7 @@ function auditPluginToolSupply(pluginsRoot) {
|
|
|
12328
12337
|
let totalDeclaredTools = 0;
|
|
12329
12338
|
for (const name of pluginNames) {
|
|
12330
12339
|
const pluginDir2 = join49(pluginsRoot, name);
|
|
12331
|
-
const manifestText =
|
|
12340
|
+
const manifestText = readFileSync35(join49(pluginDir2, "biffo.plugin.json"), "utf8");
|
|
12332
12341
|
const manifest = extractManifestTools(manifestText);
|
|
12333
12342
|
if (manifest.parseError) {
|
|
12334
12343
|
findings.push({
|
|
@@ -12346,13 +12355,13 @@ function auditPluginToolSupply(pluginsRoot) {
|
|
|
12346
12355
|
totalDeclaredTools += manifest.tools.length;
|
|
12347
12356
|
const pySources = pluginPythonFiles(pluginDir2).map((f) => ({
|
|
12348
12357
|
file: f,
|
|
12349
|
-
text:
|
|
12358
|
+
text: readFileSync35(f, "utf8")
|
|
12350
12359
|
}));
|
|
12351
12360
|
const resolver = buildSymbolResolver(pySources);
|
|
12352
12361
|
const registry = extractToolRegistryEntries(pySources, resolver);
|
|
12353
12362
|
if (registry.rawToolDefinitionCount > 0 && registry.entries.length === 0) registryBlind = true;
|
|
12354
12363
|
const tfFiles = pluginTerraformFiles(pluginDir2);
|
|
12355
|
-
const tfText = tfFiles.map((f) =>
|
|
12364
|
+
const tfText = tfFiles.map((f) => readFileSync35(f, "utf8")).join("\n");
|
|
12356
12365
|
const terraform = extractTerraformEnvKeys(tfText);
|
|
12357
12366
|
if (terraform.rawMarkerCount > 0 && terraform.resolvedBlockCount === 0) terraformBlind = true;
|
|
12358
12367
|
for (const toolName of manifest.tools) {
|
|
@@ -12460,7 +12469,7 @@ async function runPluginToolSupplyCheck() {
|
|
|
12460
12469
|
const root = (await execa17("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
12461
12470
|
let allOk = true;
|
|
12462
12471
|
const pluginsRoot = join50(root, "services", "_plugins");
|
|
12463
|
-
if (!
|
|
12472
|
+
if (!existsSync42(pluginsRoot)) {
|
|
12464
12473
|
console.log("\u2713 plugin tool-supply guard: no services/_plugins/ \u2014 nothing to audit");
|
|
12465
12474
|
} else {
|
|
12466
12475
|
const report = auditPluginToolSupply(pluginsRoot);
|
|
@@ -12491,7 +12500,7 @@ async function runPluginToolSupplyCheck() {
|
|
|
12491
12500
|
}
|
|
12492
12501
|
}
|
|
12493
12502
|
const servicesApiRoot = join50(root, "services", "api");
|
|
12494
|
-
if (!
|
|
12503
|
+
if (!existsSync42(servicesApiRoot)) {
|
|
12495
12504
|
console.log("\u2713 plugin model-id guard: no services/api/ \u2014 nothing to audit");
|
|
12496
12505
|
} else {
|
|
12497
12506
|
const modelReport = auditDeclaredModelIds(root);
|
|
@@ -12668,12 +12677,12 @@ async function runReleaseSubjectCheck(argv) {
|
|
|
12668
12677
|
}
|
|
12669
12678
|
|
|
12670
12679
|
// src/scripts/check-skeleton-drift.ts
|
|
12671
|
-
import { existsSync as
|
|
12680
|
+
import { existsSync as existsSync43, readdirSync as readdirSync24 } from "fs";
|
|
12672
12681
|
import { join as join52 } from "path";
|
|
12673
12682
|
import { execa as execa19 } from "execa";
|
|
12674
12683
|
|
|
12675
12684
|
// src/lib/skeleton-drift-guard.ts
|
|
12676
|
-
import { readFileSync as
|
|
12685
|
+
import { readFileSync as readFileSync36, readdirSync as readdirSync23, statSync as statSync14 } from "fs";
|
|
12677
12686
|
import { join as join51 } from "path";
|
|
12678
12687
|
var isWorkflow = (rel) => rel.startsWith(".github/workflows/") && (rel.endsWith(".yml") || rel.endsWith(".yaml"));
|
|
12679
12688
|
var isRootLayout = (rel) => rel.endsWith("src/app/layout.tsx");
|
|
@@ -12760,7 +12769,7 @@ function auditSkeleton(skeletonRoot, name, rules = SKELETON_RULES) {
|
|
|
12760
12769
|
if (!rule.appliesTo(rel)) continue;
|
|
12761
12770
|
let contents;
|
|
12762
12771
|
try {
|
|
12763
|
-
contents =
|
|
12772
|
+
contents = readFileSync36(join51(skeletonRoot, rel), "utf8");
|
|
12764
12773
|
} catch {
|
|
12765
12774
|
continue;
|
|
12766
12775
|
}
|
|
@@ -12796,7 +12805,7 @@ function discoverSkeletons(root) {
|
|
|
12796
12805
|
} catch {
|
|
12797
12806
|
return [];
|
|
12798
12807
|
}
|
|
12799
|
-
return entries.filter((name) =>
|
|
12808
|
+
return entries.filter((name) => existsSync43(join52(skeletonsDir, name, ".github", "workflows", "ci.yml"))).sort();
|
|
12800
12809
|
}
|
|
12801
12810
|
async function runSkeletonDriftCheck() {
|
|
12802
12811
|
const root = (await execa19("git", ["rev-parse", "--show-toplevel"])).stdout.trim();
|
|
@@ -12805,7 +12814,7 @@ async function runSkeletonDriftCheck() {
|
|
|
12805
12814
|
for (const name of skeletons) {
|
|
12806
12815
|
const skeletonRoot = join52(root, "_skeletons", name);
|
|
12807
12816
|
filesConsidered += findWorkflowFiles(skeletonRoot).length;
|
|
12808
|
-
if (
|
|
12817
|
+
if (existsSync43(join52(skeletonRoot, "apps", "frontend", "src", "app", "layout.tsx"))) {
|
|
12809
12818
|
filesConsidered += 1;
|
|
12810
12819
|
}
|
|
12811
12820
|
}
|
|
@@ -12942,7 +12951,7 @@ function rawArgsAfter(subcommand) {
|
|
|
12942
12951
|
}
|
|
12943
12952
|
|
|
12944
12953
|
// src/commands/doctor.ts
|
|
12945
|
-
import { existsSync as
|
|
12954
|
+
import { existsSync as existsSync44, readFileSync as readFileSync37 } from "fs";
|
|
12946
12955
|
import { join as join53, resolve as resolve18 } from "path";
|
|
12947
12956
|
import chalk21 from "chalk";
|
|
12948
12957
|
import { Command as Command24 } from "commander";
|
|
@@ -13119,9 +13128,9 @@ async function runDoctor(options, deps = { git: new GitAdapter() }) {
|
|
|
13119
13128
|
}
|
|
13120
13129
|
function readLocalCoreVersion(cwd) {
|
|
13121
13130
|
const path = join53(cwd, INSTANCE_CORE_FILE);
|
|
13122
|
-
if (!
|
|
13131
|
+
if (!existsSync44(path)) return null;
|
|
13123
13132
|
try {
|
|
13124
|
-
return parseCoreRecord(
|
|
13133
|
+
return parseCoreRecord(readFileSync37(path, "utf8"));
|
|
13125
13134
|
} catch {
|
|
13126
13135
|
return null;
|
|
13127
13136
|
}
|
|
@@ -13137,9 +13146,9 @@ function parseCoreRecord(contents) {
|
|
|
13137
13146
|
}
|
|
13138
13147
|
function readFossil(cwd) {
|
|
13139
13148
|
const path = join53(cwd, CORE_VERSION_FILE);
|
|
13140
|
-
if (!
|
|
13149
|
+
if (!existsSync44(path)) return null;
|
|
13141
13150
|
try {
|
|
13142
|
-
const value =
|
|
13151
|
+
const value = readFileSync37(path, "utf8").trim();
|
|
13143
13152
|
return value === "" ? null : value;
|
|
13144
13153
|
} catch {
|
|
13145
13154
|
return null;
|
|
@@ -13588,13 +13597,13 @@ import { fileURLToPath as fileURLToPath6 } from "url";
|
|
|
13588
13597
|
import { Command as Command26 } from "commander";
|
|
13589
13598
|
|
|
13590
13599
|
// src/lib/packaged-scripts.ts
|
|
13591
|
-
import { existsSync as
|
|
13600
|
+
import { existsSync as existsSync45 } from "fs";
|
|
13592
13601
|
import { dirname as dirname11, join as join54 } from "path";
|
|
13593
13602
|
function findPackagedScript(startDir, relativePath) {
|
|
13594
13603
|
let dir = startDir;
|
|
13595
13604
|
for (; ; ) {
|
|
13596
13605
|
const candidate = join54(dir, relativePath);
|
|
13597
|
-
if (
|
|
13606
|
+
if (existsSync45(candidate)) return candidate;
|
|
13598
13607
|
const parent = dirname11(dir);
|
|
13599
13608
|
if (parent === dir) return null;
|
|
13600
13609
|
dir = parent;
|