calmlens 0.18.2 → 0.18.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b4f99dcd969ce76160d706032300d1a1a7c0387e57f7cf87b48c44be060bcc7
4
- data.tar.gz: 3616af1b33e0c8da7b3dca72aa9a737e413160be42962f58220c918ea8896315
3
+ metadata.gz: 3c938e439d92c33cdb3117354d680f702856acd600a262b41e221913effd2af9
4
+ data.tar.gz: a5b8999981f5fa0f5586f6eeaad4f2293011a25673f985622d70a2b7c6e48afd
5
5
  SHA512:
6
- metadata.gz: 291ccbb5dd86660f0c74867987ceb2f703fdcce5d9eb088ef064761933da68106ab965298adb7978463f7cea158b2e9c4c7e1a0d55e89c27d330ded225c7d76e
7
- data.tar.gz: 04a08273729d5859d3a542938edcf3ac0fbac78b6125ef67033a37156339576d61dc11bfb43341ca308fd80a2bff3e4dadf4e70841ebb2f7aaa5ece4f5c5b823
6
+ metadata.gz: cccc112f1003066fcbb1faa9e7fbcb729be199e70cb8869b632b3f6f50ce71ce67163baf61f88cdbde14f0cfc4c718dd7852a730dc77559c8904c81fecbefeb6
7
+ data.tar.gz: 1d74c52c7ba36c8a7db31d6647579c698fe27f573a7662bc26108fb2864d647b6ee9453419aa802ef0f3da6f3867b0df563c42b7900e2b672f219d2c257104e9
@@ -2,5 +2,5 @@
2
2
 
3
3
  module CalmLens
4
4
  # The gem version. The gemspec and the User-Agent header read it from here.
5
- VERSION = '0.18.2'
5
+ VERSION = '0.18.3'
6
6
  end
data/sig/types.rbs CHANGED
@@ -139,6 +139,8 @@ module CalmLens
139
139
  ?"personDetection" => person_detection_result,
140
140
  ?"faceDetection" => face_detection_result,
141
141
  ?"linkDetection" => link_detection_result,
142
+ # Preview. Where the asset's links lead; present when the project's policy acts on links.
143
+ ?"linkSafety" => link_safety_result,
142
144
  ?"aiGeneratedDetection" => ai_generated_detection_result,
143
145
  # Where OCR found text, and personal information within it; redaction transforms blur these regions.
144
146
  ?"textRegions" => Array[text_region],
@@ -165,6 +167,9 @@ module CalmLens
165
167
  "flaggedCategories" => Array[String], "regions" => Array[regional_decision],
166
168
  ?"explanationComplete" => bool,
167
169
  ?"categories" => Hash[String, category_policy_score],
170
+ # Preview. What the policy's link-safety section made of the asset's links; absent when the
171
+ # policy doesn't act on links.
172
+ ?"linkSafety" => link_safety_decision,
168
173
  ?"raw" => moderation_raw
169
174
  }
170
175
  # ASSET_CONTENT_SCHEMA. `format` is the MIME type.
@@ -300,6 +305,59 @@ module CalmLens
300
305
  ?"links" => Array[detected_link],
301
306
  ?"reason" => not_evaluated_reason
302
307
  }
308
+ # Link safety (preview, LinkSafety.ts).
309
+ # What a link's destination is: `safe` when every reputation check passed, `adult` or `gambling`
310
+ # from its domain's content categories, `phishing` or `malware` from a threat list or the domain's
311
+ # security risks, and `unresolved` when a short link could not be followed or a check failed.
312
+ type link_safety_verdict = "safe" | "adult" | "gambling" | "phishing" | "malware" | "unresolved"
313
+ # The verdicts a policy can act on.
314
+ type flagged_link_verdict = "phishing" | "malware" | "adult" | "gambling" | "unresolved"
315
+ # What a link does to its asset, weakest first. Purging content over a link is never offered.
316
+ type link_safety_action = "allow" | "limit" | "age-restrict" | "block"
317
+ # One reputation check of a link's destination: its domain's categories, or a threat-list lookup
318
+ # of the destination URL. `failed` makes the link `unresolved`; `labels` is what the check reported.
319
+ type link_safety_evidence = {
320
+ "check" => "domain-categories" | "threat-lists",
321
+ "status" => "checked" | "failed",
322
+ "labels" => Array[String]
323
+ }
324
+ # A link in the asset and what its destination is. `finalUrl` is where it leads after `redirects`
325
+ # redirects, or `null` when a short link could not be followed.
326
+ type checked_link = {
327
+ "url" => String,
328
+ "finalUrl" => String?,
329
+ "redirects" => Integer,
330
+ "source" => "qr-code" | "text",
331
+ "verdict" => link_safety_verdict,
332
+ "evidence" => Array[link_safety_evidence]
333
+ }
334
+ # Preview. `status: "evaluated"` carries `links`; `"not-evaluated"` carries `reason`.
335
+ type link_safety_result = {
336
+ "status" => "evaluated" | "not-evaluated",
337
+ "stage" => processing_feature_stage,
338
+ ?"links" => Array[checked_link],
339
+ ?"reason" => not_evaluated_reason
340
+ }
341
+ # Preview. LINK_SAFETY_SETTINGS_SCHEMA: the action for an asset with a link of each verdict (a
342
+ # verdict left out is allowed), and optionally an action for every link whose destination is
343
+ # outside `allowedDomains` (bare lowercase domains, which also cover their subdomains).
344
+ type link_safety_settings = {
345
+ "verdictActions" => {
346
+ ?"phishing" => link_safety_action,
347
+ ?"malware" => link_safety_action,
348
+ ?"adult" => link_safety_action,
349
+ ?"gambling" => link_safety_action,
350
+ ?"unresolved" => link_safety_action
351
+ },
352
+ ?"offPlatformLinks" => { "action" => "limit" | "age-restrict" | "block", "allowedDomains" => Array[String] }
353
+ }
354
+ # Preview. The strongest action the asset's links take, the indexes into
355
+ # `classification.linkSafety.links` of the links that take it, and the settings in force.
356
+ type link_safety_decision = {
357
+ "action" => link_safety_action,
358
+ "links" => Array[Integer],
359
+ "settings" => link_safety_settings
360
+ }
303
361
  type provenance_signal = { "kind" => "c2pa" | "iptc-digital-source-type" | "generator-metadata", "value" => String }
304
362
  # `status: "evaluated"` carries `provenance` and `signals`; `"not-evaluated"` carries `reason`.
305
363
  type ai_generated_detection_result = {
@@ -317,6 +375,7 @@ module CalmLens
317
375
  ?"personDetection" => person_detection_result,
318
376
  ?"faceDetection" => face_detection_result,
319
377
  ?"linkDetection" => link_detection_result,
378
+ ?"linkSafety" => link_safety_result,
320
379
  ?"aiGeneratedDetection" => ai_generated_detection_result
321
380
  }
322
381
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: calmlens
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.2
4
+ version: 0.18.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - CalmLens