amalfa 1.0.1 → 1.0.2

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 (83) hide show
  1. package/README.md +226 -263
  2. package/docs/AGENT-METADATA-PATTERNS.md +1021 -0
  3. package/docs/CONFIG_E2E_VALIDATION.md +147 -0
  4. package/docs/CONFIG_UNIFICATION.md +187 -0
  5. package/docs/CONFIG_VALIDATION.md +103 -0
  6. package/docs/LEGACY_DEPRECATION.md +174 -0
  7. package/docs/MCP_SETUP.md +317 -0
  8. package/docs/QUICK_START_MCP.md +168 -0
  9. package/docs/SESSION-2026-01-06-METADATA-PATTERNS.md +346 -0
  10. package/docs/SETUP.md +464 -0
  11. package/docs/SETUP_COMPLETE.md +464 -0
  12. package/docs/VISION-AGENT-LEARNING.md +1242 -0
  13. package/docs/_current-config-status.md +93 -0
  14. package/package.json +6 -3
  15. package/polyvis.settings.json.bak +38 -0
  16. package/src/cli.ts +103 -21
  17. package/src/config/defaults.ts +52 -12
  18. package/src/core/VectorEngine.ts +18 -9
  19. package/src/mcp/index.ts +62 -7
  20. package/src/resonance/DatabaseFactory.ts +3 -4
  21. package/src/resonance/db.ts +4 -4
  22. package/src/resonance/services/vector-daemon.ts +151 -0
  23. package/src/utils/DaemonManager.ts +147 -0
  24. package/src/utils/ZombieDefense.ts +5 -1
  25. package/:memory: +0 -0
  26. package/:memory:-shm +0 -0
  27. package/:memory:-wal +0 -0
  28. package/CHANGELOG.md.old +0 -43
  29. package/README.old.md +0 -112
  30. package/ROADMAP.md +0 -316
  31. package/TEST_PLAN.md +0 -561
  32. package/agents.config.json +0 -11
  33. package/drizzle/0000_minor_iron_fist.sql +0 -19
  34. package/drizzle/meta/0000_snapshot.json +0 -139
  35. package/drizzle/meta/_journal.json +0 -13
  36. package/example_usage.ts +0 -39
  37. package/experiment.sh +0 -35
  38. package/hello +0 -2
  39. package/index.html +0 -52
  40. package/knowledge/excalibur.md +0 -12
  41. package/plans/experience-graph-integration.md +0 -60
  42. package/prompts/gemini-king-mode-prompt.md +0 -46
  43. package/public/docs/MCP_TOOLS.md +0 -372
  44. package/schemas/README.md +0 -20
  45. package/schemas/cda.schema.json +0 -84
  46. package/schemas/conceptual-lexicon.schema.json +0 -75
  47. package/scratchpads/dummy-debrief-boxed.md +0 -39
  48. package/scratchpads/dummy-debrief.md +0 -27
  49. package/scratchpads/scratchpad-design.md +0 -50
  50. package/scratchpads/scratchpad-scrolling.md +0 -20
  51. package/scratchpads/scratchpad-toc-disappearance.md +0 -23
  52. package/scratchpads/scratchpad-toc.md +0 -28
  53. package/scratchpads/test_gardener.md +0 -7
  54. package/src/core/LLMClient.ts +0 -93
  55. package/src/core/TagEngine.ts +0 -56
  56. package/src/db/schema.ts +0 -46
  57. package/src/gardeners/AutoTagger.ts +0 -116
  58. package/src/pipeline/HarvesterPipeline.ts +0 -101
  59. package/src/pipeline/Ingestor.ts +0 -555
  60. package/src/resonance/cli/ingest.ts +0 -41
  61. package/src/resonance/cli/migrate.ts +0 -54
  62. package/src/resonance/config.ts +0 -40
  63. package/src/resonance/daemon.ts +0 -236
  64. package/src/resonance/pipeline/extract.ts +0 -89
  65. package/src/resonance/pipeline/transform_docs.ts +0 -60
  66. package/src/resonance/services/tokenizer.ts +0 -159
  67. package/src/resonance/transform/cda.ts +0 -393
  68. package/src/utils/EnvironmentVerifier.ts +0 -67
  69. package/substack/substack-playbook-1.md +0 -95
  70. package/substack/substack-playbook-2.md +0 -78
  71. package/tasks/ui-investigation.md +0 -26
  72. package/test-db +0 -0
  73. package/test-db-shm +0 -0
  74. package/test-db-wal +0 -0
  75. package/tests/canary/verify_pinch_check.ts +0 -44
  76. package/tests/fixtures/ingest_test.md +0 -12
  77. package/tests/fixtures/ingest_test_boxed.md +0 -13
  78. package/tests/fixtures/safety_test.md +0 -45
  79. package/tests/fixtures/safety_test_boxed.md +0 -49
  80. package/tests/fixtures/tagged_output.md +0 -49
  81. package/tests/fixtures/tagged_test.md +0 -49
  82. package/tests/mcp-server-settings.json +0 -8
  83. package/verify-embedder.ts +0 -54
@@ -1,372 +0,0 @@
1
- # AMALFA MCP Tools
2
-
3
- Documentation for Model Context Protocol (MCP) tools provided by AMALFA.
4
-
5
- ## Overview
6
-
7
- AMALFA exposes 5 tools through the MCP protocol for AI agents to interact with your knowledge graph:
8
-
9
- 1. **search_documents** - Semantic vector search
10
- 2. **read_node_content** - Read full markdown content
11
- 3. **explore_links** - Graph traversal (find related nodes)
12
- 4. **list_directory_structure** - View document organization
13
- 5. **inject_tags** - Add semantic tags to files (experimental)
14
-
15
- ## Tools
16
-
17
- ### 1. search_documents
18
-
19
- **Purpose**: Search the knowledge graph using semantic vector search.
20
-
21
- **Parameters**:
22
- ```json
23
- {
24
- "query": "string (required)",
25
- "limit": "number (optional, default: 20)"
26
- }
27
- ```
28
-
29
- **Example Request**:
30
- ```json
31
- {
32
- "name": "search_documents",
33
- "arguments": {
34
- "query": "machine learning architectures",
35
- "limit": 10
36
- }
37
- }
38
- ```
39
-
40
- **Example Response**:
41
- ```json
42
- [
43
- {
44
- "id": "neural-networks",
45
- "score": "0.847",
46
- "preview": "Neural networks are computing systems inspired by biological neural networks...",
47
- "source": "vector"
48
- },
49
- {
50
- "id": "deep-learning",
51
- "score": "0.823",
52
- "preview": "Deep learning is part of a broader family of machine learning methods...",
53
- "source": "vector"
54
- }
55
- ]
56
- ```
57
-
58
- **Notes**:
59
- - Uses 384-dimensional vector embeddings (BAAI/bge-small-en-v1.5)
60
- - Scores range from 0.0 to 1.0 (cosine similarity)
61
- - Results are sorted by relevance (highest score first)
62
- - Preview is first 200 characters of content
63
-
64
- ### 2. read_node_content
65
-
66
- **Purpose**: Retrieve the full markdown content of a specific document.
67
-
68
- **Parameters**:
69
- ```json
70
- {
71
- "id": "string (required)"
72
- }
73
- ```
74
-
75
- **Example Request**:
76
- ```json
77
- {
78
- "name": "read_node_content",
79
- "arguments": {
80
- "id": "neural-networks"
81
- }
82
- }
83
- ```
84
-
85
- **Example Response**:
86
- ```markdown
87
- # Neural Networks
88
-
89
- Neural networks are computing systems inspired by biological neural networks...
90
-
91
- ## Architecture
92
-
93
- [[Deep Learning]] architectures consist of multiple layers:
94
-
95
- 1. Input layer
96
- 2. Hidden layers
97
- 3. Output layer
98
-
99
- <!-- tags: [DOMAIN: machine-learning] -->
100
- ```
101
-
102
- **Notes**:
103
- - Returns raw markdown content from source file
104
- - Implements "Hollow Nodes" pattern (content not stored in database)
105
- - Includes frontmatter, WikiLinks, and metadata
106
- - Returns error if node ID not found or file missing
107
-
108
- ### 3. explore_links
109
-
110
- **Purpose**: Find related documents through graph traversal.
111
-
112
- **Parameters**:
113
- ```json
114
- {
115
- "id": "string (required)",
116
- "relation": "string (optional)"
117
- }
118
- ```
119
-
120
- **Relation Types**:
121
- - `CITES` - WikiLink references (`[[Document]]`)
122
- - `TAGGED_AS` - Semantic tags (`[tag: Concept]`)
123
- - `EXEMPLIFIES` - Legacy tag references (`tag-concept`)
124
- - `RELATED_TO` - Generic relationships
125
- - Custom - User-defined metadata tags
126
-
127
- **Example Request**:
128
- ```json
129
- {
130
- "name": "explore_links",
131
- "arguments": {
132
- "id": "neural-networks",
133
- "relation": "CITES"
134
- }
135
- }
136
- ```
137
-
138
- **Example Response**:
139
- ```json
140
- [
141
- { "target": "deep-learning", "type": "CITES" },
142
- { "target": "backpropagation", "type": "CITES" },
143
- { "target": "gradient-descent", "type": "CITES" }
144
- ]
145
- ```
146
-
147
- **Example Request (All Relations)**:
148
- ```json
149
- {
150
- "name": "explore_links",
151
- "arguments": {
152
- "id": "neural-networks"
153
- }
154
- }
155
- ```
156
-
157
- **Notes**:
158
- - Without `relation` parameter, returns all outgoing edges
159
- - Only shows direct connections (1-hop traversal)
160
- - For multi-hop exploration, call recursively on target nodes
161
- - Empty array if node has no outgoing edges
162
-
163
- ### 4. list_directory_structure
164
-
165
- **Purpose**: View the high-level organization of documents.
166
-
167
- **Parameters**: None
168
-
169
- **Example Request**:
170
- ```json
171
- {
172
- "name": "list_directory_structure",
173
- "arguments": {}
174
- }
175
- ```
176
-
177
- **Example Response**:
178
- ```json
179
- [
180
- "docs/",
181
- "notes/"
182
- ]
183
- ```
184
-
185
- **Notes**:
186
- - Currently returns hardcoded structure
187
- - TODO: Make configurable via `amalfa.config.ts`
188
- - Useful for understanding document organization before search
189
-
190
- ### 5. inject_tags
191
-
192
- **Purpose**: Add semantic tags to a markdown file programmatically.
193
-
194
- ⚠️ **Experimental**: Modifies source files. Use with caution.
195
-
196
- **Parameters**:
197
- ```json
198
- {
199
- "file_path": "string (required)",
200
- "tags": "array<string> (required)"
201
- }
202
- ```
203
-
204
- **Example Request**:
205
- ```json
206
- {
207
- "name": "inject_tags",
208
- "arguments": {
209
- "file_path": "./docs/neural-networks.md",
210
- "tags": ["DOMAIN: machine-learning", "COMPLEXITY: advanced"]
211
- }
212
- }
213
- ```
214
-
215
- **Example Response**:
216
- ```json
217
- {
218
- "text": "Injected 2 tags into ./docs/neural-networks.md"
219
- }
220
- ```
221
-
222
- **What It Does**:
223
- Appends metadata block to end of file:
224
- ```markdown
225
- <!-- tags: DOMAIN: machine-learning, COMPLEXITY: advanced -->
226
- ```
227
-
228
- **Notes**:
229
- - **Modifies source files** - Changes persist on disk
230
- - Triggers file watcher (if daemon running) for re-ingestion
231
- - Tags follow metadata format: `<!-- tags: [KEY: value] -->`
232
- - Use for "Gardener Agent" workflows (automated knowledge curation)
233
-
234
- ## Resources
235
-
236
- AMALFA also provides MCP resources:
237
-
238
- ### amalfa://stats/summary
239
-
240
- Returns knowledge graph statistics (nodes, edges, embeddings, database size).
241
-
242
- ## Integration Examples
243
-
244
- ### Claude Desktop
245
-
246
- Configure in `claude_desktop_config.json`:
247
-
248
- ```json
249
- {
250
- "mcpServers": {
251
- "amalfa": {
252
- "command": "amalfa",
253
- "args": ["serve"]
254
- }
255
- }
256
- }
257
- ```
258
-
259
- ### Example Conversation
260
-
261
- **User**: "What do I have about machine learning?"
262
-
263
- **Claude** (uses search_documents):
264
- ```json
265
- {
266
- "query": "machine learning",
267
- "limit": 5
268
- }
269
- ```
270
-
271
- **User**: "Show me the full content of neural-networks"
272
-
273
- **Claude** (uses read_node_content):
274
- ```json
275
- {
276
- "id": "neural-networks"
277
- }
278
- ```
279
-
280
- **User**: "What documents link to this?"
281
-
282
- **Claude** (uses explore_links):
283
- ```json
284
- {
285
- "id": "neural-networks",
286
- "relation": "CITES"
287
- }
288
- ```
289
-
290
- ## Error Handling
291
-
292
- All tools return errors in this format:
293
-
294
- ```json
295
- {
296
- "content": [
297
- {
298
- "type": "text",
299
- "text": "Error: <error message>"
300
- }
301
- ],
302
- "isError": true
303
- }
304
- ```
305
-
306
- Common errors:
307
- - `Node not found` - ID doesn't exist in database
308
- - `File not found` - Source markdown file missing
309
- - `Search Error` - Vector search failed (embeddings missing)
310
- - `Tool <name> not found` - Invalid tool name
311
-
312
- ## Performance
313
-
314
- - **search_documents**: ~10-50ms (depends on corpus size)
315
- - **read_node_content**: <5ms (filesystem read)
316
- - **explore_links**: <5ms (SQLite query)
317
- - **list_directory_structure**: <1ms (in-memory)
318
- - **inject_tags**: <10ms (file write)
319
-
320
- Database remains open during MCP session for optimal performance.
321
-
322
- ## Limitations
323
-
324
- 1. **Read-only by default**: Only `inject_tags` modifies files
325
- 2. **No batch operations**: Each tool call processes single request
326
- 3. **No pagination**: Large result sets return all at once (use `limit` parameter)
327
- 4. **Synchronous only**: No streaming results
328
-
329
- ## Future Tools (Roadmap)
330
-
331
- - `create_document` - Create new markdown files
332
- - `update_document` - Edit existing files
333
- - `delete_document` - Remove files and nodes
334
- - `graph_stats` - Detailed graph analytics
335
- - `find_path` - Multi-hop pathfinding between nodes
336
- - `cluster_analysis` - Community detection
337
-
338
- ## Technical Details
339
-
340
- ### Transport
341
-
342
- AMALFA uses **stdio transport** for MCP communication:
343
- - stdin: Receives JSON-RPC requests
344
- - stdout: Returns JSON-RPC responses
345
- - stderr: Logging (captured in `.mcp.log`)
346
-
347
- ### Database Access
348
-
349
- Each tool call creates a fresh database connection:
350
- ```typescript
351
- const db = new ResonanceDB(".amalfa/resonance.db");
352
- const vectorEngine = new VectorEngine(db.getRawDb());
353
- // ... use tools ...
354
- db.close(); // Cleanup after request
355
- ```
356
-
357
- ### Vector Search Algorithm
358
-
359
- 1. Generate query embedding (384-dim vector)
360
- 2. Normalize to unit length (L2 norm)
361
- 3. Compute dot product with all document embeddings
362
- 4. Sort by similarity score (descending)
363
- 5. Return top-k results
364
-
365
- No vector database required - pure SQLite with BLOB storage.
366
-
367
- ---
368
-
369
- **For more information**:
370
- - [AMALFA GitHub](https://github.com/pjsvis/amalfa)
371
- - [Model Context Protocol Spec](https://modelcontextprotocol.io)
372
- - [FastEmbed Documentation](https://github.com/qdrant/fastembed)
package/schemas/README.md DELETED
@@ -1,20 +0,0 @@
1
- # Data Schemas
2
-
3
- This directory contains the canonical [JSON Schema](https://json-schema.org/) files that define the official data structures for the `polyvis` project.
4
-
5
- These schemas serve as the single source of truth for validating the project's core data artifacts.
6
-
7
- ## Files
8
-
9
- - `cda.schema.json`: Defines the required structure for a Core Directive Array (CDA) file.
10
- - `conceptual-lexicon.schema.json`: Defines the required structure for a Conceptual Lexicon (CL) file.
11
-
12
- ## Purpose
13
-
14
- 1. **Validation:** To programmatically ensure that any data file (either the private source files or public examples) conforms to the expected structure before it is processed by any build scripts.
15
- 2. **Documentation:** To act as precise, machine-readable documentation for the project's data models.
16
- 3. **Tooling Integration:** To enable editor features like autocompletion and real-time validation when editing the corresponding JSON data files.
17
-
18
- ## Future Use
19
-
20
- These schemas are intended to be integrated into the `scripts/build_db.ts` process as a preliminary validation step. The build will fail if the source data files do not adhere to these structures, ensuring data integrity throughout the pipeline.
@@ -1,84 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Core Directive Array (CDA) Schema",
4
- "description": "Defines the structure for a Core Directive Array file, which contains sections of operational directives.",
5
- "type": "object",
6
- "properties": {
7
- "cda_version": {
8
- "description": "The version number of the CDA document.",
9
- "type": "string"
10
- },
11
- "entry_count": {
12
- "description": "The total number of individual directive entries.",
13
- "type": "integer"
14
- },
15
- "title": {
16
- "description": "The overall title of this Core Directive Array.",
17
- "type": "string"
18
- },
19
- "purpose": {
20
- "description": "A high-level statement explaining the purpose of this CDA.",
21
- "type": "string"
22
- },
23
- "directives": {
24
- "description": "An array of directive sections, which group related entries.",
25
- "type": "array",
26
- "items": {
27
- "$ref": "#/definitions/directiveSection"
28
- }
29
- }
30
- },
31
- "required": ["cda_version", "title", "directives"],
32
- "definitions": {
33
- "directiveSection": {
34
- "type": "object",
35
- "title": "Directive Section",
36
- "description": "A group of related directive entries under a common heading.",
37
- "properties": {
38
- "section": {
39
- "description": "The name of the section (e.g., 'CIP: Core Identity & Persona').",
40
- "type": "string"
41
- },
42
- "entries": {
43
- "description": "An array of individual directive entries within this section.",
44
- "type": "array",
45
- "items": {
46
- "$ref": "#/definitions/directiveEntry"
47
- }
48
- }
49
- },
50
- "required": ["section", "entries"]
51
- },
52
- "directiveEntry": {
53
- "type": "object",
54
- "title": "Directive Entry",
55
- "description": "A single, atomic directive, concept, or principle.",
56
- "properties": {
57
- "id": {
58
- "description": "The unique identifier for the entry (e.g., 'Concept-01', 'CIP-1').",
59
- "type": "string"
60
- },
61
- "term": {
62
- "description": "A concise term for the entry, often used for foundational concepts.",
63
- "type": "string"
64
- },
65
- "title": {
66
- "description": "A descriptive title for the entry, often used for directives.",
67
- "type": "string"
68
- },
69
- "definition": {
70
- "description": "The full definition or explanation of the directive.",
71
- "type": ["string", "object"]
72
- },
73
- "tags": {
74
- "description": "An optional array of tags for establishing relationships (e.g., '[Substrate_Issue: Biddability]').",
75
- "type": "array",
76
- "items": {
77
- "type": "string"
78
- }
79
- }
80
- },
81
- "required": ["id", "definition"]
82
- }
83
- }
84
- }
@@ -1,75 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Conceptual Lexicon (CL) Schema",
4
- "description": "Defines the structure for a Conceptual Lexicon file, which is an array of term and heuristic entries.",
5
- "type": "array",
6
- "items": {
7
- "$ref": "#/definitions/lexiconEntry"
8
- },
9
- "definitions": {
10
- "lexiconEntry": {
11
- "type": "object",
12
- "title": "Lexicon Entry",
13
- "description": "A single entry (term or heuristic) in the Conceptual Lexicon.",
14
- "properties": {
15
- "id": {
16
- "description": "The unique identifier for the entry (e.g., 'term-001', 'OH-040').",
17
- "type": "string",
18
- "pattern": "^[a-zA-Z0-9_-]+$"
19
- },
20
- "title": {
21
- "description": "The human-readable title of the term or heuristic.",
22
- "type": "string"
23
- },
24
- "description": {
25
- "description": "The full definition of the entry. Can be a simple string or a structured object for complex definitions.",
26
- "type": ["string", "object"]
27
- },
28
- "type": {
29
- "description": "The type of the entry, e.g., 'term', 'operational-heuristic'.",
30
- "type": "string"
31
- },
32
- "category": {
33
- "description": "The category of the entry, e.g., 'Core Concept', 'Operational Heuristic'.",
34
- "type": "string"
35
- },
36
- "tags": {
37
- "description": "An optional array of tags for establishing relationships (e.g., '[Implements: COG-5]').",
38
- "type": "array",
39
- "items": {
40
- "type": "string"
41
- }
42
- },
43
- "source": {
44
- "description": "The origin of the entry, typically 'cl'.",
45
- "type": "string"
46
- },
47
- "external_refs": {
48
- "description": "A list of external grounding resources (URLs, Citations, Code).",
49
- "type": "array",
50
- "items": {
51
- "type": "object",
52
- "properties": {
53
- "label": {
54
- "description": "Human-readable link text (e.g., 'Wikipedia', 'Source Code').",
55
- "type": "string"
56
- },
57
- "url": {
58
- "description": "The fully qualified URI.",
59
- "type": "string",
60
- "format": "uri"
61
- },
62
- "type": {
63
- "description": "The nature of the reference.",
64
- "type": "string",
65
- "enum": ["source", "citation", "implementation", "example"]
66
- }
67
- },
68
- "required": ["label", "url", "type"]
69
- }
70
- }
71
- },
72
- "required": ["id", "title", "description", "type"]
73
- }
74
- }
75
- }
@@ -1,39 +0,0 @@
1
- # Debrief: Project Alpha (Dummy)
2
-
3
- **Date:** 2025-12-12
4
- **Status:** Success
5
-
6
-
7
- <!-- bento-id: bento-f4290ac6 -->
8
- <!-- type: section -->
9
- ## 1. Overview
10
- We successfully deployed the Alpha version. It was great.
11
-
12
-
13
- <!-- bento-id: bento-4dd57b85 -->
14
- <!-- type: section -->
15
- ## 2. Technical Details
16
- We used a lot of code.
17
-
18
- ### The Algorithm
19
- Here is the core loop:
20
-
21
- ```typescript
22
- function coreLoop() {
23
- console.log("Don't split me!");
24
- // This is a comment inside code
25
- }
26
- ```
27
-
28
-
29
- <!-- bento-id: bento-8cc779e9 -->
30
- <!-- type: section -->
31
- ## 3. Lessons Learned
32
- - Don't eat yellow snow.
33
- - **Testing:** Is important.
34
-
35
-
36
- <!-- bento-id: bento-e4cea28f -->
37
- <!-- type: section -->
38
- ## 4. Future Work
39
- We need to do more stuff.
@@ -1,27 +0,0 @@
1
- # Debrief: Project Alpha (Dummy)
2
-
3
- **Date:** 2025-12-12
4
- **Status:** Success
5
-
6
- ## 1. Overview
7
- We successfully deployed the Alpha version. It was great.
8
-
9
- ## 2. Technical Details
10
- We used a lot of code.
11
-
12
- ### The Algorithm
13
- Here is the core loop:
14
-
15
- ```typescript
16
- function coreLoop() {
17
- console.log("Don't split me!");
18
- // This is a comment inside code
19
- }
20
- ```
21
-
22
- ## 3. Lessons Learned
23
- - Don't eat yellow snow.
24
- - **Testing:** Is important.
25
-
26
- ## 4. Future Work
27
- We need to do more stuff.
@@ -1,50 +0,0 @@
1
- # Design Scratchpad: AntiGravity Emulation
2
-
3
- **Goal**: Adopt the visual language of Google's AntiGravity agent.
4
-
5
- ## 1. Core Philosophy
6
- - **High Contrast Dark Mode**: Deep backgrounds (`#202124` or darker), crisp white text (`#ffffff`), and subtle borders.
7
- - **Typography**: Clean, geometric sans-serif (Google Sans / Inter).
8
- - **Fluidity**: Responsive sizing for typography and spacing.
9
- - **"The Card"**: Distinct surfaces with subtle borders and rounded corners.
10
-
11
- ## 2. Color Palette (Dark Mode)
12
-
13
- | Semantic Name | Value | Description |
14
- | :--- | :--- | :--- |
15
- | `--primary` | `#202124` | Main Background (Deep Gray) |
16
- | `--secondary` | `#ffffff` | Primary Text (Crisp White) |
17
- | `--accent` | `#303134` | Secondary Background / Sidebar |
18
- | `--surface-1` | `#202124` | App Background |
19
- | `--surface-2` | `#303134` | Card / Panel Background |
20
- | `--surface-hover` | `#3c4043` | Hover State |
21
- | `--border-base` | `#5f6368` | Subtle Borders |
22
- | `--link` | `#8ab4f8` | Google Blue (Links) |
23
- | `--link-visited` | `#c58af9` | Google Violet (Visited) |
24
-
25
- ## 3. Typography
26
-
27
- - **Font Family**: `Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`
28
- - **Scale**:
29
- - `xs`: `0.75rem`
30
- - `sm`: `0.875rem`
31
- - `base`: `1rem`
32
- - `lg`: `1.125rem`
33
- - `xl`: `1.25rem`
34
- - `2xl`: `1.5rem`
35
-
36
- ## 4. Spacing (Fluid)
37
-
38
- Using Open Props `size-fluid-*` where appropriate, but anchoring on a 4px grid.
39
-
40
- - `--spacing-1`: `4px`
41
- - `--spacing-2`: `8px`
42
- - `--spacing-3`: `12px`
43
- - `--spacing-4`: `16px` (Standard Gap)
44
- - `--spacing-5`: `20px`
45
- - `--spacing-6`: `24px`
46
-
47
- ## 5. Implementation Strategy
48
- 1. **Update `theme.css`**: Replace existing color variables with the new palette.
49
- 2. **Refine Typography**: Ensure `Inter` is loaded or falls back gracefully.
50
- 3. **Component Audit**: Check Sidebars, Cards, and TOC for contrast issues.
@@ -1,20 +0,0 @@
1
- # Scratchpad: Sidebar Scrolling Experiments
2
-
3
- ## Problem Space
4
- The sidebars in `v3.html` are not scrolling.
5
- Structure: `aside` (Grid Cell) -> `div` (Container) -> `nav` (List).
6
- Current State: Both `aside` and `nav` might have overflow properties, or `nav` is not constrained.
7
-
8
- ## Hypothesis 1: Nested Scroll Conflict
9
- If `aside` allows scrolling, the inner `div` grows to fit the content.
10
- If `div` grows, `nav` grows.
11
- Result: `nav` never overflows its container, so its scrollbar never triggers. The `aside` scrollbar *should* trigger, but might be hidden or behaving oddly due to `app-shell` grid constraints.
12
-
13
- ## Experiment 1: Lock Parent, Scroll Child
14
- **Goal**: Make `nav` the *only* scrollable element.
15
- 1. `aside`: `overflow: hidden` (Don't scroll).
16
- 2. `div.docs-directory`: `h-full flex flex-col overflow: hidden` (Constrain height, don't scroll).
17
- 3. `nav`: `flex-1 overflow-y-auto min-h-0` (Fill space, scroll if needed, allow shrinking).
18
-
19
- ## Log
20
- - [ ] Experiment 1