markitect-main/.ast_cache/test_roundtrip.md.ast.json

580 lines
9.4 KiB
JSON
Raw Normal View History

feat: Complete Issue #2 - Fast Document Loading & CLI Manipulation Major milestone: Implemented complete document manipulation workflow with roundtrip validation capabilities. New features: - markitect get: Retrieve and output processed markdown files - markitect modify: Content manipulation with --add-section and --update-front-matter - AST serialization: Complete AST-to-Markdown conversion with modification support - Roundtrip validation: add → modify → get → verify workflow operational Implementation details: - Added markitect/serializer.py with comprehensive AST-to-Markdown serialization - Extended CLI with get and modify commands using Click framework - Support for section addition and front matter updates - Comprehensive error handling and user feedback - Integration with existing AST cache and database systems Testing: - All 11 Issue #2 tests passing (100% success rate) - Manual roundtrip validation successfully completed - Performance optimization maintained (<50% cache loading time) - Core USP 'Parse once, manipulate many times' fully operational Files changed: - NEW: markitect/serializer.py (AST serialization and modification) - MODIFIED: markitect/cli.py (added get and modify commands) - Test files demonstrating working roundtrip functionality Issue #2 requirements fully satisfied: ✅ Performance-first storage strategy ✅ Complete CLI workflow with roundtrip validation ✅ Document manipulation capabilities ✅ AST serialization and content modification ✅ All success criteria met 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-25 03:03:04 +02:00
[
{
"type": "heading_open",
"tag": "h1",
"attrs": {},
"map": [
0,
1
],
"nesting": 1,
"level": 0,
"content": "",
"markup": "#",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
0,
1
],
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "Test Document",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "Test Document",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "heading_close",
"tag": "h1",
"attrs": {},
"nesting": -1,
"level": 0,
"content": "",
"markup": "#",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_open",
"tag": "p",
"attrs": {},
"map": [
2,
3
],
"nesting": 1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
2,
3
],
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "This is a test file for roundtrip validation.",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "This is a test file for roundtrip validation.",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": {},
"nesting": -1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "heading_open",
"tag": "h2",
"attrs": {},
"map": [
4,
5
],
"nesting": 1,
"level": 0,
"content": "",
"markup": "##",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
4,
5
],
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "Section 1",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "Section 1",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "heading_close",
"tag": "h2",
"attrs": {},
"nesting": -1,
"level": 0,
"content": "",
"markup": "##",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_open",
"tag": "p",
"attrs": {},
"map": [
5,
6
],
"nesting": 1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
5,
6
],
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "Content in section 1.",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "Content in section 1.",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": {},
"nesting": -1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "bullet_list_open",
"tag": "ul",
"attrs": {},
"map": [
7,
9
],
"nesting": 1,
"level": 0,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "list_item_open",
"tag": "li",
"attrs": {},
"map": [
7,
8
],
"nesting": 1,
"level": 1,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_open",
"tag": "p",
"attrs": {},
"map": [
7,
8
],
"nesting": 1,
"level": 2,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": true
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
7,
8
],
"nesting": 0,
"level": 3,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "List item 1",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "List item 1",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": {},
"nesting": -1,
"level": 2,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": true
},
{
"type": "list_item_close",
"tag": "li",
"attrs": {},
"nesting": -1,
"level": 1,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "list_item_open",
"tag": "li",
"attrs": {},
"map": [
8,
9
],
"nesting": 1,
"level": 1,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_open",
"tag": "p",
"attrs": {},
"map": [
8,
9
],
"nesting": 1,
"level": 2,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": true
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": [
8,
9
],
"nesting": 0,
"level": 3,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"nesting": 0,
"level": 0,
"content": "List item 2",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "List item 2",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": {},
"nesting": -1,
"level": 2,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": true
},
{
"type": "list_item_close",
"tag": "li",
"attrs": {},
"nesting": -1,
"level": 1,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "bullet_list_close",
"tag": "ul",
"attrs": {},
"nesting": -1,
"level": 0,
"content": "",
"markup": "-",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "heading_open",
"tag": "h2",
"attrs": {},
"map": null,
"nesting": 1,
"level": 0,
"content": "",
"markup": "##",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": null,
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"map": null,
"nesting": 0,
"level": 0,
"content": "New Section",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "New Section",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "heading_close",
"tag": "h2",
"attrs": {},
"map": null,
"nesting": -1,
"level": 0,
"content": "",
"markup": "##",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_open",
"tag": "p",
"attrs": {},
"map": null,
"nesting": 1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "inline",
"tag": "",
"attrs": {},
"map": null,
"nesting": 0,
"level": 1,
"children": [
{
"type": "text",
"tag": "",
"attrs": {},
"map": null,
"nesting": 0,
"level": 0,
"content": "This section was added via CLI modification.",
"markup": "",
"info": "",
"meta": {},
"block": false,
"hidden": false
}
],
"content": "This section was added via CLI modification.",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
},
{
"type": "paragraph_close",
"tag": "p",
"attrs": {},
"map": null,
"nesting": -1,
"level": 0,
"content": "",
"markup": "",
"info": "",
"meta": {},
"block": true,
"hidden": false
}
]