Skip to content

Add SQLite-backed bidirectional sync tool for PreTeXt book structure/content#137

Open
Copilot wants to merge 6 commits intomainfrom
copilot/create-database-for-pretext-book
Open

Add SQLite-backed bidirectional sync tool for PreTeXt book structure/content#137
Copilot wants to merge 6 commits intomainfrom
copilot/create-database-for-pretext-book

Conversation

Copy link
Contributor

Copilot AI commented Feb 19, 2026

  • Review new PR comments and identify actionable requests
  • Re-check repository tooling and relevant files for minimal change scope
  • Add conflict-path logging in the sync tool when --prefer none detects conflicts
  • Run targeted validation for the conflict scenario and existing sync workflow
  • Commit the minimal change and reply to the addressed PR comment
  • Run code review/security checks and finalize

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 19, 2026 20:23
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
Copilot AI changed the title [WIP] Develop database structure for Pretext book Add SQLite-backed bidirectional sync tool for PreTeXt book structure/content Feb 19, 2026
Copilot AI requested a review from geoff-cox February 19, 2026 20:25
@geoff-cox geoff-cox marked this pull request as ready for review February 19, 2026 21:04
Copilot AI review requested due to automatic review settings February 19, 2026 21:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a SQLite-based bidirectional synchronization tool for managing PreTeXt book content between source files and a database. The tool is designed as a beginner-friendly workflow utility for solo authors and small teams to inspect and edit book content via database queries while maintaining sync with the source .ptx files.

Changes:

  • Adds a new Python sync utility with init/pull/push/sync commands and conflict detection/resolution
  • Provides comprehensive documentation explaining the database schema, sync strategy, and practical workflows
  • Updates .gitignore to exclude Python cache files for the new tooling

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
processing-tools/book-db-sync/book_db_sync.py Core sync utility implementing bidirectional sync with hash-based conflict detection, path traversal protection, and parameterized SQL queries
processing-tools/book-db-sync/README.md Documentation covering database schema, sync strategy, usage examples, and practical workflows
.gitignore Adds Python cache files (pycache/, *.pyc) to gitignore

Comment on lines 350 to 352
else:
conflicts += 1
continue
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When conflicts are detected with prefer="none", only the count is reported without identifying which specific files have conflicts. Consider logging the conflicting file paths to help users identify and resolve conflicts more easily. For example, print a warning message with the href when a conflict is detected.

Copilot uses AI. Check for mistakes.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot apply changes based on this feedback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in b65b45e. The sync tool now prints the specific conflicting href whenever sync --prefer none detects a conflict, so you can immediately see which file needs resolution.

geoff-cox and others added 2 commits February 20, 2026 16:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: geoff-cox <63681414+geoff-cox@users.noreply.github.com>
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.

3 participants