Commit graph

7 commits

Author SHA1 Message Date
Research Assistant
05629bce82 refactor: v2.1 contract hardening — PFResult unification, ErrorCode expansion, adapter cleanup, SyncService orchestration
Core contract:
- ErrorCode: 8→26 with _missing_() graceful degradation for unknown codes
- PFResult: +warnings/next_actions, PFError: +suggestions
- OcrStatus: 4→9 granular states (NONE/QUEUED/BLOCKED/NO_PDF/DONE_INCOMPLETE restored 1:1)
- field_registry.yaml: +owner/deprecated/replacement/enum values/default

Adapter cleanup:
- new core/io.py (read_json/write_json), core/date_utils.py (extract_year)
- new adapters/collections.py (build_collection_lookup)
- adapters/bbt.py: cut worker dependency, _private→public+alias
- worker/_utils.py + _domain.py: re-export from core instead of duplicate defs

Command unification:
- All 6 commands (sync/status/ocr/deep/repair/dashboard) → PFResult
- cli.py --json dest unified to 'json' (was json_output on status/doctor)
- commands/sync.py → SyncService (no more int/dict/PFResult mixing)

Service hardening:
- SyncService.run() orchestrates full sync lifecycle (select→index→clean)
- cleanup loops (orphaned records, flat notes) migrated from worker
- worker/sync.py: freeze line + services→worker one-way dependency
- plugin/main.js: formal-library.json fallback deprecation warning

Verification: 181/181 tests, 0 new lint errors
2026-05-09 22:20:07 +08:00
Research Assistant
e742df7888 fix(merge-gate): upgrade migration safeguards, index path integrity, and Python version alignment
- migrate_to_workspace: preserve legacy flat notes even without canonical index
- migrate_to_workspace: reconcile legacy library-record do_ocr/analyze flags including false overrides
- migrate_to_workspace: handle non-canonical legacy filenames via frontmatter title
- asset_index: only advertise fulltext_path/deep_reading_path when files exist
- asset_index: prefer note frontmatter over legacy library-records, fall back to legacy
- setup_wizard: require Python >=3.10 instead of >=3.8
- plugin main.js: align Python version messaging to 3.10+
- ocr.py: auto_analyze_after_ocr reads from formal note paths, not library-records
2026-05-07 21:51:58 +08:00
Research Assistant
b2e446eb21 fix: harden repair paths, slugify edge case, OCR meta resilience, venv python detection, and repair exit handling 2026-05-06 22:09:29 +08:00
Research Assistant
6394043441 fix: move install_obsidian_plugin to _utils.py, reload after update to always use latest code 2026-04-29 00:09:52 +08:00
Research Assistant
3aee514fd5 refactor: extract pipeline_paths into _utils.py — remove 7 copies, 3 of which were dead code 2026-04-28 23:42:00 +08:00
Research Assistant
67a52a898a fix: VaultStep.__init__ missing step_id and checker in super() call 2026-04-27 19:49:36 +08:00
Research Assistant
e24ef4ca6f feat(15-01): add scan_library_records() and _resolve_formal_note_path() to _utils.py
- Add _resolve_formal_note_path() with function-level paperforge_paths import
- Add scan_library_records() as pure data acquisition function
- Returns all D-03 fields: zotero_key, domain, title, analyze, do_ocr,
  deep_reading_status, ocr_status, note_path
- Uses same regex patterns as ld_deep.py for frontmatter extraction
- No side effects, no categorization, no sorting (caller's responsibility)
- Part of new '# --- Deep-Reading Queue ---' section
2026-04-27 15:55:07 +08:00