Repository navigation
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
Conversation
- 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>
Merged
2 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 becomessprint = <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.pySOURCES/DEFAULT_SOURCESgainsprintin first position;_PROMPT_ORDERis the one place that orders sources and output sections;_TOOLS_OF_SOURCE = {"sprint": "jira"}maps a source to a tool group, soallowed_tools()keeps the Atlassian read tools while either toggle is on and drops them only when both are off.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; thensprint = <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 unscopedsprint 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()keysprint_scope, placeholder{sprint_scope}in_PLACEHOLDER_REand in the built-in template (so a user-edited template keeps working),build_prompt(..., sprint_scope=)rendersAND (<fragment>)or the per-language defaultAND 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: passessprint_scopefrom settings intogenerate.pet/settings_table.py:Setting("sprint_scope", "text", …)after the source toggles; thesources.sprinttoggle row appears by itself because the rows iteratewb.SOURCES. The settings group therefore has 17 rows (was 15).pet/panorama/reports.py:SOURCE_WORDSrecognises "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/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 promptgeneratesends),tests/test_panorama_reports.py(+1source_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/work-assistant.md(the section, the two-step query and why, the scope setting, the source→tool-group mapping),CHANGELOG.md.Performance
Measured with
timeitin the main venv, main vs this branch:build_prompt()normalize()Both run once per generation. The real cost is on the Claude side: the sprint section adds Jira calls (3 → 10
searchJiraIssuesUsingJqlin 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.generatefrom 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-onlyPanoramaServicein the built-in browser:sprint in openSprints()unscoped):ok=True, 19 turns, 161 s, $0.76, 0 denied; the section had 60 items, allCritical, 0 assigned to me, no sprint name in the results. That is what prompted the two-step query.ok=True, 30 turns, 194 s, $0.92, 0 denied;claude.ai Atlassian MCPconnected with 26 calls (searchJiraIssuesUsingJql×10,getJiraIssue×8,listJiraIssueComments×7, …). The section opened with**<sprint name>** · 共 80 条,已完成 40 条, 80 items, 0 stars,Newfirst andDonelast, "还有 884 条没列出" at the end — the sprint holds 964 issues. The lines dropped the·between status and priority, hence the fixed format.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.--src=#d6764fin dark mode), cardsrc-sprintwith 80<li>and 0.star, no console errors;/api/settings/work_briefingreturns 17 rows includingsources.sprint(toggle, on) andsprint_scope(text, empty) with their hints.The pet is restarted from
mainafter the merge.Tests
Red first: on main the three new briefing tests fail (no
sprintinSOURCES, nosprint_scope),source_of("当前 Sprint")isother, 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 testsandgit diff --checkclean. Full suite not run: a new source/setting inside the briefing group plus prompt text; no lifecycle, threading or platform change.Docs
work-assistant.md)🤖 Generated with Claude Code