Commit graph

8 commits

Author SHA1 Message Date
Research Assistant
1f817a5519 Add repair subcommand to CLI
- Add 'repair' subcommand with --verbose and --fix flags
- Wire to run_repair() from literature_pipeline worker
- Follow existing dispatch pattern (like deep-reading)
2026-04-24 01:07:13 +08:00
Research Assistant
6052c823e6 Add run_repair() function for three-way OCR state divergence repair 2026-04-24 00:02:32 +08:00
Research Assistant
187af3b379 fix(cli): lazy pipeline import with idempotent guard; remove paperforge_lite deployment from wizard
Root cause: paperforge.exe pointed to vault's PaperForge/paperforge_lite/ (deployed by
wizard), which lacked the 'pipeline/' package, causing ModuleNotFoundError.

Fix:
- cli.py: deferred sys.path resolution + idempotent worker import (each global
  is imported only once; tests can patch stubs and guards skip if already bound)
- wizard: remove paperforge_lite copytree deployment (pip install -e . handles it)
- .gitignore: add tests/sandbox/00_TestVault/
2026-04-23 21:31:51 +08:00
Research Assistant
b9f06ccad3 feat: complete PaperForge Lite v1.0 release hardening (5 phases, 28 reqs, 145 tests) 2026-04-23 20:15:20 +08:00
Research Assistant
2a3295ed38 feat(02-03): add ocr doctor CLI dispatch, tests, and docs
- Convert ocr parser to sub-subcommands (run, doctor)
- Add _cmd_ocr_doctor() with formatted tiered report output
- Update dispatch logic to route ocr doctor subcommand
- Add CLI dispatch test for doctor command
- Update command/lp-ocr.md with doctor documentation
2026-04-23 12:59:04 +08:00
Research Assistant
3bd1c5ea69 feat(02-03): implement ocr_doctor() with L1-L4 diagnostics
- Add paperforge_lite/ocr_diagnostics.py with tiered L1-L4 checks
- L1: token presence, L2: URL reachability, L3: API schema validation
- L4: optional live PDF round-trip test with polling
- Add 7 mocked unit tests for all levels
- Include blank.pdf test fixture
2026-04-23 12:58:54 +08:00
Research Assistant
9496382e81 feat(01-02): implement CLI launcher, packaging entry point, and shared config resolver
- paperforge_lite/cli.py: argparse CLI with global --vault, subcommands paths/status/selection-sync/index-refresh/deep-reading/ocr (ocr defaults to run action)
- paperforge_lite/__main__.py: python -m paperforge_lite fallback entry point
- paperforge_lite/config.py: shared resolver (load_vault_config, resolve_vault, paperforge_paths, paths_as_strings, load_simple_env) matching Plan 01 contract
- pyproject.toml: setuptools build, paperforge-lite package, Python >=3.10, dependencies from requirements.txt, [project.scripts] paperforge=paperforge_lite.cli:main
- paperforge_lite/__init__.py: package init (version 1.0.0)

CLI loads .env from vault root and <system_dir>/PaperForge/.env before worker dispatch, matching legacy pipeline behavior.
2026-04-23 11:44:26 +08:00
Research Assistant
a6c0cb0e70 feat(01-01): implement shared config resolver
- DEFAULT_CONFIG: 99_System, 03_Resources, Literature, LiteratureControl, 05_Bases, .opencode/skills, .opencode/command
- ENV_KEYS: all 8 PAPERFORGE_* overrides mapped
- read_paperforge_json: supports both nested vault_config and top-level legacy keys
- resolve_vault: cli > PAPERFORGE_VAULT > json-search > cwd precedence
- load_vault_config: layered merge with locked D-Configuration Hierarchy order
- paperforge_paths: returns exactly 13 required user-facing path keys
- paths_as_strings: JSON-serializable string output
- No os.environ mutation, no OCR secrets, stdlib only
2026-04-23 11:41:10 +08:00