longecho 0.3.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.
- longecho-0.3.0/.gitignore +20 -0
- longecho-0.3.0/LICENSE +21 -0
- longecho-0.3.0/PKG-INFO +314 -0
- longecho-0.3.0/README.md +279 -0
- longecho-0.3.0/pyproject.toml +110 -0
- longecho-0.3.0/src/longecho/__init__.py +29 -0
- longecho-0.3.0/src/longecho/__main__.py +5 -0
- longecho-0.3.0/src/longecho/build.py +250 -0
- longecho-0.3.0/src/longecho/checker.py +253 -0
- longecho-0.3.0/src/longecho/cli.py +315 -0
- longecho-0.3.0/src/longecho/discovery.py +94 -0
- longecho-0.3.0/src/longecho/templates/sfa.html +537 -0
- longecho-0.3.0/tests/conftest.py +80 -0
- longecho-0.3.0/tests/test_build.py +471 -0
- longecho-0.3.0/tests/test_checker.py +349 -0
- longecho-0.3.0/tests/test_cli.py +176 -0
- longecho-0.3.0/tests/test_discovery.py +147 -0
- longecho-0.3.0/tests/test_readme.py +91 -0
longecho-0.3.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Alexander Towell
|
|
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.
|
longecho-0.3.0/PKG-INFO
ADDED
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: longecho
|
|
3
|
+
Version: 0.3.0
|
|
4
|
+
Summary: Compliance validator and site builder for durable personal archives
|
|
5
|
+
Project-URL: Homepage, https://github.com/queelius/longecho
|
|
6
|
+
Project-URL: Repository, https://github.com/queelius/longecho
|
|
7
|
+
Project-URL: Issues, https://github.com/queelius/longecho/issues
|
|
8
|
+
Author-email: Alex Towell <lex@metafunctor.com>
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: archiving,durability,longecho,static-site,validator
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Requires-Dist: jinja2>=3.0.0
|
|
22
|
+
Requires-Dist: markdown>=3.0.0
|
|
23
|
+
Requires-Dist: pyyaml>=6.0.0
|
|
24
|
+
Requires-Dist: rich>=13.0.0
|
|
25
|
+
Requires-Dist: typer>=0.9.0
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: black>=23.0.0; extra == 'dev'
|
|
28
|
+
Requires-Dist: flake8>=6.0.0; extra == 'dev'
|
|
29
|
+
Requires-Dist: mypy>=1.0.0; extra == 'dev'
|
|
30
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
|
|
31
|
+
Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
32
|
+
Requires-Dist: ruff>=0.4.0; extra == 'dev'
|
|
33
|
+
Requires-Dist: types-markdown>=3.0.0; extra == 'dev'
|
|
34
|
+
Description-Content-Type: text/markdown
|
|
35
|
+
|
|
36
|
+
# longecho
|
|
37
|
+
|
|
38
|
+
**A philosophy and a tool for durable personal archives.**
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## The Philosophy
|
|
43
|
+
|
|
44
|
+
Personal data is fragile. Companies shut down. Formats become obsolete. Passwords are forgotten. Hard drives fail.
|
|
45
|
+
|
|
46
|
+
longecho is a bet that with enough self-description and simple formats, your data can outlive the tools that created it. The name evokes what we're after: your voice, echoing forward through time.
|
|
47
|
+
|
|
48
|
+
### Core Principles
|
|
49
|
+
|
|
50
|
+
**1. Self-Describing.** Every data collection must explain itself. A human or LLM finding your data in 50 years, with no context, should be able to understand what they're looking at.
|
|
51
|
+
|
|
52
|
+
**2. Durable Formats.** Data must be stored in formats that can be read without proprietary software, have multiple implementations, and have proven longevity.
|
|
53
|
+
|
|
54
|
+
**3. Graceful Degradation.** An archive should remain useful as technology disappears:
|
|
55
|
+
|
|
56
|
+
| If you have... | You can still... |
|
|
57
|
+
|----------------|------------------|
|
|
58
|
+
| Modern LLMs | Have conversations with the archive |
|
|
59
|
+
| A web browser | Navigate a generated site |
|
|
60
|
+
| A file browser | Explore organized directories |
|
|
61
|
+
| A text editor | Read plain text files |
|
|
62
|
+
| Only fragments | Understand each piece independently |
|
|
63
|
+
|
|
64
|
+
**4. Local-First.** The archive must work entirely offline. Cloud services can sync or backup, but the archive is complete without them.
|
|
65
|
+
|
|
66
|
+
**5. Trust the Future.** Don't over-engineer. Future humans will be smarter. Future LLMs will be more capable. Focus on preserving content and context, not building complex infrastructure. If you have to choose between a simple format and a "more correct" one, choose simple.
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
## Compliance
|
|
71
|
+
|
|
72
|
+
A directory is **longecho-compliant** if it has:
|
|
73
|
+
|
|
74
|
+
1. A `README.md` or `README.txt` at the root explaining what the data is
|
|
75
|
+
2. Data stored in durable formats
|
|
76
|
+
|
|
77
|
+
That's it. No special files, no schema, no version numbers.
|
|
78
|
+
|
|
79
|
+
### Durable Formats
|
|
80
|
+
|
|
81
|
+
| Category | Formats |
|
|
82
|
+
|----------|---------|
|
|
83
|
+
| Structured data | `.db`, `.sqlite`, `.sqlite3`, `.json`, `.jsonl` |
|
|
84
|
+
| Documents | `.md`, `.markdown`, `.txt`, `.text`, `.rst`, `.html`, `.htm` |
|
|
85
|
+
| Archives | `.zip` |
|
|
86
|
+
| Images | `.jpg`, `.jpeg`, `.png`, `.webp`, `.gif` |
|
|
87
|
+
| Tabular / data | `.csv`, `.tsv`, `.xml`, `.yaml`, `.yml` |
|
|
88
|
+
|
|
89
|
+
The principle: formats that can be read without proprietary software, have multiple implementations, and are widely documented.
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## The README
|
|
94
|
+
|
|
95
|
+
The README is the interface. A human or LLM can understand any longecho source by reading its README. Everything else is optional.
|
|
96
|
+
|
|
97
|
+
### Frontmatter
|
|
98
|
+
|
|
99
|
+
READMEs can include optional YAML frontmatter for structured metadata:
|
|
100
|
+
|
|
101
|
+
```markdown
|
|
102
|
+
---
|
|
103
|
+
name: Conversation Archive
|
|
104
|
+
description: AI conversation history from 2020-2026
|
|
105
|
+
author: Alex Towell
|
|
106
|
+
datetime: 2026-02-18
|
|
107
|
+
origin: Exported from ChatGPT and Claude
|
|
108
|
+
contents:
|
|
109
|
+
- path: ctk.db
|
|
110
|
+
description: SQLite database of all conversations
|
|
111
|
+
- path: index.json
|
|
112
|
+
description: Conversation index
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
# Conversation Archive
|
|
116
|
+
|
|
117
|
+
Six years of AI conversations, exported using ctk.
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
All frontmatter is optional. A README with no frontmatter is perfectly valid — the heading and first paragraph provide name and description, and the directory name is the fallback.
|
|
121
|
+
|
|
122
|
+
### Fields With Special Behavior
|
|
123
|
+
|
|
124
|
+
Three fields change how the longecho tool behaves:
|
|
125
|
+
|
|
126
|
+
| Field | Behavior |
|
|
127
|
+
|-------|----------|
|
|
128
|
+
| `name` | Used as the source name. Cascade: frontmatter `name` > `# Heading` > directory name |
|
|
129
|
+
| `description` | Used as the source description. Cascade: frontmatter `description` > first paragraph after heading |
|
|
130
|
+
| `contents` | Lists what's in this directory. The tool uses it for build curation and ordering (see below) |
|
|
131
|
+
|
|
132
|
+
### All Other Frontmatter
|
|
133
|
+
|
|
134
|
+
Any valid YAML can go in frontmatter. The tool preserves it, displays it in generated sites, and makes it queryable. Common fields worth including:
|
|
135
|
+
|
|
136
|
+
- `author` — who created this
|
|
137
|
+
- `datetime` — when
|
|
138
|
+
- `origin` — where the data came from
|
|
139
|
+
- `generator` — what tool produced this
|
|
140
|
+
- `tool` / `tool_url` — what program best understands this data
|
|
141
|
+
|
|
142
|
+
These aren't privileged — they're just commonly useful. Include whatever you think a future reader would find helpful. longecho parses what it recognizes; a human or LLM reads everything.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Nesting
|
|
147
|
+
|
|
148
|
+
A longecho source can contain other longecho sources. The structure is recursive — each level is the same kind of object:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
my-archive/
|
|
152
|
+
├── README.md
|
|
153
|
+
├── conversations/
|
|
154
|
+
│ ├── README.md
|
|
155
|
+
│ ├── chatgpt/
|
|
156
|
+
│ │ ├── README.md
|
|
157
|
+
│ │ └── data.db
|
|
158
|
+
│ └── claude/
|
|
159
|
+
│ ├── README.md
|
|
160
|
+
│ └── data.jsonl
|
|
161
|
+
└── bookmarks/
|
|
162
|
+
├── README.md
|
|
163
|
+
└── bookmarks.jsonl
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Every directory is self-describing. If the archive gets fragmented, each piece still explains itself.
|
|
167
|
+
|
|
168
|
+
### The `contents` Field
|
|
169
|
+
|
|
170
|
+
The `contents` field in frontmatter lists what's in a directory:
|
|
171
|
+
|
|
172
|
+
```yaml
|
|
173
|
+
contents:
|
|
174
|
+
- path: conversations/
|
|
175
|
+
- path: bookmarks/
|
|
176
|
+
- path: ctk.db
|
|
177
|
+
description: Combined conversation database
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Entries always use the explicit `path:` form. Additional fields like `description` are optional and informational.
|
|
181
|
+
|
|
182
|
+
When `contents` is present, the longecho tool uses it for:
|
|
183
|
+
- **Curation** — only listed entries are included in a build
|
|
184
|
+
- **Ordering** — entries appear in the order listed
|
|
185
|
+
|
|
186
|
+
When `contents` is absent, the tool auto-discovers all longecho-compliant subdirectories in alphabetical order.
|
|
187
|
+
|
|
188
|
+
Each sub-source is always self-describing. The parent's `contents` field controls which children appear and in what order, but never overrides a child's own name or description.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## The `site/` Convention
|
|
193
|
+
|
|
194
|
+
A `site/` directory provides a static, browsable representation of a source. This is a convenience layer — raw data must still exist alongside it.
|
|
195
|
+
|
|
196
|
+
Any tool MAY generate a `site/` for its data. `longecho build` generates one for the archive as a whole, but individual toolkits (ctk, btk, chartfold, etc.) can generate their own. The `site/` directory follows the same rules as any longecho source — self-describing via README.md.
|
|
197
|
+
|
|
198
|
+
```
|
|
199
|
+
my-archive/
|
|
200
|
+
├── README.md
|
|
201
|
+
├── conversations/
|
|
202
|
+
│ ├── README.md
|
|
203
|
+
│ ├── conversations.db
|
|
204
|
+
│ └── site/
|
|
205
|
+
│ ├── README.md ← self-describing (generator: ctk)
|
|
206
|
+
│ └── index.html ← ctk's conversation browser
|
|
207
|
+
├── bookmarks/
|
|
208
|
+
│ └── ...
|
|
209
|
+
└── site/
|
|
210
|
+
├── README.md ← self-describing (generator: longecho)
|
|
211
|
+
└── index.html ← longecho's archive navigator
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Composition
|
|
215
|
+
|
|
216
|
+
The pattern is fractal: a parent SFA links to its children's sites. `longecho build` detects when a source has a `site/` and presents an "Open interactive viewer" link in the archive navigator. This means you can compose archives of archives — `longecho build` at any level produces a working SFA that connects to all the interfaces below it.
|
|
217
|
+
|
|
218
|
+
### Single-File Application
|
|
219
|
+
|
|
220
|
+
`longecho build` generates a self-contained `site/index.html` — a single-file application with all content, CSS, and JavaScript inlined. No external dependencies, no relative links to break. Single-file is recommended for all `site/` generators (maximum durability), but not required.
|
|
221
|
+
|
|
222
|
+
The SFA inlines all README content and metadata as JSON, with client-side JavaScript for navigation between views and search across sources. Actual data files (`.db`, `.json`, `.jsonl`, etc.) are linked via relative paths — the browser can open or download them directly. Because everything is self-contained or relative, the file works from `file://` — no server required.
|
|
223
|
+
|
|
224
|
+
### Self-Describing Output
|
|
225
|
+
|
|
226
|
+
The generated `site/` directory is itself longecho-compliant:
|
|
227
|
+
|
|
228
|
+
```markdown
|
|
229
|
+
---
|
|
230
|
+
name: My Archive Site
|
|
231
|
+
description: Static site generated from longecho archive
|
|
232
|
+
generator: longecho build v0.3.0
|
|
233
|
+
datetime: 2026-02-18T14:30:00
|
|
234
|
+
contents:
|
|
235
|
+
- path: index.html
|
|
236
|
+
description: Single-file browsable archive
|
|
237
|
+
---
|
|
238
|
+
|
|
239
|
+
Generated by longecho from 2 sources: conversations, bookmarks.
|
|
240
|
+
Open index.html in any browser to explore.
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
## What longecho Is Not
|
|
246
|
+
|
|
247
|
+
**Not a schema.** There's no required JSON structure, no mandatory fields beyond a README.
|
|
248
|
+
|
|
249
|
+
**Not a sync protocol.** It doesn't specify how to merge, replicate, or version data.
|
|
250
|
+
|
|
251
|
+
**Not a registry.** It doesn't maintain a central list of sources or toolkits.
|
|
252
|
+
|
|
253
|
+
**Not an orchestrator.** Each toolkit (ctk, btk, etc.) exports its own data. longecho unifies the outputs but doesn't invoke or manage the toolkits.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## Installation
|
|
258
|
+
|
|
259
|
+
```bash
|
|
260
|
+
pip install -e ".[dev]" # from source (not yet on PyPI)
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Commands
|
|
264
|
+
|
|
265
|
+
Every command is a tree walk over the archive structure, with different filters and output modes.
|
|
266
|
+
|
|
267
|
+
```bash
|
|
268
|
+
longecho check ~/my-data/ # Is this compliant?
|
|
269
|
+
longecho check ~/my-data/ --verbose # Show README, formats, frontmatter
|
|
270
|
+
|
|
271
|
+
longecho query ~/ # Find sources across the tree
|
|
272
|
+
longecho query ~/ --search "bookmarks" # Search README text
|
|
273
|
+
longecho query ~/ --depth 1 # Control depth
|
|
274
|
+
longecho query ~/ --json # Output as JSON
|
|
275
|
+
|
|
276
|
+
longecho build ~/my-archive/ # Generate single-file static site
|
|
277
|
+
longecho build ~/my-archive/ --open # Open in browser after build
|
|
278
|
+
|
|
279
|
+
longecho spec # Print specification summary
|
|
280
|
+
longecho formats # List recognized durable formats
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
---
|
|
284
|
+
|
|
285
|
+
## Ecosystem
|
|
286
|
+
|
|
287
|
+
Tools that produce longecho-compliant data. Each is self-contained — works without longecho, documented in its own repo. All share the `longecho-ecosystem` GitHub topic.
|
|
288
|
+
|
|
289
|
+
| Tool | What it manages |
|
|
290
|
+
|------|-----------------|
|
|
291
|
+
| [memex](https://github.com/queelius/memex) | Conversation knowledge base |
|
|
292
|
+
| [chartfold](https://github.com/queelius/chartfold) | Personal health data |
|
|
293
|
+
| [repoindex](https://github.com/queelius/repoindex) | Git repo metadata |
|
|
294
|
+
| [jot](https://github.com/queelius/jot) | Plaintext journal/notes |
|
|
295
|
+
| [pagevault](https://github.com/queelius/pagevault) | Password-protected static content |
|
|
296
|
+
| arkiv | Universal personal data format (JSONL→SQL) |
|
|
297
|
+
|
|
298
|
+
Markdown-based sources (Hugo, Jekyll, Obsidian, etc.) are inherently longecho-compliant.
|
|
299
|
+
|
|
300
|
+
---
|
|
301
|
+
|
|
302
|
+
## Development
|
|
303
|
+
|
|
304
|
+
```bash
|
|
305
|
+
pip install -e ".[dev]"
|
|
306
|
+
pytest tests/ -v
|
|
307
|
+
pytest tests/ --cov=src/longecho --cov-report=term-missing
|
|
308
|
+
mypy src/longecho/
|
|
309
|
+
ruff check src/longecho/
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
---
|
|
313
|
+
|
|
314
|
+
*"The archive is not a monument. It is a conversation that outlasts its participants."*
|
longecho-0.3.0/README.md
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
# longecho
|
|
2
|
+
|
|
3
|
+
**A philosophy and a tool for durable personal archives.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## The Philosophy
|
|
8
|
+
|
|
9
|
+
Personal data is fragile. Companies shut down. Formats become obsolete. Passwords are forgotten. Hard drives fail.
|
|
10
|
+
|
|
11
|
+
longecho is a bet that with enough self-description and simple formats, your data can outlive the tools that created it. The name evokes what we're after: your voice, echoing forward through time.
|
|
12
|
+
|
|
13
|
+
### Core Principles
|
|
14
|
+
|
|
15
|
+
**1. Self-Describing.** Every data collection must explain itself. A human or LLM finding your data in 50 years, with no context, should be able to understand what they're looking at.
|
|
16
|
+
|
|
17
|
+
**2. Durable Formats.** Data must be stored in formats that can be read without proprietary software, have multiple implementations, and have proven longevity.
|
|
18
|
+
|
|
19
|
+
**3. Graceful Degradation.** An archive should remain useful as technology disappears:
|
|
20
|
+
|
|
21
|
+
| If you have... | You can still... |
|
|
22
|
+
|----------------|------------------|
|
|
23
|
+
| Modern LLMs | Have conversations with the archive |
|
|
24
|
+
| A web browser | Navigate a generated site |
|
|
25
|
+
| A file browser | Explore organized directories |
|
|
26
|
+
| A text editor | Read plain text files |
|
|
27
|
+
| Only fragments | Understand each piece independently |
|
|
28
|
+
|
|
29
|
+
**4. Local-First.** The archive must work entirely offline. Cloud services can sync or backup, but the archive is complete without them.
|
|
30
|
+
|
|
31
|
+
**5. Trust the Future.** Don't over-engineer. Future humans will be smarter. Future LLMs will be more capable. Focus on preserving content and context, not building complex infrastructure. If you have to choose between a simple format and a "more correct" one, choose simple.
|
|
32
|
+
|
|
33
|
+
---
|
|
34
|
+
|
|
35
|
+
## Compliance
|
|
36
|
+
|
|
37
|
+
A directory is **longecho-compliant** if it has:
|
|
38
|
+
|
|
39
|
+
1. A `README.md` or `README.txt` at the root explaining what the data is
|
|
40
|
+
2. Data stored in durable formats
|
|
41
|
+
|
|
42
|
+
That's it. No special files, no schema, no version numbers.
|
|
43
|
+
|
|
44
|
+
### Durable Formats
|
|
45
|
+
|
|
46
|
+
| Category | Formats |
|
|
47
|
+
|----------|---------|
|
|
48
|
+
| Structured data | `.db`, `.sqlite`, `.sqlite3`, `.json`, `.jsonl` |
|
|
49
|
+
| Documents | `.md`, `.markdown`, `.txt`, `.text`, `.rst`, `.html`, `.htm` |
|
|
50
|
+
| Archives | `.zip` |
|
|
51
|
+
| Images | `.jpg`, `.jpeg`, `.png`, `.webp`, `.gif` |
|
|
52
|
+
| Tabular / data | `.csv`, `.tsv`, `.xml`, `.yaml`, `.yml` |
|
|
53
|
+
|
|
54
|
+
The principle: formats that can be read without proprietary software, have multiple implementations, and are widely documented.
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## The README
|
|
59
|
+
|
|
60
|
+
The README is the interface. A human or LLM can understand any longecho source by reading its README. Everything else is optional.
|
|
61
|
+
|
|
62
|
+
### Frontmatter
|
|
63
|
+
|
|
64
|
+
READMEs can include optional YAML frontmatter for structured metadata:
|
|
65
|
+
|
|
66
|
+
```markdown
|
|
67
|
+
---
|
|
68
|
+
name: Conversation Archive
|
|
69
|
+
description: AI conversation history from 2020-2026
|
|
70
|
+
author: Alex Towell
|
|
71
|
+
datetime: 2026-02-18
|
|
72
|
+
origin: Exported from ChatGPT and Claude
|
|
73
|
+
contents:
|
|
74
|
+
- path: ctk.db
|
|
75
|
+
description: SQLite database of all conversations
|
|
76
|
+
- path: index.json
|
|
77
|
+
description: Conversation index
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
# Conversation Archive
|
|
81
|
+
|
|
82
|
+
Six years of AI conversations, exported using ctk.
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
All frontmatter is optional. A README with no frontmatter is perfectly valid — the heading and first paragraph provide name and description, and the directory name is the fallback.
|
|
86
|
+
|
|
87
|
+
### Fields With Special Behavior
|
|
88
|
+
|
|
89
|
+
Three fields change how the longecho tool behaves:
|
|
90
|
+
|
|
91
|
+
| Field | Behavior |
|
|
92
|
+
|-------|----------|
|
|
93
|
+
| `name` | Used as the source name. Cascade: frontmatter `name` > `# Heading` > directory name |
|
|
94
|
+
| `description` | Used as the source description. Cascade: frontmatter `description` > first paragraph after heading |
|
|
95
|
+
| `contents` | Lists what's in this directory. The tool uses it for build curation and ordering (see below) |
|
|
96
|
+
|
|
97
|
+
### All Other Frontmatter
|
|
98
|
+
|
|
99
|
+
Any valid YAML can go in frontmatter. The tool preserves it, displays it in generated sites, and makes it queryable. Common fields worth including:
|
|
100
|
+
|
|
101
|
+
- `author` — who created this
|
|
102
|
+
- `datetime` — when
|
|
103
|
+
- `origin` — where the data came from
|
|
104
|
+
- `generator` — what tool produced this
|
|
105
|
+
- `tool` / `tool_url` — what program best understands this data
|
|
106
|
+
|
|
107
|
+
These aren't privileged — they're just commonly useful. Include whatever you think a future reader would find helpful. longecho parses what it recognizes; a human or LLM reads everything.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Nesting
|
|
112
|
+
|
|
113
|
+
A longecho source can contain other longecho sources. The structure is recursive — each level is the same kind of object:
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
my-archive/
|
|
117
|
+
├── README.md
|
|
118
|
+
├── conversations/
|
|
119
|
+
│ ├── README.md
|
|
120
|
+
│ ├── chatgpt/
|
|
121
|
+
│ │ ├── README.md
|
|
122
|
+
│ │ └── data.db
|
|
123
|
+
│ └── claude/
|
|
124
|
+
│ ├── README.md
|
|
125
|
+
│ └── data.jsonl
|
|
126
|
+
└── bookmarks/
|
|
127
|
+
├── README.md
|
|
128
|
+
└── bookmarks.jsonl
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Every directory is self-describing. If the archive gets fragmented, each piece still explains itself.
|
|
132
|
+
|
|
133
|
+
### The `contents` Field
|
|
134
|
+
|
|
135
|
+
The `contents` field in frontmatter lists what's in a directory:
|
|
136
|
+
|
|
137
|
+
```yaml
|
|
138
|
+
contents:
|
|
139
|
+
- path: conversations/
|
|
140
|
+
- path: bookmarks/
|
|
141
|
+
- path: ctk.db
|
|
142
|
+
description: Combined conversation database
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Entries always use the explicit `path:` form. Additional fields like `description` are optional and informational.
|
|
146
|
+
|
|
147
|
+
When `contents` is present, the longecho tool uses it for:
|
|
148
|
+
- **Curation** — only listed entries are included in a build
|
|
149
|
+
- **Ordering** — entries appear in the order listed
|
|
150
|
+
|
|
151
|
+
When `contents` is absent, the tool auto-discovers all longecho-compliant subdirectories in alphabetical order.
|
|
152
|
+
|
|
153
|
+
Each sub-source is always self-describing. The parent's `contents` field controls which children appear and in what order, but never overrides a child's own name or description.
|
|
154
|
+
|
|
155
|
+
---
|
|
156
|
+
|
|
157
|
+
## The `site/` Convention
|
|
158
|
+
|
|
159
|
+
A `site/` directory provides a static, browsable representation of a source. This is a convenience layer — raw data must still exist alongside it.
|
|
160
|
+
|
|
161
|
+
Any tool MAY generate a `site/` for its data. `longecho build` generates one for the archive as a whole, but individual toolkits (ctk, btk, chartfold, etc.) can generate their own. The `site/` directory follows the same rules as any longecho source — self-describing via README.md.
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
my-archive/
|
|
165
|
+
├── README.md
|
|
166
|
+
├── conversations/
|
|
167
|
+
│ ├── README.md
|
|
168
|
+
│ ├── conversations.db
|
|
169
|
+
│ └── site/
|
|
170
|
+
│ ├── README.md ← self-describing (generator: ctk)
|
|
171
|
+
│ └── index.html ← ctk's conversation browser
|
|
172
|
+
├── bookmarks/
|
|
173
|
+
│ └── ...
|
|
174
|
+
└── site/
|
|
175
|
+
├── README.md ← self-describing (generator: longecho)
|
|
176
|
+
└── index.html ← longecho's archive navigator
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### Composition
|
|
180
|
+
|
|
181
|
+
The pattern is fractal: a parent SFA links to its children's sites. `longecho build` detects when a source has a `site/` and presents an "Open interactive viewer" link in the archive navigator. This means you can compose archives of archives — `longecho build` at any level produces a working SFA that connects to all the interfaces below it.
|
|
182
|
+
|
|
183
|
+
### Single-File Application
|
|
184
|
+
|
|
185
|
+
`longecho build` generates a self-contained `site/index.html` — a single-file application with all content, CSS, and JavaScript inlined. No external dependencies, no relative links to break. Single-file is recommended for all `site/` generators (maximum durability), but not required.
|
|
186
|
+
|
|
187
|
+
The SFA inlines all README content and metadata as JSON, with client-side JavaScript for navigation between views and search across sources. Actual data files (`.db`, `.json`, `.jsonl`, etc.) are linked via relative paths — the browser can open or download them directly. Because everything is self-contained or relative, the file works from `file://` — no server required.
|
|
188
|
+
|
|
189
|
+
### Self-Describing Output
|
|
190
|
+
|
|
191
|
+
The generated `site/` directory is itself longecho-compliant:
|
|
192
|
+
|
|
193
|
+
```markdown
|
|
194
|
+
---
|
|
195
|
+
name: My Archive Site
|
|
196
|
+
description: Static site generated from longecho archive
|
|
197
|
+
generator: longecho build v0.3.0
|
|
198
|
+
datetime: 2026-02-18T14:30:00
|
|
199
|
+
contents:
|
|
200
|
+
- path: index.html
|
|
201
|
+
description: Single-file browsable archive
|
|
202
|
+
---
|
|
203
|
+
|
|
204
|
+
Generated by longecho from 2 sources: conversations, bookmarks.
|
|
205
|
+
Open index.html in any browser to explore.
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
## What longecho Is Not
|
|
211
|
+
|
|
212
|
+
**Not a schema.** There's no required JSON structure, no mandatory fields beyond a README.
|
|
213
|
+
|
|
214
|
+
**Not a sync protocol.** It doesn't specify how to merge, replicate, or version data.
|
|
215
|
+
|
|
216
|
+
**Not a registry.** It doesn't maintain a central list of sources or toolkits.
|
|
217
|
+
|
|
218
|
+
**Not an orchestrator.** Each toolkit (ctk, btk, etc.) exports its own data. longecho unifies the outputs but doesn't invoke or manage the toolkits.
|
|
219
|
+
|
|
220
|
+
---
|
|
221
|
+
|
|
222
|
+
## Installation
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
pip install -e ".[dev]" # from source (not yet on PyPI)
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
## Commands
|
|
229
|
+
|
|
230
|
+
Every command is a tree walk over the archive structure, with different filters and output modes.
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
longecho check ~/my-data/ # Is this compliant?
|
|
234
|
+
longecho check ~/my-data/ --verbose # Show README, formats, frontmatter
|
|
235
|
+
|
|
236
|
+
longecho query ~/ # Find sources across the tree
|
|
237
|
+
longecho query ~/ --search "bookmarks" # Search README text
|
|
238
|
+
longecho query ~/ --depth 1 # Control depth
|
|
239
|
+
longecho query ~/ --json # Output as JSON
|
|
240
|
+
|
|
241
|
+
longecho build ~/my-archive/ # Generate single-file static site
|
|
242
|
+
longecho build ~/my-archive/ --open # Open in browser after build
|
|
243
|
+
|
|
244
|
+
longecho spec # Print specification summary
|
|
245
|
+
longecho formats # List recognized durable formats
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
---
|
|
249
|
+
|
|
250
|
+
## Ecosystem
|
|
251
|
+
|
|
252
|
+
Tools that produce longecho-compliant data. Each is self-contained — works without longecho, documented in its own repo. All share the `longecho-ecosystem` GitHub topic.
|
|
253
|
+
|
|
254
|
+
| Tool | What it manages |
|
|
255
|
+
|------|-----------------|
|
|
256
|
+
| [memex](https://github.com/queelius/memex) | Conversation knowledge base |
|
|
257
|
+
| [chartfold](https://github.com/queelius/chartfold) | Personal health data |
|
|
258
|
+
| [repoindex](https://github.com/queelius/repoindex) | Git repo metadata |
|
|
259
|
+
| [jot](https://github.com/queelius/jot) | Plaintext journal/notes |
|
|
260
|
+
| [pagevault](https://github.com/queelius/pagevault) | Password-protected static content |
|
|
261
|
+
| arkiv | Universal personal data format (JSONL→SQL) |
|
|
262
|
+
|
|
263
|
+
Markdown-based sources (Hugo, Jekyll, Obsidian, etc.) are inherently longecho-compliant.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## Development
|
|
268
|
+
|
|
269
|
+
```bash
|
|
270
|
+
pip install -e ".[dev]"
|
|
271
|
+
pytest tests/ -v
|
|
272
|
+
pytest tests/ --cov=src/longecho --cov-report=term-missing
|
|
273
|
+
mypy src/longecho/
|
|
274
|
+
ruff check src/longecho/
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
---
|
|
278
|
+
|
|
279
|
+
*"The archive is not a monument. It is a conversation that outlasts its participants."*
|