ceo
|
d0334434c5
|
fix:next/mine 漏掉空倉庫中的分派 issue(#43)
iterOrgRepos(issue 掃描,供 Mine 與 members --has-work)不再跳過
empty=true 的倉庫——Gitea 允許空倉庫持有 open issue(「初始化項目」
型工作),行為基準 gitea.py 的 for_all_repositories 掃 issue 時
本來就不檢查 empty;teai 先前過度套用了空倉庫跳過條件,導致
teai next 對 colony-tick-demo issue #1 回 null。
PR 掃描(iterOpenPulls)、stalled、milestone overview 維持跳過
空倉庫不變(與 gitea.py 一致)。附回歸測試兩則。
|
2026-09-13 08:45:48 +08:00 |
|
ceo
|
027ed1ade9
|
workflow_test:fakeSource.OpenIssues 依 number 排序,消除 map 迭代隨機性
審核意見(PR #36):issue 1 與 issue 3 在新邏輯下同為 10h,
sort.SliceStable 平手時順序取決於 map 迭代隨機順序,
TestScanStalledIssueReasons 的 got[0].Number != 1 斷言不穩定。
採建議修法 1:fakeSource.OpenIssues 回傳前依 number 遞增排序,
對齊真實 Gitea API(issues 依 id 遞增)行為。實作未動。
go build / go vet / go test ./... 全綠;
TestScanStalledIssueReasons -count=50 重跑全綠。
|
2026-09-12 15:21:21 +08:00 |
|
ceo
|
e4212b9c90
|
internal/workflow:directLastActivity 排除跨 issue 引用事件(#34)
同步 agents #34/#38/#40 三個停滯判定修補到 Go 端:
- Source 介面新增 IssueTimeline(GET /repos/{o}/{r}/issues/{n}/timeline,分頁),
giteaapi.go 與 cmd/xcheck 同步實作
- 新增 directLastActivity:updated_at 晚於全部已知直接活動時拉 timeline 核對,
排除 comment_ref/issue_ref 引用事件後取最晚;全為引用事件回退已知直接活動
最晚時刻(agents #40);timeline 失敗保守沿用 updated_at
- considerIssue/considerPull 對自身 updated_at、childActivity 對子項 updated_at
(含子項 created_at 入已知活動)套用同一排除邏輯(agents #38)
- 回歸測試:子項 updated_at 被引用刷新(TestRunStalledChildXrefRefresh)、
timeline 全引用事件回退與拉取失敗保守路徑(TestRunStalledTimelineAllXrefFallback)
- 修正 workflow_test.go:timelines 須在 ScanStalled 呼叫前設定
驗證:go build/vet/test 全綠;xcheck 對真實 API 掃描,
stalled 輸出與 gitea.py(agents @ 78769ec)位元組一致(5833 bytes)。
|
2026-09-12 15:10:31 +08:00 |
|
chenyunda218
|
744e7ad809
|
milestones:新增跨倉庫里程碑總覽命令(#31)
- teai milestones(不帶 --repo)輸出跨所屬組織各倉庫 open 里程碑概況,
對應 gitea.py milestones(管理者巡邏,agents AGENTS.md 10.1):
欄位 repo/id/title/url/open_issues/closed_issues/due_on/due_hours/
overdue/unassigned/updated_at,排序期限近者在前、無期限最後。
- internal/workflow.MilestoneOverview:判定核心(Source 注入、離線可測);
MilestoneEntry 自訂 MarshalJSON,鍵集鍵序與 gitea.py 全等
(null 表示、due_hours 定點一位、unassigned PR 條目帶 author)。
- internal/workflow.APIClient 增 OpenMilestones/MilestoneOpenIssues
(issues 端點刻意不帶 type=issues,PR 條目保留供覆蓋檢查,同 gitea.py)。
- milestones --repo a/b 維持現行單倉庫 list 語義不變。
- 空清單輸出 [](gitea.py 無輸出;#26 慣例差異,README 已文件化)。
- 交叉驗證:同帳號同時跑 gitea.py milestones 與 teai milestones,
含逾期/未到期/無期限里程碑與未分派 issue/PR 條目,輸出位元組全等。
|
2026-09-10 21:20:19 +08:00 |
|
ceo
|
ab94cdce9f
|
internal/cli:stalled 與 xrefs 命令接線,完成 #7 CLI 層(堆疊於 #23)
- workflow 新增 StalledSource 介面(Source+CurrentUser+GetIssue)與
高階入口 RunStalled/ResolveIssueXrefs(xrefs 輸出附 source 出處)
- APIClient 補上 StalledSource 面向(GetIssue/TryGetIssue 等)
- CLI 新增 teai stalled [--hours N](JSON 與 gitea.py 位元組相容:
停用 HTML 轉義、縮排 2)與 teai xrefs <owner>/<repo> <number>
(404 → exit 3);table 模式 stalled_hours 定點一位小數
- 接線層與 workflow 層單元測試(注入假資料源、固定時刻)
- README 狀態行更新
驗證:go build/vet/test 全綠;對真實 API 並行掃描,stalled 輸出
與 gitea.py 位元組一致(2169 bytes);xrefs 邊界案例(PR#50/
issue#49 略過、CJK 緊鄰、跨倉庫 owner/repo#N)與 Python 版一致。
|
2026-09-10 12:20:39 +08:00 |
|
ceo
|
4582dfaa4e
|
internal/workflow:統一型別宣告,修復 #12 合併後 main 編譯失敗(#21)
#12 的 workflow.go 與 #13 的 types.go 各自宣告 User/Comment/Issue/
PullRequest/Repository,文字合併無衝突但語意衝突,main 自 a8c1f3e 起
go build 失敗。
統一採 #13 的字串模型(types.go 為唯一型別來源):
- Issue/Comment 補 State/Body/ClosedAt 欄位,新增 parseMoment
(對應 gitea.py _parse_iso8601;保留原時區偏移,輸出與 Python
isoformat 位元組一致)
- workflow.go 移除重複宣告,stalled/xref 邏輯改用該模型與 judge.go
既有輔助(AssigneeNames/ReviewerNames/LastComment/containsString)
- Source 介面 number 改 int64(與 types.go 對齊),cmd/xcheck 同步
- workflow_test.go 測試資料改新型別模型(字串時刻、指標欄位)
驗證:
- go build/go vet/go test ./... 全綠(#6 與 #7 案例皆未回歸)
- xcheck 對真實 API 並行掃描,stalled 輸出與 gitea.py 位元組一致(含
bear-cli#9 父追蹤項子項摘要、+08:00 時區偏移)
- xref 邊界案例(nope#9/PR#50 略過、bear-cli#9 內嵌解析)與 Python 一致
|
2026-09-10 11:32:40 +08:00 |
|
queena
|
a8c1f3e018
|
Merge pull request 'internal/workflow:xref 解析與 stalled 掃描核心邏輯(#7)' (#12) from feat/issue7-stalled-xrefs into main
|
2026-09-10 10:35:35 +08:00 |
|
ceo
|
b2dd2f3aac
|
修正 JSON 位元組相容與 xref Unicode 邊界(審核意見)
依 #12 審核意見修正四項偏差,並補一項同源問題:
1. iterXrefs 前一字元檢查改 Unicode:isWordChar 改用
unicode.IsLetter/IsDigit,且以 utf8 正確解碼前一 rune
(原版只認 ASCII 又取單一位元組)。另補齊 Python finditer
的重試語義:起點被 lookbehind 擋下時從下一 rune 重試,
否則「修復bear-cli#9」會整段丟失(Python 匹配後半 cli#9);
lookbehind 字元集含 #(##5 不匹配)。
2. writeJSON 改 json.Encoder + SetEscapeHTML(false):
Python ensure_ascii=False 不轉義 <、>、&,json.Marshal 預設
會,標題含這些字元即失去位元組相容。
3. stalled_hours 改 strconv.FormatFloat(v,'f',1,64):整數值輸出
48.0(原 %g 輸出 48,極大值還會變 1e+06)。
4. Child.last_activity_at 無可解析時刻時輸出 null(原輸出 ""),
型別改 *string;格式對齊 FormatMoment(UTC 記 +00:00 非 Z)。
5. cmd/xcheck 輸出同樣停用 HTML 轉義(Marshal* 對自訂
MarshalJSON 的輸出仍會轉義)。
驗證:go build/vet/test 全綠(16 測試函式,新增 CJK、##5、
全形數字、HTML 字元、48.0、null 等案例);cmd/xcheck 與
gitea.py stalled 對真實 API 並行掃描輸出位元組相同(1749B,
含 bear-cli#9 父追蹤項與 5 子項摘要);--xrefs 對 CJK
邊界輸入與 Python 一致。
|
2026-09-10 09:47:46 +08:00 |
|
chenyunda218
|
927855d3ca
|
cli:修正帶旗標命令被全域剖析攔下的阻斷問題(#13 審核)
- parseGlobals 改為抽取式 extractGlobals:只取走已知全域選項,非全域
選項(--has-work/--mine/--reviewer/--repo)原樣交回子命令 flagset,
任何順序(含與全域選項交錯)皆可解析;-- 之後停止抽取。
- runVersion 補參數檢查:version --wat 仍回 exit 2。
- workflow:commentsFor 對 number<=0 視為無留言,不打 API(對齊 gitea.py
在 number 缺漏時跳過留言檢查,避免 issues/0/comments 404 中斷掃描)。
- 新增 internal/cli/workflow_commands_test.go:以注入假 client 的接線層
測試補上 workflow 單元測試覆蓋不到的分派路徑(members --has-work、
pulls --mine/--reviewer/--repo、全域選項交錯、next null/table)。
- README:註明與 gitea.py 的已知輸出差異(空清單 [] vs 無輸出;
全域選項可出現在命令前後)。
實機交叉驗證(alex):members --has-work、pulls --mine/--reviewer、
pulls --repo、next、mine 兩者輸出一致;go vet/test 全綠。
|
2026-09-10 09:41:53 +08:00 |
|
chenyunda218
|
5583a00bb5
|
internal/workflow + cli:gitea.py 工作流命令 Go 化(#6)
- internal/workflow:Client 介面+判定語義(最後留言、作者/審核者跟進、
assignee 交集、最久未更新優先),含假 client 單元測試
- internal/workflow/giteaapi.go:以 internal/gitea(#5)實作 Client
- internal/cli:註冊 whoami/orgs/members/mine/pulls/next;全域選項允許
出現在命令之後;結束碼 0/2/3
- 與 gitea.py 交叉驗證:next/mine/pulls/members(--has-work) 拾取一致
- 依 #5 分支 feature/issue5-gitea-client 為基底
|
2026-09-10 08:39:35 +08:00 |
|
ceo
|
a86803d336
|
internal/workflow:xref 解析與 stalled 掃描核心邏輯(#7)
完整移植 gitea.py 的 _resolve_xref_targets 與 find_stalled_work:
- xref:#N/repo#N/owner/repo#N;單段 repo 僅在存在於組織時解析
(PR#50、issue#49 這類寫法自動略過);owner 需為所屬組織。
Go regexp 無 lookbehind,掃描時檢查前一字元等價實作。
- stalled:reason 分類(issue:no-assignee/assignee-idle/no-commenter/
waiting-outside/parent-tracking;PR:no-reviewer/author-idle/
reviewer-idle/no-commenter)、24h 催促冷卻、父追蹤項把子項活動
(留言、state 變更、PR 合併)計入 last_activity、上行引用不採計。
- 資料以 Source 介面注入:邏輯離線可測,CLI 接線待 #5 基礎建設。
- 輸出 JSON 與 gitea.py 位元組相容(鍵序、assignees/author 欄位、
isoformat 時刻、round(x,1) 半偶數舍入)。
- cmd/xcheck:交叉驗證工具(--xrefs 與停滯掃描模式),已對真實 API
與 gitea.py 並行比對,輸出一致。
go build/vet/test 全綠;單元測試覆蓋 xref 邊界與 stalled 判定。
|
2026-09-10 08:36:31 +08:00 |
|