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_slugabove (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
- 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.
- No new table. The join graph already carries every fact needed. Adding a
package_co_creatorsroster would create a second source of truth that drifts from the bindings the moment someone swaps a lorebook. - Cost matches the surface. Cards render in lists of dozens; detail renders once. Those get different reads (below), not one expensive read used twice.
- Reuse the attribution primitives.
CreatorLinkandAvatarStackalready exist and already carry the profile-navigation and "+N" behaviors.
Non-Goals
Deliberately out of scope:
- An invite / accept flow. Nobody is "added as" a co-creator. If your entity is in the package, you are credited; if it is removed, you are not. Consent to being credited is the same act as publishing the entity in the first place.
- Per-contributor permissions on the package. Credit ≠ access. Editing rights
already live in
entity_permissions/project_membersand are untouched here. A co-creator gets a byline, notcan_edit. - Revenue or tip splitting. Creator tips currently resolve to one recipient
(
fn_resolve_tip_recipient). Whether a package tip splits across contributors is a commercial decision — see Open Questions, not this spec. - Manual credit for non-bundled contribution (an editor, a proofreader, an artist whose work isn't an entity). Real, but it needs the roster this design rejects; it would be a separate, additive feature.
- Contribution weighting / ordering by significance in v1. Deterministic ordering only (below).
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:
- Model profiles (
package_model_profiles→model_profiles.owner_id) — configuration (provider, model, sampler settings), not authored story content. Binding someone's preset is not co-authorship. - The platform System account (
created_by_user_id = 0, the sentinel behind seeded system modes and lorebooks). Binding the built-in "Beat Director" mode must not credit a phantom human. Same> 0convention asadmin_users_view/prompt_mode_view. This matters in the mainline: hybrid-pipeline packages bind system modes by default.
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:
- A contributor is named (slug, display name, avatar, profile link) if at least one of their contributions to this package is publicly visible.
- Otherwise they are counted but not named — rendered as a role label derived from what they contributed: "another lorebook owner", "another character's creator". No name, no slug, no avatar, nothing that resolves to a profile.
- The per-contributor contribution annotation lists only their public contributions. A person credited via a public character never has their private lorebook listed alongside it.
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)
- Slice 1 — derivation + count. ✅
co_creator_countonpackage_viewandconversation_view, viafn_package_co_creator_count. - Slice 2 — cards + Who drawer. ✅
CreatorLink.othersCount; wired intoPublicPackageCardandWhoDrawer(including the package-conversation subject fix). - Slice 3 — detail list. ✅
package_contribution_view+fn_package_contributors,IBrowseRepository.GetPackageContributorsAsync, theContributorsfield onPublicPackageDetail, and the Co-creators section inPackageDetailContent. Anonymization is enforced in SQL.
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
- Should a package tip split across contributors? Decided 2026-10-28 (owner): a per-package boolean the
package owner sets, split tips across contributors, on by default. Off, tips resolve to the owner as
today (
fn_resolve_tip_recipient). The split itself (shares, rounding, anonymity per leg) needs its design on top of the tip batch (fn_send_tip_batchlegs) before build. - Ordering. Proposed default: contribution count desc, then slug asc — stable and non-judgmental. Confirm before build.
Resolved:
- ✅ Private contributors are credited by role, not by name (decided 2026-08-15) — see Anonymized contributors above.
- ✅
packages.persona_template_idis not a live inconsistency. The singular column in21_tables_packages.sqlpoints atpersonas, but26_tables_persona_templates.sql:88drops it later in the run order and replaces it with the N:Mpackage_persona_template_bindingstable, which correctly targetspersona_templates. The column exists in no database, fresh or migrated, and no code reads it. The derivation reads the bindings table.
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):
- As a reader browsing packages, I can see that a package has multiple authors — from the browse card, without opening the package.
- As a reader on a package detail page, I can see every contributor and what each one contributed, and reach any of their profiles in one click.
- As a reader in a package conversation, the Who drawer credits the package's authors — reachable without opening the gear menu.
- As a creator whose character was bundled into someone else's package, I can find my name on that package's public card and detail page without being told where to look.
Behavior:
-
package_view.co_creator_countreturns the number of distinct creators of the bundled character / mode / lorebooks / persona templates, excluding the owner. - Adding a bundled entity authored by a new person increments the count with no other action taken; removing it decrements it.
- The package detail response lists each contributor with slug, display name, avatar, and their contribution — and the browse/list path does not issue that query.
- A package conversation's Who drawer byline names the package owner + count; a non-package conversation's byline still names the character's creator.
- Model profiles and greetings do not produce contributors.
- A contributor whose every contribution is non-public is counted in
co_creator_countbut rendered as a role label — no name, slug, avatar, or profile link anywhere in the detail response payload, verified by inspecting the JSON. - A contributor with one public and one private contribution is named, and the private contribution is absent from their listed contributions.
Invariants that must stay true (carve-outs):
- A single-author package (owner authored everything) renders exactly as it does
today —
by {owner}, no "and 0 others", no empty contributor section. - Credit grants no access: a co-creator gains no read, edit, or manage right on the package, verified by hitting the package write endpoints as a co-creator and getting 403.
- Browse list performance is unchanged in shape — one query per page, no per-row contributor fan-out. Verified against the query count, not by feel.
- No new table is introduced; removing every binding removes every derived co-creator.
- A private contribution never discloses its owner's identity on any public surface — card, detail, Who drawer, or OpenGraph — and never discloses that the private entity exists. Verified as an anonymous viewer, not just logged-out-in-the-same-browser.
Edges:
- A package with no bundled entities ("bring your own") shows
by {owner}and an empty (not broken) contributor section. - A contributor whose account was deleted does not produce a blank name, a broken
avatar, or a link to
/creator/null. - A bundled entity whose creator is the owner never double-counts the owner.
- The same person contributing four entities counts once.