Repository navigation
Conversation
…ly when every check passes (CP-126) Built from template-job's harness, unchanged (run lock, window and catch-up, time limit, job-missed and job-failed alerts, audit, tracing). - A run builds every model in <schema>_build, runs dbt's tests and the template's control totals (all blocking), checks data classes, applies retention, then swaps the build schema in, in one transaction, with readers' grants and tenant row security re-applied. - Data classes through SQL (sqlglot column lineage): a column must be at least as sensitive as what it's made from, unless it goes through valxel_tokenize, valxel_generalize_year or an aggregate under valxel_min_group(11). transform-check prints the report; CI runs it. - Tokens: HMAC with a key from a mounted secret, through PGOPTIONS, never in SQL or dbt's artifacts; no key, no tokens. - Deletions: incremental marts remove what's gone at the source; a generic test proves a deleted record leaves every mart carrying it; an unquoted hook (rendered at parse time, removing nothing) fails the check. - Least privilege (transform-admin grants), marts-only reader access, security_invoker views, time-boxed audited break-glass. - Evidence per run (manifest, run results, data-class report, summary) and a valxel.transform.run line; transform.published audit record. - transform-dev on a seeded Postgres; conformance runs a real seeded run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FsRHvp6Xroi64RED1Rqpyq
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
| raise SystemExit(f"GITHUB_API_URL must be an https URL, not {api.geturl()!r}") | ||
| body = json.dumps({"state": state, "context": args.context, "description": text[:140], | ||
| "target_url": args.url}) | ||
| conn = http.client.HTTPSConnection(api.hostname, api.port or 443, timeout=30) |
| raise ValueError(f"not a file name: {name!r}") | ||
| Path(d, name).write_text(str(value), encoding="utf-8") | ||
| os.chmod(Path(d, name), 0o640) # the image's user reads them through this group (App adds it) | ||
| os.chmod(d, 0o750) |
- Semgrep's SQLAlchemy raw-query rule flags psycopg's sql composition. Every statement now goes through pg.execute, which takes only fixed text or psycopg-composed SQL, with one nosemgrep saying why. - The tenant test builds the reader's connection with make_conninfo, so it works with CI's postgres:postgres URL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FsRHvp6Xroi64RED1Rqpyq
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CP-126, step 1: Postgres. The template for the new
transformrole: dbt models over the reporting store, published only when every check passes. Snowflake follows in a second PR. The tool side is CP-127.Built from template-job's harness, unchanged: run lock, window and catch-up, time limit,
job-missedandjob-failed, audit and tracing.src/job/work.pycallssrc/transform/run.py.A run
<schema>_build, with each incremental mart's live table copied in.dbt build: models and tests, all blocking, control totals included.security_invokerviews are re-applied. A failure anywhere before this publishes nothing, and readers keep the last good marts.valxel.transform.runline and atransform.publishedaudit record.The design's acceptance criteria
transform/classes.py(sqlglot column lineage):valxel_tokenize,valxel_generalize_year, andcount/sum/avgundervalxel_min_group(11)de-identify;secretnever does.transform-checkin CItest_classes.py(17 cases); a downgraded mart publishes nothingvalxel_control_total(equal/at_most, tolerance)transform-admin grantsrenders it fromsources.ymltest_the_grants_name_only_the_declared_sourcespg.reader_grants,transform-admin break-glass(max 240 min)valxel_deletionshookrun._evidenceWorth a careful look
valxel.tokenize. The key reaches each session only through libpq'sPGOPTIONS, from a mounted secret, so it isn't in SQL, dbt's logs or artifacts. A session with no key, or a short one, fails instead of producing guessable tokens.transform-checknow fails it.security_invoker.TRANSFORM_SEED_SYNTHETICis refused outsidecianddev. The flags check is dropped because a transform reads no flag.Checks run here
Needs a repo setting
Please mark the repo as a template repository (Settings → Template repository), like the other
template-*repos. This session can't change repo settings.Generated by Claude Code