Skip to content

Sync monolith dazzlelink.py with modular package #18

@djdarcy

Description

@djdarcy

Full monolith-to-package port and monolith deprecation

Problem

The monolith dazzlelink.py (4,415 lines) and the modular package dazzlelink/ have diverged significantly. The monolith has all working features; the package has critical gaps that prevent python -m dazzlelink from functioning reliably. Key failure: AttributeError: 'DazzleLink' object has no attribute '_make_dazzlelink_executable'.

The monolith is what the Windows file association points to, what we test with, and what has all the latest features. The package is effectively broken for core operations.

Audit Results

# Gap Monolith Location Package Status Complexity
1 _make_dazzlelink_executable() Lines 2735-2939 (204 lines) Missing entirely Large
2 rebase_dazzlelinks() Lines 3314-3457 (143 lines) Missing entirely Medium
3 Execute mode precedence Lines 3536-3540 Reversed (global > file) 1-line fix
4 Enhanced info display Lines 3543-3586 Basic output only Small-medium
5 Relative path in serialize_link Lines 1023-1055 Already ported Done
6 Execute fallback chain Lines 3591-3619 Already ported Done

Proposed solution

Port all gaps in this order:

Phase 1: Unblock python -m dazzlelink (quick fixes)

  1. Fix _make_dazzlelink_executable -- the method call in core.py:313 should delegate to links.make_dazzlelink_executable() which already exists as a module-level function
  2. Fix execute mode precedence in recreate.py -- swap global/file priority to match monolith

Phase 2: Feature parity
3. Port rebase_dazzlelinks() to operations/batch.py
4. Wire CLI rebase to call both rebase_links() and rebase_dazzlelinks()
5. Port enhanced info display to recreate.py

Phase 3: Deprecation
6. Add deprecation warning to monolith dazzlelink.py header
7. Update file association scripts to use python -m dazzlelink
8. Update all documentation references
9. Eventually remove monolith (after one release cycle)

Implementation approach

The config change for #19 (default_mode None sentinel) should be applied simultaneously with Phase 1 step 2, since both touch the same code path.

Files affected:

  • dazzlelink/operations/core.py -- fix _make_dazzlelink_executable call
  • dazzlelink/operations/recreate.py -- mode precedence + info display
  • dazzlelink/operations/batch.py -- add rebase_dazzlelinks()
  • dazzlelink/config.py -- default_mode None (Design proper execute mode precedence (global vs file-embedded) #19)
  • dazzlelink/cli.py -- rebase dispatch update
  • dazzlelink.py -- add deprecation warning

Acceptance criteria

  • python -m dazzlelink create works (no AttributeError)
  • python -m dazzlelink execute respects file's embedded mode
  • python -m dazzlelink execute --mode info shows enhanced display
  • python -m dazzlelink rebase fixes stale .dazzlelink paths
  • All 5 existing tests pass via python -m pytest tests/ -v
  • File association can switch from monolith to python -m dazzlelink
  • Monolith prints deprecation notice when invoked directly
  • Global config with explicit default_mode overrides file's mode (Design proper execute mode precedence (global vs file-embedded) #19)
  • Global config with unset default_mode defers to file's mode (Design proper execute mode precedence (global vs file-embedded) #19)

Effort estimate

~6-8 hours of focused work across 3 phases.

Related issues

Analysis

See 2026-04-01__06-18-11__issue-18-19-execute-mode-precedence-and-sync.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions