@@ -102,6 +102,8 @@ export type FocusManifestGateConfig = {
102102 slopMinScore : number | null ;
103103 slopAiAdvisory : boolean | null ;
104104 sizeMode : GateRuleMode | null ;
105+ sizeMaxFiles : number | null ;
106+ sizeMaxLines : number | null ;
105107 /** `gate.lockfileIntegrity` (#2563): off|advisory|block, off by default. When not off, a changed
106108 * `package-lock.json` diff is scanned for a `resolved`/`integrity` change unaccompanied by a matching
107109 * `package.json` version bump, or a `resolved` URL outside `registry.npmjs.org` — a `lockfile_tamper_risk`
@@ -982,6 +984,8 @@ const EMPTY_GATE_CONFIG: FocusManifestGateConfig = {
982984 slopMinScore : null ,
983985 slopAiAdvisory : null ,
984986 sizeMode : null ,
987+ sizeMaxFiles : null ,
988+ sizeMaxLines : null ,
985989 lockfileIntegrityMode : null ,
986990 aiReviewMode : null ,
987991 aiReviewByok : null ,
@@ -1385,6 +1389,8 @@ function parseGateConfig(value: JsonValue | undefined, warnings: string[]): Focu
13851389 slopMinScore : normalizeOptionalScore ( slopRecord ?. minScore , "gate.slop.minScore" , warnings ) ,
13861390 slopAiAdvisory : normalizeOptionalBoolean ( slopRecord ?. aiAdvisory , "gate.slop.aiAdvisory" , warnings ) ,
13871391 sizeMode : normalizeOptionalGateMode ( sizeRecord ?. mode , "gate.size.mode" , warnings ) ,
1392+ sizeMaxFiles : normalizeOptionalPositiveInteger ( sizeRecord ?. maxFiles , "gate.size.maxFiles" , warnings ) ,
1393+ sizeMaxLines : normalizeOptionalPositiveInteger ( sizeRecord ?. maxLines , "gate.size.maxLines" , warnings ) ,
13881394 lockfileIntegrityMode : normalizeOptionalGateMode ( record . lockfileIntegrity , "gate.lockfileIntegrity" , warnings ) ,
13891395 aiReviewMode : normalizeOptionalGateMode ( aiReviewRecord ?. mode , "gate.aiReview.mode" , warnings ) ,
13901396 aiReviewByok : normalizeOptionalBoolean ( aiReviewRecord ?. byok , "gate.aiReview.byok" , warnings ) ,
@@ -1451,6 +1457,8 @@ function parseGateConfig(value: JsonValue | undefined, warnings: string[]): Focu
14511457 gate . slopMinScore !== null ||
14521458 gate . slopAiAdvisory !== null ||
14531459 gate . sizeMode !== null ||
1460+ gate . sizeMaxFiles !== null ||
1461+ gate . sizeMaxLines !== null ||
14541462 gate . lockfileIntegrityMode !== null ||
14551463 gate . aiReviewMode !== null ||
14561464 gate . aiReviewByok !== null ||
@@ -1500,7 +1508,13 @@ export function gateConfigToJson(gate: FocusManifestGateConfig): JsonValue {
15001508 if ( gate . readinessMinScore !== null ) readiness . minScore = gate . readinessMinScore ;
15011509 out . readiness = readiness ;
15021510 }
1503- if ( gate . sizeMode !== null ) out . size = { mode : gate . sizeMode } ;
1511+ if ( gate . sizeMode !== null || gate . sizeMaxFiles !== null || gate . sizeMaxLines !== null ) {
1512+ const size : Record < string , JsonValue > = { } ;
1513+ if ( gate . sizeMode !== null ) size . mode = gate . sizeMode ;
1514+ if ( gate . sizeMaxFiles !== null ) size . maxFiles = gate . sizeMaxFiles ;
1515+ if ( gate . sizeMaxLines !== null ) size . maxLines = gate . sizeMaxLines ;
1516+ out . size = size ;
1517+ }
15041518 if ( gate . lockfileIntegrityMode !== null ) out . lockfileIntegrity = gate . lockfileIntegrityMode ;
15051519 if ( gate . slopMode !== null || gate . slopMinScore !== null || gate . slopAiAdvisory !== null ) {
15061520 const slop : Record < string , JsonValue > = { } ;
0 commit comments