Persist author + tags on /admin/notes; expose revision history endpoints#28
Merged
AdaInTheLab merged 1 commit intomainfrom Apr 20, 2026
Merged
Persist author + tags on /admin/notes; expose revision history endpoints#28AdaInTheLab merged 1 commit intomainfrom
AdaInTheLab merged 1 commit intomainfrom
Conversation
…ry endpoints Extend the notes backend so admin UIs can set author identity and tags directly (previously only the markdown-sync path wrote them), and surface the append-only revision ledger that was already being written but not read. Changes: - Schema v11 → v12: add author_name + author_kind columns to lab_notes; v_lab_notes view exposes them; v7 + v8 table rebuilds carry them so fresh installs and legacy migrations both end up consistent - POST /admin/notes now accepts author_name, author_kind, tags; COALESCE preserves existing author fields when omitted so markdown-sync stays authoritative; tags use a delete+reinsert on lab_note_tags when a tags array is provided - Hard rule: type="tail" requires a non-empty author_name (rejected 400 otherwise) - GET /admin/notes and GET /admin/notes/:slug now return author_name, author_kind, and a tags[] array - New: GET /admin/notes/:slug/revisions lists the ledger (revision_num, source, intent, auth_type, content_hash, length, created_at) with current/published pointers on the envelope - New: GET /admin/notes/:slug/revisions/:revId returns the full revision content for diff/restore UI to build on All 41 tests pass. Co-authored-by: Sage <sage@thehumanpatternlab.com>
😼 Carmel Judgment Stamp™🟪 Carmel Judgment Stamp™
This automated judgment has been issued by the Chief Judgment Office (CJO). |
4 tasks
This was referenced Apr 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extend the notes backend so admin UIs can set author identity and tags directly (previously only the markdown-sync path wrote them), and surface the append-only revision ledger that was already being written but not read.
Changes
Schema (v11 → v12)
author_name+author_kindcolumns tolab_notesv_lab_notesview to expose themPOST /admin/notesauthor_name,author_kind,tagsCOALESCEpreserves existing author fields when omitted — markdown-sync stays authoritative, admin form doesn't wipe sync-authored valueslab_note_tags(only when atagsarray is provided)type="tail"requires a non-emptyauthor_name(400 otherwise)lab_note_revisionsnow includes author + tagsGET /admin/notes+/admin/notes/:slugauthor_name,author_kind, and atags[]arrayNew: revision history endpoints
GET /admin/notes/:slug/revisions?locale=en— revision list (revision_num,source,intent,auth_type,content_hash,content_length,created_at) withcurrent_revision_id/published_revision_idpointers on the envelopeGET /admin/notes/:slug/revisions/:revId?locale=en— full revision (content_markdown+frontmatter_json+ metadata)Both protected with
requireAdmin. Consumed by the frontend's newRevisionHistorycomponent (see companion PR).Testing
addedColumnsis empty on second run — caught my first attempt where the v8 rebuild was dropping the new columns)Breaking changes
None — columns are additive, endpoint changes are opt-in, existing admin clients continue to work unchanged.
Related
Frontend consumer: the-human-pattern-lab#feat/post-notebook-polish uses these endpoints for the Tails author_name field and the new revision history viewer.
Co-authored-by: Sage sage@thehumanpatternlab.com