@mark1russell7/layout-contract 0.3.9 → 0.3.10

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/README.md CHANGED
@@ -30,7 +30,7 @@ The package has one runtime dependency: `@mark1russell7/rigor-generators`, the h
30
30
  | The strategy space | `StrategySpace`, `SpaceStage`, `StageOption`, `OptionSupports`, `ShapeFilter`, `SpaceParam`, `ParamWhen`, `MemberRule`, `SpaceConstraint`, `OptionRef`, `StrategyConfig`, `StageChoice`, `ParamKind`, `ParamValue`, `STRATEGY_SPACE_SCHEMA` |
31
31
  | The space functions | `checkSpace`, `checkConfig`, `canonicalConfig`, `configId`, `spaceSize`, `spaceShapeKinds`, `paramLevels`, `enumerateSpace`, `productSpace`, `joinConfigs`, `splitConfig`, `SpaceSize`, `SpaceSizeOptions`, `EnumerateOptions`, `GridOptions`, `SampleOptions` |
32
32
  | The option declarations | `OptionSchema`, `OptionDeclaration`, `AnyOption`, `NumberOption`, `BooleanOption`, `EnumOption`, `ValueOption`, `ListItem`, `NoDefault`, `DeclaredStrategy`, `listOptions`, `optionDefaults`, `checkOptions`, `clampOptions`, `sweepValues`, `sweepOf`, `sweepGrid`, `checkSchema` |
33
- | The strategy catalog | `StrategyCatalog`, `StrategyCatalogSource`, `CatalogEntry`, `StrategyMember`, `CatalogLimit`, `STRATEGY_CATALOG_SCHEMA`, `NODE_POSITIONS_DIMENSION`, `parseStrategyCatalog`, `writeStrategyCatalog`, `checkCatalog`, `catalogDefaults`, `catalogOptions`, `catalogChoices`, `catalogKey`, `decodeOptionValue`, `encodeOptionValue` |
33
+ | The strategy catalog | `StrategyCatalog`, `StrategyCatalogSource`, `CatalogEntry`, `ParamRoute`, `StrategyMember`, `CatalogLimit`, `STRATEGY_CATALOG_SCHEMA`, `NODE_POSITIONS_DIMENSION`, `parseStrategyCatalog`, `writeStrategyCatalog`, `checkCatalog`, `catalogDefaults`, `catalogOptions`, `catalogChoices`, `catalogKey`, `decodeOptionValue`, `encodeOptionValue` |
34
34
  | The turn | `turnBox`, `turnPort`, `turnMargin`, `turnRegion`, `turnSide`, `turnPoint` |
35
35
  | The tolerances | `EPS`, `RECORD_EPS`, `RECORD_SCALE`, `Tolerance`, `DEFAULT_TOLERANCE` |
36
36
  | The hard rules | `countOverlaps`, `countObstacleHits`, `regionHitsRect`, `rectInRegion`, `countOutside`, `ContainerTest`, `countPortsOffBorder`, `packHard`, `PackHard`, `PACK_HARD_RULES`, `placedRect`, `checkInput` |
package/build/index.d.ts CHANGED
@@ -857,6 +857,8 @@ export interface ValueOption<V = unknown, S extends string = string> extends Opt
857
857
  readonly inlineOptions?: boolean;
858
858
  /** The value `false` leaves out the opt-in strategies, because the option finds only the default set of the engine. This field is for the type `strategy`. */
859
859
  readonly optIn?: boolean;
860
+ /** For each dimension of `supports`, the value that a chosen strategy must take. This field is for the type `strategy`, and also for an item of a list. */
861
+ readonly needs?: Readonly<Record<string, string>>;
860
862
  /** The declaration of each item, for the type `list`. */
861
863
  readonly of?: ListItem<S>;
862
864
  /** The smallest number of items, for the type `list`. */
@@ -875,8 +877,9 @@ export type ListItem<S extends string = string> = ItemOf<AnyOption<S>>;
875
877
  /**
876
878
  * The declaration that fits the type of an option value: numbers, booleans, string unions or other values.
877
879
  * A union of strings and other values takes an enum of the strings or a value declaration. An example is a rule or the name of a rule.
880
+ * A plain `string` takes an enum or a value declaration, because the value can be the key of a strategy.
878
881
  */
879
- export type OptionDeclaration<V, S extends string = string> = [V] extends [number] ? NumberOption : [V] extends [boolean] ? BooleanOption : [V] extends [string] ? EnumOption<V> : [Extract<V, string>] extends [never] ? ValueOption<V, S> : EnumOption<Extract<V, string>> | ValueOption<V, S>;
882
+ export type OptionDeclaration<V, S extends string = string> = [V] extends [number] ? NumberOption : [V] extends [boolean] ? BooleanOption : [V] extends [string] ? string extends V ? EnumOption<V> | ValueOption<V, S> : EnumOption<V> : [Extract<V, string>] extends [never] ? ValueOption<V, S> : EnumOption<Extract<V, string>> | ValueOption<V, S>;
880
883
  /** The declarations of the options of a strategy. The schema has one declaration for each key of the options type, and no other key. */
881
884
  export type OptionSchema<O, S extends string = string> = { readonly [K in keyof O]-?: OptionDeclaration<NonNullable<O[K]>, S>; };
882
885
  /** The fields of a strategy that the functions of this module read. An engine can add other fields. */
@@ -1051,10 +1054,24 @@ export interface SupportProbe {
1051
1054
  /** This function gives `true` if the strategy refuses the input, and `undefined` if the input cannot go to this strategy. */
1052
1055
  readonly refuses: (key: string) => boolean | undefined;
1053
1056
  }
1057
+ /**
1058
+ * The statement of how one place of a space reaches the options of an engine. The file of a catalog does not hold it, because a value can hold code.
1059
+ *
1060
+ * - `spaceOnly` tells that the place sets no option, with one sentence that tells why. A stage option without an entry can also have this statement.
1061
+ * - `option` names the option of the param, when the option has another name. `value` gives the option value of one param value, and `undefined` when the param value sets no option.
1062
+ */
1063
+ export type ParamRoute = {
1064
+ readonly spaceOnly: string;
1065
+ } | {
1066
+ readonly option?: string;
1067
+ readonly value?: (value: ParamValue) => unknown;
1068
+ };
1054
1069
  /** The options of `checkCatalog`. */
1055
1070
  export interface CatalogCheckOptions {
1056
1071
  /** Each param of these spaces is examined against the declaration of its option. */
1057
1072
  readonly spaces?: readonly StrategySpace[];
1073
+ /** The routes of the params of `spaces`. The key is `<stage>/<option>.<param>`, or `<stage>/<option>` for a stage option. A route that matches nothing is a fault. */
1074
+ readonly paramRoutes?: Readonly<Record<string, ParamRoute>>;
1058
1075
  readonly probes?: readonly SupportProbe[];
1059
1076
  /** This function runs `owner` with `choice` in its option `option`. It gives `true` for a refusal, or `undefined` if the input cannot go to `owner`. */
1060
1077
  readonly refusesChoice?: (owner: string, option: string, choice: string) => boolean | undefined;
@@ -1065,8 +1082,10 @@ export interface CatalogCheck {
1065
1082
  readonly faults: readonly string[];
1066
1083
  /** The claims that no run examined, by key and with the reason. */
1067
1084
  readonly notRun: readonly string[];
1068
- /** The stage options and the params of a space that have no entry or no declaration in the catalog. */
1085
+ /** The stage options and the params of a space that have no entry, no declaration and no route. */
1069
1086
  readonly notMatched: readonly string[];
1087
+ /** The places of a space with a `spaceOnly` route, each with its reason. */
1088
+ readonly spaceOnly: readonly string[];
1070
1089
  }
1071
1090
  /** The value of a strategy option that holds the options of the chosen strategy. A declaration with `inlineOptions` takes it. */
1072
1091
  export interface StrategyMember {
@@ -1085,8 +1104,9 @@ export interface CatalogOptionsOptions {
1085
1104
  /** This function gives the key of a strategy from its step and its id. */
1086
1105
  export declare function catalogKey(id: string, step?: string): string;
1087
1106
  /**
1088
- * This function gives the strategies that a chooser offers, by the `step`, `kinds` and `optIn` of an option. Thus no chooser keeps a copy of this rule.
1107
+ * This function gives the strategies that a chooser offers, by the `step`, `kinds`, `optIn` and `needs` of an option. Thus no chooser keeps a copy of this rule.
1089
1108
  * A baseline is not in the result. A list gives the strategies of its items. An option of each other type gives nothing.
1109
+ * A strategy that does not list a dimension of `needs` has no declared limit there, so the option offers it.
1090
1110
  * Without a declaration, the function gives each strategy that is not a baseline.
1091
1111
  */
1092
1112
  export declare function catalogChoices(strategies: readonly CatalogEntry[], declaration?: AnyOption | ListItem): readonly CatalogEntry[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;WACN;WACA;WACA;WACA;;;iBAIM;WACN;WACA;WACA,WAAW,SAAS;;;iBAId;WACN,qBAAqB;;WAErB;;WAEA;aAAiB;aAAoB;;;WAErC;aAA2B;aAAqB;aAAoB;;WACpE,iBAAiB;;;;;;;wBAQZ,UAAU,OAAO,aAAa,QAA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M,cAAc,UAAU,eAAe,UAAU;;EAEvD,UAAU,cAAc,UAAU;;EAElC,cAAc,cAAc,mBAAmB;;EAE/C,MAAM,cAAc,oBAAoB,cAAc,OAAO,SAAS,eAAe;;EAErF,YAAY;;;qBAID,mBAAmB;;;;;qBAwCnB,mBAAmB,SAAS,eAAe;;;;;wBA2BxC,gBAAgB,cAAc,QAAO,QAAQ,mBAAwB;;YAUzE,qBAAqB,KAAK;;;;;;wBAOtB,eAAe,cAAc,MAAM,qBAAqB;;;;;wBA+BxD,kBAAkB,KAAK,iBAAiB;;;;;wBA+FxC,YAAY,KAAK,YAAY;;wBAa7B,cAAc,KAAK,YAAY;;;;;;wBAsB/B,SAAS,KAAK,iBAAiB,iBAAiB;;;;;;;;wBAsChD,kBACd,qBAAqB,mBACrB,OAAM,SAAS,eAAe,cAC9B,gBACA,cACC;;wBA8Ha,qBAAqB,IAAI,aAAa,WAAU,SAAS,aAAa,MAAW,eAAe;;iBA2G/F;WACN;WACA;;WAEA;WACA;;WAEA,qBAAqB;;WAErB;WACA,aAAa;;WAEb,cAAc,MAAM;;EAE7B,MAAM,OAAO,aAAa,cAAc,MAAM,kBAAkB;;;iBAIjD;;WAEN;;WAEA;WACA;;WAEA,QAAQ,OAAO;;;;;;;wBAWV,cAAc,MAAM,aAAa,cAAc,gBAAgB,cAAc,UAAS,iBAAsB,aAAa;;;;;qBA+D5H,YAAY;;;;;;qBAoBZ,gBAAgB,aAAa"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../src/tolerance.ts","../src/output.ts","../src/record.ts","../src/rules.ts","../src/turn.ts","../src/balance.ts","../src/strategy.ts","../src/random.ts","../src/edges.ts","../src/hash.ts","../src/portfolio.ts","../src/strategy-space.ts","../src/strategy-options.ts","../src/strategy-catalog.ts","../src/verdict.ts","../src/families.ts"],"mappings":";;qBACa;;;;;qBAMA;;;;;qBAMA;;;;;iBAMI;;WAEN;;WAEA;;;;;;qBAOE,mBAAmB;;iBCzBf;WACN;WACA;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
@@ -3752,7 +3752,8 @@ const STRATEGY_FIELDS = [
3752
3752
  "kinds",
3753
3753
  "optionsKey",
3754
3754
  "inlineOptions",
3755
- "optIn"
3755
+ "optIn",
3756
+ "needs"
3756
3757
  ];
3757
3758
  const MEMBER_FIELDS = [
3758
3759
  "strategy",
@@ -3781,6 +3782,7 @@ const OPTION_ORDER = [
3781
3782
  "optionsKey",
3782
3783
  "inlineOptions",
3783
3784
  "optIn",
3785
+ "needs",
3784
3786
  "of",
3785
3787
  "default",
3786
3788
  "noDefault",
@@ -3888,6 +3890,10 @@ function readStrategyFields(at, raw, faults) {
3888
3890
  if (typeof raw[f] === "boolean") out[f] = raw[f];
3889
3891
  else faults.push(`${at}: "${f}" is not true or false.`);
3890
3892
  }
3893
+ if (raw["needs"] !== void 0) {
3894
+ if (isFields(raw["needs"]) && Object.values(raw["needs"]).every(isText)) out["needs"] = raw["needs"];
3895
+ else faults.push(`${at}: "needs" is not a record of texts.`);
3896
+ }
3891
3897
  if (raw["inlineOptions"] === true && raw["optionsKey"] !== void 0) faults.push(`${at}: "inlineOptions" and "optionsKey" give two places for the options.`);
3892
3898
  if (raw["default"] !== void 0) {
3893
3899
  if (isText(raw["default"]) || raw["inlineOptions"] === true && isMember(raw["default"])) out["default"] = raw["default"];
@@ -4071,8 +4077,9 @@ function readEntry(at, raw, faults) {
4071
4077
  };
4072
4078
  }
4073
4079
  /**
4074
- * This function gives the strategies that a chooser offers, by the `step`, `kinds` and `optIn` of an option. Thus no chooser keeps a copy of this rule.
4080
+ * This function gives the strategies that a chooser offers, by the `step`, `kinds`, `optIn` and `needs` of an option. Thus no chooser keeps a copy of this rule.
4075
4081
  * A baseline is not in the result. A list gives the strategies of its items. An option of each other type gives nothing.
4082
+ * A strategy that does not list a dimension of `needs` has no declared limit there, so the option offers it.
4076
4083
  * Without a declaration, the function gives each strategy that is not a baseline.
4077
4084
  */
4078
4085
  function catalogChoices(strategies, declaration) {
@@ -4080,7 +4087,8 @@ function catalogChoices(strategies, declaration) {
4080
4087
  if (declaration === void 0) return offered;
4081
4088
  const d = declaration.type === "list" ? declaration.of : declaration;
4082
4089
  if (d?.type !== "strategy") return [];
4083
- return offered.filter((e) => (d.step === void 0 || e.step === d.step) && (d.kinds === void 0 || d.kinds.includes(e.kind)) && (d.optIn === void 0 || d.optIn === e.optIn));
4090
+ const needs = Object.entries(d.needs ?? {});
4091
+ return offered.filter((e) => (d.step === void 0 || e.step === d.step) && (d.kinds === void 0 || d.kinds.includes(e.kind)) && (d.optIn === void 0 || d.optIn === e.optIn) && needs.every(([dimension, value]) => e.supports[dimension]?.includes(value) !== false));
4084
4092
  }
4085
4093
  /** This function adds one fault for each option of a member that its chosen strategy does not take. */
4086
4094
  function checkMember(at, member, chosen, faults) {
@@ -4332,18 +4340,54 @@ function checkChoices(entry, strategies, refuses, faults, notRun) {
4332
4340
  else if (refused) faults.push(`${name}: the option offers this strategy, and the engine refuses it.`);
4333
4341
  }
4334
4342
  }
4335
- /** This function examines each param of a space against the declaration of its option. */
4336
- function checkSpaceParams(space, entries, faults, notMatched) {
4343
+ /** This function examines each value of one param against the declaration of its option, through the route of the param. */
4344
+ function checkParamValues(entry, engine, place, option, values, route, check) {
4345
+ const declaration = entry.options[option];
4346
+ const toOption = route !== void 0 && "value" in route ? route.value : void 0;
4347
+ for (const value of values) {
4348
+ let mapped = value;
4349
+ try {
4350
+ if (toOption !== void 0) mapped = toOption(value);
4351
+ } catch (error) {
4352
+ check.faults.push(`${entry.key}: the route "${place}" fails on ${String(value)}: ${error instanceof Error ? error.message : String(error)}`);
4353
+ continue;
4354
+ }
4355
+ if (mapped === void 0) continue;
4356
+ const issue = optionIssue(option, mapped, declaration);
4357
+ if (issue !== void 0) check.faults.push(`${entry.key}: the space ${engine} is outside the declaration. ${issue.message}`);
4358
+ }
4359
+ }
4360
+ /** This function examines each param of a space against the declaration of its option, with the routes of the engine. */
4361
+ function checkSpaceParams(space, entries, check) {
4362
+ const { routes, used, faults, notMatched, spaceOnly } = check;
4363
+ const routeOf = (place) => {
4364
+ const route = routes[place];
4365
+ if (route !== void 0) used.add(place);
4366
+ return route;
4367
+ };
4337
4368
  for (const stage of space.stages) for (const option of stage.options) {
4338
- const entry = entries.get(`${stage.name}/${option.id}`) ?? entries.get(option.id);
4369
+ const name = `${stage.name}/${option.id}`;
4370
+ const entry = entries.get(name) ?? entries.get(option.id);
4339
4371
  if (entry === void 0) {
4340
- notMatched.push(`${stage.name}/${option.id}`);
4372
+ const reason = routes[name];
4373
+ if (reason !== void 0 && "spaceOnly" in reason) {
4374
+ used.add(name);
4375
+ spaceOnly.push(`${name}: ${reason.spaceOnly}`);
4376
+ } else notMatched.push(name);
4341
4377
  continue;
4342
4378
  }
4343
4379
  for (const param of option.params) {
4344
- const declaration = entry.options[param.name];
4345
- if (declaration === void 0) {
4346
- notMatched.push(`${stage.name}/${option.id}.${param.name}`);
4380
+ const place = `${name}.${param.name}`;
4381
+ const route = routeOf(place);
4382
+ if (route !== void 0 && "spaceOnly" in route) {
4383
+ if (entry.options[param.name] === void 0) spaceOnly.push(`${place}: ${route.spaceOnly}`);
4384
+ else faults.push(`${entry.key}: the route "${place}" says that the param is only in the space, and the strategy has this option.`);
4385
+ continue;
4386
+ }
4387
+ const target = route?.option ?? param.name;
4388
+ if (entry.options[target] === void 0) {
4389
+ if (route === void 0) notMatched.push(place);
4390
+ else faults.push(`${entry.key}: the route "${place}" names "${target}", and the strategy has no such option.`);
4347
4391
  continue;
4348
4392
  }
4349
4393
  const values = [
@@ -4352,13 +4396,17 @@ function checkSpaceParams(space, entries, faults, notMatched) {
4352
4396
  ...param.values ?? [],
4353
4397
  param.default
4354
4398
  ].filter((v) => v !== void 0);
4355
- for (const value of values) {
4356
- const issue = optionIssue(param.name, value, declaration);
4357
- if (issue !== void 0) faults.push(`${entry.key}: the space ${space.engine} is outside the declaration. ${issue.message}`);
4358
- }
4399
+ checkParamValues(entry, space.engine, place, target, values, route, check);
4359
4400
  }
4360
4401
  }
4361
4402
  }
4403
+ /** This function adds one fault for each route that matched nothing, and for each `spaceOnly` route with no reason. */
4404
+ function checkRoutes({ routes, used, faults }) {
4405
+ for (const [place, route] of Object.entries(routes)) {
4406
+ if (!used.has(place)) faults.push(`The route "${place}" matches nothing in the spaces.`);
4407
+ if ("spaceOnly" in route && !isText(route.spaceOnly)) faults.push(`The route "${place}" has no reason.`);
4408
+ }
4409
+ }
4362
4410
  /**
4363
4411
  * This function examines a catalog against its engine: the live defaults, the set of strategies and a round trip through JSON.
4364
4412
  * It also examines the claims of determinism, `supports`, `limits`, the choices of each strategy option and the spaces.
@@ -4368,6 +4416,7 @@ function checkCatalog(source, registry, options = {}) {
4368
4416
  const faults = [];
4369
4417
  const notRun = [];
4370
4418
  const notMatched = [];
4419
+ const spaceOnly = [];
4371
4420
  let text;
4372
4421
  try {
4373
4422
  text = writeStrategyCatalog(source, "0.0.0");
@@ -4390,11 +4439,20 @@ function checkCatalog(source, registry, options = {}) {
4390
4439
  checkProbes(entry, options.probes ?? [], faults, notRun);
4391
4440
  if (options.refusesChoice !== void 0) checkChoices(entry, source.strategies, options.refusesChoice, faults, notRun);
4392
4441
  }
4393
- for (const space of options.spaces ?? []) checkSpaceParams(space, entries, faults, notMatched);
4442
+ const spaceCheck = {
4443
+ routes: options.paramRoutes ?? {},
4444
+ used: /* @__PURE__ */ new Set(),
4445
+ faults,
4446
+ notMatched,
4447
+ spaceOnly
4448
+ };
4449
+ for (const space of options.spaces ?? []) checkSpaceParams(space, entries, spaceCheck);
4450
+ checkRoutes(spaceCheck);
4394
4451
  return {
4395
4452
  faults,
4396
4453
  notRun,
4397
- notMatched
4454
+ notMatched,
4455
+ spaceOnly
4398
4456
  };
4399
4457
  }
4400
4458
  // src/verdict.ts