feat(acms): add PostgreSQL and Docker Compose domain analyzers #611

Merged
hamza.khyari merged 3 commits from feature/m6-acms-domain-specific-analyzers into master 2026-03-06 23:07:26 +00:00

3 Commits

Author SHA1 Message Date
hamza.khyari fb96d7910b fix(changelog): prepend #588 entry to top of Unreleased section (F8)
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 36s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m42s
CI / integration_tests (pull_request) Successful in 3m2s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 4m32s
CI / benchmark-regression (pull_request) Successful in 29m33s
Move the (#588) CHANGELOG entry from after (#203) to the top of the
## Unreleased section, matching the convention that newest entries are
prepended first. All pre-existing entries (#473, #495, #203, #494)
remain intact and unmodified.

Addresses reviewer finding F8 from PR #611 second-pass review.
Refs: #588
2026-03-06 20:31:09 +00:00
hamza.khyari 13618fb8d5 fix(acms): address PR #611 review findings F1-F7
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 14s
CI / build (pull_request) Successful in 15s
CI / quality (pull_request) Successful in 17s
CI / security (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 47s
CI / unit_tests (pull_request) Successful in 2m35s
CI / integration_tests (pull_request) Successful in 3m13s
CI / docker (pull_request) Successful in 39s
CI / coverage (pull_request) Successful in 4m26s
CI / benchmark-regression (pull_request) Has been cancelled
- F1/F2 [P1]: Split postgresql_analyzer.py (695→310 lines) by
  extracting regex patterns, URI builders, and parsing functions
  into _postgresql_helpers.py (440 lines).  Split
  domain_analyzers.feature (605→217 lines) into separate
  postgresql_analyzer.feature (201) and
  docker_compose_analyzer.feature (199).

- F3 [P1]: Fix _extract_body and _split_entries to track
  single-quoted SQL string literals so parentheses inside
  DEFAULT/CHECK values (e.g. 'func(x)') do not corrupt depth
  counting.  Added regression scenarios.

- F4 [P2]: Remove prohibited `# type: ignore[arg-type]` by
  adding a static protocol assertion for _DuplicatePyAnalyzer.

- F5 [P2]: Add 1 MiB size guard before yaml.safe_load in
  DockerComposeAnalyzer to mitigate billion-laughs alias
  expansion attacks.

- F6 [P2]: Fix quoted-keyword column names (e.g. "primary")
  being silently dropped by checking raw_first.startswith('"')
  before keyword filtering.  Added regression scenario.

- F7 [P2]: Out-of-scope file changes resolved by rebase onto
  master (changes already merged via other PRs).

All nox gates pass: lint (0 errors), typecheck (0 errors),
security_scan, behave (57 scenarios, 211 steps, 0 failures).
2026-03-06 20:07:03 +00:00
hamza.khyari 77db78d768 feat(acms): add PostgreSQL and Docker Compose domain analyzers (#588)
Add Phase 2 domain-specific analyzers for the ACMS UKO indexing pipeline:

- PostgreSQLAnalyzer: regex-based DDL parser extracting uko-data:Table,
  Column, ForeignKey, View, and Schema triples with column metadata
  (data type, nullability, primary key constraints).
- DockerComposeAnalyzer: YAML-based parser extracting uko-infra:
  DeploymentUnit, Service, Port, EnvironmentVariable, and connectsTo
  triples. Validates Compose format via services/version key detection.

Both satisfy AnalyzerProtocol and register in AnalyzerRegistry by file
extension (.sql/.ddl and .yml/.yaml respectively).

Includes 34 Behave BDD scenarios (protocol conformance, registry ops,
triple extraction for all 4 analyzers, error handling, cross-analyzer
URI scheme and confidence checks), 6 Robot Framework integration smoke
tests, updated __init__.py exports, vulture whitelist, and CHANGELOG.
2026-03-06 19:56:21 +00:00