instructvault 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: instructvault
3
- Version: 0.3.0
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
 
@@ -11,8 +11,8 @@ instructvault/scaffold.py,sha256=f5gwXE3dUPuJYTedZRqBs8w5SQEgt1dgDSuqW2dxrMg,168
11
11
  instructvault/sdk.py,sha256=4M3d-KqyuWLcXkaccZjhI-BsBnD4cU_GynkJPJ3ged4,1901
12
12
  instructvault/spec.py,sha256=ybv-0rQ4Vqxrj277u7JAVttHQCGmix5zMmtZ4_SN7A8,2639
13
13
  instructvault/store.py,sha256=NhN49w7xrkeij0lQDr-CEdANYLpNVBXumv_cKqLmiYY,1056
14
- instructvault-0.3.0.dist-info/METADATA,sha256=po0yI-tsInHwHeJSokID1Vuvn9cKt67KgqbEMtsDSOg,7606
15
- instructvault-0.3.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
16
- instructvault-0.3.0.dist-info/entry_points.txt,sha256=cdcMJQwBk9c95LwfN2W6x2xO43FwPjhfV3jHE7TTuHg,49
17
- instructvault-0.3.0.dist-info/licenses/LICENSE,sha256=VFbCvIsyizmkz4NrZPMdcPhyRK5uM0HhAjv3GBUbb7Y,135
18
- instructvault-0.3.0.dist-info/RECORD,,
14
+ instructvault-0.3.1.dist-info/METADATA,sha256=gm-V1pi8a4WrrV4O_Vcxbf3wJ1InN2qQMkUELQrqN9g,11180
15
+ instructvault-0.3.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
16
+ instructvault-0.3.1.dist-info/entry_points.txt,sha256=cdcMJQwBk9c95LwfN2W6x2xO43FwPjhfV3jHE7TTuHg,49
17
+ instructvault-0.3.1.dist-info/licenses/LICENSE,sha256=VFbCvIsyizmkz4NrZPMdcPhyRK5uM0HhAjv3GBUbb7Y,135
18
+ instructvault-0.3.1.dist-info/RECORD,,