@coderifts/sdk 3.14.1 → 3.14.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.
Files changed (36) hide show
  1. package/README.md +35 -1
  2. package/dist/cjs/decision.d.ts +2 -1
  3. package/dist/cjs/decision.d.ts.map +1 -1
  4. package/dist/cjs/decision.js +33 -3
  5. package/dist/cjs/decision.js.map +1 -1
  6. package/dist/cjs/execution-grant.d.ts.map +1 -1
  7. package/dist/cjs/execution-grant.js +3 -1
  8. package/dist/cjs/execution-grant.js.map +1 -1
  9. package/dist/cjs/generated/decision-result.v1.d.ts +14 -2
  10. package/dist/cjs/generated/decision-result.v1.d.ts.map +1 -1
  11. package/dist/cjs/generated/preflight-response.v2.d.ts +30 -14
  12. package/dist/cjs/generated/preflight-response.v2.d.ts.map +1 -1
  13. package/dist/cjs/policy.d.ts.map +1 -1
  14. package/dist/cjs/policy.js +1 -1
  15. package/dist/cjs/policy.js.map +1 -1
  16. package/dist/cjs/vendor/receipt-verifier/VENDOR.sha256 +16 -12
  17. package/dist/cjs/vendor/receipt-verifier/verify-grant.js +8 -4
  18. package/dist/cjs/vendor/receipt-verifier/verify.js +11 -3
  19. package/dist/esm/decision.d.ts +2 -1
  20. package/dist/esm/decision.d.ts.map +1 -1
  21. package/dist/esm/decision.js +33 -3
  22. package/dist/esm/decision.js.map +1 -1
  23. package/dist/esm/execution-grant.d.ts.map +1 -1
  24. package/dist/esm/execution-grant.js +3 -1
  25. package/dist/esm/execution-grant.js.map +1 -1
  26. package/dist/esm/generated/decision-result.v1.d.ts +14 -2
  27. package/dist/esm/generated/decision-result.v1.d.ts.map +1 -1
  28. package/dist/esm/generated/preflight-response.v2.d.ts +30 -14
  29. package/dist/esm/generated/preflight-response.v2.d.ts.map +1 -1
  30. package/dist/esm/policy.d.ts.map +1 -1
  31. package/dist/esm/policy.js +1 -1
  32. package/dist/esm/policy.js.map +1 -1
  33. package/dist/esm/vendor/receipt-verifier/VENDOR.sha256 +16 -12
  34. package/dist/esm/vendor/receipt-verifier/verify-grant.js +8 -4
  35. package/dist/esm/vendor/receipt-verifier/verify.js +11 -3
  36. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"policy.d.ts","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gKAAgK;AAChK,eAAO,MAAM,aAAa,qFAC0D,CAAC;AAErF,gEAAgE;AAChE,eAAO,MAAM,gBAAgB,EAAE,MAAs1J,CAAC;AAEt3J,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,I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gCxG,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"}
@@ -12,7 +12,7 @@
12
12
  /** Phrase present in ALL six generated host formats (AGENTS.md, CLAUDE.md, cursor rules, Copilot instructions, LangGraph policy, OpenAI agent instructions). */
13
13
  export const POLICY_MARKER = "A receipt authorizes ONE operation: a merge receipt does not authorize a deploy.";
14
14
  /** Canonical policy body (paragraphs joined by blank lines). */
15
- 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\nWhen `execution_action` is REQUEST_APPROVAL or STOP, surface the detected patterns and the blast radius, and propose the safer path \u2014 deprecate-then-remove, an additive change, or a new version \u2014 rather than shipping the break.\n\n`CONTINUE_WITH_MONITORING` requires a wired monitoring sink (`monitoringSinkWired`). It is not \"proceed with caution\" without monitoring.\n\nDo not call `preflight_change_set` for: a documentation-only change (README, guides, comments) with no contract artifact content change; a static readiness score (a different capability, not a change-set decision); or to verify a receipt you already hold (that is `verify_receipt` \u2014 see the companion-tools rule).\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\nThe CodeRifts MCP server exposes exactly three tools \u2014 `preflight_change_set`, `verify_receipt`, `get_decision_details`. Do not invent or assume others.\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 \u2014 risk only, `may_execute` is always false \u2014 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\nVersions you may meet elsewhere: `cr.exec.v2` is the issued-token version for atomic execution, and `ENFORCING_STRICT_V1` is the versioned spelling of the strict profile. Neither is the default and neither is required by these rules \u2014 see `docs/grant-versions.md`.\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
+ 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\nWhen `execution_action` is REQUEST_APPROVAL or STOP, surface the detected patterns and the blast radius, and propose the safer path \u2014 deprecate-then-remove, an additive change, or a new version \u2014 rather than shipping the break.\n\n`CONTINUE_WITH_MONITORING` requires a wired monitoring sink (`monitoringSinkWired`). It is not \"proceed with caution\" without monitoring.\n\nDo not call `preflight_change_set` for: a documentation-only change (README, guides, comments) with no contract artifact content change; a static readiness score (a different capability, not a change-set decision); or to verify a receipt you already hold (that is `verify_receipt` \u2014 see the companion-tools rule).\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\nThe CodeRifts MCP server exposes exactly three tools \u2014 `preflight_change_set`, `verify_receipt`, `get_decision_details`. Do not invent or assume others.\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 \u2014 risk only, `may_execute` is always false \u2014 and is not permission. Read `execution_action` on the `decision_result` envelope.\n\nBefore acting under a held receipt: call verify_receipt with the same context fields the preflight was made under \u2014 operation, environment, repository, branch, pull_request \u2014 at the top level of the arguments (a context object is also accepted), AND target_id set to decision_result.artifact_digest from the decision you are acting under, AND the decision_result exactly as received. Without target_id: currently_authorized:false, authz_reason target_not_stated \u2014 a missing input, not a refusal.\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\nVersions you may meet elsewhere: `cr.exec.v2` is the issued-token version for atomic execution, and `ENFORCING_STRICT_V1` is the versioned spelling of the strict profile. Neither is the default and neither is required by these rules \u2014 see `docs/grant-versions.md`.\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\".";
16
16
  /** Once-per-process warning when the host supplied a prompt that lacks the marker. */
17
17
  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.";
18
18
  function textHasMarker(text) {
@@ -1 +1 @@
1
- {"version":3,"file":"policy.js","sourceRoot":"","sources":["../../src/policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gKAAgK;AAChK,MAAM,CAAC,MAAM,aAAa,GACxB,kFAAkF,CAAC;AAErF,gEAAgE;AAChE,MAAM,CAAC,MAAM,gBAAgB,GAAW,60JAA60J,CAAC;AAEt3J,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,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClE,IAAI,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC3C,MAAM,CAAC,GAAG,OAAkC,CAAC;QAC7C,IAAI,OAAO,CAAC,CAAC,IAAI,KAAK,QAAQ,IAAI,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACrE,IAAI,OAAO,CAAC,CAAC,OAAO,KAAK,QAAQ,IAAI,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC;YAAE,OAAO,IAAI,CAAC;IAC7E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAA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G,EAAE,GAAG,GAAG,EAAE,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,gBAAgB,EAAE,EAAE,GAAG,IAAI,CAAC,CAAC;IAClE,CAAC;IACD,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,gBAAgB,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,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"}
@@ -17,8 +17,8 @@
17
17
 
18
18
  # ── THE RECEIPT-VERIFIER CORE IS PINNED TO A RELEASED TAG ───────────────────────────────────
19
19
  #
20
- # The shared verification core here comes from receipt-verifier **v1.0.1**, peeled commit
21
- # 51a8224439959a5b46c0b09e9a2cd67117f05d56.
20
+ # The shared verification core here comes from receipt-verifier **v1.0.3**, peeled commit
21
+ # 523e0a2b822088990f500b9eea3868309439c53c.
22
22
  #
23
23
  # It was pinned to a WORKING TREE and to per-file commits. Both are honest about where the bytes
24
24
  # came from and neither is a provenance a stranger can resolve: a working tree is not fetchable,
@@ -26,8 +26,8 @@
26
26
  # now". A released tag is a name anyone can check out — that is the difference between a pin and
27
27
  # a note.
28
28
  #
29
- # The hash lines below are UNCHANGED by the re-pin. Where a file already matched the tag this is
30
- # prose only; where it did not, it was re-copied from the tag and that is recorded below.
29
+ # Hash lines that moved: verify.js, verify-grant.js (v1.0.3 admits applied_policy_hash).
30
+ # Every other hash line is unchanged because those files are byte-identical to v1.0.2.
31
31
  #
32
32
  #
33
33
  # ── AND THE TAG IS SIGNED, WHICH IS THE PART A STRANGER CAN CHECK ───────────────────────────
@@ -36,24 +36,28 @@
36
36
  # can move. v1.0.1 is annotated and SSH-signed, so the pin now resolves to an identity and not
37
37
  # only to bytes.
38
38
  #
39
- # tag object 06dd74f36f60e0b4d22dd4667732fe0a27575287
40
- # peeled commit 51a8224439959a5b46c0b09e9a2cd67117f05d56
39
+ # tag object bb5753681275920e7e23351c6b41632957e6238f
40
+ # peeled commit 523e0a2b822088990f500b9eea3868309439c53c
41
41
  # signer zsobpeter@gmail.com
42
42
  # fingerprint SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
43
43
  #
44
44
  # Verify it yourself, in a checkout of receipt-verifier:
45
45
  #
46
- # git tag -v v1.0.1
46
+ # git tag -v v1.0.3
47
47
  # -> Good "git" signature for zsobpeter@gmail.com with ED25519 key SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
48
48
  #
49
- # The peeled commit is UNCHANGED from v1.0.0 — the core is byte-identical and this re-pin moves no
50
- # hash line. What it adds is who stands behind the bytes.
51
- # source_commit: 51a8224439959a5b46c0b09e9a2cd67117f05d56 (receipt-verifier v1.0.1, signed)
49
+ # WHY v1.0.3 AND NOT v1.0.2: the CORE IS NOT byte-identical. verify-grant.js admits
50
+ # applied_policy_hash on V2_RESERVED_INERT (1942 verifier-admits; fail-closed otherwise
51
+ # unchanged) and verify.js moved with it. This re-pin copies those bytes from the signed
52
+ # tag, not from a working tree.
53
+ #
54
+ # The peeled commit is 523e0a2 — the K-phase-1 inert-admit commit the tag names.
55
+ # source_commit: 523e0a2b822088990f500b9eea3868309439c53c (receipt-verifier v1.0.3, signed)
52
56
  #
53
57
 
54
58
  721fcac58b960b5e2aa1af91edb6cfc87ebe828a6da73879967ef79a1ca474e8 arity.js
55
- 348d3f851cd79bf63298b51da422d11be980820576ab0bf0a2990b9f007d6249 verify.js
56
- 4a0ad5bd7bb8282e086bea99dcaf8ca278370d80019c5681d2942bf11bc87504 verify-grant.js
59
+ 52d7c37611f9eecc862e3678d1ffcb4fd860ea4c5faf9a9df6d6d5b290bd8197 verify.js
60
+ ea55b8611d6f3bba2cb9c84d765ade15bb2afe2418499e2da6358ffb3faf6ad6 verify-grant.js
57
61
  3bb17bd4f16d5ee3cf3fbb754b4df9aa570a615ca94ff2a97b751c4fabd3bd0d verify-prove-transcript.js
58
62
  98cd9b989a25095e0442f91f68a1adecd6e6a2a5b05902bf2580b8cba973c5e2 verify-evidence.js
59
63
  4d5476fc44bbfc2a847feeb313a1c6c08ef7fd832a2348ef3c244bd8d3f03fcd evidence-root.js
@@ -65,17 +65,21 @@ const V2_REQUIRED_STRINGS = Object.freeze([
65
65
  *
66
66
  * The admitted key set is closed: an unknown field is `MALFORMED/unknown_field`, which is the
67
67
  * right default and also means a future field cannot be introduced without every deployed
68
- * verifier refusing the grants that carry it. Reserving the two names now is what keeps that
68
+ * verifier refusing the grants that carry it. Reserving the names now is what keeps that
69
69
  * introduction from being a breaking change later.
70
70
  *
71
71
  * ── WHAT THEY DO NOT DO, WHICH IS THE POINT ─────────────────────────────────────────────────
72
72
  *
73
73
  * NOTHING. A grant carrying `call_hash` is graded EXACTLY as one without it. There is no check,
74
- * no comparison, and no `intended` field they bind to.
74
+ * no comparison, and no `intended` field they bind to. Same for `applied_policy_hash` (1942):
75
+ * admitted so a later producer can emit it without every deployed verifier going MALFORMED.
76
+ * This verifier does not read it as the evaluated policy, does not compare it to `policy_hash`,
77
+ * and does not fail a grant that omits it.
75
78
  *
76
79
  * A VERIFIER THAT READS THEIR PRESENCE AS AUTHORIZATION IS WRONG. `call_hash` present does not
77
80
  * mean a tool call was bound; `executor_image_digest` present does not mean an executor image was
78
- * pinned. Nothing signs a promise that the value is true, nothing compares it to anything, and an
81
+ * pinned; `applied_policy_hash` present does not mean the evaluator's policy was bound. Nothing
82
+ * signs a promise that the value is true, nothing compares it to anything, and an
79
83
  * attacker who can mint a grant can put any value in them. Presence is not proof — it is a slot.
80
84
  *
81
85
  * They are unsigned-by-default only in the sense that no separate signature covers them: the v2
@@ -86,7 +90,7 @@ const V2_REQUIRED_STRINGS = Object.freeze([
86
90
  * When a gate for them lands it will be a NEW check with its own negative fixtures, and this
87
91
  * comment is what a reader should be shown if anyone claims otherwise before then.
88
92
  */
89
- const V2_RESERVED_INERT = Object.freeze(['call_hash', 'executor_image_digest']);
93
+ const V2_RESERVED_INERT = Object.freeze(['call_hash', 'executor_image_digest', 'applied_policy_hash']);
90
94
  const TARGET_SCHEMES = Object.freeze(['fs', 'git', 'api', 'db', 'registry', 'deploy']);
91
95
  const DEFAULT_FETCH_URL = 'https://app.coderifts.com/api/v1/attestation/public-key';
92
96
 
@@ -427,9 +427,17 @@ function verifyChain(tokens, second, third) {
427
427
  return verifyChainInner(tokens, ctx, opts);
428
428
  }
429
429
 
430
- // Reusable API — require('./verify') imports the pure verify logic WITHOUT running the CLI. The
431
- // GitHub Action + other embedders use these directly (verifyReceipt/verifyChain/deriveStatus/…);
432
- // the receipt format + taxonomy are frozen in RECEIPT_FORMAT.md.
430
+ // Reusable API — require('./verify') imports the pure verify logic WITHOUT running the CLI; the
431
+ // receipt format + taxonomy are frozen in RECEIPT_FORMAT.md.
432
+ //
433
+ // WHO ACTUALLY CALLS THESE, measured across the public surface on 2026-09-13:
434
+ // verifyChain — cli.js:219 (--chain, with a test) and the Python verifier's public API
435
+ // (coderifts_verifier/_verify.py verify_chain).
436
+ // verifyReceipt — the contract-gate Action.
437
+ // The previous wording said "the GitHub Action + other embedders use these directly" and listed
438
+ // verifyChain first. That is false for the Action: contract-gate calls verifyReceipt and never
439
+ // verifyChain — its copy of this file only carries the definition. Naming the callers instead of
440
+ // a category keeps the claim checkable.
433
441
  module.exports = {
434
442
  verifyReceipt,
435
443
  verifyChain,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coderifts/sdk",
3
- "version": "3.14.1",
3
+ "version": "3.14.3",
4
4
  "description": "Agent Governance SDK — 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",