@wrongstack/governance 0.317.0 → 0.317.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.
@@ -45,6 +45,7 @@ export interface GovernanceEvidenceCandidate {
45
45
  readonly state: 'incomplete';
46
46
  readonly missing: readonly GovernanceEvidenceCandidateMissingBinding[];
47
47
  };
48
+ readonly trace: GovernanceEvidenceTraceSnapshot;
48
49
  readonly tool: {
49
50
  readonly callId: string | null;
50
51
  readonly name: string;
package/dist/index.js CHANGED
@@ -1211,7 +1211,7 @@ async function connectGovernanceProjectClient(options) {
1211
1211
 
1212
1212
  // src/sanitize.ts
1213
1213
  function sanitizeGovernanceMessage(message) {
1214
- return message.replace(/wsg_\S{1,700}/gu, "[credential]").slice(0, 512);
1214
+ return message.replace(/wsg_[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*/gu, "[credential]").slice(0, 512);
1215
1215
  }
1216
1216
 
1217
1217
  // src/credential-lease-controller.ts
@@ -2143,6 +2143,7 @@ function validateTaskContractV1(contract) {
2143
2143
  }
2144
2144
  }
2145
2145
  for (const check of contract.requiredChecks) {
2146
+ addRequiredStringIssue(issues, check.id, "requiredChecks[].id");
2146
2147
  for (const requirementId of check.requirementIds) {
2147
2148
  if (!requirementIds.has(requirementId)) {
2148
2149
  issues.push({
@@ -2153,6 +2154,14 @@ function validateTaskContractV1(contract) {
2153
2154
  }
2154
2155
  }
2155
2156
  }
2157
+ for (const assumption of contract.assumptions) {
2158
+ addRequiredStringIssue(issues, assumption.id, "assumptions[].id");
2159
+ addRequiredStringIssue(
2160
+ issues,
2161
+ assumption.statement,
2162
+ `assumptions[${assumption.id}].statement`
2163
+ );
2164
+ }
2156
2165
  if (hasMutatingOperation(contract.autonomy.allowedOperations) && contract.autonomy.allowedPaths.length === 0) {
2157
2166
  issues.push({
2158
2167
  code: "path_scope_missing",
@@ -2247,6 +2256,12 @@ function pathMatchesPattern(value, pattern) {
2247
2256
  const prefix = normalizedPattern.slice(0, -3);
2248
2257
  return path6 === prefix || path6.startsWith(`${prefix}/`);
2249
2258
  }
2259
+ if (normalizedPattern.endsWith("/*")) {
2260
+ const prefix = normalizedPattern.slice(0, -2);
2261
+ if (!path6.startsWith(`${prefix}/`)) return false;
2262
+ const remainder = path6.slice(prefix.length + 1);
2263
+ return remainder.length > 0 && !remainder.includes("/");
2264
+ }
2250
2265
  return path6 === normalizedPattern;
2251
2266
  }
2252
2267
  function pathIsAllowed(contract, value) {
@@ -3045,6 +3060,7 @@ function createGovernanceEvidenceCandidate(trace, outcome) {
3045
3060
  status: "unverified",
3046
3061
  candidateId: missing.length === 0 && toolCallId ? candidateIdentity(trace, { ...outcome, toolCallId }) : null,
3047
3062
  binding,
3063
+ trace,
3048
3064
  tool: Object.freeze({ callId: toolCallId ?? null, name: outcome.toolName }),
3049
3065
  outcome: Object.freeze({
3050
3066
  status: outcome.ok ? "succeeded" : "failed",
@@ -489,7 +489,7 @@ async function acquireGovernanceDaemonStartupLease(options) {
489
489
 
490
490
  // src/sanitize.ts
491
491
  function sanitizeGovernanceMessage(message) {
492
- return message.replace(/wsg_\S{1,700}/gu, "[credential]").slice(0, 512);
492
+ return message.replace(/wsg_[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]+)*/gu, "[credential]").slice(0, 512);
493
493
  }
494
494
 
495
495
  // src/attachment-broker-controller.ts
@@ -1212,6 +1212,7 @@ function validateTaskContractV1(contract) {
1212
1212
  }
1213
1213
  }
1214
1214
  for (const check of contract.requiredChecks) {
1215
+ addRequiredStringIssue(issues, check.id, "requiredChecks[].id");
1215
1216
  for (const requirementId of check.requirementIds) {
1216
1217
  if (!requirementIds.has(requirementId)) {
1217
1218
  issues.push({
@@ -1222,6 +1223,14 @@ function validateTaskContractV1(contract) {
1222
1223
  }
1223
1224
  }
1224
1225
  }
1226
+ for (const assumption of contract.assumptions) {
1227
+ addRequiredStringIssue(issues, assumption.id, "assumptions[].id");
1228
+ addRequiredStringIssue(
1229
+ issues,
1230
+ assumption.statement,
1231
+ `assumptions[${assumption.id}].statement`
1232
+ );
1233
+ }
1225
1234
  if (hasMutatingOperation(contract.autonomy.allowedOperations) && contract.autonomy.allowedPaths.length === 0) {
1226
1235
  issues.push({
1227
1236
  code: "path_scope_missing",
@@ -1316,6 +1325,12 @@ function pathMatchesPattern(value, pattern) {
1316
1325
  const prefix = normalizedPattern.slice(0, -3);
1317
1326
  return path5 === prefix || path5.startsWith(`${prefix}/`);
1318
1327
  }
1328
+ if (normalizedPattern.endsWith("/*")) {
1329
+ const prefix = normalizedPattern.slice(0, -2);
1330
+ if (!path5.startsWith(`${prefix}/`)) return false;
1331
+ const remainder = path5.slice(prefix.length + 1);
1332
+ return remainder.length > 0 && !remainder.includes("/");
1333
+ }
1319
1334
  return path5 === normalizedPattern;
1320
1335
  }
1321
1336
  function pathIsAllowed(contract, value) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/governance",
3
- "version": "0.317.0",
3
+ "version": "0.317.2",
4
4
  "license": "MIT",
5
5
  "description": "Deterministic workflow contracts and transition policy for WrongStack orchestration.",
6
6
  "repository": {
@@ -27,7 +27,7 @@
27
27
  "README.md"
28
28
  ],
29
29
  "dependencies": {
30
- "@wrongstack/persistence": "0.317.0"
30
+ "@wrongstack/persistence": "0.317.2"
31
31
  },
32
32
  "devDependencies": {
33
33
  "@types/node": "^26.2.0",