v2.2.0
DeepDoc 2.2.0 is an infrastructure and planning reliability release focused on data safety, incremental update correctness, and multi-spec API support.
New Features
Persistence & Safety
- Atomic writes across all state files — every
.deepdoc/write now goes throughatomic_write_text/atomic_write_json(mkstemp → fsync → os.replace), eliminating partial-write corruption on crash or SIGKILL. - Exclusive process lock —
deepdoc_state_lockuses an fcntl file lock so concurrentgenerateorupdateruns on the same repo are detected and rejected immediately with a clear error message instead of silently overwriting each other's state.
Planning
- DocBucket semantic identity —
DocBucketgainssemantic_id,origin,confidence,evidence_anchors, andplanner_schema_versionfields.build_bucket_semantic_id()derives a deterministic, slug-stable key from endpoint family, parent slug, or owned-file fingerprint. Serialized to and from the.deepdoc/plan.jsonledger. - Targeted incremental plan merge —
SmartUpdaterreplaces its naive slug-append strategy with_merge_targeted_plan(), which matches replanned buckets against existing ones by slug then semantic ID. Matched buckets are mutated in-place (files, hints, confidence merged) and queued for regeneration only when their ownership actually changed, avoiding unnecessary regeneration of unchanged pages. - Monorepo service boundary detection —
scan_reponow runs_detect_service_boundaries(), which reads an explicitservices:list from config or auto-discovers service roots by looking forpyproject.toml,package.json,go.mod,Dockerfile, etc. one level underservices/,apps/, andpackages/. Every scanned file is tagged with its owning service inRepoScan.file_services. - Endpoint keyword map is now config-extensible —
ENDPOINT_DOMAIN_KEYWORDSmoved toplanner/common.pyand_build_repo_endpoint_keywords()applies a three-layer merge: userendpoint_groupsconfig wins, then families observed by the scanner, then the hardcoded fallback. Honoured in bothheuristics.pyandendpoint_refs.py.
Pipeline & CLI
--strict-qualityflag —deepdoc generateanddeepdoc updatenow accept--strict-quality, which readspages_failed,pages_invalid,pages_degraded, andmdx_fallback_slugsfrom the run stats and raises aClickExceptionlisting all blockers. Designed for CI pipelines that should fail-fast on degraded output.- Multi-spec OpenAPI staging —
stage_openapi_assetsnow stages all detected specs instead of stopping at the first. Each spec gets a collision-safedeepdoc-openapi-{n}-{stem}-{sha1}filename and a single combinedmanifest.jsonis written. - LLM token usage in quality report — token usage from the LLM client is captured into stats and persisted to
generation_quality.jsonafter every run. - Quality-driven staleness —
_doc_quality_requires_regenerationmarks any page whose ledger record showsis_valid: false,mdx_fallback_applied, or whose content containsstub: true/deepdoc_status: invalidas stale so it is regenerated automatically on the next incremental run without a--force. - Duplicate changelog guard —
append_changelog_entryskips writing when the incoming commit matches the most recent entry's commit, preventing duplicate entries from rapid pipeline retries on the same SHA.