@crewhaus/ir-passes 0.3.2 → 0.4.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.d.ts CHANGED
@@ -35,6 +35,15 @@
35
35
  * deadToolElimination → redundantMcpServerCollapse →
36
36
  * permissionRuleCanonicalize → transactionPolicyEnforcement →
37
37
  * wellFormednessCheck → memoryIntegrityPass → promptCachePrefixSort
38
+ *
39
+ * G45 (loop contract 0.4) — the passes split into two families:
40
+ * - VALIDATING (transactionPolicyEnforcement, wellFormednessCheck,
41
+ * memoryIntegrityPass): pure pass-throughs that throw `IrPassError` on
42
+ * a violation. Exported as `VALIDATING_PASSES`; the compiler runs them
43
+ * UNCONDITIONALLY inside `compile()` (they cannot drift bundle bytes).
44
+ * - REWRITING (deadToolElimination, redundantMcpServerCollapse,
45
+ * permissionRuleCanonicalize, promptCachePrefixSort): structural
46
+ * optimizations that stay behind `compile({ applyIrPasses: true })`.
38
47
  */
39
48
  import { CrewhausError } from "@crewhaus/errors";
40
49
  import type { IrNode } from "@crewhaus/ir";
@@ -103,4 +112,14 @@ export declare function transactionPolicyEnforcement(ir: IrNode): IrNode;
103
112
  */
104
113
  export declare function wellFormednessCheck(ir: IrNode): IrNode;
105
114
  export declare function memoryIntegrityPass(ir: IrNode): IrNode;
115
+ /**
116
+ * G45 (loop contract 0.4) — the VALIDATING passes: pure pass-throughs that
117
+ * throw `IrPassError` on a violation and never rewrite the IR. The compiler
118
+ * runs these UNCONDITIONALLY inside `compile()` (between `lower()` and the
119
+ * opt-in rewriting pipeline); they are also part of `DEFAULT_PIPELINE`, in
120
+ * the same relative order, so `applyPasses(ir)` stays a complete standalone
121
+ * audit. Order matters: chain referential integrity → graph/crew
122
+ * well-formedness → memory/continuity integrity.
123
+ */
124
+ export declare const VALIDATING_PASSES: ReadonlyArray<IrPass>;
106
125
  export declare const DEFAULT_PIPELINE: ReadonlyArray<IrPass>;
package/dist/index.js CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crewhaus/ir-passes",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Idempotent IR optimization passes (dead-tool-elimination, prompt-cache-prefix-sort, redundant-mcp-server-collapse, permission-rule-canonicalize)",
6
6
  "main": "dist/index.js",
@@ -15,8 +15,8 @@
15
15
  "test": "bun test src"
16
16
  },
17
17
  "dependencies": {
18
- "@crewhaus/errors": "0.3.2",
19
- "@crewhaus/ir": "0.3.2"
18
+ "@crewhaus/errors": "0.4.0",
19
+ "@crewhaus/ir": "0.4.0"
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "author": {