@coderifts/sdk 3.6.0 → 3.7.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/README.md CHANGED
@@ -8,7 +8,7 @@ Agent Governance SDK for the [CodeRifts](https://coderifts.com) API. Validate AP
8
8
  npm install @coderifts/sdk
9
9
  ```
10
10
 
11
- Current package: **3.2.0**.
11
+ Current package: **3.7.0**.
12
12
 
13
13
  ## Quick Start
14
14
 
@@ -253,6 +253,34 @@ if (executionAction === 'STOP' || executionAction === 'REQUEST_APPROVAL') {
253
253
  }
254
254
  ```
255
255
 
256
+ ## Policy delivery
257
+
258
+ File-based hosts (Claude / Cursor / Copilot / Gemini) load the CodeRifts
259
+ rule file automatically. A host that **builds its own system prompt** does
260
+ not — unless it interpolates the constant:
261
+
262
+ ```typescript
263
+ import { CODERIFTS_POLICY, withPolicy, detectPolicyPresence } from '@coderifts/sdk';
264
+
265
+ const yourPrompt = 'You are a coding agent.';
266
+ const content = `${yourPrompt}\n\n${CODERIFTS_POLICY}`;
267
+
268
+ // or one line, idempotent, no in-place mutation:
269
+ const messages = withPolicy([{ role: 'system', content: yourPrompt }, { role: 'user', content: '…' }]);
270
+
271
+ const presence = detectPolicyPresence(content); // 'detected' | 'absent' | 'unknown'
272
+ ```
273
+
274
+ Three layers (the guard ships the same constant and a `systemPrompt`
275
+ observation on the outcome):
276
+
277
+ 1. **`withPolicy`** — append if the marker is not already present.
278
+ 2. **`CODERIFTS_POLICY`** — one import, one interpolation.
279
+ 3. **`detectPolicyPresence`** — last net. Nothing supplied → `unknown`, no
280
+ warn. Marker absent → once-per-process warn. Marker found → silent.
281
+
282
+ This proves the **text is present**, not that the model read or obeyed it.
283
+
256
284
  ## Error Handling
257
285
 
258
286
  All methods throw a typed `CodeRiftsError` on non-2xx responses:
@@ -13,6 +13,8 @@
13
13
  * ```
14
14
  */
15
15
  export { CodeRifts } from './client.js';
16
+ export { CODERIFTS_POLICY, POLICY_MARKER, POLICY_ABSENT_WARN, withPolicy, policyPresenceOf, detectPolicyPresence, observePolicyPresence, warnPolicyAbsentOnce, resetPolicyWarnForTests, } from './policy.js';
17
+ export type { PolicyPresence, PolicyMessage, WithPolicyOptions, } from './policy.js';
16
18
  export { CodeRiftsError, ApiError, TimeoutError, RateLimitError, AuthError } from './errors.js';
17
19
  export { readDecision } from './decision.js';
18
20
  export type { ReadDecisionResult } from './decision.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACR,sBAAsB,EACtB,0BAA0B,EAC1B,WAAW,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,4BAA4B,EAC5B,gCAAgC,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACR,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACR,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,aAAa,CAAC;AACrB,YAAY,EACR,cAAc,EACd,aAAa,EACb,iBAAiB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAA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AAsB,EACtB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,YAAY,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -14,9 +14,19 @@
14
14
  * ```
15
15
  */
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.MONITOR_ATTEST_ENVELOPE_TAG = exports.MONITOR_ATTEST_SIGNING_PREFIX = exports.MONITOR_ATTEST_VERSION = exports.monitorAttestSigningInput = exports.verifyMonitoringAttestation = exports.ATTEST_ENVELOPE_TAG = exports.ATTEST_SIGNING_PREFIX = exports.ATTEST_VERSION = exports.attestSigningInput = exports.verifyExecutionAttestation = exports.GRANT_SIGNING_PREFIX = exports.GRANT_VERSION = exports.receiptDigest = exports.afterPayloadCanonical = exports.computeScopeHash = exports.verifyExecutionGrant = exports.isIssuedInFuture = exports.isReceiptExpired = exports.declaresDestructiveProduction = exports.expiryLeewayMs = exports.CLOCK_SKEW_LEEWAY_MS = exports.readDecision = exports.AuthError = exports.RateLimitError = exports.TimeoutError = exports.ApiError = exports.CodeRiftsError = exports.CodeRifts = void 0;
17
+ exports.MONITOR_ATTEST_ENVELOPE_TAG = exports.MONITOR_ATTEST_SIGNING_PREFIX = exports.MONITOR_ATTEST_VERSION = exports.monitorAttestSigningInput = exports.verifyMonitoringAttestation = exports.ATTEST_ENVELOPE_TAG = exports.ATTEST_SIGNING_PREFIX = exports.ATTEST_VERSION = exports.attestSigningInput = exports.verifyExecutionAttestation = exports.GRANT_SIGNING_PREFIX = exports.GRANT_VERSION = exports.receiptDigest = exports.afterPayloadCanonical = exports.computeScopeHash = exports.verifyExecutionGrant = exports.isIssuedInFuture = exports.isReceiptExpired = exports.declaresDestructiveProduction = exports.expiryLeewayMs = exports.CLOCK_SKEW_LEEWAY_MS = exports.readDecision = exports.AuthError = exports.RateLimitError = exports.TimeoutError = exports.ApiError = exports.CodeRiftsError = exports.resetPolicyWarnForTests = exports.warnPolicyAbsentOnce = exports.observePolicyPresence = exports.detectPolicyPresence = exports.policyPresenceOf = exports.withPolicy = exports.POLICY_ABSENT_WARN = exports.POLICY_MARKER = exports.CODERIFTS_POLICY = exports.CodeRifts = void 0;
18
18
  var client_js_1 = require("./client.js");
19
19
  Object.defineProperty(exports, "CodeRifts", { enumerable: true, get: function () { return client_js_1.CodeRifts; } });
20
+ var policy_js_1 = require("./policy.js");
21
+ Object.defineProperty(exports, "CODERIFTS_POLICY", { enumerable: true, get: function () { return policy_js_1.CODERIFTS_POLICY; } });
22
+ Object.defineProperty(exports, "POLICY_MARKER", { enumerable: true, get: function () { return policy_js_1.POLICY_MARKER; } });
23
+ Object.defineProperty(exports, "POLICY_ABSENT_WARN", { enumerable: true, get: function () { return policy_js_1.POLICY_ABSENT_WARN; } });
24
+ Object.defineProperty(exports, "withPolicy", { enumerable: true, get: function () { return policy_js_1.withPolicy; } });
25
+ Object.defineProperty(exports, "policyPresenceOf", { enumerable: true, get: function () { return policy_js_1.policyPresenceOf; } });
26
+ Object.defineProperty(exports, "detectPolicyPresence", { enumerable: true, get: function () { return policy_js_1.detectPolicyPresence; } });
27
+ Object.defineProperty(exports, "observePolicyPresence", { enumerable: true, get: function () { return policy_js_1.observePolicyPresence; } });
28
+ Object.defineProperty(exports, "warnPolicyAbsentOnce", { enumerable: true, get: function () { return policy_js_1.warnPolicyAbsentOnce; } });
29
+ Object.defineProperty(exports, "resetPolicyWarnForTests", { enumerable: true, get: function () { return policy_js_1.resetPolicyWarnForTests; } });
20
30
  var errors_js_1 = require("./errors.js");
21
31
  Object.defineProperty(exports, "CodeRiftsError", { enumerable: true, get: function () { return errors_js_1.CodeRiftsError; } });
22
32
  Object.defineProperty(exports, "ApiError", { enumerable: true, get: function () { return errors_js_1.ApiError; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,yCAAgG;AAAvF,2GAAA,cAAc,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,sGAAA,SAAS,OAAA;AAC1E,6CAA6C;AAApC,2GAAA,YAAY,OAAA;AAErB,yCAMqB;AALjB,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,0HAAA,6BAA6B,OAAA;AAC7B,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAGpB,2DAO8B;AAN1B,0HAAA,oBAAoB,OAAA;AACpB,sHAAA,gBAAgB,OAAA;AAChB,2HAAA,qBAAqB,OAAA;AACrB,mHAAA,aAAa,OAAA;AACb,mHAAA,aAAa,OAAA;AACb,0HAAA,oBAAoB,OAAA;AAOxB,uEAMoC;AALhC,sIAAA,0BAA0B,OAAA;AAC1B,8HAAA,kBAAkB,OAAA;AAClB,0HAAA,cAAc,OAAA;AACd,iIAAA,qBAAqB,OAAA;AACrB,+HAAA,mBAAmB,OAAA;AASvB,yEAMqC;AALjC,wIAAA,2BAA2B,OAAA;AAC3B,sIAAA,yBAAyB,OAAA;AACzB,mIAAA,sBAAsB,OAAA;AACtB,0IAAA,6BAA6B,OAAA;AAC7B,wIAAA,2BAA2B,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,yCAAwC;AAA/B,sGAAA,SAAS,OAAA;AAClB,yCAUqB;AATjB,6GAAA,gBAAgB,OAAA;AAChB,0GAAA,aAAa,OAAA;AACb,+GAAA,kBAAkB,OAAA;AAClB,uGAAA,UAAU,OAAA;AACV,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AACpB,kHAAA,qBAAqB,OAAA;AACrB,iHAAA,oBAAoB,OAAA;AACpB,oHAAA,uBAAuB,OAAA;AAO3B,yCAAgG;AAAvF,2GAAA,cAAc,OAAA;AAAE,qGAAA,QAAQ,OAAA;AAAE,yGAAA,YAAY,OAAA;AAAE,2GAAA,cAAc,OAAA;AAAE,sGAAA,SAAS,OAAA;AAC1E,6CAA6C;AAApC,2GAAA,YAAY,OAAA;AAErB,yCAMqB;AALjB,iHAAA,oBAAoB,OAAA;AACpB,2GAAA,cAAc,OAAA;AACd,0HAAA,6BAA6B,OAAA;AAC7B,6GAAA,gBAAgB,OAAA;AAChB,6GAAA,gBAAgB,OAAA;AAGpB,2DAO8B;AAN1B,0HAAA,oBAAoB,OAAA;AACpB,sHAAA,gBAAgB,OAAA;AAChB,2HAAA,qBAAqB,OAAA;AACrB,mHAAA,aAAa,OAAA;AACb,mHAAA,aAAa,OAAA;AACb,0HAAA,oBAAoB,OAAA;AAOxB,uEAMoC;AALhC,sIAAA,0BAA0B,OAAA;AAC1B,8HAAA,kBAAkB,OAAA;AAClB,0HAAA,cAAc,OAAA;AACd,iIAAA,qBAAqB,OAAA;AACrB,+HAAA,mBAAmB,OAAA;AASvB,yEAMqC;AALjC,wIAAA,2BAA2B,OAAA;AAC3B,sIAAA,yBAAyB,OAAA;AACzB,mIAAA,sBAAsB,OAAA;AACtB,0IAAA,6BAA6B,OAAA;AAC7B,wIAAA,2BAA2B,OAAA"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * CodeRifts agent-host policy text.
3
+ *
4
+ * Vendored from coderifts-app `src/agent-host-rule.js` `getCanonicalRuleText()`.
5
+ * Drift-gated by `test/policy-vendored-sync.test.js` (byte-equal to the app
6
+ * canonical text; missing app checkout fails loud — never skip).
7
+ *
8
+ * This proves the TEXT is present when injected/detected, not that the model
9
+ * read or obeyed it.
10
+ */
11
+ /** Phrase present in ALL six generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions). */
12
+ export declare const POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy.";
13
+ /** Canonical policy body (paragraphs joined by blank lines). */
14
+ export declare const CODERIFTS_POLICY: string;
15
+ /** Once-per-process warning when the host supplied a prompt that lacks the marker. */
16
+ export declare const POLICY_ABSENT_WARN = "CodeRifts policy text not detected in the system prompt. The agent will still see the tools, but measured evidence shows operation-scope misuse is markedly more likely without it. See https://github.com/coderifts/agent-guard#policy-delivery.";
17
+ export type PolicyPresence = 'detected' | 'absent' | 'unknown';
18
+ export type WithPolicyOptions = {
19
+ /**
20
+ * Default true. `false` returns a non-mutated copy and does not append.
21
+ * Opt-out for hosts that call `withPolicy` from a shared wrapper.
22
+ */
23
+ injectPolicy?: boolean;
24
+ };
25
+ /** Minimal chat message shape (OpenAI/Anthropic-compatible). Extra fields are preserved. */
26
+ export type PolicyMessage = {
27
+ role: string;
28
+ content?: unknown;
29
+ [key: string]: unknown;
30
+ };
31
+ /**
32
+ * Observation-only classification of host-supplied instruction text.
33
+ * `null`/`undefined` -> `unknown` (host did not tell us). Anything else is
34
+ * `detected` or `absent` based on POLICY_MARKER.
35
+ */
36
+ export declare function policyPresenceOf(text: string | null | undefined): PolicyPresence;
37
+ /** Alias used by hosts that call the check at startup without the guard. */
38
+ export declare function detectPolicyPresence(text: string | null | undefined): PolicyPresence;
39
+ /**
40
+ * Append the canonical policy text if the marker is not already present.
41
+ * Never mutates the caller's string/array/objects — always returns a new value
42
+ * for arrays; strings are new only when appending.
43
+ */
44
+ export declare function withPolicy(input: string, opts?: WithPolicyOptions): string;
45
+ export declare function withPolicy<T extends PolicyMessage>(input: readonly T[], opts?: WithPolicyOptions): T[];
46
+ /** Once-per-process warn. Subsequent absent detections stay silent. */
47
+ export declare function warnPolicyAbsentOnce(): void;
48
+ /**
49
+ * Classify + maybe warn. `unknown` never warns. `detected` is silent.
50
+ * `absent` warns once per process.
51
+ */
52
+ export declare function observePolicyPresence(text: string | null | undefined): PolicyPresence;
53
+ /** Test-only: allow the once-warn to fire again. */
54
+ export declare function resetPolicyWarnForTests(): void;
55
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gKAAgK;AAChK,eAAO,MAAM,aAAa,qFAC0D,CAAC;AAErF,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,EAAE,MAA89H,CAAC;AAE9/H,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,sPACsN,CAAC;AAEtP,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAiBF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAGhF;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAEpF;AAQD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC5E,wBAAgB,UAAU,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,CAAC,EAAE,CAAC;AAgCxG,uEAAuE;AACvE,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAIrF;AAED,oDAAoD;AACpD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
@@ -0,0 +1,113 @@
1
+ "use strict";
2
+ /**
3
+ * CodeRifts agent-host policy text.
4
+ *
5
+ * Vendored from coderifts-app `src/agent-host-rule.js` `getCanonicalRuleText()`.
6
+ * Drift-gated by `test/policy-vendored-sync.test.js` (byte-equal to the app
7
+ * canonical text; missing app checkout fails loud — never skip).
8
+ *
9
+ * This proves the TEXT is present when injected/detected, not that the model
10
+ * read or obeyed it.
11
+ */
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.POLICY_ABSENT_WARN = exports.CODERIFTS_POLICY = exports.POLICY_MARKER = void 0;
14
+ exports.policyPresenceOf = policyPresenceOf;
15
+ exports.detectPolicyPresence = detectPolicyPresence;
16
+ exports.withPolicy = withPolicy;
17
+ exports.warnPolicyAbsentOnce = warnPolicyAbsentOnce;
18
+ exports.observePolicyPresence = observePolicyPresence;
19
+ exports.resetPolicyWarnForTests = resetPolicyWarnForTests;
20
+ /** Phrase present in ALL six generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions). */
21
+ exports.POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy.";
22
+ /** Canonical policy body (paragraphs joined by blank lines). */
23
+ exports.CODERIFTS_POLICY = "Call `preflight_change_set` before merge, deploy, publish, or tool registration when a contract artifact changed (OpenAPI/Swagger, GraphQL, gRPC/protobuf, AsyncAPI, MCP manifest, or agent tool schemas).\n\nSend the complete base-to-head change set: every changed contract artifact with full before and after content. Do not send a single-file subset when other contract files also change.\n\nBranch on `execution_action` only. Do not branch on `decision` and do not branch on `safe_for_agent` (not_for_control_flow_use_execution_action). Canonical `execution_action` values: CONTINUE, CONTINUE_WITH_MONITORING, REQUEST_APPROVAL, STOP.\n\nAn unrecognised `execution_action` is not permission: fail closed (halt or re-preflight). Well-known code: `not_permission_fail_closed`.\n\n`CONTINUE_WITH_MONITORING` requires a wired monitoring sink (`monitoringSinkWired`). It is not \"proceed with caution\" without monitoring.\n\nDo not call CodeRifts tools for a documentation-only change (README, guides, comments) with no contract artifact content change.\n\nIf you already hold a chain receipt and only need authenticity/lifecycle: `verify_receipt`. If you need a past decision by id: `get_decision_details`. Neither replaces preflight for a new change set.\n\nA receipt authorizes ONE operation: a merge receipt does not authorize a deploy. Before a different operation (deploy, publish), call `preflight_change_set` with `context.operation` set to that operation \u2014 reusing a differently-scoped receipt is not permitted and will fail at the gate.\n\nA stale or superseded receipt on a changed head requires a NEW preflight \u2014 `verify_receipt` cannot re-diff.\n\nFor mutating tools, put only the guarded version in the agent's tool table; keep the raw handler host-only and unreachable from that table. How you name tools is yours \u2014 this is a reachability property, not a product rename of host tools. CodeRifts cannot see or stop a raw call the host makes outside the table it returns; adopt this as a host convention, not as a guarantee from the package.\n\nCodeRifts reports a governance decision and `execution_action`; it does not by itself block merges. Blocking requires separate repository configuration (required status checks, enforcement) that this rule file does not set.\n\nTo act (mutate a contract, merge, deploy, or publish): call `preflight_change_set` with `preflight_mode` authorize. Analyze is informational (`may_execute` is always false) and is not permission. Read `execution_action` on the `decision_result` envelope.\n\nBefore acting under a held receipt: call `verify_receipt` with the intended `context` (operation, environment, repository, branch, pull_request) for THIS attempt. Do not act on a receipt whose scope does not match.\n\nAct only when `currently_authorized` is true (`control_envelope.receipt_view.currently_authorized`). A valid-looking token is not permission if `currently_authorized` is false or omitted.\n\nCommit / CAS evidence is a separate measurement (`commit_observation` on GuardOutcome). It is not a substitute for authorize + `currently_authorized`. Production hosts that want the fail-closed conjunction lock it with `profile: ENFORCING_STRICT` on withCodeRifts.\n\nIf the host requests an execution grant (opt-in `include_execution_grant`), the grant is bound to operation + target + after-payload (`scope_hash`) and is short-lived \u2014 never reuse it after the after-payload changes.\n\nAn ATOMIC-profile grant carries `state_nonce` and is single-use at the executor \u2014 if the executor has consumed the nonce, re-preflight; do not retry the same grant.\n\nWith a proven tenant\u2194repo binding you may request `derivation:\"server\"` instead of assembling `artifacts[]` yourself (`context.repository` + `context.base` + `context.head` required; caller-supplied artifacts are rejected on that path).\n\nA commit is only proven when an executor attestation verifies (customer-held executor key, `cas_evidence: executor_attested`); otherwise say \"authorized, commit not proven\".";
24
+ /** Once-per-process warning when the host supplied a prompt that lacks the marker. */
25
+ exports.POLICY_ABSENT_WARN = "CodeRifts policy text not detected in the system prompt. The agent will still see the tools, but measured evidence shows operation-scope misuse is markedly more likely without it. See https://github.com/coderifts/agent-guard#policy-delivery.";
26
+ function textHasMarker(text) {
27
+ return text.includes(exports.POLICY_MARKER);
28
+ }
29
+ function contentHasMarker(content) {
30
+ if (typeof content === 'string')
31
+ return textHasMarker(content);
32
+ if (Array.isArray(content))
33
+ return content.some(contentHasMarker);
34
+ if (content && typeof content === 'object') {
35
+ const o = content;
36
+ if (typeof o.text === 'string' && textHasMarker(o.text))
37
+ return true;
38
+ if (typeof o.content === 'string' && textHasMarker(o.content))
39
+ return true;
40
+ }
41
+ return false;
42
+ }
43
+ /**
44
+ * Observation-only classification of host-supplied instruction text.
45
+ * `null`/`undefined` -> `unknown` (host did not tell us). Anything else is
46
+ * `detected` or `absent` based on POLICY_MARKER.
47
+ */
48
+ function policyPresenceOf(text) {
49
+ if (text == null)
50
+ return 'unknown';
51
+ return textHasMarker(String(text)) ? 'detected' : 'absent';
52
+ }
53
+ /** Alias used by hosts that call the check at startup without the guard. */
54
+ function detectPolicyPresence(text) {
55
+ return policyPresenceOf(text);
56
+ }
57
+ function appendPolicyToString(existing) {
58
+ if (textHasMarker(existing))
59
+ return existing;
60
+ if (existing.trim() === '')
61
+ return exports.CODERIFTS_POLICY;
62
+ return existing + '\n\n' + exports.CODERIFTS_POLICY;
63
+ }
64
+ function withPolicy(input, opts) {
65
+ const inject = opts?.injectPolicy !== false;
66
+ if (typeof input === 'string') {
67
+ if (!inject)
68
+ return input;
69
+ return appendPolicyToString(input);
70
+ }
71
+ const copy = input.map((m) => ({ ...m }));
72
+ if (!inject)
73
+ return copy;
74
+ if (copy.some((m) => contentHasMarker(m.content)))
75
+ return copy;
76
+ const sysIdx = copy.findIndex((m) => String(m.role).toLowerCase() === 'system');
77
+ if (sysIdx >= 0) {
78
+ const sys = copy[sysIdx];
79
+ if (typeof sys.content === 'string') {
80
+ copy[sysIdx] = { ...sys, content: appendPolicyToString(sys.content) };
81
+ return copy;
82
+ }
83
+ // Non-string system content: prepend a dedicated system message rather than guess parts.
84
+ return [{ role: 'system', content: exports.CODERIFTS_POLICY }, ...copy];
85
+ }
86
+ return [{ role: 'system', content: exports.CODERIFTS_POLICY }, ...copy];
87
+ }
88
+ let warnedThisProcess = false;
89
+ function defaultWarn(msg) {
90
+ console.warn(msg);
91
+ }
92
+ /** Once-per-process warn. Subsequent absent detections stay silent. */
93
+ function warnPolicyAbsentOnce() {
94
+ if (warnedThisProcess)
95
+ return;
96
+ warnedThisProcess = true;
97
+ defaultWarn(exports.POLICY_ABSENT_WARN);
98
+ }
99
+ /**
100
+ * Classify + maybe warn. `unknown` never warns. `detected` is silent.
101
+ * `absent` warns once per process.
102
+ */
103
+ function observePolicyPresence(text) {
104
+ const presence = policyPresenceOf(text);
105
+ if (presence === 'absent')
106
+ warnPolicyAbsentOnce();
107
+ return presence;
108
+ }
109
+ /** Test-only: allow the once-warn to fire again. */
110
+ function resetPolicyWarnForTests() {
111
+ warnedThisProcess = false;
112
+ }
113
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":";AAAA;;;;;;;;;GASG;;;AA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AE,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACtE,OAAO,IAAI,CAAC;QACd,CAAC;QACD,yFAAyF;QACzF,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,wBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,iBAAiB,GAAG,KAAK,CAAC;AAE9B,SAAS,WAAW,CAAC,GAAW;IAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AACpB,CAAC;AAED,uEAAuE;AACvE,SAAgB,oBAAoB;IAClC,IAAI,iBAAiB;QAAE,OAAO;IAC9B,iBAAiB,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,0BAAkB,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,SAAgB,qBAAqB,CAAC,IAA+B;IACnE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,QAAQ,KAAK,QAAQ;QAAE,oBAAoB,EAAE,CAAC;IAClD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,oDAAoD;AACpD,SAAgB,uBAAuB;IACrC,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC"}
@@ -13,6 +13,8 @@
13
13
  * ```
14
14
  */
15
15
  export { CodeRifts } from './client.js';
16
+ export { CODERIFTS_POLICY, POLICY_MARKER, POLICY_ABSENT_WARN, withPolicy, policyPresenceOf, detectPolicyPresence, observePolicyPresence, warnPolicyAbsentOnce, resetPolicyWarnForTests, } from './policy.js';
17
+ export type { PolicyPresence, PolicyMessage, WithPolicyOptions, } from './policy.js';
16
18
  export { CodeRiftsError, ApiError, TimeoutError, RateLimitError, AuthError } from './errors.js';
17
19
  export { readDecision } from './decision.js';
18
20
  export type { ReadDecisionResult } from './decision.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AACrB,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACR,sBAAsB,EACtB,0BAA0B,EAC1B,WAAW,GACd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,4BAA4B,CAAC;AACpC,YAAY,EACR,YAAY,EACZ,gBAAgB,EAChB,mBAAmB,EACnB,4BAA4B,EAC5B,gCAAgC,GACnC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACH,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACR,eAAe,EACf,kBAAkB,EAClB,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,GACpC,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACR,gBAAgB,EAChB,YAAY,EACZ,qBAAqB,EACrB,sBAAsB,EACtB,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,cAAc,EACd,sBAAsB,EACtB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,WAAW,EACX,qBAAqB,EACrB,sBAAsB,EACtB,WAAW,EACX,QAAQ,EACR,eAAe,EACf,aAAa,EACb,cAAc,EACd,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACR,aAAa,EACb,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,aAAa,CAAC;AACrB,YAAY,EACR,cAAc,EACd,aAAa,EACb,iBAAiB,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,YAAY,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,gBAAgB,E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EACpB,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACzB,MAAM,YAAY,CAAC"}
package/dist/esm/index.js CHANGED
@@ -13,6 +13,7 @@
13
13
  * ```
14
14
  */
15
15
  export { CodeRifts } from './client.js';
16
+ export { CODERIFTS_POLICY, POLICY_MARKER, POLICY_ABSENT_WARN, withPolicy, policyPresenceOf, detectPolicyPresence, observePolicyPresence, warnPolicyAbsentOnce, resetPolicyWarnForTests, } from './policy.js';
16
17
  export { CodeRiftsError, ApiError, TimeoutError, RateLimitError, AuthError } from './errors.js';
17
18
  export { readDecision } from './decision.js';
18
19
  export { CLOCK_SKEW_LEEWAY_MS, expiryLeewayMs, declaresDestructiveProduction, isReceiptExpired, isIssuedInFuture, } from './leeway.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EACH,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EACH,gBAAgB,EAChB,aAAa,EACb,kBAAkB,EAClB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,GAC1B,MAAM,aAAa,CAAC;AAMrB,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,YAAY,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAChG,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAE7C,OAAO,EACH,oBAAoB,EACpB,cAAc,EACd,6BAA6B,EAC7B,gBAAgB,EAChB,gBAAgB,GACnB,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,aAAa,EACb,aAAa,EACb,oBAAoB,GACvB,MAAM,sBAAsB,CAAC;AAM9B,OAAO,EACH,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,qBAAqB,EACrB,mBAAmB,GACtB,MAAM,4BAA4B,CAAC;AAQpC,OAAO,EACH,2BAA2B,EAC3B,yBAAyB,EACzB,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC9B,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,55 @@
1
+ /**
2
+ * CodeRifts agent-host policy text.
3
+ *
4
+ * Vendored from coderifts-app `src/agent-host-rule.js` `getCanonicalRuleText()`.
5
+ * Drift-gated by `test/policy-vendored-sync.test.js` (byte-equal to the app
6
+ * canonical text; missing app checkout fails loud — never skip).
7
+ *
8
+ * This proves the TEXT is present when injected/detected, not that the model
9
+ * read or obeyed it.
10
+ */
11
+ /** Phrase present in ALL six generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions). */
12
+ export declare const POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy.";
13
+ /** Canonical policy body (paragraphs joined by blank lines). */
14
+ export declare const CODERIFTS_POLICY: string;
15
+ /** Once-per-process warning when the host supplied a prompt that lacks the marker. */
16
+ export declare const POLICY_ABSENT_WARN = "CodeRifts policy text not detected in the system prompt. The agent will still see the tools, but measured evidence shows operation-scope misuse is markedly more likely without it. See https://github.com/coderifts/agent-guard#policy-delivery.";
17
+ export type PolicyPresence = 'detected' | 'absent' | 'unknown';
18
+ export type WithPolicyOptions = {
19
+ /**
20
+ * Default true. `false` returns a non-mutated copy and does not append.
21
+ * Opt-out for hosts that call `withPolicy` from a shared wrapper.
22
+ */
23
+ injectPolicy?: boolean;
24
+ };
25
+ /** Minimal chat message shape (OpenAI/Anthropic-compatible). Extra fields are preserved. */
26
+ export type PolicyMessage = {
27
+ role: string;
28
+ content?: unknown;
29
+ [key: string]: unknown;
30
+ };
31
+ /**
32
+ * Observation-only classification of host-supplied instruction text.
33
+ * `null`/`undefined` -> `unknown` (host did not tell us). Anything else is
34
+ * `detected` or `absent` based on POLICY_MARKER.
35
+ */
36
+ export declare function policyPresenceOf(text: string | null | undefined): PolicyPresence;
37
+ /** Alias used by hosts that call the check at startup without the guard. */
38
+ export declare function detectPolicyPresence(text: string | null | undefined): PolicyPresence;
39
+ /**
40
+ * Append the canonical policy text if the marker is not already present.
41
+ * Never mutates the caller's string/array/objects — always returns a new value
42
+ * for arrays; strings are new only when appending.
43
+ */
44
+ export declare function withPolicy(input: string, opts?: WithPolicyOptions): string;
45
+ export declare function withPolicy<T extends PolicyMessage>(input: readonly T[], opts?: WithPolicyOptions): T[];
46
+ /** Once-per-process warn. Subsequent absent detections stay silent. */
47
+ export declare function warnPolicyAbsentOnce(): void;
48
+ /**
49
+ * Classify + maybe warn. `unknown` never warns. `detected` is silent.
50
+ * `absent` warns once per process.
51
+ */
52
+ export declare function observePolicyPresence(text: string | null | undefined): PolicyPresence;
53
+ /** Test-only: allow the once-warn to fire again. */
54
+ export declare function resetPolicyWarnForTests(): void;
55
+ //# sourceMappingURL=policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gKAAgK;AAChK,eAAO,MAAM,aAAa,qFAC0D,CAAC;AAErF,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,EAAE,MAA89H,CAAC;AAE9/H,sFAAsF;AACtF,eAAO,MAAM,kBAAkB,sPACsN,CAAC;AAEtP,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE/D,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,4FAA4F;AAC5F,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAiBF;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAGhF;AAED,4EAA4E;AAC5E,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAEpF;AAQD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAC5E,wBAAgB,UAAU,CAAC,CAAC,SAAS,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,iBAAiB,GAAG,CAAC,EAAE,CAAC;AAgCxG,uEAAuE;AACvE,wBAAgB,oBAAoB,IAAI,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,CAIrF;AAED,oDAAoD;AACpD,wBAAgB,uBAAuB,IAAI,IAAI,CAE9C"}
@@ -0,0 +1,104 @@
1
+ /**
2
+ * CodeRifts agent-host policy text.
3
+ *
4
+ * Vendored from coderifts-app `src/agent-host-rule.js` `getCanonicalRuleText()`.
5
+ * Drift-gated by `test/policy-vendored-sync.test.js` (byte-equal to the app
6
+ * canonical text; missing app checkout fails loud — never skip).
7
+ *
8
+ * This proves the TEXT is present when injected/detected, not that the model
9
+ * read or obeyed it.
10
+ */
11
+ /** Phrase present in ALL six generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions). */
12
+ export const POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy.";
13
+ /** Canonical policy body (paragraphs joined by blank lines). */
14
+ export const CODERIFTS_POLICY = "Call `preflight_change_set` before merge, deploy, publish, or tool registration when a contract artifact changed (OpenAPI/Swagger, GraphQL, gRPC/protobuf, AsyncAPI, MCP manifest, or agent tool schemas).\n\nSend the complete base-to-head change set: every changed contract artifact with full before and after content. Do not send a single-file subset when other contract files also change.\n\nBranch on `execution_action` only. Do not branch on `decision` and do not branch on `safe_for_agent` (not_for_control_flow_use_execution_action). Canonical `execution_action` values: CONTINUE, CONTINUE_WITH_MONITORING, REQUEST_APPROVAL, STOP.\n\nAn unrecognised `execution_action` is not permission: fail closed (halt or re-preflight). Well-known code: `not_permission_fail_closed`.\n\n`CONTINUE_WITH_MONITORING` requires a wired monitoring sink (`monitoringSinkWired`). It is not \"proceed with caution\" without monitoring.\n\nDo not call CodeRifts tools for a documentation-only change (README, guides, comments) with no contract artifact content change.\n\nIf you already hold a chain receipt and only need authenticity/lifecycle: `verify_receipt`. If you need a past decision by id: `get_decision_details`. Neither replaces preflight for a new change set.\n\nA receipt authorizes ONE operation: a merge receipt does not authorize a deploy. Before a different operation (deploy, publish), call `preflight_change_set` with `context.operation` set to that operation \u2014 reusing a differently-scoped receipt is not permitted and will fail at the gate.\n\nA stale or superseded receipt on a changed head requires a NEW preflight \u2014 `verify_receipt` cannot re-diff.\n\nFor mutating tools, put only the guarded version in the agent's tool table; keep the raw handler host-only and unreachable from that table. How you name tools is yours \u2014 this is a reachability property, not a product rename of host tools. CodeRifts cannot see or stop a raw call the host makes outside the table it returns; adopt this as a host convention, not as a guarantee from the package.\n\nCodeRifts reports a governance decision and `execution_action`; it does not by itself block merges. Blocking requires separate repository configuration (required status checks, enforcement) that this rule file does not set.\n\nTo act (mutate a contract, merge, deploy, or publish): call `preflight_change_set` with `preflight_mode` authorize. Analyze is informational (`may_execute` is always false) and is not permission. Read `execution_action` on the `decision_result` envelope.\n\nBefore acting under a held receipt: call `verify_receipt` with the intended `context` (operation, environment, repository, branch, pull_request) for THIS attempt. Do not act on a receipt whose scope does not match.\n\nAct only when `currently_authorized` is true (`control_envelope.receipt_view.currently_authorized`). A valid-looking token is not permission if `currently_authorized` is false or omitted.\n\nCommit / CAS evidence is a separate measurement (`commit_observation` on GuardOutcome). It is not a substitute for authorize + `currently_authorized`. Production hosts that want the fail-closed conjunction lock it with `profile: ENFORCING_STRICT` on withCodeRifts.\n\nIf the host requests an execution grant (opt-in `include_execution_grant`), the grant is bound to operation + target + after-payload (`scope_hash`) and is short-lived \u2014 never reuse it after the after-payload changes.\n\nAn ATOMIC-profile grant carries `state_nonce` and is single-use at the executor \u2014 if the executor has consumed the nonce, re-preflight; do not retry the same grant.\n\nWith a proven tenant\u2194repo binding you may request `derivation:\"server\"` instead of assembling `artifacts[]` yourself (`context.repository` + `context.base` + `context.head` required; caller-supplied artifacts are rejected on that path).\n\nA commit is only proven when an executor attestation verifies (customer-held executor key, `cas_evidence: executor_attested`); otherwise say \"authorized, commit not proven\".";
15
+ /** Once-per-process warning when the host supplied a prompt that lacks the marker. */
16
+ export const POLICY_ABSENT_WARN = "CodeRifts policy text not detected in the system prompt. The agent will still see the tools, but measured evidence shows operation-scope misuse is markedly more likely without it. See https://github.com/coderifts/agent-guard#policy-delivery.";
17
+ function textHasMarker(text) {
18
+ return text.includes(POLICY_MARKER);
19
+ }
20
+ function contentHasMarker(content) {
21
+ if (typeof content === 'string')
22
+ return textHasMarker(content);
23
+ if (Array.isArray(content))
24
+ return content.some(contentHasMarker);
25
+ if (content && typeof content === 'object') {
26
+ const o = content;
27
+ if (typeof o.text === 'string' && textHasMarker(o.text))
28
+ return true;
29
+ if (typeof o.content === 'string' && textHasMarker(o.content))
30
+ return true;
31
+ }
32
+ return false;
33
+ }
34
+ /**
35
+ * Observation-only classification of host-supplied instruction text.
36
+ * `null`/`undefined` -> `unknown` (host did not tell us). Anything else is
37
+ * `detected` or `absent` based on POLICY_MARKER.
38
+ */
39
+ export function policyPresenceOf(text) {
40
+ if (text == null)
41
+ return 'unknown';
42
+ return textHasMarker(String(text)) ? 'detected' : 'absent';
43
+ }
44
+ /** Alias used by hosts that call the check at startup without the guard. */
45
+ export function detectPolicyPresence(text) {
46
+ return policyPresenceOf(text);
47
+ }
48
+ function appendPolicyToString(existing) {
49
+ if (textHasMarker(existing))
50
+ return existing;
51
+ if (existing.trim() === '')
52
+ return CODERIFTS_POLICY;
53
+ return existing + '\n\n' + CODERIFTS_POLICY;
54
+ }
55
+ export function withPolicy(input, opts) {
56
+ const inject = opts?.injectPolicy !== false;
57
+ if (typeof input === 'string') {
58
+ if (!inject)
59
+ return input;
60
+ return appendPolicyToString(input);
61
+ }
62
+ const copy = input.map((m) => ({ ...m }));
63
+ if (!inject)
64
+ return copy;
65
+ if (copy.some((m) => contentHasMarker(m.content)))
66
+ return copy;
67
+ const sysIdx = copy.findIndex((m) => String(m.role).toLowerCase() === 'system');
68
+ if (sysIdx >= 0) {
69
+ const sys = copy[sysIdx];
70
+ if (typeof sys.content === 'string') {
71
+ copy[sysIdx] = { ...sys, content: appendPolicyToString(sys.content) };
72
+ return copy;
73
+ }
74
+ // Non-string system content: prepend a dedicated system message rather than guess parts.
75
+ return [{ role: 'system', content: CODERIFTS_POLICY }, ...copy];
76
+ }
77
+ return [{ role: 'system', content: CODERIFTS_POLICY }, ...copy];
78
+ }
79
+ let warnedThisProcess = false;
80
+ function defaultWarn(msg) {
81
+ console.warn(msg);
82
+ }
83
+ /** Once-per-process warn. Subsequent absent detections stay silent. */
84
+ export function warnPolicyAbsentOnce() {
85
+ if (warnedThisProcess)
86
+ return;
87
+ warnedThisProcess = true;
88
+ defaultWarn(POLICY_ABSENT_WARN);
89
+ }
90
+ /**
91
+ * Classify + maybe warn. `unknown` never warns. `detected` is silent.
92
+ * `absent` warns once per process.
93
+ */
94
+ export function observePolicyPresence(text) {
95
+ const presence = policyPresenceOf(text);
96
+ if (presence === 'absent')
97
+ warnPolicyAbsentOnce();
98
+ return presence;
99
+ }
100
+ /** Test-only: allow the once-warn to fire again. */
101
+ export function resetPolicyWarnForTests() {
102
+ warnedThisProcess = false;
103
+ }
104
+ //# sourceMappingURL=policy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,gKAAgK;AAChK,MAAM,CAAC,MAAM,aAAa,GACxB,kFAAkF,CAAC;AAErF,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAW,q9HAAq9H,CAAC;AAE9/H,sFAAsF;AACtF,MAAM,CAAC,MAAM,kBAAkB,GAC7B,mPAAmP,CAAC;AAmBtP,SAAS,aAAa,CAAC,IAAY;IACjC,OAAO,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,gBAAgB,CAAC,OAAgB;IACxC,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,OA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uE;AACvE,MAAM,UAAU,oBAAoB;IAClC,IAAI,iBAAiB;QAAE,OAAO;IAC9B,iBAAiB,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,kBAAkB,CAAC,CAAC;AAClC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAA+B;IACnE,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACxC,IAAI,QAAQ,KAAK,QAAQ;QAAE,oBAAoB,EAAE,CAAC;IAClD,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,oDAAoD;AACpD,MAAM,UAAU,uBAAuB;IACrC,iBAAiB,GAAG,KAAK,CAAC;AAC5B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderifts/sdk",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "Agent Governance SDK \u2014 validate API changes before tool invocations. TypeScript client for the CodeRifts API.",
5
5
  "main": "./dist/cjs/index.js",
6
6
  "module": "./dist/esm/index.js",