Skip to content

feat(briefing): "Current sprint" as the first section — every issue of my team's sprint in Jira priority order; scope is a setting - #94

Merged
LiminCode merged 3 commits into
mainfrom
feature/briefing-sprint-section
Nov 20, 2026
Merged

LiminCode merged 3 commits into
mainfrom
feature/briefing-sprint-section

Conversation

@LiminCode

Copy link
Copy Markdown
Owner

Summary

The work briefing gets a new first section, "当前 Sprint" / "Current sprint": every issue in the sprint my team is running now, whoever it is assigned to, in Jira's own priority order (no ★ rating in this section), with status, priority and assignee per line, done issues last. It is a source toggle like the others (sources.sprint, on by default) and shares the Atlassian read tools with the Jira source. Two real runs showed that "the current sprint" at this site is a company-wide sprint (964 issues; the user's own project alone holds 604 of them), so the section's scope is a new setting, sprint_scope: one JQL fragment (component, label, filter id …) that becomes sprint = <id> AND (<fragment>); empty falls back to the project of my issues. Design memo: .scratch/config-panorama/briefing-sprint-section-design.md (local).

What changed and why

  • pet/work_briefing.py
    • SOURCES / DEFAULT_SOURCES gain sprint in first position; _PROMPT_ORDER is the one place that orders sources and output sections; _TOOLS_OF_SOURCE = {"sprint": "jira"} maps a source to a tool group, so allowed_tools() keeps the Atlassian read tools while either toggle is on and drops them only when both are off.
    • Prompt (zh and en): a two-step query. First assignee = currentUser() AND sprint in openSprints() (fields sprint, project) to learn which sprint(s) I am in, falling back to the active sprint of my recently updated projects; then sprint = <id> {sprint_scope} ORDER BY priority DESC, status ASC, updated DESC, at most 80, paginated, with "N more not listed" when capped. One block per sprint opened by **<sprint name>** · N issues, M done. Fixed line format - [KEY](link) title · <status> · <priority> · <assignee> (the second real run dropped the separator between status and priority when the format was described in prose). The prompt forbids an unscoped sprint in openSprints() over the whole site: that is exactly what the first real run did and it returned 60 Critical issues from other teams and none of mine.
    • normalize_sprint_scope (first line, trimmed, ≤ 300 chars), normalize() key sprint_scope, placeholder {sprint_scope} in _PLACEHOLDER_RE and in the built-in template (so a user-edited template keeps working), build_prompt(..., sprint_scope=) renders AND (<fragment>) or the per-language default AND project = <the project of my issues>, generate(..., sprint_scope=) passes it through. The fragment reaches the prompt only, never the shell command.
  • pet/work_briefing_service.py: passes sprint_scope from settings into generate.
  • pet/settings_table.py: Setting("sprint_scope", "text", …) after the source toggles; the sources.sprint toggle row appears by itself because the rows iterate wb.SOURCES. The settings group therefore has 17 rows (was 15).
  • pet/panorama/reports.py: SOURCE_WORDS recognises "sprint" / "迭代" so the section gets its own tile colour; pet/panorama/page/report.css: --src-sprint (light #c4603a, dark #d6764f) and .src-sprint.
  • pet/locale/zh.json, en.json: briefing.settings.source.sprint(_hint), briefing.settings.sprint_scope(_hint).
  • Tests: tests/test_work_briefing_sources.py (+3: first section and JQL/format requirements in both languages; switching sprint off drops only that section while the tools stay, only-sprint keeps the tools, both off drops them; the scope setting: normalisation, placeholder kept in the template, both renderings, pass-through to the prompt generate sends), tests/test_panorama_reports.py (+1 source_of), tests/test_settings_write_path.py (+1 text row), and the existing expectations that enumerate sections, numbering, defaults and the row count updated.
  • Docs: docs/work-assistant.md (the section, the two-step query and why, the scope setting, the source→tool-group mapping), CHANGELOG.md.

Performance

Measured with timeit in the main venv, main vs this branch:

main branch
default zh prompt 1688 chars 2599 chars
build_prompt() 11.7 µs 13.6 µs
normalize() 1.0 µs 1.1 µs
allowed tool names 54 54

Both run once per generation. The real cost is on the Claude side: the sprint section adds Jira calls (3 → 10 searchJiraIssuesUsingJql in the real runs below) and 80 more output lines; the two real runs took 161 s / $0.76 and 194 s / $0.92 against 79 s / $0.60 for the previous briefing without the section (sonnet, medium, same sources). No new threads, files, syscalls or network paths on the fish's side; the page renders the extra card with the same code as the other sections.

Real-machine run

Real work_briefing.generate from this worktree (sonnet, medium, default sources, real WSL and connectors, output into a scratch folder, text not reproduced here — company content), and the page served by a standalone read-only PanoramaService in the built-in browser:

  1. First version (sprint in openSprints() unscoped): ok=True, 19 turns, 161 s, $0.76, 0 denied; the section had 60 items, all Critical, 0 assigned to me, no sprint name in the results. That is what prompted the two-step query.
  2. Two-step query: ok=True, 30 turns, 194 s, $0.92, 0 denied; claude.ai Atlassian MCP connected with 26 calls (searchJiraIssuesUsingJql ×10, getJiraIssue ×8, listJiraIssueComments ×7, …). The section opened with **<sprint name>** · 共 80 条,已完成 40 条, 80 items, 0 stars, New first and Done last, "还有 884 条没列出" at the end — the sprint holds 964 issues. The lines dropped the · between status and priority, hence the fixed format.
  3. Read-only probe through the same headless pipeline (sonnet, three Atlassian read tools, $0.71): my open-sprint issues are all in one project; that project has 604 issues in the sprint, 290 open. So the scope setting is required; the right fragment (board filter) is the user's to fill in.
  4. Final prompt (scope empty → project fallback): ok=True, 27 turns, 227 s, $1.29, 0 denied; searchJiraIssuesUsingJql ×12. The section names the issue the sprint was taken from, opens with **<sprint name>** · 共 80 条,已完成 37 条, all 80 lines have the four ·-separated parts, open issues run Critical → High in Jira's order with Done issues at the end of the block, 0 stars, and it closes with “还有更多” because the project fallback is still far wider than a team.
  5. Page: the "当前 Sprint" tile is first with its own colour (--src = #d6764f in dark mode), card src-sprint with 80 <li> and 0 .star, no console errors; /api/settings/work_briefing returns 17 rows including sources.sprint (toggle, on) and sprint_scope (text, empty) with their hints.

The pet is restarted from main after the merge.

Tests

Red first: on main the three new briefing tests fail (no sprint in SOURCES, no sprint_scope), source_of("当前 Sprint") is other, the write-path test has no such row. Families run: tests/test_work_briefing*.py, test_settings_table.py, test_settings_write_path.py, test_settings_work_briefing.py, test_panorama_settings*.py, test_panorama_reports.py, test_panorama_report_page.py, test_i18n.py, test_work_notes*.py, test_slack_watch*.py, test_pr_report_discipline.py — 389 passed; ruff check pet tests and git diff --check clean. Full suite not run: a new source/setting inside the briefing group plus prompt text; no lifecycle, threading or platform change.

Docs

  • CHANGELOG.md: one line (user-visible change)
  • Topic doc under docs/ updated (work-assistant.md)
  • ADR: not needed

🤖 Generated with Claude Code

LiminCode and others added 3 commits November 20, 2026 12:24
- work_briefing:来源多一个 sprint(默认开、排第一);提示词中英文各加一段(JQL sprint in openSprints() ORDER BY priority DESC,
  最多 60 条,不限经办人,第一行「共 N 条,已完成 M 条」,严格按 Jira 优先级、不标星级,已完成排最后,经办人是我加粗);
  _PROMPT_ORDER 统一来源与分区顺序;_TOOLS_OF_SOURCE 把 sprint 映射到 Jira 那组 Atlassian 工具,两个开关任一开着工具就在
- panorama/reports:SOURCE_WORDS 认「sprint / 迭代」;report.css 给 src-sprint 一个颜色(明暗各一)
- 字表:briefing.settings.source.sprint / _hint(设置页的开关行按 wb.SOURCES 自动出现)
- 测试:sprint 是第一节、JQL 与格式要求在提示词里、关 sprint 只掉那一节、只开 sprint 也放行 Atlassian 工具、两个都关才没有;
  source_of 认 sprint;既有测试的编号与分区列表跟着改
- docs/work-assistant、CHANGELOG

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
第一次真机直接 `sprint in openSprints()` 查遍全站:拿回的 60 条全是别的团队的 Critical,我的一条都没进来,返回里也没有 sprint 名。
现在先 `assignee = currentUser() AND sprint in openSprints()`(fields 带 sprint / project)找出我所在的 sprint,没有就退到我最近工单所在
项目的活跃 sprint;再 `sprint = <id> ORDER BY priority DESC, status ASC, updated DESC`(fields 带 summary / status / priority / assignee /
issuetype)最多 80 条,超出写「还有 N 条没列出」;每个 sprint 一段,段首带名字和条数。中英文提示词、测试、文档、字表同步。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…格式钉死四段用 · 隔开

探针:公司共用的 sprint 有 964 条,我的项目在里面也有 604 条(未完成 290),「全部」在这个规模下没意义,团队范围只有看板的过滤条件
(组件 / 标签 / filter id)知道。新设置 work_briefing.sprint_scope:占位符 {sprint_scope} 进模板,build_prompt 填成 `AND (<片段>)`,
空时填「AND project = <我的工单所在的项目>」;normalize 取第一行、限 300 字;它只进提示词不进 shell。设置表加一行 text 控件(页面
自动出现),字表中英文,服务把它传给 generate。第二次真机里状态和优先级之间丢了分隔符,提示词改成固定格式
`- [编号](链接) 标题 · <状态> · <优先级> · <经办人>`。测试:normalize / 模板留占位符 / 两种填法 / generate 透传 / 写入路径;
既有的默认值、模板渲染、设置条数(15 → 17)跟着改。docs/work-assistant、CHANGELOG。

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@LiminCode
LiminCode merged commit 5a9e8d2 into main Nov 20, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant