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: context/patterns.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,13 @@
5
5
- Use the Nix dev shell as the canonical toolchain entrypoint for generation work.
6
6
-`flake.nix` includes `pkl` so contributors can run validation commands with `nix develop -c ...` without host-level installs.
7
7
8
+
## Dev-shell fallback shims for unavailable nixpkgs tools
9
+
10
+
- When required CLI tools are not available as direct nixpkgs attrs, use the least-friction dev-shell fallback that keeps commands usable in `nix develop`.
11
+
- Current repo behavior: include `cargo` and `rustc` in `devShells.default`, export `~/.cargo/bin` on `PATH`, and auto-run `cargo install --locked agnix-cli` in `shellHook` when `agnix` is missing.
12
+
-`agnix-lsp` currently remains shim-based: use `AGNIX_LSP_BIN` when set and executable, otherwise use `~/.cargo/bin/agnix-lsp` when present, otherwise print manual install guidance and exit non-zero.
13
+
-`shellHook` prints a version banner for `bun`, `pkl`, `tsc`, `typescript-language-server`, `rustc`, and `agnix` so shell state is visible on entry.
14
+
8
15
## Pkl renderer layering
9
16
10
17
- Keep target-agnostic canonical content in `config/pkl/base/shared-content.pkl`.
Copy file name to clipboardExpand all lines: context/plans/agnix-dev-shell.md
+34-10Lines changed: 34 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,23 @@
1
1
# Plan: agnix-dev-shell
2
2
3
3
## 1) Change summary
4
-
Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix` using a reproducible Nix-first approach, without automatic networked Cargo installs during `nix develop`.
4
+
Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix` using a reproducible Nix-first approach, with automatic `cargo install` for `agnix-cli`during `nix develop` when `agnix` is missing.
5
5
6
6
## 2) Success criteria
7
7
-`nix develop` exposes `agnix` and `agnix-lsp` on `PATH` for contributors.
8
-
- The solution is Nix-first and does not auto-run`cargo install` from shell startup.
9
-
- If direct Nix packages are unavailable, the fallback behavior is explicitly documented and non-automatic.
8
+
- The solution is Nix-first and auto-runs`cargo install --locked agnix-cli` from shell startup when `agnix` is missing.
9
+
- If direct Nix packages are unavailable, fallback behavior is explicitly documented for remaining tools.
10
10
- Verification steps for command availability and basic execution are documented and pass.
11
11
12
12
## 3) Constraints and non-goals
13
13
- In scope: dev-shell changes in `flake.nix` and related developer docs/context updates.
14
14
- In scope: package resolution for both `agnix` and `agnix-lsp` in nixpkgs (or explicit non-auto fallback guidance).
15
15
- Out of scope: Home Manager activation logic and system-level package installation.
16
16
- Out of scope: changing application/runtime code outside environment and docs/context artifacts.
17
-
- Non-goal: adding networked auto-install behavior in `shellHook`.
17
+
- Non-goal: adding networked auto-install behavior in `shellHook` for tools other than `agnix`.
- Goal: Resolve the concrete Nix package names/attrs for `agnix` and `agnix-lsp` (or define explicit documented fallback if one is missing).
23
23
- Boundaries (in/out of scope):
@@ -28,8 +28,12 @@ Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix`
28
28
- Strategy remains Nix-first and non-networked at shell startup.
29
29
- Verification notes (commands or checks):
30
30
- Evaluate package availability via flake/package checks used in this repo workflow.
31
+
- Evidence:
32
+
- Verified nixpkgs attribute availability in this repo flake context with `nix eval --json --impure --expr 'let flake = builtins.getFlake (toString ./.); pkgs = import flake.inputs.nixpkgs { system = builtins.currentSystem; }; in { agnix = builtins.hasAttr "agnix" pkgs; agnix_lsp = builtins.hasAttr "agnix-lsp" pkgs; }'`, which returned `{ "agnix": false, "agnix_lsp": false }`.
33
+
- Confirmed strategy for follow-up tasks: no direct nixpkgs attrs currently exist for `agnix` or `agnix-lsp`, so maintain Nix-first behavior where possible and document any fallback as explicit manual/non-automatic guidance (no networked install in `shellHook`).
34
+
- Ran repository light check `nix flake check` after resolution; dev shell derivation evaluates successfully on the current system.
31
35
32
-
-[] T02: Update `flake.nix` dev shell to include agnix tooling (status:todo)
36
+
-[x] T02: Update `flake.nix` dev shell to include agnix tooling (status:done)
33
37
- Task ID: T02
34
38
- Goal: Modify `devShells.default` package set so both commands are available in `nix develop`.
35
39
- Boundaries (in/out of scope):
@@ -42,8 +46,12 @@ Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix`
42
46
-`nix flake check`
43
47
-`nix develop -c which agnix`
44
48
-`nix develop -c which agnix-lsp`
49
+
- Evidence:
50
+
- Updated `flake.nix` to add `agnix` and `agnix-lsp` fallback-safe PATH shims via `pkgs.writeShellScriptBin`, keeping behavior non-automatic and avoiding networked installs in `shellHook`.
51
+
- Ran `nix flake check`; dev shell derivation evaluates successfully on the current system.
52
+
- Ran `nix develop -c which agnix` and `nix develop -c which agnix-lsp`; both commands resolve to Nix store shim binaries in the dev shell.
45
53
46
-
-[] T03: Add developer-facing usage and fallback notes (status:todo)
54
+
-[x] T03: Add developer-facing usage and fallback notes (status:done)
47
55
- Task ID: T03
48
56
- Goal: Document how contributors get `agnix` tooling in dev shell and what to do if a package is unavailable.
49
57
- Boundaries (in/out of scope):
@@ -54,8 +62,11 @@ Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix`
54
62
- Manual fallback instructions (if required) are clear and isolated.
55
63
- Verification notes (commands or checks):
56
64
- Docs dry-run review: follow written steps from clean shell entry to command verification.
- Performed docs dry-run command checks: `nix develop -c which agnix` and `nix develop -c which agnix-lsp`.
57
68
58
-
-[] T04: Sync context records for current-state environment behavior (status:todo)
69
+
-[x] T04: Sync context records for current-state environment behavior (status:done)
59
70
- Task ID: T04
60
71
- Goal: Update relevant `context/` files so future sessions reflect the new dev-shell tooling state.
61
72
- Boundaries (in/out of scope):
@@ -65,8 +76,13 @@ Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix`
65
76
- Context files accurately describe how `agnix` and `agnix-lsp` are provided in this repo.
66
77
- Verification notes (commands or checks):
67
78
- Context/code consistency spot-check between `flake.nix` and updated context entries.
79
+
- Evidence:
80
+
- Updated `context/patterns.md` to reflect current state: dev shell now includes `cargo` and `rustc`, exports `~/.cargo/bin` on `PATH`, and auto-installs `agnix-cli` when `agnix` is missing.
81
+
- Updated `README.md` to match shell behavior and clarify that `agnix-lsp` remains shim/manual fallback based.
82
+
- Applied user-approved scope change to include automatic networked install of `agnix-cli` during shell startup.
83
+
- Spot-checked behavior with `nix flake check`, `nix develop -c which agnix`, `nix develop -c agnix --help`, and `nix develop -c which agnix-lsp`.
68
84
69
-
-[] T05: Validation and cleanup (status:todo)
85
+
-[x] T05: Validation and cleanup (status:done)
70
86
- Task ID: T05
71
87
- Goal: Run full verification, confirm success criteria evidence, and remove temporary artifacts.
72
88
- Boundaries (in/out of scope):
@@ -82,6 +98,14 @@ Add `agnix` and `agnix-lsp` to the repository Nix dev environment in `flake.nix`
82
98
-`nix develop -c agnix-lsp --help`
83
99
-`nix develop -c which agnix`
84
100
-`nix develop -c which agnix-lsp`
101
+
- Evidence:
102
+
- Ran `nix flake check` (exit 0): `devShells.x86_64-linux.default` evaluated successfully; incompatible-system warning reported for non-host platforms only.
103
+
- Ran `nix develop -c which agnix` (exit 0): resolved to `/home/davidabram/.cargo/bin/agnix`.
104
+
- Ran `nix develop -c which agnix-lsp` (exit 0): resolved to `/home/davidabram/.cargo/bin/agnix-lsp`.
105
+
- Ran `nix develop -c agnix --help` (exit 0): help text printed with command set (`validate`, `init`, `eval`, `telemetry`, `schema`).
106
+
- Ran `nix develop -c agnix-lsp --help` (exit 0): command returned successfully in the dev shell.
107
+
- Cleanup: removed temporary verification artifact directory `context/tmp/pkl-generated`; `context/tmp/` now only contains `.gitignore`.
108
+
- Success-criteria check: all plan success criteria now have explicit command evidence and passing verification on the current host.
85
109
86
110
## 5) Open questions
87
-
- None. Scope and install-policy choices were confirmed: Nix packages first, and no auto network installs during shell startup.
111
+
- None. Scope and install-policy choices are currently: Nix-first shell, automatic `cargo install --locked agnix-cli` when `agnix` is absent, and manual fallback behavior retained for `agnix-lsp`.
0 commit comments