# matrx_ai.db.content_types — Module Overview


## IMPORTANT: Do not edit auto-generated sections.

> This document is partially auto-generated. Sections tagged `<!-- AUTO:id -->` are refreshed by the generator.
> Everything else is yours to edit freely and will never be overwritten.

<!-- AUTO:meta -->
## About This Document

This file is **partially auto-generated**. Sections wrapped in `<!-- AUTO:id -->` tags
are overwritten each time the generator runs. Everything else is yours to edit freely.

| Field | Value |
|-------|-------|
| Module | `packages/matrx-ai/matrx_ai/db/content_types` |
| Last generated | 2026-07-07 01:02 |
| Output file | `packages/matrx-ai/matrx_ai/db/content_types/MODULE_README.md` |
| Signature mode | `signatures` |

**To refresh auto-sections:**
```bash
python utils/code_context/generate_module_readme.py packages/matrx-ai/matrx_ai/db/content_types --mode signatures
```

**To add permanent notes:** Write anywhere outside the `<!-- AUTO:... -->` blocks.
<!-- /AUTO:meta -->

<!-- HUMAN-EDITABLE: This section is yours. Agents & Humans can edit this section freely — it will not be overwritten. -->

## Architecture

> **Fill this in.** Describe the execution flow and layer map for this module.
> See `utils/code_context/MODULE_README_SPEC.md` for the recommended format.
>
> Suggested structure:
>
> ### Layers
> | File | Role |
> |------|------|
> | `entry.py` | Public entry point — receives requests, returns results |
> | `engine.py` | Core dispatch logic |
> | `models.py` | Shared data types |
>
> ### Call Flow (happy path)
> ```
> entry_function() → engine.dispatch() → implementation()
> ```


<!-- AUTO:tree -->
## Directory Tree

> Auto-generated. 11 files across 1 directories.

```
packages/matrx-ai/matrx_ai/db/content_types/
├── MODULE_README.md
├── _notes_impl.py
├── _tasks_impl.py
├── data_ref.py
├── data_ref_utils.ts
├── datasets.py
├── notes.py
├── patch_utils.py
├── picklists.py
├── tasks.py
├── tests.py
# excluded: 2 .md
```
<!-- /AUTO:tree -->

<!-- AUTO:signatures -->
## API Signatures

> Auto-generated via `output_mode="signatures"`. ~5-10% token cost vs full source.
> For full source, open the individual files directly.

```
---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/patch_utils.py  [python]

  class PatchPassLevel(str, Enum):
  class PatchResult:
  class PatchError(Exception):
      def __post_init__(self) -> None
      def __str__(self) -> str
      def to_dict(self) -> dict
  def _normalize_whitespace(text: str) -> str
  def _strip_blank_lines(text: str) -> str
  def _lenient_normalize(text: str) -> str
  def apply_patch(content: str, search_text: str, replacement_text: str, note_id: str = '<unknown>') -> PatchResult
  def _recover_original_span(original: str, normalized: str, norm_start: int, norm_end: int) -> str


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/_notes_impl.py  [python]

  NotesBase = get_base('NotesBase')
  XML_TEMPLATE_FULL = '<note>\n  <id>{id}</id>\n  <label>{label}</label>\n  <folder_name>{folder_name}</folder_name>\n  <content>\n{content}\n ...
  XML_TEMPLATE_COMPACT = '<note>\n  <id>{id}</id>\n  <label>{label}</label>\n  <content>{content}</content>\n</note>'
  XML_TEMPLATE_MINIMAL = '<note id="{id}">\n  <label>{label}</label>\n  <content>{content}</content>\n</note>'
  DEFAULT_XML_TEMPLATE = 'full'
  class NotesManager(NotesBase):
      def __new__(cls, *args: Any, **kwargs: Any) -> NotesManager
      def __init__(self) -> None
      async def _initialize_runtime_data(self, item: Notes) -> None
      async def get_note(self, note_id: str) -> dict[str, Any]
      async def get_note_as_xml(self, note_id: str, template: str = DEFAULT_XML_TEMPLATE) -> dict[str, Any]
      async def list_notes_for_user(self, user_id: str) -> dict[str, Any]
      async def create_note(self, user_id: str, label: str, content: str, folder_name: str = '', tags: list[str] | None = None, metadata: dict[str, Any] | None = None, is_public: bool = False) -> dict[str, Any]
      async def update_note(self, note_id: str, **updates: Any) -> dict[str, Any]
      async def update_note_content(self, note_id: str, content: str) -> dict[str, Any]
      async def update_note_label(self, note_id: str, label: str) -> dict[str, Any]
      async def update_note_tags(self, note_id: str, tags: list[str]) -> dict[str, Any]
      async def move_note_to_folder(self, note_id: str, folder_name: str) -> dict[str, Any]
      async def patch_note_content(self, note_id: str, search_text: str, replacement_text: str) -> dict[str, Any]
      async def append_to_note(self, note_id: str, text: str, separator: str = '\n\n') -> dict[str, Any]
      async def prepend_to_note(self, note_id: str, text: str, separator: str = '\n\n') -> dict[str, Any]
      async def delete_note(self, note_id: str) -> dict[str, Any]
      async def load_note_as_llm_xml(self, note_id: str, template: str = DEFAULT_XML_TEMPLATE) -> str
      def _to_llm_xml(self, note: Notes, template: str = DEFAULT_XML_TEMPLATE) -> str
  def render_note_snapshot_xml(data: dict[str, Any], template: str = DEFAULT_XML_TEMPLATE) -> str
  def _ok(note: Notes) -> dict[str, Any]
  def _err(operation: str, note_id: str, error: Exception, **extra: Any) -> dict[str, Any]


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/tasks.py  [python]

  def __getattr__(name: str) -> Any
  def __dir__() -> list[str]


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/datasets.py  [python]

  class DatasetsManager:
      def __new__(cls) -> DatasetsManager
      def get_full_table(self, table_id: str, *, limit: int = 100, offset: int = 0, sort_field: str | None = None, sort_direction: str = 'asc') -> dict[str, Any]
      def get_table_column(self, table_id: str, column_name: str, *, limit: int = 100, offset: int = 0) -> dict[str, Any]
      def get_table_row(self, table_id: str, row_id: str) -> dict[str, Any]
      def get_table_cell(self, table_id: str, row_id: str, column_name: str) -> dict[str, Any]


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/_tasks_impl.py  [python]

  TasksBase = get_base('TasksBase')
  XML_TEMPLATE_FULL = '<task>\n  <id>{id}</id>\n  <title>{title}</title>\n  <status>{status}</status>\n  <priority>{priority}</priority>\n  <d ...
  XML_TEMPLATE_COMPACT = '<task>\n  <id>{id}</id>\n  <title>{title}</title>\n  <status>{status}</status>\n  <priority>{priority}</priority>\n  <d ...
  DEFAULT_XML_TEMPLATE = 'full'
  TaskStatus = Literal['incomplete', 'completed']
  TaskPriority = Literal['low', 'medium', 'high', 'urgent']
  class TasksManager(TasksBase):
      def __new__(cls, *args: Any, **kwargs: Any) -> TasksManager
      def __init__(self) -> None
      async def _initialize_runtime_data(self, item: Tasks) -> None
      async def get_task(self, task_id: str) -> dict[str, Any]
      async def get_task_as_xml(self, task_id: str, template: str = DEFAULT_XML_TEMPLATE) -> dict[str, Any]
      def _to_llm_xml(self, task: Tasks, template: str = DEFAULT_XML_TEMPLATE) -> str
      async def list_tasks_for_project(self, project_id: str) -> dict[str, Any]
      async def list_tasks_for_user(self, user_id: str) -> dict[str, Any]
      async def list_subtasks(self, parent_task_id: str) -> dict[str, Any]
      async def create_task(self, user_id: str, title: str, description: str = '', project_id: str | None = None, parent_task_id: str | None = None, status: TaskStatus = 'incomplete', priority: TaskPriority | None = None, due_date: str | None = None, assignee_id: str | None = None, is_public: bool = False) -> dict[str, Any]
      async def update_task(self, task_id: str, **updates: Any) -> dict[str, Any]
      async def delete_task(self, task_id: str) -> dict[str, Any]
  def render_task_snapshot_xml(data: dict[str, Any], template: str = DEFAULT_XML_TEMPLATE) -> str
  def _ok(task: Tasks) -> dict[str, Any]
  def _err(operation: str, task_id: str, error: Exception, **extra: Any) -> dict[str, Any]


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/notes.py  [python]

  def __getattr__(name: str) -> Any
  def __dir__() -> list[str]


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/data_ref_utils.ts  [typescript]

  # Types
    export type AllowedTable = | "notes"
    export type DataRef = DbRecordRef | DbQueryRef | DbFieldRef
    export type _DocumentationOnly_ModelOutput = never
  # Interfaces
    export interface DbRecordRef
    # ref_type: "db_record"
    # table: AllowedTable
    # id: string
    # /** Override the label shown in XML context (defaults to the table name). */
    # label?: string
    # /** Subset of fields to include. Omit for all allowed fields. */
    # fields?: string[]
    # /** If true, a fetch failure silently drops this ref instead of aborting. */
    # ... 1 more fields
    export interface DbQueryRef
    # ref_type: "db_query"
    # table: AllowedTable
    # /** Equality filters: { field: value }. All conditions are ANDed. */
    # filter?: Record<string, string | number | boolean | null>
    # /** Subset of fields to include. Omit for all allowed fields. */
    # fields?: string[]
    # /** Sort order. */
    # sort?: { field: string; direction?: "asc" | "desc" }
    # ... 5 more fields
    export interface DbFieldRef
    # ref_type: "db_field"
    # table: AllowedTable
    # id: string
    # /** The column name to fetch. */
    # field_name: string
    # /** Label shown in the XML <field> tag (defaults to field_name). */
    # label?: string
    # optional_context?: boolean
    export interface DataInputBlockOptions
    # /**
    # optional_context?: boolean
    # /**
    # keep_fresh?: boolean
    export interface DataInputBlock
    # /**
    # optional_context?: boolean
    # /**
    # keep_fresh?: boolean
  # Functions
    export function buildDataInputBlock(refs: DataRef[], opts?: DataInputBlockOptions,): DataInputBlock


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/picklists.py  [python]

  class PicklistsManager:
      def __new__(cls) -> PicklistsManager
      def get_full_list(self, list_id: str) -> dict[str, Any]
      def get_list_summary(self, list_id: str) -> dict[str, Any]
      def get_list_items(self, list_id: str) -> dict[str, Any]
      def get_list_group(self, list_id: str, group_name: str) -> dict[str, Any]
      def get_list_item(self, list_id: str, item_id: str) -> dict[str, Any]
      def get_full_list_as_xml(self, list_id: str) -> dict[str, Any]
  def _items_to_xml(items: list[dict[str, Any]], list_name: str, group_name: str | None = None) -> str
  def _full_list_to_xml(result: dict[str, Any]) -> str


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/tests.py  [python]

  async def fetch_note(note_id: str)
  async def fetch_note_as_llm_xml(note_id: str)
  async def test_update_note(note_id: str)
  async def test_patch_note(note_id: str)
  async def test_patch_note_fuzzy(note_id: str)
  async def test_append_note(note_id: str)
  async def test_prepend_note(note_id: str)
  async def fetch_task(task_id: str)
  async def fetch_task_as_xml(task_id: str)
  async def test_list_tasks_for_project(project_id: str)
  async def test_list_subtasks(parent_task_id: str)
  async def test_update_task(task_id: str)


---
Filepath: packages/matrx-ai/matrx_ai/db/content_types/data_ref.py  [python]

  DataRef = DbRecordRef | DbQueryRef | DbFieldRef
  class _TableSpec:
  class DbRecordRef:
      def from_dict(cls, d: dict[str, Any]) -> DbRecordRef
  class DbQueryRef:
      def from_dict(cls, d: dict[str, Any]) -> DbQueryRef
  class DbFieldRef:
      def from_dict(cls, d: dict[str, Any]) -> DbFieldRef
  def _check_table(table: str) -> _TableSpec
  def _filter_fields(row: dict[str, Any], fields_allowed: list[str] | None, requested: list[str] | None) -> dict[str, Any]
  def parse_data_ref(d: dict[str, Any]) -> DataRef
  def _fetch_row(table: str, row_id: str) -> dict[str, Any] | None
  def _fetch_rows(table: str, filter_: dict[str, Any], sort: dict[str, str] | None, limit: int) -> list[dict[str, Any]]
  def _record_to_xml(row: dict[str, Any] | None, table: str, row_id: str, label: str) -> str
  def _rows_to_xml(rows: list[dict[str, Any]], table: str, label: str) -> str
  def _field_to_xml(value: Any, table: str, row_id: str, field_name: str, label: str) -> str
  def resolve_data_ref(ref: DataRef) -> str | None
  def resolve_data_refs(refs: list[dict[str, Any]]) -> tuple[str, list[str]]
```
<!-- /AUTO:signatures -->

<!-- AUTO:callers -->
## Upstream Callers

> Auto-discovered by scanning all project files that import from this module.
> Set `ENTRY_POINTS` in `generate_readme.py` to pin specific functions.

| Caller | Calls |
|--------|-------|
| `matrx_ai/config/structured_input_config.py` | `resolve_data_refs()` |
<!-- /AUTO:callers -->

<!-- AUTO:dependencies -->
## Dependencies

**External packages:** matrx_ai, matrx_orm, matrx_utils
<!-- /AUTO:dependencies -->

<!-- AUTO:config -->
## Generation Config

> Auto-managed. Contains the exact parameters used to generate this README.
> Used by parent modules to auto-refresh this file when it is stale.
> Do not edit manually — changes will be overwritten on the next run.

```json
{
  "subdirectory": "packages/matrx-ai/matrx_ai/db/content_types",
  "mode": "signatures",
  "scope": null,
  "project_noise": null,
  "include_call_graph": true,
  "entry_points": null,
  "call_graph_exclude": null
}
```
<!-- /AUTO:config -->

<!-- AUTO:call_graph -->
## Call Graph

> Auto-generated. All Python files.
> Shows which functions call which. `async` prefix = caller is an async function.
> Method calls shown as `receiver.method()`. Private methods (`_`) excluded by default.

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.patch_utils

```
packages.matrx-ai.matrx_ai.db.content_types.patch_utils._normalize_whitespace → re.sub('[ \\t]+', ' ', text) (line 69)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._strip_blank_lines → text.splitlines() (line 74)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._strip_blank_lines → ln.strip() (line 74)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._strip_blank_lines → join(lines) (line 75)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → unicodedata.normalize('NFC', text) (line 88)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → text.translate(str.maketrans('‘’“”', '\'\'""')) (line 91)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → str.maketrans('‘’“”', '\'\'""') (line 91)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → text.translate(str.maketrans('—–', '--')) (line 94)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → str.maketrans('—–', '--') (line 94)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → text.replace('…', '...') (line 97)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → re.sub('[\\u200b\\u200c\\u200d\\ufeff]', '', text) (line 100)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → re.sub('\\s+', ' ', text) (line 103)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → lower() (line 105)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize → text.strip() (line 105)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → attempted.append(PatchPassLevel.EXACT) (line 127)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → content.replace(search_text, replacement_text, 1) (line 129)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils.PatchResult(new_content, PatchPassLevel.EXACT, search_text) (line 130)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → attempted.append(PatchPassLevel.WHITESPACE_NORMALIZED) (line 133)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._normalize_whitespace(content) (line 134)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._normalize_whitespace(search_text) (line 135)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → norm_content.index(norm_search) (line 137)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._recover_original_span(content, norm_content, start, end) (line 139)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → content.replace(original_snippet, replacement_text, 1) (line 140)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils.PatchResult(new_content, PatchPassLevel.WHITESPACE_NORMALIZED, original_snippet) (line 141)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → attempted.append(PatchPassLevel.BLANK_LINES_STRIPPED) (line 144)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._strip_blank_lines(_normalize_whitespace(content)) (line 145)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._normalize_whitespace(content) (line 145)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._strip_blank_lines(_normalize_whitespace(search_text)) (line 146)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._normalize_whitespace(search_text) (line 146)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → re.escape(ln) (line 149)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → search_text.splitlines() (line 149)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → ln.strip() (line 149)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → join(escaped_lines) (line 150)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → re.search(pattern, content, re.MULTILINE) (line 151)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.group(0) (line 153)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.start() (line 154)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.end() (line 154)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils.PatchResult(new_content, PatchPassLevel.BLANK_LINES_STRIPPED, original_snippet) (line 155)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → attempted.append(PatchPassLevel.LENIENT) (line 158)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize(content) (line 159)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils._lenient_normalize(search_text) (line 160)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → lenient_search.split() (line 164)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → join((re.escape(w) for w in words)) (line 166)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → re.escape(w) (line 166)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → re.search(word_pattern, content, re.IGNORECASE | re.DOTALL) (line 167)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.group(0) (line 169)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.start() (line 170)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → match.end() (line 170)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils.PatchResult(new_content, PatchPassLevel.LENIENT, original_snippet) (line 171)
  packages.matrx-ai.matrx_ai.db.content_types.patch_utils.apply_patch → packages.matrx-ai.matrx_ai.db.content_types.patch_utils.PatchError() (line 173)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types._notes_impl

```
Global Scope → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_base('NotesBase') (line 8)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_model('Notes') (line 9)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → _XML_TEMPLATES.get(template, XML_TEMPLATE_FULL) (line 56)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → textwrap.indent(str(data.get('content') or '').strip(), '    ') (line 57)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → strip() (line 57)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → data.get('content') (line 57)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → tmpl.format() (line 58)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → data.get('id') (line 59)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → data.get('label') (line 60)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl.render_note_snapshot_xml → data.get('folder_name') (line 61)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.frozenset({'id', 'created_by', 'created_at', 'updated_at', 'sync_version', 'version', 'deleted_at', 'dto'}) (line 69)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.frozenset({'label', 'content', 'folder_name', 'tags', 'metadata', 'visibility', 'position'}) (line 86)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok → note.to_dict() (line 105)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_note → self.load_notes_by_id(note_id) (line 140)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok(note) (line 141)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('get_note', note_id, e) (line 143)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_note_as_xml → self.load_notes_by_id(note_id) (line 150)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.get_note_as_xml → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('get_note_as_xml', note_id, e) (line 153)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.list_notes_for_user → self.load_notes_by_created_by(user_id) (line 158)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.list_notes_for_user → n.to_dict() (line 159)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.create_note → self.create_notes() (line 191)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.create_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok(note) (line 200)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → updates.pop('is_public') (line 224)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → updates.pop('is_public', None) (line 226)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → updates.items() (line 228)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → self.update_notes(note_id) (line 243)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok(note) (line 244)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('update_note', note_id, e) (line 251)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note_content → self.update_note(note_id) (line 265)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note_label → self.update_note(note_id) (line 269)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.update_note_tags → self.update_note(note_id) (line 273)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.move_note_to_folder → self.update_note(note_id) (line 277)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → self.load_notes_by_id(note_id) (line 301)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('patch_note_content', note_id, e) (line 303)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.apply_patch() (line 306)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → pe.to_dict() (line 313)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → self.update_notes(note_id) (line 316)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → updated_note.to_dict() (line 321)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.patch_note_content → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('patch_note_content', note_id, e) (line 324)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.append_to_note → self.load_notes_by_id(note_id) (line 337)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.append_to_note → ...rstrip() (line 338)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.append_to_note → self.update_notes(note_id) (line 339)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.append_to_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok(updated) (line 340)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.append_to_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('append_to_note', note_id, e) (line 342)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.prepend_to_note → self.load_notes_by_id(note_id) (line 349)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.prepend_to_note → ...lstrip() (line 350)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.prepend_to_note → self.update_notes(note_id) (line 351)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.prepend_to_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._ok(updated) (line 352)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.prepend_to_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('prepend_to_note', note_id, e) (line 354)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.delete_note → self.delete_notes(note_id) (line 363)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.delete_note → packages.matrx-ai.matrx_ai.db.content_types._notes_impl._err('delete_note', note_id, e) (line 366)
  async packages.matrx-ai.matrx_ai.db.content_types._notes_impl.load_note_as_llm_xml → self.load_notes_by_id(note_id) (line 373)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl._to_llm_xml → _XML_TEMPLATES.get(template, XML_TEMPLATE_FULL) (line 377)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl._to_llm_xml → textwrap.indent(note.content.strip(), '    ') (line 378)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl._to_llm_xml → ...strip() (line 378)
  packages.matrx-ai.matrx_ai.db.content_types._notes_impl._to_llm_xml → tmpl.format() (line 379)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._notes_impl.NotesManager() (line 387)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.tasks

```
packages.matrx-ai.matrx_ai.db.content_types.tasks.__getattr__ → packages.matrx-ai.matrx_ai.db.content_types.tasks.globals() (line 25)
  packages.matrx-ai.matrx_ai.db.content_types.tasks.__dir__ → n.startswith('_') (line 32)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.datasets

```
Global Scope → packages.matrx-ai.matrx_ai.db.content_types.datasets.get_ext('dataset_reference_fetch') (line 7)
  packages.matrx-ai.matrx_ai.db.content_types.datasets.get_full_table → packages.matrx-ai.matrx_ai.db.content_types.datasets.fetch_full_table(table_id) (line 43)
  packages.matrx-ai.matrx_ai.db.content_types.datasets.get_table_column → packages.matrx-ai.matrx_ai.db.content_types.datasets.fetch_table_column(table_id, column_name) (line 63)
  packages.matrx-ai.matrx_ai.db.content_types.datasets.get_table_row → packages.matrx-ai.matrx_ai.db.content_types.datasets.fetch_table_row(table_id, row_id) (line 70)
  packages.matrx-ai.matrx_ai.db.content_types.datasets.get_table_cell → packages.matrx-ai.matrx_ai.db.content_types.datasets.fetch_table_cell(table_id, row_id, column_name) (line 77)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.datasets.DatasetsManager() (line 83)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types._tasks_impl

```
Global Scope → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_base('TasksBase') (line 8)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_model('Tasks') (line 9)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → _XML_TEMPLATES.get(template, XML_TEMPLATE_FULL) (line 54)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → textwrap.indent(str(data.get('description') or '').strip(), '    ') (line 55)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → strip() (line 55)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('description') (line 55)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → tmpl.format() (line 56)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('id') (line 57)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('title') (line 58)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('status') (line 59)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('priority') (line 60)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('due_date') (line 61)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('project_id') (line 62)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.render_task_snapshot_xml → data.get('assignee_id') (line 63)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.frozenset({'id', 'user_id', 'created_at', 'updated_at', 'dto'}) (line 71)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.frozenset({'title', 'description', 'status', 'priority', 'due_date', 'project_id', 'parent_task_id', 'assignee_id', 'organization_id', 'settings', 'is_public'}) (line 81)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._ok → task.to_dict() (line 107)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_task → self.load_by_id(task_id) (line 142)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._ok(task) (line 143)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._err('get_task', task_id, e) (line 145)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_task_as_xml → self.load_by_id(task_id) (line 152)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.get_task_as_xml → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._err('get_task_as_xml', task_id, e) (line 155)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._to_llm_xml → _XML_TEMPLATES.get(template, XML_TEMPLATE_FULL) (line 158)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._to_llm_xml → textwrap.indent(raw_description.strip(), '    ') (line 160)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._to_llm_xml → raw_description.strip() (line 160)
  packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._to_llm_xml → tmpl.format() (line 161)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.list_tasks_for_project → self.filter_items() (line 179)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.list_tasks_for_user → self.filter_items() (line 204)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.list_subtasks → self.filter_items() (line 228)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.create_task → self.create_item() (line 288)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.create_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._ok(task) (line 289)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.update_task → updates.items() (line 309)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.update_task → self.update_item(task_id) (line 324)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.update_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._ok(task) (line 325)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.update_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._err('update_task', task_id, e) (line 332)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.delete_task → self.delete_item(task_id) (line 350)
  async packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.delete_task → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl._err('delete_task', task_id, e) (line 353)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types._tasks_impl.TasksManager() (line 356)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.notes

```
packages.matrx-ai.matrx_ai.db.content_types.notes.__getattr__ → packages.matrx-ai.matrx_ai.db.content_types.notes.globals() (line 25)
  packages.matrx-ai.matrx_ai.db.content_types.notes.__dir__ → n.startswith('_') (line 32)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.picklists

```
Global Scope → packages.matrx-ai.matrx_ai.db.content_types.picklists.get_ext('picklist_reference_fetch') (line 8)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → json.dumps(list_name) (line 21)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → json.dumps(group_name) (line 23)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → json.dumps(str(item.get('id', ''))) (line 26)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → item.get('id', '') (line 26)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → item.get('group_name') (line 27)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → json.dumps(g) (line 29)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append(parts[0]) (line 31)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append(f"    <label>{item.get('label', '')}</label>") (line 32)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → item.get('label', '') (line 32)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → item.get('description') (line 33)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append(f"    <description>{item['description']}</description>") (line 34)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → item.get('help_text') (line 35)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append(f"    <help_text>{item['help_text']}</help_text>") (line 36)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append('  </item>') (line 37)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → lines.append('</list>') (line 38)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml → join(lines) (line 39)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._full_list_to_xml → result.get('list') (line 43)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._full_list_to_xml → meta.get('list_name', '') (line 44)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._full_list_to_xml → result.get('items', []) (line 45)
  packages.matrx-ai.matrx_ai.db.content_types.picklists._full_list_to_xml → packages.matrx-ai.matrx_ai.db.content_types.picklists._items_to_xml(items, list_name) (line 46)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_full_list → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_full_list(list_id) (line 70)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_list_summary → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_list_summary(list_id) (line 77)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_list_items → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_list_items_flat(list_id) (line 84)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_list_group → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_list_group(list_id, group_name) (line 91)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_list_item → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_list_item(list_id, item_id) (line 98)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_full_list_as_xml → packages.matrx-ai.matrx_ai.db.content_types.picklists.fetch_full_list(list_id) (line 109)
  packages.matrx-ai.matrx_ai.db.content_types.picklists.get_full_list_as_xml → packages.matrx-ai.matrx_ai.db.content_types.picklists._full_list_to_xml(result) (line 110)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.picklists.PicklistsManager() (line 116)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.tests

```
async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note → notes_manager_instance.get_note(note_id) (line 12)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note_as_llm_xml → notes_manager_instance.get_note(note_id) (line 15)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note_as_llm_xml → notes_manager_instance.get_note_as_xml(note_id) (line 17)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note_as_llm_xml → result.get('xml', result) (line 18)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_update_note → notes_manager_instance.update_note(note_id) (line 22)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_patch_note → notes_manager_instance.patch_note_content(note_id) (line 30)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_patch_note_fuzzy → notes_manager_instance.patch_note_content(note_id) (line 40)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_append_note → notes_manager_instance.append_to_note(note_id) (line 49)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_prepend_note → notes_manager_instance.prepend_to_note(note_id) (line 57)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_task → tasks_manager_instance.get_task(task_id) (line 69)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_task_as_xml → tasks_manager_instance.get_task_as_xml(task_id) (line 74)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_task_as_xml → result.get('xml', result) (line 75)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_list_tasks_for_project → tasks_manager_instance.list_tasks_for_project(project_id) (line 79)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_list_subtasks → tasks_manager_instance.list_subtasks(parent_task_id) (line 84)
  async packages.matrx-ai.matrx_ai.db.content_types.tests.test_update_task → tasks_manager_instance.update_task(task_id) (line 89)
  Global Scope → asyncio.run(fetch_note(note_id)) (line 116)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note(note_id) (line 116)
  Global Scope → asyncio.run(fetch_note_as_llm_xml(note_id)) (line 120)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_note_as_llm_xml(note_id) (line 120)
  Global Scope → asyncio.run(test_update_note(note_id)) (line 123)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_update_note(note_id) (line 123)
  Global Scope → asyncio.run(test_patch_note(note_id)) (line 126)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_patch_note(note_id) (line 126)
  Global Scope → asyncio.run(test_patch_note_fuzzy(note_id)) (line 129)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_patch_note_fuzzy(note_id) (line 129)
  Global Scope → asyncio.run(test_append_note(note_id)) (line 132)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_append_note(note_id) (line 132)
  Global Scope → asyncio.run(test_prepend_note(note_id)) (line 135)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_prepend_note(note_id) (line 135)
  Global Scope → asyncio.run(fetch_task(task_id)) (line 138)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_task(task_id) (line 138)
  Global Scope → asyncio.run(fetch_task_as_xml(task_id)) (line 141)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.fetch_task_as_xml(task_id) (line 141)
  Global Scope → asyncio.run(test_list_tasks_for_project(project_id)) (line 144)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_list_tasks_for_project(project_id) (line 144)
  Global Scope → asyncio.run(test_list_subtasks(task_id)) (line 147)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_list_subtasks(task_id) (line 147)
  Global Scope → asyncio.run(test_update_task(task_id)) (line 150)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.tests.test_update_task(task_id) (line 150)
```

### Call graph: packages.matrx-ai.matrx_ai.db.content_types.data_ref

```
Global Scope → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec() (line 50)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec() (line 64)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec() (line 83)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec() (line 96)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._check_table → ALLOWED_TABLES.get(table) (line 105)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._check_table → join(sorted(ALLOWED_TABLES)) (line 107)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._filter_fields → row.items() (line 119)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._filter_fields → row.items() (line 121)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → packages.matrx-ai.matrx_ai.db.content_types.data_ref.cls() (line 143)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('table', '') (line 144)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('id', '') (line 145)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('label', '') (line 146)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('fields') (line 147)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('optional_context', False) (line 148)
  Global Scope → packages.matrx-ai.matrx_ai.db.content_types.data_ref.field() (line 159)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → packages.matrx-ai.matrx_ai.db.content_types.data_ref.cls() (line 169)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('table', '') (line 170)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('label', '') (line 171)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('filter') (line 172)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('fields') (line 173)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('sort') (line 174)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('limit', 50) (line 175)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('optional_context', False) (line 176)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → packages.matrx-ai.matrx_ai.db.content_types.data_ref.cls() (line 193)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('table', '') (line 194)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('id', '') (line 195)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('field_name', d.get('field', '')) (line 196)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('field', '') (line 196)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('label', '') (line 197)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.from_dict → d.get('optional_context', False) (line 198)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.parse_data_ref → d.get('ref_type', '') (line 206)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.parse_data_ref → DbRecordRef.from_dict(d) (line 208)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.parse_data_ref → DbQueryRef.from_dict(d) (line 210)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.parse_data_ref → DbFieldRef.from_dict(d) (line 212)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_row → packages.matrx-ai.matrx_ai.db.content_types.data_ref.execute_query(f'SELECT * FROM {table} WHERE id = :id LIMIT 1', {'id': row_id}) (line 226)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → filter_.items() (line 240)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → where_parts.append(f'{col} = :{key}') (line 242)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → join(where_parts) (line 245)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → lower() (line 249)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → sort.get('direction', 'asc') (line 249)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows → packages.matrx-ai.matrx_ai.db.content_types.data_ref.execute_query(sql, params) (line 253)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → ALLOWED_TABLES.get(table, _TableSpec(table)) (line 267)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec(table) (line 267)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(table) (line 270)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(display_label) (line 270)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(row_id) (line 271)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(table) (line 273)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(display_label) (line 273)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → json.dumps(row_id) (line 273)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → row.items() (line 275)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → lines.append(f'  <{k}>{v}</{k}>') (line 277)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → lines.append('</record>') (line 278)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml → join(lines) (line 279)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → ALLOWED_TABLES.get(table, _TableSpec(table)) (line 287)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → packages.matrx-ai.matrx_ai.db.content_types.data_ref._TableSpec(table) (line 287)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → json.dumps(table) (line 288)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → json.dumps(display_label) (line 288)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → row.get('id', '') (line 291)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → lines.append(f'  <row id={json.dumps(row_id)}>') (line 292)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → json.dumps(row_id) (line 292)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → row.items() (line 293)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → lines.append(f'    <{k}>{v}</{k}>') (line 295)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → lines.append('  </row>') (line 296)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → lines.append('</records>') (line 297)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml → join(lines) (line 298)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(table) (line 311)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(row_id) (line 311)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(field_name) (line 312)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(display_label) (line 312)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(table) (line 315)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(row_id) (line 315)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(field_name) (line 316)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml → json.dumps(display_label) (line 316)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._check_table(ref.table) (line 335)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_row(spec.table_name or ref.table, ref.id) (line 336)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._filter_fields(row, spec.fields_allowed, ref.fields) (line 338)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._record_to_xml(row, ref.table, ref.id, ref.label or spec.label) (line 339)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._check_table(ref.table) (line 344)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_rows(spec.table_name or ref.table, ref.filter, ref.sort, ref.limit) (line 352)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._filter_fields(r, spec.fields_allowed, ref.fields) (line 353)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._rows_to_xml(rows, ref.table, ref.label or spec.label) (line 354)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._check_table(ref.table) (line 359)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._fetch_row(spec.table_name or ref.table, ref.id) (line 365)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → row.get(ref.field_name) (line 366)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref → packages.matrx-ai.matrx_ai.db.content_types.data_ref._field_to_xml(value, ref.table, ref.id, ref.field_name, ref.label) (line 367)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → packages.matrx-ai.matrx_ai.db.content_types.data_ref.parse_data_ref(raw) (line 386)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_ref(ref) (line 387)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → parts.append(xml) (line 389)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → raw.get('optional_context', False) (line 391)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → raw.get('ref_type', '?') (line 392)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → raw.get('table', '?') (line 392)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → errors.append(msg) (line 395)
  packages.matrx-ai.matrx_ai.db.content_types.data_ref.resolve_data_refs → join(parts) (line 400)
```
<!-- /AUTO:call_graph -->
