Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.0/schema.json",
"$schema": "https://biomejs.dev/schemas/2.4.12/schema.json",
"root": true,
"files": {
"includes": ["packages/**/src/**", "packages/**/test/**", "scripts/**/*.{js,mjs,ts}"],
Expand Down Expand Up @@ -36,6 +36,7 @@
"useImportType": "error"
},
"complexity": {
"useLiteralKeys": "off",
"useOptionalChain": "error"
}
}
Expand All @@ -46,5 +47,17 @@
"organizeImports": "on"
}
}
}
},
"overrides": [
{
"includes": ["packages/cli/src/commands/**"],
"linter": {
"rules": {
"suspicious": {
"noConsole": "off"
}
}
}
}
]
}
6 changes: 2 additions & 4 deletions packages/embedder/src/onnx-embedder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class OnnxEmbedder implements Embedder {
const hidden = results["last_hidden_state"];
if (hidden === undefined || hidden.type !== "float32") {
throw new Error(
`ONNX session did not return float32 last_hidden_state ` + `(got ${String(hidden?.type)})`,
`ONNX session did not return float32 last_hidden_state (got ${String(hidden?.type)})`,
);
}
// Shape is [B, seqLen, hiddenSize]. hiddenSize derived from data length
Expand All @@ -302,9 +302,7 @@ class OnnxEmbedder implements Embedder {
const data = hidden.data as Float32Array;
const hiddenSize = data.length / (batchSize * batchMax);
if (hiddenSize !== EMBED_DIM) {
throw new Error(
`Expected hidden size ${EMBED_DIM}, got ${hiddenSize}. ` + `Wrong model loaded?`,
);
throw new Error(`Expected hidden size ${EMBED_DIM}, got ${hiddenSize}. Wrong model loaded?`);
}

const out: Float32Array[] = [];
Expand Down
9 changes: 4 additions & 5 deletions packages/ingestion/src/pipeline/phases/profile.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ describe("profilePhase — polyglot TS + Python + Terraform + OpenAPI + Next.js
);
await fs.writeFile(
path.join(repo, "pyproject.toml"),
[
`${[
"[project]",
'name = "polyglot-svc"',
'version = "0.0.1"',
"dependencies = [",
' "django>=4.0",',
' "fastapi>=0.100",',
"]",
].join("\n") + "\n",
].join("\n")}\n`,
);
// requirements.txt should be shadowed by pyproject in the cascade
await fs.writeFile(path.join(repo, "requirements.txt"), "flask==2.2.0\n");
Expand All @@ -79,8 +79,7 @@ describe("profilePhase — polyglot TS + Python + Terraform + OpenAPI + Next.js
await fs.mkdir(path.join(repo, "api"), { recursive: true });
await fs.writeFile(
path.join(repo, "api", "openapi.yaml"),
["openapi: 3.0.3", "info:", " title: Sample", " version: 1.0.0", "paths: {}"].join("\n") +
"\n",
`${["openapi: 3.0.3", "info:", " title: Sample", " version: 1.0.0", "paths: {}"].join("\n")}\n`,
);

// Docker
Expand All @@ -90,7 +89,7 @@ describe("profilePhase — polyglot TS + Python + Terraform + OpenAPI + Next.js
await fs.mkdir(path.join(repo, "deploy"), { recursive: true });
await fs.writeFile(
path.join(repo, "deploy", "pod.yaml"),
["apiVersion: v1", "kind: Pod", "metadata:", " name: demo"].join("\n") + "\n",
`${["apiVersion: v1", "kind: Pod", "metadata:", " name: demo"].join("\n")}\n`,
);

// Source code directories. Python side:
Expand Down
1 change: 0 additions & 1 deletion packages/mcp/src/next-step-hints.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,5 @@ test("withNextSteps attaches staleness under codehub/staleness namespace", () =>
test("withNextSteps omits _meta entirely when no staleness", () => {
const result = withNextSteps("x", { a: 1 }, ["hi"]);
const sc = result.structuredContent as Record<string, unknown>;
// biome-ignore lint/complexity/useLiteralKeys: dot-access disallowed on Record index signatures
assert.equal(sc["_meta"], undefined);
});
1 change: 0 additions & 1 deletion packages/mcp/src/next-step-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ export function withNextSteps<T extends Record<string, unknown>>(
next_steps: [...nextSteps],
};
if (Object.keys(meta).length > 0) {
// biome-ignore lint/complexity/useLiteralKeys: dot-access disallowed on Record index signatures
structuredContent["_meta"] = meta;
}

Expand Down
1 change: 0 additions & 1 deletion packages/mcp/src/resources/repo-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export function registerRepoContextResource(server: McpServer, ctx: ResourceCont
mimeType: "text/yaml",
},
async (uri, variables): Promise<ReadResourceResult> => {
// biome-ignore lint/complexity/useLiteralKeys: dot-access disallowed on Record index signatures
const raw = variables["name"];
const nameVar = Array.isArray(raw) ? raw[0] : raw;
const decoded = nameVar ? decodeURIComponent(String(nameVar)) : undefined;
Expand Down
1 change: 0 additions & 1 deletion packages/sarif/src/enrich.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ function primaryFingerprint(result: unknown): string | undefined {
if (!isPlainObject(result)) {
return undefined;
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures (tsconfig's noPropertyAccessFromIndexSignature)
const pf = result["partialFingerprints"];
if (!isPlainObject(pf)) {
return undefined;
Expand Down
6 changes: 0 additions & 6 deletions packages/storage/src/meta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,29 +75,23 @@ function validateStoreMeta(value: unknown, source: string): asserts value is Sto
}
const v = value as Record<string, unknown>;
// Bracket access required by tsconfig's `noPropertyAccessFromIndexSignature`.
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
if (typeof v["schemaVersion"] !== "string") {
throw new Error(`Invalid meta.json at ${source}: schemaVersion missing`);
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
if (typeof v["indexedAt"] !== "string") {
throw new Error(`Invalid meta.json at ${source}: indexedAt missing`);
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
if (typeof v["nodeCount"] !== "number" || typeof v["edgeCount"] !== "number") {
throw new Error(`Invalid meta.json at ${source}: counts missing`);
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
const cacheHitRatio = v["cacheHitRatio"];
if (cacheHitRatio !== undefined && typeof cacheHitRatio !== "number") {
throw new Error(`Invalid meta.json at ${source}: cacheHitRatio must be a number`);
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
const cacheSizeBytes = v["cacheSizeBytes"];
if (cacheSizeBytes !== undefined && typeof cacheSizeBytes !== "number") {
throw new Error(`Invalid meta.json at ${source}: cacheSizeBytes must be a number`);
}
// biome-ignore lint/complexity/useLiteralKeys: dot-access is disallowed on Record index signatures
const lastCompaction = v["lastCompaction"];
if (lastCompaction !== undefined && typeof lastCompaction !== "string") {
throw new Error(`Invalid meta.json at ${source}: lastCompaction must be a string`);
Expand Down
Loading