@coderifts/sdk 3.14.1 → 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/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 +12 -5
- 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 +12 -5
- package/package.json +1 -1
package/README.md
CHANGED
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,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,SAAgB,0BAA0B,CAAC,QAAiB;IACxD,IAAI,CAAC,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC5D,MAAM,CAAC,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AAC,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
|
|
@@ -36,19 +36,26 @@
|
|
|
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
|
|
40
|
-
# peeled commit
|
|
39
|
+
# tag object 99567ea1c88b9b6e348118eeacd03592e3f1075f
|
|
40
|
+
# peeled commit ac683b16c19662c9124c8cdab785223b28d2d0c6
|
|
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.
|
|
46
|
+
# git tag -v v1.0.2
|
|
47
47
|
# -> Good "git" signature for zsobpeter@gmail.com with ED25519 key SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
48
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
|
+
#
|
|
49
56
|
# The peeled commit is UNCHANGED from v1.0.0 — the core is byte-identical and this re-pin moves no
|
|
50
57
|
# hash line. What it adds is who stands behind the bytes.
|
|
51
|
-
# source_commit:
|
|
58
|
+
# source_commit: ac683b16c19662c9124c8cdab785223b28d2d0c6 (receipt-verifier v1.0.2, signed)
|
|
52
59
|
#
|
|
53
60
|
|
|
54
61
|
721fcac58b960b5e2aa1af91edb6cfc87ebe828a6da73879967ef79a1ca474e8 arity.js
|
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;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CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI;SAC/D,CAAC;IACN,CAAC;IAED,mFAAmF;IACnF,IACI,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ;QAC9B,MAAM,CAAC,SAAS,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
|
|
@@ -36,19 +36,26 @@
|
|
|
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
|
|
40
|
-
# peeled commit
|
|
39
|
+
# tag object 99567ea1c88b9b6e348118eeacd03592e3f1075f
|
|
40
|
+
# peeled commit ac683b16c19662c9124c8cdab785223b28d2d0c6
|
|
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.
|
|
46
|
+
# git tag -v v1.0.2
|
|
47
47
|
# -> Good "git" signature for zsobpeter@gmail.com with ED25519 key SHA256:7yRXTm9zKGicfFpzL+7lpwFoPaoSwxAJlabB3jwxw2Y
|
|
48
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
|
+
#
|
|
49
56
|
# The peeled commit is UNCHANGED from v1.0.0 — the core is byte-identical and this re-pin moves no
|
|
50
57
|
# hash line. What it adds is who stands behind the bytes.
|
|
51
|
-
# source_commit:
|
|
58
|
+
# source_commit: ac683b16c19662c9124c8cdab785223b28d2d0c6 (receipt-verifier v1.0.2, signed)
|
|
52
59
|
#
|
|
53
60
|
|
|
54
61
|
721fcac58b960b5e2aa1af91edb6cfc87ebe828a6da73879967ef79a1ca474e8 arity.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coderifts/sdk",
|
|
3
|
-
"version": "3.14.
|
|
3
|
+
"version": "3.14.2",
|
|
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",
|