wherewolf 0.1.0__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 (70) hide show
  1. wherewolf-0.1.0/.envrc +4 -0
  2. wherewolf-0.1.0/.github/workflows/ci.yml +43 -0
  3. wherewolf-0.1.0/.github/workflows/release.yml +61 -0
  4. wherewolf-0.1.0/.gitignore +9 -0
  5. wherewolf-0.1.0/.protocol +4 -0
  6. wherewolf-0.1.0/.streamlit/config.toml +2 -0
  7. wherewolf-0.1.0/AGENTS.md +10 -0
  8. wherewolf-0.1.0/GEMINI.md +476 -0
  9. wherewolf-0.1.0/LICENSE +21 -0
  10. wherewolf-0.1.0/PKG-INFO +14 -0
  11. wherewolf-0.1.0/README.md +84 -0
  12. wherewolf-0.1.0/docs/RELEASING.md +60 -0
  13. wherewolf-0.1.0/docs/agent_conversations/2026-03-09_file_browsing.json +21 -0
  14. wherewolf-0.1.0/docs/agent_conversations/2026-03-09_initial_implementation.json +38 -0
  15. wherewolf-0.1.0/docs/agent_protocol.md +19 -0
  16. wherewolf-0.1.0/docs/execution_ledger.json +1 -0
  17. wherewolf-0.1.0/docs/plans/core_system_design.md +37 -0
  18. wherewolf-0.1.0/docs/plans/execution_engines.md +44 -0
  19. wherewolf-0.1.0/docs/plans/export_formats.md +23 -0
  20. wherewolf-0.1.0/docs/plans/file_browsing.md +26 -0
  21. wherewolf-0.1.0/docs/plans/file_browsing_v2.md +20 -0
  22. wherewolf-0.1.0/docs/plans/initial_prompt.md +141 -0
  23. wherewolf-0.1.0/docs/plans/storage_and_history.md +36 -0
  24. wherewolf-0.1.0/docs/plans/streamlit_ui.md +35 -0
  25. wherewolf-0.1.0/pyproject.toml +42 -0
  26. wherewolf-0.1.0/run.sh +7 -0
  27. wherewolf-0.1.0/scripts/check_tdd.sh +11 -0
  28. wherewolf-0.1.0/src/wherewolf/__init__.py +0 -0
  29. wherewolf-0.1.0/src/wherewolf/app.py +305 -0
  30. wherewolf-0.1.0/src/wherewolf/execution/__init__.py +5 -0
  31. wherewolf-0.1.0/src/wherewolf/execution/duckdb_engine.py +56 -0
  32. wherewolf-0.1.0/src/wherewolf/execution/models.py +13 -0
  33. wherewolf-0.1.0/src/wherewolf/execution/spark_engine.py +78 -0
  34. wherewolf-0.1.0/src/wherewolf/export/__init__.py +3 -0
  35. wherewolf-0.1.0/src/wherewolf/export/exporter.py +26 -0
  36. wherewolf-0.1.0/src/wherewolf/storage/__init__.py +3 -0
  37. wherewolf-0.1.0/src/wherewolf/storage/history.py +63 -0
  38. wherewolf-0.1.0/src/wherewolf/translation/__init__.py +3 -0
  39. wherewolf-0.1.0/src/wherewolf/translation/translator.py +35 -0
  40. wherewolf-0.1.0/src/wherewolf/ui/__init__.py +3 -0
  41. wherewolf-0.1.0/src/wherewolf/ui/file_browser.py +101 -0
  42. wherewolf-0.1.0/tests/reproduce_issue_symlink.py +64 -0
  43. wherewolf-0.1.0/tests/reproduce_issue_symlink_v2.py +39 -0
  44. wherewolf-0.1.0/tests/sample_queries.md +101 -0
  45. wherewolf-0.1.0/tests/test___init__.py +2 -0
  46. wherewolf-0.1.0/tests/test_app.py +13 -0
  47. wherewolf-0.1.0/tests/test_app_flow.py +67 -0
  48. wherewolf-0.1.0/tests/test_config_toml.py +14 -0
  49. wherewolf-0.1.0/tests/test_data.csv +11 -0
  50. wherewolf-0.1.0/tests/test_duckdb_engine.py +44 -0
  51. wherewolf-0.1.0/tests/test_execution___init__.py +0 -0
  52. wherewolf-0.1.0/tests/test_export___init__.py +0 -0
  53. wherewolf-0.1.0/tests/test_exporter.py +30 -0
  54. wherewolf-0.1.0/tests/test_file_browser.py +7 -0
  55. wherewolf-0.1.0/tests/test_file_browser_errors.py +23 -0
  56. wherewolf-0.1.0/tests/test_file_browser_navigation.py +39 -0
  57. wherewolf-0.1.0/tests/test_file_browser_v2.py +11 -0
  58. wherewolf-0.1.0/tests/test_history.py +42 -0
  59. wherewolf-0.1.0/tests/test_models.py +6 -0
  60. wherewolf-0.1.0/tests/test_protocol.py +13 -0
  61. wherewolf-0.1.0/tests/test_spark_engine.py +6 -0
  62. wherewolf-0.1.0/tests/test_spark_engine_logic.py +39 -0
  63. wherewolf-0.1.0/tests/test_storage___init__.py +0 -0
  64. wherewolf-0.1.0/tests/test_translation___init__.py +0 -0
  65. wherewolf-0.1.0/tests/test_translation_integration.py +81 -0
  66. wherewolf-0.1.0/tests/test_translator.py +37 -0
  67. wherewolf-0.1.0/tests/test_ui___init__.py +0 -0
  68. wherewolf-0.1.0/tests/test_ui_branding.py +27 -0
  69. wherewolf-0.1.0/tests/test_wherewolf___init__.py +0 -0
  70. wherewolf-0.1.0/uv.lock +1306 -0
wherewolf-0.1.0/.envrc ADDED
@@ -0,0 +1,4 @@
1
+ export UV_PROJECT_ENVIRONMENT=/tmp/wherewolf/.venv
2
+ export XDG_CACHE_HOME=/tmp/wherewolf/.cache
3
+ export PYTHONPYCACHEPREFIX=/tmp/wherewolf/__pycache__
4
+ export TMPDIR=/tmp/wherewolf
@@ -0,0 +1,43 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ lint:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - name: Install uv
15
+ uses: astral-sh/setup-uv@v5
16
+ with:
17
+ enable-cache: true
18
+ cache-dependency-glob: "uv.lock"
19
+ - name: Set up Python
20
+ run: uv python install 3.12
21
+ - name: Lint with ruff
22
+ run: |
23
+ uv run ruff check .
24
+ uv run ruff format --check .
25
+
26
+ test:
27
+ runs-on: ubuntu-latest
28
+ strategy:
29
+ matrix:
30
+ python-version: ["3.11", "3.12"]
31
+ steps:
32
+ - uses: actions/checkout@v4
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v5
35
+ with:
36
+ enable-cache: true
37
+ cache-dependency-glob: "uv.lock"
38
+ - name: Set up Python ${{ matrix.python-version }}
39
+ run: uv python install ${{ matrix.python-version }}
40
+ - name: Install dependencies
41
+ run: uv sync --all-extras --dev
42
+ - name: Run tests
43
+ run: uv run pytest
@@ -0,0 +1,61 @@
1
+ name: Release
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*.*.*"
7
+
8
+ permissions:
9
+ contents: write
10
+ id-token: write
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Install uv
18
+ uses: astral-sh/setup-uv@v5
19
+ with:
20
+ enable-cache: true
21
+ cache-dependency-glob: "uv.lock"
22
+ - name: Set up Python
23
+ run: uv python install 3.12
24
+ - name: Build package
25
+ run: uv build
26
+ - name: Upload artifacts
27
+ uses: actions/upload-artifact@v4
28
+ with:
29
+ name: dist
30
+ path: dist/
31
+
32
+ github-release:
33
+ needs: build
34
+ runs-on: ubuntu-latest
35
+ steps:
36
+ - uses: actions/checkout@v4
37
+ - name: Download artifacts
38
+ uses: actions/download-artifact@v4
39
+ with:
40
+ name: dist
41
+ path: dist/
42
+ - name: Create GitHub Release
43
+ uses: softprops/action-gh-release@v2
44
+ with:
45
+ files: dist/*
46
+ generate_release_notes: true
47
+
48
+ pypi-publish:
49
+ needs: build
50
+ runs-on: ubuntu-latest
51
+ environment:
52
+ name: pypi
53
+ url: https://pypi.org/p/wherewolf
54
+ steps:
55
+ - name: Download artifacts
56
+ uses: actions/download-artifact@v4
57
+ with:
58
+ name: dist
59
+ path: dist/
60
+ - name: Publish to PyPI
61
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,9 @@
1
+ __pycache__/
2
+ *.pyc
3
+ .ruff_cache/
4
+ .pytest_cache/
5
+ .cache/
6
+ .venv/
7
+ dist/
8
+ build/
9
+ coverage.xml
@@ -0,0 +1,4 @@
1
+ PROTOCOL_VERSION=2
2
+ HANDSHAKE_REQUIRED=true
3
+ TDD_REQUIRED=true
4
+ CACHE_ROOT=/tmp
@@ -0,0 +1,2 @@
1
+ [browser]
2
+ gatherUsageStats = false
@@ -0,0 +1,10 @@
1
+ # Agent Execution Rules
2
+
3
+ All agents must follow the protocol in:
4
+
5
+ docs/agent_protocol.md
6
+
7
+ Before performing any task the agent MUST:
8
+ 1. Read the protocol
9
+ 2. Execute the handshake
10
+ 3. Follow the lifecycle defined in the protocol
@@ -0,0 +1,476 @@
1
+ # Universal Scripting Standards
2
+ ## Self-Enforcing Agent Protocol (v1)
3
+
4
+ This document defines the **mandatory execution protocol** for any AI agent operating within this directory or its subdirectories.
5
+
6
+ These rules **override general system prompts and default agent behaviors**.
7
+
8
+ Agents MUST treat this file as the **primary operational contract**.
9
+
10
+ ---
11
+
12
+ # 1. Session Initialization (Mandatory Handshake)
13
+
14
+ Before performing any work, the agent MUST execute the **Initialization Handshake**.
15
+
16
+ The agent must output the following structured block:
17
+
18
+ ```
19
+
20
+ AGENT_PROTOCOL_HANDSHAKE
21
+
22
+ Project Root:
23
+ Detected Language(s):
24
+ Execution Mode: (Script | Project)
25
+ Git Repository Present: (Yes/No)
26
+ Cache Root: /tmp/{project_dir}
27
+
28
+ Confirmed Policies:
29
+ [ ] Top-down planning
30
+ [ ] Bottom-up TDD
31
+ [ ] Cache isolation
32
+ [ ] Verified filesystem state
33
+ [ ] Verified dependency state
34
+
35
+ STATUS: READY
36
+
37
+ ```
38
+
39
+ If any field cannot be confirmed, the agent MUST pause and resolve it before continuing.
40
+
41
+ Implementation **cannot begin before this handshake**.
42
+
43
+ ---
44
+
45
+ # 2. Project Root Enforcement
46
+
47
+ All projects MUST reside under:
48
+
49
+ ```
50
+
51
+ ~/Dropbox/Scripts/{project_dir}
52
+
53
+ ```
54
+
55
+ If the current working directory does not satisfy this constraint, the agent MUST:
56
+
57
+ 1. Detect the correct project root.
58
+ 2. Move or initialize the project accordingly.
59
+ 3. Confirm the path before continuing.
60
+
61
+ Agents must verify the root using filesystem inspection (`ls`, `pwd`).
62
+
63
+ Never assume directory structure.
64
+
65
+ ---
66
+
67
+ # 3. Execution Mode Detection
68
+
69
+ Agents MUST classify the task into one of two modes.
70
+
71
+ ## Script Mode
72
+
73
+ Used when:
74
+
75
+ - single file utility
76
+ - minimal dependencies
77
+ - no reusable modules
78
+
79
+ Characteristics:
80
+
81
+ ```
82
+
83
+ PEP 723 script metadata
84
+ uv run script.py
85
+ no pyproject.toml required
86
+
87
+ ```
88
+
89
+ ---
90
+
91
+ ## Project Mode
92
+
93
+ Used when:
94
+
95
+ - reusable modules
96
+ - multiple files
97
+ - automated tests
98
+ - packaging
99
+
100
+ Characteristics:
101
+
102
+ ```
103
+
104
+ pyproject.toml
105
+ uv dependency management
106
+ tests/ directory
107
+
108
+ ```
109
+
110
+ Agents MUST explicitly state the detected mode during the handshake.
111
+
112
+ ---
113
+
114
+ # 4. Mandatory Execution Lifecycle
115
+
116
+ Agents MUST follow this lifecycle **without skipping steps**.
117
+
118
+ ```
119
+
120
+ ANALYZE
121
+ PLAN
122
+ VERIFY STATE
123
+ TEST (RED)
124
+ IMPLEMENT (GREEN)
125
+ REFACTOR
126
+ VALIDATE
127
+ COMMIT
128
+ DOCUMENT
129
+
130
+ ```
131
+
132
+ Each phase must complete before the next begins.
133
+
134
+ ---
135
+
136
+ # 5. Planning Requirement (Top-Down)
137
+
138
+ Before writing any implementation code, the agent MUST create or update:
139
+
140
+ ```
141
+
142
+ docs/plans/{feature_name}.md
143
+
144
+ ```
145
+
146
+ The plan must include:
147
+
148
+ ```
149
+
150
+ Problem Definition
151
+ Architecture Overview
152
+ Core Data Structures
153
+ Public Interfaces
154
+ Dependency Requirements
155
+ Testing Strategy
156
+
157
+ ```
158
+
159
+ Implementation cannot begin until the plan exists.
160
+
161
+ ---
162
+
163
+ # 6. Strict TDD Enforcement
164
+
165
+ Agents MUST follow **Red-Green-Refactor**.
166
+
167
+ ### Red
168
+
169
+ Write a failing test describing desired behavior.
170
+
171
+ ```
172
+
173
+ tests/test_<feature>.py
174
+
175
+ ```
176
+
177
+ Verify failure:
178
+
179
+ ```
180
+
181
+ uv run pytest
182
+
183
+ ```
184
+
185
+ ---
186
+
187
+ ### Green
188
+
189
+ Implement the minimal code required to pass the test.
190
+
191
+ No extra functionality allowed.
192
+
193
+ ---
194
+
195
+ ### Refactor
196
+
197
+ Improve structure while maintaining passing tests.
198
+
199
+ ---
200
+
201
+ ### Enforcement Rule
202
+
203
+ If a feature implementation exists without a corresponding failing test created earlier in the session, the implementation is invalid and must be rolled back.
204
+
205
+ ---
206
+
207
+ # 7. Cache Isolation (Mandatory)
208
+
209
+ All tool-generated caches MUST reside in:
210
+
211
+ ```
212
+
213
+ /tmp/{project_dir}/
214
+
215
+ ```
216
+
217
+ Agents must configure:
218
+
219
+ ```
220
+
221
+ export XDG_CACHE_HOME=/tmp/{project_dir}/.cache
222
+ export PYTHONPYCACHEPREFIX=/tmp/{project_dir}/**pycache**
223
+
224
+ ```
225
+
226
+ Required cache redirections:
227
+
228
+ ```
229
+
230
+ ruff -> /tmp/{project_dir}/.ruff_cache
231
+ pytest -> /tmp/{project_dir}/.pytest_cache
232
+ mypy -> /tmp/{project_dir}/.mypy_cache
233
+
234
+ ```
235
+
236
+ No caches may exist inside the repository.
237
+
238
+ This prevents Dropbox synchronization pollution.
239
+
240
+ ---
241
+
242
+ # 8. Python Environment Policy
243
+
244
+ Python projects MUST use:
245
+
246
+ ```
247
+
248
+ uv
249
+
250
+ ```
251
+
252
+ Required commands:
253
+
254
+ ```
255
+
256
+ uv init
257
+ uv add
258
+ uv sync
259
+ uv run
260
+
261
+ ```
262
+
263
+ Never use:
264
+
265
+ ```
266
+
267
+ pip install
268
+ python -m venv
269
+
270
+ ```
271
+
272
+ unless explicitly required.
273
+
274
+ If a virtual environment is unavoidable, it must exist at:
275
+
276
+ ```
277
+
278
+ /tmp/{project_dir}/.venv
279
+
280
+ ```
281
+
282
+ ---
283
+
284
+ # 9. Git Enforcement
285
+
286
+ If a repository does not exist:
287
+
288
+ ```
289
+
290
+ git init
291
+
292
+ ```
293
+
294
+ All work must occur in feature branches:
295
+
296
+ ```
297
+
298
+ feat/<feature>
299
+ fix/<bug>
300
+ refactor/<component>
301
+
302
+ ```
303
+
304
+ Commits must follow imperative style:
305
+
306
+ ```
307
+
308
+ Add dataset validation layer
309
+ Fix Selenium driver initialization
310
+ Refactor logging subsystem
311
+
312
+ ```
313
+
314
+ ---
315
+
316
+ ## Mandatory `.gitignore`
317
+
318
+ If `.gitignore` does not exist, create one including:
319
+
320
+ ```
321
+
322
+ **pycache**/
323
+ *.pyc
324
+ .ruff_cache/
325
+ .pytest_cache/
326
+ .cache/
327
+ .venv/
328
+ dist/
329
+ build/
330
+
331
+ ```
332
+
333
+ Generated artifacts must never be committed.
334
+
335
+ ---
336
+
337
+ # 10. Anti-Hallucination Safeguards
338
+
339
+ Agents MUST follow these constraints.
340
+
341
+ ### File Verification
342
+
343
+ Never reference a file that has not been confirmed via filesystem inspection.
344
+
345
+ ---
346
+
347
+ ### Dependency Verification
348
+
349
+ Never assume dependencies exist.
350
+
351
+ Agents must verify via:
352
+
353
+ ```
354
+
355
+ pyproject.toml
356
+ uv.lock
357
+
358
+ ```
359
+
360
+ ---
361
+
362
+ ### Library Behavior
363
+
364
+ If API behavior is uncertain:
365
+
366
+ 1. Read documentation
367
+ 2. Inspect source
368
+ 3. Use web search if required
369
+
370
+ Speculative code is forbidden.
371
+
372
+ ---
373
+
374
+ # 11. Quality Control
375
+
376
+ Before any commit, agents MUST execute:
377
+
378
+ ```
379
+
380
+ ruff check . --fix
381
+ ruff format .
382
+ uv run pytest
383
+
384
+ ```
385
+
386
+ All checks must pass.
387
+
388
+ ---
389
+
390
+ # 12. Documentation Requirements
391
+
392
+ Every project must include:
393
+
394
+ ```
395
+
396
+ README.md
397
+ docs/
398
+ docs/plans/
399
+
400
+ ```
401
+
402
+ README must contain:
403
+
404
+ ```
405
+
406
+ project description
407
+ installation instructions
408
+ usage examples
409
+ dependency requirements
410
+
411
+ ```
412
+
413
+ ---
414
+
415
+ # 13. Agent Session Logging
416
+
417
+ Agents must record session summaries in:
418
+
419
+ ```
420
+
421
+ docs/agent_conversations/
422
+
423
+ ```
424
+
425
+ Each session log must include:
426
+
427
+ ```
428
+
429
+ date
430
+ task objective
431
+ files modified
432
+ tests added
433
+ design decisions
434
+ results
435
+
436
+ ```
437
+
438
+ Example file:
439
+
440
+ ```
441
+
442
+ docs/agent_conversations/2026-03-09_dataset_profiler.json
443
+
444
+ ```
445
+
446
+ ---
447
+
448
+ # 14. Definition of Done
449
+
450
+ A task is complete only if:
451
+
452
+ ```
453
+
454
+ [ ] ruff check passed
455
+ [ ] ruff format applied
456
+ [ ] tests pass via uv run pytest
457
+ [ ] README updated
458
+ [ ] dependencies documented
459
+ [ ] caches redirected to /tmp
460
+ [ ] session log recorded
461
+
462
+ ```
463
+
464
+ ---
465
+
466
+ # 15. Failure Recovery Protocol
467
+
468
+ If execution fails:
469
+
470
+ 1. Capture the error output
471
+ 2. Identify the failing component
472
+ 3. Write a reproduction test
473
+ 4. Fix root cause
474
+ 5. Re-run validation suite
475
+
476
+ Blind retries are forbidden.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 David Beall
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,14 @@
1
+ Metadata-Version: 2.4
2
+ Name: wherewolf
3
+ Version: 0.1.0
4
+ License-File: LICENSE
5
+ Requires-Python: >=3.11
6
+ Requires-Dist: duckdb>=1.5.0
7
+ Requires-Dist: ibis-framework>=12.0.0
8
+ Requires-Dist: openpyxl>=3.1.5
9
+ Requires-Dist: pandas>=2.3.3
10
+ Requires-Dist: pyarrow>=23.0.1
11
+ Requires-Dist: pyspark>=4.1.1
12
+ Requires-Dist: sqlglot>=29.0.1
13
+ Requires-Dist: streamlit-ace>=0.1.1
14
+ Requires-Dist: streamlit>=1.55.0