|
2 | 2 |
|
3 | 3 | All notable changes to CKB will be documented in this file. |
4 | 4 |
|
| 5 | +## [8.3.0] - 2026-03-27 |
| 6 | + |
| 7 | +### Added |
| 8 | + |
| 9 | +#### Compliance Audit (`ckb audit compliance`) |
| 10 | +Full regulatory compliance auditing with 131 checks across 20 frameworks: |
| 11 | + |
| 12 | +```bash |
| 13 | +ckb audit compliance --framework=gdpr,iso27001 # Specific frameworks |
| 14 | +ckb audit compliance --framework=all # All 20 frameworks |
| 15 | +ckb audit compliance --recommend # Auto-detect applicable frameworks |
| 16 | +ckb audit compliance --framework=gdpr --ci # CI mode with exit codes |
| 17 | +``` |
| 18 | + |
| 19 | +**20 frameworks:** GDPR, CCPA, ISO 27701, EU AI Act, ISO 27001, NIST 800-53, OWASP ASVS, SOC 2, PCI DSS, HIPAA, DORA, NIS2, FDA 21 CFR Part 11, EU CRA, SBOM/SLSA, DO-178C, IEC 61508, ISO 26262, MISRA C, IEC 62443. |
| 20 | + |
| 21 | +**Cross-framework mapping:** A single finding (e.g., hardcoded credential) automatically surfaces all applicable regulations with specific clause references and CWE IDs. |
| 22 | + |
| 23 | +**Framework recommendation (`--recommend`):** Scans codebase for indicators (HTTP handlers, PII fields, database imports, payment SDKs) and recommends applicable frameworks with confidence scores. |
| 24 | + |
| 25 | +**Output formats:** human, json, markdown, sarif. |
| 26 | + |
| 27 | +**MCP tool:** `auditCompliance` — runs compliance audit via MCP using the persistent SCIP index. |
| 28 | + |
| 29 | +#### MCP Tools: `listSymbols` and `getSymbolGraph` |
| 30 | + |
| 31 | +**`listSymbols`** — Bulk symbol listing without search query: |
| 32 | +``` |
| 33 | +listSymbols(scope: "src/services/", kinds: ["function"], minLines: 30, sortBy: "complexity") |
| 34 | +``` |
| 35 | +Returns complete symbol inventory with body ranges (`lines`, `endLine`) and complexity metrics (`cyclomatic`, `cognitive`). Replaces exploring 40 files one-by-one. |
| 36 | + |
| 37 | +**`getSymbolGraph`** — Batch call graph for multiple symbols: |
| 38 | +``` |
| 39 | +getSymbolGraph(symbolIds: [...30], depth: 1, direction: "callers") |
| 40 | +``` |
| 41 | +Returns deduplicated nodes and edges with complexity per node. One call replaces 30 serial `getCallGraph` calls. |
| 42 | + |
| 43 | +#### `searchSymbols` Enhancements |
| 44 | + |
| 45 | +- **Complexity metrics:** Results now include `lines`, `cyclomatic`, `cognitive` per symbol via tree-sitter enrichment |
| 46 | +- **Server-side filtering:** `minLines`, `minComplexity`, `excludePatterns` params — filter 80% of noise server-side instead of client-side |
| 47 | +- **`batchGet` with `includeCounts`:** Returns `referenceCount`, `callerCount`, `calleeCount` per symbol (parallel SCIP lookups) |
| 48 | + |
| 49 | +#### Symbol Body Ranges (`startLine`, `endLine`, `lines`) |
| 50 | + |
| 51 | +`searchSymbols`, `explore` keySymbols, and `getSymbolGraph` now return full body ranges via tree-sitter enrichment. Consumers no longer need to read source files for brace-matching. |
| 52 | + |
| 53 | +#### Explore keySymbols Improvements |
| 54 | + |
| 55 | +- Functions rank above struct fields (behavioral analysis priority) |
| 56 | +- Tree-sitter supplement fills in functions when SCIP returns only types |
| 57 | +- Per-symbol `cyclomatic` and `cognitive` complexity |
| 58 | + |
| 59 | +#### `getFileComplexity` in Refactor Preset |
| 60 | + |
| 61 | +Previously only available in `full` preset (96 tools). Now in `refactor` (39 tools). |
| 62 | + |
| 63 | +### Fixed |
| 64 | + |
| 65 | +#### Bug-Pattern False Positives (42 → 0) |
| 66 | +- **defer-in-loop:** Recognize `func(){}()` closure pattern as correct (defer fires per iteration) |
| 67 | +- **discarded-error:** Skip closure bodies in IIFE patterns; add `singleReturnNew` allowlist (NewScanner, NewReader, etc.); add `noErrorMethods` (Scan, WriteHeader, WriteJSON, WriteError, BadRequest, NotFound, InternalError) |
| 68 | +- **missing-defer-close:** Remove NewReader/NewWriter from resource-opening functions (bufio wrappers don't need Close) |
| 69 | +- **nil-after-deref:** 30-line gap threshold filters cross-scope false matches |
| 70 | +- **shadowed-err:** Only flag when outer `err` is standalone function-body-level `:=`; treat if/for/switch initializer `:=` as scoped |
| 71 | + |
| 72 | +All fixes use `FindNodesSkipping` — scope-aware tree-sitter node search that stops recursion at `func_literal` boundaries. |
| 73 | + |
| 74 | +#### Secrets Scanner |
| 75 | +- Shell variable interpolation (`${VAR:-default}`, `${VAR:?error}`) in Docker Compose URLs no longer flagged as password_in_url |
| 76 | +- Shell environment leak: `env -i` wrapper prevents user profile (.zshrc) from corrupting subprocess output |
| 77 | + |
| 78 | +#### Test-Gap Detection |
| 79 | +- `vi.mock`/`jest.mock` module-level mocking recognized — functions covered by module mocks no longer flagged |
| 80 | +- Barrel/re-export files (`export * from '...'`) skipped — pure re-exports have no logic to test |
| 81 | + |
| 82 | +#### Coupling Check |
| 83 | +- Expanded noise filter: test files, dependency manifests (go.mod, package.json), documentation, generated directories (dist/, build/, l10n/, __generated__/) |
| 84 | +- Generated file suffixes: .pb.go, .pb.h, .pb.cc, .pb.ts, _grpc.pb.go, _pb2.py, .g.dart, .freezed.dart, .mocks.dart, _string.go, wire_gen.go, _mock.go, .bundle.js, .arb, .d.ts |
| 85 | +- Flutter l10n false positive fixed (#185): .arb files excluded from coupling analysis |
| 86 | + |
| 87 | +#### Compliance Audit FP Reduction (11,356 → ~50 findings) |
| 88 | +- Deep-nesting: threshold 4→6, reset at function boundaries, 3-per-file cap |
| 89 | +- Dead-code: skip Go files (handled by AST-based bug-patterns) |
| 90 | +- Dynamic-memory: skip garbage-collected languages |
| 91 | +- Global-state: exclude regexp.MustCompile, errors.New, sync primitives |
| 92 | +- Swallowed-errors: remove overly broad `_ = obj.Method()` pattern |
| 93 | +- Eval-injection: skip Go and .github/ directories |
| 94 | +- Insecure-random: inline import scanning for crypto/rand vs math/rand; skip import lines |
| 95 | +- Path-traversal: skip filepath.Join, HasPrefix comparisons, testdata/ |
| 96 | +- Non-FIPS-crypto: skip strings.Contains pattern matching |
| 97 | +- SQL injection (PCI DSS): add parameterized query detection, #nosec support |
| 98 | +- TODO detection: case-sensitive TEMP, skip "Stub:/Placeholder:/Note:" comments, require comment context |
| 99 | + |
| 100 | +#### FTS Empty Query Bug |
| 101 | +`FTS.Search("")` returned empty results (early return for empty query). Added `listAll()` method that queries `symbols_fts_content` directly. Fixes `listSymbols` and `searchSymbols("")` returning 0 on MCP. |
| 102 | + |
| 103 | +#### MCP Server Warmup |
| 104 | +Changed warmup from `SearchSymbols("", 1)` (cached empty results before SCIP loaded) to `RefreshFTS()` (populates FTS from SCIP without caching search results). |
| 105 | + |
| 106 | +#### IEC 61508 Tree-Sitter Crash |
| 107 | +`complexityExceededCheck` bypassed thread-safe `AnalyzeFileComplexity()` wrapper, calling `ComplexityAnalyzer.AnalyzeFile()` directly — SIGABRT when concurrent checks hit CGO. |
| 108 | + |
| 109 | +#### Daemon API Endpoints (7 stubs → implementations) |
| 110 | +- Schedule list/detail/cancel via scheduler.ListSchedules() |
| 111 | +- Repo list/detail via repos.LoadRegistry() |
| 112 | +- Federation list/detail via federation.List()/LoadConfig() |
| 113 | +- CLI daemon status: HTTP health query with version/uptime display |
| 114 | + |
| 115 | +#### Query Engine Stubs (4 → implementations) |
| 116 | +- Ownership refresh: CODEOWNERS parsing + git-blame analysis |
| 117 | +- Hotspot refresh: git churn data with 90-day window |
| 118 | +- Responsibility refresh: module responsibility extraction |
| 119 | +- Ownership history: storage table query |
| 120 | + |
| 121 | +### Changed |
| 122 | +- Score calculation: floor is 0 (not 20), per-rule deduction cap of 10 documented |
| 123 | +- `LikelyReturnsError`: removed "Scan" from error patterns, added `singleReturnNew` and `noErrorMethods` maps |
| 124 | +- Generated file detection: 20+ new patterns (protobuf, Go generators, Dart/Flutter, GraphQL, bundlers) |
| 125 | +- Per-check findings cap (50 max) in compliance engine |
| 126 | +- Compliance config: `DefaultDaemonPort` constant replaces hardcoded 9120 |
| 127 | + |
| 128 | +### Performance |
| 129 | +- `batchGet` with `includeCounts`: parallel reference/caller/callee lookups (10-concurrent semaphore) |
| 130 | +- FTS multiplier: 2x → 10x when filters active (handles SCIP struct field flooding) |
| 131 | +- MCP index warmup: background `RefreshFTS()` on engine init |
| 132 | + |
5 | 133 | ## [8.2.0] - 2026-03-21 |
6 | 134 |
|
7 | 135 | ### Added |
|
0 commit comments