logseq-matryca-parser 0.3.3__tar.gz → 1.0.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.
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.repomixignore +25 -2
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/PKG-INFO +7 -6
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/README.md +5 -4
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/ARCHITECTURE.md +41 -1
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/pyproject.toml +2 -2
- logseq_matryca_parser-1.0.0/repomix-output-parser.xml +15235 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/__init__.py +26 -8
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/agent_writer.py +6 -1
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/graph.py +3 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/kinetic.py +6 -1
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/logos_parser.py +10 -14
- logseq_matryca_parser-1.0.0/src/logseq_matryca_parser/logseq_markdown.py +111 -0
- logseq_matryca_parser-1.0.0/src/logseq_matryca_parser/logseq_paths.py +86 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_agent_writer.py +2 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_logos_parser.py +28 -3
- logseq_matryca_parser-1.0.0/tests/test_logseq_markdown.py +98 -0
- logseq_matryca_parser-1.0.0/tests/test_logseq_paths.py +118 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/uv.lock +1 -1
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.cursorignore +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.cursorrules +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/FUNDING.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/ISSUE_TEMPLATE/bug_report.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/ISSUE_TEMPLATE/feature_request.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/dependabot.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/workflows/ci.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.github/workflows/pypi_publish.yml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.gitignore +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/.pre-commit-config.yaml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/CONTRIBUTING.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/LICENSE +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/Makefile +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/NOTICE +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/ROADMAP_AGENT_NATIVE_XRAY.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/ROADMAP_HEADLESS_WRITER.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/ROADMAP_OBSIDIAN_ADAPTER.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/SECURITY.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/claude-skill-logseq-read/SKILL.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/claude-skill-logseq-read/scripts/parse_logseq.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/ARCHITECTURE_BLUEPRINT.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/CODE_SCAFFOLD.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/LOGSEQ_ASSET_RESOLUTION_SPEC.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/LOGSEQ_DATASCRIPT_MAPPING.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/LOGSEQ_TEMPORAL_ONTOLOGY.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/OFFICIAL_MLDOC_SPECS.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/design-docs/REFERENCE_SPEC.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/error_log.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/logseq_ast_primer.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_CLI_HYDRATION_AND_ENRICHMENT.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_CONTEXT_SYNTHESIS_AND_SCOPING.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_EMBED_EXPANSION_AND_FLUENT_QUERIES.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_GRAPH_RAG_SEMANTICS.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_INCREMENTAL_WATCHER.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_INLINE_SHIELD_AND_NAMESPACES.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_ROBUSTNESS_AND_SOFT_BREAKS.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_TOML_FIX_AND_PYPI_DISTRIBUTION.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/docs/roadmaps/ROADMAP_UUID_AND_GRAPH_SUPERPOWERS.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/examples/demo_logseq_journal.md +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/examples/run_demo.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/legacy/local_digestor.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/lib/bindings/utils.js +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/lib/tom-select/tom-select.complete.min.js +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/lib/tom-select/tom-select.css +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/lib/vis-9.1.2/vis-network.css +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/lib/vis-9.1.2/vis-network.min.js +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/.gitignore +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/NOTICE +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/__main__.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/agent_press.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/exceptions.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/forge.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/lens.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/logos_core.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/pyproject.toml +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/src/logseq_matryca_parser/synapse.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_agent_press.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_forge.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_graph.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_kinetic.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_lens.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_package_version.py +0 -0
- {logseq_matryca_parser-0.3.3 → logseq_matryca_parser-1.0.0}/tests/test_synapse.py +0 -0
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# .repomixignore
|
|
2
|
-
|
|
3
1
|
# =========================
|
|
4
2
|
# Repomix Outputs & AI Generated
|
|
5
3
|
# =========================
|
|
@@ -50,6 +48,31 @@ __pycache__/
|
|
|
50
48
|
.ruff_cache/
|
|
51
49
|
.venv/
|
|
52
50
|
venv/
|
|
51
|
+
env/
|
|
52
|
+
|
|
53
|
+
# =========================
|
|
54
|
+
# Python Build & Distribution (NUOVO)
|
|
55
|
+
# =========================
|
|
56
|
+
build/
|
|
57
|
+
dist/
|
|
58
|
+
*.egg-info/
|
|
59
|
+
*.egg
|
|
60
|
+
|
|
61
|
+
# =========================
|
|
62
|
+
# Testing Coverage & Tox (NUOVO)
|
|
63
|
+
# =========================
|
|
64
|
+
.coverage
|
|
65
|
+
coverage.xml
|
|
66
|
+
htmlcov/
|
|
67
|
+
.tox/
|
|
68
|
+
|
|
69
|
+
# =========================
|
|
70
|
+
# IDE & Workflows (NUOVO)
|
|
71
|
+
# =========================
|
|
72
|
+
.vscode/
|
|
73
|
+
.idea/
|
|
74
|
+
.cursor/
|
|
75
|
+
.github/
|
|
53
76
|
|
|
54
77
|
# =========================
|
|
55
78
|
# Token Killers (Logs, DBs, Vector Graphics)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: logseq-matryca-parser
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 1.0.0
|
|
4
4
|
Summary: The Logos Protocol: Deterministic Logseq AST parsing for Matryca.ai.
|
|
5
5
|
Project-URL: Homepage, https://github.com/MarcoPorcellato/logseq-matryca-parser
|
|
6
6
|
Project-URL: Bug Tracker, https://github.com/MarcoPorcellato/logseq-matryca-parser/issues
|
|
@@ -10,7 +10,7 @@ License: Apache-2.0
|
|
|
10
10
|
License-File: LICENSE
|
|
11
11
|
License-File: NOTICE
|
|
12
12
|
Keywords: ai,ast,knowledge-graph,logseq,parser,rag
|
|
13
|
-
Classifier: Development Status ::
|
|
13
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
@@ -44,10 +44,10 @@ Description-Content-Type: text/markdown
|
|
|
44
44
|
[](https://www.python.org/downloads/)
|
|
45
45
|
[](https://github.com/MarcoPorcellato/logseq-matryca-parser/blob/main/LICENSE)
|
|
46
46
|
[](https://github.com/MarcoPorcellato/logseq-matryca-parser#-quickstart)
|
|
47
|
-
[](#)
|
|
48
48
|

|
|
49
49
|
|
|
50
|
-
**
|
|
50
|
+
**v1.0.0 Stable** — heavily tested (156+ tests), full bidirectional Headless CRUD engine, native markdown serialization, and static typing; ready for production Enterprise integration.
|
|
51
51
|
|
|
52
52
|
> *Turning a forest of local plain-text files into a unified semantic powerhouse.*
|
|
53
53
|
|
|
@@ -179,7 +179,7 @@ matryca-parse agent-read /path/to/graph --query "quantum"
|
|
|
179
179
|
The agent reads cheap topology now; the registry resolves aliases back to sovereign UUIDs when you wire targeted writes.
|
|
180
180
|
|
|
181
181
|
### Headless Write Engine & AST Linter (Wave 12)
|
|
182
|
-
The parser is **no longer read-only**. Wave 12 adds a **headless Markdown splicer** ([`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py)): `append_child_to_node` uses AST line numbers and indentation (`(indent_level + 1) × tab_size`) to insert a new bullet **atomically** into the sovereign `.md` file—via `tempfile` + `os.replace`—without Logseq’s fragile HTTP API. Pair **`agent-read`** with **`agent-write`**: X-Ray persists its alias map to **`.matryca_xray_state.json`** at the graph root so stateless CLI invocations can **read, then write** in sequence.
|
|
182
|
+
The parser is **no longer read-only**. Wave 12 adds a **headless Markdown splicer** ([`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py)): `append_child_to_node` uses AST line numbers and indentation (`(indent_level + 1) × tab_size`) to insert a new bullet **atomically** into the sovereign `.md` file—via `tempfile` + `os.replace`—without Logseq’s fragile HTTP API. Beyond surgical node splicing, the engine now supports **full bidirectional page generation** via [`serialize_logseq_page`](src/logseq_matryca_parser/logseq_markdown.py) and [`write_logseq_page`](src/logseq_matryca_parser/logseq_markdown.py)—rebuilding entire Logseq-compliant `.md` pages from an in-memory AST. Pair **`agent-read`** with **`agent-write`**: X-Ray persists its alias map to **`.matryca_xray_state.json`** at the graph root so stateless CLI invocations can **read, then write** in sequence.
|
|
183
183
|
|
|
184
184
|
```bash
|
|
185
185
|
matryca-parse agent-read /path/to/graph --tag idea
|
|
@@ -200,7 +200,8 @@ For graph hygiene, **`LogseqGraph.get_broken_references()`** flags nodes whose `
|
|
|
200
200
|
| **FORGE** | JSON, clean Markdown, and **Obsidian** vault serialization (`ObsidianForgeVisitor`, `ForgeExporter.to_obsidian_markdown`). |
|
|
201
201
|
| **LENS Visualizer** | 60FPS interactive graph rendering (10k+ nodes) with Glassmorphism HUD. |
|
|
202
202
|
| **Agent-Native Printing Press** | [`agent_press.py`](src/logseq_matryca_parser/agent_press.py): **`SessionAliasRegistry`** maps session aliases ↔ block UUIDs; **`to_xray_markdown`** emits token-minimal outline text for autonomous agents (`matryca-parse agent-read`). |
|
|
203
|
-
| **
|
|
203
|
+
| **Native Markdown Serialization** | [`logseq_markdown.py`](src/logseq_matryca_parser/logseq_markdown.py) + [`logseq_paths.py`](src/logseq_matryca_parser/logseq_paths.py): rebuild and write Logseq-compliant markdown pages from an AST—page properties as raw `key:: value` lines, block properties indented at **parent whitespace + exactly 2 spaces**, and namespace titles mapped via **`___`** pathing rules. |
|
|
204
|
+
| **Headless Write Engine** | [`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py): **`append_child_to_node`** splices child bullets into on-disk Markdown from AST topology; **`serialize_logseq_page`** / **`write_logseq_page`** emit full pages; **`matryca-parse agent-write`** resolves aliases via **`.matryca_xray_state.json`**. |
|
|
204
205
|
| **AST Linters** | **`LogseqGraph.get_broken_references()`** returns originating nodes when `block_refs` target UUIDs absent from the global registry. |
|
|
205
206
|
| **Sovereign AI** | 100% Local. Zero telemetry. Private by design. |
|
|
206
207
|
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
[](https://www.python.org/downloads/)
|
|
9
9
|
[](https://github.com/MarcoPorcellato/logseq-matryca-parser/blob/main/LICENSE)
|
|
10
10
|
[](https://github.com/MarcoPorcellato/logseq-matryca-parser#-quickstart)
|
|
11
|
-
[](#)
|
|
12
12
|

|
|
13
13
|
|
|
14
|
-
**
|
|
14
|
+
**v1.0.0 Stable** — heavily tested (156+ tests), full bidirectional Headless CRUD engine, native markdown serialization, and static typing; ready for production Enterprise integration.
|
|
15
15
|
|
|
16
16
|
> *Turning a forest of local plain-text files into a unified semantic powerhouse.*
|
|
17
17
|
|
|
@@ -143,7 +143,7 @@ matryca-parse agent-read /path/to/graph --query "quantum"
|
|
|
143
143
|
The agent reads cheap topology now; the registry resolves aliases back to sovereign UUIDs when you wire targeted writes.
|
|
144
144
|
|
|
145
145
|
### Headless Write Engine & AST Linter (Wave 12)
|
|
146
|
-
The parser is **no longer read-only**. Wave 12 adds a **headless Markdown splicer** ([`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py)): `append_child_to_node` uses AST line numbers and indentation (`(indent_level + 1) × tab_size`) to insert a new bullet **atomically** into the sovereign `.md` file—via `tempfile` + `os.replace`—without Logseq’s fragile HTTP API. Pair **`agent-read`** with **`agent-write`**: X-Ray persists its alias map to **`.matryca_xray_state.json`** at the graph root so stateless CLI invocations can **read, then write** in sequence.
|
|
146
|
+
The parser is **no longer read-only**. Wave 12 adds a **headless Markdown splicer** ([`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py)): `append_child_to_node` uses AST line numbers and indentation (`(indent_level + 1) × tab_size`) to insert a new bullet **atomically** into the sovereign `.md` file—via `tempfile` + `os.replace`—without Logseq’s fragile HTTP API. Beyond surgical node splicing, the engine now supports **full bidirectional page generation** via [`serialize_logseq_page`](src/logseq_matryca_parser/logseq_markdown.py) and [`write_logseq_page`](src/logseq_matryca_parser/logseq_markdown.py)—rebuilding entire Logseq-compliant `.md` pages from an in-memory AST. Pair **`agent-read`** with **`agent-write`**: X-Ray persists its alias map to **`.matryca_xray_state.json`** at the graph root so stateless CLI invocations can **read, then write** in sequence.
|
|
147
147
|
|
|
148
148
|
```bash
|
|
149
149
|
matryca-parse agent-read /path/to/graph --tag idea
|
|
@@ -164,7 +164,8 @@ For graph hygiene, **`LogseqGraph.get_broken_references()`** flags nodes whose `
|
|
|
164
164
|
| **FORGE** | JSON, clean Markdown, and **Obsidian** vault serialization (`ObsidianForgeVisitor`, `ForgeExporter.to_obsidian_markdown`). |
|
|
165
165
|
| **LENS Visualizer** | 60FPS interactive graph rendering (10k+ nodes) with Glassmorphism HUD. |
|
|
166
166
|
| **Agent-Native Printing Press** | [`agent_press.py`](src/logseq_matryca_parser/agent_press.py): **`SessionAliasRegistry`** maps session aliases ↔ block UUIDs; **`to_xray_markdown`** emits token-minimal outline text for autonomous agents (`matryca-parse agent-read`). |
|
|
167
|
-
| **
|
|
167
|
+
| **Native Markdown Serialization** | [`logseq_markdown.py`](src/logseq_matryca_parser/logseq_markdown.py) + [`logseq_paths.py`](src/logseq_matryca_parser/logseq_paths.py): rebuild and write Logseq-compliant markdown pages from an AST—page properties as raw `key:: value` lines, block properties indented at **parent whitespace + exactly 2 spaces**, and namespace titles mapped via **`___`** pathing rules. |
|
|
168
|
+
| **Headless Write Engine** | [`agent_writer.py`](src/logseq_matryca_parser/agent_writer.py): **`append_child_to_node`** splices child bullets into on-disk Markdown from AST topology; **`serialize_logseq_page`** / **`write_logseq_page`** emit full pages; **`matryca-parse agent-write`** resolves aliases via **`.matryca_xray_state.json`**. |
|
|
168
169
|
| **AST Linters** | **`LogseqGraph.get_broken_references()`** returns originating nodes when `block_refs` target UUIDs absent from the global registry. |
|
|
169
170
|
| **Sovereign AI** | 100% Local. Zero telemetry. Private by design. |
|
|
170
171
|
|
|
@@ -358,6 +358,46 @@ Rich styling injects **ANSI escape sequences** that waste tokens and can cause m
|
|
|
358
358
|
|
|
359
359
|
This complements §3.4 **AGENT WRITER** (weekly append + headless splice) and §3.2 **SYNAPSE** (human/RAG chunking): one stack, multiple projections — **enriched chunks for vectors**, **X-Ray + alias state for agent context**, **append / splice for durable writes**.
|
|
360
360
|
|
|
361
|
+
### 3.8 Bidirectional I/O and Logseq Layouts
|
|
362
|
+
|
|
363
|
+
Wave 12 established **surgical writes** (single-line splices); v1.0 completes the loop with **full page round-tripping**. [`logseq_markdown.py`](../src/logseq_matryca_parser/logseq_markdown.py) is the native serializer that projects a parsed **`LogseqPage`** back onto sovereign Spatial Markdown — the inverse of LOGOS ingestion.
|
|
364
|
+
|
|
365
|
+
#### Page properties (file header)
|
|
366
|
+
|
|
367
|
+
Page-level metadata is emitted as **raw `key:: value` lines** at the top of the file — no YAML frontmatter wrapper. [`format_logseq_page_properties`](../src/logseq_matryca_parser/logseq_markdown.py) renders each entry on its own line (list-valued keys such as `tags::` are flattened to comma-separated tokens), followed by a **blank separator line** before the first outline bullet. This mirrors how Logseq stores page properties in vanilla `.md` exports and keeps Git diffs line-granular.
|
|
368
|
+
|
|
369
|
+
#### Block properties (strict indentation contract)
|
|
370
|
+
|
|
371
|
+
Block-scoped properties are serialized **immediately after the bullet text line**, never interleaved with child bullets. The indent rule is strict and deterministic:
|
|
372
|
+
|
|
373
|
+
```text
|
|
374
|
+
{parent_leading_whitespace} {key}:: {value}
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
That is, take the **exact leading whitespace** of the parent bullet line and append **exactly two additional spaces** (`_block_property_indent`). Continuation lines of multiline block bodies use the same `parent + 2` column. [`format_logseq_block_property_lines`](../src/logseq_matryca_parser/logseq_markdown.py) respects **`properties_order`** when present so round-trips preserve author ordering.
|
|
378
|
+
|
|
379
|
+
#### Full-page emission
|
|
380
|
+
|
|
381
|
+
[`serialize_logseq_page`](../src/logseq_matryca_parser/logseq_markdown.py) walks `page.root_nodes` depth-first, emitting `- {first_line}` bullets scaled by `indent_level × tab_size`, then property lines, then continuations, then children. [`write_logseq_page`](../src/logseq_matryca_parser/logseq_markdown.py) persists the result with UTF-8 encoding. Together with §3.4’s **`append_child_to_node`**, the stack now supports **point mutations** and **whole-page regeneration** from the same AST — bidirectional I/O without Logseq’s HTTP API.
|
|
382
|
+
|
|
383
|
+
### 3.9 Namespace & Path Translation
|
|
384
|
+
|
|
385
|
+
Semantic page titles and OS filesystem paths speak different dialects. [`logseq_paths.py`](../src/logseq_matryca_parser/logseq_paths.py) centralizes that translation so graph loaders, exporters, and the write engine agree on **where a page lives on disk**.
|
|
386
|
+
|
|
387
|
+
#### Title ↔ filename mapping
|
|
388
|
+
|
|
389
|
+
Logseq namespaces use **`/`** in titles (e.g. `Projects/AI`). On disk, each segment is flattened into a single filename stem with the **`___`** separator and percent-encoding for reserved characters — e.g. `Projects/AI` → `Projects___AI.md`. The inverse helpers **`filename_to_page_title`** and **`derive_page_title_from_source_path`** reconstruct semantic titles from `pages/` or `journals/` paths, including nested directory layouts when namespace segments are stored as folders.
|
|
390
|
+
|
|
391
|
+
| Direction | Function | Example |
|
|
392
|
+
| --------- | -------- | ------- |
|
|
393
|
+
| Title → stem | `page_title_to_filename` | `Projects/AI` → `Projects___AI` |
|
|
394
|
+
| Stem → title | `filename_to_page_title` | `Projects___AI` → `Projects/AI` |
|
|
395
|
+
| Title → relative path | `page_title_to_relative_path` | `pages/Projects___AI.md` |
|
|
396
|
+
|
|
397
|
+
#### Graph discovery filters
|
|
398
|
+
|
|
399
|
+
When scanning a vault root, **`is_excluded_graph_path`** drops noise directories — notably **`.recycle`**, **`.git`**, and the internal **`logseq`** config tree — so incremental watchers and bulk loaders never ingest backup blobs or VCS metadata as pages. This keeps **`LogseqGraph.load_directory`** and **`invalidate_and_reload_page`** focused on sovereign content under `pages/` and `journals/`.
|
|
400
|
+
|
|
361
401
|
---
|
|
362
402
|
|
|
363
403
|
## 4. Data Flow Sequence
|
|
@@ -425,4 +465,4 @@ Recursive and character-budget chunkers assume **approximately flat prose**. Log
|
|
|
425
465
|
|
|
426
466
|
---
|
|
427
467
|
|
|
428
|
-
*This document reflects the implementations in `src/logseq_matryca_parser/logos_parser.py`, `synapse.py`, `graph.py`, `forge.py`, `lens.py`, `logos_core.py`, `agent_writer.py`, and `
|
|
468
|
+
*This document reflects the implementations in `src/logseq_matryca_parser/logos_parser.py`, `synapse.py`, `graph.py`, `forge.py`, `lens.py`, `logos_core.py`, `agent_writer.py`, `agent_press.py`, `logseq_markdown.py`, and `logseq_paths.py`, and complements narrative primers such as [`logseq_ast_primer.md`](logseq_ast_primer.md).*
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "logseq-matryca-parser"
|
|
7
|
-
version = "0.
|
|
7
|
+
version = "1.0.0"
|
|
8
8
|
description = "The Logos Protocol: Deterministic Logseq AST parsing for Matryca.ai."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
@@ -21,7 +21,7 @@ keywords = [
|
|
|
21
21
|
"knowledge-graph",
|
|
22
22
|
]
|
|
23
23
|
classifiers = [
|
|
24
|
-
"Development Status ::
|
|
24
|
+
"Development Status :: 5 - Production/Stable",
|
|
25
25
|
"Intended Audience :: Developers",
|
|
26
26
|
"Programming Language :: Python :: 3.12",
|
|
27
27
|
"License :: OSI Approved :: Apache Software License",
|