Commit graph

20 commits

Author SHA1 Message Date
Research Assistant
15d849f7e6 fix: remove deprecated control_dir from doctor/setup/repair; enable repair button; fix UTF-8 encoding in doctor output 2026-05-10 01:50:24 +08:00
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
bbd39a90d3 v1.4.17rc4
Milestone v2.1: Contract-Driven Architecture & Engineering Hardening

- Stop the Bleeding: version sync checker, PyYAML hardening, install docs unification
- Contract Layer: PFResult/PFError dataclasses, ErrorCode enum, --json wrapping
- Service Extraction: sync.py decomposed into 3 adapters + SyncService
- State Machine: PdfStatus/OcrStatus/Lifecycle enums, transitions, field registry
- Setup Modularization: setup_wizard.py decomposed into 6 classes

173 tests passing, 0 regressions.
2026-05-09 17:05:07 +08:00
Research Assistant
fa3187519d fix: add --version to CLI, fix plugin version detection to use python -c 2026-05-08 01:35:24 +08:00
Research Assistant
dd71bb0f79 fix: v1.4.17rc2 — OCR quote fix, 4-stage lifecycle, .env fallback, Codex support, deep-reading anchors, auto-update pip 2026-05-08 01:26:04 +08:00
Research Assistant
68e888a010 feat(48-textual-tui-removal): update CLI help and remove textual dependency
- Update setup parser help text (remove 'Textual-based' reference)
- Remove textual>=0.47.0 from pyproject.toml dependencies
- Remove textual from scripts/validate_setup.py required dict
2026-05-07 19:41:51 +08:00
Research Assistant
80664588ff feat(26-02): wire context command into CLI subparser, registry, and dispatch
- Add 'context' to _COMMAND_REGISTRY for dynamic module loading
- Add context subparser with key (nargs='?'), --domain, --collection, --all
- Dispatch in main() to paperforge.commands.context.run(args)
- D-06: always outputs JSON, no --json flag needed
2026-05-04 12:43:43 +08:00
Research Assistant
9691d68970 feat(23-02): add workspace path fields, frontmatter mirroring, and --rebuild-index CLI flag
- Add paper_root, main_note_path, fulltext_path, deep_reading_path, ai_path
  to _build_entry() result dict (Phase 22 paper workspace layout, D-12)
- Mirror workspace path fields in formal note frontmatter for Base views (D-14)
- Add --rebuild-index flag to cli.py sync command parser
- Thread rebuild_index parameter through commands/sync.py -> run_index_refresh()
- Existing system paths (ocr_path, meta_path, note_path) preserved (D-13)
- All 14 existing tests pass
2026-05-04 00:46:34 +08:00
Research Assistant
f617054d5a feat: paperforge status --json, plugin panel with OCR progress bar 2026-04-28 19:21:52 +08:00
Research Assistant
859fa5ff97 feat: headless setup mode, Obsidian plugin, AI agent install guide (v1.4.2) 2026-04-28 14:33:35 +08:00
Research Assistant
ebc4fdeb00 chore: rename PaperForge Lite -> PaperForge across 27 files 2026-04-28 01:25:51 +08:00
Research Assistant
0505fd2fda feat: add paperforge setup CLI command, one-click install script, sync __version__ to 1.4.0, detect local version from pip metadata 2026-04-27 21:34:03 +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
ca7d665896 feat(13-logging-foundation): add global --verbose flag and wire configure_logging() in cli.py
- Import configure_logging from paperforge.logging_config
- Add --verbose/-v as root parser argument (global flag for all subcommands)
- Remove per-subcommand --verbose from deep-reading and repair subparsers
  (users now use 'paperforge -v deep-reading' style instead)
- Call configure_logging(verbose=args.verbose) in main() before command dispatch
- validate: root-level --verbose works across all subcommands
- deviation per Rule 2: subparser --verbose removed; backward compat for
  'deep-reading -v' requires root-level style 'paperforge -v deep-reading'
  (argparse does not inherit root flags to subparsers)
2026-04-27 15:10:26 +08:00
Research Assistant
660204352f fix(cli): add missing 'update' subcommand
- worker/update.py had run_update() but CLI never registered it
- Users can now run: paperforge update
2026-04-25 00:08:46 +08:00
Research Assistant
498a9edfe5 feat(phase-12): extract worker modules from literature_pipeline.py
- Create paperforge/worker/ package with sync.py, ocr.py, repair.py,
  status.py, deep_reading.py, update.py, base_views.py
- Update paperforge/commands/*.py to import from new worker modules
- Update paperforge/cli.py _import_worker_functions for new paths
- Update paperforge/config.py ld_deep_script resolution with fallback
- Update setup_wizard.py for new worker/skills paths
- Add function-level imports to break circular dependencies
2026-04-24 22:32:25 +08:00
Research Assistant
434660c626 feat(11-01): integrate path_error with repair and status commands
- Add --fix-paths flag to paperforge repair CLI
- Add repair_pdf_paths(): re-resolves PDF paths for items with path_error
- Add _detect_path_errors(): scans library-records for path_error fields
- Update run_repair(): detects path_error, reports summary counts by type
- Update run_status(): shows path_error count and suggests repair --fix-paths
- Update repair.py wrapper: prints path_error summary, returns proper exit code
- Update status.py: document path_error reporting in module docstring
2026-04-24 20:08:46 +08:00
Research Assistant
abab8df3f5 feat(phase-10): add consistency audit script
- Add scripts/consistency_audit.py with 4 automated checks
- Check 1: No old command names in active code/docs
- Check 2: No paperforge_lite references in Python code
- Check 3: No dead internal links in markdown
- Check 4: Command docs have required sections

Fix violations found by audit:
- Update paperforge/ocr_diagnostics.py error messages to use new commands
- Update pipeline/worker/literature_pipeline.py generated content to use /pf-deep
- Update scripts/welcome.py to recommend /pf-deep
- Update skills/literature-qa/prompt_deep_subagent.md title to /pf-deep
- Update skills/literature-qa/scripts/ld_deep.py docstrings to /pf-deep
- Fix dead links in docs/COMMANDS.md and command/*.md
- Update AGENTS.md migration section to reference MIGRATION-v1.2.md
- Update paperforge/cli.py module docstring to use current commands
2026-04-24 18:06:35 +08:00
Research Assistant
27d22c7014 refactor(phase-9): refactor cli.py to use shared command modules 2026-04-24 16:31:26 +08:00
Research Assistant
59457d15c7 refactor(phase-9): rename paperforge_lite package to paperforge
- Rename directory: paperforge_lite/ → paperforge/
- Update pyproject.toml: package name, entry point, includes
- Verified: python -m paperforge --help works
2026-04-24 16:15:13 +08:00
Renamed from paperforge_lite/cli.py (Browse further)