Skip to content

fix(literature): preserve book types in BibTeX export - #309

Merged
mikamikasuki merged 2 commits into
mikamikasuki:mainfrom
Uddoo:fix/bibtex-book-types
Oct 21, 2026
Merged

mikamikasuki merged 2 commits into
mikamikasuki:mainfrom
Uddoo:fix/bibtex-book-types

Conversation

@Uddoo

@Uddoo Uddoo commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Problem and change

Fixes #107.

Crossref book imports lost their publication type, and the shared BibTeX exporter always emitted @article. Preserve the source type and editors, and export known book types as @book with publisher and editor metadata. BibTeX and RIS book imports retain the same information, including RIS BOOK, EBOOK, and EDBOOK.

Journal articles keep their existing journal, volume, issue, and page fields. Records without a publication type retain the existing article fallback; this does not infer or migrate metadata that was already missing from historical records. No schema or dependency changes are included.

Validation

Implementation and validation used OpenAI Codex. The independent reviews were automated source reviews; no human review or manual validation is claimed.

  • Regression proof on base d0353815faa94e998e8ac7db47bdc8ce7ba82af4: 9 failures, 3 passes, including the real isolated Library API/SQLite scenario. The initial automated review found two additional RIS aliases; both new cases failed before the correction and now pass.

  • 38 related checks passed on Ubuntu 24.04 WSL / Python 3.12.3, using the unmodified pinned requirements.lock.txt:

    python -m pytest tests/test_literature_sources.py tests/test_library_pdf_import.py tests/test_bibtex_publication_types.py tests/test_api_contracts.py tests/test_api.py -k "not test_isolated_api_scenario or library" -q --tb=short
    

    This exercises the actual import endpoint, persisted SourcePaper metadata, and export endpoint. The DOI response is controlled only at the HTTP retrieval seam. Four Library scenarios run in independent interpreter/database processes; 46 unrelated API scenarios are deselected.

  • 23 literature checks passed on Windows 11 / Python 3.11.9:

    python -m pytest tests/test_bibtex_publication_types.py tests/test_literature_sources.py tests/test_library_pdf_import.py -q --tb=short
    
  • A separate live smoke used the actual Crossref DOI from the issue, 10.1017/cbo9781139046855, through the real API with a disposable SQLite database: import/export both returned HTTP 200, the persisted type was edited-book, and parsed output was @book with publisher and two editors.

  • python scripts/export_api_contract.py --check passed: 185 operations across 142 paths. CLI --help, compilation of changed Python files, and git diff --check passed.

  • Frontend checks on Windows / Node 24.16.0: npm --prefix apps/web run build passed; npm --prefix apps/web test passed 102 tests in 20 files. No frontend source or appearance changes are included.

  • Independent review of the final correction 9a88da8580e4a53f2214223e891d79f0705b932d marked the prior RIS finding RESOLVED, reported no P0-P3 findings in that correction, and returned ACCEPT / HIGH confidence. The earlier full-candidate review found no other actionable defect.

Limits and baseline comparison

The full Linux suite was attempted and then interrupted after repeated execution-environment failures: 23 failed, 310 passed, 7 skipped at that point. It did not complete, and this is not a full-suite pass.

The 23 observed failed test identities were rerun individually at exact base d0353815faa94e998e8ac7db47bdc8ce7ba82af4, in the same Linux virtual environment. All 23 reproduced. Failure messages match after normalizing checkout paths and generated IDs. They report missing /usr/bin/bwrap, dependent worker failures, or waiting for worker states that never arrive. The task-owned test processes were cleaned up. Bubblewrap-dependent execution, PostgreSQL, macOS, browser interaction, and scientific/provider validation are not established by this change.

Exact full-suite failures reproduced on the base
tests/test_agent_action_attribution.py::test_edited_action_attribution_and_replay[json]
tests/test_agent_action_attribution.py::test_edited_action_attribution_and_replay[native]
tests/test_agent_context_progress.py::test_actual_file_reads_remain_visible_across_compaction
tests/test_agent_context_progress.py::test_read_cycle_feedback_uses_actual_unchanged_values
tests/test_agent_context_progress.py::test_optional_observation_ledger_cannot_crowd_out_native_exchange
tests/test_agent_context_progress.py::test_tool_text_excerpt_is_explicit_and_does_not_mutate_observation
tests/test_agent_context_progress.py::test_actual_wait_control_does_not_become_process_success_receipt
tests/test_agent_goal_provenance.py::test_actual_worker_retains_consumed_goal_context_across_edit_resume_and_api_restart[normal]
tests/test_agent_goal_provenance.py::test_actual_worker_retains_consumed_goal_context_across_edit_resume_and_api_restart[queued_edit]
tests/test_agent_goal_provenance.py::test_actual_worker_retains_consumed_goal_context_across_edit_resume_and_api_restart[continuation]
tests/test_agent_goal_provenance.py::test_actual_worker_retains_consumed_goal_context_across_edit_resume_and_api_restart[continuation_unchanged]
tests/test_agent_goal_provenance.py::test_actual_transport_failure_and_paging_keep_distinct_delivery_receipts[failed_turn]
tests/test_agent_goal_provenance.py::test_actual_transport_failure_and_paging_keep_distinct_delivery_receipts[paged_goal]
tests/test_agent_output_recovery.py::test_actual_recovery_components[chunks]
tests/test_agent_output_recovery.py::test_actual_recovery_components[transport]
tests/test_agent_output_recovery.py::test_actual_recovery_components[dynamic-steps]
tests/test_agent_processes.py::test_agent_finish_waits_for_child_through_real_worker
tests/test_agent_processes.py::test_metric_file_written_by_agent_requires_successful_real_process
tests/test_agent_processes.py::test_nonmetric_research_output_does_not_require_process_execution
tests/test_agent_progress_recovery.py::test_redundant_read_detection_ignores_limits_but_respects_changed_evidence
tests/test_agent_progress_recovery.py::test_actual_process_summary_and_task_survive_large_read_compaction
tests/test_automatic_context.py::test_required_original_controls_are_fully_retrievable_before_other_actions
tests/test_automatic_context.py::test_large_actual_tool_output_and_native_exchange_are_retained_in_full

npm audit reports the existing source-map-js advisory GHSA-68fv-2mgg-jv7q. The exact base reports the same advisory, and apps/web/package-lock.json has the same Git blob ID (249499f6a41f4ab4f99b7e6ada4d05cd32383862) in both checkouts.

The Windows-only setup could not install the lock's POSIX-only uvloop, and the application imports termios; API validation therefore ran on Linux with the complete lock, rather than substituting those modules. No paid model, existing user research project, or working database was used.

@mikamikasuki
mikamikasuki merged commit 9b9feea into mikamikasuki:main Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BibTeX export labels imported books as journal articles

2 participants