@cello-protocol/gateway 0.0.2 → 0.0.3

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.
@@ -2,11 +2,11 @@ import type { ScreenContext, ScreenVerdict, SecurityGatewayClient } from "./type
2
2
  /**
3
3
  * The null-object gateway client: screens nothing, always allows.
4
4
  *
5
- * This is the daemon's default when no gateway is configured (backward compatibility for the
6
- * many daemon/SNM tests written before M9, and for a deployment that has not enabled the
7
- * security layer). It still RETURNS a verdict (`allow`) — so SI-001 ("never act on content
8
- * without a verdict") holds even on the default path; "no gateway configured" means
9
- * "always-allow verdict", not "no verdict".
5
+ * This is the daemon's default when no gateway is configured the case for a deployment that
6
+ * has not enabled the security layer, and for the daemon/SNM tests that construct no gateway.
7
+ * It still RETURNS a verdict (`allow`) — so SI-001 ("never act on content without a verdict")
8
+ * holds even on the default path; "no gateway configured" means "always-allow verdict", not
9
+ * "no verdict".
10
10
  *
11
11
  * It contains no detection logic. Real screening lives in the gateway PROGRAM (the server +
12
12
  * the local sidecar / remote client), never in the daemon.
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * The null-object gateway client: screens nothing, always allows.
3
3
  *
4
- * This is the daemon's default when no gateway is configured (backward compatibility for the
5
- * many daemon/SNM tests written before M9, and for a deployment that has not enabled the
6
- * security layer). It still RETURNS a verdict (`allow`) — so SI-001 ("never act on content
7
- * without a verdict") holds even on the default path; "no gateway configured" means
8
- * "always-allow verdict", not "no verdict".
4
+ * This is the daemon's default when no gateway is configured the case for a deployment that
5
+ * has not enabled the security layer, and for the daemon/SNM tests that construct no gateway.
6
+ * It still RETURNS a verdict (`allow`) — so SI-001 ("never act on content without a verdict")
7
+ * holds even on the default path; "no gateway configured" means "always-allow verdict", not
8
+ * "no verdict".
9
9
  *
10
10
  * It contains no detection logic. Real screening lives in the gateway PROGRAM (the server +
11
11
  * the local sidecar / remote client), never in the daemon.
package/dist/types.d.ts CHANGED
@@ -1,16 +1,15 @@
1
1
  /**
2
2
  * @cello-protocol/gateway — the security gateway contract.
3
3
  *
4
- * The gateway is a SEPARATE program from the daemon (M9-CORE-001 / V3 split-deployment).
5
- * The daemon holds ONLY this interface and its two call sites; all detection lives in the
6
- * gateway program. The same interface backs both the local sidecar (Phase 1) and the
7
- * remote mTLS gateway (Phase 2) — Phase 2 is a transport swap behind `SecurityGatewayClient`,
8
- * not a rewrite.
4
+ * The gateway is a SEPARATE program from the daemon. The daemon holds ONLY this interface and
5
+ * its two call sites; all detection lives in the gateway program. The same interface backs both
6
+ * the local sidecar and the remote mTLS gateway — the remote form is a transport swap behind
7
+ * `SecurityGatewayClient`, not a rewrite.
9
8
  *
10
- * M9-CORE-001 implements the seam with a pass-through: every message is screened (the call
11
- * happens at the two fixed points) but the verdict is always `allow`, except the fail-closed
12
- * `block` a configured-but-unreachable gateway returns. Detectors and the redact/warn
13
- * dispositions arrive in later stories (M9-IN-*, M9-OUT-*, M9-FEED-001).
9
+ * TODAY the seam is a pass-through: every message is screened (the call happens at the two fixed
10
+ * points) but the verdict is always `allow`, except the fail-closed `block` a
11
+ * configured-but-unreachable gateway returns. No detector is wired yet, and the redact/warn
12
+ * dispositions are declared but never produced.
14
13
  */
15
14
  /** Which direction the content is flowing relative to the daemon. */
16
15
  export type ScreenDirection = "outbound" | "inbound";
@@ -18,19 +17,19 @@ export type ScreenDirection = "outbound" | "inbound";
18
17
  * What the gateway decided to do with a message.
19
18
  *
20
19
  * - `allow` — deliver/send as-is (or as transformed via `content`).
21
- * - `block` — do not deliver/send. M9-CORE-001 uses this only for fail-closed
22
- * (`gateway_unavailable`); detectors add real blocks later.
23
- * - `redact` — deliver/send a transformed `content` (M9-OUT-* / M9-FEED-001).
24
- * - `warn` — held pending an explicit governance decision (M9-FEED-001).
20
+ * - `block` — do not deliver/send. Today this is only ever fail-closed (`gateway_unavailable`);
21
+ * detectors will produce real blocks.
22
+ * - `redact` — deliver/send a transformed `content`.
23
+ * - `warn` — held pending an explicit governance decision.
25
24
  *
26
- * M9-CORE-001 only ever returns `allow` or `block`; `redact`/`warn` are declared here so the
27
- * seam code that switches on the disposition is complete from the start.
25
+ * The shipping gateway only ever returns `allow` or `block`; `redact`/`warn` are declared here so
26
+ * the seam code that switches on the disposition is exhaustive.
28
27
  */
29
28
  export type ScreenDisposition = "allow" | "block" | "redact" | "warn";
30
29
  /** The per-stage governance disposition (the §6 model: advisory, mutating, needs-decision, blocking). */
31
30
  export type GovernanceDisposition = "observe" | "redact" | "block" | "warn";
32
31
  /**
33
- * A governance decision the agent attaches to a re-send to resolve a warned item (M9-FEED-001 §6):
32
+ * A governance decision the agent attaches to a re-send to resolve a warned item (governance §6):
34
33
  * - `redact` — send with a typed placeholder. Always available (the agent's autonomous lever).
35
34
  * - `allow_once` — send the value verbatim THIS once. Honored ONLY when `autonomous_override` is
36
35
  * ON; OFF (default) → rejected + re-warned (the operator must whitelist).
@@ -41,8 +40,8 @@ export type GovernanceDisposition = "observe" | "redact" | "block" | "warn";
41
40
  export type GovernanceDecision = "redact" | "allow_once" | "allow_always";
42
41
  /**
43
42
  * One governance finding published by a screen stage (§6). The verdict aggregates these; the daemon
44
- * renders them to the agent (M9-FEED-001) — as the transformations on a redact, the reasons on a
45
- * block, or the flagged items (with `flagId`) on a warn.
43
+ * renders them to the agent — as the transformations on a redact, the reasons on a block, or the
44
+ * flagged items (with `flagId`) on a warn.
46
45
  */
47
46
  export interface GovernanceEvent {
48
47
  stage: string;
@@ -60,7 +59,7 @@ export interface ScreenContext {
60
59
  /** The async-flow correlation id, threaded through every event in this send/receive (INV-7). */
61
60
  correlationId?: string;
62
61
  /**
63
- * The agent's per-item decisions on a governance RE-SEND (M9-FEED-001 §6), keyed by the `flagId`
62
+ * The agent's per-item decisions on a governance RE-SEND (governance §6), keyed by the `flagId`
64
63
  * the prior `warn` verdict returned. Stateless: the gateway re-scans the (full) content, re-derives
65
64
  * the same deterministic flagIds, and applies these decisions. A flagId that no longer matches
66
65
  * (content changed) is ignored and that item re-warns/redacts — a decision can never mis-apply to
@@ -81,7 +80,7 @@ export interface ScreenVerdict {
81
80
  content?: Uint8Array;
82
81
  reason?: string;
83
82
  guidance?: string;
84
- /** The governance findings behind this verdict (M9-FEED-001 renders them to the agent). */
83
+ /** The governance findings behind this verdict the daemon renders them to the agent. */
85
84
  events?: GovernanceEvent[];
86
85
  /**
87
86
  * Set on a `block` whose cause is the CONTENT itself — a detector rejected these exact bytes
@@ -110,7 +109,7 @@ export interface SecurityGatewayClient {
110
109
  /** The reason code a fail-closed verdict carries when the gateway cannot be reached. */
111
110
  export declare const GATEWAY_UNAVAILABLE = "gateway_unavailable";
112
111
  /** The reason a fail-closed verdict carries when the gateway is reachable but the screening
113
- * deadline was exceeded — a timeout is a verdict, not a hang (INV-6 / FEED-001 AC-005). */
112
+ * deadline was exceeded — a timeout is a verdict, not a hang (INV-6). */
114
113
  export declare const GOVERNANCE_TIMEOUT = "governance_timeout";
115
114
  /**
116
115
  * Build the fail-closed verdict (SI-001 / DB-001 / INV-6): never deliver/send ungated content, never
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,qEAAqE;AACrE,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEtE,yGAAyG;AACzG,MAAM,MAAM,qBAAqB,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,YAAY,GAAG,cAAc,CAAC;AAE1E;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,qBAAqB,CAAC;IACnC,QAAQ,EAAE,MAA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E,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAChF,aAAa,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CAChF;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,wBAAwB,CAAC;AACzD;0EAC0E;AAC1E,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,eAAe,EAAE,MAAM,GAAE,MAA4B,GAAG,aAAa,CAcjH"}
package/dist/types.js CHANGED
@@ -1,21 +1,20 @@
1
1
  /**
2
2
  * @cello-protocol/gateway — the security gateway contract.
3
3
  *
4
- * The gateway is a SEPARATE program from the daemon (M9-CORE-001 / V3 split-deployment).
5
- * The daemon holds ONLY this interface and its two call sites; all detection lives in the
6
- * gateway program. The same interface backs both the local sidecar (Phase 1) and the
7
- * remote mTLS gateway (Phase 2) — Phase 2 is a transport swap behind `SecurityGatewayClient`,
8
- * not a rewrite.
4
+ * The gateway is a SEPARATE program from the daemon. The daemon holds ONLY this interface and
5
+ * its two call sites; all detection lives in the gateway program. The same interface backs both
6
+ * the local sidecar and the remote mTLS gateway — the remote form is a transport swap behind
7
+ * `SecurityGatewayClient`, not a rewrite.
9
8
  *
10
- * M9-CORE-001 implements the seam with a pass-through: every message is screened (the call
11
- * happens at the two fixed points) but the verdict is always `allow`, except the fail-closed
12
- * `block` a configured-but-unreachable gateway returns. Detectors and the redact/warn
13
- * dispositions arrive in later stories (M9-IN-*, M9-OUT-*, M9-FEED-001).
9
+ * TODAY the seam is a pass-through: every message is screened (the call happens at the two fixed
10
+ * points) but the verdict is always `allow`, except the fail-closed `block` a
11
+ * configured-but-unreachable gateway returns. No detector is wired yet, and the redact/warn
12
+ * dispositions are declared but never produced.
14
13
  */
15
14
  /** The reason code a fail-closed verdict carries when the gateway cannot be reached. */
16
15
  export const GATEWAY_UNAVAILABLE = "gateway_unavailable";
17
16
  /** The reason a fail-closed verdict carries when the gateway is reachable but the screening
18
- * deadline was exceeded — a timeout is a verdict, not a hang (INV-6 / FEED-001 AC-005). */
17
+ * deadline was exceeded — a timeout is a verdict, not a hang (INV-6). */
19
18
  export const GOVERNANCE_TIMEOUT = "governance_timeout";
20
19
  /**
21
20
  * Build the fail-closed verdict (SI-001 / DB-001 / INV-6): never deliver/send ungated content, never
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAyGH,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD;4FAC4F;AAC5F,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAA0B,EAAE,SAAiB,mBAAmB;IAChG,MAAM,KAAK,GAAG,MAAM,KAAK,kBAAkB;QACzC,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC,2CAA2C,CAAC;IAChD,OAAO;QACL,WAAW,EAAE,OAAO;QACpB,MAAM;QACN,QAAQ,EACN,SAAS,KAAK,UAAU;YACtB,CAAC,CAAC,gBAAgB,KAAK,4DAA4D;gBACjF,wDAAwD;YAC1D,CAAC,CAAC,gBAAgB,KAAK,mEAAmE;gBACxF,sGAAsG;KAC7G,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAyGH,wFAAwF;AACxF,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD;0EAC0E;AAC1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAA0B,EAAE,SAAiB,mBAAmB;IAChG,MAAM,KAAK,GAAG,MAAM,KAAK,kBAAkB;QACzC,CAAC,CAAC,6EAA6E;QAC/E,CAAC,CAAC,2CAA2C,CAAC;IAChD,OAAO;QACL,WAAW,EAAE,OAAO;QACpB,MAAM;QACN,QAAQ,EACN,SAAS,KAAK,UAAU;YACtB,CAAC,CAAC,gBAAgB,KAAK,4DAA4D;gBACjF,wDAAwD;YAC1D,CAAC,CAAC,gBAAgB,KAAK,mEAAmE;gBACxF,sGAAsG;KAC7G,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cello-protocol/gateway",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {