Repository navigation
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Move tag assignments out of the tag-assignments cross-reference sheet and into a field on the record they tag, e.g. tags = ["topic.transit", "tech.python"] on each project and person. We want this; the open work is to assess the downsides and measure the effect on common queries before committing to it.
Why
- An assignment is a bare link.
TagAssignmentholdstagId,taggableType,taggableId, an optionalassignedByIdandcreatedAt. It's edited at the same moment, by the same person, as the record it tags (the project or profile edit form). - Deletes leave orphans. Removing a project or person means finding and deleting its assignment files separately. Cleaning up three spam projects on 2026-10-15 (data commit
0a2182df61) meant hunting down 8 stray assignment files, and purge needs its own tag-assignment step inproject-purge.ts/person-purge.ts. With an array field, deleting the record takes its tags with it. - File count.
publishedholds 7,725 assignment files (6,632 person, 1,093 project) as separate TOML records, so each re-tag is several file adds and deletes in a commit rather than a one-line diff on the record.
What would change
- Schema: a
tagsarray field onprojects,people,help-wanted-roles,blog-posts(each taggable type), holding tag handles (namespace.slug) or tag ids. That choice is part of the assessment: handles read well in the record and in git diffs, but a tag rename then rewrites every record using it. Underspecs/principles.mdan off-path reference stays an id; handles would be a deliberate exception or need a rename cascade. Contract bumps for each sheet, and adoption onempty/fixture/legacy-importandpublishedin lockstep. - A one-off migration folding
tag-assignments/<type>/<id>/<tagId>into the owning records, then retiring the sheet (and its contract). - In memory:
tagAssignmentsByTaggablebecomes the record's own field;tagAssignmentsByTag(tag → taggables) is still needed and gets built from the arrays at load and byStateApply. - Writers:
tag.write.tsapplyTagsForEntity, project/person/help-wanted/blog writes, purge, slug renames. - Readers: serializers (project, person, tag, help-wanted), facets (
store/memory/facets.ts), tag pages, moderation footprint, the importer.
Downsides to assess
- Losing per-assignment metadata:
assignedByIdandcreatedAtper assignment. Is anything using them (moderation, audit)? If yes: keep a smaller array of objects, or accept git history as the record. - Concurrent edits: tag changes and other edits to the same record now touch the same file. Writes are serialized by the mutex, so it's merge noise in history, not a race. Confirm.
- Tag rename / merge / delete (staff tag tools): today that rewrites assignment records; it would rewrite every tagged record, possibly thousands of person files in one commit. How common is it?
- Staff auto-creating tags on project save keeps working, but check the flow.
- Legacy-import / re-import shape.
Performance to measure
Before and after, on the full published dataset:
- Boot load time and memory (one fewer sheet, but bigger records; index build moves to the record loader).
GET /api/projectswithtag=filters and facets (the hottest tag path), list and search.GET /api/tags/:handle,/projects,/people(tag → taggables).- Project/person detail serialization.
- Hot-reload (
POST /api/_internal/reload-data) incremental apply when a project's tags change. - Write path: tagging a project (commit size and latency).
Acceptance
A short written assessment (downsides found, measured numbers, recommendation, handle-vs-id decision). If it goes ahead: spec changes (data-model, the four sheets, tag specs) and a plan, then the migration as its own lockstep release.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Activity