π LogiDAV Documentation System
This directory contains the documentation infrastructure for the LogiDAV ERP system, with a cronjob-first approach.
Overviewβ
This documentation system prioritizes cronjobs as the entry point for understanding critical workflows. Cronjobs are production-critical, run silently, and represent significant operational risk if undocumented.
Directory Structureβ
docs/
βββ README.md # This file
βββ system-crontab.md # β SOURCE OF TRUTH for all cronjobs
βββ cronjobs/ # Auto-generated cronjob documentation
β βββ README.md # Cronjob documentation system guide
β βββ menzzo-v2-sales.md
β βββ menzzo-v2-products.md
β βββ ... (115 cronjob docs)
βββ meta/
β βββ documentation-progress.md # Coverage tracking and TODO list
βββ [other docs...]
Quick Startβ
View Documentation Coverageβ
cat docs/meta/documentation-progress.md
Current status:
- 164 total cron entries
- 115 unique commands
- 95 documented (82% coverage)
- 20 undocumented (18% needing investigation)
- 46 critical risk commands (sales, payments, refunds, stock)
Generate/Update Documentationβ
python3 tools/cronjob_doc_generator.py
This regenerates all cronjob documentation from system-crontab.md.
Validate Documentationβ
# Regenerate the cronjob docs locally
python3 tools/cronjob_doc_generator.py
# Then verify the updated docs before pushing
git diff -- docs/
π― Documentation Philosophyβ
1. Cron-First Approachβ
Why cronjobs first?
- π Silent Workflows: Run in background without visibility
- β οΈ Production Critical: Sales, payments, stock mutations happen here
- π¨ High Risk: Failures can have immediate business impact
- π Discoverable: System crontab is a concrete artifact
- π Traceable: Maps to concrete Symfony Command classes
Cronjobs are the entry point to understanding:
- What automated workflows exist
- When they run and how often
- What data they touch
- What external systems they interact with
2. Code-First Documentationβ
- Documentation is generated from source (system-crontab.md)
- Validation runs in the documented update flow before changes are pushed
- Documentation should not get out of sync when the generator is rerun after cron changes
- Manual enhancements are layered on top of generated structure
3. Obsolescence by Designβ
All documentation includes:
last_verified: YYYY-MM-DD
regeneration:
trigger: "Cron definition or command code changed"
instruction: "Re-run documentation agent"
This makes staleness explicit rather than hidden.
4. Risk-First Prioritizationβ
Commands are classified by risk:
- π΄ CRITICAL (46): Sales, payments, refunds, stock mutations
- π‘ HIGH (40): Products, sync, orders, imports
- π’ MEDIUM (8): Logs, stats, alerts, notifications
- βͺ UNKNOWN (21): Needs assessment
Critical commands must be documented first.
π System Componentsβ
1. Source of Truth: system-crontab.mdβ
- Contains the actual production crontab
- Generated by:
php bin/console logidav:cron:document - Last synced: 2025-12-05 14:33:07
- Update whenever cron entries change
2. Generator: tools/cronjob_doc_generator.pyβ
Python script that:
- Parses
system-crontab.md - Extracts all active cron entries (ignoring comments)
- Generates unique identifiers for each command
- Attempts to locate Symfony Command class files
- Determines risk levels based on command patterns
- Generates structured Markdown documentation
- Updates progress tracking
Run after any crontab changes.
3. Documentation: docs/cronjobs/β
Auto-generated Markdown files, one per unique command:
- Structured frontmatter (YAML)
- Schedule information
- Command details
- Risk assessment
- Status tracking
- Code linkage (when found)
Do not manually edit generated sections. Add manual enhancements below.
4. Progress Tracking: docs/meta/documentation-progress.mdβ
Central report showing:
- Total cronjob count
- Documentation coverage %
- Critical risk commands
- Commands without located classes
- High-priority TODOs
Regenerated automatically with the documentation.
5. CI Enforcementβ
Documentation checks in the team's review and Jenkins flow should ensure that:
- β Validates all cronjobs have documentation
- β Checks progress report exists and is parseable
- β οΈ Warns about undocumented commands
- β οΈ Warns about unknown risk levels
- β οΈ Identifies stale docs (>90 days old)
- π Reports coverage in review updates
Re-run documentation checks when changing:
docs/system-crontab.mddocs/cronjobs/**docs/meta/documentation-progress.mdtools/cronjob_doc_generator.py
π Getting Startedβ
For Developersβ
-
Understand what cronjobs do:
# See the full listcat docs/system-crontab.md# Check documentation for a specific commandcat docs/cronjobs/menzzo-v2-sales.md -
Find the code:
- Check the
command_classfield in the doc's frontmatter - Or search:
find src/ -name "*Command.php" | xargs grep "setName('menzzo:v2:sales')"
- Check the
-
Understand the business impact:
- Check the
risk_levelfield - Review
docs/meta/documentation-progress.mdfor critical commands - Read the "Intent & Purpose" section (may be incomplete)
- Check the
For Operationsβ
-
Monitor documentation coverage:
cat docs/meta/documentation-progress.md -
Prioritize critical commands:
- Focus on 46 critical risk commands first
- These involve money and inventory
-
Keep docs current:
- After crontab changes: re-run generator
- After command code changes: update
last_verifieddate - Review stale docs quarterly
For Maintainersβ
-
Add new cronjobs:
# 1. Update system crontabcrontab -e# 2. Document the changephp bin/console logidav:cron:document# 3. Regenerate docspython3 tools/cronjob_doc_generator.py# 4. Commit everythinggit add docs/git commit -m "docs: add new cronjob for X" -
Remove cronjobs:
# 1. Remove from crontabcrontab -e# 2. Update system-crontab.mdphp bin/console logidav:cron:document# 3. Regenerate docs (old doc will remain but be marked stale)python3 tools/cronjob_doc_generator.py# 4. Optionally delete the old doc filerm docs/cronjobs/old-command.md -
Enhance documentation:
# 1. Find the command classfind src/ -name "*Command.php" | xargs grep "setName('command:name')"# 2. Add @doc.* annotations to the class:/*** @doc.intent: Clear business purpose in one sentence* @doc.side_effects: What data does this mutate?* @doc.risk: Why is this critical/high/medium risk?* @doc.dependencies: External systems it calls* @doc.recovery: What to do if it fails*/# 3. Regenerate to pick up changespython3 tools/cronjob_doc_generator.py# 4. Manually enhance the generated doc if needed# (Add sections below the generated content)
π Current Statusβ
As of 2026-01-08:
Overall Coverageβ
- β 82% of commands have located class files
- β οΈ 18% need manual investigation
- π΄ 46 critical risk commands identified
- π‘ 40 high risk commands identified
Top Prioritiesβ
-
Document critical risk commands (46 commands)
- Focus on sales, payment, refund, stock workflows
- Add @doc.* annotations to command classes
- Complete business intent documentation
-
Locate missing command classes (20 commands)
- Some may be external scripts (not Symfony commands)
- Update finder logic if patterns change
- Mark as "external" if truly non-Symfony
-
Assess unknown risk commands (21 commands)
- Review command code
- Determine actual business impact
- Update risk level in documentation
-
Add @doc. annotations* (all 115 commands)
- Structured tags in command class docblocks
- Makes intent machine-readable
- Enables automated documentation enhancement
π Maintenance Workflowβ
Weeklyβ
- Review CI warnings on PRs
- Address high-priority TODOs
- Keep coverage above 80%
Monthlyβ
- Review
documentation-progress.md - Update docs for frequently-changing commands
- Verify critical commands are still accurate
Quarterlyβ
- Check for stale docs (>90 days)
- Reassess risk levels
- Update documentation standards
On Crontab Changesβ
- Update
system-crontab.md(via console command) - Regenerate all documentation
- Review new/changed cronjobs
- Commit all changes together
π Best Practicesβ
DOβ
β
Run generator after crontab changes
β
Commit system-crontab.md and generated docs together
β
Add @doc.* annotations to command classes
β
Prioritize critical risk commands
β
Let CI catch documentation drift
β
Update last_verified dates when reviewing
DON'Tβ
β Manually edit generated documentation sections
β Commit crontab changes without updating docs
β Ignore CI warnings
β Leave critical commands undocumented
β Skip risk assessment
β Update docs without regenerating
π§ Troubleshootingβ
Generator fails to find command classesβ
Problem: Command class path not found
Solutions:
- Search manually:
find src/ -name "*Command.php" | xargs grep "setName('command:name')" - Check if command uses different naming pattern
- Update finder logic in
tools/cronjob_doc_generator.py - Mark as external if it's not a Symfony command
CI fails on PRβ
Problem: Documentation validation errors
Solutions:
- Check the Jenkins logs for the specific error
- Regenerate the docs locally with
python3 tools/cronjob_doc_generator.py - Regenerate documentation if out of sync
- Commit missing or updated files
Documentation seems staleβ
Problem: Content doesn't match current code
Solutions:
- Check
last_verifieddate in doc frontmatter - Review command class for changes
- Update
system-crontab.mdif schedule changed - Regenerate documentation:
python3 tools/cronjob_doc_generator.py - Update
last_verifiedto today
Can't determine risk levelβ
Problem: Command risk is marked "unknown"
Solutions:
- Read the command class code
- Identify what data it touches (sales? products? logs?)
- Assess business impact (money? inventory? just metrics?)
- Update risk level in generated doc
- Consider adding @doc.risk annotation to code
π§ Future Enhancementsβ
Phase 2: Code Annotations (TODO)β
- Define @doc.* annotation schema
- Add annotations to all 115 command classes
- Update generator to extract and use annotations
- Auto-populate "Intent & Purpose" sections
Phase 3: API Workflows (TODO)β
- Document REST API endpoints
- Link endpoints to services and controllers
- Identify data mutations in API layer
- Apply similar validation in the team's delivery process
Phase 4: Event Listeners (TODO)β
- Document Symfony event subscribers
- Trace event flows through the system
- Identify side effects of events
- Document coupling between modules
Phase 5: Integration (TODO)β
- Link cronjobs to APIs they call
- Document data flow between components
- Build dependency graphs
- Identify circular dependencies
π Supportβ
For questions or issues with the documentation system:
- Check this README
- Review
docs/cronjobs/README.md - Look at
docs/meta/documentation-progress.md - Check Jenkins logs for validation errors
- Discuss with the team
π Related Filesβ
system-crontab.md- Source of truthcronjobs/README.md- Cronjob system detailsmeta/documentation-progress.md- Coverage report../tools/cronjob_doc_generator.py- Generator script../Jenkinsfile- CI pipeline definition
Remember: Undocumented cronjobs are operational debt. This system exists to make that debt visible and actionable.