Commit graph

84 commits

Author SHA1 Message Date
Research Assistant
d2de2454d7 feat(54-002): add CHAOS_MATRIX.md and chaos tests for corrupted inputs, network failures, filesystem errors
- tests/chaos/scenarios/CHAOS_MATRIX.md: 15+ destructive scenarios documented with IDs, triggers, expected behavior, safety contracts
- tests/chaos/conftest.py: chaos_vault, chaos_vault_standard fixtures with isolation guards + file corruption helpers
- tests/chaos/test_corrupted_inputs.py: CHAOS-01 (6 tests: malformed JSON, empty, missing key, corrupt PDF, broken meta, missing frontmatter)
- tests/chaos/test_network_failures.py: CHAOS-02 (4 tests: 401, 500, timeout, DNS unreachable via env var manipulation)
- tests/chaos/test_filesystem_errors.py: CHAOS-03 (4 tests: deleted dirs, missing note, permission denied)
2026-05-09 00:53:03 +08:00
Research Assistant
341941ab09 feat(54-001): add UX contract and user journey tests
- docs/ux-contract.md: verifiable step sequences for install, sync, OCR, dashboard
- tests/journey/conftest.py: journey_fresh_vault, journey_established_vault, journey_cli_invoker fixtures with isolation guards
- tests/journey/test_onboarding.py: JNY-02 new user onboarding (sync -> OCR -> analyze -> deep-read)
- tests/journey/test_daily_workflow.py: JNY-03 existing user adds paper workflow
2026-05-09 00:52:55 +08:00
Research Assistant
2cb223ddbb feat(53-001): extract src/ modules from main.js and add Vitest test infrastructure
- runtime.js: resolvePythonExecutable, getPluginVersion, checkRuntimeVersion
- errors.js: classifyError, buildRuntimeInstallCommand, parseRuntimeStatus
- commands.js: ACTIONS, buildCommandArgs, runSubprocess
- package.json with vitest + obsidian-test-mocks + jsdom
- vitest.config.ts with jsdom environment
- 42 Vitest tests across 3 test files
- Refactored main.js to import from src/ modules
2026-05-09 00:05:19 +08:00
Research Assistant
ab7ac0d6ab feat(52-golden-datasets-cli-contracts): add CLI contract tests with snapshot integration
- tests/cli/ with conftest.py (cli_invoker, vault_builder, mock_ocr_backend fixtures)
- test_contract_helpers.py with normalize_snapshot, assert_valid_json, assert_json_shape
- 3 test files covering all 8 CLI commands (paths, status, sync, ocr, doctor,
  repair, context, setup) with exit code, output shape, and error contracts
- fixtures/ocr/mock_ocr_backend.py with 4 mock modes (success, pending, error, timeout)
- pyproject.toml: added pytest-snapshot, responses, pytest-timeout, pytest-mock,
  coverage; added testpaths and layer markers
- All 27 tests pass (CLI-01, CLI-02, CLI-03 satisfied)
2026-05-08 23:32:03 +08:00
Research Assistant
e54ef1ac5c test: align deep-reading expectations with main-note workflow 2026-05-08 17:47:46 +08:00
Research Assistant
7e6abc2070 test: prefer repo source for OCR doctor fixtures 2026-05-08 17:47:45 +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
7eeaebdd81 test(merge-gate): add upgrade migration and index path integrity tests
- test OCR state machine: isolate runtime (no ambient tokens), fix retry exhaustion and full cycle tests
- test migration: verify no-index flat note migration, legacy flag promotion including false overrides
- test migration: verify non-canonical filename migration via frontmatter title
- test migration: verify already-migrated workspace reconciliation from legacy records
- test asset_index: verify fulltext/deep-reading paths only advertised when files exist
2026-05-07 21:52:16 +08:00
Research Assistant
76632a56e5 fix(50-repair-blind-spots): replace bare except:pass + add --fix else clause (REPAIR-02/03)
- Replaced 5 bare except Exception: pass blocks with logger.warning() calls
  (4 per plan at lines 223, 306, 347, 355 + 1 auto-detected at line 315 via Rule 2)
- Added else clause printing [WARNING] for unhandled --fix divergence types
- Added 6 new tests: 4 caplog tests for logger.warning, 1 capsys test for [WARNING],
  1 index load failure test
- All 37 repair tests pass
2026-05-07 20:20:25 +08:00
Research Assistant
f2198041ed fix(50-repair-blind-spots): repair condition 4 detection + dead code removal (REPAIR-01/04)
- Removed dead import of load_domain_config and orphaned dict comprehension
- Replaced note_ocr_status != pending guard with combined logic catching note=pending vs meta=done/failed
- Added 5 new tests (3 for condition 4 detection, 2 for dead code verification)
2026-05-07 20:16:38 +08:00
Research Assistant
377c8c7b44 feat(49-module-hardening): asset_state.py + status.py hardening — reorder checks, empty dicts
- HARDEN-06: Reorder next_step checks so workspace integrity (note_path, workspace_paths) comes before /pf-deep recommendation
- HARDEN-07: Initialize lifecycle_level_counts, health_aggregate, maturity_distribution as {} (not None) in status.py
- Update tests: 2 new test methods, 1 updated existing test, 1 updated assertion
2026-05-07 20:06:24 +08:00
Research Assistant
284f074389 feat(49-module-hardening): discussion.py hardening — UTC timestamps, MD escaping, file locking
- Replace CST (UTC+8) with UTC timezone using timezone.utc
- Add _escape_md() helper to escape markdown special chars in QA fields
- Wrap JSON+MD read-modify-write in filelock.FileLock with 10s timeout
- Add 5 new tests: UTC timestamp, MD escaping, CJK escaping, lock release, lock timeout
2026-05-07 20:06:16 +08:00
Research Assistant
901e8cceb6 test(47-library-records): update ld_deep tests for removed records key
- Removed 'records' from expected keys in test_paperforge_paths_returns_expected_keys
- Removed 'records' assertion in test_paperforge_paths_values_match_shared_resolver
- Updated docstrings to reflect that _paperforge_paths no longer returns records key
2026-05-07 19:22:51 +08:00
Research Assistant
a9c5534bfa fix(46-index-path-resolution): update tests for removed LIBRARY_RECORDS and config-resolved paths
- test_base_views.py: Replace LIBRARY_RECORDS placeholder tests with LITERATURE/CONTROL_DIR
- test_migration.py: Use config-resolved lit_rel instead of hardcoded 'Literature/' prefix
2026-05-07 19:03:04 +08:00
Research Assistant
98daf1e779 fix(46-index-path-resolution): fix config env var typo, library_records path, and CONFIG_PATH_KEYS (PATH-02, PATH-03, PATH-04)
- PATH-03: Fix env var name from paperforgeRATURE_DIR to PAPERFORGE_LITERATURE_DIR
- PATH-02: library_records now returns control / 'library-records' matching its docstring
- PATH-04: Add skill_dir and command_dir to CONFIG_PATH_KEYS for migration coverage
- Update test_config.py assertion to use corrected env var name
2026-05-07 19:00:04 +08:00
Research Assistant
97619d374d chore: complete v1.8 milestone + fix discussion tests
v1.8 (Phases 31-36): deep-reading mode detection + rendering,
AI discussion recorder, bug fixes, integration verification, jump button
v1.9 (Phases 37-41): frontmatter rationalization, workspace stabilization,
Base view fix, library-record deprecation, plugin dashboard sync

Test fixes: discussion.py _find_paper_metadata uses paperforge_paths
index resolution; test fixtures create canonical index
2026-05-07 10:20:16 +08:00
Research Assistant
db042cd6dd chore: complete v1.9 Frontmatter Rationalization & Library-Record Deprecation
Milestone v1.9 — 5 phases, 28 requirements, 188 tests passing.

Key changes:
- Frontmatter rationalization: slimmed formal note frontmatter (28→16 fields), created per-workspace paper-meta.json
- Library-record deprecation: removed library_record_markdown(), sync no longer creates library-records
- Workspace stabilization: unconditional workspace creation, fulltext bridge, discussion.py reads canonical index
- Base view fix: removed ghost lifecycle fields, restored workflow flags, Literature/ folder filter
- Plugin sync: version badge reads paperforge_version from index envelope

Archived: .planning/milestones/v1.9-ROADMAP.md, .planning/milestones/v1.9-REQUIREMENTS.md
2026-05-07 10:11:42 +08:00
Research Assistant
cff049682f test(35-01): add failing tests for discussion recorder
- 7 tests covering record_session() creation, append, error handling, CJK encoding, atomic writes, and CLI invocation
2026-05-06 23:26:20 +08:00
Research Assistant
d1e8090c21 fix: honor user-provided zotero path in setup informational checks 2026-05-06 22:45:23 +08:00
Research Assistant
f47df7b8c2 chore: merge pyproject.toml packaging fix and upstream setup_wizard tests from release/v1.6-core-slice 2026-05-06 22:23:06 +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
4fe55e11dc feat: restore phases 31-34 from stash — dashboard multi-view, deep-reading mode, jump button, planning docs
- Phase 31: Bug fixes (version display, lifecycle alignment, AI Ready removal)
- Phase 32: Deep-reading mode detection (_resolveModeForFile, identity guard)
- Phase 33: Deep-reading dashboard (status card, Pass 1 extraction, AI Q&A)
- Phase 34: Jump to deep reading button (i18n, conditional visibility)
- Planning files for phases 31-36
- CSS: Section 33 deep-reading styles
- asset_index.py: paperforge_version in envelope
2026-05-06 15:14:36 +08:00
Research Assistant
60355d4e97 test(26-01): add migration tests for flat-to-workspace, _build_entry workspace write, and idempotency
- test_migrate_flat_note_to_workspace: D-11/D-12 copy-not-move verification
- test_migrate_extracts_deep_reading: D-13 deep-reading.md extraction
- test_migrate_creates_ai_dir: ai/ directory creation
- test_migrate_idempotent_skips_existing: D-15 idempotency
- test_build_entry_writes_to_workspace_after_migration: workspace-aware _build_entry
- test_build_entry_flat_fallback_for_unmigrated_paper: backward compat fallback
- test_build_entry_new_paper_creates_workspace: new paper behavior
- test_run_index_refresh_calls_migrate: spy on run_index_refresh integration
- bonus: test_migrate_returns_zero_when_no_index
2026-05-04 12:46:31 +08:00
Research Assistant
2e02729f83 test(26-02): write 14 tests for context command modes and provenance output
- TestContextSingleKey: single key JSON object with _provenance and _ai_readiness
- TestContextSingleKeyNotFound: missing key returns 1 with error
- TestContextDomainFilter: --domain filters correctly (AIC-03)
- TestContextCollectionFilter: --collection prefix match (AIC-03)
- TestContextAll: --all returns all entries
- TestContextProvenanceTraceability: all 9 provenance path keys present (AIC-04)
- TestContextAiReadinessBlocking: blocking explanation for pdf_ready/fulltext_ready
- TestContextNoEntriesMatch: empty results and no-mode error
- TestContextIndexMissing: missing index guidance
2026-05-04 12:45:52 +08:00
Research Assistant
157fc4d0ff fix(25-03): use double-quote YAML wrapping for lifecycle filter values
- Filters now contain single-quoted lifecycle values (e.g. lifecycle = 'fulltext_ready')
  which broke single-quote YAML wrapping; switched to double-quote wrapper
- Updated _render_views_section(), merge_base_views(), _build_base_yaml()
- Updated filter preservation test to use lifecycle-based filter strings
2026-05-04 11:35:17 +08:00
Research Assistant
e2ef4e9f02 feat(25-01): refactor run_status to read canonical index + add doctor Index Health
- run_status() reads canonical index via summarize_index() for lifecycle,
  health, and maturity aggregates; falls back to filesystem when index missing
- JSON output includes lifecycle_level_counts, health_aggregate,
  maturity_distribution (or None when falling back)
- Text output shows lifecycle and health lines when index is present
- run_doctor() shows Index Health section with PDF/OCR/Note/Asset Health
  counts and status per dimension
- Brownfield detection: legacy schema, old Base templates, partial OCR assets
- Fixed status_tag mapping to support 'info' status (existing bug)
- 6 new tests covering index-backed JSON output, fallback, text output,
  Index Health with/without index, and mixed health counts

Phase 25-01, Tasks 2+3
2026-05-04 11:26:39 +08:00
Research Assistant
1a6d936258 feat(25-03): wire repair to call build_index() after fixing source artifacts
- Add build_index() call at end of run_repair() when fix=True or fix_paths=True
- Add 'rebuilt' key to result dict initialization
- Add user-facing messages about repair completion and recovery path (MIG-04)
- Lazy import inside conditional block to avoid circular dependency
- Add tests: build_index called after fix, not called during dry-run,
  rebuilt in result, error fallback on build_index failure
2026-05-04 11:25:12 +08:00
Research Assistant
dbeb17f1bc feat(25-03): update Base views with lifecycle-based columns, filters, and sort order
- Replace has_pdf/do_ocr/analyze/ocr_status columns with lifecycle/maturity_level/next_step
- Update filters to use lifecycle states instead of raw status combinations
- Add sort by lifecycle ascending to all views
- Update PROPERTIES_YAML and _build_base_yaml properties
- Add sort YAML rendering in _render_views_section and merge_base_views
- Update existing filter tests to match lifecycle semantics
- Add tests: lifecycle columns, removed old columns, lifecycle filters, sort, properties
2026-05-04 11:23:38 +08:00
Research Assistant
3a695a5269 feat(25-01): add summarize_index() helper to asset_index.py
- New function summarize_index() reads canonical index and returns lifecycle,
  health, and maturity aggregates
- Returns None for missing or legacy bare-list index
- 4 new tests: aggregates, missing, legacy format, empty items

Phase 25-01, Task 1
2026-05-04 11:22:46 +08:00
Research Assistant
3f9ff0e14b test(24-02): add integration tests for derived state fields in index entries
- Add TestDerivedStateFields class with 6 test methods
- Verify lifecycle/health/maturity/next_step present after full build
- Verify same fields present after incremental refresh
- Verify lifecycle is a valid state string
- Verify health dict has four dimension keys
- Verify maturity structure (level, level_name, checks, blocking)
- Verify next_step is a valid action string
2026-05-04 10:43:43 +08:00
Research Assistant
bc7c1ba1e5 test(24-01): add failing tests for asset_state derivation functions
- Class TestComputeLifecycle: 8 tests covering indexed, pdf_ready, fulltext_ready, deep_read_done, ai_context_ready states
- Class TestComputeHealth: 4 tests covering all four health dimensions
- Class TestComputeMaturity: 6 tests covering levels 1-6 with blocking indicators
- Class TestComputeNextStep: 8 tests covering sync, ocr, /pf-deep, ready recommendations
- All 26 tests fail with ModuleNotFoundError (module not yet created)
2026-05-04 10:32:19 +08:00
Research Assistant
de153d2402 fix(23): use Beijing time (UTC+8) for index timestamp, fix test stub signature 2026-05-04 01:08:13 +08:00
Research Assistant
e1b54d7319 feat(23-03): add integration tests for incremental refresh across workers
- Add test_asset_index_integration.py with 9 tests:
  - refresh_index_entry preserves unrelated entries
  - refresh_index_entry appends new keys
  - refresh_index_entry falls back to build_index on legacy format
  - refresh_index_entry skips unknown keys gracefully
  - Structural checks for OCR, deep-reading, repair call sites
  - Workspace path fields present and consistent
- Fix indentation bug in repair.py (Rule 1 auto-fix from Task 3)
2026-05-04 00:55:17 +08:00
Research Assistant
b8a57eeb2e test(23-01): add tests for asset_index.py core functionality
- TestGetIndexPath: path resolution to indexes/formal-library.json
- TestBuildEnvelope: empty/with-items/count-matching/ISO timestamp
- TestAtomicWriteIndex: file creation, content correctness, atomicity
  on interrupt, parent dir creation, overwrite, lock timeout via threading
- TestBuildIndexEmpty: empty exports dir and absent exports dir return 0
  and write empty envelope
- 14 tests passing
2026-05-04 00:36:15 +08:00
Research Assistant
530629dff6 feat(22-01): implement config migration engine
- Add import shutil to config.py
- Add CONFIG_PATH_KEYS tuple for legacy top-level path keys
- Add migrate_paperforge_json() function with gap-fill logic
- Backs up original as paperforge.json.bak before writing
- Idempotent: no-op for already-migrated files
- Non-path top-level keys (version, agent_platform) survive migration
2026-05-03 22:41:13 +08:00
Research Assistant
8874a0ed30 test(22-01): add failing tests for config migration engine
- Legacy top-level keys migrate to vault_config block
- Idempotent: already-migrated files return False
- No paperforge.json returns False safely
- Non-path keys survive in output root
- vault_config block is created when missing
2026-05-03 22:39:45 +08:00
Research Assistant
aec5e160fe test(22-01): add failing tests for schema_version feature
- DEFAULT_CONFIG must contain schema_version: '2'
- CONFIG_KEYS must include schema_version
- get_paperforge_schema_version() defaults to 1 when key absent
- get_paperforge_schema_version() reads explicit value
- load_vault_config() excludes schema_version from output
2026-05-03 22:37:56 +08:00
Research Assistant
1af4924c52 chore: bump version to v1.4.13 2026-05-01 11:14:59 +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
248a0b6446 fix: restructure skills — separate pf-deep/pf-paper, add prefix substitution, create config_file on deploy 2026-04-28 18:33:11 +08:00
Research Assistant
0c90e40636 test: add integration smoke tests for multi-agent deploy 2026-04-28 16:27:31 +08:00
Research Assistant
aac31c4a76 test: add AGENT_CONFIGS format/prefix field tests, update expected agents 2026-04-28 16:13:58 +08:00
Research Assistant
ebc4fdeb00 chore: rename PaperForge Lite -> PaperForge across 27 files 2026-04-28 01:25:51 +08:00
Research Assistant
61df09c77f feat: add postprocess-pass2 molecule for validating Pass 2 output 2026-04-28 00:24:31 +08:00
Research Assistant
cc1f696ded feat: add fixed sub-headings to figure/table callout blocks in skeleton 2026-04-28 00:15:48 +08:00
Research Assistant
d82fc52521 feat: persistent OCR poll until completion; fix OpenCode commands for pip install; fix test hangs; add command_files to package 2026-04-27 22:52:03 +08:00
Research Assistant
94f00e990a fix: sync paperforge.json version to 1.4.0; fix update.py missing GITHUB_REPO/GITHUB_ZIP imports; remove PaperForge.base generation (duplicates Literature Hub) 2026-04-27 21:25:00 +08:00
Research Assistant
2bfbec691e fix: add zotero_dir to paperforge_paths() for PDF resolution; fix L3 diagnostic to skip schema check without file upload 2026-04-27 21:12:29 +08:00
Research Assistant
ee260e05f5 fix: L2 diagnostic accepts 400 as reachable (PaddleOCR rejects bare POST without fileUrl) 2026-04-27 20:41:49 +08:00
Research Assistant
13b3e142cc fix: OCR diagnostic L2 probe uses POST instead of GET (PaddleOCR rejects GET) 2026-04-27 20:34:47 +08:00