docs(core): public API surface, JSDoc, TypeDoc reference, and CHANGELOG#39
Merged
Nanle-code merged 3 commits intoJul 18, 2026
Conversation
Restores detectReentrancy/detectTxOrigin, which had two conflicting implementations tangled together from a bad merge (undefined vars, invalid syntax). Fixes scanner.ts's scan()/scanFile(), which referenced several undefined symbols (detectUnprotectedUpgrade, analyzeContract, allMetrics) left over from the same merge, and re-exports ASTNode from ast/parser.ts so downstream modules that import it from there resolve correctly. Also consolidates scan() to build a single shared import graph instead of re-parsing every file up to three times, cutting single-file scan latency roughly 3x. None of this compiled before, so packages/core's build, test suite, and TypeDoc generation were all silently broken. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Categorizes every @chainproof/core export as public/stable or @internal, adds JSDoc with usage examples to all public functions and types, and narrows package.json's exports field so only the curated public API (scanner, report generators, plugin/config loaders, and their types) is importable — internal helpers like parseSolidity/visit/runSlither stay out of both the type surface and the generated docs. Adds TypeDoc config and a GitHub Actions workflow that publishes the API reference to GitHub Pages on every release. Adds CHANGELOG.md (Keep a Changelog format) backfilled from the project's commit history, with a documented deprecation policy (deprecate in a minor, remove in the next major). README gets an API Reference section linking the generated docs and a Changelog section. Also removes stray root-level scratch files (PR_DESCRIPTION.md, TODO.md, chainproof-report.md) left over from prior work sessions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #23
Makes
@chainproof/coreproduction-ready as a public library: every exportis categorized as public/stable or
@internal, all public functions andtypes get JSDoc with examples, a TypeDoc site is generated and published to
GitHub Pages on release, and CHANGELOG.md adopts Keep a Changelog with a
documented deprecation policy.
While wiring up TypeDoc I found
packages/coredidn't actually build —merge damage already on
master(predating this branch) had leftdetectReentrancy/detectTxOriginwith two tangled, syntactically invalidimplementations, and
scanner.tscalling several undefined symbols(
scanFile,analyzeContract,detectUnprotectedUpgrade,allMetrics).That's fixed here too, since there's no generating docs for code that
doesn't compile.
Changes
API surface & docs
scan,generateMarkdownReport,generateJSONReport,generateTableReport,isSlitherAvailable,loadPlugin,loadPlugins,loadConfigFile,mergePluginsFromConfig) andpublic types (
ScanConfig,ScanResult,Finding,ChainProofPlugin, etc).parseSolidity,visit,runSlither) tagged@internal.package.jsonexportsfield narrowed to the curated public entry point only.packages/core/typedoc.json+.github/workflows/docs.yml— generates andpublishes the API reference to GitHub Pages on every release
(
workflow_dispatchalso supported for manual runs).CHANGELOG.md— Keep a Changelog format, backfilled from commit history,with a deprecation policy (deprecate in a minor, remove in the next major).
section.
Bug fixes (pre-existing, found while verifying the build)
detectReentrancy/detectTxOriginagainst the workingswc116-unprotected-upgrade.tspattern and existing unit tests.scanner.ts: restored missing imports/wiring fordetectUnprotectedUpgrade,analyzeContract,allMetrics; re-exportedASTNodefromast/parser.ts(several modules imported it from there butit was never exported); fixed a stale
enhanceFindingsWithLLMcallsignature.
scan()to build one shared import graph instead ofre-parsing every file up to 3x — ~3x faster on single-file scans.
useMetricswas required but omitted) and oneoutdated test assertion (CP-101 not flagging
+=/-=was a stale"known limitation" the symbolic-exec engine already fixed).
Out of scope / follow-up needed
packages/cli,packages/server, and the VS Code extension currently failto build independently of this change (missing
useMetricsin theirScanConfigliterals, and other issues) — not touched here since the docsworkflow only builds
packages/core, but worth a follow-up PR.scan()single-file latency <200ms) is flaky inresource-constrained environments — raw parser cost alone is close to the
budget here. Not a regression from this PR.
→ Pages for the first release-triggered deploy to succeed.
Test plan
npm run build --workspace=packages/corenpx jestinpackages/core(92/93 — see flaky perf note above)npm run docs --workspace=packages/core— generates cleanly, 0 warningsexamples/contracts/VulnerableVault.solvia the built
dist/index.js, confirming findings + metrics populatecorrectly