amalfa 0.0.0-reserved โ 1.0.1
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/.biomeignore +19 -0
- package/:memory: +0 -0
- package/:memory:-shm +0 -0
- package/:memory:-wal +0 -0
- package/CHANGELOG.md.old +43 -0
- package/LICENSE +21 -0
- package/README.md +359 -13
- package/README.old.md +112 -0
- package/ROADMAP.md +316 -0
- package/TEST_PLAN.md +561 -0
- package/agents.config.json +11 -0
- package/amalfa.config.example.ts +102 -0
- package/biome.json +49 -0
- package/bun.lock +371 -0
- package/docs/AGENT_PROTOCOLS.md +28 -0
- package/docs/ARCHITECTURAL_OVERVIEW.md +123 -0
- package/docs/BENTO_BOXING_DEPRECATION.md +281 -0
- package/docs/Bun-SQLite.html +464 -0
- package/docs/COMMIT_GUIDELINES.md +367 -0
- package/docs/DEVELOPER_ONBOARDING.md +36 -0
- package/docs/Graph and Vector Database Best Practices.md +214 -0
- package/docs/PERFORMANCE_BASELINES.md +88 -0
- package/docs/REPOSITORY_CLEANUP_SUMMARY.md +261 -0
- package/docs/edge-generation-methods.md +57 -0
- package/docs/elevator-pitch.md +118 -0
- package/docs/graph-and-vector-database-playbook.html +480 -0
- package/docs/hardened-sqlite.md +85 -0
- package/docs/headless-knowledge-management.md +79 -0
- package/docs/john-kaye-flux-prompt.md +46 -0
- package/docs/keyboard-shortcuts.md +80 -0
- package/docs/opinion-proceed-pattern.md +29 -0
- package/docs/polyvis-nodes-edges-schema.md +77 -0
- package/docs/protocols/lab-protocol.md +30 -0
- package/docs/reaction-iquest-loop-coder.md +46 -0
- package/docs/services.md +60 -0
- package/docs/sqlite-wal-readonly-trap.md +228 -0
- package/docs/strategy/css-architecture.md +40 -0
- package/docs/test-document-cycle.md +83 -0
- package/docs/test_lifecycle_E2E.md +4 -0
- package/docs/the-bicameral-graph.md +83 -0
- package/docs/user-guide.md +70 -0
- package/docs/vision-helper.md +53 -0
- package/drizzle/0000_minor_iron_fist.sql +19 -0
- package/drizzle/meta/0000_snapshot.json +139 -0
- package/drizzle/meta/_journal.json +13 -0
- package/example_usage.ts +39 -0
- package/experiment.sh +35 -0
- package/hello +2 -0
- package/index.html +52 -0
- package/knowledge/excalibur.md +12 -0
- package/package.json +60 -15
- package/plans/experience-graph-integration.md +60 -0
- package/prompts/gemini-king-mode-prompt.md +46 -0
- package/public/docs/MCP_TOOLS.md +372 -0
- package/schemas/README.md +20 -0
- package/schemas/cda.schema.json +84 -0
- package/schemas/conceptual-lexicon.schema.json +75 -0
- package/scratchpads/dummy-debrief-boxed.md +39 -0
- package/scratchpads/dummy-debrief.md +27 -0
- package/scratchpads/scratchpad-design.md +50 -0
- package/scratchpads/scratchpad-scrolling.md +20 -0
- package/scratchpads/scratchpad-toc-disappearance.md +23 -0
- package/scratchpads/scratchpad-toc.md +28 -0
- package/scratchpads/test_gardener.md +7 -0
- package/src/EnlightenedTriad.ts +146 -0
- package/src/JIT_Triad.ts +137 -0
- package/src/cli.ts +364 -0
- package/src/config/constants.ts +7 -0
- package/src/config/defaults.ts +99 -0
- package/src/core/BentoNormalizer.ts +113 -0
- package/src/core/EdgeWeaver.ts +145 -0
- package/src/core/FractureLogic.ts +22 -0
- package/src/core/Harvester.ts +73 -0
- package/src/core/LLMClient.ts +93 -0
- package/src/core/LouvainGate.ts +67 -0
- package/src/core/MarkdownMasker.ts +49 -0
- package/src/core/README.md +11 -0
- package/src/core/SemanticMatcher.ts +89 -0
- package/src/core/SemanticWeaver.ts +96 -0
- package/src/core/TagEngine.ts +56 -0
- package/src/core/TimelineWeaver.ts +61 -0
- package/src/core/VectorEngine.ts +232 -0
- package/src/daemon/index.ts +225 -0
- package/src/data/experience/test_doc_1.md +2 -0
- package/src/data/experience/test_doc_2.md +2 -0
- package/src/db/schema.ts +46 -0
- package/src/demo-triad.ts +45 -0
- package/src/gardeners/AutoTagger.ts +116 -0
- package/src/gardeners/BaseGardener.ts +55 -0
- package/src/llm/EnlightenedProvider.ts +95 -0
- package/src/mcp/README.md +6 -0
- package/src/mcp/index.ts +341 -0
- package/src/pipeline/AmalfaIngestor.ts +272 -0
- package/src/pipeline/HarvesterPipeline.ts +101 -0
- package/src/pipeline/Ingestor.ts +555 -0
- package/src/pipeline/PreFlightAnalyzer.ts +434 -0
- package/src/pipeline/README.md +7 -0
- package/src/pipeline/SemanticHarvester.ts +222 -0
- package/src/resonance/DatabaseFactory.ts +100 -0
- package/src/resonance/README.md +148 -0
- package/src/resonance/cli/README.md +7 -0
- package/src/resonance/cli/ingest.ts +41 -0
- package/src/resonance/cli/migrate.ts +54 -0
- package/src/resonance/config.ts +40 -0
- package/src/resonance/daemon.ts +236 -0
- package/src/resonance/db.ts +424 -0
- package/src/resonance/pipeline/README.md +7 -0
- package/src/resonance/pipeline/extract.ts +89 -0
- package/src/resonance/pipeline/transform_docs.ts +60 -0
- package/src/resonance/schema.ts +156 -0
- package/src/resonance/services/embedder.ts +131 -0
- package/src/resonance/services/simpleTokenizer.ts +119 -0
- package/src/resonance/services/stats.ts +327 -0
- package/src/resonance/services/tokenizer.ts +159 -0
- package/src/resonance/transform/cda.ts +393 -0
- package/src/resonance/types/enriched-cda.ts +112 -0
- package/src/services/README.md +56 -0
- package/src/services/llama.ts +59 -0
- package/src/services/llamauv.ts +56 -0
- package/src/services/olmo3.ts +58 -0
- package/src/services/phi.ts +52 -0
- package/src/types/artifact.ts +12 -0
- package/src/utils/EnvironmentVerifier.ts +67 -0
- package/src/utils/Logger.ts +21 -0
- package/src/utils/ServiceLifecycle.ts +207 -0
- package/src/utils/ZombieDefense.ts +244 -0
- package/src/utils/validator.ts +264 -0
- package/substack/substack-playbook-1.md +95 -0
- package/substack/substack-playbook-2.md +78 -0
- package/tasks/ui-investigation.md +26 -0
- package/test-db +0 -0
- package/test-db-shm +0 -0
- package/test-db-wal +0 -0
- package/tests/canary/verify_pinch_check.ts +44 -0
- package/tests/fixtures/ingest_test.md +12 -0
- package/tests/fixtures/ingest_test_boxed.md +13 -0
- package/tests/fixtures/safety_test.md +45 -0
- package/tests/fixtures/safety_test_boxed.md +49 -0
- package/tests/fixtures/tagged_output.md +49 -0
- package/tests/fixtures/tagged_test.md +49 -0
- package/tests/mcp-server-settings.json +8 -0
- package/tsconfig.json +46 -0
- package/verify-embedder.ts +54 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- locus:098ce247-1773-4a01-8ff1-3d5b73ad56ae -->
|
|
2
|
+
# Safety Test (Large)
|
|
3
|
+
|
|
4
|
+
This document tests the "No-Fly Zone" protection of the Bento Boxer.
|
|
5
|
+
It contains a large block of Lorem Ipsum to force a split, and a code block that should remain atomic.
|
|
6
|
+
|
|
7
|
+
## Preamble (Filler)
|
|
8
|
+
|
|
9
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
10
|
+
|
|
11
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
12
|
+
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
14
|
+
|
|
15
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
16
|
+
|
|
17
|
+
<!-- locus:f31cc4d0-656d-4e36-ba46-0ed3b7ff7c81 -->
|
|
18
|
+
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
19
|
+
|
|
20
|
+
## The Restricted Area (Code Block)
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
def fibonacci(n):
|
|
24
|
+
"""
|
|
25
|
+
This is a function that calculates the nth fibonacci number.
|
|
26
|
+
It uses recursion which is inefficient but demonstrates code structure.
|
|
27
|
+
We want to ensure this entire block is treated as a single atom.
|
|
28
|
+
It should not be split in the middle, even if it is long.
|
|
29
|
+
"""
|
|
30
|
+
if n <= 0:
|
|
31
|
+
return 0
|
|
32
|
+
elif n == 1:
|
|
33
|
+
return 1
|
|
34
|
+
else:
|
|
35
|
+
return fibonacci(n-1) + fibonacci(n-2)
|
|
36
|
+
|
|
37
|
+
# Here is some more code
|
|
38
|
+
print(fibonacci(10))
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Postscript (Filler)
|
|
42
|
+
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
44
|
+
|
|
45
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
46
|
+
|
|
47
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
48
|
+
|
|
49
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- locus:098ce247-1773-4a01-8ff1-3d5b73ad56ae -->
|
|
2
|
+
# Safety Test (Large)
|
|
3
|
+
|
|
4
|
+
This document tests the "No-Fly Zone" protection of the Bento Boxer.
|
|
5
|
+
It contains a large block of Lorem Ipsum to force a split, and a code block that should remain atomic.
|
|
6
|
+
|
|
7
|
+
## Preamble (Filler)
|
|
8
|
+
|
|
9
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
10
|
+
|
|
11
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
12
|
+
|
|
13
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
14
|
+
|
|
15
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
|
|
16
|
+
|
|
17
|
+
<!-- locus:f31cc4d0-656d-4e36-ba46-0ed3b7ff7c81 -->
|
|
18
|
+
Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
19
|
+
|
|
20
|
+
## The Restricted Area (Code Block)
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
def fibonacci(n):
|
|
24
|
+
"""
|
|
25
|
+
This is a function that calculates the nth fibonacci number.
|
|
26
|
+
It uses recursion which is inefficient but demonstrates code structure.
|
|
27
|
+
We want to ensure this entire block is treated as a single atom.
|
|
28
|
+
It should not be split in the middle, even if it is long.
|
|
29
|
+
"""
|
|
30
|
+
if n <= 0:
|
|
31
|
+
return 0
|
|
32
|
+
elif n == 1:
|
|
33
|
+
return 1
|
|
34
|
+
else:
|
|
35
|
+
return fibonacci(n-1) + fibonacci(n-2)
|
|
36
|
+
|
|
37
|
+
# Here is some more code
|
|
38
|
+
print(fibonacci(10))
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Postscript (Filler)
|
|
42
|
+
|
|
43
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
44
|
+
|
|
45
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
|
46
|
+
|
|
47
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
|
|
48
|
+
|
|
49
|
+
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
// Environment setup & latest features
|
|
4
|
+
"lib": ["ESNext"],
|
|
5
|
+
"target": "ESNext",
|
|
6
|
+
"module": "Preserve",
|
|
7
|
+
"moduleDetection": "force",
|
|
8
|
+
"jsx": "react-jsx",
|
|
9
|
+
"allowJs": true,
|
|
10
|
+
|
|
11
|
+
// Bundler mode
|
|
12
|
+
"moduleResolution": "bundler",
|
|
13
|
+
"allowImportingTsExtensions": true,
|
|
14
|
+
"verbatimModuleSyntax": true,
|
|
15
|
+
"noEmit": true,
|
|
16
|
+
|
|
17
|
+
// Best practices
|
|
18
|
+
"strict": true,
|
|
19
|
+
"skipLibCheck": true,
|
|
20
|
+
"noFallthroughCasesInSwitch": true,
|
|
21
|
+
"noUncheckedIndexedAccess": true,
|
|
22
|
+
"noImplicitOverride": true,
|
|
23
|
+
|
|
24
|
+
// Some stricter flags (disabled by default)
|
|
25
|
+
"noUnusedLocals": false,
|
|
26
|
+
"noUnusedParameters": false,
|
|
27
|
+
"noPropertyAccessFromIndexSignature": false,
|
|
28
|
+
"baseUrl": ".",
|
|
29
|
+
"paths": {
|
|
30
|
+
"@src/*": ["./src/*"],
|
|
31
|
+
"@scripts/*": ["./scripts/*"],
|
|
32
|
+
"@resonance/*": ["./src/resonance/*"],
|
|
33
|
+
"@/*": ["./*"]
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"exclude": [
|
|
37
|
+
"public/docs",
|
|
38
|
+
"docs/webdocs",
|
|
39
|
+
"node_modules",
|
|
40
|
+
"dist",
|
|
41
|
+
".resonance",
|
|
42
|
+
"briefs",
|
|
43
|
+
"examples",
|
|
44
|
+
"experiments"
|
|
45
|
+
]
|
|
46
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Embedder } from "./src/resonance/services/embedder.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Verification Script for Embedder Refactor
|
|
5
|
+
* Usage:
|
|
6
|
+
* 1. Default (BGE Small): npx tsx verify-embedder.ts
|
|
7
|
+
* 2. Custom Model: EMBEDDING_MODEL=allminilml6v2 npx tsx verify-embedder.ts
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
async function verify() {
|
|
11
|
+
console.log("๐ Starting Embedder Verification Protocol...");
|
|
12
|
+
|
|
13
|
+
// 1. Inspect Environment
|
|
14
|
+
const envModel = process.env.EMBEDDING_MODEL || "(Not Set - using default)";
|
|
15
|
+
console.log(`๐ Configuration: EMBEDDING_MODEL=${envModel}`);
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
// 2. Initialize Embedder
|
|
19
|
+
// We force local usage to ensure we are testing the library, not the daemon
|
|
20
|
+
const embedder = Embedder.getInstance();
|
|
21
|
+
|
|
22
|
+
const testPhrase =
|
|
23
|
+
"The Scottish Enlightenment was a period of intellectual outpouring.";
|
|
24
|
+
console.log(`๐งช Embedding phrase: "${testPhrase.substring(0, 25)}..."`);
|
|
25
|
+
|
|
26
|
+
const start = performance.now();
|
|
27
|
+
// Force local=true to bypass daemon and test the actual fastembed integration
|
|
28
|
+
const vector = await embedder.embed(testPhrase, true);
|
|
29
|
+
const duration = (performance.now() - start).toFixed(2);
|
|
30
|
+
|
|
31
|
+
// 3. Validate Output
|
|
32
|
+
console.log(`โ
Embedding generated in ${duration}ms`);
|
|
33
|
+
console.log(`๐ Vector Dimensions: ${vector.length}`);
|
|
34
|
+
|
|
35
|
+
// 4. Model Specific Validation
|
|
36
|
+
// BGE-Small and AllMiniLM are both 384, but we verify we got a valid vector
|
|
37
|
+
if (vector.length === 384) {
|
|
38
|
+
console.log(
|
|
39
|
+
"โจ SUCCESS: Dimension matches expected 384 for BGE-Small/MiniLM.",
|
|
40
|
+
);
|
|
41
|
+
} else {
|
|
42
|
+
console.warn(
|
|
43
|
+
`โ ๏ธ WARNING: Unexpected dimension ${vector.length}. Check model configuration.`,
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
console.log("\n[Verification Complete]");
|
|
48
|
+
} catch (error) {
|
|
49
|
+
console.error("โ FAILURE:", error);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
verify();
|