Package Multi-Authoring (Derived Co-Creator Credit)

Status: ✅ Shipped — slices 1–2 (derivation + count on cards and the Who drawer, c5f98bfa, 2026-08-17) and slice 3 (named co-creator list on the package detail page, 64cffd95, 2026-08-17). The cast's authors are credited too since C1 (93eee7954, 2026-09-10).

A package already bundles other people's work. package_view says so in a comment that has been true since the view was written:

The BOUND CHARACTER's creator, which is not creator_slug above (that is the package owner). A package may bundle another creator's character. — database/v1/views/29_package_view.sql:83-86

But every surface that renders a package names exactly one person. This doc makes the other contributors visible, without adding a roster anyone has to maintain.


Overview

A package is the platform's finished product — the unit a reader actually starts (packages.md). It is also, structurally, an assembly: a character, a mode, lorebooks, persona templates, each with its own creator, each of which may be someone other than the package owner.

Today that assembly is credited to the owner alone. The character's author gets no byline on the card, no name on the detail page, and no mention in the chat's Who drawer — even though the reader is talking to their character for the whole session. As packages become the main delivery path, silently absorbing other people's attribution is both wrong and an adoption problem: nobody lets their best character into someone else's package if the package erases them.


Design Goals

  1. Credit is derived, never administered. Contribution is a fact about what the package contains, read from the bindings that already exist. Contents change → credit changes, correctly, with nobody remembering to update a list.
  2. No new table. The join graph already carries every fact needed. Adding a package_co_creators roster would create a second source of truth that drifts from the bindings the moment someone swaps a lorebook.
  3. Cost matches the surface. Cards render in lists of dozens; detail renders once. Those get different reads (below), not one expensive read used twice.
  4. Reuse the attribution primitives. CreatorLink and AvatarStack already exist and already carry the profile-navigation and "+N" behaviors.

Non-Goals

Deliberately out of scope:


The design

Where credit comes from

The contributor set is the distinct creators of the package's bundled entities, minus the owner:

Contribution Path Creator column
Character packages.character_id → characters created_by_user_id
Mode packages.mode_id → prompt_modes created_by_user_id
Lorebooks package_lorebook_bindings → lorebooks created_by_user_id
Persona templates package_persona_template_bindings → persona_templates created_by_user_id
Trackers entity_tracker_bindings (owner_type = 6) → trackers created_by_user_id
Greeting packages.greeting_id → character_greetings owner_id

Greetings are counted from their own owner_id, not inherited from the character. That column is independent by construction — fn_upsert_character_greeting takes the owner as its own parameter, and a standalone greeting has no character at all — so "credited through their character" would silently drop a real author.

Excluded, deliberately:

Anonymized contributors (private contributions)

A package can bundle an entity that isn't public — a creator's unlisted lorebook, used with permission. Naming that person on a public card would disclose both their identity and the existence of their private work. Suppressing them entirely would under-credit the package and make the count lie.

So credit is by role when it can't be by name:

The count is identical either way — co_creator_count counts people, not public people, so the card's "and 3 others" stays honest without the view needing to know who's visible.

Two reads, split by cost

This is the load-bearing structural decision.

1. package_view precalculates the count. One scalar, co_creator_count, alongside the existing creator_slug / creator_username. Cheap enough to carry on every row of a browse list. This is what cards render, and it is all they need — a card says "by X and 3 others", never who the 3 are.

2. The detail page does its own select. A dedicated query (repository method, not a view column) returns the actual contributor list: slug, display name, avatar, and what each person contributed. Never joined into the list path.

The count and the list are therefore never the same read, and the expensive one only runs on the surface that displays it.

conversation_view needs the same co_creator_count for the Who drawer (below), on the same precalculated-scalar basis.

Surfaces

Package card — by {owner} and {n} others, collapsing to by {owner} when n = 0. CreatorLink gains an optional othersCount; the card and the Who drawer are two consumers of the same string, so it is extracted at the primitive on first implementation, not copied (rule of two).

Package detail — the full contributor list, with AvatarStack for the faces and each name linking to /creator/{slug}, annotated with the contribution ("Character", "2 lorebooks"). This is the surface that answers who and what.

Who drawer (chat) — on a package conversation the byline credits the package owner + count; anywhere else it credits the character's creator, unchanged.

The subject is the work being read, not the image on screen. A package conversation is a package experience — the character is one bundled component, and its creator is already inside the count when they're a different person. This is deliberately not keyed to the hero image: the hero prefers the package cover but falls back to the character avatar whenever the package has no cover, which is the common case (1 of 6 packages in the dev database has one). Keying the byline to the image would flip whose name appears based on whether cover art happened to be uploaded.


Implementation Plan (Sliced)

Divergence worth knowing: the derivation is written out twice — inline in fn_package_co_creator_count and again as package_contribution_view. Pointing the count at the view measured ~2x slower per browse row (an opaque function call cannot use the caller's package id to probe the view's branches), so the duplication was taken deliberately. PackageCoCreatorCountTests asserts the count always equals the contributor-list length across every contribution kind, which is what keeps the two from drifting.


Open Questions

Resolved:


Acceptance Criteria

The feature is not done until every box below is verified ✅ against the running product.

User use cases — satisfiable + accessible (verify by driving the UI, not the code):

Behavior:

Invariants that must stay true (carve-outs):

Edges: