@octaviaflow/flow-rules 0.8.0 → 0.9.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.cjs CHANGED
@@ -72,6 +72,7 @@ __export(exports_src, {
72
72
  collectArrayPaths: () => collectArrayPaths,
73
73
  collectArrayPathsFromSample: () => collectArrayPathsFromSample,
74
74
  configErrors: () => configErrors,
75
+ contractDerivedKeys: () => contractDerivedKeys,
75
76
  contractDrift: () => contractDrift,
76
77
  contractFieldsFor: () => contractFieldsFor,
77
78
  contractFor: () => contractFor,
@@ -4931,6 +4932,10 @@ function contractVocabularyDrift(actionId) {
4931
4932
  const known = new Set([...Object.keys(CONTRACT_TYPE_TO_FIELD_TYPE), "none"]);
4932
4933
  return Object.entries(c.schema).filter(([, f]) => !known.has(f.type)).map(([k, f]) => `${k}:${f.type}`);
4933
4934
  }
4935
+ function contractDerivedKeys(definition) {
4936
+ const own = new Set((definition.inputSchema?.fields ?? []).map((f) => f.key));
4937
+ return new Set(contractFieldsFor(definition).map((f) => f.key).filter((k) => !own.has(k)));
4938
+ }
4934
4939
 
4935
4940
  // src/rules/configSafety.ts
4936
4941
  var MAX_STEP_CONFIG_BYTES = 256 * 1024;
package/dist/index.d.ts CHANGED
@@ -45,4 +45,4 @@ export { type FlowConnection, type FlowData, type FlowStep, generateConnectionsF
45
45
  export { flattenNestedWorkflow } from "./rules/flattenNestedWorkflow";
46
46
  export { configErrors, MAX_STEP_CONFIG_BYTES, validateStepConfig, validateStepConfigs, type ConfigIssue, type ConfigIssueCode, } from "./rules/configSafety";
47
47
  export { isMappingFunction, MAPPING_FUNCTION_SPECS, MAPPING_FUNCTIONS, mappingTransformFunctionName, USER_FUNCTION_PREFIX, type MappingFunction, type MappingFunctionSpec, } from "./rules/mappingFunctions";
48
- export { CONFIG_CONTRACTS, contractDrift, contractFieldsFor, contractVocabularyDrift, contractFor, declaredKeys, isEditorPrivateKey, type ConfigContract, type ContractField, type ContractFieldType, } from "./rules/configContracts";
48
+ export { CONFIG_CONTRACTS, contractDerivedKeys, contractDrift, contractFieldsFor, contractVocabularyDrift, contractFor, declaredKeys, isEditorPrivateKey, type ConfigContract, type ContractField, type ContractFieldType, } from "./rules/configContracts";
package/dist/index.js CHANGED
@@ -4818,6 +4818,10 @@ function contractVocabularyDrift(actionId) {
4818
4818
  const known = new Set([...Object.keys(CONTRACT_TYPE_TO_FIELD_TYPE), "none"]);
4819
4819
  return Object.entries(c.schema).filter(([, f]) => !known.has(f.type)).map(([k, f]) => `${k}:${f.type}`);
4820
4820
  }
4821
+ function contractDerivedKeys(definition) {
4822
+ const own = new Set((definition.inputSchema?.fields ?? []).map((f) => f.key));
4823
+ return new Set(contractFieldsFor(definition).map((f) => f.key).filter((k) => !own.has(k)));
4824
+ }
4821
4825
 
4822
4826
  // src/rules/configSafety.ts
4823
4827
  var MAX_STEP_CONFIG_BYTES = 256 * 1024;
@@ -5090,6 +5094,7 @@ export {
5090
5094
  collectArrayPaths,
5091
5095
  collectArrayPathsFromSample,
5092
5096
  configErrors,
5097
+ contractDerivedKeys,
5093
5098
  contractDrift,
5094
5099
  contractFieldsFor,
5095
5100
  contractFor,
@@ -90,3 +90,16 @@ export declare function contractFieldsFor(definition: ActionDefinition): FieldCo
90
90
  export declare function contractDrift(definition: ActionDefinition): string[];
91
91
  /** Contract fields whose `type` is not in the vocabulary — a typo, not a new kind. */
92
92
  export declare function contractVocabularyDrift(actionId: string): string[];
93
+ /**
94
+ * Keys `contractFieldsFor` ADDED — declared by config.ts but not by inputSchema.
95
+ *
96
+ * In 0.8.1 the fence treated a type mismatch on one of these as a WARNING,
97
+ * pending a measurement: the moment http_request's contract declared
98
+ * `queryParams: array`, a fixture storing it as an object stopped saving, and
99
+ * with 71 of 131 real keys previously undeclared any might have been stored in
100
+ * an unexpected shape. Measured 2026-09-26 against every flow on beta — 79
101
+ * flows, 302 steps — zero mismatches. 0.9.0 promotes them to errors, the same
102
+ * as any other declared key. This helper remains for tooling that wants to
103
+ * know which keys the contract added.
104
+ */
105
+ export declare function contractDerivedKeys(definition: ActionDefinition): Set<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octaviaflow/flow-rules",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "The flow action catalog and the rules engine behind Flow Doctor \u2014 one definition of what a step accepts and what makes a flow valid, shared by the editor and the server",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",