# @sintesi/sintesi

## 0.21.0

### Minor Changes

- 169f74f: - Add surgical documentation update mode via patch_file tool (DOC_UPDATE_PROMPT & createPatchFileTool)
    - Extend AI generateText options with tools and maxSteps
- 655aabd: - Batch research & RAG: decouple research from writing for faster, more accurate context
    - Structured review/refine: JSON reviewer output plus automated writer refinement
    - Enforce strict markdown-only prompt output
    - Update default AI models to gpt-5 variants
- 34db7a6: - Implement state-based drift detection for documentation and README generation using cached Git SHAs
- 5fe61c4: 🧠 Smarter Context & RAG
  We've upgraded our Retrieval-Augmented Generation (RAG) capabilities. The system now utilizes query caching and reranking timeouts to ensure that the most relevant context is retrieved without bottlenecking the process. Furthermore, code skeletonization now allows the LLM to focus on logic rather than boilerplate.

    💎 Polished Output & Formatting
    - Prettier Integration: All generated code blocks and documentation are now automatically formatted via Prettier.
    - Mermaid Diagrams: Refined prompt engineering significantly reduces syntax errors in generated diagrams.
    - YAML & Metadata: Enhanced quoting and formatting rules ensure that all documentation headers are valid and parsable.
    - Strict Styling: Introduced new styling rules to maintain a consistent tone and voice across all generated pages.
    - ⚡ Performance & Scalability
      High Concurrency: Documentation generation is now significantly faster thanks to increased task concurrency.
    - Site Restructure: Optimized the underlying folder structure and navigation for a more intuitive user experience.

- 3fb48a5: - Add state-based drift detection: cache last-generated SHAs for README and documentation and restore .sintesi state in CI
    - Introduce lineage graph and SemanticVerifier to target which docs are impacted by code changes
- a686914: - Introduce observability metadata for enhanced AI tracking
    - Add logger support for AI agents
    - Improve AI agent initialization with role-based configuration
    - Enhance documentation generation with metadata tracking
- 7478b4b: RAG Services: Improved non-TypeScript chunking, added local keyword reranking fallback, and implemented context budgeting for retrieved content.
  Diff Analysis: Integrated git diff filtering into ChangeAnalysisService and DocumentationBuilder for more targeted context.
  Documentation & Prompts: Refactored prompts for clarity, implemented selective package.json summarization.

### Patch Changes

- @sintesi/core@0.21.0

## 0.20.0

### Minor Changes

- f8f0da8: - Improve incremental indexing: use GitBinding to diff commits and process only changed files
    - Persist last processed commit SHA in index state for accurate incremental runs
- 3869198: - Introduce DOC_DISCOVERY_PROMPT for high-level architectural discovery
    - Integrate a discovery step in DocumentationPlanner leveraging AI researcher agent

### Patch Changes

- @sintesi/core@0.20.0

## 0.19.0

### Minor Changes

- 54aa685: - Add Retrieval-Augmented Generation (RAG) pipeline: CodeChunkingService, EmbeddingService, VectorStoreService, RerankingService, and RetrievalService for semantic context retrieval
    - Update CLI to initialize and use RAG index in documentation generation
    - Introduce COHERE_API_KEY support and update workflows/docs accordingly

### Patch Changes

- @sintesi/core@0.19.0

## 0.18.4

### Patch Changes

- 938e451: - Only load and summarize existing documentation when not in force mode
    - Improve CLI behavior by skipping docs scan in force mode
    - @sintesi/core@0.18.4

## 0.18.3

### Patch Changes

- f6222d5: Improve documentation and readme commands to reset diff when using --force or missing output
    - @sintesi/core@0.18.3

## 0.18.2

### Patch Changes

- 0eca93a: - Auto-detect and populate repository URL from git config when missing in package.json

## 0.18.1

### Patch Changes

- 09b94c3: - Add check for @changesets/cli installation, with clear error instructions if missing
    - Introduce createRequire usage for robust module resolution in changesetCommand
    - Extend tests to simulate dependency resolution and failure scenarios
- b71ca86: Enhance researcher role and fix monorepo context detection
- f7879b7: Improve OPENAI models and add researcher to the pipeline
    - @sintesi/core@0.18.1

## 0.18.0

### Minor Changes

- dd4dbb0: Implement Rust-based Git analysis with NAPI binding to detect meaningful changes and retrieve diffs/changed files

### Patch Changes

- Updated dependencies [dd4dbb0]
    - @sintesi/core@0.18.0

## 0.17.5

### Patch Changes

- 9f4f199: Enhance review service accuracy by providing source context for hallucination detection.
    - @sintesi/core@0.17.5

## 0.17.4

### Patch Changes

- 9bcd10e: Short-circuit impact analysis when filtered diff is empty to avoid unnecessary AI calls.
    - @sintesi/core@0.17.4

## 0.17.3

### Patch Changes

- e3d9db8: - Fixed improper removal of CLI flags (e.g., --no-strict) in documentation by ensuring entry points like src/index.ts are included in the AI context.
    - @sintesi/core@0.17.3

## 0.17.2

### Patch Changes

- 7f18571: - Fixed AI hallucinations of git repos by enforcing package.json source of truth.
    - Fixed infinite documentation loop by excluding docs directories from impact analysis.
    - @sintesi/core@0.17.2

## 0.17.1

### Patch Changes

- 9bad0f3: Refine impact analysis to skip when output files are missing, ensuring generation.
    - @sintesi/core@0.17.1

## 0.17.0

### Minor Changes

- 125d36a: - Add new CLI options to check only README or documentation drift
    - Separate state files for README and documentation
    - Enhance existence checks and smart drift analysis for improved documentation

### Patch Changes

- @sintesi/core@0.17.0

## 0.16.3

### Patch Changes

- Updated dependencies [6394050]
    - @sintesi/core@0.16.3

## 0.16.2

### Patch Changes

- 816c0ff: Ignore changeset files when checking documentation drift
    - @sintesi/core@0.16.2

## 0.16.1

### Patch Changes

- 2a43407: Add --force flag to documentation
    - @sintesi/core@0.16.1

## 0.16.0

### Minor Changes

- 9fa598d: Introduces the `--force` flag for `documentation` and `readme` commands.

    This flag allows bypassing the smart check and incremental caching system. When enabled:
    - Ignores `.sintesi/state.json` validation and drift detection.
    - Disables impact analysis, forcing a run even if no semantic code changes are detected.
    - Treats the generation as "greenfield," ignoring existing markdown content to ensure a complete regeneration from scratch.

### Patch Changes

- @sintesi/core@0.16.0

## 0.15.0

### Minor Changes

- 510f4b5: - Integrate AI-based drift detection and impact analysis in both check and documentation commands
    - Enhance README generation with smart context and pipeline state validation
    - Add new execution steps in the CI workflow

### Patch Changes

- @sintesi/core@0.15.0

## 0.14.0

### Minor Changes

- 5b9cc1f: 🚀 **New Architecture & Reviewer Agent**
    - **New AI Roles**: Added `Reviewer` and `Researcher` agents. The CLI now performs a self-review of generated documentation using the Reviewer agent to fix hallucinations before saving.
    - **Service Layer**: Introduced `GenerationContextService` for better context awareness (detects CLI binary names, tech stacks, and relevant imports) and `ReviewService`.
    - **Site Mode**: Added `--site` flag to `documentation` command to generate structured guides ready for VitePress/Starlight.
    - **Rebranding**: Project updated to "Sintesi".

- f90d2f7: - Introduce ImpactAnalyzer to perform semantic checks before generating docs
    - Add new flags like hasExistingDocs and strategyInstructions to adjust documentation strategy
    - Update prompts and instructions for documentation and readme commands
- a3ca30e: 🚀 **Default Site Structure**: The `documentation` command now generates organized, static-site friendly file structures (e.g., for VitePress) by default, grouping files into logical folders like `guide/` and `reference/`. The `--site` flag has been removed.

    🐛 **Fix Drift Recursion**: Updated `SmartChecker` to ignore changes to `README.md` itself during drift analysis. This prevents CI infinite loops where documentation updates triggered false positive code changes.

- c2e6ada: - Add strategy selection instructions based on existing documentation
    - Introduce new flags hasExistingDocs and strategyInstructions in documentation command
    - Update installation guide directory name for clarity

### Patch Changes

- f2d475d: - Remove automatic sidebar generation via executing generateSidebar script
    - Update --site behavior to log guidance for VitePress configuration
- Updated dependencies [5b9cc1f]
    - @sintesi/core@0.14.0

## 0.13.0

### Minor Changes

- e87b830: - Integrate smart checks in both documentation and README commands to skip generation when no relevant changes are detected.
    - Add hasRelevantCodeChanges method in SmartChecker for heuristic analysis.

### Patch Changes

- @sintesi/core@0.13.0

## 0.12.0

### Minor Changes

- 144e564: - BREAKING: Removed init, fix, generate, and menu commands
    - Refactored check command to use smart drift detection only

### Patch Changes

- @sintesi/core@0.12.0

## 0.11.0

### Minor Changes

- ebbb68b: - BREAKING: Refactor AI agent initialization to support planner and writer roles
    - Remove deprecated createAgentFromEnv and update CLI commands
    - Enhance connection validation and logging

### Patch Changes

- @sintesi/core@0.11.0

## 0.10.0

### Minor Changes

- cfe8bfd: - Introduce a new CLI command for generating project documentation
    - Implement AI integration for intelligent documentation generation based on project context

### Patch Changes

- @sintesi/core@0.10.0

## 0.9.0

### Minor Changes

- 8453ac1: Implement AI-driven smart check for README updates in the check command

### Patch Changes

- @sintesi/core@0.9.0

## 0.8.0

### Minor Changes

- bbcf561: - Rename project from Doctype to Sintesi
    - Update all references and configurations to reflect the new name
    - Remove deprecated files and workflows related to Doctype
    - Introduce new workflows for Sintesi CI/CD processes

### Patch Changes

- Updated dependencies [bbcf561]
    - @sintesi/core@0.8.0

## 0.7.0

### Minor Changes

- 5c2f805: - Introduce new `sintesi readme` command to generate a README.md based on project context
    - Add project context analysis capabilities to improve documentation generation
    - Enhance AI generation logic for README content based on recent code changes

### Patch Changes

- Updated dependencies [5c2f805]
    - @sintesi/core@0.7.0

## 0.6.0

### Minor Changes

- 3a53ff8: - **New**: `sintesi check` now detects "untracked" symbols (exported code not yet in the map).
    - **New**: Added `--prune` flag to `sintesi fix` to remove dead documentation entries.
    - **Fix**: Huge performance improvement in drift detection via AST caching.
    - **Fix**: Filtered out local variables from being documented as public APIs.
- 8f1f8bf: - Introduce interactive main menu for improved user experience
    - Add new commands for initializing configuration and checking documentation drift
    - Enhance CLI functionality with additional options for user actions

### Patch Changes

- Updated dependencies [8f1f8bf]
    - @sintesi/core@0.6.0

## 0.5.1

### Patch Changes

- 5f99b28: - Update dependencies to include 'glob' package
    - @sintesi/core@0.5.1

## 0.5.0

### Minor Changes

- ec3282d: Prevent duplicate code reference processing within a single run
- c1eebb3: - Enhance scanAndCreateAnchors function to handle existing markdown anchors more effectively
    - Improve error handling and reporting for anchor creation
- c4cbf88: - Add support for Linux and Windows native binaries
- c17c494: Enhance scanAndCreateAnchors function to handle existing markdown anchors more effectively
- 944c25f: Add retry mechanism for AI generation and improve errors logging
- 22c019d: Introduced sintesi generate command, implemented concurrent AI processing for faster performance, and simplified the initialization workflow.
- a1499d2: Implement progressive saving with thread-safe file writing
- 6ca2448: Implement changeset command for generating changesets from code changes using AI.

### Patch Changes

- Updated dependencies [c4cbf88]
    - @sintesi/core@0.5.0

## 0.4.5

### Patch Changes

- f203ff1: Implement structured JSON output with deterministic Markdown builder
    - @sintesi/core@0.4.5

## 0.4.4

### Patch Changes

- 0f57003: Implemented strict AI content sanitization to protect anchors and added resilient batch processing with partial success and smart retries.
- 246079e: Remove redundant fields from sintesi-map.json to make it more robust and maintainable
    - Remove `originalMarkdownContent` - Content is now read from markdown files at runtime
    - Remove `startLine` and `endLine` from DocRef - Use ID-based anchor lookup instead
    - Update all TypeScript and Rust type definitions
    - Update CLI commands (check, fix, init) to use simplified schema
    - Update ContentInjector and MarkdownAnchorInserter
    - Update all tests to reflect new schema
    - Update CLAUDE.md documentation

    Benefits:
    - Single source of truth: Markdown files contain the actual content
    - No content duplication in map file
    - More resilient to manual markdown edits (no fragile line numbers)
    - Smaller map file size
    - Simpler architecture

- Updated dependencies [ff5a3db]
- Updated dependencies [246079e]
    - @sintesi/core@0.4.4

## 0.4.3

### Patch Changes

- 098c13b: Integrate multi-provider AI to generate documentation
  Integrate Vercel AI SDK to create/update documentation on init and fix.
    - @sintesi/core@0.4.3

## 0.4.2

### Patch Changes

- f314c60: Fix deprecated optional dependency
- Updated dependencies [f314c60]
    - @sintesi/core@0.4.2

## 0.4.1

### Patch Changes

- 61fa11b: Update optionalDependencies to force download 0.4.x native core
- Updated dependencies [61fa11b]
    - @sintesi/core@0.4.1

## 0.4.0

### Minor Changes

- 3794e03: Rewrited sintesi core using Rust to improve performance
- b596675: Implement signature-hasher in Rust code instead of Typescript to improve performances

### Patch Changes

- Updated dependencies [3794e03]
- Updated dependencies [b596675]
    - @sintesi/core@0.4.0

## 0.3.33

### Patch Changes

- c1b56c9: Multi-Provider AI Support in CLI
- Updated dependencies [c1b56c9]
    - @sintesi/core@0.3.33

## 0.3.32

### Patch Changes

- 9adca9f: Improve pipeline by avoiding release of native packages when not really needed
- Updated dependencies [9adca9f]
    - @sintesi/core@0.3.32

## 0.3.31

### Patch Changes

- Updated dependencies [5f4970b]
    - @sintesi/core@0.3.31

## 0.3.30

### Patch Changes

- Updated dependencies [5106561]
    - @sintesi/core@0.3.29

## 0.3.29

### Patch Changes

- 5043fe7: Replace TypeScript markdown parser with Rust NAPI implementation using pulldown-cmark
    - Migrate markdown extraction logic from TypeScript to Rust for improved performance
    - Use pulldown-cmark for proper Markdown AST parsing (best practice, avoids regex fragility)
    - Automatically ignores HTML comments in code blocks (impossible with regex)
    - Add `extractAnchors`, `validateMarkdownAnchors`, and `parseCodeRef` functions via NAPI bindings
    - Remove `@sintesi/core-native` workspace dependency (not needed)
    - Add type definitions for markdown extraction to native-types.d.ts
    - Remove old packages/content/markdown-parser.ts file
    - Maintain 0-indexed line numbers for TypeScript compatibility

- Updated dependencies [5043fe7]
    - @sintesi/core@0.3.28

## 0.3.28

### Patch Changes

- 2d148d4: Migrate to pnpm workspaces, refactor core package, and automate releases.
- Updated dependencies [2d148d4]
    - @sintesi/core@0.3.27
