campaign ls printed every campaign and offered no way to narrow it, and the row was assembled by hand, so a long title pushed the standing out of line with the row above it and the created date the file already carries was not shown at all. --state takes open, done or empty and matches against Standing::state(), so the derived value keeps one definition: a campaign reads [open] in the listing if and only if --state open lists it. --state rather than --status, which names one of the five ticket statuses everywhere else and would invite --state backlog here. empty is the third value because an empty campaign derives None deliberately, and a filter that could not reach those would leave what has been filed and forgotten answerable only by reading the whole listing. A filter that matches nothing names the value back, since a silent listing reads as the other empty case. The filter reaches --ids as well, the way ls --ids keeps its own, and is the only thing that makes that path count members: an unfiltered completion is as cheap as it was. The columns are measured on the raw values and padded before anything is painted, the rule metadata_cells follows. The codename is measured with the title rather than given a column of its own: a campaign filed without one spends nothing on it, so a column for it would be one most rows pad into and some leave empty, and what a reader lines up is where a name ends and its progress begins. A flag's possible values now come off the command that holds the flag, so campaign ls --state reaches ls's own arguments rather than campaign's. The prompt offered nothing there while fish offered the three values, which made a liar of the rule that a ValueEnum added anywhere is typeable on the board the day it is added. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
14 KiB
14 KiB
Campaigns
The container that groups tickets across the flow, and why its state is derived.
- A campaign's state is derived, never stored. Open until every member is done, computed by
Standingfrom the members. AStatusfield on the campaign would be the same state in two places, and the two would disagree the moment a member moved. It is also why there is nocampaign mvand no forward-only ruleset besidemv's - A campaign with no members is neither open nor done.
Standing::state()returnsNonethere, and both callers printno members. Calling it done would make a container nothing has been filed against the most complete thing on the board; calling it open would claim work that does not exist - Membership is one field on the member,
Campaignin the ticket Metadata, written only byassign. The member list is deliberately not on the campaign: that would put membership in two places, and would make one file that every assignment edits, which is contended the moment two agents share a board. Soaddhas no--campaignandsethas no--campaign, the same rule as Owner and Status - The full uuid is stored and the title is resolved for display, as the Relations section already does.
reference_cellsis shared between the two, so a dangling campaign and a dangling relation target are both spelled_missing_rather than each inventing a spelling adddoes not write the field. Every ticket written before campaigns existed has none, so the insertion path has to exist regardless; leaving it out ofaddmeans one path that is always exercised rather than two. Same reasoning as the Relations sectionset_or_insert_metadata_field()is the upsert, andMETADATA_ORDERis its anchor list, the waySECTION_ORDERisensure_section's. Campaign is placed before Status, so Status stays last where every file already keeps it. A file with no## Metadataheading is an error, not an insertion: per 641e3d5 such a file has no fields at all, and writing one above the prose would invent a shape nothing reads- The four tiers are
resolve_in(), shared by tickets and campaigns. A campaign is addressed exactly the way a ticket is, and a second resolver would be a second copy of the precedence rules to keep in step.Found.diris the status for a ticket and empty for a campaign, which is what makes the ambiguity listing drop the bracket for one - An exact
Codenameis the top tier, and it lives in the shared resolver rather than in a campaign-only path. Only campaigns carry the field, soparse_codenamereturnsNonefor every ticket and the tier is always empty for one: ticket resolution is unchanged, whicha_ticket_search_is_unaffected_by_the_codename_tierpins. It goes above the uuid prefix because it is an exact match on a field written for the purpose, where a substring can be a coincidence, and because a codename likev1is belowMIN_ID_SEARCHand would never be tried as an id at all. A codename that a title also contains,v2againstv2 release, has to win outright rather than be reported ambiguous against it resolve_ticketexplains a search that names a campaign, rather than each command doing it. One place, somv,show,chownand everything else that takes a ticket give the same reason instead of a bare "no ticket found". Checked only on the zero-match path, so it costs nothing normally, and only when exactly one campaign matches: an ambiguous ticket error must not be replaced by a complaint about a directory the caller never mentionedResolvedcarries whatcontent_trimcannot render from the file. The relations block and the campaign cell both come from elsewhere on the board. A struct rather than two more parameters, so the next such field is one entry here instead of an edit at every call sitecampaign showlists done members, unlikels, which leaves the done column out of its listing. What is finished against what is left is the whole question a campaign asks, so hiding half the answer is not an option.ls --campaignis the other way round: it is the ordinary board filtered, and keeps every rulelsalready hascampaign lsscans the status directories once per campaign to count members. That is a scan per row rather than one walk reused, and it is deliberate: the map-from-uuid version is worth writing when a board has enough campaigns to noticecampaign ls --statefilters onStanding::state(), never on the counters. The derived value has one definition, so a campaign reads[open]in the listing if and only if--state openlists it.--stateand not--status: the word names one of the five ticket statuses everywhere else in the tool, and a campaign sits in no status directory. The third value isempty, matching theNonean empty campaign derives, because a filter that could not reach those would leave "what has been filed and forgotten" answerable only by reading the whole listing. A filter that matches nothing says so and repeats the value back, since a silent listing reads as the other empty case, a board with no campaigns on it- The filter reaches
--idsas well, and is the only thing that makes that path count members.ls --idskeeps its own filters, so this one keeps its. An unfiltered completion is as cheap as it was:keptreturns true without reading a ticket when there is no filter to answer - The listing is a table, measured on the raw values and padded before anything is painted, the rule
metadata_cellsfollows. A column sized on a painted value counts its escape sequences towards its width, which is what tilts a table when colour is on and leaves it straight when it is off — the one combination an integration test running through a pipe can never see, which is whythe_campaign_table_stands_in_the_same_columns_coloured_or_notrenders both ways in one process and compares them with the escapes taken back off - The codename is measured with the title rather than given a column of its own. A campaign filed without one spends nothing on it, so a column for it would be a column most rows pad into and some rows leave empty. What a reader lines up is where one campaign's name ends and its progress begins, which is one field: the name is the codename and the title together
- The created stamp is
format_created_at's, the same formlsprints, rather than a second spelling of a date. An unparseable one is empty there and the column goes, exactly as it does for a ticket - The TUI got a card label and a frame, not a campaign tab. 61879a4 decided it. A tab would have had to answer what its columns are, and a campaign groups across the flow rather than within one status, so the honest answer is the four statuses filtered — which is a filter on the board it already has rather than a fifth tab. So: a label on the card, a frame above the columns while one is selected, and
cfor the picker. The cost the earlier decision balked at, a campaigns read per reload, is paid once per project incolumns_ofand is what names the label; see The Board View - A campaign is named by its codename on the board, and by its short id when it has none. The uuid does not fit on a card and the title is a sentence, which is the gap
Codenamefills.campaign_labelbuilds it in one place, as aCell, so the CLI paints it and the board makes a span of it; the mark isCAMPAIGN_MARK,~, beside#for a tag campaign setandcampaign appendare the only writers of a filed campaign's fields. d637288 decided the command: asetrather than a flag on something narrower, because the file has more than one editable thing and the moment somebody wants to fix a typo in a title there would be a second command to design.setcarries--title, which renames the file the wayset --titledoes,--descriptionand--codename;appendcarries--descriptionalone.campaign addwriting a field at creation is not a second writer, exactly asadd --titleandset --titlecoexist- Replacing a codename the campaign already has needs
--force. Once a campaign has one it is referred to by it: it is on every card in the campaign, it is what resolves the campaign at the command line, and it is in somebody's shell history. Changing it silently is the mistakeinstall-skill --forceexists to prevent, so it is refused and the refusal names both words and the flag rather than leaving it to be found. Checked before any edit is applied, likeSetArgs::contested, so a call also carrying--titlewrites neither field. Setting the codename a campaign already carries stays a no-op, not a refusal —--forceis about overwriting a different word, which is the same divisioninstall::Outcomedraws betweenUnchangedandRefused.--forceguards the codename alone: a campaign always has a title, so guarding that would mean the flag was always required - The description arrived as a pair,
set --descriptionandcampaign append, 32e98ab. Never one without the other: for a prose sectionsetreplaces andappendadds, and a way to replace a description with no way to add a paragraph is the half that is easy to reach for and wrong, since replacing a description to add a sentence to it is how the rest of it gets lost. The two scalars have no append form at all, which is the same lineappendalready draws for a ticket, andcampaign_append_offers_only_the_descriptionpins that. Neither flag takes--force: a description is prose written to be revised, the same reasontags set --annotationhas none appendis a campaign's own subcommand, not the top-levelappend. That one resolves a ticket, and one positional naming either object is the ambiguityresolve_inmakes real: its tiers are the same over both directories, so a search can resolve in each and nothing but a flag could say which was meant. It would also make a liar ofresolve_ticket, which explains a ticket search that names a campaign. Undercampaignthe object is settled by the command, as it is forset,showandls- Still no
--ownerand still no--clear. No--owner, because nothing writes a campaign's Owner today and givingsetone would settle by accident whetherchowngrows a campaign. No--clear, which 32e98ab settled rather than deferred: a codename is replaced rather than emptied, and emptying the description of a container six tickets are filed against is not a thing anybody has asked for, so the only spellings left would beClearableon a campaign, whose variants are a ticket's fields, or a second enum with one variant in it.campaign_set_offers_no_owner_and_no_clearpins both - An empty
--description ""is a paragraph break here too, and the refusal for an all-blank value names no flag. Every prose argument in the tool reads a blank value that way,add,setandtags --annotationalike, so a campaign reading it as empty the section would be the one exception. With no--clearto point at, the refusal says a campaign's description has no cleared form instead of naming a flag that does not exist.replaced_itemsis where the check lives, shared withset, and the way out is the caller's argument for exactly that reason SECTION_ORDERneeds no campaign variant, and that is what the one-section file proves. A campaign holds Description and Metadata where a ticket holds four sections and Metadata. Every consumer of the list looks for the headings that follow, filtered by what is actually in the file, so a campaign's description anchors against## Metadata— which is wherecampaign_bodywrites it.the_description_is_edited_in_place_in_a_file_with_one_sectionpins that no section a campaign does not have gets inserted to anchor against- A campaign whose Description heading is gone is refused, not given the section back. No
ensure_sectionon this path: every campaign the tool has ever filed carries the heading, so an insertion here would be reachable only from a hand-edited file, which is the opposite of the Relations case, whereaddwrites nothing and the insertion is the only path there is. The refusal therefore names the section and not the object — "There is no description section to write to" — because both a ticket and a campaign reachreplace_section_bodynow.write_then_replacestill carries the noun, where the message is about a file - The codename is written through
set_or_insert_metadata_field, notset_metadata_field. Every campaign filed before the field existed has no such line, and those are exactly the campaigns the command is for, which is the same reasoning that putsassignon the upsert.Codenameis therefore inMETADATA_ORDER, directly after ID, so an inserted one lands wherecampaign_bodywrites it and a campaign given a codename later is the same file as one filed with it. Nothing upserts it on a ticket, so its place in a ticket's order costs nothing - One write path for tickets and campaigns.
save_entryis the body,save_ticketandsave_campaignare the named wrappers, andwrite_then_replaceandfind_entry_filetake the noun as a&strso a failure says "campaign" where it is one. A campaign file is a ticket file in every way that matters here,<uuid>_<slug>.mdin a directory, and the rename happens only after the write has landed. Every message puts the noun mid-sentence so there is no capital to case campaign_body()builds the file fromDESCRIPTIONandMETADATA_HEADINGrather than its own string literals, so the two file formats cannot drift apart on the spelling of a heading. A campaign has no acceptance criteria (its definition of done is derived), no implementation plan and no Status- The campaigns directory is created by
initand on demand bycampaign add, since every board made before campaigns existed has none and aworklane initover a live board to get one would be a strange thing to have to do