Repository navigation
Description
Design: queue metadata, notes, status history, resolution taxonomy, label + GitHub change tracking
Drew's order (2026-11-24 01:18 CST): "consider if there's useful optional or mandatory columns or jsonb Metadata you should add to queue table and access w/fleet subcommands. maybe jsonb Metadata either way that accepts arbitrary key value with certain common items. then separately consider notes etc, add tables for automatically tracking every status change pick up drop link to sessions agents models effort etc, mark resolution status reason substatus categories, attach all issue labels to each queue item and track label add remove, possibly comments add remove, description edits, emoji, linking of issues prs marking parent changing parent etc etc"
Cross-links: the reprioritization programme #14158 (whose census worked around every gap below) and the reprioritize-verb spec #14100 (this design generalises its one-off reprioritized event into the full history machinery).
Full design of record: doc/2026-11-24T07-23-14Z_design_queue-metadata-history/ (landing by PR with this issue as tracking).
What exists today (verified from source, 2026-11-24)
tasks(fleet-queue Turso store,pkgs/fleet/crates/fleet-queue/src/turso_queue/core.rsSCHEMA): id, queue, title, body,payload(packet JSON), dedupe_key, priority, status, claim fields incl.claim_provider/claim_model/claim_variant/claim_session_id(current claim only),progress/resultJSON, park_kind/wait_kind/ready_condition,blocked_deps(JSON text on the row), timestamps. No metadata column, no resolution fields, no labels column, no notes.events(id, worker_id, task_id, kind, detail JSON, created_at): lifecycle verbs do write events, and claim/admin paths enrich detail with audit marks (lane, model, session — from the task row's current claim fields). But there are no from/to status columns, no actor distinct from worker_id, no reason column, the timeline verb reads only a curated kind subset (blocked/unblocked/enqueued/reprioritized are not in it), and a prune verb with the PG-era 30-day default hangs over the table — history is a rolling window, not an archive.- Labels: a webhook-fed GitHub mirror (
github_mirror_issues, same store, maintained by the github-ci Worker) holds each issue's current labels as a JSON array; at enqueue the broker copies them intopayload.labels(label_enrich.rs) and never refreshes them. No label history anywhere — the mirror overwrites in place. - Resolution: nothing structured. The only traces are free-text
resultJSON, triage exits (e.g.already_solved), and the verify-disposition verdicts (Close authority: require a verified disposition when a linked draft still carries unfinished work #10611). Tonight's census counted 1,476 cancelled tasks with no recorded reason.
Headline recommendations (full argument in the design record)
- Split by access pattern, not by taste. Columns for anything filtered, sorted, joined, or constrained: the resolution set, a labels cache, and history's structured fields. A
metadataJSON column ontasksfor arbitrary key-value, with a registry of well-known keys (programme, tracking issue, held marks, verification_class, external ids, coverage exception, session hints…) validated when present; unregistered keys stay legal. Access via a newfleet queue metaverb family (get/set/unset/keys) +--metafilters on list; merge-patch writes, size/key limits, every write lands in history. - Notes are a stream, not state: a separate append-only
task_notestable (author, session, timestamp, body),fleet queue note add/list, interleaved into show/timeline. Not metadata. - Status history gets its own structured table —
task_history(from_status, to_status, kind, reason, actor, worker, session, provider/model/variant, lease context, detail JSON) — written by the broker in the same transaction as every transition, dual-written beside today's events during migration, backfilled from events, and exempt from the 30-day events prune.eventsstays the free-form log. - Resolution is columns:
resolution,resolution_category(success / redirection / rejection),resolution_substatus,resolution_reason,resolution_ref,resolved_by,resolved_at. Taxonomy grounded in tonight's cleanup: done, already_solved, answered / duplicate, superseded, split_out / wontfix, obsolete, invalid. Required at terminal transitions (cancelled most of all); revive clears it, on the record. - Labels: current set read from the mirror + a broker-maintained
tasks.labelscache refreshed at claim and every transition (cheapuser/*/priority/*filtering for list); history captured at the source — the mirror projector already sees labeled/unlabeled webhook actions, so it diffs old→new and writesgithub_label_history. No polling. - GitHub-side tracking, decided per item: description edits — yes (projector diffs
body_hash, records an edit event, hashes only). Comment add/remove — counts and agent-note pointers only (already half-built in the mirror), not bodies. Issue↔PR links and parent/sub-issue changes — yes, as a first-classqueue_linkstable (task↔issue/PR/task, kind: implements/pr_for/parent/split_from/supersedes) plus mirror parent projection with change events; deps normalise intotask_depsalongside (tonight's blocker graph was built client-side from row JSON, malformedtask:Nonedeps included). Emoji reactions — no (no consumer, polling cost, recorded as a considered rejection). - Consumers named with their queries: the reprioritization audit (band histograms, unlock graph in SQL, blocked-with-no-dep as one query), the PR sweep (PR↔task links, label filters), stewardship (staleness from history), the PM stack (a since-cursor history feed for the aggregator/projector). Backfill for the 18,556 existing tasks is specified per table; migration is additive ALTERs in the crate's existing pattern.
Proposed build slices (packet-ready detail in the design record §11)
- Q1 — task_history foundation: table + broker dual-write on every lifecycle transition + backfill from events + timeline/show read from history.
- Q2 — resolution columns + taxonomy: columns, validation, complete/cancel/fail parameters, revive clearing, disposition mapping, backfill where provable.
- Q3 — metadata column + registry +
fleet queue meta: column, well-known-key registry with type checks, verb family, enqueue--meta, list--metafilter, meta-change history rows. - Q4 — task_notes: table, note verbs, show/timeline interleave.
- Q5 — labels current + history:
tasks.labelscache with claim/transition refresh + sweep, mirror projector label-diff intogithub_label_history, list--labelfilter. - Q6 — links + deps normalised:
queue_links+task_depstables, broker maintenance at block/unblock/dep-recheck/enqueue,fleet queue linkverbs, blocked_deps cache transition. - Q7 — GitHub-side history in the mirror projector: body-edit events, comment-count deltas, sub-issue parent projection + parent-change events.
- Q8 — consumers: aggregator since-cursor history feed, stewardship staleness queries, audit-programme canned census queries, book/docs update (book-live-update).
Design only — no build in this lane, no live queue writes. Slices are proposed here for packetising under the programmes that need them (#14158 first).
{
"direct_parent": null,
"links": [],
"lineage": {
"design": null,
"roadmap_item": null,
"priority": null
},
"pm_meta": 1,
"provenance": {
"queue_id": null,
"scheduled_start": null,
"picked_up_at": null,
"work_started_at": null,
"created_at": "2026-11-24T07:23:34Z",
"session_id": null,
"lane": null,
"host": "htch-runtime",
"worktree": null,
"model": null,
"lane_start_issues": [],
"workspace_ref": null,
"auth_subject": "archer",
"stamped_by": "fleet 0.1.0 (native)"
}
}
Activity
developing-today commentedon Nov 24, 2026
CODE-5212
Merge pull request #14173 from developing-today/design/queue-metadata…
developing-today-fleet commentedon Nov 24, 2026
Design landed. Record:
doc/2026-11-24T07-23-14Z_design_queue-metadata-history/— PR #14173, merged17735dc88541(docs only, +415/−0, hash-verified transfer, diff verified before merge).Headline recommendations (full argument in the record):
tasks.metadata(JSON object, merge-patch, ≤8 KB / ≤64 keys, registered keys type-checked, arbitrary keys legal). Access viafleet queue meta get/set/unset/keys, enqueue--meta, list--meta k=v; every meta write lands in history.task_notestable — never metadata. Queue-local in v1; posting to GitHub stays an explicit outbox act.task_history(from/to status, reason, actor, worker, session, provider/model/variant, lease context) written by the broker in the same transaction as each transition, marks copied from the transition's own context (fixing today's re-read-from-current-claim mis-attribution), exempt from the 30-day events prune;eventsstays the free-form log; backfill from events withsource='backfill'.cancelled(the 1,476 unexplained cancellations are the baseline), optional forfailed, cleared-on-revive with the prior verdict preserved in history. Disposition verdicts map todone/verifiedinstead of dying insideresult.tasks.labelscache refreshed at enqueue/claim/every transition + actionable-only sweep enables--labelfiltering (incl. theuser/*held check); add/remove history captured in the github-ci projector, which already sees labeled/unlabeled webhooks —github_label_history, exact diffs, backfill rows as defined starts. No polling anywhere.body_hash, hashes only); comments COUNTS ONLY (deltas + agent-note pointers; bodies rejected on volume/duplication); emoji reactions NO (considered, rejected — no consumer, polling cost); issue↔PR links + parents YES asqueue_links(+ GitHub sub-issue parent projected mirror-side with change rows); deps normalise intotask_deps, making tonight's client-side blocker graph a recursive SQL query, with malformed deps (task:None) representable asstate='malformed'instead of silently skipped.Slices proposed (packet-ready in record §11, dependency-ordered): Q1 task_history foundation → Q2 resolution → Q3 metadata → Q4 notes → Q5 labels → Q6 links+deps → Q7 projector GitHub history → Q8 consumers. Not queued by this lane; #14158 is the first consumer programme.
developing-today-fleet commentedon Nov 24, 2026
Build slices Q1–Q8 packetised (2026-11-24)
All eight slices from §11 of the design record are now queued in
repo-health-code-pilot, kindfeature_slice, priority 40 (very high), each packet carrying its §11 scope, its acceptance oracle verbatim, and a link to this issue. Dedupe was checked first: a sweep of the queue's actionable rows (405) found no existing task referencing #14170.fleet queue metaDependencies follow §11 exactly (Q2–Q6 behind Q1, Q7 independent, Q8 behind Q1–Q6) and are carried as hard-prerequisite entries naming the predecessor task id, with the chain's self-parking rule ("if claimed earlier, park behind it") — the same pattern as the #14084 and #13948 chains. Every enqueue was verified by read-back: task id, status, priority 40, and the stored prerequisite entries (Q2's dep on 21698 and Q8's six deps confirmed in the stored payloads).
Note: task 21698 (Q1) was drawn by the fleet flow within minutes of enqueue and currently sits parked (attempts 1) — the chain is live.
developing-today-fleet commentedon Nov 24, 2026
Cross-link from the priority-model exploration (record:
doc/2026-11-24T07-42-32Z_design_priority-model-exploration/, PR #14182 mergedb43b9d6cbc0b; decision page posted on #9199):Temporal amendment proposed for this design (§4 of the record). Three datetime columns on
tasks, framed under this design's own split rule (filtered/sorted/joined → columns):target_at(proposed target — ours, advisory, never affects ordering in v1),due_at(the world's deadline, set only with evidence),expires_at(value presumed decayed after this unless re-triaged; passing writes a state-neutral history row and surfaces the item — resolutionobsolete/expired, already in this design's taxonomy, is applied by a sweep decision, never by the clock alone). Deliberately derived, never stored: urgency-from-due (distance-to-due_atfeeds #9199's effective-pressure "deadlines/opportunity" input) and staleness age (now − last transition, from this design'stask_history). Note the distinction the record draws: this design derives staleness (how long since an item moved); the amendment adds horizon (when its value ends) — different facts, both cheap. If the Q-slices are packetised, this is a small additional slice behind Q1; nothing here changes this issue's existing scope.developing-today-fleet commentedon Nov 24, 2026
Lane ITEM-WORK-2 (Archer direct item-work lane) drew Q6 (task 21704) via
fleet agent nextand has parked it behind its hard prerequisite, per the packet rule: ready condition = task 21698 (Q1) complete. No work started on Q6; nothing touched.Q1 (task 21698) currently sits parked (lane oc-code-01, not-before 2026-11-24T08:35:02Z, no worker holding it). If it is still parked and unclaimed after that time, this lane will claim Q1 and work it end to end (takeover noted here in advance), so the Q-chain unblocks in dependency order. Progress will be recorded on this issue at each boundary.
dezren39 commentedon Nov 24, 2026
🤖 Agent note · Q1 claimed, parked for size (queue task 21698)
task_historytable or broker dual-write inpkgs/fleet/crates/fleet-queue.events, thetimelineread and the/history-sinceroute. The claim path it would change is the path this lane uses to claim, so it needs a reviewable branch, not an in-run edit.dezren39 commentedon Nov 24, 2026
Lane oc-code-04 premise checkpoint for queue task 21700 (Q2 resolution columns + taxonomy, claimed 2026-11-24T09:37Z).
Premise verdict: hard prerequisite Q1 (task 21698, task_history foundation) is NOT landed. Design PR #14173 is merged, but no
task_historytable or dual-write exists on main (grep of pkgs/fleet/crates/fleet-queue is empty). Q1 is parked (not-before 09:36:49Z) and unclaimed. Q2 touches the same lifecycle verbs Q1 dual-writes, so it cannot land against an unmerged Q1.Parking 21700 with ready condition = task 21698 complete. No code written, no PR opened. Part of #14170.
github-ci mirror: GitHub-side history in the projector (#14170 Q7)
dezren39 commentedon Nov 24, 2026
🤖 Agent note · Q7 landed as PR #14299 (queue task 21705, lane felix)
github_issue_historyin the mirror projector —body_edited(hash-only),comment_added/comment_removed/comment_count_changed(counts only, agent-note id rides the detail),parent_changed— plus theparent_numberprojection ongithub_mirror_issuesfromparent_issue_urlsnapshots, a newsub_issueswebhook route, and the backfill sweep (parent in the diff key; sweep writes its own diff rows, actorbackfill). Fail-open throughout: history writes are a separate batch after the mirror batch, caught — a killed history write never fails the upsert. Reserved kinds (linked/unlinked/state_changed) are documented vocabulary, not written by this slice.test/mirror.test.ts("mirror history (Design: queue metadata, notes, status history, resolution taxonomy, label + GitHub change tracking #14170 Q7)"), plus redelivery, stale-snapshot, first-sight, and silent-parent cases.npm ci(140 packages),tsc --noEmitclean, vitest 7 files / 91 tests, all passed (mirror 34 incl. 15 new Q7 tests; worker 20 incl. the sub_issues route test; backfill 10 incl. the parent-bind test). Executor image has no node/npm; Node 22 came fromnix shell nixpkgs#nodejs_22.npm cifails on a pre-existing wrangler/@cloudflare/workers-types peer conflict — filed as github-ci worker: npm ci fails out of the box (wrangler peer conflict on @cloudflare/workers-types) #14298, enqueued as task 23064; the Q7 run used--legacy-peer-depsfor that reason only.sub_issuesroute receives deliveries only if the webhook subscription includes that event; snapshot + sweep projection works regardless.Merge pull request #14299 from developing-today/felix/14170-q7-github…
developing-today-fleet commentedon Nov 24, 2026
Q8 (task 21706) premise check — 2026-11-24 (lane ITEM-WORK-79): drawn and premise-checked. None of Q8's hard prerequisites is terminal-done, so the slice cannot start:
parked(not_before 2026-11-24T13:37:17Z)parkedbehind Q1blockedon Q1parkedbehind Q1parkedparkedbehind Q1done; it is independent of Q8.)Action taken: task 21706 is now structurally dep-blocked on task 21698 (reason-class dependency, dep-recheck 3600s, dep_blocked_until 2026-11-27T11:11:04Z), replacing its earlier claim/park cycle. Its
progress.nextcarries the wake protocol naming all six gates: on wake, re-check Q1–Q6 in order; re-block on the earliest unfinished gate; only when all six are terminal-done does Q8 start, per the design record §11, against its oracle (stewardship cycle reads staleness from one query; the audit census reproduces the #14158 census numbers from the canned pack).