-
Notifications
You must be signed in to change notification settings - Fork 0
Add JSDoc comments to core library functions #16
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationdxDeveloper experienceDeveloper experiencegood first issueGood for newcomersGood for newcomers
Description
Problem
Core files in lib/opentrust/ lack documentation comments. This makes it harder to:
- Understand function contracts without reading the implementation
- Get useful IntelliSense/hover info in editors
- Onboard new contributors
Scope
Add JSDoc comments to all exported functions in:
-
lib/opentrust/db.ts— connection management, query helpers -
lib/opentrust/memory-api.ts— search, inspect, promote operations -
lib/opentrust/memory-entries.ts— CRUD operations and versioning -
lib/opentrust/auth.ts— auth config, verification, credential checking -
lib/opentrust/api-contract.ts— request parsing and response helpers -
lib/opentrust/semantic.ts— embedding and chunking -
lib/opentrust/import-openclaw.ts— session ingestion -
lib/opentrust/import-cron.ts— cron workflow ingestion -
lib/opentrust/ingestion-state.ts— cursor state management -
lib/opentrust/search.ts— FTS search -
lib/types.ts— shared TypeScript interfaces
JSDoc Format
/**
* Searches memory entries using full-text and optional semantic search.
*
* @param query - The search query string (supports FTS5 syntax)
* @param options - Optional filters: status, retention class, date range
* @returns Paginated list of matching memory entries with relevance scores
* @throws {DatabaseError} If the search query is malformed
*
* @example
* const results = await memorySearch("authentication flow", { status: "approved" });
*/Acceptance Criteria
- All exported functions have JSDoc with description,
@param, and@returns - Complex functions include
@exampleusage - Functions that throw include
@throws -
pnpm typecheckstill passes
🤖 Generated with Claude Code
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationdxDeveloper experienceDeveloper experiencegood first issueGood for newcomersGood for newcomers