Skip to content

v0.3.0 — structure-edit, destructive & blog CRUD tools

Choose a tag to compare

@CyberGitJul CyberGitJul released this 20 Jul 16:08
· 79 commits to main since this release
ae71671

Highlights

This release grows the server from 16 to 28 MCP tools — 25 always-on plus 3 destructive tools behind an opt-in gate — adds a full blog-post CRUD surface, and introduces a ruff lint/format gate across the codebase. 193 tests green.

Wave 3 — structure-edit & destructive tools (#2)

  • gramps_set_family_parent — set the father/mother handle of an existing family. role is an explicit bloodline slot (never inferred from gender); returns the previous handle. Non-destructive (PUT).
  • gramps_remove_child_from_family — remove a child reference; raises ChildNotInFamilyError if the person isn't a child of that family. Non-destructive (PUT).
  • gramps_delete_person (destructive) — strict confirm is True plus a people-count guard; also cleans up notes orphaned by the deletion (shared notes are kept, reported via deleted_notes).
  • gramps_delete_family (destructive) — families-count guard; refuses to delete while children are still attached (FamilyNotEmptyError).

Destructive tools are hidden unless GRAMPS_ENABLE_DESTRUCTIVE=1 is set — they are not registered at all in the default deployment.

Wave 4 — blog CRUD & name fields (#3)

Blog posts (a Gramps Source tagged Blog with an HTML body note):

  • gramps_create_blog_post, gramps_list_blog_posts, gramps_get_blog_post, gramps_update_blog_post (partial read-modify-write, type-preserving), gramps_delete_blog_post (destructive, env-gated, orphan-note cleanup).
  • Body rendering is controlled by GRAMPS_BLOG_BODY_FORMAT (html | text). HTML is sanitized through a bleach allow-list (keeps p/strong/a[href], strips script/img/on* handlers) — XSS-safe.

Name fields:

  • gramps_set_first_name (G12)
  • gramps_add_alternate_name (G13a) — generalizes the former add_birth_name, which stays as an alias.
  • gramps_swap_primary_name (G13b) — swaps primary_name with an alternate name by index.

Tooling & fixes

  • Lint gate: ruff lint + format as a GitHub Action, pre-commit / pre-push hooks, and a required merge check on main (#3).
  • Docker fix: the image now copies gramps_blog.py, so the container no longer crashes on import (#4).

Known limitation

Flipping GRAMPS_BLOG_BODY_FORMAT between html and text on an existing post can render the stored body as an escaped literal — see docs/blog-crud.md §7.1.

Full changelog: v0.2.0...v0.3.0