You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ERGO.md
+25-19Lines changed: 25 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,12 @@
2
2
3
3
## Context
4
4
5
-
Investigating the current blend implementation (at `~/Vanilla/blend/`) to map essential user journeys and identify friction points. blend is a Rust-based dotfiles manager using Nickel DSL, managing ~55 orders across macOS and Linux.
5
+
Investigating the current blend implementation (at `~/Vanilla/blend/`) to map essential user journeys and identify friction points. blend is a Rust-based dotfiles manager using Nickel DSL, managing roughly 50 orders across macOS and Linux.
2a. Or explicit root: blend add my-app --prefix ~/.config/my-app ~/.config/my-app/config
57
+
3. For structured: Manually transcribe TOML/JSON/YAML into Nickel from_config syntax
58
+
4. Validate: blend check my-app
57
59
5. Preview: blend view my-app
58
60
6. Deploy: blend sync my-app
59
61
```
@@ -62,19 +64,18 @@ removed or moved to the top-level `justfile`.
62
64
63
65
| # | Issue | Severity | Detail |
64
66
|---|-------|----------|--------|
65
-
| 1 |**No scaffolding command**| High |No `blend add my-app` to create order skeleton with boilerplate order.ncl|
67
+
| 1 |**~~No scaffolding command~~**|~~High~~|**Resolved** — `blend create <order>` scaffolds the Source order and `blend add <order> <target>` imports existing Target files/directories|
66
68
| 2 |**Manual config transcription for structured**| High | User must hand-convert a TOML/JSON file into Nickel `from_config = { ... }` syntax. For a 200-line starship.toml, this is painful and error-prone |
67
69
| 3 |**Must know Nickel syntax**| Medium | No inline documentation, no `blend help new-order` with examples |
68
-
| 4 |**No first-class validation command**| Low |`just check` wraps `bin/blend view --dry-run`, but there is no dedicated `blend check`/`blend lint` CLI yet|
70
+
| 4 |**~~No first-class validation command~~**|~~Low~~|**Resolved** — `blend check [orders...]` validates Source order definitions without deploying|
69
71
| 5 |**Schema contract usage is implicit**| Low | User should pipe to `| Order` at end of order.ncl for editor/Nickel validation, but the workflow does not strongly suggest it; Rust deserialization still validates the evaluated shape |
70
72
71
73
### Improvement Ideas
72
74
73
-
-`blend add <name> [--from <path>]` command that:
74
-
- Creates `orders/<name>/order.ncl` with sensible defaults
75
-
- If `--from ~/.config/app/config.toml` is given: auto-detects format, parses the file, generates `from_config` Nickel syntax using `json_to_nickel()` (already implemented in `ast_utils.rs`)
76
-
- For directories: creates `from_file` entry pointing to copied dir
77
-
-`blend check`: validate all order.ncl files without deploying (first-class CLI wrapper around fast Nickel eval + schema check)
75
+
-~~Order scaffolding/import~~: **Implemented** via `blend create <order>` and
76
+
`blend add <order> <target>` for `from_file` entries.
77
+
- Structured import remains future work: auto-detect a TOML/JSON/YAML Target,
78
+
parse it, and generate `from_config` Nickel syntax using `json_to_nickel()`.
78
79
79
80
---
80
81
@@ -158,14 +159,14 @@ These friction points from the original analysis have been addressed by `blend s
158
159
159
160
| # | Issue | Severity | Detail |
160
161
|---|-------|----------|--------|
161
-
| 1 |**No first-class validation-only command**| Medium |No `blend check` or `blend lint` CLI yet; the top-level `just check` currently uses `bin/blend view --dry-run`|
162
+
| 1 |**~~No first-class validation-only command~~**|~~Medium~~|**Resolved** — `blend check [orders...]` validates Source order definitions without deploying|
162
163
| 2 |**No rollback**| Medium | If a force deploy overwrites a config and breaks an app, there's no `blend rollback` or automatic backup |
163
164
| 3 |**Nickel errors can be opaque**| Low | Nickel evaluation errors include source info but can be hard to trace for contract violations |
164
165
| 4 |**No pre-sync backup**| Low | Sync overwrites in-place. A backup of the previous deployed version would help recovery |
165
166
166
167
### Improvement Ideas
167
168
168
-
-`blend check`: validate all orders without building (fast Nickel eval + schema check)
169
+
-~~`blend check`~~: **Implemented** — validate all orders without deploying (fast Nickel eval + schema check)
169
170
- Auto-backup before Source -> Target sync: copy previous Target file to `~/.cache/blend/backups/<order>/<file>.bak`
170
171
-`blend rollback <order>`: restore from backup
171
172
@@ -176,10 +177,12 @@ These friction points from the original analysis have been addressed by `blend s
176
177
### Quick Wins (low effort, high impact)
177
178
1.~~**Fix bootstrap script**: install proto/Rust, build `bin/blend`, then deploy via `just bootstrap`~~
178
179
2.**First-run message**: When all orders are pending, show "Run `blend sync` to review and deploy"
179
-
3.**`blend check` command**: Validate all order.ncl files without deploying
180
+
3.~~**`blend check` command**~~: **Implemented** — validate all order.ncl files without deploying
180
181
181
182
### Medium Effort
182
-
4.**`blend add <name> [--from <path>]`**: Scaffold new orders with auto-import from existing deployed configs (can reuse existing `json_to_nickel()` for format conversion). This covers the "capture existing config into a new order" use case — currently there's no way to pull a config from the filesystem into a new order without manual setup.
183
+
4.~~**`blend create` / `blend add` for `from_file` import**~~:
184
+
**Implemented** — remaining work is structured `from_config` import from
185
+
existing TOML/JSON/YAML Targets.
183
186
5.**`--no-rewrite` info display**: Show branch context and Nickel snippets for manual merge
Copy file name to clipboardExpand all lines: NEW_BLEND.md
+10-6Lines changed: 10 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Two config modes per file entry:
35
35
| Mode | Source | Rendering | Sync-back |
36
36
|------|--------|-----------|-----------|
37
37
|`from_config`| Inline Nickel data/expressions | Evaluated → rendered to target format | Context-aware AST rewrite |
38
-
|`from_file`|Files/dirs in`orders/<order>/`| Copied as-is | File copy back |
38
+
|`from_file`|Relative files/dirs inside`orders/<order>/`| Copied as-is | File copy back |
39
39
40
40
---
41
41
@@ -60,14 +60,14 @@ Each order is defined by `orders/<order>/order.ncl`. The evaluated result must c
60
60
|-------|------|----------|-------------|
61
61
|`name`| String | Yes (for `from_config`) | Destination filename. Combined with prefix for target path. Auto-set from `from_file` if omitted. |
62
62
|`from_config`| Record/Array | One of these | Inline structured config data, evaluated by Nickel and rendered to target format |
63
-
|`from_file`| String | One of these |Path to file/directory in the order dir, copied as-is |
64
-
|`prefix`| Array<String> | No | Per-file prefix override (default: inherits global `blend.prefix`) |
63
+
|`from_file`| String | One of these |Relative path to file/directory in the order dir, copied as-is. Absolute paths and paths that normalize outside the order dir are rejected.|
64
+
|`prefix`| Array<String> | No | Per-file prefix override (default: inherits global `blend.prefix`). File entries require an effective prefix from either place.|
65
65
|`format`| String | No | Output format override (default: inferred from `name` extension) |
66
66
|`ignore`| Array<String> | No | Keys/patterns to exclude from diff (merged with global) |
67
67
|`when`| Record | No | Per-file condition: `{ os, arch, hostname }`|
68
68
|`symlink`| Bool | No | Create symlink instead of copying (`from_file` only) |
69
69
|`exclude`| Array<String> | No | Glob patterns to skip in `from_file` directories |
70
-
|`local`| String | No |Local overlay directory for machine-specific overrides (auto-created, gitignored) |
70
+
|`local`| String | No |Relative local overlay directory for machine-specific overrides (auto-created, gitignored). It follows the same non-escaping Source path rule as `from_file`.|
71
71
|`immutable`| Bool | No | Set OS immutable flag after deploying (macOS `chflags uchg`, Linux `chattr +i`) |
72
72
73
73
### Example: structured config (from_config)
@@ -325,7 +325,7 @@ Prompt diffs use explicit side markers instead of traditional `+/-`:
blend create <order> Scaffold an empty Source order
341
+
blend add <order> <target> Import a Target file/directory into an order
342
+
blend add <order> --prefix <path> <target>
343
+
Strip an explicit Target prefix before import
340
344
blend format [orders...] Format order.ncl files
341
345
blend format --check [orders...] Check order.ncl formatting without writing
342
346
blend table Output order info as HTML table (for README)
@@ -453,7 +457,7 @@ In `.ncl` files, use `\u{xxxx}` escape sequences for non-ASCII characters (e.g.,
453
457
-**Three-way merge context**: Snapshot-backed prompts are implemented for conflict explanation. This is not a full automatic merge engine, but `blend` can now show Source/Target/Base context when a snapshot exists.
454
458
-**Secrets management**: Deferred to v2. Focus on core config management first.
455
459
-**JSONC round-trip**: Output JSON without comments. Comments live in Nickel source.
456
-
-**Schema validation**: Orders are validated through the Nickel `| Order` contract when present, then through Rust deserialization and `resolve_defaults()`. Generated `order.contract.ncl` and `metadata.ncl` freshness is checked for read-only commands and repaired by `init`/`sync`.
460
+
-**Schema validation**: Orders are validated through the Nickel `| Order` contract when present, then through Rust deserialization, `resolve_defaults()`, and Source path checks. Generated `order.contract.ncl` and `metadata.ncl` freshness is checked for read-only commands and repaired by `init`/`sync`.
0 commit comments