@codacy/verity-cli 0.34.3 → 0.35.0-experimental.16e0448

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.
@@ -306,334 +306,8 @@ owasp_mapping:
306
306
  description: "Server-side request forgery"
307
307
 
308
308
  # =============================================================================
309
- # 6. Tool Recommendations by Language
310
- # Adapter IDs match @codacy/analysis-cli (from CODACY-ANALYSIS-CLI.md)
309
+ # 6. Static analysis
310
+ # Trivy only, configured and run by Verity itself (.verity/static-analysis.json).
311
+ # The per-language tool matrices, analysis modes and curated pattern ids that
312
+ # used to live here were removed with the other tools (spec/INIT-ONBOARDING-PLAN.md DC7).
311
313
  # =============================================================================
312
-
313
- tool_recommendations:
314
- typescript:
315
- lightweight: [Trivy]
316
- balanced: [ESLint9, Semgrep, Trivy]
317
- thorough: [ESLint9, Semgrep, Trivy, Lizard]
318
-
319
- javascript:
320
- lightweight: [Trivy]
321
- balanced: [ESLint9, Semgrep, Trivy]
322
- thorough: [ESLint9, Semgrep, Trivy, Lizard]
323
-
324
- python:
325
- lightweight: [Trivy]
326
- balanced: [Ruff, Semgrep, Trivy]
327
- thorough: [Ruff, Semgrep, Bandit, Trivy, Lizard]
328
-
329
- go:
330
- lightweight: [Trivy]
331
- balanced: [Semgrep, Trivy]
332
- thorough: [Semgrep, Trivy, Lizard]
333
-
334
- java:
335
- lightweight: [Trivy]
336
- balanced: [PMD7, Semgrep, Trivy]
337
- thorough: [PMD7, Checkstyle, Semgrep, Trivy, Lizard]
338
-
339
- kotlin:
340
- lightweight: [Trivy]
341
- balanced: [detekt, Semgrep, Trivy]
342
- thorough: [detekt, Semgrep, Trivy]
343
-
344
- ruby:
345
- lightweight: [Trivy]
346
- balanced: [Semgrep, Trivy]
347
- thorough: [Semgrep, Trivy, Lizard]
348
-
349
- rust:
350
- lightweight: [Trivy]
351
- balanced: [Semgrep, Trivy]
352
- thorough: [Semgrep, Trivy]
353
-
354
- c:
355
- lightweight: [Trivy]
356
- balanced: [cppcheck, Semgrep, Trivy]
357
- thorough: [cppcheck, flawfinder, Semgrep, Trivy, Lizard]
358
-
359
- cpp:
360
- lightweight: [Trivy]
361
- balanced: [cppcheck, Semgrep, Trivy]
362
- thorough: [cppcheck, flawfinder, Semgrep, Trivy, Lizard]
363
-
364
- shell:
365
- lightweight: []
366
- balanced: [shellcheck]
367
- thorough: [shellcheck]
368
-
369
- dockerfile:
370
- lightweight: [Trivy]
371
- balanced: [Hadolint, Trivy]
372
- thorough: [Hadolint, Trivy]
373
-
374
- # =============================================================================
375
- # 7. Analysis Modes
376
- # =============================================================================
377
-
378
- analysis_modes:
379
- lightweight:
380
- description: "Critical security only. Fastest (~3s)."
381
- tools: "Trivy only"
382
- patterns: "Critical security patterns"
383
-
384
- balanced:
385
- description: "Security + key quality. Good balance (~8s)."
386
- tools: "Trivy + 1-2 language-specific tools"
387
- patterns: "Curated high-signal patterns only (see curated_patterns below)"
388
-
389
- thorough:
390
- description: "All tools, all rules. Most comprehensive (~15s)."
391
- tools: "All applicable tools"
392
- patterns: "Curated patterns + tool defaults for secondary tools"
393
-
394
- # =============================================================================
395
- # 8. Curated Patterns Per Tool
396
- # IMPORTANT: patterns: [] means ALL defaults (thousands of rules, massive
397
- # token consumption and slow runs). Always use these curated lists instead.
398
- #
399
- # PATTERN ID FORMAT — get this wrong and the tool fails SILENTLY.
400
- # Every ID is `<toolId>_<ruleId>`, with `/` replaced by `_`:
401
- # no-eval → ESLint9_no-eval
402
- # @typescript-eslint/no-explicit-any → ESLint9_@typescript-eslint_no-explicit-any
403
- # F401 → Ruff_F401
404
- # SC2086 → shellcheck_SC2086
405
- # An unrecognised ID is not an error. The adapter builds `enabledPatterns` from
406
- # the config, matches nothing, and reports 0 issues — identical to clean code.
407
- # Perversely, `patterns: []` (size 0) means "all defaults" and DOES work, so a
408
- # wrong list is strictly worse than no list.
409
- #
410
- # ALWAYS run `node validate-patterns.mjs` after writing codacy.config.json.
411
- # Never hand-author an ID; derive it from the installed adapter metadata.
412
- # =============================================================================
413
-
414
- curated_patterns:
415
-
416
- # --- ESLint9 (2900+ available → ~25 high-signal) ---
417
- ESLint9:
418
- description: "Security + error-prone + TypeScript strictness. Skips style/formatting."
419
- patterns:
420
- # Security (MUST have)
421
- - patternId: "ESLint9_no-eval"
422
- - patternId: "ESLint9_no-implied-eval"
423
- - patternId: "ESLint9_no-new-func"
424
- - patternId: "ESLint9_no-script-url"
425
- # Error-prone (high value)
426
- - patternId: "ESLint9_no-unused-vars"
427
- - patternId: "ESLint9_no-undef"
428
- - patternId: "ESLint9_no-unreachable"
429
- - patternId: "ESLint9_no-constant-condition"
430
- - patternId: "ESLint9_no-dupe-keys"
431
- - patternId: "ESLint9_no-duplicate-case"
432
- - patternId: "ESLint9_no-fallthrough"
433
- - patternId: "ESLint9_no-self-assign"
434
- - patternId: "ESLint9_no-self-compare"
435
- - patternId: "ESLint9_use-isnan"
436
- - patternId: "ESLint9_valid-typeof"
437
- - patternId: "ESLint9_no-loss-of-precision"
438
- - patternId: "ESLint9_no-unsafe-optional-chaining"
439
- # TypeScript (if applicable)
440
- - patternId: "ESLint9_@typescript-eslint_no-explicit-any"
441
- - patternId: "ESLint9_@typescript-eslint_no-unused-vars"
442
- - patternId: "ESLint9_@typescript-eslint_no-unsafe-assignment"
443
- - patternId: "ESLint9_@typescript-eslint_no-unsafe-call"
444
- - patternId: "ESLint9_@typescript-eslint_no-unsafe-return"
445
- # Best practice
446
- - patternId: "ESLint9_eqeqeq"
447
- - patternId: "ESLint9_no-var"
448
- - patternId: "ESLint9_prefer-const"
449
-
450
- # --- Semgrep / Opengrep (2523 available) — PATTERN LIST NOT YET DERIVED ---
451
- #
452
- # DO NOT emit a Semgrep block into codacy.config.json until the IDs below are
453
- # derived and `validate-patterns.mjs` passes. The 17 IDs previously listed here
454
- # were invented and matched nothing, so Semgrep silently reported zero findings.
455
- #
456
- # Real IDs repeat the trailing segment and carry the tool prefix, e.g.
457
- # Semgrep_javascript.jsonwebtoken.security.jwt-hardcode.hardcoded-jwt-secret
458
- # Semgrep_generic.secrets.security.detected-artifactory-token.detected-artifactory-token
459
- # Derive them from the installed adapter, never by hand:
460
- # node -e "const fs=require('fs');const d=process.env.CODACY_TOOLS_DIR+'/tools-opengrep-1/dist';\
461
- # let b='';for(const f of fs.readdirSync(d))if(f.endsWith('.js'))b+=fs.readFileSync(d+'/'+f,'utf8');\
462
- # console.log([...new Set(b.match(/Semgrep_[A-Za-z0-9_.-]+/g))].sort().join('\n'))"
463
- #
464
- # Also note Semgrep needs the Opengrep binary, which `--install-dependencies`
465
- # does NOT fetch: curl -fsSL https://raw.githubusercontent.com/opengrep/opengrep/main/install.sh | bash
466
- #
467
- # Categories to cover when curating (counts of real candidates in parentheses):
468
- # SQL injection, JS/TS (8) · XSS / unsafe HTML (15) · generic secrets (49)
469
- # hardcoded JWT secret (4) · Python deserialization / pickle (6)
470
- # NOTE: no rule matches "command-injection" for JavaScript — the old entry was fiction.
471
- Semgrep:
472
- description: "Security-only: injection, XSS, secrets, auth. No style rules."
473
- status: unverified # omit from generated config until derived + validated
474
- patterns: [] # intentionally empty — see note above, do NOT copy into config
475
-
476
- # --- Trivy — DERIVED, NOT HAND-MAINTAINED ---
477
- #
478
- # Trivy's catalogue is a fixed set of 6 umbrella patterns, so the config block is
479
- # GENERATED from adapter metadata rather than copied from here. The list below is
480
- # a cached snapshot for reading convenience only; the generator must emit it:
481
- #
482
- # node validate-patterns.mjs --emit Trivy \
483
- # '^Trivy_(secret|malicious_packages|vulnerability_(critical|high))$'
484
- #
485
- # If this snapshot ever disagrees with `--list Trivy`, the adapter wins — the
486
- # snapshot is stale and should be regenerated. Severity is fixed per pattern, so
487
- # severity filtering IS pattern selection. There is NO misconfig/config or license
488
- # pattern; the old `trivy_config`/`trivy_license` entries were fiction.
489
- Trivy:
490
- description: "Dependency vulnerabilities, secrets, malicious packages. 6 patterns total."
491
- source: derived
492
- # NO pattern list is stored here ON PURPOSE. There is exactly one source of truth
493
- # — the installed adapter — so there is nothing here to copy, mistype, or let go
494
- # stale. Run `--list Trivy` to see all six, `--emit Trivy '<regex>'` to generate
495
- # the config block.
496
- #
497
- # Selecting by severity IS selecting patterns (severity is fixed per pattern):
498
- # lightweight '^Trivy_(secret|vulnerability_critical)$'
499
- # balanced '^Trivy_(secret|malicious_packages|vulnerability_(critical|high))$'
500
- # thorough '^Trivy_(secret|malicious_packages|vulnerability_(critical|high|medium))$'
501
- patterns: derive # sentinel: not a list — see above. Never emit this value.
502
-
503
- # --- Ruff (773 available → ~20 high-signal) ---
504
- Ruff:
505
- description: "Python errors + security. Skips style/formatting (use formatter instead)."
506
- patterns:
507
- # Pyflakes — error-prone
508
- - patternId: "Ruff_F401_unused-import" # unused import
509
- - patternId: "Ruff_F811_redefined-while-unused" # redefined unused name
510
- - patternId: "Ruff_F841_unused-variable" # unused variable
511
- - patternId: "Ruff_F821_undefined-name" # undefined name
512
- # Bugbear — likely bugs
513
- - patternId: "Ruff_B006_mutable-argument-default" # mutable default argument
514
- - patternId: "Ruff_B007_unused-loop-control-variable" # unused loop variable
515
- - patternId: "Ruff_B018_useless-expression" # useless expression
516
- # Security
517
- - patternId: "Ruff_S101_assert" # assert used (not for prod)
518
- - patternId: "Ruff_S102_exec-builtin" # exec used
519
- - patternId: "Ruff_S103_bad-file-permissions" # bad file permissions
520
- - patternId: "Ruff_S104_hardcoded-bind-all-interfaces" # hardcoded bind all interfaces
521
- - patternId: "Ruff_S105_hardcoded-password-string" # hardcoded password string
522
- - patternId: "Ruff_S106_hardcoded-password-func-arg" # hardcoded password argument
523
- - patternId: "Ruff_S107_hardcoded-password-default" # hardcoded password default
524
- - patternId: "Ruff_S108_hardcoded-temp-file" # hardcoded temp file
525
- - patternId: "Ruff_S110_try-except-pass" # try-except-pass
526
- - patternId: "Ruff_S301_suspicious-pickle-usage" # pickle usage
527
- - patternId: "Ruff_S608_hardcoded-sql-expression" # SQL injection via string formatting
528
- # Type annotations (if desired)
529
- - patternId: "Ruff_ANN001_missing-type-function-argument" # missing type annotation for function argument
530
- - patternId: "Ruff_ANN201_missing-return-type-undocumented-public-function" # missing return type annotation
531
-
532
- # --- ShellCheck (491 available → ~15 high-signal) ---
533
- shellcheck:
534
- description: "Quoting, globbing, and error-prone shell patterns."
535
- patterns:
536
- - patternId: "shellcheck_SC2086" # double quote to prevent globbing/splitting
537
- - patternId: "shellcheck_SC2046" # quote to prevent word splitting
538
- - patternId: "shellcheck_SC2006" # use $() instead of backticks
539
- - patternId: "shellcheck_SC2034" # variable unused
540
- - patternId: "shellcheck_SC2064" # use single quotes for trap
541
- - patternId: "shellcheck_SC2155" # declare and assign separately
542
- - patternId: "shellcheck_SC2164" # use cd ... || exit
543
- - patternId: "shellcheck_SC2181" # check exit code directly
544
- - patternId: "shellcheck_SC2162" # read without -r
545
- - patternId: "shellcheck_SC2002" # useless cat
546
- - patternId: "shellcheck_SC2004" # unnecessary $ in arithmetic
547
- - patternId: "shellcheck_SC2116" # useless echo
548
- - patternId: "shellcheck_SC2148" # missing shebang
549
- - patternId: "shellcheck_SC2229" # command not found (typo)
550
-
551
- # --- Bandit (78 available → ~10 high-signal) ---
552
- Bandit:
553
- description: "Python security only."
554
- patterns:
555
- - patternId: "Bandit_B101" # assert used
556
- - patternId: "Bandit_B102" # exec used
557
- - patternId: "Bandit_B103" # set_bad_file_permissions
558
- - patternId: "Bandit_B104" # hardcoded_bind_all_interfaces
559
- - patternId: "Bandit_B105" # hardcoded_password_string
560
- - patternId: "Bandit_B301" # pickle usage
561
- - patternId: "Bandit_B303" # insecure hash (md5/sha1)
562
- - patternId: "Bandit_B608" # SQL injection
563
- - patternId: "Bandit_B602" # subprocess with shell=True
564
- - patternId: "Bandit_B501" # request with verify=False
565
-
566
- # --- PMD7 — ⚠ LIST NOT DERIVED. THE TOOL IS DISABLED UNTIL IT IS. ---
567
- #
568
- # Audited 2026-09-07 against the installed adapter: all 12 ids below matched
569
- # nothing. They are bare rule names, and the adapter's are category-qualified:
570
- # UnusedLocalVariable → PMD7_category_java_bestpractices_UnusedLocalVariable
571
- #
572
- # ⚠ THE LIST IS EMPTY ON PURPOSE, AND EMPTYING IT IS WHAT DISABLES THE TOOL.
573
- # `patterns: []` in the CATALOGUE means "no derived ids", which makes the CLI
574
- # drop PMD7 (selectTools) — the same treatment Semgrep gets. Leaving the bare
575
- # names here was worse than useless: on a machine with no adapter there is no
576
- # intersection to filter them, so they were written into codacy.config.json and
577
- # PMD7 ran with nothing enabled, reporting zero issues. That is the VRT-105
578
- # failure, produced by the very list that documents it.
579
- #
580
- # They cannot be resolved mechanically: the suffix is AMBIGUOUS across
581
- # languages — `UnusedLocalVariable` exists as both
582
- # `PMD7_category_apex_bestpractices_…` and `PMD7_category_java_…` — so picking
583
- # one would enable a rule that can never fire. Deriving them needs a human to
584
- # choose the category per rule:
585
- # node validate-patterns.mjs --list PMD7 '_category_java_'
586
- #
587
- # The curation to restore, once the categories are chosen:
588
- # UnusedLocalVariable
589
- # UnusedPrivateField
590
- # UnusedPrivateMethod
591
- # EmptyCatchBlock
592
- # AvoidReassigningParameters
593
- # CloseResource
594
- # CompareObjectsWithEquals
595
- # EqualsNull
596
- # MissingBreakInSwitch
597
- # NullAssignment
598
- # ReturnEmptyCollectionRatherThanNull
599
- # SimplifiedTernary
600
- PMD7:
601
- description: "Java quality + error-prone. NOT DERIVED — see above."
602
- patterns: []
603
-
604
- # --- detekt — ⚠ UNVERIFIED: no detekt adapter was installed when the other
605
- # lists were audited (2026-09-07), so these ids have never been checked
606
- # against one. The CLI drops any id the adapter does not define, so a wrong
607
- # one costs the rule rather than the tool — but the list is not evidence.
608
- # --- detekt (296 available → ~10 high-signal) ---
609
- detekt:
610
- description: "Kotlin error-prone + complexity."
611
- patterns:
612
- - patternId: "EmptyCatchBlock"
613
- - patternId: "SwallowedException"
614
- - patternId: "UnusedPrivateMember"
615
- - patternId: "MagicNumber"
616
- - patternId: "ComplexMethod"
617
- - patternId: "LongMethod"
618
- - patternId: "TooManyFunctions"
619
- - patternId: "ReturnCount"
620
- - patternId: "ThrowsCount"
621
- - patternId: "MaxLineLength"
622
-
623
- # --- Lizard (12 available → all, already minimal) ---
624
- Lizard:
625
- description: "Complexity metrics only. Already minimal."
626
- patterns: [] # All 12 patterns — they are all complexity metrics
627
-
628
- # --- Hadolint (99 available → ~8 high-signal) ---
629
- Hadolint:
630
- description: "Dockerfile best practices."
631
- patterns:
632
- - patternId: "Hadolint_DL3006" # always tag the version of an image
633
- - patternId: "Hadolint_DL3007" # using latest is error-prone
634
- - patternId: "Hadolint_DL3008" # pin versions in apt-get
635
- - patternId: "Hadolint_DL3009" # delete apt-get lists
636
- - patternId: "Hadolint_DL3018" # pin versions in apk add
637
- - patternId: "Hadolint_DL3025" # use JSON for CMD
638
- - patternId: "Hadolint_DL3028" # pin versions in gem install
639
- - patternId: "Hadolint_DL4006" # set SHELL option -o pipefail
@@ -119,7 +119,6 @@ custom_patterns: []
119
119
  # Process constraints
120
120
  process_constraints:
121
121
  self_healing_limit: 2 # Max fix-recheck iterations (research: degradation after 2)
122
- analysis_mode: balanced # lightweight | balanced | thorough
123
122
 
124
123
  # Knowledge system (KNOWLEDGE-SYSTEM-PRD §4, §8, §9)
125
124
  compound_enabled: true # master switch: graph + extractor + feedback suppressions
@@ -142,12 +141,6 @@ process_constraints:
142
141
  - .next
143
142
  - coverage
144
143
 
145
- # Tool configuration (populated during synthesis based on detected languages)
144
+ # Static analysis is Trivy only, configured and run by Verity itself
145
+ # (.verity/static-analysis.json). Synthesis sets: Trivy: { enabled: true }
146
146
  tool_configuration: {}
147
- # Example:
148
- # eslint:
149
- # enabled: true
150
- # config_file: ".verity/tools/eslint.config.mjs"
151
- # semgrep:
152
- # enabled: true
153
- # rulesets: ["p/security-audit", "p/typescript"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codacy/verity-cli",
3
- "version": "0.34.3",
3
+ "version": "0.35.0-experimental.16e0448",
4
4
  "description": "CLI for Verity quality gate service",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "homepage": "https://verity.md",
@@ -42,15 +42,8 @@
42
42
  "web-tree-sitter": "0.27.0"
43
43
  },
44
44
  "dependencies": {
45
+ "@codacy/analysis-cli": "0.25.0",
45
46
  "commander": "^12",
46
47
  "yaml": "^2"
47
- },
48
- "peerDependencies": {
49
- "@codacy/analysis-cli": ">=1.0.0"
50
- },
51
- "peerDependenciesMeta": {
52
- "@codacy/analysis-cli": {
53
- "optional": true
54
- }
55
48
  }
56
49
  }