Files
buzz/desktop/scripts/check-file-sizes.mjs
Duncan 20609f1815 feat(manifest): model-capability manifest — single source of truth for efforts, routes, labels
Rebased onto origin/main (5bf78671f4).

Conflict resolved in crates/buzz-agent/src/config.rs: kept our generated
anthropic_thinking_config_generated as the sole authority; absorbed main's
thinking shapes, ThinkingSummary enum + parse_thinking_summary, and the
thinking_summary field in Config wired through from_env / for_discovery.

Fixed CI job (model-capabilities): actions/checkout comment v6 → v6.0.3,
Swatinem/rust-cache SHA bumped to tagged v2.9.1 (c1937114) to resolve
zizmor ref-version-mismatch finding (r3730151005).

  62ebc9431 fix(model-capabilities): collapse empty segments in Rust gpt-version-segment matcher
  817b88790 test(file-size): fix fileOverrides integration test under GITHUB_ACTIONS
  1e9df5568 fix(manifest): enforce registry_label exclusion on family rules; test fileOverrides boundary
  0e6aacfd2 fix(buzz-agent): curate display name in configured_model_fallback
  77c24ef32 chore(manifest): remove dead registry_labels key

Co-authored-by: Will Pfleger <pfleger.will@gmail.com>
Signed-off-by: Will Pfleger <pfleger.will@gmail.com>
2026-08-10 11:10:45 -04:00

70 lines
1.9 KiB
JavaScript

import path from "node:path";
import { fileURLToPath } from "node:url";
import { runFileSizeCheck } from "../../scripts/check-file-sizes-core.mjs";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const projectRoot = path.resolve(__dirname, "..");
const MAX_LINES = 1000;
const rules = [
{ root: "src-tauri/src", extensions: new Set([".rs"]), maxLines: MAX_LINES },
// Workspace member crates. Without this the ratchet's only Rust root is
// `src-tauri/src`, and a crate under `src-tauri/crates/` is born outside the
// repo's one size discipline -- silently, since the check still exits 0.
{
root: "src-tauri/crates",
extensions: new Set([".rs"]),
maxLines: MAX_LINES,
},
{
root: "src/app",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/features",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/api",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/context",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/lib",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/ui",
extensions: new Set([".ts", ".tsx"]),
maxLines: MAX_LINES,
},
{
root: "src/shared/styles",
extensions: new Set([".css"]),
maxLines: MAX_LINES,
},
];
await runFileSizeCheck({
projectRoot,
rules,
label: "Desktop",
// Auto-generated files are exempt from the hand-authored 1000-line ceiling.
// The line count is bounded by the manifest's exact_records count, not by
// engineering complexity. Set per-file caps tightly to catch unexpected growth.
fileOverrides: {
// Generated from scripts/model-capabilities.json — grows only when new
// models are added to the manifest. Cap at current size + headroom.
"src/features/agents/ui/modelCapabilities.ts": 1200,
},
});