docs: C4 diagram fixes + complete Tier 2 risk mitigation implementation (#272)#283
Closed
raifdmueller wants to merge 14 commits intodocToolchain:mainfrom
Closed
docs: C4 diagram fixes + complete Tier 2 risk mitigation implementation (#272)#283raifdmueller wants to merge 14 commits intodocToolchain:mainfrom
raifdmueller wants to merge 14 commits intodocToolchain:mainfrom
Conversation
…hain#272) Add cross-references from the "Document Parser Architecture" section to the existing parser component specifications (04_markdown_parser, 05_asciidoc_parser) which contain state machine diagrams, data models, and include resolution algorithms — serving as C4 Level 4 (Code) views. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add pre-commit to dev dependencies (pyproject.toml) - Configure hooks: Ruff linting/formatting + basic file checks - Auto-fix formatting across codebase (ruff-format) - Fix isinstance syntax to use modern union syntax (int | float) - Hooks run automatically on git commit
- Add pip-audit step to GitHub Actions workflow - Scans all Python dependencies against PyPI Advisory Database - CI will fail if known vulnerabilities are found - Helps prevent supply chain attacks
- Add cryptography>=46.0.5 to fix CVE-2026-26007 - Upgrade pip to 26.0.1 (addresses 2 CVEs) - Verified with pip-audit: no known vulnerabilities - All 702 tests pass
- Configure GitHub CodeQL for Python analysis - Use security-extended query suite for deeper analysis - Run on push/PR to main/develop branches - Schedule weekly scans on Mondays - Detects: SQL injection, command injection, crypto issues, etc.
- Add Hypothesis to dev dependencies - Create property-based tests for parser utilities - Test slugify() and strip_doc_extension() functions - Verify functions never crash on random input - Test invariants: lowercase, no multiple dashes, idempotency - 11 new tests, each running 100 random examples (1,100+ test cases)
- Define review requirements by change type - Implement 20-30% sampling for non-critical PRs - Mandatory review for security, breaking changes, architecture - Auto-merge eligible: dependency updates, formatting fixes - Include review checklist and metrics tracking - Support AI-assisted development workflow
- Mark all implemented mitigations as 'Eingerichtet' - Update test count to 713 (added 11 property-based tests) - Add completion rates: Tier 1 100%, Tier 2 80% - Document commit hashes for each mitigation - Note security fixes applied
- Configure SonarCloud for code quality analysis - Set up GitHub Actions workflow for automatic scans - Use coverage.xml from pytest for code coverage metrics - Organization: doctoolchain - Project: docToolchain_dacli - Scans run on push/PR to main/develop branches
- Update mitigation status for both dacli modules - SonarCloud configured and integrated - Tier 2 completion: 5/5 (100%) - All required mitigations for Tier 2 now in place
- Add condition to skip SonarCloud on forks - Prevents SONAR_TOKEN errors on fork PRs - SonarCloud only runs on docToolchain/dacli - Forks don't need SonarCloud secrets configured
- Use continue-on-error for forks (missing SONAR_TOKEN) - Fails normally on upstream (docToolchain/dacli) - Prevents CI failures on fork PRs - SonarCloud runs when available, skips gracefully when not
- Workflows only needed on upstream (docToolchain/dacli) - Prevents CI failures on fork due to missing secrets - Workflows will be active after PR merge to upstream - CodeQL default setup already enabled on upstream
Created three Architecture Decision Records (Nygard format) documenting the Risk Radar assessment and mitigation implementation: - ADR-011: Risk Classification - dacli CLI (Tier 2) - ADR-012: Risk Classification - dacli-mcp (Tier 2) - ADR-013: Security Mitigations - Tier 2 Implementation Key decisions documented: - Tier 2 classification based on Code Type=2, Language=2, Blast Radius=2 - Repository-wide mitigation strategy (both modules share codebase) - 100% Tier 1+2 measure implementation (9/9 measures complete) - PR review policy with risk-based sampling (20-30%) - Security fixes: cryptography 46.0.5, pip 26.0.1 Each ADR includes: - Context with dimension scoring and evidence - Decision rationale with tier requirements - Pugh Matrix comparing alternatives - Consequences (positive and negative) - Implementation timeline with commit references Updated CLAUDE.md with links to new ADRs. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing to reorganize into separate PRs: parser-crossref (#272) and security mitigations |
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.
Summary
This PR contains two main improvements:
1. Documentation: C4 Diagram Fixes (#272)
2. Security: Complete Tier 2 Risk Mitigation Implementation
Implemented all required security mitigations based on Risk Radar assessment:
Tier 1 — Automated Gates (100%)
Tier 2 — Extended Assurance (100%)
3. Architecture Decision Records (ADRs)
Created three ADRs documenting the Risk Radar assessment and mitigation decisions:
Changes
Documentation
Security Mitigations (11 commits)
Code Quality
Test Results
Breaking Changes
None
Migration Guide
For contributors:
uv sync --extra devto install new dev dependencies (pre-commit, hypothesis).github/PR_REVIEW_POLICY.mdfor review requirementsRelated Issues
Generated with 🤖 Claude Code (AI-assisted development)
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com