feat(workflows): 新增科研团队洞察端到端工作流(research-team-insight) #249

Merged
wbtiger merged 1 commits from luwanzhou/gitlink-cli:feat/research-team-insight into master 2026-07-14 22:32:50 +08:00
Contributor

合并请求描述

新增 research-team-insight 端到端科研工作流(Go 实现,复用主仓库 go.mod),从"成员名单"或"研究方向"出发,串联 search +users → api GET ×N + user +info → 聚合分析 → Go 内联 SVG 渲染 → 报告归档,自动产出团队可视化报告(自包含 HTML)、洞察报告(Markdown)与命令执行日志。

相关Issue

关联Issue编号:#(请补充)

变更内容

1. 工作流核心(Go,纯标准库,零第三方依赖)

  • scripts/insight.go(536 行)— 编排主程序:成员解析、画像采集(5 类统计 + 用户信息)、聚合分析、命令日志
  • scripts/render.go(348 行)— Markdown 洞察报告 + HTML/SVG 可视化渲染(能力雷达叠加图 + 能力矩阵 + 共有/独有方向 + 协作网络图)
  • scripts/insight_test.go(168 行)— 7 个单元测试,全部离线运行

2. 三种运行模式

  • --members — 指定成员 login(逗号分隔)
  • --config — 团队配置 JSON 文件
  • --keyword — 按研究方向自动发现成员(search +users

3. 可视化产物(自包含 HTML,浏览器直接打开)

  • 能力雷达叠加图 — 多成员五维能力对比
  • 能力矩阵表 — 影响力/贡献度/活跃度/经验/语言能力 + 团队均值
  • 共有/独有研究方向 — 标签云展示学科覆盖
  • 协作网络图 — 连线粗细表示共同方向数

4. 关键特性

  • 纯 Go 标准库生成内联 SVG,零第三方依赖
  • 复用根 go.mod,可被主仓库 CI 直接覆盖(go build/golangci-lint/go test
  • --no-fetch --data-root 支持离线复现,产物一致
  • 瞬时 TLS 超时自动重试(2 次,3s 间隔)
  • 镜像聚合账号自动标注"分布偏泛"(mirror_projects_count > 100
  • Windows .CMD 包装自动兼容
  • 全流程只读,command_log.json 可审计

5. 真实验证

  • 对 @yystopf(何慧·国防科技大学)、@jiangtx、@wangyue111 三人跑通
  • 19 条命令调用,退出码 0
  • 示例数据与 GitLink API 实测完全一致
  • 产物已归档至 examples/demo_outputs/(HTML / Markdown / 命令日志 / 原始数据)

质量门

检查 状态
go build ./...
go vet ./...
go test 7/7
gofmt -l
离线复现

变更文件(30 个,+2769 行)

核心代码

  • scripts/insight.go — 新增
  • scripts/render.go — 新增
  • scripts/insight_test.go — 新增

配置与脚本

  • config/team.example.json — 新增
  • scripts/run_demo.ps1 — 新增

文档

  • README.md — 新增
  • docs/architecture.md — 新增
  • docs/assets/architecture.svg — 新增
  • docs/runbook.md — 新增

示例产出

  • examples/demo_outputs/team-report.html — 新增
  • examples/demo_outputs/team-insight.md — 新增
  • examples/demo_outputs/command_log.json — 新增
  • examples/demo_outputs/data/{yystopf,jiangtx,wangyue111}/*.json — 新增(18 个)

复现

cd examples/workflows/research-team-insight

# 离线复现(无需网络)
go run ./scripts --config config/team.example.json \
    --out ./out --no-fetch --data-root ./examples/demo_outputs/data

# 在线采集
go run ./scripts --members "yystopf,jiangtx,wangyue111" \
    --team-name "gitlink-cli 贡献组" --out ./out
## 合并请求描述 新增 `research-team-insight` 端到端科研工作流(Go 实现,复用主仓库 `go.mod`),从"成员名单"或"研究方向"出发,串联 `search +users → api GET ×N + user +info → 聚合分析 → Go 内联 SVG 渲染 → 报告归档`,自动产出团队可视化报告(自包含 HTML)、洞察报告(Markdown)与命令执行日志。 ## 相关Issue 关联Issue编号:#(请补充) ## 变更内容 ### 1. 工作流核心(Go,纯标准库,零第三方依赖) - `scripts/insight.go`(536 行)— 编排主程序:成员解析、画像采集(5 类统计 + 用户信息)、聚合分析、命令日志 - `scripts/render.go`(348 行)— Markdown 洞察报告 + HTML/SVG 可视化渲染(能力雷达叠加图 + 能力矩阵 + 共有/独有方向 + 协作网络图) - `scripts/insight_test.go`(168 行)— 7 个单元测试,全部离线运行 ### 2. 三种运行模式 - `--members` — 指定成员 login(逗号分隔) - `--config` — 团队配置 JSON 文件 - `--keyword` — 按研究方向自动发现成员(`search +users`) ### 3. 可视化产物(自包含 HTML,浏览器直接打开) - **能力雷达叠加图** — 多成员五维能力对比 - **能力矩阵表** — 影响力/贡献度/活跃度/经验/语言能力 + 团队均值 - **共有/独有研究方向** — 标签云展示学科覆盖 - **协作网络图** — 连线粗细表示共同方向数 ### 4. 关键特性 - 纯 Go 标准库生成内联 SVG,**零第三方依赖** - 复用根 `go.mod`,可被主仓库 CI 直接覆盖(`go build`/`golangci-lint`/`go test`) - `--no-fetch --data-root` 支持离线复现,产物一致 - 瞬时 TLS 超时自动重试(2 次,3s 间隔) - 镜像聚合账号自动标注"分布偏泛"(`mirror_projects_count > 100`) - Windows `.CMD` 包装自动兼容 - 全流程只读,`command_log.json` 可审计 ### 5. 真实验证 - 对 @yystopf(何慧·国防科技大学)、@jiangtx、@wangyue111 三人跑通 - 19 条命令调用,退出码 0 - 示例数据与 GitLink API 实测完全一致 - 产物已归档至 `examples/demo_outputs/`(HTML / Markdown / 命令日志 / 原始数据) ## 质量门 | 检查 | 状态 | |------|------| | `go build ./...` | ✅ | | `go vet ./...` | ✅ | | `go test` 7/7 | ✅ | | `gofmt -l` | ✅ | | 离线复现 | ✅ | ## 变更文件(30 个,+2769 行) **核心代码** - `scripts/insight.go` — 新增 - `scripts/render.go` — 新增 - `scripts/insight_test.go` — 新增 **配置与脚本** - `config/team.example.json` — 新增 - `scripts/run_demo.ps1` — 新增 **文档** - `README.md` — 新增 - `docs/architecture.md` — 新增 - `docs/assets/architecture.svg` — 新增 - `docs/runbook.md` — 新增 **示例产出** - `examples/demo_outputs/team-report.html` — 新增 - `examples/demo_outputs/team-insight.md` — 新增 - `examples/demo_outputs/command_log.json` — 新增 - `examples/demo_outputs/data/{yystopf,jiangtx,wangyue111}/*.json` — 新增(18 个) ## 复现 ```bash cd examples/workflows/research-team-insight # 离线复现(无需网络) go run ./scripts --config config/team.example.json \ --out ./out --no-fetch --data-root ./examples/demo_outputs/data # 在线采集 go run ./scripts --members "yystopf,jiangtx,wangyue111" \ --team-name "gitlink-cli 贡献组" --out ./out
luwanzhou added 1 commit 2026-06-15 00:21:23 +08:00
e6929a1825 feat(examples): add research-team-insight end-to-end workflow (Go)
A Go workflow (subtopic 3) that composes existing gitlink-cli commands
into a reproducible research-team insight pipeline:

  [search +users] -> profile statistics x N (+ user +info)
    -> aggregate (ability matrix / discipline coverage / roles / languages)
    -> render team report (self-contained HTML, inline SVG: ability radar
       overlay + collaboration network graph)
    -> archive (team-insight.md + command_log.json)

Implemented in Go to match the main repo's stack (shared go.mod, covered
by go build / vet / test / gofmt); standard library only, no third-party
deps. Handles Windows .cmd CLI shims, retries transient TLS timeouts, and
auto-flags mirror-inflated accounts in the report.

Includes unit tests, docs (architecture + runbook + SVG diagram),
run_demo.ps1, sample config, and real demo outputs (3 GitLink members,
19 command invocations). Reuses the gitlink-research-profile skill's
portrait model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
wbtiger merged commit 8af07a94c1 into master 2026-07-14 22:32:37 +08:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Gitlink/gitlink-cli#249
No description provided.