@crewhaus/ir-passes 0.2.3 → 0.3.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 +11 -4
- package/dist/index.js +0 -0
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
* - `wellFormednessCheck` — Track F validating pass: checks typed
|
|
24
24
|
* multi-agent graphs/crews (edges connect declared nodes, reachability
|
|
25
25
|
* from entry, schema/role references resolve) and throws on a violation.
|
|
26
|
+
* - `memoryIntegrityPass` — v0.3.0 validating pass: memory/continuity
|
|
27
|
+
* block integrity (wiki.recallK bounds, ttl floor, session-scope only
|
|
28
|
+
* on session-routed shapes, fragment JSON-serializability).
|
|
26
29
|
* - `promptCachePrefixSort` — TODO: re-orders system-block segments so
|
|
27
30
|
* the cache prefix is maximised. v0 stub returns IR unchanged so the
|
|
28
31
|
* pipeline contract holds; v1 follow-up wires this once we land
|
|
@@ -31,7 +34,7 @@
|
|
|
31
34
|
* Pipeline order in `applyPasses` (the safe default):
|
|
32
35
|
* deadToolElimination → redundantMcpServerCollapse →
|
|
33
36
|
* permissionRuleCanonicalize → transactionPolicyEnforcement →
|
|
34
|
-
* wellFormednessCheck → promptCachePrefixSort
|
|
37
|
+
* wellFormednessCheck → memoryIntegrityPass → promptCachePrefixSort
|
|
35
38
|
*/
|
|
36
39
|
import { CrewhausError } from "@crewhaus/errors";
|
|
37
40
|
import type { IrNode } from "@crewhaus/ir";
|
|
@@ -57,9 +60,12 @@ export declare function applyPasses(ir: IrNode, opts?: ApplyPassesOptions): IrNo
|
|
|
57
60
|
export declare function deadToolElimination(ir: IrNode): IrNode;
|
|
58
61
|
/**
|
|
59
62
|
* Pass 2 — collapse `mcp_servers` entries that share `(transport, command,
|
|
60
|
-
* args)` (stdio) or `(transport, url)` (sse). The first key
|
|
61
|
-
* collision; later duplicates are dropped. Order is preserved for
|
|
62
|
-
* that survive.
|
|
63
|
+
* args, env)` (stdio) or `(transport, url, headers)` (sse). The first key
|
|
64
|
+
* wins on collision; later duplicates are dropped. Order is preserved for
|
|
65
|
+
* entries that survive. env/header values are `IrSecretRef` objects
|
|
66
|
+
* (0.3.0), compared structurally under sorted keys — two servers that
|
|
67
|
+
* reference the same `$VAR` still dedupe, while servers that differ only
|
|
68
|
+
* in credentials are (correctly) kept apart.
|
|
63
69
|
*/
|
|
64
70
|
export declare function redundantMcpServerCollapse(ir: IrNode): IrNode;
|
|
65
71
|
/**
|
|
@@ -96,4 +102,5 @@ export declare function transactionPolicyEnforcement(ir: IrNode): IrNode;
|
|
|
96
102
|
* only. Cited paper: AgentFlow (arxiv 2604.20801).
|
|
97
103
|
*/
|
|
98
104
|
export declare function wellFormednessCheck(ir: IrNode): IrNode;
|
|
105
|
+
export declare function memoryIntegrityPass(ir: IrNode): IrNode;
|
|
99
106
|
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
|
+
"version": "0.3.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.
|
|
19
|
-
"@crewhaus/ir": "0.
|
|
18
|
+
"@crewhaus/errors": "0.3.0",
|
|
19
|
+
"@crewhaus/ir": "0.3.0"
|
|
20
20
|
},
|
|
21
21
|
"license": "Apache-2.0",
|
|
22
22
|
"author": {
|