@coderifts/sdk 3.14.0 → 3.14.2
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 +1 -1
- package/dist/cjs/authorize.d.ts.map +1 -1
- package/dist/cjs/authorize.js +35 -5
- package/dist/cjs/authorize.js.map +1 -1
- package/dist/cjs/decision.d.ts +2 -1
- package/dist/cjs/decision.d.ts.map +1 -1
- package/dist/cjs/decision.js +33 -3
- package/dist/cjs/decision.js.map +1 -1
- package/dist/cjs/vendor/receipt-verifier/VENDOR.sha256 +28 -2
- package/dist/cjs/vendor/receipt-verifier/verified-execution-binding.d.ts +48 -0
- package/dist/cjs/verify-receipt-local.d.ts.map +1 -1
- package/dist/cjs/verify-receipt-local.js +9 -4
- package/dist/cjs/verify-receipt-local.js.map +1 -1
- package/dist/esm/authorize.d.ts.map +1 -1
- package/dist/esm/authorize.js +31 -4
- package/dist/esm/authorize.js.map +1 -1
- package/dist/esm/decision.d.ts +2 -1
- package/dist/esm/decision.d.ts.map +1 -1
- package/dist/esm/decision.js +33 -3
- package/dist/esm/decision.js.map +1 -1
- package/dist/esm/vendor/receipt-verifier/VENDOR.sha256 +28 -2
- package/dist/esm/vendor/receipt-verifier/verified-execution-binding.d.ts +48 -0
- package/dist/esm/verify-receipt-local.d.ts.map +1 -1
- package/dist/esm/verify-receipt-local.js +9 -4
- package/dist/esm/verify-receipt-local.js.map +1 -1
- package/package.json +4 -3
package/README.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAqCH;;;GAGG;AACH,MAAM,MAAM,kBAAkB,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ider_witness`
|
|
32
32
|
* is an unsigned readback unless you say otherwise, which is what RECORDED_UNWITNESSED names.
|
|
33
33
|
*/
|
|
34
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
+
};
|
|
34
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
38
|
exports.AUTHORIZATION_STATE = void 0;
|
|
36
39
|
exports.authorize = authorize;
|
|
37
40
|
const crypto_1 = require("crypto");
|
|
41
|
+
// ── STATIC IMPORTS, BECAUSE A CALL-TIME `require` BROKE EVERY ESM CONSUMER ──────────────────
|
|
42
|
+
//
|
|
43
|
+
// These two were loaded inside `authorize()` with a bare `require(...)`. MEASURED against the
|
|
44
|
+
// published 3.14.0 tarball, installed into a fresh project and imported from a real `.mjs`:
|
|
45
|
+
//
|
|
46
|
+
// import { authorize } from '@coderifts/sdk'; -> authorize typeof: function
|
|
47
|
+
// authorize({...}) -> ReferenceError: require is not defined
|
|
48
|
+
// in ES module scope, at dist/esm/authorize.js:64
|
|
49
|
+
//
|
|
50
|
+
// So the function IMPORTED and could not be CALLED — which is why it survived: the export existed,
|
|
51
|
+
// the types were right, and nothing failed until an adopter ran it. The suite never saw it either,
|
|
52
|
+
// because the tests load the CJS build, and a call-time `require` is invisible to the compiler in
|
|
53
|
+
// exactly the build where it cannot work.
|
|
54
|
+
//
|
|
55
|
+
// A static import is compiled to `require` in the CJS output and left as an `import` in the ESM
|
|
56
|
+
// one. The module form stops being something a runtime discovers and becomes something `tsc`
|
|
57
|
+
// emits — which is the whole fix. `verify-receipt-local.ts` was already written this way; this is
|
|
58
|
+
// the same treatment applied to the path that still had the defect.
|
|
59
|
+
//
|
|
60
|
+
// The DEFAULT import for the vendored core, and its reasoning is recorded beside it in
|
|
61
|
+
// `verified-execution-binding.d.ts`: named imports out of vendored CommonJS depend on node's
|
|
62
|
+
// cjs-module-lexer surfacing each name, which it does not always do, and the failure lands at load
|
|
63
|
+
// time rather than at compile time.
|
|
64
|
+
//
|
|
65
|
+
// NEITHER LOAD IS CONDITIONAL AND NEITHER WAS LAZY FOR A REASON. Checked before moving them:
|
|
66
|
+
// `execution-attestation.ts` imports only `crypto` and `./leeway.js`, and nothing imports
|
|
67
|
+
// `authorize.ts` except `index.ts` and a TYPE-only import in `verify-receipt-local.ts` — so there
|
|
68
|
+
// is no cycle these `require`s were quietly working around.
|
|
69
|
+
const verified_execution_binding_js_1 = __importDefault(require("./vendor/receipt-verifier/verified-execution-binding.js"));
|
|
70
|
+
const execution_attestation_js_1 = require("./execution-attestation.js");
|
|
71
|
+
const { verifiedExecutionBinding } = verified_execution_binding_js_1.default;
|
|
38
72
|
function toKeyringMap(keyring) {
|
|
39
73
|
if (!keyring || !Array.isArray(keyring.keys) || keyring.keys.length === 0)
|
|
40
74
|
return null;
|
|
@@ -64,10 +98,6 @@ function toKeyringMap(keyring) {
|
|
|
64
98
|
* if (!r.authorized_and_committed) throw new Error(`${r.state}: ${r.shortfalls.join('; ')}`);
|
|
65
99
|
*/
|
|
66
100
|
function authorize(input) {
|
|
67
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
68
|
-
const { verifiedExecutionBinding } = require('./vendor/receipt-verifier/verified-execution-binding.js');
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
70
|
-
const { verifyExecutionAttestation } = require('./execution-attestation.js');
|
|
71
101
|
const g = input.grant || {};
|
|
72
102
|
const att = input.attestation;
|
|
73
103
|
const root = input.evidenceRoot;
|
|
@@ -107,7 +137,7 @@ function authorize(input) {
|
|
|
107
137
|
registry: att.registry,
|
|
108
138
|
// Handed in rather than reimplemented: the core holds no attestation format
|
|
109
139
|
// knowledge of its own, and this SDK already owns that verifier.
|
|
110
|
-
verify: verifyExecutionAttestation,
|
|
140
|
+
verify: execution_attestation_js_1.verifyExecutionAttestation,
|
|
111
141
|
},
|
|
112
142
|
}
|
|
113
143
|
: {}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG
|
|
1
|
+
{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":";AAAA,4FAA4F;AAC5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;;;;;;AA0MH,8BA2DC;AAnQD,mCAAyC;AAEzC,+FAA+F;AAC/F,EAAE;AACF,8FAA8F;AAC9F,4FAA4F;AAC5F,EAAE;AACF,iFAAiF;AACjF,6FAA6F;AAC7F,sGAAsG;AACtG,EAAE;AACF,mGAAmG;AACnG,mGAAmG;AACnG,kGAAkG;AAClG,0CAA0C;AAC1C,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,oEAAoE;AACpE,EAAE;AACF,uFAAuF;AACvF,6FAA6F;AAC7F,mGAAmG;AACnG,oCAAoC;AACpC,EAAE;AACF,6FAA6F;AAC7F,0FAA0F;AAC1F,kGAAkG;AAClG,4DAA4D;AAC5D,4HAAkF;AAClF,yEAAwE;AAExE,MAAM,EAAE,wBAAwB,EAAE,GAAG,uCAAW,CAAC;AA4IjD,SAAS,YAAY,CAAC,OAAyC;IAC3D,IAAI,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACvF,MAAM,CAAC,GAAG,IAAI,GAAG,EAAmB,CAAC;IACrC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QAC3B,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,cAAc,KAAK,QAAQ;YAAE,SAAS;QACtF,CAAC,C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A,wBAAe,EAAC,IAAI,CAAC,oBAAoB,CAAC;oBACvD,QAAQ,EAAE,IAAI,CAAC,QAAQ;iBAC1B;aACJ;YACD,CAAC,CAAC,EAAE,CAAC;QACT,GAAG,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,gBAAgB,EAAE,KAAK,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,SAAS,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI;QACnC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACpD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAC1D,CAAoB,CAAC;AAC1B,CAAC;AAED,8DAA8D;AACjD,QAAA,mBAAmB,GAAuC,MAAM,CAAC,MAAM,CAAC;IACjF,wBAAwB,EAAE,0BAA0B;IACpD,YAAY,EAAE,cAAc;IAC5B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,oBAAoB,EAAE,sBAAsB;IAC5C,6BAA6B,EAAE,+BAA+B;IAC9D,aAAa,EAAE,eAAe;CACjC,CAAC,CAAC"}
|
package/dist/cjs/decision.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export declare function hasExplicitExecutionAction(response: unknown): boolean;
|
|
|
29
29
|
* Read a governance decision from ANY CodeRifts response, fail-closed. Resolution order:
|
|
30
30
|
* 1. envelope-first — `response.decision_result.execution_action` (+ receipt);
|
|
31
31
|
* 2. top-level `execution_action` (legacy REST endpoints emit it directly);
|
|
32
|
-
* 3. map a top-level `decision` via the ported deriveExecutionAction table
|
|
32
|
+
* 3. map a top-level `decision` via the ported deriveExecutionAction table — ONLY on an
|
|
33
|
+
* explicit spec-1.0, non-v2 body (see {@link allowLegacyDecisionMap});
|
|
33
34
|
* 4. otherwise fail closed: `{ executionAction: 'STOP', reason: 'UNREADABLE_DECISION' }`.
|
|
34
35
|
* Never throws — a guard can call this on any value (including error bodies / garbage).
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAU3F,MAAM,WAAW,kBAAkB;IAC/B,iFAAiF;IACjF,eAAe,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAMrE;
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAU3F,MAAM,WAAW,kBAAkB;IAC/B,iFAAiF;IACjF,eAAe,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAMrE;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CAyClE"}
|
package/dist/cjs/decision.js
CHANGED
|
@@ -34,11 +34,39 @@ function hasExplicitExecutionAction(response) {
|
|
|
34
34
|
return true;
|
|
35
35
|
return isExecutionAction(r.execution_action);
|
|
36
36
|
}
|
|
37
|
+
/**
|
|
38
|
+
* v2 body: `decision_result` present, OR `decision_spec_version` starts "2.", OR
|
|
39
|
+
* `preflight_mode` present. Mirrors @coderifts/agent-guard's isV2Response — the two
|
|
40
|
+
* readers must not disagree about what "legacy" means.
|
|
41
|
+
*/
|
|
42
|
+
function isV2Response(r, envObj) {
|
|
43
|
+
if (envObj)
|
|
44
|
+
return true;
|
|
45
|
+
if (r.preflight_mode != null && r.preflight_mode !== '')
|
|
46
|
+
return true;
|
|
47
|
+
const ver = r.decision_spec_version;
|
|
48
|
+
return typeof ver === 'string' && ver.startsWith('2.');
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* The legacy `decision` -> action map is allowed ONLY on an explicit spec-1.0 body that is
|
|
52
|
+
* not v2. A MISSING `decision_spec_version` is NOT legacy.
|
|
53
|
+
*
|
|
54
|
+
* 1565/1585, measured: before this gate the bare-legacy arm mapped `{decision:'ALLOW'}` to
|
|
55
|
+
* CONTINUE for EVERY bare shape — a missing action, an unrecognised action, and a spec-2.0
|
|
56
|
+
* body all resolved to permission. An agent branching on the result proceeded on a response
|
|
57
|
+
* that never granted anything. The wrapped shape was already fail-closed; only the bare arm
|
|
58
|
+
* leaked, which is why one measurement called this reader fail-closed and another called it
|
|
59
|
+
* fail-open. Both were right about the shape they fed it.
|
|
60
|
+
*/
|
|
61
|
+
function allowLegacyDecisionMap(r, envObj) {
|
|
62
|
+
return r.decision_spec_version === '1.0' && !isV2Response(r, envObj);
|
|
63
|
+
}
|
|
37
64
|
/**
|
|
38
65
|
* Read a governance decision from ANY CodeRifts response, fail-closed. Resolution order:
|
|
39
66
|
* 1. envelope-first — `response.decision_result.execution_action` (+ receipt);
|
|
40
67
|
* 2. top-level `execution_action` (legacy REST endpoints emit it directly);
|
|
41
|
-
* 3. map a top-level `decision` via the ported deriveExecutionAction table
|
|
68
|
+
* 3. map a top-level `decision` via the ported deriveExecutionAction table — ONLY on an
|
|
69
|
+
* explicit spec-1.0, non-v2 body (see {@link allowLegacyDecisionMap});
|
|
42
70
|
* 4. otherwise fail closed: `{ executionAction: 'STOP', reason: 'UNREADABLE_DECISION' }`.
|
|
43
71
|
* Never throws — a guard can call this on any value (including error bodies / garbage).
|
|
44
72
|
*/
|
|
@@ -65,8 +93,10 @@ function readDecision(response) {
|
|
|
65
93
|
decision: typeof r.decision === 'string' ? r.decision : null,
|
|
66
94
|
};
|
|
67
95
|
}
|
|
68
|
-
// 3. Legacy decision-only -> mapped action.
|
|
69
|
-
if (typeof r.decision === 'string' &&
|
|
96
|
+
// 3. Legacy decision-only -> mapped action. Gated: explicit spec 1.0, non-v2 only.
|
|
97
|
+
if (typeof r.decision === 'string' &&
|
|
98
|
+
Object.prototype.hasOwnProperty.call(EXECUTION_ACTION, r.decision) &&
|
|
99
|
+
allowLegacyDecisionMap(r, (env && typeof env === 'object' ? env : null))) {
|
|
70
100
|
return { executionAction: EXECUTION_ACTION[r.decision], decision: r.decision };
|
|
71
101
|
}
|
|
72
102
|
// 4. Fail closed.
|
package/dist/cjs/decision.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAuCH,gEAMC;
|
|
1
|
+
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":";AAAA;;GAEG;;AAuCH,gEAMC;AAsCD,oCAyCC;AAxHD,0FAA0F;AAC1F,MAAM,gBAAgB,GAAoC;IACtD,K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E,sBAAsB,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAC1E,CAAC;QACC,OAAO,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnF,CAAC;IAED,kBAAkB;IAClB,OAAO;QACH,eAAe,EAAE,MAAM;QACvB,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;QAC5D,MAAM,EAAE,qBAAqB;KAChC,CAAC;AACN,CAAC"}
|
|
@@ -17,7 +17,7 @@
|
|
|
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.
|
|
20
|
+
# The shared verification core here comes from receipt-verifier **v1.0.2**, peeled commit
|
|
21
21
|
# 51a8224439959a5b46c0b09e9a2cd67117f05d56.
|
|
22
22
|
#
|
|
23
23
|
# It was pinned to a WORKING TREE and to per-file commits. Both are honest about where the bytes
|
|
@@ -29,7 +29,33 @@
|
|
|
29
29
|
# The hash lines below are UNCHANGED by the re-pin. Where a file already matched the tag this is
|
|
30
30
|
# prose only; where it did not, it was re-copied from the tag and that is recorded below.
|
|
31
31
|
#
|
|
32
|
-
#
|
|
32
|
+
#
|
|
33
|
+
# ── AND THE TAG IS SIGNED, WHICH IS THE PART A STRANGER CAN CHECK ───────────────────────────
|
|
34
|
+
#
|
|
35
|
+
# v1.0.0 was an unsigned tag: a name anyone can check out, and also a name anyone with push access
|
|
36
|
+
# can move. v1.0.1 is annotated and SSH-signed, so the pin now resolves to an identity and not
|
|
37
|
+
# only to bytes.
|
|
38
|
+
#
|
|
39
|
+
# tag object 99567ea1c88b9b6e348118eeacd03592e3f1075f
|
|
40
|
+
# peeled commit ac683b16c19662c9124c8cdab785223b28d2d0c6
|
|
41
|
+
# signer zsobpeter@gmail.com
|
|
42
|
+
# fingerprint SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
43
|
+
#
|
|
44
|
+
# Verify it yourself, in a checkout of receipt-verifier:
|
|
45
|
+
#
|
|
46
|
+
# git tag -v v1.0.2
|
|
47
|
+
# -> Good "git" signature for zsobpeter@gmail.com with ED25519 key SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
48
|
+
#
|
|
49
|
+
# WHY v1.0.2 AND NOT v1.0.1: the CORE IS BYTE-IDENTICAL between them — every hash line
|
|
50
|
+
# below is unchanged, and this re-pin moves none of them. v1.0.2 adds two things to the
|
|
51
|
+
# RELEASE: RECEIPT_FORMAT.md section 14 (the authority model) is in the tagged tree, and
|
|
52
|
+
# verification/allowed_signers ships in the repo so `git tag -v` names a principal on a
|
|
53
|
+
# machine that has never seen this project. A doc committed after a tag is not in that
|
|
54
|
+
# release, however committed it is — which is why the tag moved rather than the bytes.
|
|
55
|
+
#
|
|
56
|
+
# The peeled commit is UNCHANGED from v1.0.0 — the core is byte-identical and this re-pin moves no
|
|
57
|
+
# hash line. What it adds is who stands behind the bytes.
|
|
58
|
+
# source_commit: ac683b16c19662c9124c8cdab785223b28d2d0c6 (receipt-verifier v1.0.2, signed)
|
|
33
59
|
#
|
|
34
60
|
|
|
35
61
|
721fcac58b960b5e2aa1af91edb6cfc87ebe828a6da73879967ef79a1ca474e8 arity.js
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the vendored `verified-execution-binding.js`, written HERE rather than in it.
|
|
3
|
+
*
|
|
4
|
+
* The same rule as `verify.d.ts` beside it: the vendored bytes stay byte-identical to
|
|
5
|
+
* receipt-verifier's, because a pin that survives an edit is not a pin. The declaration lives
|
|
6
|
+
* alongside, and `VENDOR.sha256` covers the .js only — that is deliberate, since this file is
|
|
7
|
+
* ours and the .js is theirs.
|
|
8
|
+
*
|
|
9
|
+
* ── WHY THIS FILE EXISTS AT ALL ─────────────────────────────────────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* `authorize()` loaded the core with a call-time `require(...)`, which needs no declaration and
|
|
12
|
+
* therefore never needed one — and which MEASURED as `ReferenceError: require is not defined` in
|
|
13
|
+
* `dist/esm/authorize.js` for every ESM consumer of the published package. Replacing it with a
|
|
14
|
+
* static import is what makes the compiler responsible for the module form, and a static import
|
|
15
|
+
* needs types. So this file is the cost of moving the check from a consumer's runtime to our
|
|
16
|
+
* build.
|
|
17
|
+
*
|
|
18
|
+
* Only what `authorize()` actually calls is declared. Declaring the rest would invite callers to
|
|
19
|
+
* reach into the core through this package; the core is vendored for internal use, not re-exported
|
|
20
|
+
* as an API this SDK then owns.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** The core's own result shape. Kept loose: this SDK maps it, it does not redefine it. */
|
|
24
|
+
export interface CoreBindingResult {
|
|
25
|
+
state: string;
|
|
26
|
+
authorized_and_committed: boolean;
|
|
27
|
+
shortfalls: string[];
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The DEFAULT export — `module.exports` whole, destructured at runtime.
|
|
33
|
+
*
|
|
34
|
+
* Declared this way for the reason `verify.d.ts` records: node's cjs-module-lexer does not
|
|
35
|
+
* reliably surface every name on a vendored CommonJS module to an ESM importer, and a named import
|
|
36
|
+
* that type-checks can still throw "does not provide an export named" at load. Taking
|
|
37
|
+
* `module.exports` whole is interop that does not depend on a lexer guessing right about bytes
|
|
38
|
+
* this package is forbidden to edit.
|
|
39
|
+
*/
|
|
40
|
+
declare const core: {
|
|
41
|
+
verifiedExecutionBinding(input: Record<string, unknown>): CoreBindingResult;
|
|
42
|
+
STATE: Record<string, string>;
|
|
43
|
+
AUTHORITY: Record<string, string>;
|
|
44
|
+
PROFILE: Record<string, unknown>;
|
|
45
|
+
PROFILE_NAMES: Record<string, string>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default core;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-receipt-local.d.ts","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-receipt-local.d.ts","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAuBpD,+FAA+F;AAC/F,MAAM,WAAW,mBAAmB;IAChC,+FAA+F;IAC/F,KAAK,EAAE,OAAO,CAAC;IACf,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACtC;;;;;;OAMG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAmCD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,GACnC,mBAAmB,CAarB"}
|
|
@@ -33,10 +33,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
33
33
|
exports.verifyReceipt = verifyReceipt;
|
|
34
34
|
// ── A STATIC IMPORT, AND THAT IS THE POINT ──────────────────────────────────────────────────
|
|
35
35
|
//
|
|
36
|
-
// MEASURED on the built package: `authorize()`
|
|
37
|
-
// `dist/esm/authorize.js` therefore
|
|
38
|
-
// tests never saw it because they load the CJS source
|
|
39
|
-
// compiler in exactly the build where it cannot work.
|
|
36
|
+
// MEASURED on the built package when this module was written: `authorize()` loaded the same core
|
|
37
|
+
// with a bare `require(...)`, and `dist/esm/authorize.js` therefore threw `require is not defined`
|
|
38
|
+
// for every ESM consumer. The tests never saw it because they load the CJS source — a call-time
|
|
39
|
+
// `require` is invisible to the compiler in exactly the build where it cannot work.
|
|
40
|
+
//
|
|
41
|
+
// FIXED SINCE, in authorize.ts, the same way: static imports plus a default import of the vendored
|
|
42
|
+
// core. `test/dual-module-form.test.js` now loads dist/esm and scans it, so the defect is held
|
|
43
|
+
// shut as a class rather than in this one module. Past tense on purpose — a comment that keeps
|
|
44
|
+
// describing a live bug after it is closed sends the next reader looking for it.
|
|
40
45
|
//
|
|
41
46
|
// A static import is compiled to `require` for the CJS output and left as an import for the ESM
|
|
42
47
|
// one, so this module works in both — and the compiler, not a runtime, is what checks it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-receipt-local.js","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;
|
|
1
|
+
{"version":3,"file":"verify-receipt-local.js","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;;;;;AAmGH,sCAgBC;AAhHD,+FAA+F;AAC/F,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,gGAAgG;AAChG,oFAAoF;AACpF,EAAE;AACF,mGAAmG;AACnG,+FAA+F;AAC/F,+FAA+F;AAC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AAG,mBAAI,CAAC,aAAa,CAAC,KAAK,EAAE;QAChC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI,EAAE;QAChE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE,CAAC,CAAC;IACH,OAAO;QACH,KAAK,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI;QACvB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,cAAc,EAAE,CAAC,GAAG,cAAc,CAAC;KACtC,CAAC;AACN,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;
|
|
1
|
+
{"version":3,"file":"authorize.d.ts","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAqCH;;;GAGG;AACH,MAAM,MAAM,kBAAkB,GACxB,0BAA0B;AAC5B,4FAA4F;GAC1F,cAAc;AAChB,4EAA4E;GAC1E,iBAAiB;AACnB,mFAAmF;GACjF,kBAAkB;AACpB,sEAAsE;GACpE,sBAAsB;AACxB;;;;;;GAMG;GACD,+BAA+B;AACjC,iEAAiE;GAC/D,eAAe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AAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QACnC,GAAG,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,oFAAoF;IACpF,WAAW,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;QACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACtB,CAAC;IACF,qGAAqG;IACrG,YAAY,CAAC,EAAE;QACX,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAClC,oBAAoB,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;KACrC,GAAG,IAAI,CAAC;IACT,sFAAsF;IACtF,gBAAgB,CAAC,EAAE;QAAE,MAAM,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC9C,SAAS,EAAE,OAAO,CAAC;IACnB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,aAAa,EAAE,CAAC;CAC9B;AAiBD;;;;;;;;;;;GAWG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,eAAe,CA2DhE;AAED,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAQjE,CAAC"}
|
package/dist/esm/authorize.js
CHANGED
|
@@ -31,6 +31,37 @@
|
|
|
31
31
|
* is an unsigned readback unless you say otherwise, which is what RECORDED_UNWITNESSED names.
|
|
32
32
|
*/
|
|
33
33
|
import { createPublicKey } from 'crypto';
|
|
34
|
+
// ── STATIC IMPORTS, BECAUSE A CALL-TIME `require` BROKE EVERY ESM CONSUMER ──────────────────
|
|
35
|
+
//
|
|
36
|
+
// These two were loaded inside `authorize()` with a bare `require(...)`. MEASURED against the
|
|
37
|
+
// published 3.14.0 tarball, installed into a fresh project and imported from a real `.mjs`:
|
|
38
|
+
//
|
|
39
|
+
// import { authorize } from '@coderifts/sdk'; -> authorize typeof: function
|
|
40
|
+
// authorize({...}) -> ReferenceError: require is not defined
|
|
41
|
+
// in ES module scope, at dist/esm/authorize.js:64
|
|
42
|
+
//
|
|
43
|
+
// So the function IMPORTED and could not be CALLED — which is why it survived: the export existed,
|
|
44
|
+
// the types were right, and nothing failed until an adopter ran it. The suite never saw it either,
|
|
45
|
+
// because the tests load the CJS build, and a call-time `require` is invisible to the compiler in
|
|
46
|
+
// exactly the build where it cannot work.
|
|
47
|
+
//
|
|
48
|
+
// A static import is compiled to `require` in the CJS output and left as an `import` in the ESM
|
|
49
|
+
// one. The module form stops being something a runtime discovers and becomes something `tsc`
|
|
50
|
+
// emits — which is the whole fix. `verify-receipt-local.ts` was already written this way; this is
|
|
51
|
+
// the same treatment applied to the path that still had the defect.
|
|
52
|
+
//
|
|
53
|
+
// The DEFAULT import for the vendored core, and its reasoning is recorded beside it in
|
|
54
|
+
// `verified-execution-binding.d.ts`: named imports out of vendored CommonJS depend on node's
|
|
55
|
+
// cjs-module-lexer surfacing each name, which it does not always do, and the failure lands at load
|
|
56
|
+
// time rather than at compile time.
|
|
57
|
+
//
|
|
58
|
+
// NEITHER LOAD IS CONDITIONAL AND NEITHER WAS LAZY FOR A REASON. Checked before moving them:
|
|
59
|
+
// `execution-attestation.ts` imports only `crypto` and `./leeway.js`, and nothing imports
|
|
60
|
+
// `authorize.ts` except `index.ts` and a TYPE-only import in `verify-receipt-local.ts` — so there
|
|
61
|
+
// is no cycle these `require`s were quietly working around.
|
|
62
|
+
import bindingCore from './vendor/receipt-verifier/verified-execution-binding.js';
|
|
63
|
+
import { verifyExecutionAttestation } from './execution-attestation.js';
|
|
64
|
+
const { verifiedExecutionBinding } = bindingCore;
|
|
34
65
|
function toKeyringMap(keyring) {
|
|
35
66
|
if (!keyring || !Array.isArray(keyring.keys) || keyring.keys.length === 0)
|
|
36
67
|
return null;
|
|
@@ -60,10 +91,6 @@ function toKeyringMap(keyring) {
|
|
|
60
91
|
* if (!r.authorized_and_committed) throw new Error(`${r.state}: ${r.shortfalls.join('; ')}`);
|
|
61
92
|
*/
|
|
62
93
|
export function authorize(input) {
|
|
63
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
64
|
-
const { verifiedExecutionBinding } = require('./vendor/receipt-verifier/verified-execution-binding.js');
|
|
65
|
-
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
66
|
-
const { verifyExecutionAttestation } = require('./execution-attestation.js');
|
|
67
94
|
const g = input.grant || {};
|
|
68
95
|
const att = input.attestation;
|
|
69
96
|
const root = input.evidenceRoot;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"authorize.js","sourceRoot":"","sources":["../../src/authorize.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAC;AAEzC,+FAA+F;AAC/F,EAAE;AACF,8FAA8F;AAC9F,4FAA4F;AAC5F,EAAE;AACF,iFAAiF;AACjF,6FAA6F;AAC7F,sGAAsG;AACtG,EAAE;AACF,mGAAmG;AACnG,mGAAmG;AACnG,kGAAkG;AAClG,0CAA0C;AAC1C,EAAE;AACF,gGAAgG;AAChG,6FAA6F;AAC7F,kGAAkG;AAClG,oEAAoE;AACpE,EAAE;AACF,uFAAuF;AACvF,6FAA6F;AAC7F,mGAAmG;AACnG,oCAAoC;AACpC,EAAE;AACF,6FAA6F;AAC7F,0F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AmB,GAAuC,MAAM,CAAC,MAAM,CAAC;IACjF,wBAAwB,EAAE,0BAA0B;IACpD,YAAY,EAAE,cAAc;IAC5B,eAAe,EAAE,iBAAiB;IAClC,gBAAgB,EAAE,kBAAkB;IACpC,oBAAoB,EAAE,sBAAsB;IAC5C,6BAA6B,EAAE,+BAA+B;IAC9D,aAAa,EAAE,eAAe;CACjC,CAAC,CAAC"}
|
package/dist/esm/decision.d.ts
CHANGED
|
@@ -29,7 +29,8 @@ export declare function hasExplicitExecutionAction(response: unknown): boolean;
|
|
|
29
29
|
* Read a governance decision from ANY CodeRifts response, fail-closed. Resolution order:
|
|
30
30
|
* 1. envelope-first — `response.decision_result.execution_action` (+ receipt);
|
|
31
31
|
* 2. top-level `execution_action` (legacy REST endpoints emit it directly);
|
|
32
|
-
* 3. map a top-level `decision` via the ported deriveExecutionAction table
|
|
32
|
+
* 3. map a top-level `decision` via the ported deriveExecutionAction table — ONLY on an
|
|
33
|
+
* explicit spec-1.0, non-v2 body (see {@link allowLegacyDecisionMap});
|
|
33
34
|
* 4. otherwise fail closed: `{ executionAction: 'STOP', reason: 'UNREADABLE_DECISION' }`.
|
|
34
35
|
* Never throws — a guard can call this on any value (including error bodies / garbage).
|
|
35
36
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAU3F,MAAM,WAAW,kBAAkB;IAC/B,iFAAiF;IACjF,eAAe,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAMrE;
|
|
1
|
+
{"version":3,"file":"decision.d.ts","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAU3F,MAAM,WAAW,kBAAkB;IAC/B,iFAAiF;IACjF,eAAe,EAAE,eAAe,CAAC;IACjC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,sBAAsB,CAAC;IAClC,6DAA6D;IAC7D,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,wDAAwD;IACxD,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAMD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAMrE;AA6BD;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,QAAQ,EAAE,OAAO,GAAG,kBAAkB,CAyClE"}
|
package/dist/esm/decision.js
CHANGED
|
@@ -30,11 +30,39 @@ export function hasExplicitExecutionAction(response) {
|
|
|
30
30
|
return true;
|
|
31
31
|
return isExecutionAction(r.execution_action);
|
|
32
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* v2 body: `decision_result` present, OR `decision_spec_version` starts "2.", OR
|
|
35
|
+
* `preflight_mode` present. Mirrors @coderifts/agent-guard's isV2Response — the two
|
|
36
|
+
* readers must not disagree about what "legacy" means.
|
|
37
|
+
*/
|
|
38
|
+
function isV2Response(r, envObj) {
|
|
39
|
+
if (envObj)
|
|
40
|
+
return true;
|
|
41
|
+
if (r.preflight_mode != null && r.preflight_mode !== '')
|
|
42
|
+
return true;
|
|
43
|
+
const ver = r.decision_spec_version;
|
|
44
|
+
return typeof ver === 'string' && ver.startsWith('2.');
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The legacy `decision` -> action map is allowed ONLY on an explicit spec-1.0 body that is
|
|
48
|
+
* not v2. A MISSING `decision_spec_version` is NOT legacy.
|
|
49
|
+
*
|
|
50
|
+
* 1565/1585, measured: before this gate the bare-legacy arm mapped `{decision:'ALLOW'}` to
|
|
51
|
+
* CONTINUE for EVERY bare shape — a missing action, an unrecognised action, and a spec-2.0
|
|
52
|
+
* body all resolved to permission. An agent branching on the result proceeded on a response
|
|
53
|
+
* that never granted anything. The wrapped shape was already fail-closed; only the bare arm
|
|
54
|
+
* leaked, which is why one measurement called this reader fail-closed and another called it
|
|
55
|
+
* fail-open. Both were right about the shape they fed it.
|
|
56
|
+
*/
|
|
57
|
+
function allowLegacyDecisionMap(r, envObj) {
|
|
58
|
+
return r.decision_spec_version === '1.0' && !isV2Response(r, envObj);
|
|
59
|
+
}
|
|
33
60
|
/**
|
|
34
61
|
* Read a governance decision from ANY CodeRifts response, fail-closed. Resolution order:
|
|
35
62
|
* 1. envelope-first — `response.decision_result.execution_action` (+ receipt);
|
|
36
63
|
* 2. top-level `execution_action` (legacy REST endpoints emit it directly);
|
|
37
|
-
* 3. map a top-level `decision` via the ported deriveExecutionAction table
|
|
64
|
+
* 3. map a top-level `decision` via the ported deriveExecutionAction table — ONLY on an
|
|
65
|
+
* explicit spec-1.0, non-v2 body (see {@link allowLegacyDecisionMap});
|
|
38
66
|
* 4. otherwise fail closed: `{ executionAction: 'STOP', reason: 'UNREADABLE_DECISION' }`.
|
|
39
67
|
* Never throws — a guard can call this on any value (including error bodies / garbage).
|
|
40
68
|
*/
|
|
@@ -61,8 +89,10 @@ export function readDecision(response) {
|
|
|
61
89
|
decision: typeof r.decision === 'string' ? r.decision : null,
|
|
62
90
|
};
|
|
63
91
|
}
|
|
64
|
-
// 3. Legacy decision-only -> mapped action.
|
|
65
|
-
if (typeof r.decision === 'string' &&
|
|
92
|
+
// 3. Legacy decision-only -> mapped action. Gated: explicit spec 1.0, non-v2 only.
|
|
93
|
+
if (typeof r.decision === 'string' &&
|
|
94
|
+
Object.prototype.hasOwnProperty.call(EXECUTION_ACTION, r.decision) &&
|
|
95
|
+
allowLegacyDecisionMap(r, (env && typeof env === 'object' ? env : null))) {
|
|
66
96
|
return { executionAction: EXECUTION_ACTION[r.decision], decision: r.decision };
|
|
67
97
|
}
|
|
68
98
|
// 4. Fail closed.
|
package/dist/esm/decision.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,0FAA0F;AAC1F,MAAM,gBAAgB,GAAoC;IACtD,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,0BAA0B;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,KAAK,EAAE,MAAM;CAChB,CAAC;AAeF,SAAS,iBAAiB,CAAC,CAAU;IACjC,OAAO,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,0BAA0B,IAAI,CAAC,KAAK,kBAAkB,IAAI,CAAC,KAAK,MAAM,CAAC;AAC5G,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAiB;IACxD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5D,MAAM,CAAC,GAAG,QAAmC,CAAC;IAC9C,MAAM,GAAG,GAAG,CAAC,CAAC,eAAsD,CAAC;IACrE,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,iBAAiB,CAAC,GAAG,CAAC,gBAAgB,CAAC;QAAE,OAAO,IAAI,CAAC;IAC3F,OAAO,iBAAiB,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC;AACjD,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"decision.js","sourceRoot":"","sources":["../../src/decision.ts"],"names":[],"mapp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AS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,QAAQ,CAAC;QAClE,sBAAsB,CAAC,CAAC,EAAE,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,EAC1E,CAAC;QACC,OAAO,EAAE,eAAe,EAAE,gBAAgB,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnF,CAAC;IAED,kBAAkB;IAClB,OAAO;QACH,eAAe,EAAE,MAAM;QACvB,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;QAC5D,MAAM,EAAE,qBAAqB;KAChC,CAAC;AACN,CAAC"}
|
|
@@ -17,7 +17,7 @@
|
|
|
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.
|
|
20
|
+
# The shared verification core here comes from receipt-verifier **v1.0.2**, peeled commit
|
|
21
21
|
# 51a8224439959a5b46c0b09e9a2cd67117f05d56.
|
|
22
22
|
#
|
|
23
23
|
# It was pinned to a WORKING TREE and to per-file commits. Both are honest about where the bytes
|
|
@@ -29,7 +29,33 @@
|
|
|
29
29
|
# The hash lines below are UNCHANGED by the re-pin. Where a file already matched the tag this is
|
|
30
30
|
# prose only; where it did not, it was re-copied from the tag and that is recorded below.
|
|
31
31
|
#
|
|
32
|
-
#
|
|
32
|
+
#
|
|
33
|
+
# ── AND THE TAG IS SIGNED, WHICH IS THE PART A STRANGER CAN CHECK ───────────────────────────
|
|
34
|
+
#
|
|
35
|
+
# v1.0.0 was an unsigned tag: a name anyone can check out, and also a name anyone with push access
|
|
36
|
+
# can move. v1.0.1 is annotated and SSH-signed, so the pin now resolves to an identity and not
|
|
37
|
+
# only to bytes.
|
|
38
|
+
#
|
|
39
|
+
# tag object 99567ea1c88b9b6e348118eeacd03592e3f1075f
|
|
40
|
+
# peeled commit ac683b16c19662c9124c8cdab785223b28d2d0c6
|
|
41
|
+
# signer zsobpeter@gmail.com
|
|
42
|
+
# fingerprint SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
43
|
+
#
|
|
44
|
+
# Verify it yourself, in a checkout of receipt-verifier:
|
|
45
|
+
#
|
|
46
|
+
# git tag -v v1.0.2
|
|
47
|
+
# -> Good "git" signature for zsobpeter@gmail.com with ED25519 key SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
48
|
+
#
|
|
49
|
+
# WHY v1.0.2 AND NOT v1.0.1: the CORE IS BYTE-IDENTICAL between them — every hash line
|
|
50
|
+
# below is unchanged, and this re-pin moves none of them. v1.0.2 adds two things to the
|
|
51
|
+
# RELEASE: RECEIPT_FORMAT.md section 14 (the authority model) is in the tagged tree, and
|
|
52
|
+
# verification/allowed_signers ships in the repo so `git tag -v` names a principal on a
|
|
53
|
+
# machine that has never seen this project. A doc committed after a tag is not in that
|
|
54
|
+
# release, however committed it is — which is why the tag moved rather than the bytes.
|
|
55
|
+
#
|
|
56
|
+
# The peeled commit is UNCHANGED from v1.0.0 — the core is byte-identical and this re-pin moves no
|
|
57
|
+
# hash line. What it adds is who stands behind the bytes.
|
|
58
|
+
# source_commit: ac683b16c19662c9124c8cdab785223b28d2d0c6 (receipt-verifier v1.0.2, signed)
|
|
33
59
|
#
|
|
34
60
|
|
|
35
61
|
721fcac58b960b5e2aa1af91edb6cfc87ebe828a6da73879967ef79a1ca474e8 arity.js
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the vendored `verified-execution-binding.js`, written HERE rather than in it.
|
|
3
|
+
*
|
|
4
|
+
* The same rule as `verify.d.ts` beside it: the vendored bytes stay byte-identical to
|
|
5
|
+
* receipt-verifier's, because a pin that survives an edit is not a pin. The declaration lives
|
|
6
|
+
* alongside, and `VENDOR.sha256` covers the .js only — that is deliberate, since this file is
|
|
7
|
+
* ours and the .js is theirs.
|
|
8
|
+
*
|
|
9
|
+
* ── WHY THIS FILE EXISTS AT ALL ─────────────────────────────────────────────────────────────
|
|
10
|
+
*
|
|
11
|
+
* `authorize()` loaded the core with a call-time `require(...)`, which needs no declaration and
|
|
12
|
+
* therefore never needed one — and which MEASURED as `ReferenceError: require is not defined` in
|
|
13
|
+
* `dist/esm/authorize.js` for every ESM consumer of the published package. Replacing it with a
|
|
14
|
+
* static import is what makes the compiler responsible for the module form, and a static import
|
|
15
|
+
* needs types. So this file is the cost of moving the check from a consumer's runtime to our
|
|
16
|
+
* build.
|
|
17
|
+
*
|
|
18
|
+
* Only what `authorize()` actually calls is declared. Declaring the rest would invite callers to
|
|
19
|
+
* reach into the core through this package; the core is vendored for internal use, not re-exported
|
|
20
|
+
* as an API this SDK then owns.
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
/** The core's own result shape. Kept loose: this SDK maps it, it does not redefine it. */
|
|
24
|
+
export interface CoreBindingResult {
|
|
25
|
+
state: string;
|
|
26
|
+
authorized_and_committed: boolean;
|
|
27
|
+
shortfalls: string[];
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The DEFAULT export — `module.exports` whole, destructured at runtime.
|
|
33
|
+
*
|
|
34
|
+
* Declared this way for the reason `verify.d.ts` records: node's cjs-module-lexer does not
|
|
35
|
+
* reliably surface every name on a vendored CommonJS module to an ESM importer, and a named import
|
|
36
|
+
* that type-checks can still throw "does not provide an export named" at load. Taking
|
|
37
|
+
* `module.exports` whole is interop that does not depend on a lexer guessing right about bytes
|
|
38
|
+
* this package is forbidden to edit.
|
|
39
|
+
*/
|
|
40
|
+
declare const core: {
|
|
41
|
+
verifiedExecutionBinding(input: Record<string, unknown>): CoreBindingResult;
|
|
42
|
+
STATE: Record<string, string>;
|
|
43
|
+
AUTHORITY: Record<string, string>;
|
|
44
|
+
PROFILE: Record<string, unknown>;
|
|
45
|
+
PROFILE_NAMES: Record<string, string>;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default core;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-receipt-local.d.ts","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"verify-receipt-local.d.ts","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAuBpD,+FAA+F;AAC/F,MAAM,WAAW,mBAAmB;IAChC,+FAA+F;IAC/F,KAAK,EAAE,OAAO,CAAC;IACf,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC;;;;OAIG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,yBAAyB;IACtC;;;;;;OAMG;IACH,OAAO,EAAE,aAAa,CAAC;IACvB,yFAAyF;IACzF,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gDAAgD;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAmCD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CACzB,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,yBAAyB,GACnC,mBAAmB,CAarB"}
|
|
@@ -27,10 +27,15 @@
|
|
|
27
27
|
*/
|
|
28
28
|
// ── A STATIC IMPORT, AND THAT IS THE POINT ──────────────────────────────────────────────────
|
|
29
29
|
//
|
|
30
|
-
// MEASURED on the built package: `authorize()`
|
|
31
|
-
// `dist/esm/authorize.js` therefore
|
|
32
|
-
// tests never saw it because they load the CJS source
|
|
33
|
-
// compiler in exactly the build where it cannot work.
|
|
30
|
+
// MEASURED on the built package when this module was written: `authorize()` loaded the same core
|
|
31
|
+
// with a bare `require(...)`, and `dist/esm/authorize.js` therefore threw `require is not defined`
|
|
32
|
+
// for every ESM consumer. The tests never saw it because they load the CJS source — a call-time
|
|
33
|
+
// `require` is invisible to the compiler in exactly the build where it cannot work.
|
|
34
|
+
//
|
|
35
|
+
// FIXED SINCE, in authorize.ts, the same way: static imports plus a default import of the vendored
|
|
36
|
+
// core. `test/dual-module-form.test.js` now loads dist/esm and scans it, so the defect is held
|
|
37
|
+
// shut as a class rather than in this one module. Past tense on purpose — a comment that keeps
|
|
38
|
+
// describing a live bug after it is closed sends the next reader looking for it.
|
|
34
39
|
//
|
|
35
40
|
// A static import is compiled to `require` for the CJS output and left as an import for the ESM
|
|
36
41
|
// one, so this module works in both — and the compiler, not a runtime, is what checks it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify-receipt-local.js","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,+FAA+F;AAC/F,EAAE;AACF,mGAAmG;AACnG,gGAAgG;AAChG,
|
|
1
|
+
{"version":3,"file":"verify-receipt-local.js","sourceRoot":"","sources":["../../src/verify-receipt-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAGH,+FAA+F;AAC/F,EAAE;AACF,iGAAiG;AACjG,mGAAmG;AACnG,gGAAgG;AAChG,oFAA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AAM,IAAI,GAAG,YAAY,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IACtD,MAAM,CAAC,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE;QAChC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,IAAI,EAAE;QAChE,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KAChE,CAAC,CAAC;IACH,OAAO;QACH,KAAK,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI;QACvB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACzC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5C,cAAc,EAAE,CAAC,GAAG,cAAc,CAAC;KACtC,CAAC;AACN,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderifts/sdk",
|
|
3
|
-
"version": "3.14.
|
|
4
|
-
"description": "Agent Governance SDK
|
|
3
|
+
"version": "3.14.2",
|
|
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",
|
|
7
7
|
"types": "./dist/cjs/index.d.ts",
|
|
@@ -33,7 +33,8 @@
|
|
|
33
33
|
"test": "npm run test:types && node --test --test-concurrency=1 test/*.test.js",
|
|
34
34
|
"prepublishOnly": "npm run build && npm test",
|
|
35
35
|
"check:packed": "node scripts/check-packed-install.js",
|
|
36
|
-
"build:vendor": "node scripts/copy-vendor.mjs"
|
|
36
|
+
"build:vendor": "node scripts/copy-vendor.mjs",
|
|
37
|
+
"prepack": "node scripts/stamp-doc-version.mjs"
|
|
37
38
|
},
|
|
38
39
|
"keywords": [
|
|
39
40
|
"coderifts",
|