modscape 2.0.3 → 2.0.4

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.ja.md CHANGED
@@ -62,6 +62,8 @@ npm install -g modscape
62
62
  ```
63
63
  `.modscape/rules.md`(YAMLスキーマのルール)と `.modscape/codegen-rules.md`(実装コード生成のルール)、および各エージェント用のコマンドファイルが生成されます。
64
64
 
65
+ > **ルールの更新**: Modscape をアップグレードした後は、`modscape init` を再実行することで `.modscape/rules.md` と `.modscape/codegen-rules.md` を最新版に上書きできます。
66
+
65
67
  2. **起動**: ビジュアライザーを起動します。
66
68
  ```bash
67
69
  modscape dev model.yaml
@@ -73,10 +75,12 @@ npm install -g modscape
73
75
  4. **実装コードの生成** — `/modscape:codegen` でYAMLをdbt / SQLMesh / Spark SQLに変換します。
74
76
  > *".modscape/codegen-rules.md に従って、model.yaml からdbtモデルを生成して。"*
75
77
 
76
- エージェントは `lineage.upstream` を元に依存関係の順でモデルを生成し、YAMLで定義しきれない箇所には `-- TODO:` コメントを残します。
78
+ エージェントは `lineage` セクションを元に依存関係の順でモデルを生成し、YAMLで定義しきれない箇所には `-- TODO:` コメントを残します。
77
79
 
78
80
  ### B: 手動モデリング
79
- 1. **YAML作成**: `model.yaml` ファイルを作成します。
81
+ アーキテクチャを直接コントロールしたい場合に最適です。
82
+
83
+ 1. **YAML作成**: `model.yaml` ファイルを作成します([YAMLリファレンス](#モデルの定義-yaml) を参照)。
80
84
  2. **起動**: ビジュアライザーを起動します。
81
85
  ```bash
82
86
  modscape dev model.yaml
package/README.md CHANGED
@@ -63,6 +63,8 @@ Leverage AI coding assistants (**Gemini CLI, Claude Code, or Codex**) to build y
63
63
  ```
64
64
  This creates `.modscape/rules.md` (YAML schema rules) and `.modscape/codegen-rules.md` (code generation rules), plus agent-specific command files.
65
65
 
66
+ > **Updating rules**: After upgrading Modscape, re-run `modscape init` to overwrite `.modscape/rules.md` and `.modscape/codegen-rules.md` with the latest bundled version.
67
+
66
68
  2. **Start Dev**: Launch the visualizer.
67
69
  ```bash
68
70
  modscape dev model.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "modscape",
3
- "version": "2.0.3",
3
+ "version": "2.0.4",
4
4
  "description": "Modscape: A YAML-driven data modeling visualizer CLI",
5
5
  "repository": {
6
6
  "type": "git",
@@ -16,7 +16,7 @@ COORDINATES ONLY in `layout`. NEVER inside tables or domains.
16
16
  LINEAGE Use top-level `lineage` section (not relationships, not table.lineage.upstream).
17
17
  parentId Declare a table's domain membership inside layout, not inside domains.
18
18
  IDs Every object (table, domain, annotation) needs a unique `id`.
19
- sampleData First row = column IDs. At least 3 realistic data rows.
19
+ sampleData At least 3 realistic data rows. No header row.
20
20
  Grid All x/y values must be multiples of 40.
21
21
  ```
22
22
 
@@ -45,13 +45,12 @@ layout: # (object) ALL coordinates — REQUIRED if any objects exist
45
45
 
46
46
  | Field | Required | Description |
47
47
  |-------|----------|-------------|
48
- | `id` | **REQUIRED** | Unique identifier used as a key in `layout`, `domains.tables`, `lineage.upstream`, etc. Use snake_case. |
48
+ | `id` | **REQUIRED** | Unique identifier used as a key in `layout`, `domains.tables`, `lineage`, etc. Use snake_case. |
49
49
  | `name` | **REQUIRED** | Conceptual (business) name shown large on the canvas. |
50
50
  | `logical_name` | optional | Formal business name shown medium. Omit if same as `name`. |
51
51
  | `physical_name` | optional | Actual database table name shown small. |
52
52
  | `appearance` | optional | Visual type, icon, color. |
53
53
  | `conceptual` | optional | AI-friendly business context metadata. |
54
- | `lineage` | optional | Upstream table IDs. Only for `mart` / aggregated tables. |
55
54
  | `columns` | optional | Column definitions. |
56
55
  | `sampleData` | optional | 2D array of sample rows. Strongly recommended. |
57
56
 
@@ -72,7 +71,7 @@ appearance:
72
71
  |------|-------------|
73
72
  | `fact` | Events, transactions, measurements. Has measures (numbers) and FK columns. |
74
73
  | `dimension` | Entities, master data, reference lists. Descriptive attributes. |
75
- | `mart` | Aggregated or consumer-facing output. **Always add `lineage.upstream`.** |
74
+ | `mart` | Aggregated or consumer-facing output. **Always add a top-level `lineage` entry.** |
76
75
  | `hub` | Data Vault: stores a single unique business key. |
77
76
  | `link` | Data Vault: joins two or more hubs (transaction or relationship). |
78
77
  | `satellite` | Data Vault: descriptive attributes of a hub, tracked over time. |
@@ -96,7 +95,7 @@ Each column has an `id` plus optional `logical` and `physical` blocks.
96
95
 
97
96
  ```yaml
98
97
  columns:
99
- - id: order_id # REQUIRED. Unique within the table. Used in sampleData header.
98
+ - id: order_id # REQUIRED. Unique within the table.
100
99
  logical:
101
100
  name: "Order ID" # Display name
102
101
  type: Int # Int | String | Decimal | Date | Timestamp | Boolean | ...
@@ -138,7 +137,7 @@ relationships:
138
137
  | `many-to-one` | Fact → Dimension *(inverse notation of above)* |
139
138
  | `many-to-many` | Via a bridge / link table |
140
139
 
141
- **MUST NOT** use `relationships` to express data lineage (use `lineage.upstream` instead).
140
+ **MUST NOT** use `relationships` to express data lineage (use the top-level `lineage` section instead).
142
141
 
143
142
  ---
144
143
 
@@ -497,7 +496,7 @@ The command reads `target/manifest.json` and produces YAML with:
497
496
  | `physical_name` | `node.alias` | Falls back to `node.name` |
498
497
  | `conceptual.description` | `node.description` | From dbt docs |
499
498
  | `columns[].logical.name/type/description` | `node.columns` | From dbt schema.yml |
500
- | `lineage.upstream` | `node.depends_on.nodes` | Auto-populated |
499
+ | `lineage` (top-level) | `node.depends_on.nodes` | Auto-populated as `{from, to}` entries |
501
500
  | `appearance.type` | — | **Always `table`. Must be reclassified.** |
502
501
  | `sampleData` | — | **Not generated. Must be added.** |
503
502
  | `layout` | — | **Not generated. Must be added.** |
@@ -517,7 +516,7 @@ After running `modscape dbt import`, the generated YAML needs enrichment. AI age
517
516
 
518
517
  3. **Add `sampleData`** — The import does not generate sample data. Add at least 3 realistic rows per table.
519
518
 
520
- 4. **Do NOT re-generate `lineage.upstream`**It is already correctly populated from `depends_on.nodes`.
519
+ 4. **Do NOT re-generate `lineage` entries** Top-level `lineage` is already correctly populated from `depends_on.nodes`.
521
520
 
522
521
  ### 11-4. `dbt sync` — Incremental updates
523
522
 
@@ -527,7 +526,7 @@ Use `modscape dbt sync` when the dbt project has changed (new models, updated co
527
526
  - `name`, `logical_name`, `physical_name`
528
527
  - `conceptual.description`
529
528
  - `columns` (all)
530
- - `lineage.upstream`
529
+ - `lineage` (top-level)
531
530
 
532
531
  **What `sync` preserves (safe to edit manually):**
533
532
  - `appearance` (type, icon, color, scd)
@@ -549,14 +548,15 @@ id: "model.my_project.fct_orders"
549
548
  id: "source.my_project.raw.orders"
550
549
  id: "seed.my_project.product_categories"
551
550
 
552
- # lineage.upstream also uses unique_id format
551
+ # top-level lineage also uses unique_id format
553
552
  lineage:
554
- upstream:
555
- - "model.my_project.stg_orders"
556
- - "source.my_project.raw.customers"
553
+ - from: "model.my_project.stg_orders"
554
+ to: "model.my_project.fct_orders"
555
+ - from: "source.my_project.raw.customers"
556
+ to: "model.my_project.fct_orders"
557
557
  ```
558
558
 
559
- **MUST NOT** shorten these IDs. They are the join keys between `tables`, `domains.tables`, `lineage.upstream`, and `layout`.
559
+ **MUST NOT** shorten these IDs. They are the join keys between `tables`, `domains.tables`, `lineage`, and `layout`.
560
560
 
561
561
  ---
562
562
 
@@ -611,6 +611,17 @@ Use the built-in mutation commands to **add, update, or remove individual entiti
611
611
 
612
612
  ### 13-2. Recommended AI Agent Flow
613
613
 
614
+ When inspecting a model's current state, **prefer using the list/get commands** over reading the YAML file directly.
615
+ They return validated, structured JSON output that is easier to process.
616
+
617
+ ```bash
618
+ # Inspect current state before making changes
619
+ modscape table list model.yaml --json
620
+ modscape domain list model.yaml --json
621
+ modscape relationship list model.yaml --json
622
+ modscape lineage list model.yaml --json
623
+ ```
624
+
614
625
  Before `add` or `update`, check existence with `get` or `list`:
615
626
 
616
627
  ```bash
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visualizer",
3
3
  "private": true,
4
- "version": "2.0.3",
4
+ "version": "2.0.4",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "dev": "vite",