create-dql-app 1.6.0 → 1.6.2
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.
- package/README.md +9 -13
- package/bin/create-dql-app.mjs +16 -8
- package/package.json +2 -2
- package/templates/starter/README.md +55 -0
- package/templates/starter/gitignore +17 -0
- package/templates/starter/notebooks/welcome.dqlnb +35 -0
- package/templates/{jaffle-shop → starter}/package.json +7 -4
- package/templates/acme-bank/.dql/skills/mei.chen@acme-bank.com/cards-fraud.skill.md +0 -15
- package/templates/acme-bank/.dql/skills/sara.fitch@acme-bank.com/cfo-weekly.skill.md +0 -15
- package/templates/acme-bank/README.md +0 -75
- package/templates/acme-bank/apps/cards-ops/README.md +0 -9
- package/templates/acme-bank/apps/cards-ops/dashboards/daily-ops.dqld +0 -65
- package/templates/acme-bank/apps/cards-ops/dashboards/fraud-watch.dqld +0 -37
- package/templates/acme-bank/apps/cards-ops/dql.app.json +0 -89
- package/templates/acme-bank/apps/cards-ops/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/cards-ops/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/executive-cockpit/README.md +0 -9
- package/templates/acme-bank/apps/executive-cockpit/dashboards/bank-overview.dqld +0 -57
- package/templates/acme-bank/apps/executive-cockpit/dql.app.json +0 -82
- package/templates/acme-bank/apps/executive-cockpit/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/executive-cockpit/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/retail-deposits/README.md +0 -9
- package/templates/acme-bank/apps/retail-deposits/dashboards/deposit-growth.dqld +0 -48
- package/templates/acme-bank/apps/retail-deposits/dql.app.json +0 -59
- package/templates/acme-bank/apps/retail-deposits/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/retail-deposits/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/risk-office/README.md +0 -8
- package/templates/acme-bank/apps/risk-office/dashboards/credit-risk.dqld +0 -48
- package/templates/acme-bank/apps/risk-office/dql.app.json +0 -57
- package/templates/acme-bank/apps/risk-office/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/risk-office/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/blocks/cards/card_approval_rate.dql +0 -24
- package/templates/acme-bank/blocks/cards/daily_transaction_volume.dql +0 -34
- package/templates/acme-bank/blocks/cards/fraud_alerts_by_region.dql +0 -33
- package/templates/acme-bank/blocks/cards/fraud_by_merchant_recent.dql +0 -33
- package/templates/acme-bank/blocks/deposits/branch_deposit_leaders.dql +0 -30
- package/templates/acme-bank/blocks/deposits/deposit_trend.dql +0 -30
- package/templates/acme-bank/blocks/deposits/deposits_by_segment.dql +0 -33
- package/templates/acme-bank/blocks/executive/bank_health_scorecard.dql +0 -34
- package/templates/acme-bank/blocks/lending/high_risk_loan_exposure.dql +0 -31
- package/templates/acme-bank/blocks/lending/loan_delinquency_by_region.dql +0 -32
- package/templates/acme-bank/data/customers.csv +0 -12
- package/templates/acme-bank/data/deposits.csv +0 -22
- package/templates/acme-bank/data/fraud_alerts.csv +0 -9
- package/templates/acme-bank/data/loans.csv +0 -11
- package/templates/acme-bank/data/merchants.csv +0 -10
- package/templates/acme-bank/data/transactions.csv +0 -20
- package/templates/acme-bank/dql.config.json +0 -21
- package/templates/acme-bank/notebooks/cards_fraud_ops.dqlnb +0 -47
- package/templates/acme-bank/notebooks/credit_risk_review.dqlnb +0 -42
- package/templates/acme-bank/notebooks/executive_weekly_review.dqlnb +0 -47
- package/templates/acme-bank/notebooks/retail_deposits_review.dqlnb +0 -42
- package/templates/acme-bank/notebooks/welcome.dqlnb +0 -44
- package/templates/acme-bank/package.json +0 -18
- package/templates/acme-bank/semantic-layer/dimensions/banking.yaml +0 -36
- package/templates/acme-bank/semantic-layer/metrics/banking.yaml +0 -37
- package/templates/empty/README.md +0 -19
- package/templates/empty/dql.config.json +0 -13
- package/templates/empty/notebooks/welcome.dqlnb +0 -21
- package/templates/empty/package.json +0 -13
- package/templates/jaffle-shop/README.md +0 -48
- package/templates/jaffle-shop/blocks/revenue_by_segment.dql +0 -26
- package/templates/jaffle-shop/dashboards/overview.dql +0 -27
- package/templates/jaffle-shop/notebooks/welcome.dqlnb +0 -33
- package/templates/jaffle-shop/semantic-layer/dimensions/customer.yaml +0 -14
- package/templates/jaffle-shop/semantic-layer/metrics/revenue.yaml +0 -9
- /package/templates/{jaffle-shop → starter}/dql.config.json +0 -0
package/README.md
CHANGED
|
@@ -13,25 +13,21 @@ Opens a running notebook at <http://127.0.0.1:3474> in under 5 minutes on a
|
|
|
13
13
|
clean machine. No global install required; the template installs
|
|
14
14
|
`@duckcodeailabs/dql-cli` locally and exposes it through npm scripts.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
The scaffolded project is a clean starter: `dql.config.json` (DuckDB
|
|
17
|
+
in-memory by default — bring your own warehouse), a welcome notebook, and npm
|
|
18
|
+
scripts for `notebook`, `compile`, `lineage`, `doctor`, and `validate`. If a
|
|
19
|
+
sibling dbt project is detected, it is wired into `dql.config.json`
|
|
20
|
+
automatically so `dql sync dbt` works out of the box.
|
|
17
21
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
| `acme-bank` | Banking OSS release walkthrough with sample data, certified blocks, sample notebooks, Apps, dashboards, governance, schedules, and agent Skills |
|
|
22
|
-
| `empty` | Just `dql.config.json` and project layout - bring your own warehouse |
|
|
23
|
-
|
|
24
|
-
```bash
|
|
25
|
-
npx create-dql-app@latest acme-bank --template acme-bank
|
|
26
|
-
npx create-dql-app@latest finance-reports --template empty
|
|
27
|
-
```
|
|
22
|
+
Want a ready-made dbt project to try DQL on? Clone the example repo and add
|
|
23
|
+
DQL to it — the same steps you'd use on your own dbt repo:
|
|
24
|
+
[github.com/duckcode-ai/jaffle-shop-duckdb](https://github.com/duckcode-ai/jaffle-shop-duckdb).
|
|
28
25
|
|
|
29
26
|
## Flags
|
|
30
27
|
|
|
31
28
|
| Flag | Default | Meaning |
|
|
32
29
|
| --- | --- | --- |
|
|
33
|
-
| `--template <name>` | `
|
|
34
|
-
| `--no-install` | off | Skip downloading the Jaffle Shop seed data |
|
|
30
|
+
| `--template <name>` | `starter` | Starter template |
|
|
35
31
|
|
|
36
32
|
## Docs
|
|
37
33
|
|
package/bin/create-dql-app.mjs
CHANGED
|
@@ -37,19 +37,21 @@ Usage:
|
|
|
37
37
|
npx create-dql-app@latest <project-dir> [options]
|
|
38
38
|
|
|
39
39
|
Options:
|
|
40
|
-
--template <name> Starter template
|
|
40
|
+
--template <name> Starter template (default: starter)
|
|
41
41
|
--help, -h Show this help
|
|
42
42
|
--version, -v Show version
|
|
43
43
|
|
|
44
44
|
Examples:
|
|
45
45
|
npx create-dql-app@latest my-analytics
|
|
46
|
-
npx create-dql-app@latest
|
|
47
|
-
|
|
46
|
+
npx create-dql-app@latest dql --template starter # inside your dbt repo
|
|
47
|
+
|
|
48
|
+
Want a ready-made dbt project to try DQL on?
|
|
49
|
+
git clone https://github.com/duckcode-ai/jaffle-shop-duckdb
|
|
48
50
|
`);
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
function parseArgs(argv) {
|
|
52
|
-
const args = { dir: null, template: '
|
|
54
|
+
const args = { dir: null, template: 'starter' };
|
|
53
55
|
for (let i = 0; i < argv.length; i++) {
|
|
54
56
|
const a = argv[i];
|
|
55
57
|
if (a === '--help' || a === '-h') { usage(); process.exit(0); }
|
|
@@ -69,7 +71,9 @@ function copyDir(src, dst) {
|
|
|
69
71
|
mkdirSync(dst, { recursive: true });
|
|
70
72
|
for (const entry of readdirSync(src)) {
|
|
71
73
|
const s = join(src, entry);
|
|
72
|
-
|
|
74
|
+
// npm strips .gitignore files from published tarballs, so templates ship
|
|
75
|
+
// it as "gitignore" and we restore the dot on scaffold.
|
|
76
|
+
const d = join(dst, entry === 'gitignore' ? '.gitignore' : entry);
|
|
73
77
|
if (statSync(s).isDirectory()) copyDir(s, d);
|
|
74
78
|
else writeFileSync(d, readFileSync(s));
|
|
75
79
|
}
|
|
@@ -152,9 +156,13 @@ async function main() {
|
|
|
152
156
|
console.log(c.dim(` wired into dql.config.json — run 'dql sync dbt' to import\n`));
|
|
153
157
|
}
|
|
154
158
|
|
|
155
|
-
// Best-effort:
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
// Best-effort: `git init` for a clean first commit — but never nest a
|
|
160
|
+
// repo inside an existing one (e.g. scaffolding ./dql inside a dbt repo).
|
|
161
|
+
const inRepo = spawnSync('git', ['rev-parse', '--is-inside-work-tree'], { cwd: target });
|
|
162
|
+
if (inRepo.status !== 0) {
|
|
163
|
+
const gitResult = spawnSync('git', ['init', '-q'], { cwd: target });
|
|
164
|
+
if (gitResult.status === 0) console.log(c.dim(' initialized git repo'));
|
|
165
|
+
}
|
|
158
166
|
|
|
159
167
|
const pm = detectPackageManager();
|
|
160
168
|
const installCmd = pm === 'npm' ? 'npm install' : `${pm} install`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-dql-app",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "Scaffold a new DQL project. Run with: npx create-dql-app <name>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "DuckCode AI Labs",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"type": "module",
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=20"
|
|
31
|
+
"node": ">=20 <23"
|
|
32
32
|
},
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# {{PROJECT_NAME}}
|
|
2
|
+
|
|
3
|
+
A DQL project scaffolded by `create-dql-app`.
|
|
4
|
+
|
|
5
|
+
DQL means **Domain Query Language**. It is the open-source analytics language
|
|
6
|
+
for turning source data, SQL, dbt models, business terms, notebooks,
|
|
7
|
+
dashboards, apps, and lineage into one Git-versioned project.
|
|
8
|
+
|
|
9
|
+
The core path is:
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
source data -> DQL block -> business_view -> dashboard/app/AI answer
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Run `dql compile .` to produce `dql-manifest.json`, the local manifest that
|
|
16
|
+
connects technical lineage with business lineage.
|
|
17
|
+
|
|
18
|
+
## Connect your warehouse
|
|
19
|
+
|
|
20
|
+
Edit `dql.config.json` — DQL ships 15 drivers out of the box:
|
|
21
|
+
[docs/reference/connectors.md](https://github.com/duckcode-ai/dql/blob/main/docs/reference/connectors.md).
|
|
22
|
+
The default connection is in-memory DuckDB, so dropping a CSV into the project
|
|
23
|
+
and querying it with `read_csv_auto('./file.csv')` works with zero setup.
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install
|
|
27
|
+
npm run doctor
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Start the notebook
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
npm run notebook
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Open `notebooks/welcome.dqlnb` first. It shows the starter workflow:
|
|
37
|
+
|
|
38
|
+
1. Explore data with SQL.
|
|
39
|
+
2. Promote repeated logic into reusable DQL blocks under `blocks/`.
|
|
40
|
+
3. Define shared vocabulary under `terms/`.
|
|
41
|
+
4. Compose business outcomes under `business-views/`.
|
|
42
|
+
5. Use Lineage to trace source data into business views and consumption.
|
|
43
|
+
|
|
44
|
+
## Have a dbt project?
|
|
45
|
+
|
|
46
|
+
Point `dql.config.json` at it (auto-wired if a sibling dbt project was
|
|
47
|
+
detected at scaffold time), then:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
dbt parse # inside the dbt project
|
|
51
|
+
npx dql sync dbt # import models + lineage into DQL
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
No dbt project handy? Try the example repo:
|
|
55
|
+
[github.com/duckcode-ai/jaffle-shop-duckdb](https://github.com/duckcode-ai/jaffle-shop-duckdb).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dqlnbVersion": 1,
|
|
3
|
+
"version": 1,
|
|
4
|
+
"title": "{{PROJECT_NAME}} - DQL Workbench",
|
|
5
|
+
"metadata": {
|
|
6
|
+
"title": "{{PROJECT_NAME}} - DQL Workbench",
|
|
7
|
+
"description": "DQL starter workbench for building domain-first analytics."
|
|
8
|
+
},
|
|
9
|
+
"cells": [
|
|
10
|
+
{
|
|
11
|
+
"id": "intro",
|
|
12
|
+
"type": "markdown",
|
|
13
|
+
"title": "Welcome",
|
|
14
|
+
"source": "# {{PROJECT_NAME}}\n\nDQL means **Domain Query Language**. It turns SQL, business terms, notebooks, dashboards, apps, and lineage into one trusted analytics project.\n\n**Core path:** source data -> DQL block -> business_view -> dashboard/app/AI answer.\n\nUse this notebook as your workbench: explore data, promote repeated SQL into reusable blocks, define business vocabulary, and compile the project manifest for lineage and AI-ready context."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"id": "starter_query",
|
|
18
|
+
"type": "sql",
|
|
19
|
+
"title": "Starter Query",
|
|
20
|
+
"source": "-- If using DuckDB, local CSV, Parquet, and JSON files work with zero setup\n-- Example: SELECT * FROM read_csv_auto('./data/my_file.csv') LIMIT 10;\nselect 1 as customer_count"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"id": "domain_layer",
|
|
24
|
+
"type": "dql",
|
|
25
|
+
"title": "Example Domain Layer",
|
|
26
|
+
"source": "term \"Customer\" {\n domain = \"Customer\"\n type = \"entity\"\n status = \"draft\"\n description = \"A person or account that can place orders or receive service.\"\n owner = \"customer-analytics\"\n identifiers = [\"customer_id\"]\n}\n\nblock \"Example Customer Rollup\" {\n domain = \"Customer\"\n type = \"custom\"\n status = \"draft\"\n description = \"Starter customer summary block. Replace this query with your own source table.\"\n owner = \"analytics\"\n terms = [\"Customer\"]\n businessOutcome = \"Understand customer value and activity.\"\n decisionUse = \"Account planning and retention review.\"\n\n query = \"\"\"\n SELECT 1 AS customer_count\n \"\"\"\n\n tests {\n assert row_count == 1\n }\n}\n\nbusiness_view \"Customer 360\" {\n domain = \"Customer\"\n status = \"draft\"\n description = \"Business composition for account review and customer health.\"\n owner = \"customer-analytics\"\n terms = [\"Customer\"]\n businessOutcome = \"See customer identity, value, activity, and service risk in one lineage path.\"\n decisionUse = \"Account planning, churn review, and expansion targeting.\"\n reviewCadence = \"weekly\"\n\n includes {\n block \"Example Customer Rollup\"\n }\n}"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "next_steps",
|
|
30
|
+
"type": "markdown",
|
|
31
|
+
"title": "Next Steps",
|
|
32
|
+
"source": "## Next steps\n\n1. Connect a warehouse or query local files with DuckDB.\n2. Save repeated SQL as DQL blocks under `blocks/`.\n3. Add shared vocabulary under `terms/`.\n4. Compose business outcomes under `business-views/`.\n5. Run `dql compile .` and open Lineage to inspect technical and business paths."
|
|
33
|
+
}
|
|
34
|
+
]
|
|
35
|
+
}
|
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
"name": "{{PROJECT_NAME}}",
|
|
3
3
|
"version": "0.1.0",
|
|
4
4
|
"private": true,
|
|
5
|
-
"description": "DQL analytics project.",
|
|
6
5
|
"scripts": {
|
|
7
6
|
"notebook": "dql notebook",
|
|
8
|
-
"compile": "dql compile",
|
|
9
7
|
"sync": "dql sync dbt",
|
|
8
|
+
"compile": "dql compile",
|
|
9
|
+
"lineage": "dql lineage",
|
|
10
10
|
"doctor": "dql doctor",
|
|
11
|
-
"
|
|
11
|
+
"validate": "dql validate"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@duckcodeailabs/dql-cli": "^1.
|
|
14
|
+
"@duckcodeailabs/dql-cli": "^1.6.2"
|
|
15
|
+
},
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20 <23"
|
|
15
18
|
}
|
|
16
19
|
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: cards-fraud-daily-ops
|
|
3
|
-
user: mei.chen@acme-bank.com
|
|
4
|
-
description: "Cards fraud analyst skill for Acme Bank daily operations"
|
|
5
|
-
preferred_metrics: [card_volume, fraud_exposure]
|
|
6
|
-
vocabulary:
|
|
7
|
-
"fraud exposure": "block:fraud_alerts_by_region"
|
|
8
|
-
"approval rate": "block:card_approval_rate"
|
|
9
|
-
"merchant fraud": "block:fraud_by_merchant_recent"
|
|
10
|
-
---
|
|
11
|
-
Mei supports the Cards Operations App. Default to certified cards-domain blocks
|
|
12
|
-
first. Always cite the block id and certification status. When a question asks
|
|
13
|
-
about branch-level fraud, respect persona RLS fields `user.region` and
|
|
14
|
-
`user.branch`.
|
|
15
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
id: cfo-weekly-bank-review
|
|
3
|
-
user: sara.fitch@acme-bank.com
|
|
4
|
-
description: "CFO weekly bank health review"
|
|
5
|
-
preferred_metrics: [card_volume, fraud_exposure, deposit_balance, loan_outstanding]
|
|
6
|
-
vocabulary:
|
|
7
|
-
"bank health": "block:bank_health_scorecard"
|
|
8
|
-
"deposit growth": "block:deposit_trend"
|
|
9
|
-
"credit risk": "block:loan_delinquency_by_region"
|
|
10
|
-
---
|
|
11
|
-
Sara prepares a Monday executive review across cards, fraud, deposits, and
|
|
12
|
-
lending. Prefer the Executive Cockpit App and certified domain blocks. If the
|
|
13
|
-
agent proposes SQL that is not backed by a certified block, flag it as
|
|
14
|
-
uncertified and route it to analyst review.
|
|
15
|
-
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
# {{PROJECT_NAME}}
|
|
2
|
-
|
|
3
|
-
Acme Bank is a runnable end-to-end DQL OSS sample for a single local owner. It
|
|
4
|
-
models how a bank packages certified analytics into domain-specific Apps while
|
|
5
|
-
keeping all source artifacts in git.
|
|
6
|
-
|
|
7
|
-
## Run
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install
|
|
11
|
-
npm run compile
|
|
12
|
-
npm run app:build
|
|
13
|
-
npm run notebook
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
The notebook opens the local desktop UI. Click **Apps** to see packaged
|
|
17
|
-
dashboard pages, attached notebooks, and AI-ready certified blocks.
|
|
18
|
-
|
|
19
|
-
## What is included
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
data/ small DuckDB-readable CSV warehouse
|
|
23
|
-
blocks/ certified reusable DQL blocks by domain
|
|
24
|
-
apps/ OSS Apps with dql.app.json + .dqld dashboard pages
|
|
25
|
-
notebooks/ analyst notebook walkthrough
|
|
26
|
-
semantic-layer/ starter metric and dimension metadata
|
|
27
|
-
.dql/skills/ agent skills for banking personas
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
## Domains
|
|
31
|
-
|
|
32
|
-
| Domain | Business question | Certified blocks |
|
|
33
|
-
| --- | --- | --- |
|
|
34
|
-
| `cards` | Are card operations healthy and where is fraud concentrated? | `daily_transaction_volume`, `card_approval_rate`, `fraud_alerts_by_region`, `fraud_by_merchant_recent` |
|
|
35
|
-
| `deposits` | Are deposits growing by segment and branch? | `deposit_trend`, `deposits_by_segment`, `branch_deposit_leaders` |
|
|
36
|
-
| `lending` | Where is credit risk concentrated? | `loan_delinquency_by_region`, `high_risk_loan_exposure` |
|
|
37
|
-
| `executive` | What should CXO leaders review this week? | `bank_health_scorecard` plus cited domain blocks |
|
|
38
|
-
|
|
39
|
-
## Apps
|
|
40
|
-
|
|
41
|
-
| App | Audience | Homepage dashboard |
|
|
42
|
-
| --- | --- | --- |
|
|
43
|
-
| `cards-ops` | Head of Cards, fraud analyst, branch manager | `daily-ops` |
|
|
44
|
-
| `retail-deposits` | Retail banking leaders | `deposit-growth` |
|
|
45
|
-
| `risk-office` | Credit and fraud risk committee | `credit-risk` |
|
|
46
|
-
| `executive-cockpit` | CFO/COO weekly review | `bank-overview` |
|
|
47
|
-
|
|
48
|
-
Certified business logic stays in root `blocks/`. App folders contain metadata,
|
|
49
|
-
schedules, dashboard pages, optional notebooks, and `drafts/` for future
|
|
50
|
-
AI-generated work waiting for review.
|
|
51
|
-
|
|
52
|
-
## Sample notebooks
|
|
53
|
-
|
|
54
|
-
| Notebook | Use case |
|
|
55
|
-
| --- | --- |
|
|
56
|
-
| `notebooks/welcome.dqlnb` | Guided first run across raw SQL and certified blocks |
|
|
57
|
-
| `notebooks/cards_fraud_ops.dqlnb` | Cards volume, approval rate, fraud exposure, merchant watchlist |
|
|
58
|
-
| `notebooks/retail_deposits_review.dqlnb` | Deposit trend, segment balance, branch leaders |
|
|
59
|
-
| `notebooks/credit_risk_review.dqlnb` | Delinquency, probability of default, high-risk exposure |
|
|
60
|
-
| `notebooks/executive_weekly_review.dqlnb` | CXO weekly review across cards, deposits, and lending |
|
|
61
|
-
|
|
62
|
-
## Useful commands
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
npm run compile # writes dql-manifest.json
|
|
66
|
-
npm run app:build # validates Apps and dashboard references
|
|
67
|
-
npm run agent:reindex # builds the local SQLite/FTS agent knowledge graph
|
|
68
|
-
npm run verify # proves manifest output is reproducible
|
|
69
|
-
```
|
|
70
|
-
|
|
71
|
-
## Local persona preview
|
|
72
|
-
|
|
73
|
-
Apps are single-user OSS artifacts. There is no login, SSO, or hosted
|
|
74
|
-
multi-tenant behavior. Use the UI persona switcher to preview the real
|
|
75
|
-
PolicyEngine and RLS paths declared in `dql.app.json`.
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Cards Operations
|
|
2
|
-
|
|
3
|
-
Audience: Head of Cards, cards analyst, and branch operations leaders.
|
|
4
|
-
|
|
5
|
-
Homepage dashboard: `dashboards/daily-ops.dqld`
|
|
6
|
-
|
|
7
|
-
Certified blocks stay in root `blocks/cards/`. This App declares members,
|
|
8
|
-
policies, RLS bindings, a weekday daily digest, and a high-frequency fraud
|
|
9
|
-
watch schedule in `dql.app.json`.
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "daily-ops",
|
|
4
|
-
"metadata": {
|
|
5
|
-
"title": "Cards Daily Ops",
|
|
6
|
-
"description": "Certified cards operating dashboard for volume, approvals, and fraud exposure.",
|
|
7
|
-
"domain": "cards",
|
|
8
|
-
"subdomain": "fraud",
|
|
9
|
-
"groups": ["daily-ops", "merchant-risk"],
|
|
10
|
-
"audience": "operations",
|
|
11
|
-
"visibility": "shared",
|
|
12
|
-
"lifecycle": "review",
|
|
13
|
-
"tags": ["cards", "fraud", "ops"]
|
|
14
|
-
},
|
|
15
|
-
"filters": [
|
|
16
|
-
{ "id": "region", "type": "select", "options": ["NA-NE", "NA-W", "NA-SE", "EMEA"], "bindsTo": "region" }
|
|
17
|
-
],
|
|
18
|
-
"layout": {
|
|
19
|
-
"kind": "grid",
|
|
20
|
-
"cols": 12,
|
|
21
|
-
"rowHeight": 80,
|
|
22
|
-
"items": [
|
|
23
|
-
{
|
|
24
|
-
"i": "approval-rate",
|
|
25
|
-
"x": 0,
|
|
26
|
-
"y": 0,
|
|
27
|
-
"w": 3,
|
|
28
|
-
"h": 2,
|
|
29
|
-
"block": { "blockId": "card_approval_rate" },
|
|
30
|
-
"viz": { "type": "single_value" },
|
|
31
|
-
"title": "Approval Rate"
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"i": "transaction-volume",
|
|
35
|
-
"x": 3,
|
|
36
|
-
"y": 0,
|
|
37
|
-
"w": 9,
|
|
38
|
-
"h": 3,
|
|
39
|
-
"block": { "blockId": "daily_transaction_volume" },
|
|
40
|
-
"viz": { "type": "line" },
|
|
41
|
-
"title": "Daily Transaction Volume"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"i": "fraud-region",
|
|
45
|
-
"x": 0,
|
|
46
|
-
"y": 3,
|
|
47
|
-
"w": 6,
|
|
48
|
-
"h": 3,
|
|
49
|
-
"block": { "blockId": "fraud_alerts_by_region" },
|
|
50
|
-
"viz": { "type": "bar" },
|
|
51
|
-
"title": "Fraud Exposure by Region"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"i": "fraud-merchant",
|
|
55
|
-
"x": 6,
|
|
56
|
-
"y": 3,
|
|
57
|
-
"w": 6,
|
|
58
|
-
"h": 3,
|
|
59
|
-
"block": { "blockId": "fraud_by_merchant_recent" },
|
|
60
|
-
"viz": { "type": "bar" },
|
|
61
|
-
"title": "Fraud by Merchant"
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "fraud-watch",
|
|
4
|
-
"metadata": {
|
|
5
|
-
"title": "Fraud Watch",
|
|
6
|
-
"description": "High-frequency card fraud monitoring dashboard for Slack and analyst review.",
|
|
7
|
-
"domain": "cards",
|
|
8
|
-
"tags": ["cards", "fraud", "watchlist"]
|
|
9
|
-
},
|
|
10
|
-
"layout": {
|
|
11
|
-
"kind": "grid",
|
|
12
|
-
"cols": 12,
|
|
13
|
-
"rowHeight": 80,
|
|
14
|
-
"items": [
|
|
15
|
-
{
|
|
16
|
-
"i": "fraud-by-region",
|
|
17
|
-
"x": 0,
|
|
18
|
-
"y": 0,
|
|
19
|
-
"w": 12,
|
|
20
|
-
"h": 3,
|
|
21
|
-
"block": { "blockId": "fraud_alerts_by_region" },
|
|
22
|
-
"viz": { "type": "bar" },
|
|
23
|
-
"title": "Fraud Exposure by Region"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"i": "fraud-by-merchant",
|
|
27
|
-
"x": 0,
|
|
28
|
-
"y": 3,
|
|
29
|
-
"w": 12,
|
|
30
|
-
"h": 4,
|
|
31
|
-
"block": { "blockId": "fraud_by_merchant_recent" },
|
|
32
|
-
"viz": { "type": "table" },
|
|
33
|
-
"title": "Fraud Exposure by Merchant"
|
|
34
|
-
}
|
|
35
|
-
]
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "cards-ops",
|
|
4
|
-
"name": "Cards Operations",
|
|
5
|
-
"description": "Daily cards volume, approval health, and fraud monitoring for operations leaders.",
|
|
6
|
-
"visibility": "shared",
|
|
7
|
-
"domain": "cards",
|
|
8
|
-
"subdomain": "fraud",
|
|
9
|
-
"groups": ["daily-ops", "merchant-risk"],
|
|
10
|
-
"audience": "operations",
|
|
11
|
-
"lifecycle": "review",
|
|
12
|
-
"owners": ["raj.kumar@acme-bank.com"],
|
|
13
|
-
"tags": ["cards", "fraud", "daily", "ops", "audience:operations"],
|
|
14
|
-
"notebooks": [
|
|
15
|
-
{
|
|
16
|
-
"path": "notebooks/cards_fraud_ops.dqlnb",
|
|
17
|
-
"title": "Cards Fraud Ops Investigation",
|
|
18
|
-
"role": "analysis",
|
|
19
|
-
"visibility": "shared"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
"members": [
|
|
23
|
-
{
|
|
24
|
-
"userId": "raj.kumar@acme-bank.com",
|
|
25
|
-
"displayName": "Raj Kumar - Head of Cards",
|
|
26
|
-
"roles": ["owner"],
|
|
27
|
-
"attributes": { "department": "cards" }
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"userId": "mei.chen@acme-bank.com",
|
|
31
|
-
"displayName": "Mei Chen - Cards Analyst",
|
|
32
|
-
"roles": ["analyst"],
|
|
33
|
-
"attributes": { "department": "cards" }
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"userId": "li.park@acme-bank.com",
|
|
37
|
-
"displayName": "Li Park - NYC Branch Manager",
|
|
38
|
-
"roles": ["branch_viewer"],
|
|
39
|
-
"attributes": { "region": "NA-NE", "branch": "NYC-042", "department": "cards" }
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
"roles": [
|
|
43
|
-
{ "id": "owner", "displayName": "Owner", "description": "Full App configuration and execution." },
|
|
44
|
-
{ "id": "analyst", "displayName": "Analyst", "description": "Can execute dashboards and review proposed blocks." },
|
|
45
|
-
{ "id": "viewer", "displayName": "Viewer", "description": "Can view and run certified dashboard tiles." },
|
|
46
|
-
{ "id": "branch_viewer", "displayName": "Branch Viewer", "description": "Dashboard execution narrowed to the member's region and branch." }
|
|
47
|
-
],
|
|
48
|
-
"policies": [
|
|
49
|
-
{
|
|
50
|
-
"id": "cards-dashboard-view",
|
|
51
|
-
"domain": "cards",
|
|
52
|
-
"minClassification": "internal",
|
|
53
|
-
"allowedRoles": ["viewer", "branch_viewer", "analyst", "owner"],
|
|
54
|
-
"accessLevel": "execute",
|
|
55
|
-
"enabled": true
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"id": "cards-config-owner",
|
|
59
|
-
"domain": "cards",
|
|
60
|
-
"minClassification": "restricted",
|
|
61
|
-
"allowedRoles": ["owner"],
|
|
62
|
-
"accessLevel": "admin",
|
|
63
|
-
"enabled": true
|
|
64
|
-
}
|
|
65
|
-
],
|
|
66
|
-
"rlsBindings": [
|
|
67
|
-
{ "role": "branch_viewer", "variable": "user.region", "from": "region" },
|
|
68
|
-
{ "role": "branch_viewer", "variable": "user.branch", "from": "branch" }
|
|
69
|
-
],
|
|
70
|
-
"schedules": [
|
|
71
|
-
{
|
|
72
|
-
"id": "daily-7am-digest",
|
|
73
|
-
"cron": "0 7 * * 1-5",
|
|
74
|
-
"dashboard": "daily-ops",
|
|
75
|
-
"deliver": [{ "kind": "slack", "channel": "#cards-ops" }],
|
|
76
|
-
"description": "Weekday cards operations digest.",
|
|
77
|
-
"enabled": true
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"id": "fraud-spike-watch",
|
|
81
|
-
"cron": "*/15 * * * *",
|
|
82
|
-
"dashboard": "fraud-watch",
|
|
83
|
-
"deliver": [{ "kind": "slack", "channel": "#cards-fraud-alerts" }],
|
|
84
|
-
"description": "High-frequency fraud monitoring digest.",
|
|
85
|
-
"enabled": true
|
|
86
|
-
}
|
|
87
|
-
],
|
|
88
|
-
"homepage": { "type": "dashboard", "id": "daily-ops" }
|
|
89
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "bank-overview",
|
|
4
|
-
"metadata": {
|
|
5
|
-
"title": "Bank Overview",
|
|
6
|
-
"description": "CXO scorecard that cites certified domain blocks.",
|
|
7
|
-
"domain": "executive",
|
|
8
|
-
"tags": ["executive", "scorecard", "cxo"]
|
|
9
|
-
},
|
|
10
|
-
"layout": {
|
|
11
|
-
"kind": "grid",
|
|
12
|
-
"cols": 12,
|
|
13
|
-
"rowHeight": 80,
|
|
14
|
-
"items": [
|
|
15
|
-
{
|
|
16
|
-
"i": "health-scorecard",
|
|
17
|
-
"x": 0,
|
|
18
|
-
"y": 0,
|
|
19
|
-
"w": 6,
|
|
20
|
-
"h": 4,
|
|
21
|
-
"block": { "blockId": "bank_health_scorecard" },
|
|
22
|
-
"viz": { "type": "table" },
|
|
23
|
-
"title": "Bank Health Scorecard"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"i": "deposit-trend",
|
|
27
|
-
"x": 6,
|
|
28
|
-
"y": 0,
|
|
29
|
-
"w": 6,
|
|
30
|
-
"h": 3,
|
|
31
|
-
"block": { "blockId": "deposit_trend" },
|
|
32
|
-
"viz": { "type": "line" },
|
|
33
|
-
"title": "Deposit Trend"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"i": "card-volume",
|
|
37
|
-
"x": 0,
|
|
38
|
-
"y": 4,
|
|
39
|
-
"w": 6,
|
|
40
|
-
"h": 3,
|
|
41
|
-
"block": { "blockId": "daily_transaction_volume" },
|
|
42
|
-
"viz": { "type": "line" },
|
|
43
|
-
"title": "Card Volume"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"i": "credit-risk",
|
|
47
|
-
"x": 6,
|
|
48
|
-
"y": 4,
|
|
49
|
-
"w": 6,
|
|
50
|
-
"h": 3,
|
|
51
|
-
"block": { "blockId": "loan_delinquency_by_region" },
|
|
52
|
-
"viz": { "type": "bar" },
|
|
53
|
-
"title": "Credit Risk"
|
|
54
|
-
}
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
}
|