๐Ÿงน Pre-Release Cleanup & Validation

Blade Generation System โ€” Project Plan

๐Ÿงน Pre-Release Cleanup Phase

๐Ÿ†• Added February 2, 2026 โ€” Production Packaging Checklist

Before any release candidate is packaged for deployment, the codebase must be scrubbed of development artifacts, dead code, and sensitive information. This is a mandatory gate that runs AFTER the Python OVM analysis passes.

๐Ÿ—‘๏ธ Step 1: Strip Orphaned Macros

Remove OVM files that are not called by any production macro chain. The Python dependency checker identifies these.

ORPHAN DETECTION WORKFLOW 1. Python script scans all .ovm files for 'call XXX' statements 2. Build directed graph of caller โ†’ callee relationships 3. Walk graph from known entry points (fxCreateBladeFromIntersect, etc.) 4. Any .ovm NOT reachable from an entry point = ORPHAN 5. Review list manually โ†’ delete or archive confirmed orphans
  • โ—‹ Run dependency analysis from all production entry points
  • โ—‹ Generate orphan report with last-modified dates
  • โ—‹ Manual review: confirm each orphan is truly unused
  • โ—‹ Move confirmed orphans to _archive/ (don't delete immediately)

๐Ÿ“„ Step 2: Remove Development Artifacts

Strip files that exist only for development/documentation purposes and should not ship.

CategoryPatternAction
HTML docs*.html in docs/Exclude from production package
Markdown notes*.md, HANDOFF_*.mdExclude from production package
Text notes*.txt (non-config)Exclude from production package
Test harnessesfxTest*.ovm in testing/Exclude from production package
Backup files#backups/, _backup_*/, _baseline_*/Delete entirely
Copy variantsFiles with "copy" or "backup" in nameDelete after confirming original exists
Analysis scripts*.py (dependency checkers, analyzers)Move to tools/ (internal only)

๐Ÿ”’ Step 3: IP Protection Scrub

Remove or redact information that could expose internal infrastructure, development process, or proprietary methods.

TargetPattern to FindReplacement
UNC paths\\servername\share\Remove or replace with relative paths
UsernamesWindows usernames in paths or commentsRemove
TODO/HACK/FIXMEMarkers left during developmentResolve or remove
Debug printprint 'DEBUG', verbose tracingRemove or gate behind debugLevel
AI references"Claude", "AI Assistant", "Anthropic"Replace with company attribution
Internal IPs192.168.*, NAS addressesRemove

โš ๏ธ AI Attribution

All file headers currently showing Created by: Claude AI Assistant must be changed to Created by: Camtek Software LLC or the appropriate author before release.

โœ… Step 4: Final Verification

  • โ—‹ Run Python OVM analyzer on cleaned codebase (MUST still pass)
  • โ—‹ Run grep -r for all IP scrub patterns (zero hits required)
  • โ—‹ Verify all production entry points still function (smoke test)
  • โ—‹ Confirm CRLF line endings on all .ovm and .var files
  • โ—‹ Package release candidate with version stamp

๐Ÿ“ฆ Deliverables

cleanup_checklist.md โ€” Step-by-step pre-release checklist

ip_scrub.py โ€” Automated IP pattern scanner

package_release.bat โ€” Build script that excludes dev artifacts

๐Ÿ”ข Magic Number Detection

๐Ÿ†• Added February 2, 2026 โ€” Python Analyzer Extension

Extension to the existing Python OVM source analyzer. Flags hardcoded numeric literals that are unit-dependent or tolerance values not assigned to named constants. These "magic numbers" cause silent failures when switching between metric and imperial units.

๐ŸŽฏ Detection Targets

CategoryMagic NumberWhat It IsNamed Constant
Unit conversion25.4mm per inchw_MM_PER_INCH
Unit conversion0.03937inches per mmw_INCH_PER_MM
Unit conversion0.0254meters per inchw_M_PER_INCH
Tolerance0.001Common tolerancew_TOL_FINE
Tolerance0.0001Fine tolerancew_TOL_ULTRA
Tolerance0.01Coarse tolerancew_TOL_COARSE
Angular3.14159Pi (or fragments)w_PI
Comparison999999Large sentinelw_LARGE_VALUE

๐Ÿ” Detection Algorithm

MAGIC NUMBER SCANNER LOGIC For each .ovm file: For each line (skip comments starting with '): 1. SKIP lines that ARE constant definitions: e.g. w_TOL_FINE = 0.001 โ† this is FINE (it IS the definition) 2. FLAG lines that USE magic numbers in expressions: e.g. if w_distance < 0.001 โ† BAD: should be w_TOL_FINE e.g. w_val = w_x * 25.4 โ† BAD: should be w_MM_PER_INCH 3. FLAG lines that use raw numbers in SLD commands: e.g. sld cnv ... 0.001 โ† BAD: tolerance should be named 4. IGNORE safe patterns: - Loop counters: for i = 1 to 10 - Array indices: w_array( 3 ) - VDM slot numbers: vdm add i_set 7 - Known constants: i_TRUE, i_FALSE, i_NOT_SET - Zero and one: 0, 1, -1 (universal)

๐Ÿ“‹ Output: Named Constants File

All magic numbers should be replaced with named constants defined in a central .var file:

'*** fxConstants.var โ€” Unit-independent named constants '*** Include in any macro that uses tolerances or unit conversions w_MM_PER_INCH = 25.4 w_INCH_PER_MM = 0.03937007874 w_M_PER_INCH = 0.0254 w_PI = 3.14159265359 '*** Tolerances (metric, mm) w_TOL_ULTRA = 0.0001 w_TOL_FINE = 0.001 w_TOL_STANDARD = 0.01 w_TOL_COARSE = 0.1 '*** Tolerances (angular, degrees) w_TOL_ANGLE_FINE = 0.01 w_TOL_ANGLE_COARSE = 0.1 '*** Sentinel values w_LARGE_VALUE = 999999.0 w_SMALL_VALUE = -999999.0
  • โ—‹ Add magic number detection to ovm_analyzer.py
  • โ—‹ Create fxConstants.var with all named constants
  • โ—‹ Run scan on full codebase โ€” generate report
  • โ—‹ Replace flagged occurrences with named constants
  • โ—‹ Add magic number check to pre-release validation gate

๐Ÿ“ฆ Deliverables

ovm_analyzer.py โ€” Extended with magic number detection module

fxConstants.var โ€” Central named constants file

magic_number_report.html โ€” Scan results with file:line references

๐Ÿ”ฌ Pre-Release Validation Process

๐Ÿ†• Added January 8, 2026 - Mandatory Pre-Production Analysis

Before releasing production code for testing, ALL OVM macros must pass through the Python-based source code analysis system.

๐Ÿ“Š Python OVM Source Interrogation

Automated analysis of OVM macro source files to detect common issues before production release.

PRE-RELEASE VALIDATION WORKFLOW โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ DEVELOPMENT COMPLETE โ”‚ โ”‚ โ†“ โ”‚ โ”‚ Run Python OVM Analyzer โ”‚ โ”‚ โ†“ โ”‚ โ”‚ โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ” โ”‚ โ”‚ โ”‚ Checks Performed: โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Variable declarations at top of macros โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Local variables inside loops/conditionals โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Extended ASCII characters (>127) โ”‚ โ”‚ โ”‚ โ”‚ โ€ข CRLF line endings โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Undeclared variable usage โ”‚ โ”‚ โ”‚ โ”‚ โ€ข VDM open/close balance โ”‚ โ”‚ โ”‚ โ”‚ โ€ข Syntax pattern validation โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜ โ”‚ โ”‚ โ†“ โ”‚ โ”‚ PASS? โ”€โ”€โ”€ YES โ”€โ”€โ†’ Release for Testing โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ NO โ”‚ โ”‚ โ”‚ โ”‚ โ”‚ โ””โ”€โ”€โ†’ Fix Issues โ”€โ”€โ†’ Re-analyze โ”‚ โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
  • โœ“ Python analyzer script created
  • โœ“ Variable declaration position checking
  • โœ“ Loop/conditional scope analysis
  • โ—‹ Integrate into release checklist
  • โ—‹ Add to CI/CD pipeline (future)
  • โ—‹ Generate HTML validation report

โš ๏ธ MANDATORY GATE

No OVM code should be released for production testing without first passing the Python analysis. This catches common PEPS macro pitfalls that cause silent failures or hard-to-debug runtime errors.

๐Ÿ“ฆ Deliverables

ovm_analyzer.py - Main analysis script

analyze_all_macros.bat - Batch runner for full codebase

validation_report.html - Generated analysis report