Skip to content

fix: include author_name + author_kind in public /lab-notes SELECTs#30

Merged
AdaInTheLab merged 1 commit intomainfrom
fix/public-author-fields
Apr 30, 2026
Merged

fix: include author_name + author_kind in public /lab-notes SELECTs#30
AdaInTheLab merged 1 commit intomainfrom
fix/public-author-fields

Conversation

@AdaInTheLab
Copy link
Copy Markdown
Owner

Summary

Public `/lab-notes` responses are missing the `author` field — surfaced today on ironkitsune.tech where every tail rendered as "UNKNOWN". The `v_lab_notes` view already exposes `author_name` + `author_kind` (PR #28) and the `mapToLabNotePreview` / `mapToLabNoteView` mappers already construct `author: { kind, name? }` when those values are present. The bug was simply that the public endpoint SQL never included those columns in the SELECT, so the row reaching the mapper had `undefined` for both.

Changes

  • `GET /lab-notes`: add `author_name, author_kind` to both `sqlAll` and `sqlByLocale`
  • `GET /lab-notes/:slug`: same

Testing

  • Typecheck clean
  • All 41 tests pass

After deploy

Hit `https://api.thehumanpatternlab.com/lab-notes?type=tail\` and you should see an `author` object on rows that have it set in the DB.

If `author` is still missing after this lands, the data isn't in the DB — separate issue (likely the iron-nine-tails skill not sending `author_name` in its POST payload). Slug parsing as a defensive fallback on the rendering side is also reasonable given slugs already encode the voice (e.g. `koda-claiming-without-confirming`).

Co-authored-by: Sage sage@thehumanpatternlab.com

The v_lab_notes view exposes author_name + author_kind (added in PR #28),
and the LabNoteView mapper renders them into the response's `author`
field — but the public endpoint SELECTs were never updated to ask for
those columns. Result: every public response was missing the `author`
field even when the underlying row had it set.

Add author_name + author_kind to:
- GET /lab-notes (both sqlAll + sqlByLocale paths)
- GET /lab-notes/:slug

Mapper already handles them (returns `author: { kind, name? }` when
author_kind is truthy), so no other changes needed. ironkitsune.tech
(and any other public consumer) will now see `author` in the response
instead of "UNKNOWN" fallbacks.

Co-authored-by: Sage <sage@thehumanpatternlab.com>
@github-actions
Copy link
Copy Markdown

😼📘 Carmel Epistemic Stamp™

📘 Carmel Epistemic Stamp™
😼📘💬 "Your logic is sound… shockingly."

PR: #30fix: include author_name + author_kind in public /lab-notes SELECTs
Author: @AdaInTheLab

This automated judgment has been issued by the Chief Judgment Office (CJO).

@AdaInTheLab AdaInTheLab merged commit eb027ad into main Apr 30, 2026
2 checks passed
@AdaInTheLab AdaInTheLab deleted the fix/public-author-fields branch April 30, 2026 08:28
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.

1 participant