Repository navigation
项目指标改成读数器注册表,一个项目挂多个指标,新增 X 粉丝数 (#39) - #122
Merged
Merged
Conversation
…哪一个 (#39) Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01EUUevWtewJLhFKxozAthNu
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni
…90 宽目标表单不再被选择框撑开 (#39) - shared 加 landReported,返回 MetricLanding:land 带序列键(null 是手记那条),refused 带原因(unknown_label 列出挂着的名字,polled_goal)。 - 控制面 handleMetricReport 改用它,不收的整条丢掉,warn 写群、runId、label 和原因,不记 value。recordSample 改收一个落点函数,PickMetric 三态收掉。 - 运行器 report_metric 发之前按任务卡判一遍,不收就抛中文错误,告诉 Bot 照哪个名字写,或者这个数由读数器读。 - UpdateTaskRequest 的 goal.metric 可省,省了保留原来对的那个,给 null 才改对手记那条,控制面和 mock 一起改。 - 目标表单的格子和选择框可以收窄,390 宽下不超出聊天栏。 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni
joesmart
force-pushed
the
joesmart/feat-project-metrics
branch
from
October 24, 2026 21:19
4bf4ea7 to
ac626f4
Compare
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.
改了什么
control-plane/src/metrics/readers.ts):每种能直读的指标按平台注册,声明走哪个平台的接口授权账号、请求哪个路径、从回包哪里取数、取不到怎么说。取令牌、超时、401 重试一次再记过期、非 2xx 这些通用部分留在poller.ts。GitHub 星数迁进来,行为不变(原有星数用例只换了挂指标的辅助函数,goal 的期望多一个metric: null,读数和时机的断言没动)。metricSource改成metricSources数组(最多 8 个,同一个指标不能挂两次)。goal.metric指明目标对的是哪一个,null 是手记的那条。任务卡新增metrics,和metricSources一一对应:每个指标给出读数、读到的时间,以及账号是否连着(connected/disconnected;Bot 报的数为 null)。样本表加metric列,按 (群, 指标) 分序列。goal_metric、metric_sources、metric_samples.metric三列。旧的单个来源迁成一个元素的数组,旧样本和目标都归到这个指标上,然后删掉metric_source。/2/users/me的public_metrics.followers_count。只在电脑浏览器上登着、没连接口的账号不读,项目页提示「账号没连上,去连接」。goal不带metric时保留原来对的那个,显式给 null 才改对手记那条(Web 照旧每次都带)。landReported一处定,控制面和运行器都用它。label 和挂着的某个「Bot 报的数」同名,记到那个指标;一个都没挂、目标对手记那条(或没目标),记到手记那条,单指标的老项目照旧;其余一律不收(目标对的是读数器读的数,或挂了 Bot 报的数但名字都对不上),控制面整条丢掉并打 warn(群、runId、label、原因,不记数值)。运行器发之前按任务卡先判一遍,不收就回中文错误让 Bot 改了重报,控制面那道仍是权威。运行器的任务卡在挂了 Bot 报的数时多一行「要报的数」,列出这些名字;没挂就没有这一行,旧项目的 prompt 字节不变。复核后这一轮(4bf4ea7)
landReported返回MetricLanding:{ kind: "land", metric }(metric 为 null 是手记那条,和goal.metric同一约定)或{ kind: "refused", reason },reason 是unknown_label(带挂着的名字)或polled_goal。控制面recordSample改收一个落点函数,手动记数和 Bot 报数各传各的,原来的PickMetric三态收掉。min-width: 0不够,它外面那格 label 是 flex 项、默认不肯比内容窄,所以.field也加了min-width: 0,输入框加max-width: 100%。390 宽下整页仍有横向滚动(侧栏固定 272px,聊天栏只剩 118px,任务卡右上按钮、头部电脑按钮、保存按钮本来就出界),不是这个表单引起的,没在这一轮动。为什么
#39:项目指标只能读 GitHub 星数,其他平台只能手填;评论里要求一个项目能挂多个指标(粉丝、星数、互动率)。
小红书这条没做,留给后续,所以这里写 Refs 不写 Fixes。后续接法:小红书没有公开读数接口,指标挂
{ kind: "reported", platform: "xiaohongshu", label },由 Bot 在例行里用浏览器读完调report_metric上报。「建小红书项目时自动挂一条读数例行」要在建项目时按这类来源生成例行,也没做。控制面 README「目标与手动记数」一节写了怎么接。怎么验证
新用例在 origin/main 上都是红的(在临时工作树里只换测试文件跑过):控制面 goals / metric-poller / metric-sources-migration 里 17 条失败,shared 2 条,runner 1 条,Web Playwright 1 条。复核这一轮的新用例先单独提交在 fcde304,在 e71677d 上红:控制面 3 条(P1、P2、PATCH 保留 metric),runner 2 条,shared 2 条,Web 390 宽 1 条(超出聊天栏 153px)。
Refs #39
🤖 Generated with Claude Code
https://claude.ai/code/session_01Be3SZps2JjqvyrJ1vbLmni