Advanced Usage
How Agents Should Read ODS Workspaces
- Start at the root
index.md. - Descend through child indexes toward the target document.
- Read the target frontmatter first.
- Load
dependstransitively up tocontext.max-depth(default 2). - Load
context.loadentries: Document.mdpaths first, then Resource paths. - Skip paths matching
context.ignoreand workspaceignore:. - Prefer
stableoverdraft, anddraftoverdeprecatedorarchived.
That gives agents a deterministic path instead of a broad scan.
Use the CLI to debug the resolution:
ods context path/to/doc.md
Global Multi-Workspace Tracking (ods workspaces)
ODS background daemons (ods serve) monitor multiple repositories registered in the user’s global machine configuration file (~/.ods/odsconfig.toml):
# Register a workspace for background tracking
ods workspaces add /path/to/my-project
# List all tracked workspaces and pack entries
ods workspaces list
# Remove a workspace from tracking
ods workspaces remove /path/to/my-project
# Print machine config file path (~/.ods/odsconfig.toml)
ods workspaces path
Daemon Execution Modes & Memory Tuning (ods serve)
ods serve supports three execution modes for handling filesystem updates across workspaces:
auto(default): Automatically selectswatchmode, unlessODS_LOW_MEMORY=1is set in the environment, in which case it usespollmode.watch: Real-time OS event watcher (fsnotify/kqueue/inotify) for immediate rename mapping and index regeneration.poll: Periodic polling interval (default 10s). Drops temporary workspace state between ticks for maximum RAM savings in low-memory containerized environments.
# Low-memory polling configuration with RSS memory diagnostics
ODS_LOW_MEMORY=1 ODS_POLL_SECS=30 ods serve --mode poll --memory-report --root .
Large Workspaces
Guidance for tens of thousands of Markdown files:
- Keep profiles small; put custom catalogs in
ods-profiles/or listedprofiles:roots. - Prefer path-derived IDs; pin explicit
id:only when renames must not break external refs. - Run
ods index --checkandods lintin CI rather than trusting hand-edited maps. - Use
--level 1while onboarding noisy trees; enable body-link and graph checks at Level 3 when ready. - Tooling skips
node_modules,target, and similar trees by default and may honor.gitignore. - Exclude implementation trees with root
ignore:(for examplesrc).