v2.2.1
DeepDoc 2.2.1 is a bug-fix release addressing 22 scanner, planner, and generator correctness issues identified by audit, plus adversarial-review remediations.
Bug Fixes
Scanner
- Import lookup:
__init__.pyparent-path indexing sofrom pkg.sub import Xresolves topkg/sub/__init__.py. - Endpoint ownership: endpoint handler now uses
endpoint_owned_files()coveringhandler_file,route_file, andfile— not justfile. - Database scanner: hybrid segment + filename-prefix test-file skip catches
test_*.pyoutside atests/directory. - Artifacts scanner: path-segment membership check restores CI artifact detection for
.github/workflows/and other directory-style patterns. - Runtime scanner: task-name pre-filter skips files that can't contain any task name before running expensive regex loops.
- Clustering: duplicate symbols are deduplicated by first occurrence rather than last.
- Integrations: webhook regex reverted to plain
r"webhook"(word-boundary\bblocked compound identifiers likewebhook_handler); comment-only lines are now skipped.
Planner
repo_rootthreading:plan_docsandrun_phase2_scansaccept and propagate arepo_rootparameter instead of silently defaulting toPath(".").- Topology sort: cluster sort key corrected to
(is_foundational, min_depth, -len(all_files))so foundational clusters are processed first. - Topology ID collision: duplicate cluster IDs are disambiguated with a counter suffix instead of silently overwriting.
- Bucket file list cap:
_decompose_bucketscapsowned_filesat 50 with a trailing"... and N more"note. parent_slugon split children: decomposed child buckets now carryparent_slugpointing to the parent.- Keyword merge:
_build_repo_endpoint_keywordsunion-merges new keywords into existing groups rather than overwriting.
Generator
- Proportional OpenAPI budget: first spec receives up to 4 000 chars; additional specs share the remaining budget down to a 2 000-char floor (single-spec repos recover the previous 4 000-char context).
- Ambiguous import cap: import-based dependency links skip any hint that resolves to more than 5 files to avoid noise from generic module names.
- Sitemap orphans: buckets absent from
nav_structureare now grouped bybucket.sectionwith section headers instead of being appended as a flat list. _EP_TITLE_RE: endpoint-title regex promoted to a module-level constant instead of being compiled inside the per-bucket hot path.- Artifact env context:
artifact_refsare now included when scanning env/config keys in evidence assembly. - Flow validation: bare
"sequence"removed from_flow_terms; only"sequence diagram"is accepted to prevent false positives on unrelated uses of the word.
Pipeline
- Ordering invariant restored:
save_allnow runs before_record_changelog, which runs before_build_site. Changelog entries reference pages that are guaranteed to be persisted, andwhats-changed.mdxexists when the site builder checks for it.
Other
- Added
CONTRIBUTING.mdwith local setup, testing, and release instructions. - Added
.github/workflows/deepdoc-refresh.ymlexample workflow for teams running DeepDoc as an internal docs pipeline.