Skip to content

Demo s027: SSN exposed in mart - #28

Open
anandgupta42 wants to merge 1 commit into
mainfrom
demo/s027-new-ssn-pii
Open

Demo s027: SSN exposed in mart#28
anandgupta42 wants to merge 1 commit into
mainfrom
demo/s027-new-ssn-pii

Conversation

@anandgupta42

Copy link
Copy Markdown
Contributor

Demo scenario

  • Scenario ID: s027
  • Branch: demo/s027-new-ssn-pii
  • Risk category: pii_exposure
  • Expected reviewer verdict: REQUEST_CHANGES
  • Expected deterministic evidence: altimate_core.classify_pii and lineage impact

Customer walkthrough

Blocks high-risk identifier exposure.

When presenting this PR, first show that dbt can build the project, then show the reviewer finding. The point is that the reviewer catches or ignores the change from deterministic dbt/SQL evidence, not from advisory AI text.

Validation command

rm -f demo.duckdb demo.duckdb.wal
dbt build --profiles-dir . --target dev
dbt compile --profiles-dir . --target dev
dbt docs generate --profiles-dir . --target dev
bun --conditions=browser /Users/anandgupta/codebase/altimate-code/packages/opencode/src/index.ts review \
  --cwd=/Users/anandgupta/codebase/altimate-code/demo/dbt-pr-review-demo \
  --base=main \
  --head=HEAD \
  --mode=gate \
  --manifest=/Users/anandgupta/codebase/altimate-code/demo/dbt-pr-review-demo/target/manifest.json \
  --json \
  --no-ai

Acceptance notes

  • DuckDB default warehouse.
  • AI disabled with --no-ai.
  • Included in the final local corpus matrix: 50/50 branches matched expected verdicts.
  • Real-world corpus floor held at 15/15 caught bad cases and 0/5 false positives.

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown

💬 Reviewed with comments — 1 critical, 8 warning, 4 suggestion (lite tier)

⚙️ Lint-only run — no dbt manifest/warehouse was available, so lineage, equivalence and
data-impact checks were skipped. Wire manifest_path (and optionally warehouse creds) for the full verdict.

🛑 Critical (1)

  • fct_customer_orders: PII column added to a marts/reporting model
    A PII-named column was added to a model in marts//reporting/, widening PII exposure into a broadly-read layer. Confirm the column is needed here, that masking/access policy applies, and that the downstream grant is appropriate.
    models/marts/fct_customer_orders.sql · pii_exposure

⚠️ Warning (8)

  • fct_customer_orders: PII columns selected
    Email/SSN/phone/DOB pulled into a model widens PII exposure; confirm it's needed and masked.
    models/marts/fct_customer_orders.sql · pii_exposure
  • fct_customer_orders: refactor could not be proven equivalent
    The logic of fct_customer_orders changed and equivalence could not be decided (no schema, or unsupported SQL). Treat as a potential behavior change and verify with a data-diff.
    models/marts/fct_customer_orders.sql · unverified · semantic_change
  • fct_customer_orders: exposes SSN column ssn
    This change surfaces a SSN-classified column ssn (confidence 98%). Confirm masking / access policy before merging to a non-restricted schema; suggested masking: '***MASKED***'.
    models/marts/fct_customer_orders.sql · pii_exposure
  • fct_customer_orders: exposes Name column customer_name
    This change surfaces a Name-classified column customer_name (confidence 75%). Confirm masking / access policy before merging to a non-restricted schema; suggested masking: '***MASKED***'.
    models/marts/fct_customer_orders.sql · pii_exposure
  • stg_customers: refactor could not be proven equivalent
    The logic of stg_customers changed and equivalence could not be decided (no schema, or unsupported SQL). Treat as a potential behavior change and verify with a data-diff.
    models/staging/stg_customers.sql · unverified · semantic_change
  • stg_customers: exposes Name column customer_name
    This change surfaces a Name-classified column customer_name (confidence 75%). Confirm masking / access policy before merging to a non-restricted schema; suggested masking: '***MASKED***'.
    models/staging/stg_customers.sql · pii_exposure
  • stg_customers: exposes Email column email
    This change surfaces a Email-classified column email (confidence 95%). Confirm masking / access policy before merging to a non-restricted schema; suggested masking: '***MASKED***'.
    models/staging/stg_customers.sql · pii_exposure
  • stg_customers: Missing not-null test for new column ssn
    The new ssn column should have a corresponding not_null test in the staging model's schema to ensure data integrity.
    models/staging/stg_customers.sql · test_coverage

💡 Suggestion (4)

  • fct_customer_orders: missing_table_alias
    Multi-table query without aliases for: orders, customers
    models/marts/fct_customer_orders.sql:8 · sql_quality
  • fct_customer_orders: LEFT JOIN may produce null SSN for unmatched orders
    If the intent is to always include SSN for all orders, consider using INNER JOIN or adding a test to verify no orders have null SSN after the join.
    models/marts/fct_customer_orders.sql:26 · join_risk
  • stg_customers: high downstream fan-out (1 model)
    stg_customers has 1 direct and 0 transitive downstream models (+6 tests). Blast radius is informational — verify the change is backward-compatible (no removed/renamed columns) for these consumers.
    models/staging/stg_customers.sql · lineage_breakage
  • stg_customers: Redshift: VARCHAR without length defaults to 256
    Redshift VARCHAR defaults to 256 chars and truncates silently; size it explicitly for long text.
    models/staging/stg_customers.sql · contract_violation

altimate dbt-pr-review · verdict COMMENT · signed sha256:96c7f27719a… · manifest d4e988a190

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💬 Reviewed with comments — 1 critical, 8 warning, 4 suggestion (lite tier)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant