de-agent 0.3.2__tar.gz → 0.3.3__tar.gz

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.
Files changed (248) hide show
  1. {de_agent-0.3.2 → de_agent-0.3.3}/PKG-INFO +7 -7
  2. {de_agent-0.3.2 → de_agent-0.3.3}/README.md +1 -1
  3. {de_agent-0.3.2 → de_agent-0.3.3}/pyproject.toml +6 -6
  4. de_agent-0.3.3/src/de_agent/__init__.py +1 -0
  5. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/lint.py +1 -1
  6. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/catalog.py +8 -1
  7. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/run.py +1 -1
  8. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/terraform.py +104 -7
  9. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_release_meta.py +4 -0
  10. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_status_dates.py +7 -0
  11. de_agent-0.3.3/tests/test_terraform_dms.py +138 -0
  12. de_agent-0.3.2/src/de_agent/__init__.py +0 -1
  13. {de_agent-0.3.2 → de_agent-0.3.3}/.gitignore +0 -0
  14. {de_agent-0.3.2 → de_agent-0.3.3}/LICENSE +0 -0
  15. {de_agent-0.3.2 → de_agent-0.3.3}/NOTICE +0 -0
  16. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/applyplan.py +0 -0
  17. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/approval.py +0 -0
  18. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/cli.py +0 -0
  19. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/cliclass.py +0 -0
  20. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/clients.py +0 -0
  21. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/__init__.py +0 -0
  22. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/_airflow_core.py +0 -0
  23. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/_pack_http_core.py +0 -0
  24. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/airflow.py +0 -0
  25. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/aws/__init__.py +0 -0
  26. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/aws/_aws_core.py +0 -0
  27. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/base.py +0 -0
  28. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/dbt.py +0 -0
  29. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/pack_base.py +0 -0
  30. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/pack_cli.py +0 -0
  31. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/pack_http.py +0 -0
  32. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/pack_sql.py +0 -0
  33. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/postgres.py +0 -0
  34. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/collectors/redshift.py +0 -0
  35. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/config.py +0 -0
  36. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/configdoc.py +0 -0
  37. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/data/sql_cases.yaml +0 -0
  38. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/diff.py +0 -0
  39. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/extract.py +0 -0
  40. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/find.py +0 -0
  41. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/hubpath.py +0 -0
  42. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/initcmd.py +0 -0
  43. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/__init__.py +0 -0
  44. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/argv.py +0 -0
  45. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/bigquery.yaml +0 -0
  46. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/check.py +0 -0
  47. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/cli.py +0 -0
  48. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/dagster.yaml +0 -0
  49. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/databricks-system.yaml +0 -0
  50. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/databricks.yaml +0 -0
  51. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/errors.py +0 -0
  52. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/expr.py +0 -0
  53. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/fivetran.yaml +0 -0
  54. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/gcp.yaml +0 -0
  55. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/kubernetes.yaml +0 -0
  56. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/loader.py +0 -0
  57. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/model.py +0 -0
  58. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/mssql.yaml +0 -0
  59. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/mysql.yaml +0 -0
  60. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/postgres-lite.yaml +0 -0
  61. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/scaffold.py +0 -0
  62. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/snowflake.yaml +0 -0
  63. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/template.py +0 -0
  64. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/packs/view.py +0 -0
  65. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/plans.py +0 -0
  66. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/pyscan.py +0 -0
  67. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/render.py +0 -0
  68. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/routines.py +0 -0
  69. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/routines_render.py +0 -0
  70. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/runner.py +0 -0
  71. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/__init__.py +0 -0
  72. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/airflow.py +0 -0
  73. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/common.py +0 -0
  74. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/dbt.py +0 -0
  75. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/edges.py +0 -0
  76. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/headers.py +0 -0
  77. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/pycode.py +0 -0
  78. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/pyexpr.py +0 -0
  79. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/python.py +0 -0
  80. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/routines.py +0 -0
  81. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/scanners/sql.py +0 -0
  82. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/secretscan.py +0 -0
  83. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/snapshot.py +0 -0
  84. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/sqlclass.py +0 -0
  85. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/sqlexec.py +0 -0
  86. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/stepexec.py +0 -0
  87. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/example/integrations/orders_etl--warehouse.md +0 -0
  88. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/example/map_row.txt +0 -0
  89. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/example/projects/orders_etl.md +0 -0
  90. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/README.md +0 -0
  91. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/conventions.md +0 -0
  92. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/de-agent.yaml +0 -0
  93. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/domains/_template.md +0 -0
  94. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/gitignore.tmpl +0 -0
  95. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/integrations/_template.md +0 -0
  96. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/map.md +0 -0
  97. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/projects/_template.md +0 -0
  98. {de_agent-0.3.2 → de_agent-0.3.3}/src/de_agent/templates/hub/status.md +0 -0
  99. {de_agent-0.3.2 → de_agent-0.3.3}/tests/aws_fixtures.py +0 -0
  100. {de_agent-0.3.2 → de_agent-0.3.3}/tests/conftest.py +0 -0
  101. {de_agent-0.3.2 → de_agent-0.3.3}/tests/corpus/cli_guard.yaml +0 -0
  102. {de_agent-0.3.2 → de_agent-0.3.3}/tests/corpus/redteam.yaml +0 -0
  103. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_2_10/failing.json +0 -0
  104. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_2_10/healthy.json +0 -0
  105. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_3_0/basic.json +0 -0
  106. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/common/__init__.py +0 -0
  107. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/common/pg_utils.py +0 -0
  108. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/call_proc.py +0 -0
  109. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/datasets_2x.py +0 -0
  110. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/factory.py +0 -0
  111. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/nested_with.py +0 -0
  112. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/ops/nested_folder.py +0 -0
  113. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/sensors.py +0 -0
  114. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/sql/load_x.sql +0 -0
  115. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/sql_file.py +0 -0
  116. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/sql_hook.py +0 -0
  117. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/sql_kwarg.py +0 -0
  118. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/taskflow.py +0 -0
  119. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/unrolled.py +0 -0
  120. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/dags/util_imports.py +0 -0
  121. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/airflow_repo/utils/dates.py +0 -0
  122. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/aws_snapshot.json +0 -0
  123. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/failing/manifest.json +0 -0
  124. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/failing/run_results.json +0 -0
  125. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/failing/sources.json +0 -0
  126. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/healthy/manifest.json +0 -0
  127. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/healthy/run_results.json +0 -0
  128. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt/healthy/sources.json +0 -0
  129. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/dbt_proj/target/manifest.json +0 -0
  130. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/pg_full.json +0 -0
  131. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/pg_healthy.json +0 -0
  132. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/pg_partial.json +0 -0
  133. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/jobs/broken.py +0 -0
  134. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/jobs/load_orders.py +0 -0
  135. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/jobs/pandas_job.py +0 -0
  136. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/jobs/spark_job.py +0 -0
  137. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/lib/__init__.py +0 -0
  138. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/lib/etl.py +0 -0
  139. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/notebooks/dbx_export.py +0 -0
  140. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/python_repo/notebooks/orders_rollup.ipynb +0 -0
  141. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/range_loops_repo/jobs/loops.py +0 -0
  142. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/tf_repo/main.tf +0 -0
  143. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/tf_repo/modules/warehouse.tf +0 -0
  144. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/dags/util_hops.py +0 -0
  145. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/dags/util_loop.py +0 -0
  146. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/dags/util_proc.py +0 -0
  147. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/sql/procs.sql +0 -0
  148. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/utils/__init__.py +0 -0
  149. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/utils/db.py +0 -0
  150. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/util_repo/utils/etl.py +0 -0
  151. {de_agent-0.3.2 → de_agent-0.3.3}/tests/fixtures/warehouse_sql/procs.sql +0 -0
  152. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/af3_basic.md +0 -0
  153. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/af_failing.md +0 -0
  154. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/af_healthy.md +0 -0
  155. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_athena_section.md +0 -0
  156. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_cloudwatch_section.md +0 -0
  157. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_dms_section.md +0 -0
  158. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_firehose_section.md +0 -0
  159. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_full.md +0 -0
  160. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_glue_section.md +0 -0
  161. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_s3_section.md +0 -0
  162. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/aws_split_index.md +0 -0
  163. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/dbt_failing.md +0 -0
  164. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/dbt_healthy.md +0 -0
  165. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_bigquery.md +0 -0
  166. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_dagster.md +0 -0
  167. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_databricks-system.md +0 -0
  168. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_databricks.md +0 -0
  169. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_fivetran.md +0 -0
  170. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_gcp.md +0 -0
  171. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_kubernetes.md +0 -0
  172. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_mssql.md +0 -0
  173. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_mysql.md +0 -0
  174. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_postgres-lite.md +0 -0
  175. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pack_snowflake.md +0 -0
  176. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pg_full.md +0 -0
  177. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pg_healthy.md +0 -0
  178. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/pg_partial.md +0 -0
  179. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/redshift_degraded.md +0 -0
  180. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/redshift_healthy.md +0 -0
  181. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/scan_python.md +0 -0
  182. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/scan_terraform.md +0 -0
  183. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/scan_util_airflow.md +0 -0
  184. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/scan_util_edges.md +0 -0
  185. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/schedule_cron.txt +0 -0
  186. {de_agent-0.3.2 → de_agent-0.3.3}/tests/golden/schedule_launchd.plist +0 -0
  187. {de_agent-0.3.2 → de_agent-0.3.3}/tests/packs_fixtures.py +0 -0
  188. {de_agent-0.3.2 → de_agent-0.3.3}/tests/packs_helpers.py +0 -0
  189. {de_agent-0.3.2 → de_agent-0.3.3}/tests/redshift_fixtures.py +0 -0
  190. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_airflow_collector.py +0 -0
  191. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_audit_pack.py +0 -0
  192. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_aws_collector.py +0 -0
  193. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_aws_dms_mappings.py +0 -0
  194. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_aws_guard.py +0 -0
  195. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_aws_more.py +0 -0
  196. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_aws_render_edges.py +0 -0
  197. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_cli.py +0 -0
  198. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_cli_guard.py +0 -0
  199. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_closeout_plans.py +0 -0
  200. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_cold_imports.py +0 -0
  201. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_config.py +0 -0
  202. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_config_routine_edges.py +0 -0
  203. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_dbt_collector.py +0 -0
  204. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_demo_e2e.py +0 -0
  205. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_denylist.py +0 -0
  206. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_diff.py +0 -0
  207. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_docs.py +0 -0
  208. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_docs_examples.py +0 -0
  209. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_evals.py +0 -0
  210. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_export_schedule.py +0 -0
  211. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_extract.py +0 -0
  212. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_find.py +0 -0
  213. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_hooks.py +0 -0
  214. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_lint.py +0 -0
  215. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_builtin.py +0 -0
  216. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_cli.py +0 -0
  217. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_enforcement.py +0 -0
  218. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_expr.py +0 -0
  219. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_http.py +0 -0
  220. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_live.py +0 -0
  221. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_packs_routines.py +0 -0
  222. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_plan_steps.py +0 -0
  223. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_plans.py +0 -0
  224. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_postgres_collector.py +0 -0
  225. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_pyexpr_recursion.py +0 -0
  226. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_recovered.py +0 -0
  227. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_redshift_collector.py +0 -0
  228. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_redshift_single_pass.py +0 -0
  229. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_redteam.py +0 -0
  230. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_release_script.py +0 -0
  231. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_render.py +0 -0
  232. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_render_m1b.py +0 -0
  233. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_routines_core.py +0 -0
  234. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_routines_edges.py +0 -0
  235. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_routines_redteam.py +0 -0
  236. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_routines_render.py +0 -0
  237. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_scan_airflow.py +0 -0
  238. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_scan_perf.py +0 -0
  239. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_scan_run.py +0 -0
  240. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_scan_v02.py +0 -0
  241. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_self_guard_script_writes.py +0 -0
  242. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_session_hook.py +0 -0
  243. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_snapshot_m3.py +0 -0
  244. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_sqlclass.py +0 -0
  245. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_sqlexec.py +0 -0
  246. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_stop_check.py +0 -0
  247. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_test_guard.py +0 -0
  248. {de_agent-0.3.2 → de_agent-0.3.3}/tests/test_walkthrough.py +0 -0
@@ -1,12 +1,12 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: de-agent
3
- Version: 0.3.2
3
+ Version: 0.3.3
4
4
  Summary: Ground-truth context, guardrails and workflows for data engineering with Claude Code
5
- Project-URL: Homepage, https://github.com/Rafid-Bin-Sadeque/de-agent
6
- Project-URL: Documentation, https://github.com/Rafid-Bin-Sadeque/de-agent#readme
7
- Project-URL: Repository, https://github.com/Rafid-Bin-Sadeque/de-agent
8
- Project-URL: Issues, https://github.com/Rafid-Bin-Sadeque/de-agent/issues
9
- Project-URL: Changelog, https://github.com/Rafid-Bin-Sadeque/de-agent/blob/main/CHANGELOG.md
5
+ Project-URL: Homepage, https://github.com/OWNER/de-agent
6
+ Project-URL: Documentation, https://github.com/OWNER/de-agent#readme
7
+ Project-URL: Repository, https://github.com/OWNER/de-agent
8
+ Project-URL: Issues, https://github.com/OWNER/de-agent/issues
9
+ Project-URL: Changelog, https://github.com/OWNER/de-agent/blob/main/CHANGELOG.md
10
10
  Author: de-agent maintainers
11
11
  License-Expression: Apache-2.0
12
12
  License-File: LICENSE
@@ -91,4 +91,4 @@ uv tool install 'de-agent[pg,aws]' # or: pipx install 'de-agent[pg,aws]'
91
91
  dea init --name "My platform" && dea doctor
92
92
  ```
93
93
 
94
- Documentation, the plugin, the safety model and the eval results: <https://github.com/Rafid-Bin-Sadeque/de-agent>. Apache-2.0.
94
+ Documentation, the plugin, the safety model and the eval results: <https://github.com/OWNER/de-agent>. Apache-2.0.
@@ -13,4 +13,4 @@ uv tool install 'de-agent[pg,aws]' # or: pipx install 'de-agent[pg,aws]'
13
13
  dea init --name "My platform" && dea doctor
14
14
  ```
15
15
 
16
- Documentation, the plugin, the safety model and the eval results: <https://github.com/Rafid-Bin-Sadeque/de-agent>. Apache-2.0.
16
+ Documentation, the plugin, the safety model and the eval results: <https://github.com/OWNER/de-agent>. Apache-2.0.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "de-agent"
7
- version = "0.3.2"
7
+ version = "0.3.3"
8
8
  description = "Ground-truth context, guardrails and workflows for data engineering with Claude Code"
9
9
  readme = "README.md"
10
10
  license = "Apache-2.0"
@@ -41,11 +41,11 @@ all = ["de-agent[aws,pg,mysql,snowflake,bigquery,databricks,mssql,terraform]"]
41
41
  dev = ["pytest", "pytest-cov", "ruff", "boto3", "moto[all]", "psycopg[binary]>=3.1", "sqlalchemy>=2", "pymysql", "python-hcl2>=4"]
42
42
 
43
43
  [project.urls]
44
- Homepage = "https://github.com/Rafid-Bin-Sadeque/de-agent"
45
- Documentation = "https://github.com/Rafid-Bin-Sadeque/de-agent#readme"
46
- Repository = "https://github.com/Rafid-Bin-Sadeque/de-agent"
47
- Issues = "https://github.com/Rafid-Bin-Sadeque/de-agent/issues"
48
- Changelog = "https://github.com/Rafid-Bin-Sadeque/de-agent/blob/main/CHANGELOG.md"
44
+ Homepage = "https://github.com/OWNER/de-agent"
45
+ Documentation = "https://github.com/OWNER/de-agent#readme"
46
+ Repository = "https://github.com/OWNER/de-agent"
47
+ Issues = "https://github.com/OWNER/de-agent/issues"
48
+ Changelog = "https://github.com/OWNER/de-agent/blob/main/CHANGELOG.md"
49
49
 
50
50
  [project.scripts]
51
51
  dea = "de_agent.cli:app"
@@ -0,0 +1 @@
1
+ __version__ = "0.3.3"
@@ -158,7 +158,7 @@ def _bullet_item(line: str) -> tuple[str, bool] | None:
158
158
  text = t.group(2).strip()
159
159
  if lead_date(text) is None:
160
160
  return None
161
- struck = len(text) > 4 and text.startswith("~~") and text.endswith("~~") and "~~" not in text[2:-2]
161
+ struck = text.startswith("~~") and "~~" in text[2:]
162
162
  return text, checked or struck
163
163
 
164
164
 
@@ -160,7 +160,10 @@ def render_terraform(res: dict[str, Any]) -> dict[str, str]:
160
160
  if n["writes"]:
161
161
  parts.append(f"writes: {_list(n['writes'])}")
162
162
  if n["pairs"]:
163
- parts.append("replicates: " + _list([f"{p['source']} → {p['target']}" for p in n["pairs"]]))
163
+ pairs_str = _list([f"{p['source']} → {p['target']}" for p in n["pairs"]])
164
+ if n.get("snapshot_fallback"):
165
+ pairs_str += " (via snapshot)"
166
+ parts.append("replicates: " + pairs_str)
164
167
  if n["unclear"]:
165
168
  parts.append("direction unclear: " + _list(n["unclear"]))
166
169
  lines.append("- " + " · ".join(parts))
@@ -169,6 +172,10 @@ def render_terraform(res: dict[str, Any]) -> dict[str, str]:
169
172
  lines += ["## Unresolved references", ""]
170
173
  lines += [f"- {u['name']} (in {u['referenced_by']})" for u in res["unresolved_refs"]]
171
174
  lines.append("")
175
+ if res.get("warnings"):
176
+ lines += ["## Mapping drift", ""]
177
+ lines += [f"- {w}" for w in sorted(res["warnings"])]
178
+ lines.append("")
172
179
  if res["errors"]:
173
180
  lines += ["## Parse notes", ""] + [f"- {e}" for e in res["errors"]] + [""]
174
181
  return {f"catalog/terraform/{scan}.md": _fm(res["revision"], scan=scan, type="terraform") + "\n".join(lines).rstrip("\n") + "\n"}
@@ -123,7 +123,7 @@ def scan_one(hub: Path, scan: Any, full: bool) -> tuple[dict[str, Any] | None, d
123
123
  per_file, hashes, parsed, cached = _per_file(
124
124
  scan, files, cache, full, lambda src, rel: tf_scan.scan_terraform_text(src, rel, scan.dialect))
125
125
  rev = source_revision(root, hashes)
126
- result = tf_scan.assemble(scan, per_file, rev)
126
+ result = tf_scan.assemble(scan, per_file, rev, hub=hub)
127
127
  _dump(cache_p, {"sig": _sig(scan), "files": {r: {"sha": hashes[r], "result": per_file[r]} for r in per_file}})
128
128
  state.update({"files": hashes, "parsed": parsed, "cached": cached})
129
129
  else:
@@ -400,6 +400,7 @@ def first(attrs: Any, path: str) -> Any:
400
400
 
401
401
  REF_RE = re.compile(r"^\$\{\s*([^{}]*?)\s*\}$")
402
402
  ADDR_RE = re.compile(r"^(?!var\.|local\.|data\.|module\.|each\.|count\.|path\.|self\.)([a-z][a-z0-9_]*)\.([A-Za-z0-9_-]+)(?:\.|\[|$)")
403
+ DATA_ADDR_RE = re.compile(r"^data\.([a-z][a-z0-9_]*)\.([A-Za-z0-9_-]+)(?:\.|\[|$)")
403
404
  NAME_ATTR = {"aws_s3_bucket": "bucket", "google_storage_bucket": "name", "aws_kinesis_stream": "name",
404
405
  "google_pubsub_topic": "name", "google_pubsub_subscription": "name",
405
406
  "aws_kinesis_firehose_delivery_stream": "name", "google_bigquery_dataset": "dataset_id",
@@ -409,6 +410,7 @@ NAME_ATTR = {"aws_s3_bucket": "bucket", "google_storage_bucket": "name", "aws_ki
409
410
  class Ctx:
410
411
  def __init__(self, resources: list[dict[str, Any]], variables: dict[str, str], locals_: dict[str, str]) -> None:
411
412
  self.by_addr = {f"{r['type']}.{r['name']}": r for r in resources if r["kind"] == "resource"}
413
+ self.by_addr.update({f"data.{r['type']}.{r['name']}": r for r in resources if r["kind"] == "data"})
412
414
  self.variables, self.locals = variables, locals_
413
415
  self.unresolved: list[dict[str, str]] = []
414
416
 
@@ -454,12 +456,19 @@ class Ctx:
454
456
  return None
455
457
 
456
458
  def address(self, v: Any) -> dict[str, Any] | None:
457
- """The resource a reference like `aws_dms_endpoint.src.endpoint_arn` points at."""
459
+ """The resource or data source a reference like `aws_dms_endpoint.src.endpoint_arn` or
460
+ `data.aws_dms_endpoint.target.endpoint_arn` points at."""
458
461
  if not isinstance(v, str):
459
462
  return None
460
463
  m = REF_RE.match(v)
461
- am = ADDR_RE.match(m.group(1)) if m else None
462
- return self.by_addr.get(f"{am.group(1)}.{am.group(2)}") if am else None
464
+ ref = m.group(1).strip() if m else v.strip()
465
+ am = ADDR_RE.match(ref)
466
+ if am:
467
+ return self.by_addr.get(f"{am.group(1)}.{am.group(2)}")
468
+ dm = DATA_ADDR_RE.match(ref)
469
+ if dm:
470
+ return self.by_addr.get(f"data.{dm.group(1)}.{dm.group(2)}")
471
+ return None
463
472
 
464
473
 
465
474
  def _bucket_from(ctx: Ctx, v: Any, owner: str) -> str | None:
@@ -496,6 +505,41 @@ def _dms_rules(raw: Any) -> list[dict[str, str]]:
496
505
  return [r for r in rules if r.get("type") == "selection" and r.get("action", "include") == "include"]
497
506
 
498
507
 
508
+ def _dms_transforms(raw: Any) -> list[dict[str, str]]:
509
+ """Transformation rules from table_mappings (rule-target, action, schema, table, value)."""
510
+ text = raw if isinstance(raw, str) else json.dumps(raw)
511
+ rules: list[dict[str, str]] = []
512
+ cur: dict[str, str] | None = None
513
+ _KEY = {"rule-action": "action", "rule-target": "target",
514
+ "schema-name": "schema", "table-name": "table", "value": "value"}
515
+ for m in re.finditer(
516
+ r'"(rule-type|rule-action|rule-target|schema-name|table-name|value)"\s*[=:]\s*\\?"([^"\\]*)\\?"', text
517
+ ):
518
+ key, val = m.group(1), m.group(2)
519
+ if key == "rule-type":
520
+ cur = {"type": val}
521
+ rules.append(cur)
522
+ elif cur is not None and key in _KEY:
523
+ cur[_KEY[key]] = val
524
+ return [r for r in rules if r.get("type") == "transformation"]
525
+
526
+
527
+ def _apply_dms_rename(schema: str, table: str, transforms: list[dict[str, str]]) -> tuple[str, str]:
528
+ """Apply rename transformation rules to get (target_schema, target_table)."""
529
+ tsch, ttbl = schema, table
530
+ for r in transforms:
531
+ if r.get("action") != "rename":
532
+ continue
533
+ rsch = r.get("schema", "%")
534
+ if r.get("target") == "schema" and (rsch == "%" or rsch == schema) and r.get("value"):
535
+ tsch = r["value"]
536
+ elif r.get("target") == "table":
537
+ rtbl = r.get("table", "%")
538
+ if (rsch == "%" or rsch == schema) and (rtbl == "%" or rtbl == table) and r.get("value"):
539
+ ttbl = r["value"]
540
+ return tsch, ttbl
541
+
542
+
499
543
  def h_dms_task(res: dict[str, Any], ctx: Ctx, owner: str, dialect: str) -> dict[str, Any]:
500
544
  a = res["attrs"]
501
545
  out: dict[str, Any] = {"pairs": [], "id": None}
@@ -508,14 +552,17 @@ def h_dms_task(res: dict[str, Any], ctx: Ctx, owner: str, dialect: str) -> dict[
508
552
  tattrs = tgt["attrs"]
509
553
  bucket = ctx.text(first(tattrs, "s3_settings.bucket_name"), owner)
510
554
  folder = (ctx.text(first(tattrs, "s3_settings.bucket_folder"), owner, False) or "").strip("/")
511
- for r in _dms_rules(a.get("table_mappings")):
555
+ raw_mappings = a.get("table_mappings")
556
+ transforms = _dms_transforms(raw_mappings)
557
+ for r in _dms_rules(raw_mappings):
512
558
  sch, tbl = r.get("schema", "%"), r.get("table", "%")
513
559
  skey = f"{sch}.{tbl}".lower()
514
560
  pattern = "%" in sch or "%" in tbl
515
561
  if bucket:
516
562
  tkey = _s3(bucket, "/".join(x for x in (folder, sch, tbl) if x) + "/")
517
563
  elif tattrs.get("engine_name"):
518
- tkey = skey
564
+ tsch, ttbl = _apply_dms_rename(sch, tbl, transforms)
565
+ tkey = f"{tsch}.{ttbl}".lower()
519
566
  else:
520
567
  continue
521
568
  out["pairs"].append({"source": skey, "target": tkey, "pattern": pattern})
@@ -713,7 +760,41 @@ def node_key_of(res: dict[str, Any], ctx: Ctx) -> str | None:
713
760
  return None
714
761
 
715
762
 
716
- def assemble(scan: Any, per_file: dict[str, dict[str, Any]], revision: str) -> dict[str, Any]:
763
+ def _load_snap_dms(hub: Path) -> dict[str, tuple[str, list[dict[str, Any]]]]:
764
+ """Latest hub snapshot's dms_table_mappings keyed by task id -> (collected_at, pairs)."""
765
+ snaps_dir = hub / ".dea" / "snapshots"
766
+ if not snaps_dir.is_dir():
767
+ return {}
768
+ dirs = sorted(d for d in snaps_dir.iterdir() if d.is_dir())
769
+ if not dirs:
770
+ return {}
771
+ latest = dirs[-1]
772
+ task_pairs: dict[str, list[dict[str, Any]]] = {}
773
+ task_ts: dict[str, str] = {}
774
+ for jf in sorted(latest.glob("*.json")):
775
+ try:
776
+ snap = json.loads(jf.read_text(encoding="utf-8", errors="replace"))
777
+ except Exception:
778
+ continue
779
+ ts = snap.get("collected_at") or (snap.get("data") or {}).get("meta", {}).get("collected_at", "")
780
+ rows = (snap.get("data") or {}).get("dms_table_mappings") or []
781
+ for row in rows:
782
+ tid = str(row.get("task", "")).strip()
783
+ if not tid:
784
+ continue
785
+ task_ts.setdefault(tid, ts)
786
+ ssch = str(row.get("schema", "")).lower()
787
+ stbl = str(row.get("table", "")).lower()
788
+ tsch = str(row.get("target_schema", ssch)).lower()
789
+ ttbl = str(row.get("target_table", stbl)).lower()
790
+ task_pairs.setdefault(tid, []).append({
791
+ "source": f"{ssch}.{stbl}", "target": f"{tsch}.{ttbl}",
792
+ "via": f"live-snapshot:{task_ts[tid]}", "pattern": "%" in ssch or "%" in stbl,
793
+ })
794
+ return {tid: (task_ts[tid], task_pairs[tid]) for tid in task_pairs}
795
+
796
+
797
+ def assemble(scan: Any, per_file: dict[str, dict[str, Any]], revision: str, hub: Path | None = None) -> dict[str, Any]:
717
798
  resources: list[dict[str, Any]] = []
718
799
  variables: dict[str, str] = {}
719
800
  locals_: dict[str, str] = {}
@@ -752,13 +833,29 @@ def assemble(scan: Any, per_file: dict[str, dict[str, Any]], revision: str) -> d
752
833
  nodes.append(node)
753
834
  seen = set()
754
835
  unresolved = [u for u in ctx.unresolved if not (repr(u) in seen or seen.add(repr(u)))]
836
+ snap_dms = _load_snap_dms(hub) if hub is not None else {}
837
+ warnings: list[str] = []
838
+ for node in nodes:
839
+ if node["type"] != "aws_dms_replication_task":
840
+ continue
841
+ tid = node["id"][4:] if node.get("id", "").startswith("dms:") else ""
842
+ snap = snap_dms.get(tid)
843
+ if not node["pairs"] and snap is not None:
844
+ _, snap_pairs = snap
845
+ node["pairs"] = sorted(snap_pairs, key=lambda p: (p["source"], p["target"]))
846
+ node["snapshot_fallback"] = True
847
+ elif node["pairs"] and snap is not None:
848
+ static_set = {(p["source"], p["target"]) for p in node["pairs"]}
849
+ snap_set = {(p["source"], p["target"]) for p in snap[1]}
850
+ if static_set.symmetric_difference(snap_set):
851
+ warnings.append(f"mapping drift: {tid}")
755
852
  return {"scan": scan.name, "type": "terraform", "project": scan.project_name, "revision": revision, "nodes": nodes,
756
853
  "unresolved_refs": sorted(unresolved, key=lambda u: (u["name"], u["referenced_by"])),
757
854
  "stats": {"files": len(per_file), "resources": len(nodes), "data_nodes": sum(1 for n in nodes if n["data"]),
758
855
  "edges": sum(len(n["reads"]) + len(n["writes"]) + 2 * len(n["pairs"]) for n in nodes),
759
856
  "unresolved_refs": len(unresolved), "parse_errors": len(errors),
760
857
  "parser": ",".join(sorted(parsers)) or "regex"},
761
- "errors": errors, "types": dict(sorted(types.items()))}
858
+ "errors": errors, "types": dict(sorted(types.items())), "warnings": warnings}
762
859
 
763
860
 
764
861
  def list_files(scan: Any, root: Path) -> dict[str, Path]:
@@ -11,7 +11,11 @@ ROOT = Path(__file__).resolve().parents[2]
11
11
  def test_versions_agree():
12
12
  py = re.search(r'^version = "([^"]+)"', (ROOT / "cli" / "pyproject.toml").read_text(), re.M).group(1)
13
13
  plugin = json.loads((ROOT / ".claude-plugin" / "plugin.json").read_text())["version"]
14
+ market = [p.get("version") for p in json.loads((ROOT / ".claude-plugin" / "marketplace.json").read_text())["plugins"]]
14
15
  assert py == plugin == de_agent.__version__
16
+ assert market == [plugin] # `claude plugin validate --strict` fails on a mismatch
17
+ status = re.search(r"^Status: v([0-9][^.\s]*\.[0-9]+\.[0-9]+)", (ROOT / "README.md").read_text(), re.M)
18
+ assert status and status.group(1) == py # README header said v0.2.4 for two releases
15
19
 
16
20
 
17
21
  def test_marketplace_names_the_plugin():
@@ -42,6 +42,13 @@ CASES = [
42
42
  ("done-section-ignored", "## Done\n- 2026-11-01 finished thing\n- 2026-11-02 other\n", [], []),
43
43
  ("section-ends-at-next-heading", "## Dated\n- 2026-11-10 a\n\n## Recently done\n- 2026-11-09 b\n", ["2026-11-10"], []),
44
44
  ("bullet-without-date-ignored", "## Dated\n- check the thing\n- 2026-13-45 bad date\n", [], []),
45
+ # v0.3.3: partial strike covering the date is done; strike not covering the date is still open
46
+ ("bullet-partial-strike-done",
47
+ "## Dated\n- ~~**2026-11-08 verify** thing~~ outcome text\n- 2026-11-09 open\n",
48
+ ["2026-11-09"], ["2026-11-09"]),
49
+ ("bullet-strike-not-on-date",
50
+ "## Dated\n- **2026-11-08 task** ~~old note~~\n",
51
+ ["2026-11-08"], ["2026-11-08"]),
45
52
  ]
46
53
 
47
54
 
@@ -0,0 +1,138 @@
1
+ """v0.3.3: DMS lineage from Terraform-managed tasks (data sources, var IDs, renames, snapshot fallback, drift)."""
2
+ import json
3
+
4
+ from de_agent.scanners.terraform import _apply_dms_rename, assemble, scan_terraform_text
5
+
6
+ # TF shaped like the real repo: data source target, var task id, computed mappings
7
+ FIXTURE_VAR_TF = '''
8
+ variable "task_id" {
9
+ type = string
10
+ default = "test-api-backend-secrets-demo"
11
+ }
12
+ variable "target_ep_id" {
13
+ type = string
14
+ }
15
+ data "aws_dms_endpoint" "target" {
16
+ endpoint_id = var.target_ep_id
17
+ endpoint_type = "target"
18
+ engine_name = "postgres"
19
+ }
20
+ resource "aws_dms_replication_task" "demo" {
21
+ replication_task_id = var.task_id
22
+ target_endpoint_arn = data.aws_dms_endpoint.target.endpoint_arn
23
+ table_mappings = jsonencode(local.table_mappings)
24
+ }
25
+ '''
26
+
27
+ # TF with literal JSON + schema rename
28
+ FIXTURE_RENAME_TF = '''
29
+ data "aws_dms_endpoint" "tgt" {
30
+ endpoint_id = "tgt-pg"
31
+ endpoint_type = "target"
32
+ engine_name = "postgres"
33
+ }
34
+ resource "aws_dms_replication_task" "task" {
35
+ replication_task_id = "my-task"
36
+ target_endpoint_arn = data.aws_dms_endpoint.tgt.endpoint_arn
37
+ table_mappings = <<EOT
38
+ {"rules": [
39
+ {"rule-type": "selection", "rule-id": "1", "rule-action": "include",
40
+ "schema-name": "api_backend", "table-name": "users"},
41
+ {"rule-type": "selection", "rule-id": "2", "rule-action": "include",
42
+ "schema-name": "api_backend", "table-name": "accounts"},
43
+ {"rule-type": "transformation", "rule-id": "3", "rule-action": "rename",
44
+ "rule-target": "schema", "schema-name": "api_backend", "value": "test_api_backend"}
45
+ ]}
46
+ EOT
47
+ }
48
+ '''
49
+
50
+
51
+ def _snap_fixture(tmp_path, rows, ts="2026-11-20T00:00:00Z"):
52
+ snap_dir = tmp_path / ".dea" / "snapshots" / "2026-11-20T00"
53
+ snap_dir.mkdir(parents=True)
54
+ (snap_dir / "aws_main.json").write_text(json.dumps({
55
+ "collected_at": ts, "data": {"dms_table_mappings": rows}
56
+ }))
57
+ return tmp_path
58
+
59
+
60
+ def _tables():
61
+ return [{"task": "test-api-backend-secrets-demo", "schema": "api_backend", "table": t,
62
+ "target_schema": "test_api_backend", "target_table": t}
63
+ for t in ["users", "accounts", "orders", "payments", "trades",
64
+ "positions", "sessions", "logs", "events"]]
65
+
66
+
67
+ class _Scan:
68
+ name = "infra"
69
+ project_name = "test"
70
+ dialect = "postgres"
71
+
72
+
73
+ def _run(tf_text, hub=None):
74
+ pf = {"main.tf": scan_terraform_text(tf_text, "main.tf", "postgres")}
75
+ return assemble(_Scan(), pf, "rev", hub=hub)
76
+
77
+
78
+ def test_data_source_not_unresolved():
79
+ """data.aws_dms_endpoint.target is resolved; not in unresolved_refs."""
80
+ r = _run(FIXTURE_VAR_TF)
81
+ assert not any("target_endpoint_arn" in u["name"] for u in r["unresolved_refs"])
82
+
83
+
84
+ def test_var_task_id_resolves():
85
+ """replication_task_id = var.task_id -> dms:test-api-backend-secrets-demo."""
86
+ r = _run(FIXTURE_VAR_TF)
87
+ node = next(n for n in r["nodes"] if n["type"] == "aws_dms_replication_task")
88
+ assert node["id"] == "dms:test-api-backend-secrets-demo"
89
+
90
+
91
+ def test_snapshot_fallback_9_pairs(tmp_path):
92
+ """computed table_mappings + snapshot -> 9 pairs with renamed target schema, via live-snapshot."""
93
+ hub = _snap_fixture(tmp_path, _tables())
94
+ r = _run(FIXTURE_VAR_TF, hub=hub)
95
+ node = next(n for n in r["nodes"] if n["type"] == "aws_dms_replication_task")
96
+ assert len(node["pairs"]) == 9
97
+ assert all(p["target"].startswith("test_api_backend.") for p in node["pairs"])
98
+ assert all("live-snapshot:" in p.get("via", "") for p in node["pairs"])
99
+ assert node.get("snapshot_fallback") is True
100
+
101
+
102
+ def test_rename_applied_to_static_pairs():
103
+ """Static literal mapping + schema rename -> target uses renamed schema."""
104
+ r = _run(FIXTURE_RENAME_TF)
105
+ node = next(n for n in r["nodes"] if n["type"] == "aws_dms_replication_task")
106
+ targets = {p["target"] for p in node["pairs"]}
107
+ assert targets == {"test_api_backend.users", "test_api_backend.accounts"}
108
+ assert not node.get("snapshot_fallback")
109
+
110
+
111
+ def test_drift_warning(tmp_path):
112
+ """Static pairs and snapshot disagree -> drift warning, no failure."""
113
+ # snapshot for my-task has 3 pairs; static mapping has 2 -> drift
114
+ drift_rows = [{"task": "my-task", "schema": "api_backend", "table": t,
115
+ "target_schema": "test_api_backend", "target_table": t}
116
+ for t in ["users", "accounts", "orders"]]
117
+ hub = _snap_fixture(tmp_path, drift_rows)
118
+ r = _run(FIXTURE_RENAME_TF, hub=hub)
119
+ assert any("mapping drift" in w and "my-task" in w for w in r.get("warnings", []))
120
+
121
+
122
+ def test_no_snapshot_no_pairs():
123
+ """No snapshot + computed mappings -> empty pairs (existing behaviour)."""
124
+ r = _run(FIXTURE_VAR_TF, hub=None)
125
+ node = next(n for n in r["nodes"] if n["type"] == "aws_dms_replication_task")
126
+ assert node["pairs"] == []
127
+
128
+
129
+ def test_apply_dms_rename_schema():
130
+ assert _apply_dms_rename("api_backend", "users",
131
+ [{"type": "transformation", "action": "rename", "target": "schema",
132
+ "schema": "api_backend", "value": "test_api_backend"}]) == ("test_api_backend", "users")
133
+
134
+
135
+ def test_apply_dms_rename_no_match():
136
+ assert _apply_dms_rename("other", "tbl",
137
+ [{"type": "transformation", "action": "rename", "target": "schema",
138
+ "schema": "api_backend", "value": "test_api_backend"}]) == ("other", "tbl")
@@ -1 +0,0 @@
1
- __version__ = "0.3.2"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes