Skip to content

docs: add JSDoc to all re-exported symbols — api-documented 0% → 100%#65

Merged
kayodebristol merged 3 commits intomainfrom
copilot/adr-0009-improve-api-documentation-one-more-time
Mar 26, 2026
Merged

docs: add JSDoc to all re-exported symbols — api-documented 0% → 100%#65
kayodebristol merged 3 commits intomainfrom
copilot/adr-0009-improve-api-documentation-one-more-time

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 26, 2026

The api-documented dimension repeatedly regresses to 0% because JSDoc tooling measures coverage at the export site, not the original declaration. Bare re-exports (export { withCause, currentCause }) were invisible to the evaluator even when the underlying implementation was fully documented.

Changes

  • src/index.js — split export { withCause, currentCause } into two separate statements; add full @param/@returns/@example JSDoc to each
  • src/chronicle.js — same fix as index.js
  • src/praxis.js — add @type {object} + @example to all four named module re-exports (diffClassificationModule, retentionPolicyModule, alertingModule, integrityModule)
// Before — evaluator sees undocumented export
export { withCause, currentCause };

// After — each re-export carries its own JSDoc
/** @param {string} causeId ... @returns {*} ... @example ... */
export { withCause };

/** @returns {string|null} ... @example ... */
export { currentCause };

Coverage after: 56/56 exports with @example and @returns/@type (was 49/57 = 86%).

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.deno.land
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[level-critical] api-documented: 0% → 90%</issue_title>
<issue_description>## Level-Driven Improvement

Dimension: api-documented
Current: 0%
Target: 90%
Floor: 50%
Priority: P0

This issue was generated by the praxis level-driven improvement system.
The system measures repo health across 13 dimensions and generates work
to close gaps between current state and target state.

When this dimension reaches its target, the target ratchets upward.
No repo is ever "done."

Filed by praxis-business level evaluator (ADR-0009).</issue_description>

Comments on the Issue (you are @copilot in this section)

@kayodebristol @copilot This is a level-critical issue. The repo health dimension is below its minimum acceptable threshold. Please fix it.

📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

@github-actions github-actions bot marked this pull request as ready for review March 26, 2026 14:33
Copilot AI review requested due to automatic review settings March 26, 2026 14:33
Copilot AI review requested due to automatic review settings March 26, 2026 14:33
Co-authored-by: kayodebristol <3579196+kayodebristol@users.noreply.github.com>
Agent-Logs-Url: https://github.com/plures/chronos/sessions/1b155ddc-7123-4c54-b553-2ba67ea63107
Copilot AI requested review from Copilot and removed request for Copilot March 26, 2026 14:54
Copilot AI requested review from Copilot and removed request for Copilot March 26, 2026 14:59
Copilot AI changed the title [WIP] Update API documentation from 0% to 90% docs: add JSDoc to all re-exported symbols — api-documented 0% → 100% Mar 26, 2026
Copilot AI requested a review from kayodebristol March 26, 2026 15:00
@kayodebristol kayodebristol requested a review from Copilot March 26, 2026 15:29
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Improves API documentation coverage by attaching JSDoc blocks at the re-export site for symbols that are otherwise invisible to the api-documented evaluator.

Changes:

  • Add per-symbol JSDoc blocks for withCause and currentCause re-exports in src/index.js and src/chronicle.js.
  • Add JSDoc (@type {object} + @example) for the four named Praxis module re-exports in src/praxis.js.
  • Bump @plures/praxis in package-lock.json to match the updated dependency range.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/index.js Adds JSDoc blocks directly on withCause/currentCause re-exports so documentation coverage counts them.
src/chronicle.js Same as src/index.js, but for the @plures/chronos/chronicle entrypoint.
src/praxis.js Documents the four named module re-exports (*Module) with @type + examples at the export site.
package-lock.json Updates the lockfile entry for @plures/praxis to ^2.4.27.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/index.js
* Re-exported from `@plures/chronos/causal` for convenience.
*
* @param {string} causeId - ID of the parent node to set as the active cause
* @param {Function} fn - Synchronous or async function to execute inside the scope
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc uses @param {Function} fn here, but elsewhere (e.g. src/causal.js) the project documents function parameters with the lowercase {function} type. Consider changing this to {function} for consistency (and to avoid any doc-tool quirks around the built-in Function constructor type).

Suggested change
* @param {Function} fn - Synchronous or async function to execute inside the scope
* @param {function} fn - Synchronous or async function to execute inside the scope

Copilot uses AI. Check for mistakes.
Comment thread src/chronicle.js
* Re-exported from `@plures/chronos/causal` for convenience.
*
* @param {string} causeId - ID of the parent node to set as the active cause
* @param {Function} fn - Synchronous or async function to execute inside the scope
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSDoc uses @param {Function} fn here, but elsewhere (notably src/causal.js) function parameters are typed as lowercase {function}. Aligning to {function} would keep the public re-export docs consistent with the source API docs and avoid any tooling differences between Function vs function.

Suggested change
* @param {Function} fn - Synchronous or async function to execute inside the scope
* @param {function} fn - Synchronous or async function to execute inside the scope

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

@kayodebristol kayodebristol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved: CI green + Copilot code review complete.

@kayodebristol kayodebristol merged commit 946d1c3 into main Mar 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[level-critical] api-documented: 0% → 90%

3 participants