src/extractors
Module summary
Module src/extractors
Exports
| Name | Kind | Default |
|---|---|---|
CURSOR_REGEX | variable | no |
ISSUES_QUERY | variable | no |
ISSUE_COMMENTS_QUERY | variable | no |
_formatJsDoc | function | no |
classifyCommit | function | no |
extractAst | function | no |
extractAstAndJsDoc | function | no |
extractChangelog | function | no |
extractConfigComments | function | no |
extractIssues | function | no |
extractJsDoc | function | no |
extractReadmes | function | no |
notifyParseFailure | function | no |
parseSource | function | no |
readCursor | function | no |
validatePath | function | no |
writeCursor | function | no |
Detail
CURSOR_REGEX
CURSOR_REGEXParams
None.
Returns
None.
Examples
None.
ISSUES_QUERY
ISSUES_QUERYParams
None.
Returns
None.
Examples
None.
ISSUE_COMMENTS_QUERY
ISSUE_COMMENTS_QUERYParams
None.
Returns
None.
Examples
None.
_formatJsDoc
_formatJsDoc(parsed): objectParams
parsed
Returns
object
Examples
None.
classifyCommit
classifyCommit(subject)Pure: classify a single conventional-commit subject line.
Params
subject
Returns
None.
Examples
None.
extractAst
extractAst({ path, source })Params
{ path, source }
Returns
None.
Examples
None.
extractAstAndJsDoc
extractAstAndJsDoc({ path, source }): objectParams
{ path, source }
Returns
object
Examples
None.
extractChangelog
async extractChangelog({ since = '30.days.ago', repoDir = process.cwd() }): Promise<unknown>Run git log --since=<since> in repoDir and return classified commits.
Params
{ since = '30.days.ago', repoDir = process.cwd() } = {}
Returns
Promise<unknown>
Examples
None.
extractConfigComments
async extractConfigComments(rootDir): Promise<object>Extract inline-comment annotations from project config files.
Looked-up files (best-effort — missing files yield empty maps):
vitest.config.ts(or.js,.mts,.cts) — top-level keys inside thetest: { ... }block.package.json+ siblingpackage.scripts.md— comment for each entry inscripts..env.example— comment for eachKEY=...line.
Params
rootDir = process.cwd()
Returns
Promise<object>
Examples
None.
extractIssues
async extractIssues({ owner, repo, client, cursorPath = DEFAULT_CURSOR_PATH, pageSize = DEFAULT_PAGE_SIZE, maxPages = DEFAULT_MAX_PAGES, reset = false, now = () => new Date(),}): Promise<object>Paginated GraphQL extractor for issues. See file header for cursor invariants.
Cursor-invalidation fallback (must_fix_in_build): when the pagination loop is
resuming mid-run (pageCursor !== null) and the GraphQL call throws an error
matched by isCursorError (explicit “cursor” mention, or pagination-argument
error referencing “after”/“before” with “invalid”), the loop resets
pageCursor to null, restores sinceForRun to the original
cursor.last_updated_at, and retries the call once. On retry success, it
immediately persists a cleared end_cursor (writeCursor with end_cursor: null) so the stale cursor on disk cannot re-trigger the fallback on the
next run. If the retry also throws, the error propagates. Non-cursor errors
(auth, scope, rate-limit) bypass the retry and propagate immediately.
Per-issue comment pagination (#1391): each matched issue’s comments
connection is walked via ISSUE_COMMENTS_QUERY until pageInfo.hasNextPage
is false or MAX_COMMENTS_PAGES_PER_ISSUE is hit. Issues with <= 100
comments take the single-fetch path (no extra GraphQL calls). The
commentsTruncated stat is true if ANY issue hit the per-issue page cap.
Params
{ owner, repo, client, cursorPath = DEFAULT_CURSOR_PATH, pageSize = DEFAULT_PAGE_SIZE, maxPages = DEFAULT_MAX_PAGES, reset = false, now = () => new Date(), }
Returns
Promise<object>
Examples
None.
extractJsDoc
extractJsDoc({ path, source })Params
{ path, source }
Returns
None.
Examples
None.
extractReadmes
async extractReadmes(rootDir, opts): Promise<unknown>Walk rootDir and collect every README.md in any subdirectory.
Params
rootDiropts = {}
Returns
Promise<unknown>
Examples
None.
notifyParseFailure
notifyParseFailure({ path, message }): voidParams
{ path, message }
Returns
void
Examples
None.
parseSource
parseSource({ path, source }): objectParams
{ path, source }
Returns
object
Examples
None.
readCursor
readCursor(filePath): objectRead the cursor file. Returns safe defaults on any failure path.
Validation rules:
- Missing file, unreadable file, malformed JSON → defaults.
last_updated_at: must be a string, must parse viaDate.parse, and must not be in the future. On any failure → coerce tonulland warn.end_cursor: must matchCURSOR_REGEX. On failure → coerce tonull.
Params
filePath
Returns
object
Examples
None.
validatePath
validatePath(rawPath, root, kind)Validate that rawPath resolves to a location inside root. On any
failure, write a generic error to stderr and call process.exit(2).
Params
rawPathrootkind
Returns
None.
Examples
None.
writeCursor
writeCursor(filePath, cursor): voidAtomically persist the cursor. Always overwrites updated_at with the
current ISO timestamp. Creates the parent directory if missing.
Params
filePathcursor
Returns
void
Examples
None.