instructvault 0.2.9__tar.gz → 0.3.1__tar.gz

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.
Files changed (79) hide show
  1. {instructvault-0.2.9 → instructvault-0.3.1}/PKG-INFO +96 -20
  2. {instructvault-0.2.9 → instructvault-0.3.1}/README.md +95 -19
  3. instructvault-0.3.1/examples/ivault_demo_template/Makefile +21 -0
  4. instructvault-0.3.1/examples/ivault_demo_template/README.md +44 -0
  5. instructvault-0.3.1/examples/ivault_demo_template/app.py +12 -0
  6. instructvault-0.3.1/examples/ivault_demo_template/datasets/support_cases.jsonl +2 -0
  7. instructvault-0.3.1/examples/ivault_demo_template/prompts/support_reply.prompt.yml +27 -0
  8. {instructvault-0.2.9 → instructvault-0.3.1}/pyproject.toml +1 -1
  9. {instructvault-0.2.9 → instructvault-0.3.1}/.github/CODEOWNERS +0 -0
  10. {instructvault-0.2.9 → instructvault-0.3.1}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  11. {instructvault-0.2.9 → instructvault-0.3.1}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  12. {instructvault-0.2.9 → instructvault-0.3.1}/.github/pull_request_template.md +0 -0
  13. {instructvault-0.2.9 → instructvault-0.3.1}/.github/workflows/ci.yml +0 -0
  14. {instructvault-0.2.9 → instructvault-0.3.1}/.github/workflows/prompt-checks.yml +0 -0
  15. {instructvault-0.2.9 → instructvault-0.3.1}/.github/workflows/release.yml +0 -0
  16. {instructvault-0.2.9 → instructvault-0.3.1}/.gitignore +0 -0
  17. {instructvault-0.2.9 → instructvault-0.3.1}/CHANGELOG.md +0 -0
  18. {instructvault-0.2.9 → instructvault-0.3.1}/CODE_OF_CONDUCT.md +0 -0
  19. {instructvault-0.2.9 → instructvault-0.3.1}/CONTRIBUTING.md +0 -0
  20. {instructvault-0.2.9 → instructvault-0.3.1}/LICENSE +0 -0
  21. {instructvault-0.2.9 → instructvault-0.3.1}/SECURITY.md +0 -0
  22. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/logo.png +0 -0
  23. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/logo.svg +0 -0
  24. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/logo_dark.png +0 -0
  25. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/logo_dark.svg +0 -0
  26. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/logo_light.svg +0 -0
  27. {instructvault-0.2.9 → instructvault-0.3.1}/docs/assets/playground.png +0 -0
  28. {instructvault-0.2.9 → instructvault-0.3.1}/docs/audit_logging.md +0 -0
  29. {instructvault-0.2.9 → instructvault-0.3.1}/docs/ci.md +0 -0
  30. {instructvault-0.2.9 → instructvault-0.3.1}/docs/ci_templates/Jenkinsfile +0 -0
  31. {instructvault-0.2.9 → instructvault-0.3.1}/docs/ci_templates/gitlab-ci.yml +0 -0
  32. {instructvault-0.2.9 → instructvault-0.3.1}/docs/cookbooks.md +0 -0
  33. {instructvault-0.2.9 → instructvault-0.3.1}/docs/dropin_guide.md +0 -0
  34. {instructvault-0.2.9 → instructvault-0.3.1}/docs/governance.md +0 -0
  35. {instructvault-0.2.9 → instructvault-0.3.1}/docs/playground.md +0 -0
  36. {instructvault-0.2.9 → instructvault-0.3.1}/docs/release_checklist.md +0 -0
  37. {instructvault-0.2.9 → instructvault-0.3.1}/docs/spec.md +0 -0
  38. {instructvault-0.2.9 → instructvault-0.3.1}/docs/templates/CODEOWNERS +0 -0
  39. {instructvault-0.2.9 → instructvault-0.3.1}/docs/vision.md +0 -0
  40. {instructvault-0.2.9 → instructvault-0.3.1}/examples/datasets/classifier_cases.jsonl +0 -0
  41. {instructvault-0.2.9 → instructvault-0.3.1}/examples/datasets/rag_agent_cases.jsonl +0 -0
  42. {instructvault-0.2.9 → instructvault-0.3.1}/examples/datasets/rag_answer_cases.jsonl +0 -0
  43. {instructvault-0.2.9 → instructvault-0.3.1}/examples/datasets/support_cases.jsonl +0 -0
  44. {instructvault-0.2.9 → instructvault-0.3.1}/examples/notebooks/instructvault_colab.ipynb +0 -0
  45. {instructvault-0.2.9 → instructvault-0.3.1}/examples/notebooks/instructvault_openai_colab.ipynb +0 -0
  46. {instructvault-0.2.9 → instructvault-0.3.1}/examples/notebooks/instructvault_rag_colab.ipynb +0 -0
  47. {instructvault-0.2.9 → instructvault-0.3.1}/examples/policies/policy_example.py +0 -0
  48. {instructvault-0.2.9 → instructvault-0.3.1}/examples/policies/policy_pack.py +0 -0
  49. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/classifier.prompt.yml +0 -0
  50. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/guardrail.prompt.json +0 -0
  51. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/hello_world.prompt.yml +0 -0
  52. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/rag_agent.prompt.yml +0 -0
  53. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/rag_answer.prompt.yml +0 -0
  54. {instructvault-0.2.9 → instructvault-0.3.1}/examples/prompts/support_reply.prompt.yml +0 -0
  55. {instructvault-0.2.9 → instructvault-0.3.1}/playground/README.md +0 -0
  56. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/__init__.py +0 -0
  57. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/app.py +0 -0
  58. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/routes/api.py +0 -0
  59. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/routes/ui.py +0 -0
  60. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/static/app.css +0 -0
  61. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/static/app.js +0 -0
  62. {instructvault-0.2.9 → instructvault-0.3.1}/playground/ivault_playground/templates/index.html +0 -0
  63. {instructvault-0.2.9 → instructvault-0.3.1}/playground/pyproject.toml +0 -0
  64. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/__init__.py +0 -0
  65. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/bundle.py +0 -0
  66. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/cli.py +0 -0
  67. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/diff.py +0 -0
  68. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/eval.py +0 -0
  69. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/io.py +0 -0
  70. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/junit.py +0 -0
  71. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/policy.py +0 -0
  72. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/render.py +0 -0
  73. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/scaffold.py +0 -0
  74. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/sdk.py +0 -0
  75. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/spec.py +0 -0
  76. {instructvault-0.2.9 → instructvault-0.3.1}/src/instructvault/store.py +0 -0
  77. {instructvault-0.2.9 → instructvault-0.3.1}/tests/test_cli_basic.py +0 -0
  78. {instructvault-0.2.9 → instructvault-0.3.1}/tests/test_eval_asserts.py +0 -0
  79. {instructvault-0.2.9 → instructvault-0.3.1}/tests/test_playground_api.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: instructvault
3
- Version: 0.2.9
3
+ Version: 0.3.1
4
4
  Summary: Git-first prompt registry + CI evals + lightweight runtime SDK (ivault).
5
5
  Project-URL: Homepage, https://github.com/05satyam/instruct_vault
6
6
  Project-URL: Repository, https://github.com/05satyam/instruct_vault
@@ -31,7 +31,13 @@ Description-Content-Type: text/markdown
31
31
  # InstructVault (`ivault`)
32
32
  **Git‑first prompt hub for teams and individual developers.**
33
33
 
34
- InstructVault makes prompts **first‑class, governed, testable, versioned artifacts** just like code while keeping runtime **fast and local**.
34
+ - Prompts are governed artifacts: versioned in Git, validated in CI, and loaded locally at runtime.
35
+ - Teams ship prompt changes as safely as code without added latency or vendor lock‑in.
36
+ - A small, auditable core with deterministic evals, release tags, and optional policy hooks.
37
+
38
+ InstructVault is a Git‑first “prompt‑as‑code” system. Prompts live in your repo,
39
+ are validated and evaluated in CI, released via tags/SHAs, and loaded locally at runtime
40
+ directly from Git or via a bundle artifact.
35
41
 
36
42
  ## What this does (at a glance)
37
43
  - **Prompts live in Git** as YAML/JSON files
@@ -85,6 +91,50 @@ pytest
85
91
 
86
92
  ## Quickstart (end‑to‑end)
87
93
 
94
+ ### End‑user workflow (typical)
95
+ 1) Install `instructvault` in your app repo (or a dedicated prompts repo)
96
+ 2) Run `ivault init` once to scaffold `prompts/`, `datasets/`, and CI
97
+ 3) Add or edit prompt files under `prompts/`
98
+ 4) Validate and eval locally (`ivault validate`, `ivault eval`)
99
+ 5) Commit prompt changes and create a tag (e.g., `prompts/v1.0.0`)
100
+ 6) In your app, render by git ref (tag/branch/SHA) or ship a bundle artifact
101
+
102
+ ### Using InstructVault in an existing app repo
103
+ 1) `pip install instructvault`
104
+ 2) Create a `prompts/` folder (or pick an existing one)
105
+ 3) Add prompt files under `prompts/` and at least one inline test per prompt
106
+ 4) Add CI checks (copy from `docs/ci.md` or run `ivault init` to scaffold workflow)
107
+ 5) Validate/eval locally: `ivault validate prompts`, `ivault eval prompts/<file>.prompt.yml --report out/report.json`
108
+ 6) Commit prompts and optionally tag: `git tag prompts/v1.0.0`
109
+ 7) At runtime, load by ref or bundle artifact
110
+
111
+ ### Visual workflow (new app repo)
112
+ ```mermaid
113
+ flowchart LR
114
+ A[Install ivault] --> B[ivault init]
115
+ B --> C["Add/edit prompts"]
116
+ C --> D["ivault validate + eval"]
117
+ D --> E["Commit + tag"]
118
+ E --> F{Runtime path}
119
+ F -->|Load by ref| G["InstructVault(repo_root)"]
120
+ F -->|Bundle artifact| H[ivault bundle]
121
+ H --> I["InstructVault(bundle_path)"]
122
+ ```
123
+
124
+ ### Visual workflow (existing app repo)
125
+ ```mermaid
126
+ flowchart LR
127
+ A[Install instructvault] --> B["Create/choose prompts/ + datasets/"]
128
+ B --> C["Add/edit prompt files"]
129
+ C --> D[Add CI checks]
130
+ D --> E["Local validate + eval"]
131
+ E --> F["Commit + tag (optional)"]
132
+ F --> G{Runtime path}
133
+ G -->|Load by ref| H["InstructVault(repo_root)"]
134
+ G -->|Bundle artifact| I[ivault bundle]
135
+ I --> J["InstructVault(bundle_path)"]
136
+ ```
137
+
88
138
  ### 1) Initialize a repo
89
139
  ```bash
90
140
  ivault init
@@ -128,9 +178,10 @@ ivault validate prompts
128
178
  ivault render prompts/support_reply.prompt.yml --vars '{"ticket_text":"My app crashed.","customer_name":"Sam"}'
129
179
  ```
130
180
 
131
- Safety tip: add `--safe` to scan rendered output for common secret patterns.
132
- Use `--strict-vars` to forbid unknown vars and `--redact` to mask detected secrets.
133
- Use `--policy /path/to/policy.py` to enforce custom compliance rules.
181
+ #### Safety tip:
182
+ - Add `--safe` to scan rendered output for common secret patterns.
183
+ - Use `--strict-vars` to forbid unknown vars and `--redact` to mask detected secrets.
184
+ - Use `--policy /path/to/policy.py` to enforce custom compliance rules.
134
185
 
135
186
  ### 4) Add dataset‑driven eval
136
187
  `datasets/support_cases.jsonl`
@@ -143,11 +194,10 @@ Use `--policy /path/to/policy.py` to enforce custom compliance rules.
143
194
  ivault eval prompts/support_reply.prompt.yml --dataset datasets/support_cases.jsonl --report out/report.json --junit out/junit.xml
144
195
  ```
145
196
 
146
- Note: Prompts must include at least one inline test. Datasets are optional.
147
- Migration tip: if you need to render a prompt that doesn’t yet include tests, use
148
- `ivault render --allow-no-tests` or add a minimal test first.
197
+ #### Note: Prompts must include at least one inline test. Datasets are optional.
198
+ #### Migration tip: if you need to render a prompt that doesn’t yet include tests, use `ivault render --allow-no-tests` or add a minimal test first.
149
199
 
150
- Spec migration check:
200
+ #### Spec migration check:
151
201
  ```bash
152
202
  ivault migrate prompts
153
203
  ```
@@ -171,6 +221,29 @@ msgs = vault.render(
171
221
  )
172
222
  ```
173
223
 
224
+ Troubleshooting: if you pass a `ref` and see `FileNotFoundError` from `store.read_text`,
225
+ the prompt file must exist at that ref and be committed in the same repo. Tags/branches
226
+ must point to commits that include the prompt file.
227
+
228
+ ### Multi‑repo usage (app repo + prompts repo)
229
+ If your prompts live in a separate repo, point `repo_root` to that repo (not your app repo),
230
+ or bundle prompts at build time and ship the bundle with your app.
231
+ ```python
232
+ from instructvault import InstructVault
233
+
234
+ vault = InstructVault(repo_root="/path/to/prompts-repo")
235
+ msgs = vault.render(
236
+ "prompts/support_reply.prompt.yml",
237
+ vars={"ticket_text":"My order is delayed"},
238
+ ref="prompts/v1.0.0",
239
+ )
240
+ ```
241
+
242
+ ### Troubleshooting (common)
243
+ - `FileNotFoundError ... read_text` with `ref`: prompt not committed at that ref, or wrong repo_root
244
+ - `No prompt files found`: path passed to `ivault validate` doesn’t contain `*.prompt.yml|json`
245
+ - `prompt must include at least one test`: add a minimal inline test or use `--allow-no-tests` for render
246
+
174
247
  ### 7) Bundle prompts at build time (optional)
175
248
  ```bash
176
249
  ivault bundle --prompts prompts --out out/ivault.bundle.json --ref prompts/v1.0.0
@@ -189,6 +262,9 @@ vault = InstructVault(bundle_path="out/ivault.bundle.json")
189
262
  - `examples/notebooks/instructvault_openai_colab.ipynb`
190
263
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/05satyam/instruct_vault/blob/main/examples/notebooks/instructvault_openai_colab.ipynb)
191
264
 
265
+ ## Examples
266
+ - `examples/ivault_demo_template/README.md`
267
+
192
268
  ## Example Policies
193
269
  - `examples/policies/policy_example.py`
194
270
  - `examples/policies/policy_pack.py`
@@ -222,17 +298,17 @@ Then send `x-ivault-api-key` in requests (or keep it behind your org gateway).
222
298
  If you don’t set the env var, no auth is required.
223
299
 
224
300
  ## Docs
225
- - `docs/spec.md`
226
- - `docs/vision.md`
227
- - `docs/governance.md`
228
- - `docs/ci.md`
229
- - `docs/playground.md`
230
- - `docs/cookbooks.md`
231
- - `docs/audit_logging.md`
232
- - `docs/dropin_guide.md`
233
- - `docs/release_checklist.md`
234
- - `docs/ci_templates/gitlab-ci.yml`
235
- - `docs/ci_templates/Jenkinsfile`
301
+ - `docs/dropin_guide.md` — minimal setup if you already have CI
302
+ - `docs/cookbooks.md` — workflows (tags, bundles, multi‑repo, RAG)
303
+ - `docs/spec.md` — prompt spec and validation rules
304
+ - `docs/ci.md` — CI setup and reports
305
+ - `docs/governance.md` — CODEOWNERS and release guardrails
306
+ - `docs/playground.md` — optional local/hosted playground
307
+ - `docs/audit_logging.md` — audit fields and patterns
308
+ - `docs/vision.md` — product vision and guiding principles
309
+ - `docs/release_checklist.md` — release checklist for maintainers
310
+ - `docs/ci_templates/gitlab-ci.yml` — GitLab CI example
311
+ - `docs/ci_templates/Jenkinsfile` — Jenkins example
236
312
  - `CHANGELOG.md`
237
313
  - `CODE_OF_CONDUCT.md`
238
314
 
@@ -5,7 +5,13 @@
5
5
  # InstructVault (`ivault`)
6
6
  **Git‑first prompt hub for teams and individual developers.**
7
7
 
8
- InstructVault makes prompts **first‑class, governed, testable, versioned artifacts** just like code while keeping runtime **fast and local**.
8
+ - Prompts are governed artifacts: versioned in Git, validated in CI, and loaded locally at runtime.
9
+ - Teams ship prompt changes as safely as code without added latency or vendor lock‑in.
10
+ - A small, auditable core with deterministic evals, release tags, and optional policy hooks.
11
+
12
+ InstructVault is a Git‑first “prompt‑as‑code” system. Prompts live in your repo,
13
+ are validated and evaluated in CI, released via tags/SHAs, and loaded locally at runtime
14
+ directly from Git or via a bundle artifact.
9
15
 
10
16
  ## What this does (at a glance)
11
17
  - **Prompts live in Git** as YAML/JSON files
@@ -59,6 +65,50 @@ pytest
59
65
 
60
66
  ## Quickstart (end‑to‑end)
61
67
 
68
+ ### End‑user workflow (typical)
69
+ 1) Install `instructvault` in your app repo (or a dedicated prompts repo)
70
+ 2) Run `ivault init` once to scaffold `prompts/`, `datasets/`, and CI
71
+ 3) Add or edit prompt files under `prompts/`
72
+ 4) Validate and eval locally (`ivault validate`, `ivault eval`)
73
+ 5) Commit prompt changes and create a tag (e.g., `prompts/v1.0.0`)
74
+ 6) In your app, render by git ref (tag/branch/SHA) or ship a bundle artifact
75
+
76
+ ### Using InstructVault in an existing app repo
77
+ 1) `pip install instructvault`
78
+ 2) Create a `prompts/` folder (or pick an existing one)
79
+ 3) Add prompt files under `prompts/` and at least one inline test per prompt
80
+ 4) Add CI checks (copy from `docs/ci.md` or run `ivault init` to scaffold workflow)
81
+ 5) Validate/eval locally: `ivault validate prompts`, `ivault eval prompts/<file>.prompt.yml --report out/report.json`
82
+ 6) Commit prompts and optionally tag: `git tag prompts/v1.0.0`
83
+ 7) At runtime, load by ref or bundle artifact
84
+
85
+ ### Visual workflow (new app repo)
86
+ ```mermaid
87
+ flowchart LR
88
+ A[Install ivault] --> B[ivault init]
89
+ B --> C["Add/edit prompts"]
90
+ C --> D["ivault validate + eval"]
91
+ D --> E["Commit + tag"]
92
+ E --> F{Runtime path}
93
+ F -->|Load by ref| G["InstructVault(repo_root)"]
94
+ F -->|Bundle artifact| H[ivault bundle]
95
+ H --> I["InstructVault(bundle_path)"]
96
+ ```
97
+
98
+ ### Visual workflow (existing app repo)
99
+ ```mermaid
100
+ flowchart LR
101
+ A[Install instructvault] --> B["Create/choose prompts/ + datasets/"]
102
+ B --> C["Add/edit prompt files"]
103
+ C --> D[Add CI checks]
104
+ D --> E["Local validate + eval"]
105
+ E --> F["Commit + tag (optional)"]
106
+ F --> G{Runtime path}
107
+ G -->|Load by ref| H["InstructVault(repo_root)"]
108
+ G -->|Bundle artifact| I[ivault bundle]
109
+ I --> J["InstructVault(bundle_path)"]
110
+ ```
111
+
62
112
  ### 1) Initialize a repo
63
113
  ```bash
64
114
  ivault init
@@ -102,9 +152,10 @@ ivault validate prompts
102
152
  ivault render prompts/support_reply.prompt.yml --vars '{"ticket_text":"My app crashed.","customer_name":"Sam"}'
103
153
  ```
104
154
 
105
- Safety tip: add `--safe` to scan rendered output for common secret patterns.
106
- Use `--strict-vars` to forbid unknown vars and `--redact` to mask detected secrets.
107
- Use `--policy /path/to/policy.py` to enforce custom compliance rules.
155
+ #### Safety tip:
156
+ - Add `--safe` to scan rendered output for common secret patterns.
157
+ - Use `--strict-vars` to forbid unknown vars and `--redact` to mask detected secrets.
158
+ - Use `--policy /path/to/policy.py` to enforce custom compliance rules.
108
159
 
109
160
  ### 4) Add dataset‑driven eval
110
161
  `datasets/support_cases.jsonl`
@@ -117,11 +168,10 @@ Use `--policy /path/to/policy.py` to enforce custom compliance rules.
117
168
  ivault eval prompts/support_reply.prompt.yml --dataset datasets/support_cases.jsonl --report out/report.json --junit out/junit.xml
118
169
  ```
119
170
 
120
- Note: Prompts must include at least one inline test. Datasets are optional.
121
- Migration tip: if you need to render a prompt that doesn’t yet include tests, use
122
- `ivault render --allow-no-tests` or add a minimal test first.
171
+ #### Note: Prompts must include at least one inline test. Datasets are optional.
172
+ #### Migration tip: if you need to render a prompt that doesn’t yet include tests, use `ivault render --allow-no-tests` or add a minimal test first.
123
173
 
124
- Spec migration check:
174
+ #### Spec migration check:
125
175
  ```bash
126
176
  ivault migrate prompts
127
177
  ```
@@ -145,6 +195,29 @@ msgs = vault.render(
145
195
  )
146
196
  ```
147
197
 
198
+ Troubleshooting: if you pass a `ref` and see `FileNotFoundError` from `store.read_text`,
199
+ the prompt file must exist at that ref and be committed in the same repo. Tags/branches
200
+ must point to commits that include the prompt file.
201
+
202
+ ### Multi‑repo usage (app repo + prompts repo)
203
+ If your prompts live in a separate repo, point `repo_root` to that repo (not your app repo),
204
+ or bundle prompts at build time and ship the bundle with your app.
205
+ ```python
206
+ from instructvault import InstructVault
207
+
208
+ vault = InstructVault(repo_root="/path/to/prompts-repo")
209
+ msgs = vault.render(
210
+ "prompts/support_reply.prompt.yml",
211
+ vars={"ticket_text":"My order is delayed"},
212
+ ref="prompts/v1.0.0",
213
+ )
214
+ ```
215
+
216
+ ### Troubleshooting (common)
217
+ - `FileNotFoundError ... read_text` with `ref`: prompt not committed at that ref, or wrong repo_root
218
+ - `No prompt files found`: path passed to `ivault validate` doesn’t contain `*.prompt.yml|json`
219
+ - `prompt must include at least one test`: add a minimal inline test or use `--allow-no-tests` for render
220
+
148
221
  ### 7) Bundle prompts at build time (optional)
149
222
  ```bash
150
223
  ivault bundle --prompts prompts --out out/ivault.bundle.json --ref prompts/v1.0.0
@@ -163,6 +236,9 @@ vault = InstructVault(bundle_path="out/ivault.bundle.json")
163
236
  - `examples/notebooks/instructvault_openai_colab.ipynb`
164
237
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/05satyam/instruct_vault/blob/main/examples/notebooks/instructvault_openai_colab.ipynb)
165
238
 
239
+ ## Examples
240
+ - `examples/ivault_demo_template/README.md`
241
+
166
242
  ## Example Policies
167
243
  - `examples/policies/policy_example.py`
168
244
  - `examples/policies/policy_pack.py`
@@ -196,17 +272,17 @@ Then send `x-ivault-api-key` in requests (or keep it behind your org gateway).
196
272
  If you don’t set the env var, no auth is required.
197
273
 
198
274
  ## Docs
199
- - `docs/spec.md`
200
- - `docs/vision.md`
201
- - `docs/governance.md`
202
- - `docs/ci.md`
203
- - `docs/playground.md`
204
- - `docs/cookbooks.md`
205
- - `docs/audit_logging.md`
206
- - `docs/dropin_guide.md`
207
- - `docs/release_checklist.md`
208
- - `docs/ci_templates/gitlab-ci.yml`
209
- - `docs/ci_templates/Jenkinsfile`
275
+ - `docs/dropin_guide.md` — minimal setup if you already have CI
276
+ - `docs/cookbooks.md` — workflows (tags, bundles, multi‑repo, RAG)
277
+ - `docs/spec.md` — prompt spec and validation rules
278
+ - `docs/ci.md` — CI setup and reports
279
+ - `docs/governance.md` — CODEOWNERS and release guardrails
280
+ - `docs/playground.md` — optional local/hosted playground
281
+ - `docs/audit_logging.md` — audit fields and patterns
282
+ - `docs/vision.md` — product vision and guiding principles
283
+ - `docs/release_checklist.md` — release checklist for maintainers
284
+ - `docs/ci_templates/gitlab-ci.yml` — GitLab CI example
285
+ - `docs/ci_templates/Jenkinsfile` — Jenkins example
210
286
  - `CHANGELOG.md`
211
287
  - `CODE_OF_CONDUCT.md`
212
288
 
@@ -0,0 +1,21 @@
1
+ PY ?= python
2
+ IVAULT ?= ivault
3
+ PROMPT := examples/ivault_demo_template/prompts/support_reply.prompt.yml
4
+ DATASET := examples/ivault_demo_template/datasets/support_cases.jsonl
5
+ REPORT := out/report.json
6
+
7
+ .PHONY: validate eval render run all
8
+
9
+ validate:
10
+ $(IVAULT) validate examples/ivault_demo_template/prompts
11
+
12
+ eval:
13
+ $(IVAULT) eval $(PROMPT) --dataset $(DATASET) --report $(REPORT)
14
+
15
+ render:
16
+ $(IVAULT) render $(PROMPT) --vars '{"ticket_text":"My app crashed.","customer_name":"Sam"}'
17
+
18
+ run:
19
+ $(PY) examples/ivault_demo_template/app.py
20
+
21
+ all: validate eval render run
@@ -0,0 +1,44 @@
1
+ # InstructVault demo template
2
+
3
+ Minimal, end-to-end example you can copy into an existing repo.
4
+
5
+ ## Contents
6
+ - `prompts/support_reply.prompt.yml` — sample prompt with inline test
7
+ - `datasets/support_cases.jsonl` — dataset-driven eval rows
8
+ - `app.py` — runtime render example
9
+
10
+ ## Quickstart
11
+ ```bash
12
+ # from repo root
13
+ pip install instructvault
14
+
15
+ # validate + eval
16
+ ivault validate examples/ivault_demo_template/prompts
17
+ ivault eval examples/ivault_demo_template/prompts/support_reply.prompt.yml \
18
+ --dataset examples/ivault_demo_template/datasets/support_cases.jsonl \
19
+ --report out/report.json
20
+
21
+ # render locally
22
+ ivault render examples/ivault_demo_template/prompts/support_reply.prompt.yml \
23
+ --vars '{"ticket_text":"My app crashed.","customer_name":"Sam"}'
24
+
25
+ # run runtime example
26
+ python examples/ivault_demo_template/app.py
27
+ ```
28
+
29
+ ## Makefile shortcuts
30
+ ```bash
31
+ make -C examples/ivault_demo_template all
32
+ ```
33
+
34
+ ## Using tags or bundles
35
+ ```bash
36
+ # tag prompts
37
+ git add examples/ivault_demo_template/prompts examples/ivault_demo_template/datasets
38
+ git commit -m "add ivault demo prompts"
39
+ git tag prompts/v1.0.0
40
+
41
+ # bundle
42
+ ivault bundle --prompts examples/ivault_demo_template/prompts \
43
+ --out out/ivault.bundle.json --ref prompts/v1.0.0
44
+ ```
@@ -0,0 +1,12 @@
1
+ from instructvault import InstructVault
2
+
3
+ vault = InstructVault(repo_root=".")
4
+ msgs = vault.render(
5
+ "examples/ivault_demo_template/prompts/support_reply.prompt.yml",
6
+ vars={"ticket_text": "My app crashed.", "customer_name": "Sam"},
7
+ )
8
+
9
+ for m in msgs:
10
+ print(m.role)
11
+ print(m.content)
12
+ print()
@@ -0,0 +1,2 @@
1
+ {"vars":{"ticket_text":"Order arrived damaged","customer_name":"Alex"},"assert":{"contains_any":["Ticket:"]}}
2
+ {"vars":{"ticket_text":"Need refund"},"assert":{"contains_all":["Ticket:"]}}
@@ -0,0 +1,27 @@
1
+ spec_version: "1.0"
2
+ name: support_reply
3
+ description: Respond to a support ticket with empathy and clear steps.
4
+ model_defaults:
5
+ temperature: 0.2
6
+
7
+ variables:
8
+ required: [ticket_text]
9
+ optional: [customer_name]
10
+
11
+ messages:
12
+ - role: system
13
+ content: |
14
+ You are a support engineer. Be concise, empathetic, and action-oriented.
15
+ - role: user
16
+ content: |
17
+ Customer: {{ customer_name | default("there") }}
18
+ Ticket:
19
+ {{ ticket_text }}
20
+
21
+ tests:
22
+ - name: must_contain_customer_and_ticket
23
+ vars:
24
+ ticket_text: "My order arrived damaged."
25
+ customer_name: "Alex"
26
+ assert:
27
+ contains_all: ["Customer:", "Ticket:"]
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "instructvault"
3
- version = "0.2.9"
3
+ version = "0.3.1"
4
4
  description = "Git-first prompt registry + CI evals + lightweight runtime SDK (ivault)."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.10"
File without changes
File without changes
File without changes
File without changes