From ed08c0ceba3f5bf503b8c5ef05e42effe2cdfc44 Mon Sep 17 00:00:00 2001 From: dmlguq456 Date: Sun, 29 Nov 2026 22:41:42 +0900 Subject: [PATCH 1/2] Backlog topics: write, group and close put-off work by the result you want MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new `###` topic heading under a campaign names the result the person wants. New requests look for that topic first (one more case is one indented line, a job finished apart is a sibling, another result is a new topic), a finished job moves block by block to `backlog-closed.md` with a `closed:` line, the last job takes the topic out of the open file, and a closed result recurring opens the same words again with an `이력:` note. The common reader (`utilities/backlog_items.py`) carries each job's topic and each group's topics; the panel, board and entrance still read the one rule and are unchanged for a document without a topic (same keys, same counts, same board answer byte for byte). The board gains a Topic axis on `o` and opens grouped by topic where the document has one, an opened job's lines carry its topic, Tab finds a topic, and the head and the entrance say both numbers (`39 topics · 99 items`). core/ARTIFACT_META.md carries the form, the topic identity, the counting rule, who writes what, Done, Recurrence and `backlog-closed.md`; CORE.md and the root-document tuple learn the closed record, the bootstrap's Where-to-look points at the contract, and README/docs/session-shell say the same. --- README.ko.md | 3 +- README.md | 3 +- adapters/claude/CLAUDE.md | 1 + .../hearting-claude/core/ARTIFACT_META.md | 86 ++- .../plugins/hearting-claude/core/CORE.md | 2 +- .../core/fragments/bootstrap-body.md | 1 + .../core/references/session-shell.md | 21 +- adapters/codex/AGENTS.md | 1 + .../hearting-codex/core/ARTIFACT_META.md | 86 ++- .../codex/plugins/hearting-codex/core/CORE.md | 2 +- .../core/fragments/bootstrap-body.md | 1 + .../core/references/session-shell.md | 21 +- adapters/opencode/AGENTS.md | 1 + core/ARTIFACT_META.md | 86 ++- core/CORE.md | 2 +- core/fragments/bootstrap-body.md | 1 + core/references/session-shell.md | 21 +- docs/session-panel.md | 3 +- tools/fleet/session_panel.py | 2 +- tools/fleet/session_status.py | 69 +- tools/i18n/messages.json | 16 +- utilities/artifact_entrance.py | 24 +- utilities/artifact_entrance.test.py | 6 +- utilities/artifact_producer_store.py | 10 +- utilities/artifact_residue.test.py | 3 +- utilities/backlog_items.py | 46 +- utilities/backlog_topics_1129.test.py | 600 ++++++++++++++++++ utilities/session-shell/backlog-board.cjs | 78 ++- utilities/session-shell/host.cjs | 7 +- .../session-shell/status-popup-picture.cjs | 20 +- .../session_shell_backlog_board_1126.test.py | 26 +- utilities/status_popup_picture.py | 13 +- 32 files changed, 1083 insertions(+), 179 deletions(-) create mode 100755 utilities/backlog_topics_1129.test.py diff --git a/README.ko.md b/README.ko.md index 0862d7e248..9a11754080 100644 --- a/README.ko.md +++ b/README.ko.md @@ -57,7 +57,8 @@ route 상자, `MESSAGES`를 누르면 그 표 전부가 창 가운데 팝업으 여기서 답할 질문은 장미색 테두리 상자에 섭니다. **Ctrl+]** 키는 늘 팝업을 열고 그 질문을 먼저 띄웁니다. **Tab**, **1–9**, **Enter**로 답하면 팝업이 닫히고 `✓ answer sent`가 남습니다. REPO 줄(저장소와 괄호 속 브랜치·`↑N`/`↓N`) 아래의 **STATUS** 머리는 단추(`STATUS 5 ›`)이고, **BACKLOG** 머리(`BACKLOG +136 · Discuss 2 ›`)는 사용자가 정한 차례(`priority:` 줄)대로 항목을 세 줄까지 상태부터 보이며, 각각 프로젝트 현황 문서 -전문과 백로그를 팝업으로 엽니다(문서가 아직 없으면 머리의 낱말이 흐리게 서 있습니다). 팝업에서 **←/→** 키는 구획을 옮기고, **f**는 같은 창에서 +전문과 백로그를 팝업으로 엽니다(문서가 아직 없으면 머리의 낱말이 흐리게 서 있습니다). 백로그 판은 원하는 결과(주제)별로 묶여 열리고 +(`주제 39 · 할 일 99`), **k**/**a**/**d**/**o**로 묶음을 바꿉니다. 팝업에서 **←/→** 키는 구획을 옮기고, **f**는 같은 창에서 Fleet를 열고, **p**는 패널을 에이전트 화면 아래 띠로 접으며, **Esc**나 **Ctrl+]** 키는 팝업을 닫습니다. `hearting session shell disable`은 새 터미널부터 패널을 끕니다. 키, 설정, 좁은 창 배치, 하네스별 세부는 [docs/session-panel.md](docs/session-panel.md)(영어)에 diff --git a/README.md b/README.md index 73afe225a8..6e4d21050e 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,8 @@ in a rose-bordered box. **Ctrl+]** always opens a popup, that question first: answer with **Tab**, **1–9**, and **Enter**, and the popup closes with `✓ answer sent`. Under the REPO row (the repository with its branch and `↑N`/`↓N` in parentheses) the **STATUS** head is a button (`STATUS 5 ›`) and the **BACKLOG** head (`BACKLOG +136 · Discuss 2 ›`) lists up to three items in the order you gave -(their `priority:` lines), each state first; they open the project's status document and backlog. In a popup **←/→** move between sections, **f** opens +(their `priority:` lines), each state first; they open the project's status document and backlog, and that board opens grouped by the result +you want (its topics: `39 topics · 99 items`), with **k**/**a**/**d**/**o** changing the grouping. In a popup **←/→** move between sections, **f** opens Fleet in the same window, **p** folds the panel into a strip under the agent's screen, and **Esc** or **Ctrl+]** closes it. `hearting session shell disable` turns the panel off for new terminals. Keys, settings, the narrow-window diff --git a/adapters/claude/CLAUDE.md b/adapters/claude/CLAUDE.md index cd77553463..d709259fe5 100644 --- a/adapters/claude/CLAUDE.md +++ b/adapters/claude/CLAUDE.md @@ -120,6 +120,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/ARTIFACT_META.md b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/ARTIFACT_META.md index 73dfbdceb7..9248053434 100644 --- a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/ARTIFACT_META.md +++ b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/ARTIFACT_META.md @@ -311,7 +311,8 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. every campaign, that opens `all-campaigns.*`), **backlog** (one line that opens the root's `backlog.md`, see the next section; its meta is the total, the count of each kind, the count in Discuss and the file's `갱신` date (`6 total · FIX 2 · TASK 1 · NOTE 1 · TBD 2 · Discuss 1`, - `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`); there is no section when that regular file is absent or a link, and + `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`; a document with a + topic says its topic count and its job count first instead of the total, `3 topics · 5 items` (`주제 3 · 할 일 5`), and an old one keeps `5 total`); there is no section when that regular file is absent or a link, and `Counts unavailable` instead of the counts when it cannot be read or is over 1 MiB) and **records** (a link to the recent route reports page and a link to the ID index `campaigns/INDEX.md`), plus the root totals. The line counts are the constants `ENTRANCE_SPEC_LINES` and @@ -367,18 +368,22 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. ### `backlog.md` — what was put off -- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo. +- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo; the jobs + that are done leave it for one closed record beside it, `/backlog-closed.md` (see + **Done** below). - **Form.** A title line, then `갱신 YYYY-MM-DD HH:MM`, then one `## ` - heading per campaign, with `## Unassigned` for work with no campaign. A job is one top-level - `- ` bullet (a title line of at most 60 columns) with optional indented `date:`, `source:`, - `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came up, where from, what the - person said then, what kind of work it is, where in the repo it mainly lands, how far it is, and - the order the person gave it). + heading per campaign, with `## Unassigned` for work with no campaign. Under a campaign, one or more + `### ` headings (the result the person wants; see **Topic heading** below), and under a topic + the jobs. A job is one top-level `- ` bullet (a title line of at most 60 columns) with optional + indented `date:`, `source:`, `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came + up, where from, what the person said then, what kind of work it is, where in the repo it mainly lands, + how far it is, and the order the person gave it). The title line carries no tag, status or owner mark; the kind, area, state and priority are those optional lines alone. ```text ## 2026-11-02_v4-open + ### 질문에 한 번 답하면 어디에 전달됐는지 안다 - Resuming a route loses its stage date: 2026-11-26 kind: fix @@ -386,7 +391,23 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. state: discuss source: the person, while resuming note: what was seen, and what the person said then + - The answered question says where it went + date: 2026-11-27 + kind: task + area: Questions ``` +- **Topic heading.** A `###` line names the result the person wants to be able to do or see when the + work under it is done (`질문에 한 번 답하면 어디에 전달됐는지 안다`), not a part of the repo, a step of a + plan, or a batch of work: a campaign's own plan is not a topic. The part of the repo belongs to + `area:`, and one topic may span several areas. The name is read with its ends cut and its runs of + blanks folded to one; the first spelling written is the name shown. A job written under a campaign + with no `###` heading above it stands in `No topic`; a campaign may keep that form and gain topics + later, and a document with no `###` heading at all reads exactly as it did before topics existed. +- **Topic identity.** A topic is its campaign heading and its folded name together: the same name under + the same campaign is one topic however many times it is written, and the same name under another + campaign is another topic (the board joins the campaign's name where it shows two of them together). + Topics are never merged for looking alike, by a reader or by a writer: only a person moves jobs from + one topic to another, and the moved jobs' `note:` lines then name the old topic. - **`kind:` line.** An indented line under a job, `kind: `; the value is `fix` (the flow or result in use keeps a problem, however it is to be solved), `task` (something to do: an improvement, a new piece, a test, a clean-up, a look into something; an observation that now has @@ -422,6 +443,14 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. below the first heading line and outside a code fence. - A heading line is `##` followed by a space, a tab or the end of the line, after at most three spaces: ` ## C` is a heading, four spaces make it no heading, and `###` is none. + - A topic line is `###` followed by a space, a tab or the end of the line, after at most three + spaces: ` ### T` is a topic, four spaces and `####` are none, and a `###` before the first `##` + heading is no topic. An empty `###` names `No topic`. + - A job's topic is the nearest topic line above it in its campaign; a job with none above it in its + campaign (or in a campaign with no topic) is `No topic`. A topic line closes no job: only a `##` + heading, a fence or another line at the left edge does. + - The number of topics is the number of topics holding at least one job: an empty `###` (one with no + `- ` under it) is not counted, and neither is `No topic`. - A `- ` line before the first heading is not a job. Neither is any line that does not start with `- ` at its left edge: `*`, `+` and numbered items, `-` with no space after it, indented lines, sub-bullets, `> - `. @@ -436,14 +465,41 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. `갱신 YYYY-MM-DD HH:MM` (ASCII digits) with a date and time that exist; surrounding whitespace is ignored. The first line of that shape and a real time is the date; any other line, or `갱신 2026-13-45 99:99`, is no date. -- **Who and when.** The session that puts a job off adds one line, at that moment, under the - campaign's heading (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and - an `area:` and a `state:` line where they are known (each left out when it is not known). A - person writes it by hand. -- **Done.** The line is deleted. The file holds open work only. -- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes - it. All three read the jobs and their lines by this one rule (`utilities/backlog_items.py`) and - count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. The entrance reads it by +- **Who and when.** The session that puts a job off adds one line, at that moment, under its campaign + (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and an `area:` and a + `state:` line where they are known (each left out when it is not known). A person writes it by hand. + A new request first looks for the topic of the same result, then: + - another case of a job already written → one indented line under that job + (`noteN: [MM-DD] … — source …`, the file's own habit), the job's other lines unchanged; + - a job finished apart from it → a sibling `- ` under the same topic; + - another result → a new `###` topic under the campaign; + - not sure which → a new topic (names are never merged for looking alike, and a wrong pairing is + worse than a second topic). +- **Done.** A finished job is not deleted. Take the job's block — its `- ` line and every indented line + under it, up to the next line at the left edge (never a text replacement) — and append it at the end + of `/backlog-closed.md`, under a `## ` and `### ` heading + when the last thing written there is not already those headings; and add one indented line under the + job, `closed: YYYY-MM-DD `. + The job's siblings stay under the topic in the + open file; when the last job of a topic leaves, its `###` heading leaves too. A new closing always + appends to `backlog-closed.md` only: the older + `backlog-closed-*.md` files (such as `backlog-closed-1127.md`) and their `판정:` lines are read-only + history, and nothing is appended to or rewritten in them. +- **Recurrence.** A request that is the same result again: find its topic by name in the open file + first, then in `backlog-closed.md` and the older `backlog-closed-*.md` files (a text search is enough; + no ID is needed). A closed topic is opened again with the same words as a `###` heading, and the new + job's `note:` names the history it continues: + `이력: backlog-closed.md "### "`. +- **`backlog-closed.md`.** The closed record beside the open file: same place, same form (`##` campaign, + `###` topic, the job's block as it was, then `closed:`), append only — never inserted in the middle, + never rewritten. It is read as one history together with the older `backlog-closed-*.md` files, which + are never written; only the open `backlog.md` decides what is still open. +- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes it. + All three read the jobs, their lines and their topics by this one rule (`utilities/backlog_items.py`) + and count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. With a topic in the document + the board opens grouped by topic (`o`; `k`, `a`, `d` the other groupings), an opened job's lines carry + its `topic`, and the board's head and the entrance say both numbers (`39 topics · 99 items`, + `주제 39 · 할 일 99`); without one they read as before (`99 total`). The entrance reads it by name, never through a link, at most 1 MiB, the panel's own limit. No command, setting or step is added. diff --git a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/CORE.md b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/CORE.md index b9dd301530..4badf732a7 100644 --- a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/CORE.md +++ b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/CORE.md @@ -222,7 +222,7 @@ never orders a move or a delete. | `.git/`, `.agents/`, `.codex/`, `.probe-*/` | runtime residue that lives beside artifacts without being one | `C-LEG(runtime-residue)` | | `_scratch/` | the sole exact census exclusion | `C-SCR` | | `README.md`, `index.html`, `all-campaigns.md`, `all-campaigns.html`, `all-spec.md`, `all-spec.html`, `recent-route-reports.md`, `recent-route-reports.html` (files) | derived read entrance that Hearting rewrites (not canonical; not an admission, census or residue input; a same-named file without the generator's `` marker stays with its owner: the generator leaves it unchanged and in place) | `C-RT` | -| `backlog.md` (file) | a root document that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`); Hearting only reads it. Not canonical; not an admission, census or residue input, and not an entrance file (Hearting does not rewrite it) | `C-RT` | +| `backlog.md`, `backlog-closed.md` (files) | root documents that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`, and the record of the jobs that are done beside it, with the day and the evidence they closed); Hearting only reads them. Not canonical; not an admission, census or residue input, and not entrance files (Hearting does not rewrite them). The older `backlog-closed-*.md` files are read-only history and stay where they are | `C-RT` | The following paths are a sealed-evidence exception set. These exact prefixes (and their descendants) or exact files take precedence over their parent diff --git a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/fragments/bootstrap-body.md b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/fragments/bootstrap-body.md index f2ff59b015..6f4ce3e9b7 100644 --- a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/fragments/bootstrap-body.md +++ b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/fragments/bootstrap-body.md @@ -110,6 +110,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/references/session-shell.md b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/references/session-shell.md index 2683bbd972..f92a8be980 100755 --- a/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/references/session-shell.md +++ b/adapters/claude/plugin-marketplace/plugins/hearting-claude/core/references/session-shell.md @@ -1304,24 +1304,23 @@ they arrive (for a page with a list screen, after the document read whole is ask cannot read is that same failure, not a `?`), and the Fleet part holds no place of the document's: a popup opened again while it is out stands at once, and its lines are kept only for the width and value they were asked at), BACKLOG (11-21: the status popup's list screen over `/backlog.md`, drawn by the same `status-list.cjs` with the same frame; 11-26, scheme A: the **board**, `session_status.backlog_board` laid out by `backlog-board.cjs`; its answer is the status popup's own (`part: list` / `doc` / `detail`, no Fleet part; -`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, and under -each the top-level `- ` bullets, one item each, read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, -followed by a blank or the end of the line; a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; +`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, under each one or more `###` topic headings (11-29: the result the person wants, e.g. `### 질문에 한 번 답하면 어디에 전달됐는지 안다`) and under a topic the top-level `- ` bullets, one item each (a bullet directly under the campaign, or under one with no `###`, is `No topic`), read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, +followed by a blank or the end of the line; a topic line is `###` the same way (`####` is none, one before the first `##` is none, an empty one names no topic group); a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; `- - -` and a `- ` inside an HTML comment are counted; a code fence (up to three spaces in, whatever follows) is not read, closes on the same character and the same or a longer length only, and one never closed runs to the end; `갱신 YYYY-MM-DD HH:MM` (ASCII digits, one blank, the line's own surrounding blanks cut) is read before the first `##` only, and only where the date and the time are real, shown as `updated MM-DD HH:MM`, with `! … old document` after three days). An item's optional indented lines are its kind (`kind:` `fix`, `task`, `note`, the earlier `improve` read as `task`; none, another value or two different values is `TBD`), its state (`state:` `discuss`, `ready`, `waiting`; else none), its one area (`area:`, case and runs of blanks folded, the first spelling the group's name; none or two different is `No area`) and its date (`date:` `YYYY-MM-DD`, a real one; else none); a wrong value leaves only that cell undecided and the board still opens. **The board's answer carries one short row per item** (`[key, kind, date, area, state, title, campaign]`, newest first: the latest date first, -the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`), what it shows -(`group [Kind] Area Date · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last), each a head with its count (`▾ FIX 65`, +the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. A document with a topic (11-29) adds an eighth cell to each row, the index of its topic in the answer's `topics = [[name, campaign index], …]` (document order, `-1` for `No topic`), and `counts.topics`; a document with none answers exactly as before (seven cells, no `topics`), so an older popup and the panel's own lists read it as they did. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`; with a topic `39 topics · 99 items · FIX 65 · …`, the same items the old total counted), what it shows +(`group [Kind] Area Date Topic · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`, `find Area "…"` or `find Topic "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last) or by topic (11-29, in the document's order, `No topic` last; a topic whose name stands under two campaigns reads ` · `), each a head with its count (`▾ FIX 65`, the first open, the others folded `▸ TASK 43`), and under it its items, the newest first, each a row of fixed cells: the kind's word (colored as on the panel), the date `YYYY-MM-DD` (`—` none), the area (`No area`), `Discuss` or `Waiting` before the title (Ready and no state leave the cell blank), the title (cut with `…`; -opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d` group by kind, area or date (a new -grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); +opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d`, `o` group by kind, area, date or topic (a new +grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name, Tab again: a topic's; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); a filtered or found view stands with every group open; `Home`/`End` stand on the first or the last item, opening its group; Enter on an item opens its lines (`part: detail`, `open` the item's key, `indent` the cells under the date: one item read; one `⠏` stands under it until they come): `2026-11-16 · FIX · Panel · Waiting`, -`campaign `, then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, -the filter and what was found belong to the open board alone: the popup opened again starts grouped by kind, everything shown. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's +`campaign `, `topic ` (11-29, where it has one), then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, +the filter and what was found belong to the open board alone: the popup opened again starts grouped by topic where the document has one (else by kind), everything shown; a board opened on topic whose new answer has no topic goes back to kind. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's item row and on the board whatever it is grouped by. **The read limits** stand on the board: a file longer than the 1 MiB read limit counts what was read (`146+ total`) and says `read 146 · more in backlog.md (the file is longer than is read)`; an answer whose rows pass 200 KiB (`BACKLOG_ANSWER_BYTES`; the host reads 256 KiB -of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, -`total`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. +of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, `Topic`, `No topic`, +`total`, `topics`, `items`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. A document of another form (no headings, no `- ` bullets) shows as much as is read and no item is none. The title is `BACKLOG · `.), QUESTIONS (the question editor), ROUTE (Fleet's own table: the backend's `popup` reading draws diff --git a/adapters/codex/AGENTS.md b/adapters/codex/AGENTS.md index a8477848bb..a24a49506d 100644 --- a/adapters/codex/AGENTS.md +++ b/adapters/codex/AGENTS.md @@ -120,6 +120,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/adapters/codex/plugins/hearting-codex/core/ARTIFACT_META.md b/adapters/codex/plugins/hearting-codex/core/ARTIFACT_META.md index 73dfbdceb7..9248053434 100644 --- a/adapters/codex/plugins/hearting-codex/core/ARTIFACT_META.md +++ b/adapters/codex/plugins/hearting-codex/core/ARTIFACT_META.md @@ -311,7 +311,8 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. every campaign, that opens `all-campaigns.*`), **backlog** (one line that opens the root's `backlog.md`, see the next section; its meta is the total, the count of each kind, the count in Discuss and the file's `갱신` date (`6 total · FIX 2 · TASK 1 · NOTE 1 · TBD 2 · Discuss 1`, - `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`); there is no section when that regular file is absent or a link, and + `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`; a document with a + topic says its topic count and its job count first instead of the total, `3 topics · 5 items` (`주제 3 · 할 일 5`), and an old one keeps `5 total`); there is no section when that regular file is absent or a link, and `Counts unavailable` instead of the counts when it cannot be read or is over 1 MiB) and **records** (a link to the recent route reports page and a link to the ID index `campaigns/INDEX.md`), plus the root totals. The line counts are the constants `ENTRANCE_SPEC_LINES` and @@ -367,18 +368,22 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. ### `backlog.md` — what was put off -- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo. +- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo; the jobs + that are done leave it for one closed record beside it, `/backlog-closed.md` (see + **Done** below). - **Form.** A title line, then `갱신 YYYY-MM-DD HH:MM`, then one `## ` - heading per campaign, with `## Unassigned` for work with no campaign. A job is one top-level - `- ` bullet (a title line of at most 60 columns) with optional indented `date:`, `source:`, - `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came up, where from, what the - person said then, what kind of work it is, where in the repo it mainly lands, how far it is, and - the order the person gave it). + heading per campaign, with `## Unassigned` for work with no campaign. Under a campaign, one or more + `### ` headings (the result the person wants; see **Topic heading** below), and under a topic + the jobs. A job is one top-level `- ` bullet (a title line of at most 60 columns) with optional + indented `date:`, `source:`, `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came + up, where from, what the person said then, what kind of work it is, where in the repo it mainly lands, + how far it is, and the order the person gave it). The title line carries no tag, status or owner mark; the kind, area, state and priority are those optional lines alone. ```text ## 2026-11-02_v4-open + ### 질문에 한 번 답하면 어디에 전달됐는지 안다 - Resuming a route loses its stage date: 2026-11-26 kind: fix @@ -386,7 +391,23 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. state: discuss source: the person, while resuming note: what was seen, and what the person said then + - The answered question says where it went + date: 2026-11-27 + kind: task + area: Questions ``` +- **Topic heading.** A `###` line names the result the person wants to be able to do or see when the + work under it is done (`질문에 한 번 답하면 어디에 전달됐는지 안다`), not a part of the repo, a step of a + plan, or a batch of work: a campaign's own plan is not a topic. The part of the repo belongs to + `area:`, and one topic may span several areas. The name is read with its ends cut and its runs of + blanks folded to one; the first spelling written is the name shown. A job written under a campaign + with no `###` heading above it stands in `No topic`; a campaign may keep that form and gain topics + later, and a document with no `###` heading at all reads exactly as it did before topics existed. +- **Topic identity.** A topic is its campaign heading and its folded name together: the same name under + the same campaign is one topic however many times it is written, and the same name under another + campaign is another topic (the board joins the campaign's name where it shows two of them together). + Topics are never merged for looking alike, by a reader or by a writer: only a person moves jobs from + one topic to another, and the moved jobs' `note:` lines then name the old topic. - **`kind:` line.** An indented line under a job, `kind: `; the value is `fix` (the flow or result in use keeps a problem, however it is to be solved), `task` (something to do: an improvement, a new piece, a test, a clean-up, a look into something; an observation that now has @@ -422,6 +443,14 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. below the first heading line and outside a code fence. - A heading line is `##` followed by a space, a tab or the end of the line, after at most three spaces: ` ## C` is a heading, four spaces make it no heading, and `###` is none. + - A topic line is `###` followed by a space, a tab or the end of the line, after at most three + spaces: ` ### T` is a topic, four spaces and `####` are none, and a `###` before the first `##` + heading is no topic. An empty `###` names `No topic`. + - A job's topic is the nearest topic line above it in its campaign; a job with none above it in its + campaign (or in a campaign with no topic) is `No topic`. A topic line closes no job: only a `##` + heading, a fence or another line at the left edge does. + - The number of topics is the number of topics holding at least one job: an empty `###` (one with no + `- ` under it) is not counted, and neither is `No topic`. - A `- ` line before the first heading is not a job. Neither is any line that does not start with `- ` at its left edge: `*`, `+` and numbered items, `-` with no space after it, indented lines, sub-bullets, `> - `. @@ -436,14 +465,41 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. `갱신 YYYY-MM-DD HH:MM` (ASCII digits) with a date and time that exist; surrounding whitespace is ignored. The first line of that shape and a real time is the date; any other line, or `갱신 2026-13-45 99:99`, is no date. -- **Who and when.** The session that puts a job off adds one line, at that moment, under the - campaign's heading (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and - an `area:` and a `state:` line where they are known (each left out when it is not known). A - person writes it by hand. -- **Done.** The line is deleted. The file holds open work only. -- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes - it. All three read the jobs and their lines by this one rule (`utilities/backlog_items.py`) and - count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. The entrance reads it by +- **Who and when.** The session that puts a job off adds one line, at that moment, under its campaign + (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and an `area:` and a + `state:` line where they are known (each left out when it is not known). A person writes it by hand. + A new request first looks for the topic of the same result, then: + - another case of a job already written → one indented line under that job + (`noteN: [MM-DD] … — source …`, the file's own habit), the job's other lines unchanged; + - a job finished apart from it → a sibling `- ` under the same topic; + - another result → a new `###` topic under the campaign; + - not sure which → a new topic (names are never merged for looking alike, and a wrong pairing is + worse than a second topic). +- **Done.** A finished job is not deleted. Take the job's block — its `- ` line and every indented line + under it, up to the next line at the left edge (never a text replacement) — and append it at the end + of `/backlog-closed.md`, under a `## ` and `### ` heading + when the last thing written there is not already those headings; and add one indented line under the + job, `closed: YYYY-MM-DD `. + The job's siblings stay under the topic in the + open file; when the last job of a topic leaves, its `###` heading leaves too. A new closing always + appends to `backlog-closed.md` only: the older + `backlog-closed-*.md` files (such as `backlog-closed-1127.md`) and their `판정:` lines are read-only + history, and nothing is appended to or rewritten in them. +- **Recurrence.** A request that is the same result again: find its topic by name in the open file + first, then in `backlog-closed.md` and the older `backlog-closed-*.md` files (a text search is enough; + no ID is needed). A closed topic is opened again with the same words as a `###` heading, and the new + job's `note:` names the history it continues: + `이력: backlog-closed.md "### "`. +- **`backlog-closed.md`.** The closed record beside the open file: same place, same form (`##` campaign, + `###` topic, the job's block as it was, then `closed:`), append only — never inserted in the middle, + never rewritten. It is read as one history together with the older `backlog-closed-*.md` files, which + are never written; only the open `backlog.md` decides what is still open. +- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes it. + All three read the jobs, their lines and their topics by this one rule (`utilities/backlog_items.py`) + and count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. With a topic in the document + the board opens grouped by topic (`o`; `k`, `a`, `d` the other groupings), an opened job's lines carry + its `topic`, and the board's head and the entrance say both numbers (`39 topics · 99 items`, + `주제 39 · 할 일 99`); without one they read as before (`99 total`). The entrance reads it by name, never through a link, at most 1 MiB, the panel's own limit. No command, setting or step is added. diff --git a/adapters/codex/plugins/hearting-codex/core/CORE.md b/adapters/codex/plugins/hearting-codex/core/CORE.md index b9dd301530..4badf732a7 100644 --- a/adapters/codex/plugins/hearting-codex/core/CORE.md +++ b/adapters/codex/plugins/hearting-codex/core/CORE.md @@ -222,7 +222,7 @@ never orders a move or a delete. | `.git/`, `.agents/`, `.codex/`, `.probe-*/` | runtime residue that lives beside artifacts without being one | `C-LEG(runtime-residue)` | | `_scratch/` | the sole exact census exclusion | `C-SCR` | | `README.md`, `index.html`, `all-campaigns.md`, `all-campaigns.html`, `all-spec.md`, `all-spec.html`, `recent-route-reports.md`, `recent-route-reports.html` (files) | derived read entrance that Hearting rewrites (not canonical; not an admission, census or residue input; a same-named file without the generator's `` marker stays with its owner: the generator leaves it unchanged and in place) | `C-RT` | -| `backlog.md` (file) | a root document that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`); Hearting only reads it. Not canonical; not an admission, census or residue input, and not an entrance file (Hearting does not rewrite it) | `C-RT` | +| `backlog.md`, `backlog-closed.md` (files) | root documents that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`, and the record of the jobs that are done beside it, with the day and the evidence they closed); Hearting only reads them. Not canonical; not an admission, census or residue input, and not entrance files (Hearting does not rewrite them). The older `backlog-closed-*.md` files are read-only history and stay where they are | `C-RT` | The following paths are a sealed-evidence exception set. These exact prefixes (and their descendants) or exact files take precedence over their parent diff --git a/adapters/codex/plugins/hearting-codex/core/fragments/bootstrap-body.md b/adapters/codex/plugins/hearting-codex/core/fragments/bootstrap-body.md index f2ff59b015..6f4ce3e9b7 100644 --- a/adapters/codex/plugins/hearting-codex/core/fragments/bootstrap-body.md +++ b/adapters/codex/plugins/hearting-codex/core/fragments/bootstrap-body.md @@ -110,6 +110,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/adapters/codex/plugins/hearting-codex/core/references/session-shell.md b/adapters/codex/plugins/hearting-codex/core/references/session-shell.md index 2683bbd972..f92a8be980 100755 --- a/adapters/codex/plugins/hearting-codex/core/references/session-shell.md +++ b/adapters/codex/plugins/hearting-codex/core/references/session-shell.md @@ -1304,24 +1304,23 @@ they arrive (for a page with a list screen, after the document read whole is ask cannot read is that same failure, not a `?`), and the Fleet part holds no place of the document's: a popup opened again while it is out stands at once, and its lines are kept only for the width and value they were asked at), BACKLOG (11-21: the status popup's list screen over `/backlog.md`, drawn by the same `status-list.cjs` with the same frame; 11-26, scheme A: the **board**, `session_status.backlog_board` laid out by `backlog-board.cjs`; its answer is the status popup's own (`part: list` / `doc` / `detail`, no Fleet part; -`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, and under -each the top-level `- ` bullets, one item each, read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, -followed by a blank or the end of the line; a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; +`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, under each one or more `###` topic headings (11-29: the result the person wants, e.g. `### 질문에 한 번 답하면 어디에 전달됐는지 안다`) and under a topic the top-level `- ` bullets, one item each (a bullet directly under the campaign, or under one with no `###`, is `No topic`), read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, +followed by a blank or the end of the line; a topic line is `###` the same way (`####` is none, one before the first `##` is none, an empty one names no topic group); a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; `- - -` and a `- ` inside an HTML comment are counted; a code fence (up to three spaces in, whatever follows) is not read, closes on the same character and the same or a longer length only, and one never closed runs to the end; `갱신 YYYY-MM-DD HH:MM` (ASCII digits, one blank, the line's own surrounding blanks cut) is read before the first `##` only, and only where the date and the time are real, shown as `updated MM-DD HH:MM`, with `! … old document` after three days). An item's optional indented lines are its kind (`kind:` `fix`, `task`, `note`, the earlier `improve` read as `task`; none, another value or two different values is `TBD`), its state (`state:` `discuss`, `ready`, `waiting`; else none), its one area (`area:`, case and runs of blanks folded, the first spelling the group's name; none or two different is `No area`) and its date (`date:` `YYYY-MM-DD`, a real one; else none); a wrong value leaves only that cell undecided and the board still opens. **The board's answer carries one short row per item** (`[key, kind, date, area, state, title, campaign]`, newest first: the latest date first, -the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`), what it shows -(`group [Kind] Area Date · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last), each a head with its count (`▾ FIX 65`, +the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. A document with a topic (11-29) adds an eighth cell to each row, the index of its topic in the answer's `topics = [[name, campaign index], …]` (document order, `-1` for `No topic`), and `counts.topics`; a document with none answers exactly as before (seven cells, no `topics`), so an older popup and the panel's own lists read it as they did. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`; with a topic `39 topics · 99 items · FIX 65 · …`, the same items the old total counted), what it shows +(`group [Kind] Area Date Topic · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`, `find Area "…"` or `find Topic "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last) or by topic (11-29, in the document's order, `No topic` last; a topic whose name stands under two campaigns reads ` · `), each a head with its count (`▾ FIX 65`, the first open, the others folded `▸ TASK 43`), and under it its items, the newest first, each a row of fixed cells: the kind's word (colored as on the panel), the date `YYYY-MM-DD` (`—` none), the area (`No area`), `Discuss` or `Waiting` before the title (Ready and no state leave the cell blank), the title (cut with `…`; -opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d` group by kind, area or date (a new -grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); +opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d`, `o` group by kind, area, date or topic (a new +grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name, Tab again: a topic's; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); a filtered or found view stands with every group open; `Home`/`End` stand on the first or the last item, opening its group; Enter on an item opens its lines (`part: detail`, `open` the item's key, `indent` the cells under the date: one item read; one `⠏` stands under it until they come): `2026-11-16 · FIX · Panel · Waiting`, -`campaign `, then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, -the filter and what was found belong to the open board alone: the popup opened again starts grouped by kind, everything shown. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's +`campaign `, `topic ` (11-29, where it has one), then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, +the filter and what was found belong to the open board alone: the popup opened again starts grouped by topic where the document has one (else by kind), everything shown; a board opened on topic whose new answer has no topic goes back to kind. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's item row and on the board whatever it is grouped by. **The read limits** stand on the board: a file longer than the 1 MiB read limit counts what was read (`146+ total`) and says `read 146 · more in backlog.md (the file is longer than is read)`; an answer whose rows pass 200 KiB (`BACKLOG_ANSWER_BYTES`; the host reads 256 KiB -of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, -`total`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. +of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, `Topic`, `No topic`, +`total`, `topics`, `items`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. A document of another form (no headings, no `- ` bullets) shows as much as is read and no item is none. The title is `BACKLOG · `.), QUESTIONS (the question editor), ROUTE (Fleet's own table: the backend's `popup` reading draws diff --git a/adapters/opencode/AGENTS.md b/adapters/opencode/AGENTS.md index 447d8db8b1..dfc5d70aeb 100644 --- a/adapters/opencode/AGENTS.md +++ b/adapters/opencode/AGENTS.md @@ -125,6 +125,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/core/ARTIFACT_META.md b/core/ARTIFACT_META.md index 73dfbdceb7..9248053434 100644 --- a/core/ARTIFACT_META.md +++ b/core/ARTIFACT_META.md @@ -311,7 +311,8 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. every campaign, that opens `all-campaigns.*`), **backlog** (one line that opens the root's `backlog.md`, see the next section; its meta is the total, the count of each kind, the count in Discuss and the file's `갱신` date (`6 total · FIX 2 · TASK 1 · NOTE 1 · TBD 2 · Discuss 1`, - `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`); there is no section when that regular file is absent or a link, and + `TBD n` only where some job has no kind; a document with no kind written on any line says `FIX ? · TASK ? · NOTE ?` and its `TBD`; a document with a + topic says its topic count and its job count first instead of the total, `3 topics · 5 items` (`주제 3 · 할 일 5`), and an old one keeps `5 total`); there is no section when that regular file is absent or a link, and `Counts unavailable` instead of the counts when it cannot be read or is over 1 MiB) and **records** (a link to the recent route reports page and a link to the ID index `campaigns/INDEX.md`), plus the root totals. The line counts are the constants `ENTRANCE_SPEC_LINES` and @@ -367,18 +368,22 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. ### `backlog.md` — what was put off -- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo. +- **Place.** One file at the artifact root: `/backlog.md`, for the whole repo; the jobs + that are done leave it for one closed record beside it, `/backlog-closed.md` (see + **Done** below). - **Form.** A title line, then `갱신 YYYY-MM-DD HH:MM`, then one `## ` - heading per campaign, with `## Unassigned` for work with no campaign. A job is one top-level - `- ` bullet (a title line of at most 60 columns) with optional indented `date:`, `source:`, - `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came up, where from, what the - person said then, what kind of work it is, where in the repo it mainly lands, how far it is, and - the order the person gave it). + heading per campaign, with `## Unassigned` for work with no campaign. Under a campaign, one or more + `### ` headings (the result the person wants; see **Topic heading** below), and under a topic + the jobs. A job is one top-level `- ` bullet (a title line of at most 60 columns) with optional + indented `date:`, `source:`, `note:`, `kind:`, `area:`, `state:` and `priority:` lines (when it came + up, where from, what the person said then, what kind of work it is, where in the repo it mainly lands, + how far it is, and the order the person gave it). The title line carries no tag, status or owner mark; the kind, area, state and priority are those optional lines alone. ```text ## 2026-11-02_v4-open + ### 질문에 한 번 답하면 어디에 전달됐는지 안다 - Resuming a route loses its stage date: 2026-11-26 kind: fix @@ -386,7 +391,23 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. state: discuss source: the person, while resuming note: what was seen, and what the person said then + - The answered question says where it went + date: 2026-11-27 + kind: task + area: Questions ``` +- **Topic heading.** A `###` line names the result the person wants to be able to do or see when the + work under it is done (`질문에 한 번 답하면 어디에 전달됐는지 안다`), not a part of the repo, a step of a + plan, or a batch of work: a campaign's own plan is not a topic. The part of the repo belongs to + `area:`, and one topic may span several areas. The name is read with its ends cut and its runs of + blanks folded to one; the first spelling written is the name shown. A job written under a campaign + with no `###` heading above it stands in `No topic`; a campaign may keep that form and gain topics + later, and a document with no `###` heading at all reads exactly as it did before topics existed. +- **Topic identity.** A topic is its campaign heading and its folded name together: the same name under + the same campaign is one topic however many times it is written, and the same name under another + campaign is another topic (the board joins the campaign's name where it shows two of them together). + Topics are never merged for looking alike, by a reader or by a writer: only a person moves jobs from + one topic to another, and the moved jobs' `note:` lines then name the old topic. - **`kind:` line.** An indented line under a job, `kind: `; the value is `fix` (the flow or result in use keeps a problem, however it is to be solved), `task` (something to do: an improvement, a new piece, a test, a clean-up, a look into something; an observation that now has @@ -422,6 +443,14 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. below the first heading line and outside a code fence. - A heading line is `##` followed by a space, a tab or the end of the line, after at most three spaces: ` ## C` is a heading, four spaces make it no heading, and `###` is none. + - A topic line is `###` followed by a space, a tab or the end of the line, after at most three + spaces: ` ### T` is a topic, four spaces and `####` are none, and a `###` before the first `##` + heading is no topic. An empty `###` names `No topic`. + - A job's topic is the nearest topic line above it in its campaign; a job with none above it in its + campaign (or in a campaign with no topic) is `No topic`. A topic line closes no job: only a `##` + heading, a fence or another line at the left edge does. + - The number of topics is the number of topics holding at least one job: an empty `###` (one with no + `- ` under it) is not counted, and neither is `No topic`. - A `- ` line before the first heading is not a job. Neither is any line that does not start with `- ` at its left edge: `*`, `+` and numbered items, `-` with no space after it, indented lines, sub-bullets, `> - `. @@ -436,14 +465,41 @@ recreates them. They are classified `C-RT` in `core/CORE.md` §3. `갱신 YYYY-MM-DD HH:MM` (ASCII digits) with a date and time that exist; surrounding whitespace is ignored. The first line of that shape and a real time is the date; any other line, or `갱신 2026-13-45 99:99`, is no date. -- **Who and when.** The session that puts a job off adds one line, at that moment, under the - campaign's heading (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and - an `area:` and a `state:` line where they are known (each left out when it is not known). A - person writes it by hand. -- **Done.** The line is deleted. The file holds open work only. -- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes - it. All three read the jobs and their lines by this one rule (`utilities/backlog_items.py`) and - count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. The entrance reads it by +- **Who and when.** The session that puts a job off adds one line, at that moment, under its campaign + (and refreshes `갱신`), with its `date:` line and its `kind:` line then, and an `area:` and a + `state:` line where they are known (each left out when it is not known). A person writes it by hand. + A new request first looks for the topic of the same result, then: + - another case of a job already written → one indented line under that job + (`noteN: [MM-DD] … — source …`, the file's own habit), the job's other lines unchanged; + - a job finished apart from it → a sibling `- ` under the same topic; + - another result → a new `###` topic under the campaign; + - not sure which → a new topic (names are never merged for looking alike, and a wrong pairing is + worse than a second topic). +- **Done.** A finished job is not deleted. Take the job's block — its `- ` line and every indented line + under it, up to the next line at the left edge (never a text replacement) — and append it at the end + of `/backlog-closed.md`, under a `## ` and `### ` heading + when the last thing written there is not already those headings; and add one indented line under the + job, `closed: YYYY-MM-DD `. + The job's siblings stay under the topic in the + open file; when the last job of a topic leaves, its `###` heading leaves too. A new closing always + appends to `backlog-closed.md` only: the older + `backlog-closed-*.md` files (such as `backlog-closed-1127.md`) and their `판정:` lines are read-only + history, and nothing is appended to or rewritten in them. +- **Recurrence.** A request that is the same result again: find its topic by name in the open file + first, then in `backlog-closed.md` and the older `backlog-closed-*.md` files (a text search is enough; + no ID is needed). A closed topic is opened again with the same words as a `###` heading, and the new + job's `note:` names the history it continues: + `이력: backlog-closed.md "### "`. +- **`backlog-closed.md`.** The closed record beside the open file: same place, same form (`##` campaign, + `###` topic, the job's block as it was, then `closed:`), append only — never inserted in the middle, + never rewritten. It is read as one history together with the older `backlog-closed-*.md` files, which + are never written; only the open `backlog.md` decides what is still open. +- **Readers.** The panel's BACKLOG part, its board and the entrance only read it; no code writes it. + All three read the jobs, their lines and their topics by this one rule (`utilities/backlog_items.py`) + and count each kind (`FIX`, `TASK`, `NOTE`, `TBD`) and state the same. With a topic in the document + the board opens grouped by topic (`o`; `k`, `a`, `d` the other groupings), an opened job's lines carry + its `topic`, and the board's head and the entrance say both numbers (`39 topics · 99 items`, + `주제 39 · 할 일 99`); without one they read as before (`99 total`). The entrance reads it by name, never through a link, at most 1 MiB, the panel's own limit. No command, setting or step is added. diff --git a/core/CORE.md b/core/CORE.md index b9dd301530..4badf732a7 100644 --- a/core/CORE.md +++ b/core/CORE.md @@ -222,7 +222,7 @@ never orders a move or a delete. | `.git/`, `.agents/`, `.codex/`, `.probe-*/` | runtime residue that lives beside artifacts without being one | `C-LEG(runtime-residue)` | | `_scratch/` | the sole exact census exclusion | `C-SCR` | | `README.md`, `index.html`, `all-campaigns.md`, `all-campaigns.html`, `all-spec.md`, `all-spec.html`, `recent-route-reports.md`, `recent-route-reports.html` (files) | derived read entrance that Hearting rewrites (not canonical; not an admission, census or residue input; a same-named file without the generator's `` marker stays with its owner: the generator leaves it unchanged and in place) | `C-RT` | -| `backlog.md` (file) | a root document that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`); Hearting only reads it. Not canonical; not an admission, census or residue input, and not an entrance file (Hearting does not rewrite it) | `C-RT` | +| `backlog.md`, `backlog-closed.md` (files) | root documents that a person or a session writes (what was put off, `core/ARTIFACT_META.md` `backlog.md`, and the record of the jobs that are done beside it, with the day and the evidence they closed); Hearting only reads them. Not canonical; not an admission, census or residue input, and not entrance files (Hearting does not rewrite them). The older `backlog-closed-*.md` files are read-only history and stay where they are | `C-RT` | The following paths are a sealed-evidence exception set. These exact prefixes (and their descendants) or exact files take precedence over their parent diff --git a/core/fragments/bootstrap-body.md b/core/fragments/bootstrap-body.md index f2ff59b015..6f4ce3e9b7 100644 --- a/core/fragments/bootstrap-body.md +++ b/core/fragments/bootstrap-body.md @@ -110,6 +110,7 @@ dispatch depth, model role, tests, safety, or validation. - Memory: `core/MEMORY.md` - Capabilities, roles, modes: `capabilities/README.md`, `roles/README.md`, `roles/MODES.md` - Route health: `hearting run workflow-supervisor status --route --json` +- Put-off work, its topics and closing it (`backlog.md`): `core/ARTIFACT_META.md` `backlog.md` - Compute hosts: `compute-hosts`, `~/.config/hearting/compute-hosts.yaml`; receipts show GPU headroom - This runtime's commands and edge cases: the adapter `README.md` and `ADAPTATION.md` diff --git a/core/references/session-shell.md b/core/references/session-shell.md index 2683bbd972..f92a8be980 100755 --- a/core/references/session-shell.md +++ b/core/references/session-shell.md @@ -1304,24 +1304,23 @@ they arrive (for a page with a list screen, after the document read whole is ask cannot read is that same failure, not a `?`), and the Fleet part holds no place of the document's: a popup opened again while it is out stands at once, and its lines are kept only for the width and value they were asked at), BACKLOG (11-21: the status popup's list screen over `/backlog.md`, drawn by the same `status-list.cjs` with the same frame; 11-26, scheme A: the **board**, `session_status.backlog_board` laid out by `backlog-board.cjs`; its answer is the status popup's own (`part: list` / `doc` / `detail`, no Fleet part; -`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, and under -each the top-level `- ` bullets, one item each, read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, -followed by a blank or the end of the line; a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; +`session_status.backlog_view`, `session_shell._status_popup(kind="backlog")`). The document's form (written by another task, only read here): a title, `갱신 YYYY-MM-DD HH:MM`, then `##` headings, each a campaign folder name or `Unassigned`, under each one or more `###` topic headings (11-29: the result the person wants, e.g. `### 질문에 한 번 답하면 어디에 전달됐는지 안다`) and under a topic the top-level `- ` bullets, one item each (a bullet directly under the campaign, or under one with no `###`, is `No topic`), read by the one rule the entrance reads them by (core/ARTIFACT_META.md `backlog.md`, `utilities/backlog_items.py`; `parse_backlog` and `artifact_entrance._backlog` both call it, and are checked against each other on the same random documents: a heading is `##`, after at most three spaces, +followed by a blank or the end of the line; a topic line is `###` the same way (`####` is none, one before the first `##` is none, an empty one names no topic group); a `- ` before the first `##` is none; `*`, `+`, `-` and numbered lists are none; an indented line and a sub-bullet are none; `- - -` and a `- ` inside an HTML comment are counted; a code fence (up to three spaces in, whatever follows) is not read, closes on the same character and the same or a longer length only, and one never closed runs to the end; `갱신 YYYY-MM-DD HH:MM` (ASCII digits, one blank, the line's own surrounding blanks cut) is read before the first `##` only, and only where the date and the time are real, shown as `updated MM-DD HH:MM`, with `! … old document` after three days). An item's optional indented lines are its kind (`kind:` `fix`, `task`, `note`, the earlier `improve` read as `task`; none, another value or two different values is `TBD`), its state (`state:` `discuss`, `ready`, `waiting`; else none), its one area (`area:`, case and runs of blanks folded, the first spelling the group's name; none or two different is `No area`) and its date (`date:` `YYYY-MM-DD`, a real one; else none); a wrong value leaves only that cell undecided and the board still opens. **The board's answer carries one short row per item** (`[key, kind, date, area, state, title, campaign]`, newest first: the latest date first, -the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`), what it shows -(`group [Kind] Area Date · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last), each a head with its count (`▾ FIX 65`, +the same date in the document's order, no date last), the counts and the head, never the lines under an item, so a backlog of 1,000 items stands as one answer. A document with a topic (11-29) adds an eighth cell to each row, the index of its topic in the answer's `topics = [[name, campaign index], …]` (document order, `-1` for `No topic`), and `counts.topics`; a document with none answers exactly as before (seven cells, no `topics`), so an older popup and the panel's own lists read it as they did. **The board, top to bottom**: the title, `updated …`, the counts (`146 total · FIX 65 · TASK 43 · TBD 0 · NOTE 38`; with a topic `39 topics · 99 items · FIX 65 · …`, the same items the old total counted), what it shows +(`group [Kind] Area Date Topic · showing 146 · Discuss 18`; filtered, `showing 18 of 146 · … · state Discuss` and `find Title "…"`, `find Area "…"` or `find Topic "…"`), then the groups: by kind (`FIX`, `TASK`, `TBD`, `NOTE`), by area (by name, `No area` last) or by date (the newest first, `No date` last) or by topic (11-29, in the document's order, `No topic` last; a topic whose name stands under two campaigns reads ` · `), each a head with its count (`▾ FIX 65`, the first open, the others folded `▸ TASK 43`), and under it its items, the newest first, each a row of fixed cells: the kind's word (colored as on the panel), the date `YYYY-MM-DD` (`—` none), the area (`No area`), `Discuss` or `Waiting` before the title (Ready and no state leave the cell blank), the title (cut with `…`; -opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d` group by kind, area or date (a new -grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); +opened, it stands whole). Short of cells the area cell goes first, then the date. Then `full document ›` (the document read whole, its first 64 KiB, `… 64 KiB` after a longer one). **Its keys** (on top of the list screen's ↑↓, PgUp/PgDn, Enter, ←→): `k`, `a`, `d`, `o` group by kind, area, date or topic (a new +grouping opens its first group and stands on its first item); `t` shows All, Discuss, Ready, Waiting, No state in turn; `/` finds a title (Tab first: an area's name, Tab again: a topic's; case and blanks folded; the words typed stand in one row above the keys, `/ Title: …▏`, and every key typed is the finder's until Enter or Esc); a filtered or found view stands with every group open; `Home`/`End` stand on the first or the last item, opening its group; Enter on an item opens its lines (`part: detail`, `open` the item's key, `indent` the cells under the date: one item read; one `⠏` stands under it until they come): `2026-11-16 · FIX · Panel · Waiting`, -`campaign `, then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, -the filter and what was found belong to the open board alone: the popup opened again starts grouped by kind, everything shown. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's +`campaign `, `topic ` (11-29, where it has one), then its own lines as written (`source …`, `note …`, the note wrapping to eight rows); Enter again closes it. Esc undoes the board's own state one step at a time (what is being typed, the opened items, what was found, the state shown), then closes the popup. The grouping, +the filter and what was found belong to the open board alone: the popup opened again starts grouped by topic where the document has one (else by kind), everything shown; a board opened on topic whose new answer has no topic goes back to kind. A press on a panel item stands the board on it and opens its group. An item's key is `i:` (`:N` for the Nth of the same title there), the same in the panel's item row and on the board whatever it is grouped by. **The read limits** stand on the board: a file longer than the 1 MiB read limit counts what was read (`146+ total`) and says `read 146 · more in backlog.md (the file is longer than is read)`; an answer whose rows pass 200 KiB (`BACKLOG_ANSWER_BYTES`; the host reads 256 KiB -of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, -`total`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. +of an answer) holds the newest that fit and says `showing the newest 600 of 1,000 · 400 more in backlog.md`. The campaign headings are the document's words as written, never invented. The words Hearting puts there (`BACKLOG`, `FIX`, `TASK`, `NOTE`, `TBD`, `Discuss`, `Ready`, `Waiting`, `No area`, `No date`, `Topic`, `No topic`, +`total`, `topics`, `items`, `updated`, `old document`, `full document`, `No backlog document yet.`) are English whatever the language. No document, a folder or link of that name, one that cannot be read: the popup's one dim line, no board. A document of another form (no headings, no `- ` bullets) shows as much as is read and no item is none. The title is `BACKLOG · `.), QUESTIONS (the question editor), ROUTE (Fleet's own table: the backend's `popup` reading draws diff --git a/docs/session-panel.md b/docs/session-panel.md index 930331f60b..5d5d4b27ff 100644 --- a/docs/session-panel.md +++ b/docs/session-panel.md @@ -45,7 +45,7 @@ motion, or none, under [Settings](#settings)). From the top: | Rows | What they say | |---|---| -| `REPO` | One row: the repository, then its Git words in parentheses, then the linked-worktree count: `REPO web-api (main ↑2 ↓5) wt 1` — the branch, then `✓` when it is level with its upstream or `↑N` in green and `↓N` in red (Fleet's colors), then any merge or rebase warning; `(no-git)` outside a repository. Short of room `wt` goes first, then the label's column, then (in a short window) the buttons below fold, then the longer of the name and the branch loses letters (down to one letter and `…`), and the arrows and the warning go last; a wider window never shows less of the name or the branch. Under it stand **STATUS** and **BACKLOG**, each a head one cell in (`›` at the row's right end). `STATUS 5 ›` is a button: the number is everything its board shows, and a press opens the status document (its list screen, then whole with Fleet's status lines and markdown tables as aligned columns); nothing is listed under it. `BACKLOG +136 · Discuss 2 ›` counts the items not shown and the document's Discuss items, and under it stand up to three items **in the order you gave** — the ones with a `priority:` line in `backlog.md` (1 first; a session writes it only when you say the order) — each state first: `· Ready TASK 11-26 Fit long titles` (the state, the kind `FIX`/`TASK`/`NOTE`/`TBD`, the date, with room the area, then the title). With nothing ranked the head stands alone. A press on the head opens `backlog.md` as a board grouped by kind, area or date (`k`/`a`/`d`), filtered by state (`t`) and searched by title or area (`/`); a press on an item opens the board standing on it. The word is dim when the document is not there yet, and neither part stands where the project keeps no artifact root. Short of rows the two parts fold into buttons at the end of the REPO row, with the heads' numbers (`STATUS 5 › BACKLOG +139 ›`, then the words alone, then `› ›`, before a letter of the name or the branch goes); in the bottom layout the first row ends in `STATUS +N › BACKLOG +N ›` (BACKLOG's `N` is its FIX and TASK together, `?` for an old document with no sort written, nothing for zero) and nothing is listed | +| `REPO` | One row: the repository, then its Git words in parentheses, then the linked-worktree count: `REPO web-api (main ↑2 ↓5) wt 1` — the branch, then `✓` when it is level with its upstream or `↑N` in green and `↓N` in red (Fleet's colors), then any merge or rebase warning; `(no-git)` outside a repository. Short of room `wt` goes first, then the label's column, then (in a short window) the buttons below fold, then the longer of the name and the branch loses letters (down to one letter and `…`), and the arrows and the warning go last; a wider window never shows less of the name or the branch. Under it stand **STATUS** and **BACKLOG**, each a head one cell in (`›` at the row's right end). `STATUS 5 ›` is a button: the number is everything its board shows, and a press opens the status document (its list screen, then whole with Fleet's status lines and markdown tables as aligned columns); nothing is listed under it. `BACKLOG +136 · Discuss 2 ›` counts the items not shown and the document's Discuss items, and under it stand up to three items **in the order you gave** — the ones with a `priority:` line in `backlog.md` (1 first; a session writes it only when you say the order) — each state first: `· Ready TASK 11-26 Fit long titles` (the state, the kind `FIX`/`TASK`/`NOTE`/`TBD`, the date, with room the area, then the title). With nothing ranked the head stands alone. A press on the head opens `backlog.md` as a board grouped by topic where the document has one (the result you want; else by kind), area or date (`o`/`k`/`a`/`d`), filtered by state (`t`) and searched by title, area or topic (`/`); a press on an item opens the board standing on it. The word is dim when the document is not there yet, and neither part stands where the project keeps no artifact root. Short of rows the two parts fold into buttons at the end of the REPO row, with the heads' numbers (`STATUS 5 › BACKLOG +139 ›`, then the words alone, then `› ›`, before a letter of the name or the branch goes); in the bottom layout the first row ends in `STATUS +N › BACKLOG +N ›` (BACKLOG's `N` is its FIX and TASK together, `?` for an old document with no sort written, nothing for zero) and nothing is listed | | `PEERS` | Directly under `REPO`, the sessions tied by supervision: `[c7] ⚑ ─ [d4] [3b]`, the supervising session, its flag, two cells, a dash, then the sessions it supervises, in that order in every window. A supervised window shows only its own group (`[c7] ⚑ ─ [d4]`); a window that is both shows two groups joined by ` · `. Numbers wear their session's harness color: this window's own bold and at full strength, every other session's one step back (darker on a dark or unknown background, as the `USAGE` names are; lighter on a light one, so in 256 colors or more it is never the same color as this window's number), so the window's own number reads at once; with no color, or in 8 or 16 colors, where the two share one hue, weight alone tells them apart, the flag is Fleet's steward pink, and no session state is shown. Short of cells the last numbers become `+N`; a window with no such relation has no row. The numbers are plain text here; Fleet's session page has the same line, where they open that session's page | | `MODEL` | The model and effort, and at the row's right end the context gauge and percent, in its level's color: `MODEL Opus 5.5 xhigh ━━━━────── 41%`. Short of room the effort goes first, then the gauge shortens (down to five cells), then the model name is shortened; the percent stands alone only where no gauge fits. The route box's owner and worker rows keep their own rule (below). Nothing stands there before the context is known. In OpenCode the MCP count and the cost stand on the row under it | | `MODEL` … `NOW` | Under one rule without a word that parts the repository from this session. | @@ -119,6 +119,7 @@ choice leads with `▶` (the place, as the question being answered and the setti | **Enter** | In a question: send, once every form field is answered; the popup closes and keys go back to the native CLI. In ROUTE: the unfolded route's page, and again back to the table (a popup opened on a route's page goes to the table first, then back to the page) | | **↑/↓** | In ROUTE: unfold the next route; elsewhere read on (**PgUp/PgDn** a page) | | **↑/↓**, **Enter** | In NOW: choose a line of the story (oldest first, the latest NOW at the bottom; a prompt's own NOW values fold under it and open with it). **Enter** reads that part of the conversation in the popup and again goes back to the list; on a route line it opens that route's page, on a question or message line that section's popup. Nothing is sent to the agent's window. A very long story shows `… N earlier lines` on top where the oldest were left out | +| **k/a/d/o**, **t**, **/** | On the BACKLOG board: group by kind, area, date or topic (a backlog with a topic opens on topic), show one state, find a title (**Tab** first an area's name, again a topic's) | | **p** | Fold the panel into the strip, or open a folded one (the popup closes) | | **f** | Open Fleet in the same window; **Ctrl+]** closes it and returns | | **r**, **w** | The MESSAGES popup; this repository's open work | diff --git a/tools/fleet/session_panel.py b/tools/fleet/session_panel.py index b36110dd4e..29915294c3 100755 --- a/tools/fleet/session_panel.py +++ b/tools/fleet/session_panel.py @@ -1096,7 +1096,7 @@ def presentation(values, view, harness, sid, columns, *, native_owned=(), displa "popup_now", "popup_now_page", # 11-21: the status popup's keys on its list screen (the document read whole has the keys every popup has). "popup_status", - # 11-26: the BACKLOG board's keys (scheme A: k/a/d group, t state, / find, Home/End). + # 11-26: the BACKLOG board's keys (scheme A: k/a/d group, t state, / find, Home/End); 11-29 adds o (topic). "popup_backlog", # 11-15 (panel polish 1): the action under a question to answer here. "answer_action", diff --git a/tools/fleet/session_status.py b/tools/fleet/session_status.py index 78da765673..84e037103d 100644 --- a/tools/fleet/session_status.py +++ b/tools/fleet/session_status.py @@ -701,12 +701,13 @@ def listing_entries(parsed, width, old=False, now=None): DETAIL_LINES = 12 # indented lines shown under one opened item DETAIL_ROWS = 3 # rows one indented line takes in an opened item NOTE_ROWS = 8 # rows its `note:` line takes (the description is what an opened item is read for) -BACKLOG_WORDS = {"updated": "updated", "old": "old document", "none": "No backlog document yet.", "campaign": "campaign"} +BACKLOG_WORDS = {"updated": "updated", "old": "old document", "none": "No backlog document yet.", "campaign": "campaign", "topic": "topic"} # (the words Hearting puts there are English, as the panel's section names are) # The backlog is read by the one rule the artifact entrance reads it by (core/ARTIFACT_META.md `backlog.md`; `utilities/backlog_items.py`, # which both call): a job is a top-level `- ` bullet under a `##` heading, outside a code fence; the `갱신` line is read before the first heading; -# the optional indented `kind:`, `state:`, `area:` and `date:` lines (11-26, scheme A) are its kind (`fix`, `task`, `note`; the earlier `improve` +# a job's topic (11-29) is the nearest `###` line above it in its campaign (`####` is no topic, one before the first `##` is none, an empty one +# names no topic group); the optional indented `kind:`, `state:`, `area:` and `date:` lines (11-26, scheme A) are its kind (`fix`, `task`, `note`; the earlier `improve` # is `task`; none, another value or two different values is no kind, drawn `TBD`), its state (`discuss`, `ready`, `waiting`; else none, `—`), # its one area (case and runs of blanks folded; the first name written is the group's name; none or two different is `No area`) and its date # (`YYYY-MM-DD`, a real one; else none, `—`); the optional `priority:` line (11-26, panel B) is the order the person gave (a positive whole number, @@ -723,9 +724,10 @@ def _backlog_items(): def parse_backlog(lines, detail=True): - """``{title, updated, groups}`` of a backlog document's lines; ``groups`` is ``[{name, items}]`` and an item - ``{text, kind, state, area, area_key, date, priority, source, note, lines, detail, has_detail, at}`` (``utilities/backlog_items.py``'s job, its title - and heading with the markdown taken off: ``text`` is ``(empty)`` for a bullet with no words). ``lines`` (with ``detail``) are the + """``{title, updated, groups}`` of a backlog document's lines; ``groups`` is ``[{name, topics, items}]`` and an item + ``{text, kind, state, topic, area, area_key, date, priority, source, note, lines, detail, has_detail, at}`` (``utilities/backlog_items.py``'s job, its title + and heading with the markdown taken off: ``text`` is ``(empty)`` for a bullet with no words; ``topic`` its topic's name or ``None``; ``topics`` the + topic names the group's jobs stand under, in the order they first do). ``lines`` (with ``detail``) are the indented lines under it, ``(name, value)``; ``detail`` the same as plain text (``date: 2026-11-20``), ``DETAIL_LINES`` of them.""" parsed = _backlog_items().parse(lines, detail=detail) groups = [] @@ -736,8 +738,10 @@ def parse_backlog(lines, detail=True): # (``detail``: the indented lines as plain text, a line that sets the item's kind left out where it has one) shown = [f"{name}: {value}" if name else value for name, value in job["lines"] if not (name == "kind" and job["kind"])] items.append(dict(job, text=project_status._plain(job["title"]) or "(empty)", + topic=project_status._plain(job["topic"]) if job.get("topic") else None, detail=[transcript.clean(project_status._plain(text)) for text in shown][:DETAIL_LINES] if detail else [])) - groups.append({"name": project_status._plain(heading.group(2)) if heading else "", "items": items}) + groups.append({"name": project_status._plain(heading.group(2)) if heading else "", + "topics": [project_status._plain(name) for name in group.get("topics") or []], "items": items}) title = project_status._plain(parsed["title"]) if parsed["title"] else "" return {"title": title, "updated": parsed["updated"], "groups": groups} @@ -776,6 +780,12 @@ def backlog_total(parsed): return sum(len(group["items"]) for group in parsed["groups"]) +def backlog_topics(parsed): + """``[(campaign name, topic name)]`` in the document's order: the topics holding at least one item, the same definition + ``utilities/backlog_items.counts()["topics"]`` counts by (the same name under another campaign is another topic).""" + return [(group["name"], name) for group in parsed["groups"] for name in group.get("topics") or []] + + def _updated_words(parsed, old, now): stamp = parsed["updated"] if stamp: @@ -793,24 +803,47 @@ def backlog_board(parsed, old=False, now=None, cut=False, limit=None): """The board's answer (the BACKLOG popup, 11-26 scheme A): the document's head and one short row per item, newest first; the host groups, filters and finds on them (``utilities/session-shell/backlog-board.cjs``) and keeps that state while the board is open. - ``{title, updated, old, counts, total, sent, cut, campaigns, items}``: an item is ``[key, kind, date, area, state, title, campaign]`` (``kind`` - ``fix``/``task``/``note`` or ``""``, ``date`` ``YYYY-MM-DD`` or ``""``, ``area`` the area's name or ``""``, ``state`` ``discuss``/``ready``/ - ``waiting`` or ``""``, ``campaign`` the index of its heading in ``campaigns``). ``limit`` is how many items are sent at most (the newest: - the answer's size decides it, and ``sent`` against ``total`` says how many more are in the document); ``cut``: the file is longer than is - read (the counts are of what was read).""" + ``{title, updated, old, counts, total, sent, cut, campaigns, items}``, and ``topics`` with a document that has one: an item is ``[key, kind, + date, area, state, title, campaign]`` (``kind`` ``fix``/``task``/``note`` or ``""``, ``date`` ``YYYY-MM-DD`` or ``""``, ``area`` the area's name + or ``""``, ``state`` ``discuss``/``ready``/``waiting`` or ``""``, ``campaign`` the index of its heading in ``campaigns``). ``limit`` is how many + items are sent at most (the newest: the answer's size decides it, and ``sent`` against ``total`` says how many more are in the document); + ``cut``: the file is longer than is read (the counts are of what was read). + + 11-29 (topics): with a topic holding at least one item the answer also carries ``topics = [[topic name, campaign index], …]`` in the document's + order (every topic of the document, whatever ``limit``), each item row gets an eighth cell, its topic's index in ``topics`` (``-1``: no topic), + and ``counts`` gains ``topics``, the number of them. A campaign with no row sent is added to ``campaigns`` for its topic's index. A document with + no topic answers exactly as before (seven cells, no ``topics``, ``counts`` without it), so an older host and the panel's own lists read it as + they did; ``backlog_counts`` stays the shared counts the panel's list carries.""" rows = _newest(_backlog_rows(parsed)) if limit is not None: rows = rows[:max(0, int(limit))] campaigns, at = [], {} - items = [] + items, pairs = [], [] for campaign, item, key in rows: if campaign not in at: at[campaign] = len(campaigns) campaigns.append(campaign) items.append([key, item["kind"] or "", item["date"] or "", item["area"] or "", item["state"] or "", transcript.clean(item["text"])[:TITLE_TEXT], at[campaign]]) - return {"title": parsed["title"], "updated": _updated_words(parsed, old, now), "old": bool(old), "counts": backlog_counts(parsed), - "total": backlog_total(parsed), "sent": len(items), "cut": bool(cut), "campaigns": campaigns, "items": items} + pairs.append((campaign, item.get("topic"))) + counts = backlog_counts(parsed) + answer = {"title": parsed["title"], "updated": _updated_words(parsed, old, now), "old": bool(old), "counts": counts, + "total": backlog_total(parsed), "sent": len(items), "cut": bool(cut), "campaigns": campaigns, "items": items} + if any(group.get("topics") for group in parsed["groups"]): + topics, index = [], {} + for campaign, name in backlog_topics(parsed): + if (campaign, name) in index: + continue + if campaign not in at: + at[campaign] = len(campaigns) + campaigns.append(campaign) + index[(campaign, name)] = len(topics) + topics.append([name, at[campaign]]) + for row, (campaign, name) in zip(items, pairs): + row.append(index.get((campaign, name), -1)) + answer["topics"] = topics + answer["counts"] = dict(counts, topics=len(topics)) + return answer def backlog_path(root): @@ -909,6 +942,7 @@ def backlog_detail(root, own, key, width, indent=0): 2026-11-16 · FIX · Panel · Waiting the date, kind, area and state (``—``, ``No area`` where there is none) campaign 2026-11-02_v4-open the ``##`` heading the item stands under + topic the ``###`` topic above it (11-29; no line where it has none) source … / note … its other indented lines, as written (a ``note:`` line wraps to ``NOTE_ROWS`` rows) Only that one item is read; ``own`` is not used (the key names the item whichever the window).""" @@ -927,8 +961,11 @@ def backlog_detail(root, own, key, width, indent=0): (item["area"] or "No area", "soft" if item["area"] else "dim"), (" · ", "dim"), (STATE_MARKS[item["state"]], "soft" if item["state"] else "dim")]] out = [_cut_row(out[0], width)] - shown = [(BACKLOG_WORDS["campaign"], campaign or "—")] + [(name, value) for name, value in item["lines"] if name not in ("kind", "state", "area", "date")] - for name, value in shown[:1 + DETAIL_LINES]: + heads = [(BACKLOG_WORDS["campaign"], campaign or "—")] + if item.get("topic"): + heads.append((BACKLOG_WORDS["topic"], item["topic"])) + shown = heads + [(name, value) for name, value in item["lines"] if name not in ("kind", "state", "area", "date")] + for name, value in shown[:len(heads) + DETAIL_LINES]: text = transcript.clean(project_status._plain(value) if value else "") rows = _wrapped((name + " " + text) if name else text, room, NOTE_ROWS if name == "note" else DETAIL_ROWS, "soft") if name and rows and rows[0] and rows[0][0][0].startswith(name + " "): diff --git a/tools/i18n/messages.json b/tools/i18n/messages.json index f28b3ac206..ea772ec78c 100755 --- a/tools/i18n/messages.json +++ b/tools/i18n/messages.json @@ -358,13 +358,17 @@ "en": "Discuss {discuss}", "ko": "Discuss {discuss}" }, + "entrance.backlog_items": { + "en": "{count} items", + "ko": "할 일 {count}" + }, "entrance.backlog_kinds": { "en": "FIX {fix} · TASK {task} · NOTE {note}", "ko": "FIX {fix} · TASK {task} · NOTE {note}" }, "entrance.backlog_note": { - "en": "Work handed off, and what you said then. The session that postpones work writes one line each.", - "ko": "맡긴 일과 그때 하신 말. 일을 미루는 세션이 한 줄씩 적습니다." + "en": "Work handed off, and what you said then, under the result you want. A finished job moves to backlog-closed.md.", + "ko": "맡긴 일과 그때 하신 말을 원하는 결과(주제) 아래에 적습니다. 끝난 일은 backlog-closed.md로 옮겨집니다." }, "entrance.backlog_open": { "en": "Open backlog.md", @@ -374,6 +378,10 @@ "en": "TBD {tbd}", "ko": "TBD {tbd}" }, + "entrance.backlog_topics": { + "en": "{topics} topics", + "ko": "주제 {topics}" + }, "entrance.backlog_unavailable": { "en": "Counts unavailable", "ko": "수를 읽을 수 없음" @@ -1919,8 +1927,8 @@ "ko": "REQUEST" }, "fleet.session_panel.popup_backlog": { - "en": "↑↓ · Enter open · k/a/d group · t state · / find · Home/End", - "ko": "↑↓ · Enter 열기 · k/a/d 묶음 · t 상태 · / 찾기 · Home/End" + "en": "↑↓ · Enter open · k/a/d/o group · t state · / find · Home/End", + "ko": "↑↓ · Enter 열기 · k/a/d/o 묶음 · t 상태 · / 찾기 · Home/End" }, "fleet.session_panel.popup_fold": { "en": "p fold panel", diff --git a/utilities/artifact_entrance.py b/utilities/artifact_entrance.py index 2d053bef9d..ec63f375a2 100755 --- a/utilities/artifact_entrance.py +++ b/utilities/artifact_entrance.py @@ -152,10 +152,12 @@ def _fallback_translator(message: str, /, **fields: Any) -> str: "entrance.section_campaigns": "Campaigns", "entrance.section_records": "Records", "entrance.section_backlog": "Backlog", - "entrance.backlog_note": ("Work handed off, and what you said then. " - "The session that postpones work writes one line each."), + "entrance.backlog_note": ("Work handed off, and what you said then, under the result you want. " + "A finished job moves to backlog-closed.md."), "entrance.backlog_open": "Open backlog.md", "entrance.backlog_count": "{count} total", + "entrance.backlog_topics": "{topics} topics", + "entrance.backlog_items": "{count} items", "entrance.backlog_kinds": "FIX {fix} · TASK {task} · NOTE {note}", "entrance.backlog_tbd": "TBD {tbd}", "entrance.backlog_discuss": "Discuss {discuss}", @@ -602,18 +604,19 @@ def scan(root: Path, *, recent_limit: int = RECENT_LIMIT, def _backlog(root: Path) -> Optional[Dict[str, Any]]: - """The root's `backlog.md` as `{"count", "updated", "kinds", "states"}`, or None when there is no such regular file. + """The root's `backlog.md` as `{"count", "topics", "updated", "kinds", "states"}`, or None when there is no such regular file. Read by name from a no-follow fd, never written, never followed (a link is no file). A file that - cannot be read or is over MAX_BACKLOG_BYTES keeps the line but has no count (`count`, `kinds` and `states` None). - The jobs, their kinds (`fix`, `task`, `note`, `tbd`) and their states (`discuss`, `ready`, `waiting`) are read by the one + cannot be read or is over MAX_BACKLOG_BYTES keeps the line but has no count (`count`, `topics`, `kinds` and `states` None). + The jobs, their kinds (`fix`, `task`, `note`, `tbd`), their states (`discuss`, `ready`, `waiting`) and their topics + (11-29: a topic holding at least one job, the same name under another campaign another topic) are read by the one rule the panel reads them by (core/ARTIFACT_META.md `backlog.md`; `utilities/backlog_items.py`).""" try: if not stat.S_ISREG(os.lstat(str(Path(root) / BACKLOG_NAME)).st_mode): return None except OSError: return None - entry: Dict[str, Any] = {"count": None, "updated": "", "kinds": None, "states": None} + entry: Dict[str, Any] = {"count": None, "topics": None, "updated": "", "kinds": None, "states": None} try: root_fd = open_root(os.path.realpath(str(root))) try: @@ -638,7 +641,7 @@ def _backlog(root: Path) -> Optional[Dict[str, Any]]: import backlog_items parsed = backlog_items.parse(raw.decode("utf-8", "replace").splitlines(), detail=False) counts = backlog_items.counts(parsed) - entry.update({"count": counts["total"], "updated": parsed["updated_text"], + entry.update({"count": counts["total"], "topics": counts["topics"], "updated": parsed["updated_text"], "kinds": {name: counts[name] for name in BACKLOG_KINDS + ("tbd",)}, "states": {name: counts[name] for name in backlog_items.STATES}}) return entry @@ -946,7 +949,12 @@ def line(kind, title, md, html, target, *, date="", summary="", row=None, direct # A document with no kind written anywhere (an old one) has every kind unknown, not none: `?`. sorted_any = any(kinds.get(name) for name in BACKLOG_KINDS) shown = {name: (_count(kinds.get(name, 0)) if sorted_any or not kinds.get("tbd") else "?") for name in BACKLOG_KINDS} - meta.append(t("entrance.backlog_count", count=_count(backlog["count"]))) + # 11-29 (topics): a document with a topic says both numbers first (`3 topics · 5 items`); an old one keeps `5 total`. + if backlog.get("topics"): + meta.append(t("entrance.backlog_topics", topics=_count(backlog["topics"]))) + meta.append(t("entrance.backlog_items", count=_count(backlog["count"]))) + else: + meta.append(t("entrance.backlog_count", count=_count(backlog["count"]))) meta.append(t("entrance.backlog_kinds", **shown)) if kinds.get("tbd"): meta.append(t("entrance.backlog_tbd", tbd=_count(kinds["tbd"]))) diff --git a/utilities/artifact_entrance.test.py b/utilities/artifact_entrance.test.py index 47d892fc59..1e0abea0ee 100755 --- a/utilities/artifact_entrance.test.py +++ b/utilities/artifact_entrance.test.py @@ -1741,7 +1741,7 @@ def test_the_backlog_section_stands_between_the_campaigns_and_the_records_in_bot marks = ("

spec

", "

Campaigns

", "

Backlog

", "

Records

") positions = [page.index(mark) for mark in marks] self.assertEqual(positions, sorted(positions)) - self.assertIn("The session that postpones work writes one line each.", readme) + self.assertIn("A finished job moves to backlog-closed.md.", readme) self.assertIn("[Open backlog.md]()\n 3 total · FIX ? · TASK ? · NOTE ? · TBD 3 · Discuss 0 · updated 2026-11-21 23:10", readme) self.assertIn('Open backlog.md ' '3 total · FIX ? · TASK ? · NOTE ? · TBD 3 · Discuss 0 · updated 2026-11-21 23:10', page) @@ -1908,7 +1908,7 @@ def test_reports_and_open_number_reach_the_backlog_line(self): number = targets.index("backlog.md") + 1 self.assertEqual(targets[number:], ["recent-route-reports.md", "campaigns/INDEX.md"]) out = self.reports() - self.assertIn("Backlog\n Work handed off, and what you said then.", out) + self.assertIn("Backlog\n Work handed off, and what you said then, under the result you want.", out) self.assertIn(f"{number}. Open backlog.md\n backlog.md\n 3 total · FIX ? · TASK ? · NOTE ? · TBD 3 · Discuss 0 · updated 2026-11-21 23:10", out) self.assertEqual(self.open_line(number), str(self.root / "backlog.md")) self.assertEqual(self.open_line(number + 1), str(self.root / "recent-route-reports.html")) @@ -1948,7 +1948,7 @@ def test_korean_says_the_agreed_words(self): self.refresh() readme = self.entrance() self.assertIn("## 백로그", readme) - self.assertIn("맡긴 일과 그때 하신 말. 일을 미루는 세션이 한 줄씩 적습니다.", readme) + self.assertIn("맡긴 일과 그때 하신 말을 원하는 결과(주제) 아래에 적습니다.", readme) self.assertIn("[backlog.md 열기]()\n 전체 3 · FIX ? · TASK ? · NOTE ? · TBD 3 · Discuss 0 · 갱신 2026-11-21 23:10", readme) self.assertIn("

백로그

", self.entrance("index.html")) diff --git a/utilities/artifact_producer_store.py b/utilities/artifact_producer_store.py index 6bda7348ff..3fcba2e352 100755 --- a/utilities/artifact_producer_store.py +++ b/utilities/artifact_producer_store.py @@ -100,10 +100,12 @@ def artifact_index_observation_scope(): ENTRANCE_NAMES = ("README.md", "index.html", "all-campaigns.md", "all-campaigns.html", "recent-route-reports.md", "recent-route-reports.html", "all-spec.md", "all-spec.html") -# CORE §3 root documents that a person or a session writes (`backlog.md`). Not canonical records: -# admission, census and residue never take them as input, and Hearting only reads them. They are -# not entrance files (Hearting does not rewrite them), so they stay out of ENTRANCE_NAMES. -ROOT_DOCUMENT_NAMES = ("backlog.md",) +# CORE §3 root documents that a person or a session writes (`backlog.md` and its closed record +# `backlog-closed.md`). Not canonical records: admission, census and residue never take them as input, +# and Hearting only reads them. They are not entrance files (Hearting does not rewrite them), so they +# stay out of ENTRANCE_NAMES. The older dated `backlog-closed-*.md` files are not in this tuple: they +# are read-only history, and residue keeps counting them as it did. +ROOT_DOCUMENT_NAMES = ("backlog.md", "backlog-closed.md") COMPAT_OVERRIDE_FIELDS = ("schema_version", "contract", "canonical_root", "reason", "issuer", "created_at", "expires_at") WAIVER_FIELDS = ("reason", "issuer", "created_at", "expires_at") diff --git a/utilities/artifact_residue.test.py b/utilities/artifact_residue.test.py index b0519efaff..256276cc70 100644 --- a/utilities/artifact_residue.test.py +++ b/utilities/artifact_residue.test.py @@ -194,8 +194,9 @@ def test_entrance_names_are_never_residue(self): self.assertEqual(RES._prune_empty(self.root), []) def test_a_root_document_is_never_residue(self): - self.seed("backlog.md", "# Backlog\n## 2026-01-01_some-campaign\n- a job\n") self.assertTrue(P.ROOT_DOCUMENT_NAMES) # the loop below has something to do + for name in P.ROOT_DOCUMENT_NAMES: # `backlog.md` and its closed record `backlog-closed.md` (11-29) + self.seed(name, "# Backlog\n## 2026-01-01_some-campaign\n- a job\n") for name in P.ROOT_DOCUMENT_NAMES: self.assertTrue(RES._is_runtime_owned_entry(self.root / name), name) self.assertEqual(list(RES.iter_residue_files(self.root)), []) diff --git a/utilities/backlog_items.py b/utilities/backlog_items.py index ef869b1fa3..be7e6b7bee 100644 --- a/utilities/backlog_items.py +++ b/utilities/backlog_items.py @@ -6,18 +6,25 @@ undecided (kind ``None``: drawn ``TBD``; state, area or date ``None``: drawn ``—`` or ``No area``; priority ``None``: the job is not among the panel's chosen ones); the document still opens. -``parse(lines, detail=True)`` is ``{"title", "updated", "updated_text", "groups"}``: ``groups`` is ``[{"line", "heading", "jobs"}]`` -in the document's order (``line`` the heading line, its blanks cut; ``heading`` the text after ``##``), and a job is:: +``parse(lines, detail=True)`` is ``{"title", "updated", "updated_text", "groups"}``: ``groups`` is ``[{"line", "heading", "topics", "jobs"}]`` +in the document's order (``line`` the heading line, its blanks cut; ``heading`` the text after ``##``; ``topics`` the topic names that hold at least +one job, in the order their first job stands), and a job is:: {"title": , "kind": "fix"|"task"|"note"|None, "state": "discuss"|"ready"|"waiting"|None, + "topic": |None, "area": |None, "area_key": |None, "date": "YYYY-MM-DD"|None, "priority": |None, "source": , "note": , "lines": [(name, value)], "has_detail": bool, "at": } -``priority`` (11-26, panel B) is the order the person gave (1 first); a session writes it only where the person said the order. +``topic`` (11-29) is the nearest topic line above the job in its campaign — ``###`` after at most three spaces, then a blank or the end of the +line, its ends and closing ``#``s cut and its runs of blanks folded to one; ``####`` is no topic, a ``###`` before the first ``##`` is none, an +empty ``###`` names ``No topic`` — and ``None`` for a job with none above it (a campaign with no ``###``, or a ``- `` above the first one). A +topic line closes no job: only a ``##`` heading, a fence or another line at the left edge does. ``priority`` (11-26, panel B) is the order the +person gave (1 first); a session writes it only where the person said the order. ``lines`` (kept only with ``detail``) are the job's indented lines in order, ``name`` the lower-case line name (``kind``, ``area``, ``state``, ``date``, ``source``, ``note``) or ``None`` for a line of other text (a ``priority:`` line is one: it stands as written). -``counts(parsed)`` is the number of jobs of each kind and state and in all. +``counts(parsed)`` is the number of jobs of each kind and state and in all, the number of topics (a topic holding at least one job; the same +name under another campaign is another topic) and the number of jobs with no topic. """ import datetime import re @@ -31,6 +38,7 @@ _NAMED = re.compile(r"^(kind|area|state|date|priority|source|note):(.*)$", re.IGNORECASE) _FENCE = re.compile(r"^ {0,3}(`{3,}|~{3,})") _HEADING = re.compile(r"^ {0,3}##(?:[ \t]|$)") +_TOPIC = re.compile(r"^ {0,3}###(?:[ \t]|$)") _TITLE = re.compile(r"^#[ \t]+(.*?)[ \t]*#*[ \t]*$") _UPDATED = re.compile(r"^갱신 ([0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2})$") _DAY = re.compile(r"^[0-9]{4}-[0-9]{2}-[0-9]{2}$") @@ -73,10 +81,15 @@ def _one(values): return next(iter(values)) if len(values) == 1 else None +def _topic_name(line): + """A topic line's name: its ends cut, its closing ``#``s cut, its runs of blanks one blank ('' for an empty ``###``).""" + return " ".join(line.strip()[3:].strip().rstrip("#").split()) + + def parse(lines, detail=True): """The document's title, ``갱신`` time and jobs by the counting rule (core/ARTIFACT_META.md ``backlog.md``).""" title, updated, updated_text, groups = "", None, "", [] - group, job, fence, seen = None, None, None, {} + group, job, topic, fence, seen = None, None, None, None, {} count = 0 def close(): @@ -110,9 +123,17 @@ def close(): if _HEADING.match(raw): close() job = None - group = {"line": raw.strip(), "heading": raw.strip()[2:].strip().rstrip("#").strip(), "jobs": []} + topic = None + group = {"line": raw.strip(), "heading": raw.strip()[2:].strip().rstrip("#").strip(), "topics": [], "jobs": []} groups.append(group) continue + if _TOPIC.match(raw): + # (a topic line closes the job above it, and names the jobs under it; before the first `##` it is no topic) + close() + job = None + if group is not None: + topic = _topic_name(raw) or None + continue if group is None and updated is None: found = _stamp(raw) if found: @@ -143,10 +164,12 @@ def close(): title = found.group(1) continue if raw.startswith("- "): - job = {"title": raw[2:], "kind": None, "state": None, "area": None, "area_key": None, "date": None, "priority": None, + job = {"title": raw[2:], "kind": None, "state": None, "topic": topic, "area": None, "area_key": None, "date": None, "priority": None, "source": "", "note": "", "lines": [], "has_detail": False, "at": count, "_values": {"kind": set(), "state": set(), "area": set(), "date": set(), "priority": set()}} count += 1 + if topic and topic not in group["topics"]: + group["topics"].append(topic) group["jobs"].append(job) close() return {"title": title, "updated": updated, "updated_text": updated_text, "groups": groups} @@ -158,11 +181,16 @@ def jobs(parsed): def counts(parsed): - """``{fix, task, note, tbd, discuss, ready, waiting, total}``: the jobs of each kind (``tbd``: no kind) and state, and all.""" - out = {name: 0 for name in KINDS + ("tbd",) + STATES + ("total",)} + """``{fix, task, note, tbd, discuss, ready, waiting, total, topics, no_topic}``: the jobs of each kind (``tbd``: no kind) and state, all of + them, the topics holding at least one job (the same name under another campaign is another topic) and the jobs with no topic.""" + out = {name: 0 for name in KINDS + ("tbd",) + STATES + ("total", "topics", "no_topic")} + for group in parsed["groups"]: + out["topics"] += len(group.get("topics") or []) for _heading, job in jobs(parsed): out[job["kind"] or "tbd"] += 1 if job["state"]: out[job["state"]] += 1 + if not job.get("topic"): + out["no_topic"] += 1 out["total"] += 1 return out diff --git a/utilities/backlog_topics_1129.test.py b/utilities/backlog_topics_1129.test.py new file mode 100755 index 0000000000..3fc5b83fc2 --- /dev/null +++ b/utilities/backlog_topics_1129.test.py @@ -0,0 +1,600 @@ +"""11-29 (the person: "백로그에 주제의 개념을 추가하자 … 그걸 기준으로 백로그를 재정리하고 백로그를 작성하고 관리하는 방식을 근본적으로 고치자"): +the backlog's topics — a `###` heading under a campaign, named for the result the person wants — and closing one job at a time. + +1. One reading (`utilities/backlog_items.py`, core/ARTIFACT_META.md `backlog.md`): a job's topic is the nearest `###` line above it in its + campaign; `####`, four spaces and a `###` before the first `##` are none; an empty `###` names no topic; a topic is its campaign and its + folded name together (the same name under another campaign is another topic), and names are never merged for looking alike. A document + with no `###` reads exactly as it did (same counts, same keys, same board answer, byte for byte). +2. The transitions the contract writes down, as documents: another case of a job (one indented line), a sibling job, another result (a new + topic), one job closed (its block moves to `backlog-closed.md` under the same campaign and topic, the siblings stay), the last job closed + (the topic leaves the open file) and a closed result recurring (the same words reopen it, its `note:` naming the history). +3. The board (`utilities/session-shell/backlog-board.cjs` over `session_status.backlog_board`): a document with a topic opens grouped by + Topic (`o`; `k`, `a`, `d` the others), the head says `3 topics · 5 items`, a topic whose name stands under two campaigns reads + ` · `, `Tab` twice finds a topic, and an old seven-cell answer (or a bad `counts.topics`) is a board with no topic. +4. The entrance (`utilities/artifact_entrance.py`): `3 topics · 5 items` (`주제 3 · 할 일 5`), and an old document's line is unchanged. +5. The board as the product draws it (`utilities/status_popup_picture.py`): every row the frame's width, at 100 x 26 and 60 x 20. +""" +import os, sys # noqa: E401 +if __name__ == "__main__" and not os.environ.get("HEARTING_TEST_ISOLATED"): # a direct run re-enters under tools/run-tests.py isolation + os.execv(sys.executable, [sys.executable, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../tools/run-tests.py"), "--direct-run", sys.executable, *sys.orig_argv[1:]]) +import json +import shutil +import subprocess +import tempfile +import unittest +from pathlib import Path +from unittest import mock + +ROOT = Path(__file__).resolve().parents[1] +SHELL = ROOT / "utilities/session-shell" +NODE = shutil.which("node") +sys.path[:0] = [str(ROOT / "utilities"), str(ROOT / "tools")] + +TOPICS = """# Sample backlog +갱신 2026-11-29 10:00 + +## 2026-11-29_sample-a +### 질문에 한 번 답하면 어디로 갔는지 안다 +- Sample answered question + date: 2026-11-28 + kind: task + area: Questions + state: discuss +- Sample second under the topic + date: 2026-11-27 + kind: fix + area: Questions +### 패널에서 백로그를 주제로 본다 +- Sample board grouped by topic + date: 2026-11-26 + kind: task + area: Panel + +## Unassigned +- Sample with no topic + date: 2026-11-25 + kind: note + area: Fleet +### 패널에서 백로그를 주제로 본다 +- Sample unassigned under the same topic + date: 2026-11-24 + kind: fix + area: Panel +""" + +# the same five jobs, no `###` anywhere: the old form +PLAIN = """# Sample backlog +갱신 2026-11-29 10:00 + +## 2026-11-29_sample-a +- Sample answered question + date: 2026-11-28 + kind: task + area: Questions + state: discuss +- Sample second under the topic + date: 2026-11-27 + kind: fix + area: Questions +- Sample board grouped by topic + date: 2026-11-26 + kind: task + area: Panel + +## Unassigned +- Sample with no topic + date: 2026-11-25 + kind: note + area: Fleet +- Sample unassigned under the same topic + date: 2026-11-24 + kind: fix + area: Panel +""" + +EDGES = """# Edge +갱신 2026-11-29 10:00 +### Before the first campaign +- Sample before any campaign +## A +- Sample above the first topic + kind: task +### A topic +- Sample under it + kind: fix +#### A deeper heading +- Sample under four hashes + ### Four spaces +- Sample under four spaces +### A topic ### +- Sample folded to the same name +```text +### In a fence +- Sample in a fence +``` +### +- Sample under an empty topic +""" + +# the board's answer for GOLD, as the code before topics answered it (11-29: an old document is unchanged, byte for byte) +GOLD = """# Sample +갱신 2026-11-26 09:30 +## 2026-11-26_sample-a +- Sample one + date: 2026-11-24 + kind: fix + area: Routing + state: ready +## Unassigned +- Sample two + kind: note +""" +GOLD_ANSWER = {"campaigns": ["2026-11-26_sample-a", "Unassigned"], + "counts": {"discuss": 0, "fix": 1, "note": 1, "ready": 1, "task": 0, "tbd": 0, "waiting": 0}, + "cut": False, + "items": [["i:93166ffff27b", "fix", "2026-11-24", "Routing", "ready", "Sample one", 0], + ["i:5d6c4dffab66", "note", "", "", "", "Sample two", 1]], + "old": False, "sent": 2, "title": "Sample", "total": 2, "updated": "updated 11-26 09:30"} +GOLD_NOW = 1795946400.0 # 2026-11-29 10:00 UTC, the time the `갱신` age is told against + + +def parse(text, detail=True): + from fleet import session_status + return session_status.parse_backlog(text.splitlines(), detail=detail) + + +def items_of(parsed): + return [item for group in parsed["groups"] for item in group["items"]] + + +class ReadingTest(unittest.TestCase): + def test_a_job_takes_the_nearest_topic_above_it(self): + parsed = parse(TOPICS) + self.assertEqual([(group["name"], group["topics"]) for group in parsed["groups"]], + [("2026-11-29_sample-a", ["질문에 한 번 답하면 어디로 갔는지 안다", "패널에서 백로그를 주제로 본다"]), + ("Unassigned", ["패널에서 백로그를 주제로 본다"])]) + self.assertEqual([item["topic"] for item in items_of(parsed)], + ["질문에 한 번 답하면 어디로 갔는지 안다", "질문에 한 번 답하면 어디로 갔는지 안다", "패널에서 백로그를 주제로 본다", + None, "패널에서 백로그를 주제로 본다"]) + + def test_the_topic_line_shape_and_where_it_counts(self): + import backlog_items + parsed = backlog_items.parse(EDGES.splitlines()) + self.assertEqual([(group["heading"], group["topics"]) for group in parsed["groups"]], [("A", ["A topic"])]) + jobs = [(job["title"], job["topic"]) for job in parsed["groups"][0]["jobs"]] + self.assertEqual(jobs, [("Sample above the first topic", None), # above the first `###`: No topic + ("Sample under it", "A topic"), + ("Sample under four hashes", "A topic"), # `####` is no topic + ("Sample under four spaces", "A topic"), # four spaces are no topic; the line is the job's detail + ("Sample folded to the same name", "A topic"), # `### A topic ###` folds to the one written above + ("Sample under an empty topic", None)]) # an empty `###` names no topic; the fence holds none + self.assertEqual(backlog_items.counts(parsed)["topics"], 1) + self.assertEqual(backlog_items.counts(parsed)["no_topic"], 2) + self.assertEqual(backlog_items.counts(parsed)["total"], 6) + + def test_a_topic_is_its_campaign_and_its_folded_name(self): + import backlog_items + one = backlog_items.parse(("## A\n### T\n- a\n### T \n- b\n").splitlines()) + self.assertEqual(one["groups"][0]["topics"], ["T"]) # one topic, however often written + two = backlog_items.parse(("## A\n### T\n- a\n## B\n### T\n- b\n").splitlines()) + self.assertEqual([group["topics"] for group in two["groups"]], [["T"], ["T"]]) + self.assertEqual(backlog_items.counts(two)["topics"], 2) # another campaign: another topic + self.assertEqual([job["topic"] for job in two["groups"][1]["jobs"]], ["T"]) + + def test_a_topic_line_closes_the_job_above_it(self): + import backlog_items + parsed = backlog_items.parse(("## A\n- a\n kind: fix\n### T\n- b\n").splitlines()) + self.assertEqual([(job["title"], job["kind"], job["topic"]) for job in parsed["groups"][0]["jobs"]], + [("a", "fix", None), ("b", None, "T")]) + + def test_counts_names_the_topics_and_the_jobs_without_one(self): + import backlog_items + counts = backlog_items.counts(backlog_items.parse(TOPICS.splitlines())) + self.assertEqual((counts["topics"], counts["no_topic"], counts["total"]), (3, 1, 5)) + self.assertEqual({name: counts[name] for name in ("fix", "task", "note", "tbd")}, {"fix": 2, "task": 2, "note": 1, "tbd": 0}) + + def test_an_old_document_reads_exactly_as_before(self): + import backlog_items + parsed = backlog_items.parse(PLAIN.splitlines()) + self.assertEqual([group["topics"] for group in parsed["groups"]], [[], []]) + self.assertEqual([job["topic"] for job in parsed["groups"][0]["jobs"]], [None, None, None]) + counts = backlog_items.counts(parsed) + self.assertEqual((counts["topics"], counts["no_topic"], counts["total"]), (0, 5, 5)) + + +class TransitionTest(unittest.TestCase): + """The contract's four `Who and when` branches and its `Done`/`Recurrence`, written out as documents and read back.""" + + BASE = """# Sample +갱신 2026-11-20 09:00 +## A +### 결과 하나 +- Job one + date: 2026-11-19 + kind: task +- Job two + date: 2026-11-18 + kind: fix +## B +- Job three + kind: note +""" + + def test_another_case_of_a_job_is_one_indented_line(self): + text = self.BASE.replace(" date: 2026-11-19\n", " date: 2026-11-19\n note2: [11-29] the same thing again — source the person\n") + parsed = parse(text) + self.assertEqual(([g["topics"] for g in parsed["groups"]], len(items_of(parsed))), ([["결과 하나"], []], 3)) + job = items_of(parsed)[0] + self.assertIn((None, "note2: [11-29] the same thing again — source the person"), job["lines"]) + + def test_a_job_finished_apart_is_a_sibling_under_the_same_topic(self): + text = self.BASE.replace("- Job two\n", "- Job two\n- Job four\n kind: fix\n") + parsed = parse(text) + self.assertEqual([g["topics"] for g in parsed["groups"]], [["결과 하나"], []]) + self.assertEqual([job["topic"] for job in items_of(parsed)], ["결과 하나", "결과 하나", "결과 하나", None]) + self.assertEqual(len(items_of(parsed)), 4) + + def test_another_result_is_a_new_topic(self): + text = self.BASE.replace("## B", "### 결과 둘\n- Job five\n kind: task\n## B") + parsed = parse(text) + self.assertEqual([len(g["topics"]) for g in parsed["groups"]], [2, 0]) + self.assertEqual(parsed["groups"][0]["topics"], ["결과 하나", "결과 둘"]) + + def test_one_job_closed_keeps_its_topic_and_stands_in_the_closed_record(self): + opened = self.BASE.replace("- Job two\n date: 2026-11-18\n kind: fix\n", "") + closed = """## A +### 결과 하나 +- Job two + date: 2026-11-18 + kind: fix + closed: 2026-11-29 PR #2000 +""" + still = parse(opened) + self.assertEqual([job["title"] for job in items_of(still)], ["Job one", "Job three"]) + self.assertEqual(still["groups"][0]["topics"], ["결과 하나"]) # one job left: the topic stays + history = parse(closed) + self.assertEqual(history["groups"][0]["topics"], ["결과 하나"]) + job = items_of(history)[0] + self.assertEqual((job["title"], job["topic"]), ("Job two", "결과 하나")) + self.assertIn((None, "closed: 2026-11-29 PR #2000"), job["lines"]) + + def test_the_last_job_closed_takes_the_topic_out_of_the_open_file(self): + opened = self.BASE.replace("### 결과 하나\n- Job one\n date: 2026-11-19\n kind: task\n- Job two\n date: 2026-11-18\n kind: fix\n", "") + parsed = parse(opened) + self.assertEqual([g["topics"] for g in parsed["groups"]], [[], []]) + self.assertEqual(parsed["groups"][0]["items"], []) + self.assertEqual(len(items_of(parsed)), 1) + + def test_a_closed_result_recurring_opens_the_same_words_and_names_the_history(self): + # the topic left with its last job… + opened = "## A\n## B\n- Job three\n kind: note\n" + self.assertEqual(parse(opened)["groups"][0]["topics"], []) + # …and the same words open it again, the new job naming the history it continues + back = "## A\n### 결과 하나\n- Job six\n kind: task\n note: 이력: backlog-closed.md \"### 결과 하나\"\n## B\n- Job three\n kind: note\n" + parsed = parse(back) + self.assertEqual(parsed["groups"][0]["topics"], ["결과 하나"]) + job = items_of(parsed)[0] + self.assertEqual((job["title"], job["topic"]), ("Job six", "결과 하나")) + self.assertEqual(job["note"], '이력: backlog-closed.md "### 결과 하나"') + # (the closed record reads by the same rule: the same campaign and topic above the job, its `closed:` line under it) + closed = "## A\n### 결과 하나\n- Job six\n kind: task\n closed: 2026-11-29 PR #2000\n" + history = parse(closed) + self.assertEqual(history["groups"][0]["topics"], ["결과 하나"]) + self.assertIn((None, "closed: 2026-11-29 PR #2000"), items_of(history)[0]["lines"]) + + +class KeysTest(unittest.TestCase): + def test_inserting_a_topic_keeps_every_key(self): + from fleet import session_status + plain = session_status._backlog_rows(parse(PLAIN)) + with_topics = session_status._backlog_rows(parse(TOPICS)) + self.assertEqual([key for _campaign, _item, key in plain], [key for _campaign, _item, key in with_topics]) + self.assertEqual([item["text"] for _c, item, _k in plain], [item["text"] for _c, item, _k in with_topics]) + + def test_two_topics_of_one_campaign_with_one_title_split_the_key(self): + from fleet import session_status + rows = session_status._backlog_rows(parse("## A\n### T1\n- Same title\n### T2\n- Same title\n")) + first = rows[0][2] + self.assertEqual((first, rows[1][2]), (first, first + ":2")) + self.assertTrue(first.startswith("i:")) + + def test_the_first_seven_cells_are_the_same(self): + from fleet import session_status + plain = session_status.backlog_board(session_status.parse_backlog(PLAIN.splitlines()))["items"] + with_topics = session_status.backlog_board(session_status.parse_backlog(TOPICS.splitlines()))["items"] + self.assertEqual([row[:7] for row in with_topics], [row[:7] for row in plain]) + self.assertEqual([row[7] for row in with_topics], [0, 0, 1, -1, 2]) # (the topic's index; -1 for no topic) + self.assertEqual(with_topics[0][:7], plain[0][:7]) + + def test_an_old_documents_board_answer_is_byte_identical(self): + from fleet import session_status + answer = session_status.backlog_board(session_status.parse_backlog(GOLD.splitlines()), now=GOLD_NOW) + for key in GOLD_ANSWER: + self.assertEqual(answer[key], GOLD_ANSWER[key], key) + self.assertEqual(sorted(answer), sorted(GOLD_ANSWER)) # no `topics`, no other key + self.assertEqual(json.dumps(answer, sort_keys=True, ensure_ascii=False), json.dumps(GOLD_ANSWER, sort_keys=True, ensure_ascii=False)) + + def test_the_panels_lists_do_not_change_with_topics(self): + from fleet import session_status + with tempfile.TemporaryDirectory(prefix="btl") as folder: + root = Path(folder) + with mock.patch.object(session_status, "_root", lambda cwd, now: str(root)): + seen = [] + for text in (PLAIN, TOPICS): + (root / "backlog.md").write_text(text, encoding="utf-8") + lists = session_status.panel_lists(root, {"path": "", "has_doc": False}, {}) + backlog = lists["backlog"] + seen.append(([item["key"] for item in backlog["items"]], backlog["total"], backlog["counts"], backlog["more"], backlog["has_doc"])) + self.assertEqual(seen[0], seen[1]) + self.assertEqual(seen[1][1], 5) + self.assertEqual(seen[1][2], {"fix": 2, "task": 2, "note": 1, "tbd": 0, "discuss": 1, "ready": 0, "waiting": 0}) + + def test_a_topic_is_the_answers_campaign_order_and_index(self): + from fleet import session_status + board = session_status.backlog_board(session_status.parse_backlog(TOPICS.splitlines())) + self.assertEqual(board["topics"], [["질문에 한 번 답하면 어디로 갔는지 안다", 0], + ["패널에서 백로그를 주제로 본다", 0], ["패널에서 백로그를 주제로 본다", 1]]) + self.assertEqual(board["campaigns"], ["2026-11-29_sample-a", "Unassigned"]) + self.assertEqual(board["counts"]["topics"], 3) + + def test_a_limited_answer_still_names_every_topic(self): + from fleet import session_status + board = session_status.backlog_board(session_status.parse_backlog(TOPICS.splitlines()), limit=1) + self.assertEqual(board["sent"], 1) + self.assertEqual(len(board["topics"]), 3) # every topic of the document, whatever is sent + self.assertEqual(board["items"][0][7], 0) + + +BOARD_HEAD = r""" +const fs=require('node:fs'),path=require('node:path'),assert=require('node:assert/strict'); +const list=require(path.join(process.argv[1],'status-list.cjs')),board=require(path.join(process.argv[1],'backlog-board.cjs')); +const read=file=>JSON.parse(fs.readFileSync(file,'utf8')); +const text=r=>r.map(p=>p.text).join(''); +const screenOf=(b,st,width=96)=>list.layout(board.entries(b,st.bs,{width}),st.t,{width}).rows.map(text); +const open=(answer)=>{const b=board.fromAnswer(answer);const st={t:{sel:'',fold:new Set(),items:new Set(),more:{}},bs:board.newState(b)};board.prepare(b,st.bs,st.t); + st.lines=screenOf(b,st);return {b,st,lines:st.lines};}; +const answer=read(process.argv[2]),b=board.fromAnswer(answer); +const fresh=()=>{const t={sel:'',fold:new Set(),items:new Set(),more:{}},bs=board.newState(b);board.prepare(b,bs,t);return {t,bs};}; +const screen=(st,width=96)=>screenOf(b,st,width); +const chosen=st=>screen(st).find(l=>l.startsWith('▶ '))||''; +const items=st=>screen(st).filter(l=>/^(▶ | ) (FIX|TASK|NOTE|TBD) /.test(l)).map(l=>l.slice(4).trim()); +""" + + +@unittest.skipUnless(NODE, "needs node") +class BoardTest(unittest.TestCase): + def setUp(self): + from fleet import session_status + import session_shell + self.status, self.shell = session_status, session_shell + self._tmp = tempfile.TemporaryDirectory(prefix="btb") + self.addCleanup(self._tmp.cleanup) + self.root = Path(self._tmp.name).resolve() + patch = mock.patch.object(session_status, "_root", lambda cwd, now: str(self.root)) + patch.start() + self.addCleanup(patch.stop) + + def popup(self, part, open="", indent=0): + binding = {"harness": "claude", "sid": "00000000-0000-4000-8000-000000000001"} + return self.shell._status_popup(binding, {"cwd": str(self.root), "routes": [], "status": {}, "part": part, "own": "", "open": open, "indent": indent}, + 96, 256, False, "backlog") + + def answer(self, text): + (self.root / "backlog.md").write_text(text, encoding="utf-8") + return self.root / "answer.json", self.popup("list") + + def node(self, body, text=TOPICS, other=None): + path, answer = self.answer(text) + path.write_text(json.dumps(answer, ensure_ascii=False), encoding="utf-8") + argv = [NODE, "-e", BOARD_HEAD + body, str(SHELL), str(path)] + if other is not None: + second = self.root / "other.json" + second.write_text(json.dumps(self.answer(other)[1], ensure_ascii=False), encoding="utf-8") + argv.append(str(second)) + result = subprocess.run(argv, capture_output=True, text=True, timeout=120) + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + return result.stdout + + def test_a_document_with_a_topic_opens_on_topic_with_both_numbers(self): + self.node(r""" +const st=fresh(),s=screen(st); +assert.deepEqual([s[0],...s.slice(2,5)],['Sample backlog','3 topics · 5 items · FIX 2 · TASK 2 · TBD 0 · NOTE 1','group Kind Area Date [Topic] · showing 5 · Discuss 1','']); +assert.deepEqual(s.filter(l=>/^[▾▸] /.test(l.trim())).map(l=>l.trim().replace(/^▶ /,'')), + ['▾ 질문에 한 번 답하면 어디로 갔는지 안다 2','▸ 패널에서 백로그를 주제로 본다 · 2026-11-29_sample-a 1','▸ 패널에서 백로그를 주제로 본다 · Unassigned 1','▸ No topic 1']); +assert(/Sample answered question/.test(chosen(st))); +""") + + def test_o_k_and_the_group_order_no_topic_last(self): + self.node(r""" +const st=fresh(); +board.setAxis(b,st.bs,st.t,'kind');let s=screen(st); +assert(s.includes('group [Kind] Area Date Topic · showing 5 · Discuss 1')); +assert.deepEqual(s.filter(l=>/[▾▸] (FIX|TASK|TBD|NOTE) \d/.test(l)).map(l=>l.trim().replace(/^▶ /,'')),['▾ FIX 2','▸ TASK 2','▸ NOTE 1']); +board.setAxis(b,st.bs,st.t,'topic');s=screen(st); +assert(s.includes('group Kind Area Date [Topic] · showing 5 · Discuss 1')); +// the document's order, `No topic` last, the same name under two campaigns joined +assert.deepEqual(s.filter(l=>/^[▾▸] /.test(l.trim())).map(l=>l.trim().replace(/^▶ /,'')).slice(0,4), + ['▾ 질문에 한 번 답하면 어디로 갔는지 안다 2','▸ 패널에서 백로그를 주제로 본다 · 2026-11-29_sample-a 1','▸ 패널에서 백로그를 주제로 본다 · Unassigned 1','▸ No topic 1']); +assert.equal(board.setAxis(b,st.bs,st.t,'topic'),false); // the same key again changes nothing +""") + + def test_a_document_without_a_topic_opens_on_kind(self): + self.node(r""" +const st=fresh(),s=screen(st); +assert.equal(st.bs.axis,'kind'); +assert(s.includes('5 total · FIX 2 · TASK 2 · TBD 0 · NOTE 1')); +assert(s.includes('group [Kind] Area Date Topic · showing 5 · Discuss 1')); +""", text=PLAIN) + + def test_a_bad_counts_topics_is_a_board_with_no_topic(self): + self.node(r""" +for(const bad of [-1,'3',2.5,null]){ + const a=JSON.parse(JSON.stringify(answer));a.board.counts.topics=bad; + const o=open(a); + assert.equal(o.b.counts.topics,0,String(bad)); + assert.equal(o.st.bs.axis,'kind',String(bad)); + assert(o.lines.includes('5 total · FIX 2 · TASK 2 · TBD 0 · NOTE 1'),String(bad)); +} +""") + + def test_an_open_board_keeps_its_axis_and_a_topicless_answer_goes_back_to_kind(self): + self.node(r""" +// (1) a board already open in Kind stays in Kind when the next answer has topics +const a1=read(process.argv[3]); // PLAIN: no topic +const first=board.fromAnswer(a1), t={sel:'',fold:new Set(),items:new Set(),more:{}}, bs=board.newState(first); +board.prepare(first,bs,t); +assert.equal(bs.axis,'kind'); +board.prepare(b,bs,t); // TOPICS: the open board keeps the grouping the person chose +assert.equal(bs.axis,'kind');assert(bs.ready); +// (2) a board opened on Topic whose new answer has no topic goes back to Kind +const t2={sel:'',fold:new Set(),items:new Set(),more:{}}, bs2=board.newState(b); +board.prepare(b,bs2,t2); +assert.equal(bs2.axis,'topic'); +board.prepare(first,bs2,t2); +assert.equal(bs2.axis,'kind'); +assert(screenOf(first,{t:t2,bs:bs2}).includes('group [Kind] Area Date Topic · showing 5 · Discuss 1')); +""", other=PLAIN) + + def test_find_a_topic_and_the_state_filter_on_the_topic_axis(self): + self.node(r""" +const st=fresh(),type=s=>{for(const ch of Buffer.from(s,'utf8').toString('latin1'))board.type(b,st.bs,st.t,'',ch);}; +board.startFind(st.bs); +assert.deepEqual(board.inputRow(b,st.bs,96).map(p=>p.text).join(''),'/ Title: ▏ Tab field · Enter find · Esc cancel'); +board.type(b,st.bs,st.t,'tab');assert(/^\/ Area: /.test(board.inputRow(b,st.bs,96).map(p=>p.text).join(''))); +board.type(b,st.bs,st.t,'tab');assert(/^\/ Topic: /.test(board.inputRow(b,st.bs,96).map(p=>p.text).join(''))); +board.type(b,st.bs,st.t,'tab');assert(/^\/ Title: /.test(board.inputRow(b,st.bs,96).map(p=>p.text).join(''))); // three Tabs are back to the title +board.type(b,st.bs,st.t,'tab');board.type(b,st.bs,st.t,'tab');type('패널'); +board.type(b,st.bs,st.t,'enter'); +assert(screen(st)[3].includes('find Topic "패널"'),screen(st)[3]); +assert.equal(items(st).length,2); +// `t` on the Topic axis keeps the topic groups and Esc undoes the state, then what was found +board.cycleFilter(b,st.bs,st.t); +assert(screen(st)[3].includes('state Discuss')); +assert.deepEqual(board.back(b,st.bs,st.t),true); // the state +board.back(b,st.bs,st.t); // what was found +assert.equal(st.bs.find,null); +assert(screen(st)[3].includes('group Kind Area Date [Topic] · showing 5 · Discuss 1')); +""") + + def test_tab_twice_finds_a_topic_name_folded(self): + self.node(r""" +const st=fresh(),type=s=>{for(const ch of Buffer.from(s,'utf8').toString('latin1'))board.type(b,st.bs,st.t,'',ch);}; +board.startFind(st.bs);board.type(b,st.bs,st.t,'tab');board.type(b,st.bs,st.t,'tab');type(' 패널에서 '); +assert.equal(board.inputRow(b,st.bs,96).map(p=>p.text).join('').trim(),'/ Topic: 패널에서 ▏ Tab field · Enter find · Esc cancel'.trim()); +board.type(b,st.bs,st.t,'enter'); +assert(screen(st)[3].includes('find Topic "패널에서"'),screen(st)[3]); +assert.equal(items(st).length,2); // (a topic's name: its two items, in both campaigns) +""") + + def test_an_old_seven_cell_answer_is_a_board_with_no_topic(self): + self.node(r""" +const old=JSON.parse(JSON.stringify(answer)); +for(const row of old.board.items) row.length=7; +delete old.board.topics;delete old.board.counts.topics; +const o=open(old); +assert.equal(o.st.bs.axis,'kind'); +assert(o.lines.includes('5 total · FIX 2 · TASK 2 · TBD 0 · NOTE 1')); +assert.deepEqual(o.lines.filter(l=>/^[▾▸] /.test(l.trim())).map(l=>l.trim().replace(/^▶ /,'')),['▾ FIX 2','▸ TASK 2','▸ NOTE 1']); +const partial=JSON.parse(JSON.stringify(answer));for(const row of partial.board.items) row.length=7; +const p=open(partial); // rows without the eighth cell: every item is `No topic` +assert.deepEqual([...new Set(p.b.items.map(r=>r.topic))],[-1]); +""") + + def test_a_panel_key_opens_the_topic_group_it_stands_in(self): + self.node(r""" +const st={t:{sel:'',fold:new Set(),items:new Set(),more:{}},bs:board.newState(b)}; +const wanted=b.items.find(r=>r.title==='Sample board grouped by topic');st.t.sel=wanted.key; +board.prepare(b,st.bs,st.t); +assert.equal(st.t.sel,wanted.key); +assert([...st.t.fold].some(id=>id==='topic:'+wanted.topic),[...st.t.fold].join(',')); +assert(screen(st).some(l=>l.includes('▾ 패널에서 백로그를 주제로 본다 · 2026-11-29_sample-a 1'))); +""") + + def test_the_detail_carries_the_topic_after_the_campaign(self): + _path, answer = self.answer(TOPICS) + rows = {row[5]: row[0] for row in answer["board"]["items"]} + got = self.popup("detail", open=rows["Sample answered question"], indent=4) + self.assertEqual(["".join(part[0] for part in row) for row in got["rows"]], + [" 2026-11-28 · TASK · Questions · Discuss", " campaign 2026-11-29_sample-a", + " topic 질문에 한 번 답하면 어디로 갔는지 안다"]) + got = self.popup("detail", open=rows["Sample with no topic"]) + self.assertEqual(["".join(part[0] for part in row).strip() for row in got["rows"]], + ["2026-11-25 · NOTE · Fleet · —", "campaign Unassigned"]) # a job with no topic: no line + + +class EntranceTest(unittest.TestCase): + def setUp(self): + self._tmp = tempfile.TemporaryDirectory(prefix="bte") + self.addCleanup(self._tmp.cleanup) + self.root = Path(self._tmp.name) / "root" + self.root.mkdir() + (self.root / "campaigns").mkdir() + (self.root / "campaigns" / "INDEX.md").write_text("# ID index\n", encoding="utf-8") + self._lang = os.environ.get("FLEET_NOW_LANG") + self.addCleanup(self._restore) + + def _restore(self): + if self._lang is None: + os.environ.pop("FLEET_NOW_LANG", None) + else: + os.environ["FLEET_NOW_LANG"] = self._lang + + def note(self, text, lang=None): + import artifact_entrance as E + (self.root / "backlog.md").write_text(text, encoding="utf-8") + os.environ["FLEET_NOW_LANG"] = lang or "en" + sections = E.entrance_sections(E.scan(self.root), E._translator()) + return next(section for section in sections if section["key"] == "backlog")["lines"][0]["note"] + + def test_a_document_with_a_topic_says_both_numbers(self): + note = self.note(TOPICS) + self.assertTrue(note.startswith("3 topics · 5 items · FIX 2 · TASK 2 · NOTE 1 · Discuss 1 · updated 2026-11-29 10:00"), note) + self.assertEqual(self.note(TOPICS, "ko").split(" · ")[:2], ["주제 3", "할 일 5"]) + + def test_a_document_without_a_topic_keeps_the_old_line(self): + self.assertEqual(self.note(PLAIN), "5 total · FIX 2 · TASK 2 · NOTE 1 · Discuss 1 · updated 2026-11-29 10:00") + self.assertTrue(self.note(PLAIN, "ko").startswith("전체 5 · FIX 2 · TASK 2 · NOTE 1 · Discuss 1 · 갱신 2026-11-29 10:00")) + + def test_the_fallback_dictionary_carries_the_two_new_words(self): + import artifact_entrance as E + for key, fields in (("entrance.backlog_topics", {"topics": "3"}), ("entrance.backlog_items", {"count": "5"})): + self.assertNotEqual(E._fallback_translator(key, **fields), key) + + +@unittest.skipUnless(NODE, "needs node") +class PictureTest(unittest.TestCase): + def picture(self, text, width, height, steps, find_topic=""): + with tempfile.TemporaryDirectory(prefix="btp") as folder: + path = Path(folder) / "backlog.md" + path.write_text(text, encoding="utf-8") + result = subprocess.run([sys.executable, "-I", "-B", str(ROOT / "utilities/status_popup_picture.py"), str(path), "--kind", "backlog", + "--width", str(width), "--height", str(height), "--steps", steps, "--find-topic", find_topic], + capture_output=True, text=True, timeout=300) + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + screens = {} + for block in result.stdout.split("--- ")[1:]: + name, _, body = block.partition(" ---\n") + screens[name] = [line for line in body.splitlines() if line.startswith(("╭", "│", "╰"))] + return screens + + @staticmethod + def cells(line): + return sum(2 if ord(c) > 0x2e7f else 1 for c in line) + + def test_the_topic_screens_at_100_by_26_and_60_by_20(self): + for width, height in ((100, 26), (60, 20)): + shown = self.picture(TOPICS, width, height, "first,kind,topic,findtopic", find_topic="패널") + self.assertEqual(len(shown), 4) + for name, rows in shown.items(): + self.assertTrue(rows, name) + self.assertTrue(all(self.cells(r) == width for r in rows), (width, name, [self.cells(r) for r in rows])) + text = {name: "\n".join(rows) for name, rows in shown.items()} + self.assertIn("3 topics · 5 items", text["first screen (grouped by topic)"]) + self.assertIn("group Kind Area Date [Topic]", text["first screen (grouped by topic)"]) + self.assertIn("group [Kind] Area Date Topic", text["k: grouped by kind"]) + self.assertIn("group Kind Area Date [Topic]", text["o: grouped by topic"]) + self.assertIn('find Topic "패널"', text["/ Tab Tab 패널 Enter: a topic found"]) + + +if __name__ == "__main__": + unittest.main(verbosity=2) diff --git a/utilities/session-shell/backlog-board.cjs b/utilities/session-shell/backlog-board.cjs index e695a6c89f..7fffa3a11c 100644 --- a/utilities/session-shell/backlog-board.cjs +++ b/utilities/session-shell/backlog-board.cjs @@ -1,18 +1,21 @@ 'use strict'; -// The BACKLOG board (11-26, scheme A; the person: "A — FIX · TASK · NOTE에 상태(Discuss 등)와 영역을 더하고, 판은 영역별로 묶어 봄"). +// The BACKLOG board (11-26, scheme A; the person: "A — FIX · TASK · NOTE에 상태(Discuss 등)와 영역을 더하고, 판은 영역별로 묶어 봄"; +// 11-29: "백로그에 주제의 개념을 추가하자" — a topic is the result the person wants, a `###` heading in the document). // // The backend (`session_status.backlog_board`) sends the document's head and one short row per item, newest first (the latest date -// first, the same date in the document's order, no date last): `[key, kind, date, area, state, title, campaign]`. This file makes the +// first, the same date in the document's order, no date last): `[key, kind, date, area, state, title, campaign]`, and with a document +// that has topics an eighth cell (the item's topic's index) plus `topics: [[name, campaign index], …]`. This file makes the // status list's entries (`status-list.cjs`, which lays them out and moves the choice) from those rows by the board's own state: what -// they are grouped by (`k` kind, `a` area, `d` date), which state is shown (`t`: All, Discuss, Ready, Waiting, No state) and what is -// being found (`/` a title, `Tab` first for an area's name). That state is the open popup's alone (`newState`, kept on the popup's table); -// nothing is written, asked or started here, and nothing is read but the answer it is given. +// they are grouped by (`k` kind, `a` area, `d` date, `o` topic; a document with a topic opens on Topic), which state is shown (`t`: All, +// Discuss, Ready, Waiting, No state) and what is being found (`/` a title, `Tab` first for an area's name, again for a topic's). That +// state is the open popup's alone (`newState`, kept on the popup's table); nothing is written, asked or started here, and nothing is +// read but the answer it is given. // // The groups' open state is the status list's own (`fold`, a set of the open groups' ids); a view that filters or finds stands with every // group open (its heads are not pressed). Inside a group the items keep the answer's order, so the newest stand first. -const AXIS_WORDS = { kind: 'Kind', area: 'Area', date: 'Date' }; -const AXIS_KEYS = { k: 'kind', a: 'area', d: 'date' }; +const AXIS_WORDS = { kind: 'Kind', area: 'Area', date: 'Date', topic: 'Topic' }; +const AXIS_KEYS = { k: 'kind', a: 'area', d: 'date', o: 'topic' }; const KIND_ORDER = ['fix', 'task', 'tbd', 'note']; const KIND_WORDS = { fix: 'FIX', task: 'TASK', note: 'NOTE', tbd: 'TBD' }; const KIND_STYLES = { fix: 'lvl_y', task: 'lvl_g', note: 'dim', tbd: 'dim' }; @@ -29,7 +32,9 @@ const defaultMeasure = text => [...String(text)].reduce((n, c) => n + (c.codePoi const fold = text => String(text).split(/\s+/).filter(Boolean).join(' ').toLowerCase(); // The board from the backend's answer (`result.board`), or null where the answer has none. Every value is checked here: a row with no key is -// left out, a kind that is none of the three is TBD, a date that is not `YYYY-MM-DD` is none, a state that is none of the three is none. +// left out, a kind that is none of the three is TBD, a date that is not `YYYY-MM-DD` is none, a state that is none of the three is none, and a +// topic index that is not one the answer's `topics` has is no topic (-1). A campaign a topic's index names is its name (` · ` joins a +// topic whose name stands under two campaigns). function fromAnswer(result) { const b = result && result.board; if (!b || typeof b !== 'object' || !Array.isArray(b.items)) return null; @@ -37,21 +42,36 @@ function fromAnswer(result) { const named = {}; for (const [name, at] of Object.entries(b.styles && typeof b.styles === 'object' ? b.styles : {})) if (Number.isInteger(at) && styles[at]) named[name] = styles[at]; const campaigns = Array.isArray(b.campaigns) ? b.campaigns.map(String) : []; + const topics = []; + if (Array.isArray(b.topics)) for (const t of b.topics) { + if (!Array.isArray(t) || typeof t[0] !== 'string') continue; + const campaign = Number.isInteger(t[1]) && campaigns[t[1]] !== undefined ? campaigns[t[1]] : ''; + topics.push({ name: t[0], campaign, word: t[0] }); + } + const seen = {}; + for (const t of topics) seen[fold(t.name)] = (seen[fold(t.name)] || 0) + 1; + for (const t of topics) if (seen[fold(t.name)] > 1 && t.campaign) t.word = t.name + ' · ' + t.campaign; const items = []; for (const row of b.items) { if (!Array.isArray(row) || typeof row[0] !== 'string' || !row[0].startsWith('i:')) continue; const kind = ['fix', 'task', 'note'].includes(row[1]) ? row[1] : 'tbd'; + const at = Number.isInteger(row[7]) && row[7] >= 0 && row[7] < topics.length ? row[7] : -1; + const topic = at >= 0 ? topics[at] : null; items.push({ key: row[0], kind, date: DAY.test(String(row[2] || '')) ? String(row[2]) : '', area: String(row[3] || '').trim(), - state: STATES[row[4]] ? row[4] : '', title: String(row[5] ?? ''), campaign: campaigns[row[6]] ?? '' }); + state: STATES[row[4]] ? row[4] : '', title: String(row[5] ?? ''), campaign: campaigns[row[6]] ?? '', + topic: at, topicName: topic ? topic.name : '', topicWord: topic ? topic.word : 'No topic' }); } const count = v => Number.isInteger(v) && v >= 0 ? v : 0, c = b.counts && typeof b.counts === 'object' ? b.counts : {}; - return { title: String(b.title || ''), updated: String(b.updated || ''), old: b.old === true, cut: b.cut === true, + return { title: String(b.title || ''), updated: String(b.updated || ''), old: b.old === true, cut: b.cut === true, topics, total: Math.max(count(b.total), items.length), items, styles: named, - counts: Object.fromEntries(['fix', 'task', 'note', 'tbd', 'discuss', 'ready', 'waiting'].map(k => [k, count(c[k])])) }; + counts: Object.fromEntries(['fix', 'task', 'note', 'tbd', 'discuss', 'ready', 'waiting', 'topics'].map(k => [k, count(c[k])])) }; } -// The board's state: grouped by kind, every state shown, nothing found, nothing being typed. -function newState() { return { axis: 'kind', filter: '', find: null, typing: null, ready: false }; } +// The board's state: grouped by topic where the document has one (11-29), else by kind; every state shown, nothing found, nothing being typed. +function newState(board = null) { + const topics = board && board.counts ? board.counts.topics : 0; + return { axis: topics > 0 ? 'topic' : 'kind', filter: '', find: null, typing: null, ready: false }; +} const narrowed = bs => !!(bs.filter || (bs.find && bs.find.text)); function visible(board, bs) { @@ -59,15 +79,21 @@ function visible(board, bs) { if (bs.filter) rows = rows.filter(r => bs.filter === 'none' ? !r.state : r.state === bs.filter); if (bs.find && bs.find.text) { const q = fold(bs.find.text); - rows = rows.filter(r => fold(bs.find.field === 'area' ? r.area : r.title).includes(q)); + rows = rows.filter(r => fold(bs.find.field === 'area' ? r.area : bs.find.field === 'topic' ? r.topicName : r.title).includes(q)); } return rows; } -// The groups of `rows` by `axis`: kinds in the order FIX, TASK, TBD, NOTE; areas by name, `No area` last; dates newest first, `No date` last. +// The groups of `rows` by `axis`: kinds in the order FIX, TASK, TBD, NOTE; areas by name, `No area` last; dates newest first, `No date` last; +// topics in the document's order (the answer's `topics`), `No topic` last. function groups(rows, axis) { - const by = new Map(), value = r => axis === 'kind' ? r.kind : axis === 'area' ? r.area : r.date; + const by = new Map(), value = r => axis === 'kind' ? r.kind : axis === 'area' ? r.area : axis === 'date' ? r.date : r.topic; for (const r of rows) { const v = value(r); if (!by.has(v)) by.set(v, []); by.get(v).push(r); } + if (axis === 'topic') { + const names = [...by.keys()].sort((x, y) => (x < 0) - (y < 0) || x - y); + return names.map(v => ({ id: v >= 0 ? 'topic:' + v : 'topic:-', word: v >= 0 ? by.get(v)[0].topicWord : 'No topic', + style: v >= 0 ? 'sect' : 'dim', items: by.get(v) })); + } let names = [...by.keys()]; if (axis === 'kind') names = KIND_ORDER.filter(k => by.has(k)); else if (axis === 'area') names.sort((x, y) => (x === '') - (y === '') || x.localeCompare(y, 'en', { sensitivity: 'base' }) || (x < y ? -1 : x > y ? 1 : 0)); @@ -137,14 +163,18 @@ function entries(board, bs, { width = 96, measure = defaultMeasure } = {}) { const c = board.counts, shown = visible(board, bs), narrow = narrowed(bs); if (board.title) out.push(E(one([S(board.title, 'sect')]))); out.push(E(one([...(board.old ? [S('! ', 'lvl_y')] : []), S(board.updated, 'dim')]))); - out.push(E(pieces(`${number(board.total)}${board.cut ? '+' : ''} total · FIX ${number(c.fix)} · TASK ${number(c.task)} · TBD ${number(c.tbd)} · NOTE ${number(c.note)}`, 'dim'))); + // (11-29: a document with a topic says both numbers — `3 topics · 5 items` — the items being the `5 total` of an old one) + const counts = c.topics > 0 + ? `${number(c.topics)} topics · ${number(board.total)}${board.cut ? '+' : ''} items · FIX ${number(c.fix)} · TASK ${number(c.task)} · TBD ${number(c.tbd)} · NOTE ${number(c.note)}` + : `${number(board.total)}${board.cut ? '+' : ''} total · FIX ${number(c.fix)} · TASK ${number(c.task)} · TBD ${number(c.tbd)} · NOTE ${number(c.note)}`; + out.push(E(pieces(counts, 'dim'))); // (the read limits: the file is longer than is read, or the answer holds the newest of them only) if (board.cut) out.push(E(pieces(`read ${number(board.total)} · more in backlog.md (the file is longer than is read)`, 'dim'))); if (board.items.length < board.total) out.push(E(pieces(`showing the newest ${number(board.items.length)} of ${number(board.total)} · ${number(board.total - board.items.length)} more in backlog.md`, 'dim'))); const axis = Object.entries(AXIS_WORDS).map(([k, w]) => k === bs.axis ? '[' + w + ']' : w).join(' '); const bits = ['group ' + axis, 'showing ' + number(shown.length) + (shown.length !== board.items.length ? ' of ' + number(board.items.length) : ''), 'Discuss ' + number(c.discuss)]; if (bs.filter) bits.push('state ' + FILTER_WORDS[bs.filter]); - if (bs.find && bs.find.text) bits.push('find ' + (bs.find.field === 'area' ? 'Area' : 'Title') + ' "' + bs.find.text + '"'); + if (bs.find && bs.find.text) bits.push('find ' + (bs.find.field === 'area' ? 'Area' : bs.find.field === 'topic' ? 'Topic' : 'Title') + ' "' + bs.find.text + '"'); out.push(E(pieces(bits.join(' · '), 'dim'))); out.push(E([[]])); const cols = columns(board, inner, measure); @@ -181,6 +211,8 @@ function ordered(board, bs) { return groups(visible(board, bs), bs.axis).flatMap // The first answer the open board has (and an answer read again): the board's first group opens, or, where the popup was opened standing on an // item (a press on one of the panel's rows), the group that item is in. An answer read again keeps the board's state as it is. function prepare(board, bs, t) { + // (11-29: a board opened on Topic whose new answer has no topic goes back to Kind — its topic groups are gone) + if (bs.axis === 'topic' && !(board.counts.topics > 0)) { bs.axis = 'kind'; bs.ready = false; t.fold = new Set(); t.items = new Set(); t.sel = ''; } if (bs.ready) return; bs.ready = true; const list = ordered(board, bs), at = list.find(e => e.r.key === t.sel) || list[0]; @@ -194,7 +226,7 @@ function selectFirst(board, bs, t) { t.reveal = true; } -// `k`, `a`, `d`: the board grouped by kind, area or date (a new grouping opens its first group and stands on its first item). +// `k`, `a`, `d`, `o`: the board grouped by kind, area, date or topic (a new grouping opens its first group and stands on its first item). function setAxis(board, bs, t, axis) { if (!AXIS_WORDS[axis] || bs.axis === axis) return false; bs.axis = axis; @@ -220,14 +252,14 @@ function ends(board, bs, t, last) { t.sel = at.r.key; t.reveal = true; return true; } -// `/`: a title is being found (`Tab` first: an area's name). +// `/`: a title is being found (`Tab` first: an area's name; `Tab` again: a topic's). function startFind(bs) { bs.typing = { field: 'title', text: '', decoder: new TextDecoder('utf-8') }; return true; } function typing(bs) { return !!(bs && bs.typing); } // A key while finding: `tab`, `enter`, `escape`, `backspace`, or the bytes of what was typed (as the host reads them, one byte a character). function type(board, bs, t, key, bytes = '') { const f = bs.typing; if (!f) return false; - if (key === 'tab') f.field = f.field === 'title' ? 'area' : 'title'; + if (key === 'tab') f.field = f.field === 'title' ? 'area' : f.field === 'area' ? 'topic' : 'title'; else if (key === 'escape') bs.typing = null; else if (key === 'backspace') f.text = [...f.text].slice(0, -1).join(''); else if (key === 'enter') { @@ -250,11 +282,11 @@ function back(board, bs, t) { if (bs.filter) { bs.filter = ''; selectFirst(board, bs, t); return true; } return false; } -// The row that stands above the keys while a title or an area is being found. +// The row that stands above the keys while a title, an area or a topic is being found. function inputRow(board, bs, inner, measure = defaultMeasure) { if (!bs || !bs.typing) return null; const S = painter(board), f = bs.typing; - return cutParts([S('/ ', 'loc_repo'), S((f.field === 'title' ? 'Title' : 'Area') + ': ', 'dim'), S(f.text, 'loc_repo'), S('▏', 'loc_repo'), + return cutParts([S('/ ', 'loc_repo'), S((f.field === 'title' ? 'Title' : f.field === 'area' ? 'Area' : 'Topic') + ': ', 'dim'), S(f.text, 'loc_repo'), S('▏', 'loc_repo'), S(' Tab field · Enter find · Esc cancel', 'dim')], Math.max(1, inner), measure); } diff --git a/utilities/session-shell/host.cjs b/utilities/session-shell/host.cjs index 694b304240..1921b3954b 100755 --- a/utilities/session-shell/host.cjs +++ b/utilities/session-shell/host.cjs @@ -759,8 +759,8 @@ function tableGuide(kind){ :kind==='NOW'?label(table?.page?'popup_now_page':'popup_now',table?.page?'Enter back to the list':'↑↓ · Enter read that part') // 11-21: the status popup with a list screen names its keys; one without (a hand-written page, none) keeps the keys it had. // (the document read whole has the keys every popup has: its Esc goes back to the list, and Enter does too) - // 11-26: the backlog's board names its own keys too (`k/a/d` group, `t` state, `/` find, Home/End). - :kind==='BACKLOG'&&table?.board&&table.screen!=='full'?label('popup_backlog','↑↓ · Enter open · k/a/d group · t state · / find · Home/End') + // 11-26: the backlog's board names its own keys too (`k/a/d` group, `t` state, `/` find, Home/End); 11-29 adds `o` (topic). + :kind==='BACKLOG'&&table?.board&&table.screen!=='full'?label('popup_backlog','↑↓ · Enter open · k/a/d/o group · t state · / find · Home/End') :listed(kind)&&table?.listing&&table.screen!=='full'?label('popup_status','↑↓ · Enter open'):''; const fold=label(expanded?'popup_fold':'popup_unfold',expanded?'p fold panel':'p open panel'); return [own,label('popup_keys','←→ section · PgUp/PgDn').replace('{panel}',fold)].filter(Boolean); @@ -1003,9 +1003,10 @@ function askTable(){ // other answer (`askDoc`); for any other document the rows as they always came, with Fleet's lines after. t.title=typeof result.title==='string'?result.title:''; // 11-26: the backlog's answer is its board (one short row per item); the board's state is kept while the popup stands. + // (11-29: `newState(board)` opens a document with a topic on Topic; a board already open keeps the grouping the person chose.) const board=t.kind==='BACKLOG'?backlogBoard.fromAnswer(result):null; t.board=board; - if(board){t.boardState=t.boardState||backlogBoard.newState();backlogBoard.prepare(board,t.boardState,t);t.listing=boardEntries(t);} + if(board){t.boardState=t.boardState||backlogBoard.newState(board);backlogBoard.prepare(board,t.boardState,t);t.listing=boardEntries(t);} else t.listing=statusEntries(result); if(t.listing){ t.rows=[]; diff --git a/utilities/session-shell/status-popup-picture.cjs b/utilities/session-shell/status-popup-picture.cjs index 79b5432d68..b8d35277ea 100755 --- a/utilities/session-shell/status-popup-picture.cjs +++ b/utilities/session-shell/status-popup-picture.cjs @@ -56,7 +56,7 @@ const answer = input.answer, entries = statusList.entriesOf(answer); const board = backlogBoard.fromAnswer(answer); function boardSteps() { const shots = []; - const fresh = () => { const t = { sel: '', fold: new Set(), items: new Set(), more: {}, scroll: 0 }, bs = backlogBoard.newState(); backlogBoard.prepare(board, bs, t); return { t, bs }; }; + const fresh = () => { const t = { sel: '', fold: new Set(), items: new Set(), more: {}, scroll: 0 }, bs = backlogBoard.newState(board); backlogBoard.prepare(board, bs, t); return { t, bs }; }; const shot = (label, { t, bs }) => { const view = statusList.layout(backlogBoard.entries(board, bs, { width: inner, measure: cellWidth }), t, { width: inner, measure: cellWidth }); const typed = backlogBoard.inputRow(board, bs, inner, cellWidth); @@ -64,11 +64,20 @@ function boardSteps() { shots.push(`--- ${label} ---\n${s.text}`); }; const typeAll = (st, text) => { for (const ch of Buffer.from(text, 'utf8').toString('latin1')) backlogBoard.type(board, st.bs, st.t, '', ch); }; - const find = (st, text, area) => { backlogBoard.startFind(st.bs); if (area) backlogBoard.type(board, st.bs, st.t, 'tab'); typeAll(st, text); }; + // (the finder's field: the title, an area (one `Tab`) or a topic (two, 11-29)) + const find = (st, text, field = 'title') => { + backlogBoard.startFind(st.bs); + if (field === 'area' || field === 'topic') backlogBoard.type(board, st.bs, st.t, 'tab'); + if (field === 'topic') backlogBoard.type(board, st.bs, st.t, 'tab'); + typeAll(st, text); + }; for (const step of input.steps) { const st = fresh(); - if (step === 'first') shot('first screen (grouped by kind)', st); - else if (step === 'kind' || step === 'area' || step === 'date') { backlogBoard.setAxis(board, st.bs, st.t, step); shot(`${step[0]}: grouped by ${step}`, st); } + if (step === 'first') shot(`first screen (grouped by ${st.bs.axis})`, st); + else if (step === 'kind' || step === 'area' || step === 'date' || step === 'topic') { + backlogBoard.setAxis(board, st.bs, st.t, step); + shot(`${step === 'topic' ? 'o' : step[0]}: grouped by ${step}`, st); + } else if (step === 'discuss') { backlogBoard.cycleFilter(board, st.bs, st.t); shot('t: only Discuss', st); } else if (step === 'typing') { find(st, input.find || ''); shot(`/ ${input.find || ''}: being typed`, st); } else if (step === 'find' || step === 'detail') { @@ -80,7 +89,8 @@ function boardSteps() { if (input.details && input.details[key]) st.t.more[key] = statusList.rowsOf(input.details[key]); } shot(step === 'find' ? `/ ${input.find || ''} Enter: a title found` : `/ ${input.find || ''} Enter Enter: the item opened`, st); - } else if (step === 'findarea') { find(st, input.find_area || '', true); backlogBoard.type(board, st.bs, st.t, 'enter'); shot(`/ Tab ${input.find_area || ''} Enter: an area found`, st); } + } else if (step === 'findarea') { find(st, input.find_area || '', 'area'); backlogBoard.type(board, st.bs, st.t, 'enter'); shot(`/ Tab ${input.find_area || ''} Enter: an area found`, st); } + else if (step === 'findtopic') { find(st, input.find_topic || '', 'topic'); backlogBoard.type(board, st.bs, st.t, 'enter'); shot(`/ Tab Tab ${input.find_topic || ''} Enter: a topic found`, st); } else if (step === 'end' || step === 'home') { backlogBoard.ends(board, st.bs, st.t, step === 'end'); shot(step === 'end' ? 'End: the last item' : 'Home: the first item', st); } else if (step === 'full') { const s = screen(statusList.rowsOf(input.document || answer), 0, ''); shots.push(`--- full document ---\n${s.text}`); } } diff --git a/utilities/session_shell_backlog_board_1126.test.py b/utilities/session_shell_backlog_board_1126.test.py index aae47e12e6..25e265c23e 100644 --- a/utilities/session_shell_backlog_board_1126.test.py +++ b/utilities/session_shell_backlog_board_1126.test.py @@ -123,7 +123,7 @@ def test_the_cases_of_each_line(self): for name, value in want.items(): self.assertEqual(job[name], value, (body, name)) counts = backlog_items.counts(backlog_items.parse(SAMPLE.splitlines())) - self.assertEqual(counts, {"fix": 3, "task": 3, "note": 1, "tbd": 1, "discuss": 2, "ready": 1, "waiting": 1, "total": 8}) + self.assertEqual(counts, {"fix": 3, "task": 3, "note": 1, "tbd": 1, "discuss": 2, "ready": 1, "waiting": 1, "total": 8, "topics": 0, "no_topic": 8}) def test_nothing_is_written_and_a_strange_document_still_opens(self): from fleet import session_status @@ -238,7 +238,7 @@ def node(self, body, text=SAMPLE): def test_the_head_and_the_kind_groups_newest_first(self): self.node(r""" const st=fresh(),s=screen(st); -assert.deepEqual([s[0],...s.slice(2,5)],['Sample backlog','8 total · FIX 3 · TASK 3 · TBD 1 · NOTE 1','group [Kind] Area Date · showing 8 · Discuss 2','']); +assert.deepEqual([s[0],...s.slice(2,5)],['Sample backlog','8 total · FIX 3 · TASK 3 · TBD 1 · NOTE 1','group [Kind] Area Date Topic · showing 8 · Discuss 2','']); assert.match(s[1],/^updated (2026-)?11-26 09:30$/); // the first group open, the others folded with their counts, in the order FIX, TASK, TBD, NOTE assert.deepEqual(s.filter(l=>/[▾▸] (FIX|TASK|TBD|NOTE) \d/.test(l)).map(l=>l.trim().replace(/^▶ /,'')),['▾ FIX 3','▸ TASK 3','▸ TBD 1','▸ NOTE 1']); @@ -268,7 +268,7 @@ def test_k_a_d_group_by_kind_area_and_date(self): const st=fresh(); board.setAxis(b,st.bs,st.t,'area'); let s=screen(st); -assert(s.includes('group Kind [Area] Date · showing 8 · Discuss 2')); +assert(s.includes('group Kind [Area] Date Topic · showing 8 · Discuss 2')); assert.deepEqual(s.filter(l=>/^(▶ | )[▾▸] /.test(l)).map(l=>l.slice(2)),['▾ panel 2','▸ Questions 1','▸ Routing 2','▸ Workers 1','▸ No area 2']); assert.deepEqual(items(st),['TASK 2026-11-26 panel Sample panel head hides the count','TASK — panel Waiting Sample undated job']); board.setAxis(b,st.bs,st.t,'date');s=screen(st); @@ -277,7 +277,7 @@ def test_k_a_d_group_by_kind_area_and_date(self): assert.deepEqual(items(st).map(l=>l.replace(/ +/g,' ')),['TASK 2026-11-26 panel Sample panel head hides the count','NOTE 2026-11-26 Routing Sample routing note to keep', 'TASK 2026-11-26 Workers Discuss Sample worker leg runs twice']); assert(/Sample panel head/.test(chosen(st))); -board.setAxis(b,st.bs,st.t,'kind');assert(screen(st).includes('group [Kind] Area Date · showing 8 · Discuss 2')); +board.setAxis(b,st.bs,st.t,'kind');assert(screen(st).includes('group [Kind] Area Date Topic · showing 8 · Discuss 2')); assert.equal(board.setAxis(b,st.bs,st.t,'kind'),false); // the same key again changes nothing """) @@ -286,11 +286,11 @@ def test_t_filters_by_state_and_every_group_stands_open(self): const st=fresh(),seen=[]; for(let i=0;i<5;i++){board.cycleFilter(b,st.bs,st.t);const s=screen(st);seen.push([s[3],items(st).length,s.filter(l=>l.includes('▸')&&!l.includes('full document')).length]);} assert.deepEqual(seen,[ - ['group [Kind] Area Date · showing 2 of 8 · Discuss 2 · state Discuss',2,0], - ['group [Kind] Area Date · showing 1 of 8 · Discuss 2 · state Ready',1,0], - ['group [Kind] Area Date · showing 1 of 8 · Discuss 2 · state Waiting',1,0], - ['group [Kind] Area Date · showing 4 of 8 · Discuss 2 · state No state',4,0], - ['group [Kind] Area Date · showing 8 · Discuss 2',3,3]]); + ['group [Kind] Area Date Topic · showing 2 of 8 · Discuss 2 · state Discuss',2,0], + ['group [Kind] Area Date Topic · showing 1 of 8 · Discuss 2 · state Ready',1,0], + ['group [Kind] Area Date Topic · showing 1 of 8 · Discuss 2 · state Waiting',1,0], + ['group [Kind] Area Date Topic · showing 4 of 8 · Discuss 2 · state No state',4,0], + ['group [Kind] Area Date Topic · showing 8 · Discuss 2',3,3]]); """) def test_find_a_title_or_an_area_and_esc_undoes_one_thing_at_a_time(self): @@ -301,22 +301,22 @@ def test_find_a_title_or_an_area_and_esc_undoes_one_thing_at_a_time(self): assert.deepEqual(board.inputRow(b,st.bs,96).map(p=>p.text).join(''),'/ Title: SAME▏ Tab field · Enter find · Esc cancel'); board.type(b,st.bs,st.t,'enter'); assert.equal(board.typing(st.bs),false); -assert.equal(screen(st)[3],'group [Kind] Area Date · showing 1 of 8 · Discuss 2 · find Title "SAME"'); +assert.equal(screen(st)[3],'group [Kind] Area Date Topic · showing 1 of 8 · Discuss 2 · find Title "SAME"'); assert(/Sample same title/.test(chosen(st))); // `Tab` first: an area's name, case and blanks folded assert.equal(board.back(b,st.bs,st.t),true); board.startFind(st.bs);board.type(b,st.bs,st.t,'tab');type('rout');board.type(b,st.bs,st.t,'backspace');type('t');board.type(b,st.bs,st.t,'enter'); -assert.equal(screen(st)[3],'group [Kind] Area Date · showing 2 of 8 · Discuss 2 · find Area "rout"'); +assert.equal(screen(st)[3],'group [Kind] Area Date Topic · showing 2 of 8 · Discuss 2 · find Area "rout"'); assert.deepEqual(items(st).map(l=>l.split(' ').pop().trim()),['Sample route resume loses its stage','Sample routing note to keep']); // nothing found: one line says so board.back(b,st.bs,st.t);board.startFind(st.bs);type('없는 제목');board.type(b,st.bs,st.t,'enter'); -assert(screen(st).some(l=>l.includes('nothing matches · Esc clears')));assert.equal(screen(st)[3],'group [Kind] Area Date · showing 0 of 8 · Discuss 2 · find Title "없는 제목"'); +assert(screen(st).some(l=>l.includes('nothing matches · Esc clears')));assert.equal(screen(st)[3],'group [Kind] Area Date Topic · showing 0 of 8 · Discuss 2 · find Title "없는 제목"'); // Esc: what is typed, then the opened items, then what was found, then the state; then nothing (the popup closes) board.back(b,st.bs,st.t);board.cycleFilter(b,st.bs,st.t);board.startFind(st.bs);type('x'); const t=st.t;t.items.add(t.sel); const undo=[];for(let i=0;i<5;i++){undo.push(board.back(b,st.bs,t));} assert.deepEqual(undo,[true,true,true,false,false]); -assert.equal(board.typing(st.bs),false);assert.equal(t.items.size,0);assert.equal(screen(st)[3],'group [Kind] Area Date · showing 8 · Discuss 2'); +assert.equal(board.typing(st.bs),false);assert.equal(t.items.size,0);assert.equal(screen(st)[3],'group [Kind] Area Date Topic · showing 8 · Discuss 2'); """) def test_home_end_and_the_detail_of_one_item(self): diff --git a/utilities/status_popup_picture.py b/utilities/status_popup_picture.py index fe4b518953..01b17c8e4e 100644 --- a/utilities/status_popup_picture.py +++ b/utilities/status_popup_picture.py @@ -3,7 +3,7 @@ python3 -I -B utilities/status_popup_picture.py [--width 100] [--height 26] [--steps first,group,item,short,full] [--fleet-line TEXT] [--now EPOCH] [--out FILE] [--kind status|backlog] [--own FOLDER] - [--find TITLE] [--find-area AREA] + [--find TITLE] [--find-area AREA] [--find-topic TOPIC] ```` is a ``campaign.md`` (the generated page) or any other status page; ``-`` is no document. ``--width`` and ``--height`` are the popup frame's size in cells (100 x 26 by default). The steps draw, in order: ``first`` the screen the @@ -12,10 +12,12 @@ ``all N ▸`` opened, ``full`` the document read whole (``full document ›``). A page that is not the generated one has no list screen: ``first`` and ``full`` draw the one screen it always had. -``--kind backlog`` draws the BACKLOG board (11-26, scheme A) the same way: ```` is a ``backlog.md`` (or ``-`` for none), and each step is -the board opened afresh and then: ``first`` nothing (grouped by kind, the first group open), ``kind``/``area``/``date`` that key (``k``/``a``/``d``), +``--kind backlog`` draws the BACKLOG board (11-26, scheme A; 11-29 topics) the same way: ```` is a ``backlog.md`` (or ``-`` for none), and +each step is the board opened afresh and then: ``first`` nothing (grouped by topic where the document has one, else by kind, the first group +open), ``kind``/``area``/``date``/``topic`` that key (``k``/``a``/``d``/``o``), ``discuss`` ``t`` once, ``typing`` ``/`` and the ``--find`` words, ``find`` those and Enter, ``detail`` those, Enter and Enter (the item found opened, -its lines read as the popup reads them), ``findarea`` ``/ Tab``, the ``--find-area`` words and Enter, ``home``/``end``, ``full``; it has no Fleet lines. +its lines read as the popup reads them), ``findarea`` ``/ Tab``, the ``--find-area`` words and Enter, ``findtopic`` ``/ Tab Tab``, the +``--find-topic`` words and Enter, ``home``/``end``, ``full``; it has no Fleet lines. The board's keys and state are the host's own (``utilities/session-shell/backlog-board.cjs``). What it runs is the product's: the backend's own answer (``session_shell._status_popup``, which reads the document the way the @@ -58,6 +60,7 @@ def main(argv=None): parser.add_argument("--own", default="") parser.add_argument("--find", default="", help="the backlog board's title to find (the typing, find and detail steps)") parser.add_argument("--find-area", default="", help="the backlog board's area to find (the findarea step)") + parser.add_argument("--find-topic", default="", help="the backlog board's topic to find (the findtopic step; 11-29)") args = parser.parse_args(argv) if args.width < 20 or args.height < 6: parser.error("the popup frame is at least 20 x 6 cells") @@ -168,7 +171,7 @@ def backlog_picture(args, scratch, node, helper, columns, cols, rows, now, sessi details[key] = got drawn = run_node(node, helper, scratch, {"mode": "draw", "cols": cols, "rows": rows, "answer": first, "document": doc, "fleet": None, "sections": SECTIONS, "keys": keys, "title_rest": title[len("BACKLOG"):], "word": "BACKLOG", "current": 1, "steps": steps, "details": details, - "find": args.find, "find_area": args.find_area}) + "find": args.find, "find_area": args.find_area, "find_topic": args.find_topic}) return "{} x {} popup frame\n\n{}\n".format(args.width, args.height, drawn.rstrip("\n")) From 90fd5e68f60c8c6a7e7cf30e793c203e29ad4bad Mon Sep 17 00:00:00 2001 From: dmlguq456 Date: Sun, 29 Nov 2026 23:24:59 +0900 Subject: [PATCH 2/2] ci: measure the backlog-topic bootstrap pointer in the Codex baseline The one-line pointer in core/fragments/bootstrap-body.md raises the Codex bootstrap to 9796 bytes, one warning over the 21-warning ceiling held by the context-footprint census case. Re-measure the baseline (as 9603e3c88 did for the LAB guidance) instead of raising the ceiling; the assertion and every other baseline entry stay as they were. --- hooks/portable-guards.test.sh | 1 + tools/context-footprint-baseline.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/hooks/portable-guards.test.sh b/hooks/portable-guards.test.sh index a62b32c0bc..f842fdea51 100755 --- a/hooks/portable-guards.test.sh +++ b/hooks/portable-guards.test.sh @@ -2323,6 +2323,7 @@ fi # it while the census was unchanged), which is noise, not a regression signal. # The shared LAB guidance is measured in the Codex bootstrap baseline; # the one-sentence addition is intentional, with no new worker/router surfaces. +# The backlog-topic pointer is measured in the same baseline refresh. if python3 "$ROOT/tools/context-footprint.py" --root "$ROOT" --skip-runtime --skip-hooks >"$TMP/context_footprint.out" 2>"$TMP/context_footprint.err" \ && grep -q '^context_footprint_report=1' "$TMP/context_footprint.out" \ && grep -q '^surface=codex-plugin ' "$TMP/context_footprint.out" \ diff --git a/tools/context-footprint-baseline.json b/tools/context-footprint-baseline.json index e0b3e3206d..a0f3f0cf40 100644 --- a/tools/context-footprint-baseline.json +++ b/tools/context-footprint-baseline.json @@ -9,7 +9,7 @@ "schema": 1, "surfaces": { "bootstrap:claude": 5377, - "bootstrap:codex": 9244, + "bootstrap:codex": 9796, "bootstrap:opencode": 6678, "entry-router:canonical:max": 3069, "entry-router:canonical:total": 33922, @@ -40,7 +40,7 @@ "worker-bootstrap:support": 2412 }, "codex_bootstrap_correction": { - "recorded_at": "2026-11-14", - "reason": "Measured LAB guidance bootstrap; preserve the 21-warning ceiling." + "recorded_at": "2026-11-29", + "reason": "Measured LAB guidance and backlog-topic pointer bootstrap; preserve the 21-warning ceiling." } }