amalfa 1.0.2 → 1.0.4
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.
- package/package.json +1 -1
- package/src/cli.ts +1 -1
- package/docs/AGENT-METADATA-PATTERNS.md +0 -1021
- package/docs/AGENT_PROTOCOLS.md +0 -28
- package/docs/ARCHITECTURAL_OVERVIEW.md +0 -123
- package/docs/BENTO_BOXING_DEPRECATION.md +0 -281
- package/docs/Bun-SQLite.html +0 -464
- package/docs/COMMIT_GUIDELINES.md +0 -367
- package/docs/CONFIG_E2E_VALIDATION.md +0 -147
- package/docs/CONFIG_UNIFICATION.md +0 -187
- package/docs/CONFIG_VALIDATION.md +0 -103
- package/docs/DEVELOPER_ONBOARDING.md +0 -36
- package/docs/Graph and Vector Database Best Practices.md +0 -214
- package/docs/LEGACY_DEPRECATION.md +0 -174
- package/docs/MCP_SETUP.md +0 -317
- package/docs/PERFORMANCE_BASELINES.md +0 -88
- package/docs/QUICK_START_MCP.md +0 -168
- package/docs/REPOSITORY_CLEANUP_SUMMARY.md +0 -261
- package/docs/SESSION-2026-01-06-METADATA-PATTERNS.md +0 -346
- package/docs/SETUP.md +0 -464
- package/docs/SETUP_COMPLETE.md +0 -464
- package/docs/VISION-AGENT-LEARNING.md +0 -1242
- package/docs/_current-config-status.md +0 -93
- package/docs/edge-generation-methods.md +0 -57
- package/docs/elevator-pitch.md +0 -118
- package/docs/graph-and-vector-database-playbook.html +0 -480
- package/docs/hardened-sqlite.md +0 -85
- package/docs/headless-knowledge-management.md +0 -79
- package/docs/john-kaye-flux-prompt.md +0 -46
- package/docs/keyboard-shortcuts.md +0 -80
- package/docs/opinion-proceed-pattern.md +0 -29
- package/docs/polyvis-nodes-edges-schema.md +0 -77
- package/docs/protocols/lab-protocol.md +0 -30
- package/docs/reaction-iquest-loop-coder.md +0 -46
- package/docs/services.md +0 -60
- package/docs/sqlite-wal-readonly-trap.md +0 -228
- package/docs/strategy/css-architecture.md +0 -40
- package/docs/test-document-cycle.md +0 -83
- package/docs/test_lifecycle_E2E.md +0 -4
- package/docs/the-bicameral-graph.md +0 -83
- package/docs/user-guide.md +0 -70
- package/docs/vision-helper.md +0 -53
- package/polyvis.settings.json.bak +0 -38
- package/src/EnlightenedTriad.ts +0 -146
- package/src/JIT_Triad.ts +0 -137
- package/src/data/experience/test_doc_1.md +0 -2
- package/src/data/experience/test_doc_2.md +0 -2
- package/src/demo-triad.ts +0 -45
- package/src/gardeners/BaseGardener.ts +0 -55
- package/src/llm/EnlightenedProvider.ts +0 -95
- package/src/services/README.md +0 -56
- package/src/services/llama.ts +0 -59
- package/src/services/llamauv.ts +0 -56
- package/src/services/olmo3.ts +0 -58
- package/src/services/phi.ts +0 -52
|
@@ -1,367 +0,0 @@
|
|
|
1
|
-
# Commit Guidelines
|
|
2
|
-
|
|
3
|
-
**Purpose:** Define what should and should NOT be committed to the polyvis repository.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## ✅ What TO Commit
|
|
8
|
-
|
|
9
|
-
### Source Code
|
|
10
|
-
- `.ts`, `.js` - TypeScript/JavaScript source files
|
|
11
|
-
- `.html`, `.css` - HTML and stylesheets
|
|
12
|
-
- `.md` - Documentation (markdown)
|
|
13
|
-
- `.json` - Configuration files (package.json, tsconfig.json)
|
|
14
|
-
- `.yaml`, `.yml` - Configuration files
|
|
15
|
-
|
|
16
|
-
### Project Configuration
|
|
17
|
-
- `.gitignore`, `.gitattributes`
|
|
18
|
-
- `biome.json`, `tsconfig.json`
|
|
19
|
-
- `package.json` (but NOT `bun.lockb` - see exceptions)
|
|
20
|
-
- `.beads/` directory (Beads issue tracking)
|
|
21
|
-
|
|
22
|
-
### Documentation & Assets
|
|
23
|
-
- Small images (<500 KB) for documentation
|
|
24
|
-
- Architecture diagrams (optimized)
|
|
25
|
-
- Example data files (small samples, <100 KB)
|
|
26
|
-
- README files, playbooks, guides
|
|
27
|
-
|
|
28
|
-
### Scripts & Tools
|
|
29
|
-
- Build scripts (`scripts/*.ts`, `scripts/*.sh`)
|
|
30
|
-
- Development utilities
|
|
31
|
-
- Migration scripts (with documentation)
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## ❌ What NOT to Commit
|
|
36
|
-
|
|
37
|
-
### Generated Artifacts
|
|
38
|
-
|
|
39
|
-
**Database Files:**
|
|
40
|
-
```
|
|
41
|
-
❌ *.db
|
|
42
|
-
❌ *.db-wal
|
|
43
|
-
❌ *.db-shm
|
|
44
|
-
❌ *.sqlite
|
|
45
|
-
❌ *.sqlite-wal
|
|
46
|
-
❌ *.sqlite-shm
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
**Why:** Database files are generated from source JSON. The JSON is the source of truth.
|
|
50
|
-
|
|
51
|
-
**What to do instead:**
|
|
52
|
-
- Commit source JSON files in `public/data/`
|
|
53
|
-
- Document database generation in README
|
|
54
|
-
- Use `scripts/build-db.ts` to regenerate
|
|
55
|
-
|
|
56
|
-
---
|
|
57
|
-
|
|
58
|
-
**Node Modules & Dependencies:**
|
|
59
|
-
```
|
|
60
|
-
❌ node_modules/
|
|
61
|
-
❌ bun.lockb (too large, changes frequently)
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
**Why:** Dependencies should be installed via `bun install`, not committed.
|
|
65
|
-
|
|
66
|
-
**What to do instead:**
|
|
67
|
-
- List dependencies in `package.json`
|
|
68
|
-
- Document installation steps in README
|
|
69
|
-
- Use `.nvmrc` or similar for version pinning
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
**Built/Bundled Files:**
|
|
74
|
-
```
|
|
75
|
-
❌ dist/*.bundle.js
|
|
76
|
-
❌ dist/*.min.js
|
|
77
|
-
❌ build/
|
|
78
|
-
❌ out/
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
**Why:** Built files are generated from source via build scripts.
|
|
82
|
-
|
|
83
|
-
**What to do instead:**
|
|
84
|
-
- Commit source files in `src/`
|
|
85
|
-
- Document build process in README
|
|
86
|
-
- Use CI/CD to build on deployment
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
**Cache & Temp Files:**
|
|
91
|
-
```
|
|
92
|
-
❌ .resonance/cache/
|
|
93
|
-
❌ local_cache/
|
|
94
|
-
❌ *.log
|
|
95
|
-
❌ .DS_Store
|
|
96
|
-
❌ *.tmp
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**Why:** These are ephemeral, machine-specific files.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
### Large Binary Files
|
|
104
|
-
|
|
105
|
-
**Research Papers:**
|
|
106
|
-
```
|
|
107
|
-
❌ *.pdf (research papers)
|
|
108
|
-
❌ Large images (>1 MB)
|
|
109
|
-
```
|
|
110
|
-
|
|
111
|
-
**Why:** Git is optimized for text, not large binaries. They bloat the repo.
|
|
112
|
-
|
|
113
|
-
**What to do instead:**
|
|
114
|
-
- Link to papers via URL (arXiv, DOI)
|
|
115
|
-
- Create `docs/REFERENCES.md` with links
|
|
116
|
-
- For critical PDFs, use external storage (GitHub releases, S3)
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
**Machine Learning Models:**
|
|
121
|
-
```
|
|
122
|
-
❌ *.gguf
|
|
123
|
-
❌ *.pt
|
|
124
|
-
❌ *.safetensors
|
|
125
|
-
❌ *.onnx (>50 MB)
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
**Why:** Models are huge and change frequently.
|
|
129
|
-
|
|
130
|
-
**What to do instead:**
|
|
131
|
-
- Document model download URLs
|
|
132
|
-
- Use model registry (Hugging Face, etc.)
|
|
133
|
-
- Store model metadata/config only
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
### Backups
|
|
138
|
-
|
|
139
|
-
**Database Backups:**
|
|
140
|
-
```
|
|
141
|
-
❌ backups/db/*.db
|
|
142
|
-
❌ *.backup
|
|
143
|
-
❌ *.bak
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
**Why:** Backups belong in backup systems, not version control.
|
|
147
|
-
|
|
148
|
-
**What to do instead:**
|
|
149
|
-
- Use external backup solutions
|
|
150
|
-
- Document backup/restore procedures
|
|
151
|
-
- Keep backups out of git entirely
|
|
152
|
-
|
|
153
|
-
---
|
|
154
|
-
|
|
155
|
-
### Test Artifacts
|
|
156
|
-
|
|
157
|
-
**Test Databases:**
|
|
158
|
-
```
|
|
159
|
-
❌ test-*.db
|
|
160
|
-
❌ canary-*.db
|
|
161
|
-
❌ *-test.sqlite
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
**Why:** Test artifacts should be created on-demand during testing.
|
|
165
|
-
|
|
166
|
-
**What to do instead:**
|
|
167
|
-
- Use `beforeEach()` to create fresh test DBs
|
|
168
|
-
- Clean up test artifacts in `afterEach()`
|
|
169
|
-
- Gitignore test patterns
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## 🤔 Edge Cases
|
|
174
|
-
|
|
175
|
-
### Small Sample Databases
|
|
176
|
-
|
|
177
|
-
**✅ Acceptable IF:**
|
|
178
|
-
- < 1 MB in size
|
|
179
|
-
- Essential for examples/documentation
|
|
180
|
-
- Clearly named (e.g., `examples/sample-small.db`)
|
|
181
|
-
- Documented in README
|
|
182
|
-
|
|
183
|
-
**❌ Never acceptable:**
|
|
184
|
-
- Production database dumps
|
|
185
|
-
- Full-sized test databases
|
|
186
|
-
- Database backups
|
|
187
|
-
|
|
188
|
-
---
|
|
189
|
-
|
|
190
|
-
### Configuration Files with Secrets
|
|
191
|
-
|
|
192
|
-
**✅ Commit:**
|
|
193
|
-
```
|
|
194
|
-
config.example.yaml # Template with placeholders
|
|
195
|
-
.env.example # Example environment variables
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
**❌ Never commit:**
|
|
199
|
-
```
|
|
200
|
-
.env # Actual secrets
|
|
201
|
-
config.yaml # With real API keys
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
**Pattern:** Commit examples/templates, never actual secrets.
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
### Generated Documentation
|
|
209
|
-
|
|
210
|
-
**It depends:**
|
|
211
|
-
|
|
212
|
-
- **Commit:** Hand-written docs, playbooks, guides
|
|
213
|
-
- **Don't commit:** Auto-generated API docs (can be regenerated)
|
|
214
|
-
|
|
215
|
-
**Rule of thumb:** If a human wrote it, commit it. If a script generated it, don't.
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
## 🔍 How to Check Before Committing
|
|
220
|
-
|
|
221
|
-
### 1. Review Your Staged Files
|
|
222
|
-
|
|
223
|
-
```bash
|
|
224
|
-
git status
|
|
225
|
-
git diff --cached
|
|
226
|
-
```
|
|
227
|
-
|
|
228
|
-
**Red flags:**
|
|
229
|
-
- Files in `dist/`, `build/`, or `out/`
|
|
230
|
-
- Files ending in `.db`, `.sqlite`, `.log`
|
|
231
|
-
- Files > 1 MB
|
|
232
|
-
- Files with "backup" or "test" in the name
|
|
233
|
-
|
|
234
|
-
---
|
|
235
|
-
|
|
236
|
-
### 2. Use Git Hooks (Pre-commit)
|
|
237
|
-
|
|
238
|
-
Create `.git/hooks/pre-commit`:
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
#!/bin/bash
|
|
242
|
-
# Check for large files
|
|
243
|
-
git diff --cached --name-only | while read file; do
|
|
244
|
-
if [ -f "$file" ]; then
|
|
245
|
-
size=$(wc -c < "$file" | awk '{print $1}')
|
|
246
|
-
if [ $size -gt 1048576 ]; then # 1 MB
|
|
247
|
-
echo "⚠️ Warning: $file is larger than 1 MB ($size bytes)"
|
|
248
|
-
echo " Consider adding to .gitignore or using external storage"
|
|
249
|
-
fi
|
|
250
|
-
fi
|
|
251
|
-
done
|
|
252
|
-
|
|
253
|
-
# Check for database files
|
|
254
|
-
if git diff --cached --name-only | grep -E '\.(db|sqlite)$'; then
|
|
255
|
-
echo "❌ Error: Database files detected!"
|
|
256
|
-
echo " Database files should not be committed."
|
|
257
|
-
exit 1
|
|
258
|
-
fi
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
---
|
|
262
|
-
|
|
263
|
-
### 3. Audit Repository Size
|
|
264
|
-
|
|
265
|
-
```bash
|
|
266
|
-
# Check current repo size
|
|
267
|
-
du -sh .git
|
|
268
|
-
|
|
269
|
-
# List largest files in history
|
|
270
|
-
git rev-list --objects --all \
|
|
271
|
-
| git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' \
|
|
272
|
-
| awk '/^blob/ {print $3, $4}' \
|
|
273
|
-
| sort -rn \
|
|
274
|
-
| head -20
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
If you see large files, they may need to be removed from history (see cleanup script).
|
|
278
|
-
|
|
279
|
-
---
|
|
280
|
-
|
|
281
|
-
## 🧹 Cleaning Up Mistakes
|
|
282
|
-
|
|
283
|
-
### If You Accidentally Committed Artifacts
|
|
284
|
-
|
|
285
|
-
**Before pushing:**
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
# Remove from staging
|
|
289
|
-
git reset HEAD path/to/artifact.db
|
|
290
|
-
|
|
291
|
-
# Remove from last commit
|
|
292
|
-
git rm --cached path/to/artifact.db
|
|
293
|
-
git commit --amend --no-edit
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
**After pushing:**
|
|
297
|
-
|
|
298
|
-
Use the cleanup script:
|
|
299
|
-
|
|
300
|
-
```bash
|
|
301
|
-
./scripts/cleanup-repo-artifacts.sh
|
|
302
|
-
```
|
|
303
|
-
|
|
304
|
-
**⚠️ Warning:** This rewrites history. Coordinate with your team first.
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
## 📋 Quick Checklist
|
|
309
|
-
|
|
310
|
-
Before committing, ask yourself:
|
|
311
|
-
|
|
312
|
-
- [ ] Is this a source file I wrote/edited?
|
|
313
|
-
- [ ] Can this file be regenerated from source?
|
|
314
|
-
- [ ] Is this file larger than 1 MB?
|
|
315
|
-
- [ ] Does this file contain secrets/credentials?
|
|
316
|
-
- [ ] Is this a database, cache, or log file?
|
|
317
|
-
- [ ] Would someone else need this to build the project?
|
|
318
|
-
|
|
319
|
-
**If you answered:**
|
|
320
|
-
- "Yes" to 1 or 6 → Commit it
|
|
321
|
-
- "Yes" to 2-5 → DON'T commit it
|
|
322
|
-
|
|
323
|
-
---
|
|
324
|
-
|
|
325
|
-
## 🎯 Summary Table
|
|
326
|
-
|
|
327
|
-
| File Type | Commit? | Rationale |
|
|
328
|
-
|-----------|---------|-----------|
|
|
329
|
-
| `.ts`, `.js` (source) | ✅ Yes | Source code |
|
|
330
|
-
| `.db`, `.sqlite` | ❌ No | Generated artifacts |
|
|
331
|
-
| `package.json` | ✅ Yes | Dependency manifest |
|
|
332
|
-
| `bun.lockb` | ❌ No | Too large, auto-generated |
|
|
333
|
-
| `dist/*.js` | ❌ No | Built artifacts |
|
|
334
|
-
| `.md` (docs) | ✅ Yes | Documentation |
|
|
335
|
-
| `.pdf` (papers) | ❌ No | Too large, use links |
|
|
336
|
-
| `*.log` | ❌ No | Ephemeral logs |
|
|
337
|
-
| `.env` | ❌ No | Contains secrets |
|
|
338
|
-
| `.env.example` | ✅ Yes | Template without secrets |
|
|
339
|
-
| Small images (<500 KB) | ✅ Yes | Documentation assets |
|
|
340
|
-
| Large images (>1 MB) | ❌ No | Use external hosting |
|
|
341
|
-
| Test fixtures (<100 KB) | ✅ Yes | Required for tests |
|
|
342
|
-
| Test databases | ❌ No | Generated during tests |
|
|
343
|
-
| Scripts (`.sh`, `.ts`) | ✅ Yes | Automation tools |
|
|
344
|
-
| Backups (`.bak`) | ❌ No | Use backup systems |
|
|
345
|
-
|
|
346
|
-
---
|
|
347
|
-
|
|
348
|
-
## 🔗 Related Documentation
|
|
349
|
-
|
|
350
|
-
- **Cleanup Script:** `scripts/cleanup-repo-artifacts.sh`
|
|
351
|
-
- **Gitignore:** `.gitignore` (see patterns)
|
|
352
|
-
- **Beads Playbooks:** `playbooks/beads-human-playbook.md` (for issues)
|
|
353
|
-
- **Development Workflow:** `playbooks/development-workflow-playbook.md`
|
|
354
|
-
|
|
355
|
-
---
|
|
356
|
-
|
|
357
|
-
## 💡 Philosophy
|
|
358
|
-
|
|
359
|
-
**Guiding principle:** *The repository should contain the minimum necessary to build and understand the project.*
|
|
360
|
-
|
|
361
|
-
**Corollary:** If it can be generated, downloaded, or derived from committed files, it should NOT be committed.
|
|
362
|
-
|
|
363
|
-
**Goal:** Keep the repository lean, fast to clone, and easy to navigate.
|
|
364
|
-
|
|
365
|
-
---
|
|
366
|
-
|
|
367
|
-
**Last updated:** 2026-01-05
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
# Configuration System End-to-End Validation
|
|
2
|
-
|
|
3
|
-
**Date**: 2026-01-07
|
|
4
|
-
**Test Status**: ✅ PASSED
|
|
5
|
-
**Database**: `.amalfa/multi-source-test.db`
|
|
6
|
-
**Test Script**: `scripts/test-config-search.ts`
|
|
7
|
-
|
|
8
|
-
## Test Overview
|
|
9
|
-
|
|
10
|
-
Validated the unified configuration system end-to-end after migrating from `polyvis.settings.json` to `amalfa.config.json`.
|
|
11
|
-
|
|
12
|
-
## Test Sequence
|
|
13
|
-
|
|
14
|
-
### 1. Document Creation
|
|
15
|
-
Created test document: `../polyvis/docs/config-unification-test.md`
|
|
16
|
-
- Purpose: Validate indexing and search
|
|
17
|
-
- Content: Configuration migration strategy details
|
|
18
|
-
- Tags: #configuration #migration #typescript #amalfa #testing
|
|
19
|
-
|
|
20
|
-
### 2. Ingestion
|
|
21
|
-
```bash
|
|
22
|
-
bun run src/cli.ts init
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
**Results**:
|
|
26
|
-
- Files processed: 96 (including new test document)
|
|
27
|
-
- Nodes created: 95
|
|
28
|
-
- Embeddings: 95 (384-dim BAAI/bge-small-en-v1.5)
|
|
29
|
-
- Database: `.amalfa/multi-source-test.db` (0.79 MB)
|
|
30
|
-
|
|
31
|
-
### 3. Vector Search Tests
|
|
32
|
-
|
|
33
|
-
**Query 1**: "configuration migration strategy"
|
|
34
|
-
```
|
|
35
|
-
1. [84.1%] config-unification-test.md ✅
|
|
36
|
-
2. [79.8%] embeddings-and-fafcas-protocol-playbook.md
|
|
37
|
-
3. [79.3%] report-graph-first-strategy.md
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
**Query 2**: "TypeScript compilation errors"
|
|
41
|
-
```
|
|
42
|
-
1. [76.0%] tooling-showcase.md
|
|
43
|
-
2. [75.6%] problem-solving-playbook.md
|
|
44
|
-
3. [74.8%] compare-src-and-resonance-folders.md
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
**Query 3**: "database path validation"
|
|
48
|
-
```
|
|
49
|
-
1. [77.3%] database-capabilities.md
|
|
50
|
-
2. [76.6%] schema-playbook.md
|
|
51
|
-
3. [76.4%] data-architecture.md
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### 4. Test Document Verification
|
|
55
|
-
|
|
56
|
-
**Query**: "config unification test document clean-slate migration"
|
|
57
|
-
|
|
58
|
-
**Result**: ✅ **SUCCESS**
|
|
59
|
-
- Best match: `config-unification-test.md`
|
|
60
|
-
- Score: 83.5%
|
|
61
|
-
- Status: TEST DOCUMENT INDEXED SUCCESSFULLY!
|
|
62
|
-
|
|
63
|
-
## System Validation
|
|
64
|
-
|
|
65
|
-
### Configuration Loading ✅
|
|
66
|
-
- Config file: `amalfa.config.json`
|
|
67
|
-
- Sources: `../polyvis/docs`, `../polyvis/playbooks`
|
|
68
|
-
- Database: `.amalfa/multi-source-test.db`
|
|
69
|
-
- Model: `BAAI/bge-small-en-v1.5`
|
|
70
|
-
|
|
71
|
-
### Database Access ✅
|
|
72
|
-
- Path loaded from config (not hardcoded)
|
|
73
|
-
- WAL mode active
|
|
74
|
-
- 95 nodes with embeddings
|
|
75
|
-
- Full-text search disabled (hollow nodes)
|
|
76
|
-
|
|
77
|
-
### Vector Search ✅
|
|
78
|
-
- Model initialized correctly
|
|
79
|
-
- Embeddings generated
|
|
80
|
-
- Dot product similarity working
|
|
81
|
-
- Results ranked by relevance
|
|
82
|
-
|
|
83
|
-
### Semantic Accuracy ✅
|
|
84
|
-
- Query 1: 84.1% match on exact test document
|
|
85
|
-
- Query 2-3: 76-77% matches on related technical content
|
|
86
|
-
- Clear differentiation between topics
|
|
87
|
-
|
|
88
|
-
## Performance Metrics
|
|
89
|
-
|
|
90
|
-
- **Database size**: 0.79 MB (95 nodes)
|
|
91
|
-
- **Ingestion time**: ~0.26 seconds (96 files)
|
|
92
|
-
- **Search latency**: <100ms per query
|
|
93
|
-
- **Best match accuracy**: 83.5% for exact topic match
|
|
94
|
-
|
|
95
|
-
## Configuration Benefits Observed
|
|
96
|
-
|
|
97
|
-
1. **Single Source of Truth**: No ambiguity about config location
|
|
98
|
-
2. **Lazy Loading**: Config loaded only when needed by each command
|
|
99
|
-
3. **Predictable Paths**: All paths resolved from config
|
|
100
|
-
4. **Clean Migration**: Zero legacy imports remain
|
|
101
|
-
5. **Validation Tooling**: `validate-config` provides safety net
|
|
102
|
-
|
|
103
|
-
## Issues Encountered
|
|
104
|
-
|
|
105
|
-
None. System working as expected.
|
|
106
|
-
|
|
107
|
-
## Related Tests
|
|
108
|
-
|
|
109
|
-
- **CLI Test**: `amalfa stats` ✅
|
|
110
|
-
- **Daemon Test**: File watcher started successfully ✅
|
|
111
|
-
- **MCP Server**: Ready for Warp Preview testing ⏭️
|
|
112
|
-
|
|
113
|
-
## Conclusion
|
|
114
|
-
|
|
115
|
-
The unified configuration system migration is **complete and validated**. All components:
|
|
116
|
-
- Load config from `amalfa.config.json`
|
|
117
|
-
- Access database from config path
|
|
118
|
-
- Perform vector search correctly
|
|
119
|
-
- Index new documents successfully
|
|
120
|
-
|
|
121
|
-
**Recommendation**: Ship to production. System stable and performant.
|
|
122
|
-
|
|
123
|
-
---
|
|
124
|
-
|
|
125
|
-
## Test Reproduction
|
|
126
|
-
|
|
127
|
-
To reproduce this test:
|
|
128
|
-
|
|
129
|
-
```bash
|
|
130
|
-
# 1. Create test document
|
|
131
|
-
vim ../polyvis/docs/test-doc.md
|
|
132
|
-
|
|
133
|
-
# 2. Ingest
|
|
134
|
-
bun run src/cli.ts init
|
|
135
|
-
|
|
136
|
-
# 3. Run validation
|
|
137
|
-
bun run scripts/test-config-search.ts
|
|
138
|
-
|
|
139
|
-
# Expected: All tests pass, document indexed, searches work
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
## Next Steps
|
|
143
|
-
|
|
144
|
-
1. ✅ Config system validated
|
|
145
|
-
2. ⏭️ Test MCP server in Warp Preview
|
|
146
|
-
3. ⏭️ Test daemon file watching (auto-update on save)
|
|
147
|
-
4. ⏭️ Production deployment readiness check
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
# Configuration Unification Plan
|
|
2
|
-
|
|
3
|
-
**Date:** 2026-01-07
|
|
4
|
-
**Status:** Proposed
|
|
5
|
-
|
|
6
|
-
## Current State
|
|
7
|
-
|
|
8
|
-
### Two Active Configs
|
|
9
|
-
|
|
10
|
-
1. **`amalfa.config.json`** (Primary)
|
|
11
|
-
- User-facing AMALFA configuration
|
|
12
|
-
- Clean, minimal, focused
|
|
13
|
-
- Controls: sources, database, embeddings, file watching
|
|
14
|
-
- Loaded by: `src/config/defaults.ts`
|
|
15
|
-
|
|
16
|
-
2. **`polyvis.settings.json`** (Legacy)
|
|
17
|
-
- Resonance pipeline configuration
|
|
18
|
-
- Complex, with graph tuning and persona paths
|
|
19
|
-
- Controls: legacy database paths, graph algorithms, persona fixtures
|
|
20
|
-
- Loaded by: `src/resonance/config.ts`
|
|
21
|
-
|
|
22
|
-
### Issue
|
|
23
|
-
|
|
24
|
-
- Confusing for new users (two configs)
|
|
25
|
-
- Potential for conflicting settings (both define database paths)
|
|
26
|
-
- Unclear which config to edit
|
|
27
|
-
|
|
28
|
-
## Decision: Keep Separate (For Now)
|
|
29
|
-
|
|
30
|
-
**Rationale:**
|
|
31
|
-
|
|
32
|
-
1. **Different audiences:**
|
|
33
|
-
- `amalfa.config.json` - End users configuring AMALFA
|
|
34
|
-
- `polyvis.settings.json` - Internal Resonance library settings
|
|
35
|
-
|
|
36
|
-
2. **Different lifecycles:**
|
|
37
|
-
- AMALFA config is stable and user-friendly
|
|
38
|
-
- Resonance config will be deprecated as features migrate
|
|
39
|
-
|
|
40
|
-
3. **Clean migration path:**
|
|
41
|
-
- Mark `polyvis.settings.json` as deprecated
|
|
42
|
-
- Gradually move needed settings to `amalfa.config.json`
|
|
43
|
-
- Remove when fully migrated
|
|
44
|
-
|
|
45
|
-
## Recommendation: Document Ownership
|
|
46
|
-
|
|
47
|
-
Create clear boundaries:
|
|
48
|
-
|
|
49
|
-
### `amalfa.config.json` - AMALFA Core (User-Facing)
|
|
50
|
-
|
|
51
|
-
```json
|
|
52
|
-
{
|
|
53
|
-
"sources": ["./docs", "./playbooks"],
|
|
54
|
-
"database": ".amalfa/resonance.db",
|
|
55
|
-
"embeddings": {
|
|
56
|
-
"model": "BAAI/bge-small-en-v1.5",
|
|
57
|
-
"dimensions": 384
|
|
58
|
-
},
|
|
59
|
-
"watch": {
|
|
60
|
-
"enabled": true,
|
|
61
|
-
"debounce": 1000
|
|
62
|
-
},
|
|
63
|
-
"excludePatterns": ["node_modules", ".git", ".amalfa"],
|
|
64
|
-
|
|
65
|
-
// Future additions (not yet implemented):
|
|
66
|
-
// "daemons": {
|
|
67
|
-
// "vector": {
|
|
68
|
-
// "enabled": true,
|
|
69
|
-
// "port": 3010 // Only if really needed
|
|
70
|
-
// },
|
|
71
|
-
// "watcher": {
|
|
72
|
-
// "enabled": true
|
|
73
|
-
// }
|
|
74
|
-
// }
|
|
75
|
-
}
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
**Controls:**
|
|
79
|
-
- MCP server behavior
|
|
80
|
-
- File watcher daemon
|
|
81
|
-
- Vector daemon
|
|
82
|
-
- Database location
|
|
83
|
-
- Source directories
|
|
84
|
-
- Embedding model selection
|
|
85
|
-
|
|
86
|
-
### `polyvis.settings.json` - Resonance Library (Internal/Deprecated)
|
|
87
|
-
|
|
88
|
-
**Current usage:**
|
|
89
|
-
- Graph tuning parameters (Louvain algorithm)
|
|
90
|
-
- Persona fixture paths (lexicon, CDA)
|
|
91
|
-
- Legacy "experience" source structure
|
|
92
|
-
|
|
93
|
-
**Migration path:**
|
|
94
|
-
1. Mark file as deprecated in v1.0
|
|
95
|
-
2. Add warning when loaded: "polyvis.settings.json is deprecated, migrate to amalfa.config.json"
|
|
96
|
-
3. Remove in v2.0
|
|
97
|
-
|
|
98
|
-
**What to migrate:**
|
|
99
|
-
- Graph tuning → `amalfa.config.json` (if users need it)
|
|
100
|
-
- Persona paths → Hard-coded defaults or removed (likely unused)
|
|
101
|
-
- Experience sources → Already handled by `sources` in amalfa.config.json
|
|
102
|
-
|
|
103
|
-
## Port Numbers Decision
|
|
104
|
-
|
|
105
|
-
**NO** - Do not add port configuration to `amalfa.config.json`
|
|
106
|
-
|
|
107
|
-
**Reasons:**
|
|
108
|
-
1. Ports rarely change in single-user, local-first systems
|
|
109
|
-
2. Adds complexity for minimal benefit
|
|
110
|
-
3. Already support env var override: `VECTOR_PORT=3011 bun run start`
|
|
111
|
-
|
|
112
|
-
**Current approach (keep):**
|
|
113
|
-
```typescript
|
|
114
|
-
// Code constant with env override
|
|
115
|
-
const PORT = Number(process.env.VECTOR_PORT || 3010);
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
**When to add ports to config:**
|
|
119
|
-
- Multi-user deployments
|
|
120
|
-
- Cloud-native setups
|
|
121
|
-
- Conflict resolution needs
|
|
122
|
-
|
|
123
|
-
For AMALFA's use case: **Not needed.**
|
|
124
|
-
|
|
125
|
-
## Action Plan
|
|
126
|
-
|
|
127
|
-
### Phase 1: Document (Now)
|
|
128
|
-
- [x] Create this document
|
|
129
|
-
- [ ] Update `_current-config-status.md` with clear ownership
|
|
130
|
-
- [ ] Add comments to `polyvis.settings.json` marking as deprecated
|
|
131
|
-
- [ ] Update README with config documentation
|
|
132
|
-
|
|
133
|
-
### Phase 2: Deprecation Warnings (v0.9)
|
|
134
|
-
- [ ] Add warning log when `polyvis.settings.json` is loaded
|
|
135
|
-
- [ ] Migrate graph tuning to `amalfa.config.json` (optional section)
|
|
136
|
-
- [ ] Remove unused persona paths from codebase
|
|
137
|
-
|
|
138
|
-
### Phase 3: Removal (v2.0)
|
|
139
|
-
- [ ] Delete `polyvis.settings.json`
|
|
140
|
-
- [ ] Remove `src/resonance/config.ts`
|
|
141
|
-
- [ ] Single config: `amalfa.config.json`
|
|
142
|
-
|
|
143
|
-
## Example: Unified Config (Future v2.0)
|
|
144
|
-
|
|
145
|
-
```json
|
|
146
|
-
{
|
|
147
|
-
"sources": ["./docs", "./playbooks"],
|
|
148
|
-
"database": ".amalfa/resonance.db",
|
|
149
|
-
|
|
150
|
-
"embeddings": {
|
|
151
|
-
"model": "BAAI/bge-small-en-v1.5",
|
|
152
|
-
"dimensions": 384
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
"watch": {
|
|
156
|
-
"enabled": true,
|
|
157
|
-
"debounce": 1000
|
|
158
|
-
},
|
|
159
|
-
|
|
160
|
-
"excludePatterns": ["node_modules", ".git", ".amalfa"],
|
|
161
|
-
|
|
162
|
-
"graph": {
|
|
163
|
-
"tuning": {
|
|
164
|
-
"louvain": {
|
|
165
|
-
"resolution": 0.3
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
## Configuration Schema (Future)
|
|
173
|
-
|
|
174
|
-
Consider adding schema validation:
|
|
175
|
-
- `amalfa.config.schema.json` for IDE autocomplete
|
|
176
|
-
- Validate on load with `zod` or similar
|
|
177
|
-
- Clear error messages for invalid config
|
|
178
|
-
|
|
179
|
-
## Summary
|
|
180
|
-
|
|
181
|
-
**Decision:** Keep configs separate for now, document clearly, deprecate `polyvis.settings.json` gradually.
|
|
182
|
-
|
|
183
|
-
**Port numbers:** NO - use env vars, keep config simple.
|
|
184
|
-
|
|
185
|
-
**Timeline:**
|
|
186
|
-
- v1.0: Document + deprecation warnings
|
|
187
|
-
- v2.0: Single unified config
|