Commit graph

143 commits

Author SHA1 Message Date
Research Assistant
2aea1150d2 test: verify annotation persistence across memory rebuild
- TestMemoryRebuildSurvival proves annotations in annotations.db survive
  a full memory layer drop_all_tables + rebuild cycle, because the two
  databases are independent
2026-05-20 15:51:53 +08:00
Research Assistant
d2bfed9d12 feat: add annotation cli commands
- paperforge/cli.py                   adds annotation subparser with 7 subcommands
- paperforge/commands/annotation.py   dispatch + command implementations
  - import/list/create/patch/delete/export/status
  - all support --json output via PFResult envelope
- tests/cli/test_annotation_commands.py  10 tests: parser validation + integration
  create/list/patch/delete lifecycle
2026-05-20 15:51:32 +08:00
Research Assistant
f880d50092 feat: add annotation service
- paperforge/annotation/service.py  create/patch/delete/list/get/export
  - create_annotation()          local annotation with UUID
  - patch_annotation()           comment/color/tags only, enforces readonly guard
  - delete_annotation()          soft delete
  - get_annotation()             single row lookup
  - list_annotations()           filtered by paper/page/type
  - export_annotations_json()    JSON serialization
  - export_annotations_markdown() Markdown serialization
- tests/unit/annotation/test_service.py  11 tests: create, patch, readonly
  enforcement, soft/hard delete, list filtering, JSON/MD export
2026-05-20 15:48:20 +08:00
Research Assistant
ed869dffaa test: add fixture-driven annotation import coverage
- fixtures/zotero/build_test_db.py  generates minimal Zotero SQLite with
  highlight/underline/note annotations and tags
- tests/integration/test_annotation_import_workflow.py  end-to-end probe→import→verify
  pipeline using a real SQLite fixture (generated on demand, not checked in)
- .gitignore  excludes generated *.sqlite from fixtures/zotero
2026-05-20 15:47:13 +08:00
Research Assistant
c708e00184 feat: add annotation import reconciliation
- paperforge/annotation/importer.py  stable upsert by id, version tracking,
  soft-delete of stale rows, cross-source isolation
- paperforge/annotation/service.py   mark_deleted, hard_delete, list
- tests/unit/annotation/test_importer.py  5 tests: import, noop, update,
  soft-delete, source isolation
2026-05-20 15:46:06 +08:00
Research Assistant
85918eba14 feat: add zotero annotation probe
- paperforge/annotation/probe.py  read-only Zotero SQLite query layer
  - open_readonly()              URI mode=ro connection
  - copy_db_to_temp()            safe copy before reading
  - fetch_annotations()          SQL JOIN across items/itemAnnotations/itemAttachments
  - _fetch_tags()                tag aggregation
  - normalize_annotation_row()   type mapping + position JSON parsing
- tests/unit/annotation/test_probe.py  fixture-driven tests with minimal Zotero DB
2026-05-20 15:45:11 +08:00
Research Assistant
0efd6c83f6 feat: add annotation schema
- paperforge/annotation/schema.py  DDL, indexes, FTS5, sync_queue, version lifecycle
- ANNOTATIONS_SCHEMA_VERSION = 1, independent from memory layer
- FTS triggers on insert/update/delete for selected_text + comment + tags_json
- Schema is never dropped during memory rebuild
2026-05-20 15:43:14 +08:00
Research Assistant
771fff0111 feat: add annotation db helpers
- paperforge/annotation/__init__.py  package marker
- paperforge/annotation/db.py        path resolution and connection helpers
  (get_annotations_db_path, get_annotations_connection)
- tests/unit/annotation/test_schema.py  DB path, WAL, read-only tests
2026-05-20 15:41:18 +08:00
Research Assistant
3729381fd5 feat: add hardcoded-path audit gate with pre-commit hook
- New tests/audit/test_hardcoded_paths.py detects config-driven path
  literals hardcoded in Python source files
- Pre-commit hook runs the audit automatically before every commit
- Fixed three existing violations:
  paperforge/commands/sync.py    -> use paperforge_paths()
  paperforge/commands/dashboard.py -> use paperforge_paths()
  paperforge/worker/discussion.py  -> use paths.get('index')
2026-05-20 15:39:21 +08:00
Research Assistant
63c6be3f78 feat(skill): add version field to SKILL.md frontmatter and bootstrap, with pre-flight version check 2026-05-19 15:54:04 +08:00
Research Assistant
819f51ed95 test(skill): add skill graph contract tests 2026-05-19 14:44:56 +08:00
Research Assistant
2912acbb5e refactor(skill): add atoms and molecules directories 2026-05-19 14:42:35 +08:00
Research Assistant
29a7e195c6 fix: add return type annotation to main() and indent=2 to early-exit json.dump calls 2026-05-19 14:41:06 +08:00
Research Assistant
261e92a788 feat(bootstrap): add capability probes to bootstrap output
Adds a capabilities block to the bootstrap JSON with runtime probes:
- rg: checks if ripgrep is available
- metadata_search: always True (vault config present)
- paper_context: always True
- semantic_enabled/semantic_ready: derived from plugin data.json

Test verifies the contract with an isolated tmp_path vault.
2026-05-19 14:36:05 +08:00
Research Assistant
798e048a8d feat(sync): auto-detect orphan papers after sync, show modal in Obsidian
- prune.py: _enrich_orphan_preview() reads note frontmatter for metadata
- sync_service.py: always run dry-run prune, include in result
- sync.py: write sync-orphan-state.json for plugin consumption
- main.js: add checkOrphanState() + PaperForgeOrphanModal with select/toggle
- styles.css: orphan modal styles (list, tags, dimmed rows)
- cli.py: add --keys to prune command for targeted deletion
2026-05-19 00:31:19 +08:00
Research Assistant
24f72e7d91 test(prune): add SyncService prune integration tests 2026-05-18 21:58:57 +08:00
Research Assistant
20ff03ed8e fix(prune): protect dir iteration, add OSError handling, improve test coverage 2026-05-18 21:53:14 +08:00
Research Assistant
f10d36d205 feat(prune): core orphan paper cleanup module 2026-05-18 21:48:18 +08:00
Research Assistant
9f013b4cff feat(plugin): render discussion card from .md with MarkdownRenderer 2026-05-18 21:12:06 +08:00
Research Assistant
5ba9ac92c3 feat(discussion): remove JSON output and markdown escaping 2026-05-18 21:09:54 +08:00
Research Assistant
18aa0073c1 Merge branch 'paperforge-stabilization'
# Conflicts:
#	paperforge/memory/vector_db.py
2026-05-18 18:47:07 +08:00
Research Assistant
387a87fef0 fix(test): correct patch target in test_retrieve — must patch embedding.get_embed_status, not status.get_embed_status, because retrieve.py imports from __init__ re-export 2026-05-18 17:38:23 +08:00
Research Assistant
98caa83954 test: update vector_db test imports to embedding package 2026-05-18 17:23:37 +08:00
Research Assistant
efc8da0b12 docs: reset documentation IA (readme entry pages, tutorial/troubleshooting split, AGENTS agent-only, pure command ref, maintainer guide)
Separate audiences: README as navigation entry, getting-started as canonical tutorial,
troubleshooting as failure recovery, AGENTS as agent-only operating contract,
COMMANDS as pure reference, maintainer-guide for release/versioning/architecture.
2026-05-16 22:47:00 +08:00
Research Assistant
ed95e0f565 feat: runtime contract hardening + skill/command truth alignment (Package A+B)
Atomic snapshots, canonical index mutation serialization, sync post-clean truth,
plugin path config-awareness, embed stop signal honesty, full snapshot bootstrap,
pf_ prefix unification, workflow command/lifecycle/path corrections,
mechanical/cognitive route separation with unknown-command guard.
2026-05-16 22:38:43 +08:00
Research Assistant
03cc2d2efd feat: add runtime-health CLI command 2026-05-15 01:16:16 +08:00
Research Assistant
e57f7b9e4b feat: add layered runtime health computation 2026-05-15 01:15:39 +08:00
Research Assistant
1be3b99464 feat: persist embed lifecycle and add stop command 2026-05-15 01:15:07 +08:00
Research Assistant
6c58493ff6 feat: add persistent vector build state helpers 2026-05-15 01:13:12 +08:00
Research Assistant
e91dfd8c45 perf: refresh_paper accepts entry dict, skip full index read 2026-05-13 16:58:39 +08:00
Research Assistant
d4df673088 feat(memory): dashboard reads from SQLite + incremental refresh_paper() 2026-05-12 20:08:46 +08:00
Research Assistant
2b91e09996 feat(memory): add agent context query module 2026-05-12 19:55:58 +08:00
Research Assistant
6c6b8ce7a1 feat(frontmatter): add citation_key field and alias from BBT citationKey 2026-05-12 18:28:53 +08:00
Research Assistant
65cbf867e6 test(memory): add integration test for memory build/status workflow 2026-05-12 17:59:37 +08:00
Research Assistant
afcbd3ce27 feat(memory): add query module for paper lookup and status check 2026-05-12 17:47:30 +08:00
Research Assistant
f6bc234aa7 feat(memory): add builder module that populates SQLite from formal-library.json 2026-05-12 17:44:03 +08:00
Research Assistant
fb17c58020 feat(memory): add schema module with table definitions and tests 2026-05-12 17:40:10 +08:00
Research Assistant
ed0da99207 test: update fixtures to {key}.md filename format (red phase) 2026-05-11 21:09:36 +08:00
Research Assistant
7933ad8c68 test: update headless_setup tests for refactored literature-qa skill directory
Refactored deploy_skills service creates a single literature-qa skill dir

instead of individual pf-deep/pf-paper/etc. Update all 4 agent

platform tests to check for literature-qa instead of old names.
2026-05-11 00:18:24 +08:00
Research Assistant
2f0f417b7c fix(setup,test): replace orphaned imported_skills variable and update bootstrap test
headless_setup Phase 7 used imported_skills which was removed during

skill_deploy refactor. Use skill_result['skill_deployed'] instead.

Also update bootstrap test that asserted old command_files string.
2026-05-11 00:11:00 +08:00
Research Assistant
232dd1f453 test: update AGENT_CONFIGS tests for refactored AGENT_SKILL_DIRS flat dict
Setup wizard no longer defines AGENT_CONFIGS; the refactored

skill_deploy.py exports AGENT_SKILL_DIRS instead. Update

test imports and assertions accordingly.
2026-05-11 00:05:59 +08:00
Research Assistant
cfe00a9a64 test: update bootstrap test to match fixed agents_src code 2026-05-10 21:05:05 +08:00
Research Assistant
59a024abba refactor(skills): modular literature-qa skill with router-first architecture
- Replace 6 scattered pf-*.md files with single SKILL.md router + 4 reference files
- Add paper_resolver.py: deterministic key/DOI/field search (4 subcommands)
- Remove pf-sync/ocr/status (CLI-only commands, no skill wrapper needed)
- Move chart-reading/ into references/ for flat structure
- Make ld_deep.py --vault optional (auto-detect from cwd)
- Add 26 unit tests for paper_resolver
- All paths dynamically resolved from paperforge.json, zero hardcoding
2026-05-10 20:56:28 +08:00
Research Assistant
06ef31271e hotfix(base): stop regenerating Base views on every sync — prevents duplicate views and preserves user column widths
- ensure_base_views now only creates files on first run; subsequent calls
  only update folder filter, leaving views untouched
- merge_base_views gains width preservation for PF views (backup safety)
- Removed deprecated control_dir from test_setup_wizard (5 cases)
- Fixed NoneType stdout in test_doctor_runs
- Added paperforge status reference to README

Obsidian handles view data from frontmatter changes automatically;
PaperForge should not regenerate views on every sync.
2026-05-10 02:59:41 +08:00
Research Assistant
4f3eb7ebe5 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
90bab3795a fix: test_migration expects run_index_refresh dict return (v2.1) 2026-05-09 22:57:57 +08:00
Research Assistant
42c7078eff fix: e2e test_index_refresh expects dict return (v2.1) 2026-05-09 22:54:10 +08:00
Research Assistant
c62da3f7ef fix: e2e test expects run_selection_sync dict return (v2.1) 2026-05-09 22:49:54 +08:00
Research Assistant
a990aa6205 fix: update test_paperforge_paths_returns_exact_keys for new config/index keys 2026-05-09 22:46:56 +08:00
Research Assistant
2b3adf7c2c fix: CI dispatch tests — mock at SyncService level, restore --selection/--index flags 2026-05-09 22:42:53 +08:00