ReMe/reme2/schema/parsed_file.py
huangsen 514bf35050
Some checks failed
Pre-commit / run (ubuntu-latest) (push) Has been cancelled
```
docs: add ReMe2 architecture design documentation

- Add comprehensive design document (reme2.md) detailing the
  three-layer architecture (L1/L2/L3) for the vault system
- Document new protocols for folder notes and memory management
- Specify interface contracts for memory_* and vault_* tools
- Outline implementation phases from current state to target

refactor: fix typo in personal retriever class

- Correct spelling error: 'retri eved_nodes' -> 'retrieved_nodes'
  in PersonalRetriever.result assignment

chore: update gitignore with vault-related patterns

- Add '/vault' to ignore vault directory
- Add '/reme-plugin' to ignore plugin files
- Add '/reme2/vault' to ignore new vault implementation
```
2026-05-08 16:14:42 +08:00

28 lines
1.1 KiB
Python

"""ParsedFile — Parser's single output, carrying everything one file pass produces.
Inherits `FileMetadata` (file / path / st_mtime / metadata) and adds the
parsed contents:
chunks: list[FileChunk] — semantic blocks (text + position + hash);
embeddings ARE attached here — the parser
owns the embedding step (with hash-diff
cache via `existing_chunks` parameter).
edges: list[FileEdge] — wikilink graph edges (regex / frontmatter /
LLM provenance preserved per-edge).
The Watcher passes a `ParsedFile` into `file_store.upsert_parsed(...)`,
which dispatches the three sub-payloads (meta / edges / chunks) to the
appropriate persistence pipelines while keeping the upsert atomic at
the store layer.
"""
from pydantic import Field
from .file_chunk import FileChunk
from .file_edge import FileEdge
from .file_metadata import FileMetadata
class ParsedFile(FileMetadata):
chunks: list[FileChunk] = Field(default_factory=list)
edges: list[FileEdge] = Field(default_factory=list)