ai-project-maintainer 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +175 -0
- package/ai-project-maintainer/SKILL.md +62 -0
- package/ai-project-maintainer/agents/openai.yaml +6 -0
- package/ai-project-maintainer/references/ci-guardrails.md +55 -0
- package/ai-project-maintainer/references/database.md +60 -0
- package/ai-project-maintainer/references/electron-desktop.md +43 -0
- package/ai-project-maintainer/references/incident-response.md +52 -0
- package/ai-project-maintainer/references/local-gate.md +117 -0
- package/ai-project-maintainer/references/security.md +48 -0
- package/ai-project-maintainer/references/tool-router.md +53 -0
- package/ai-project-maintainer/scripts/audit-plan.mjs +155 -0
- package/ai-project-maintainer/scripts/bootstrap-local-tools.ps1 +109 -0
- package/ai-project-maintainer/scripts/check-syntax.mjs +41 -0
- package/ai-project-maintainer/scripts/ci-smoke-gate.mjs +26 -0
- package/ai-project-maintainer/scripts/cli.mjs +165 -0
- package/ai-project-maintainer/scripts/doctor.mjs +80 -0
- package/ai-project-maintainer/scripts/init-audit.mjs +105 -0
- package/ai-project-maintainer/scripts/init-project.mjs +229 -0
- package/ai-project-maintainer/scripts/lib/check-registry.mjs +68 -0
- package/ai-project-maintainer/scripts/lib/checks.mjs +337 -0
- package/ai-project-maintainer/scripts/lib/command-runner.mjs +130 -0
- package/ai-project-maintainer/scripts/lib/intake.mjs +172 -0
- package/ai-project-maintainer/scripts/lib/policy.mjs +150 -0
- package/ai-project-maintainer/scripts/lib/project-detect.mjs +111 -0
- package/ai-project-maintainer/scripts/lib/report.mjs +227 -0
- package/ai-project-maintainer/scripts/probe-project.mjs +218 -0
- package/ai-project-maintainer/scripts/report-summary.mjs +25 -0
- package/ai-project-maintainer/scripts/run-local-gate.mjs +147 -0
- package/docs/CI-GITHUB-ACTIONS.zh-CN.md +83 -0
- package/docs/DEMO.md +81 -0
- package/docs/DEMO.zh-CN.md +81 -0
- package/docs/GITHUB-LAUNCH-CHECKLIST.md +77 -0
- package/docs/INSTALL.zh-CN.md +112 -0
- package/docs/INTAKE-SCHEMA.zh-CN.md +105 -0
- package/docs/POLICY-AND-EXCEPTIONS.zh-CN.md +96 -0
- package/docs/PRODUCTION-AUDIT.zh-CN.md +89 -0
- package/docs/PROMOTION.md +116 -0
- package/docs/UPGRADE-ROADMAP.zh-CN.md +47 -0
- package/docs/demo-output/security-report.md +57 -0
- package/docs/superpowers/plans/2026-06-29-ci-dogfooding.md +200 -0
- package/package.json +21 -0
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Intake 配置说明
|
|
2
|
+
|
|
3
|
+
`init-audit` 生成的文件用于告诉工具“这个项目是什么、有哪些资源、哪些风险需要重点审”。公开用户不需要提供所有资源,缺失项会作为 `GAP` 写入报告。
|
|
4
|
+
|
|
5
|
+
## project-profile.yml
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
schema_version: 1
|
|
9
|
+
project:
|
|
10
|
+
name: ""
|
|
11
|
+
type: auto
|
|
12
|
+
lifecycle: development
|
|
13
|
+
production: false
|
|
14
|
+
risk:
|
|
15
|
+
handles_auth: false
|
|
16
|
+
handles_sensitive_data: false
|
|
17
|
+
handles_payments: false
|
|
18
|
+
handles_financial_data: false
|
|
19
|
+
handles_health_data: false
|
|
20
|
+
has_database: auto
|
|
21
|
+
has_deployment: false
|
|
22
|
+
has_user_generated_content: false
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
建议:
|
|
26
|
+
|
|
27
|
+
- `type` 可以保持 `auto`,工具会自动识别 Electron、Web、API、Node 或通用项目。
|
|
28
|
+
- `has_database` 可以保持 `auto`,工具会根据 migration、Prisma、Drizzle、SQL 等文件推断。
|
|
29
|
+
- 涉及登录、权限、支付、财务、隐私数据时,要把对应字段改为 `true`。
|
|
30
|
+
|
|
31
|
+
## evidence-sources.yml
|
|
32
|
+
|
|
33
|
+
```yaml
|
|
34
|
+
schema_version: 1
|
|
35
|
+
evidence:
|
|
36
|
+
github_actions: auto
|
|
37
|
+
deployment:
|
|
38
|
+
provider: none
|
|
39
|
+
has_staging: false
|
|
40
|
+
has_production: false
|
|
41
|
+
production_requires_approval: false
|
|
42
|
+
observability:
|
|
43
|
+
errors: none
|
|
44
|
+
logs: none
|
|
45
|
+
metrics: none
|
|
46
|
+
alerts: none
|
|
47
|
+
database:
|
|
48
|
+
migrations: auto
|
|
49
|
+
review_tool: none
|
|
50
|
+
backup_policy: none
|
|
51
|
+
rollback_plan: none
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
这里不要写密钥。只写证据类型,例如:
|
|
55
|
+
|
|
56
|
+
```yaml
|
|
57
|
+
observability:
|
|
58
|
+
errors: sentry
|
|
59
|
+
logs: vercel
|
|
60
|
+
metrics: grafana
|
|
61
|
+
alerts: email
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## business-flows.yml
|
|
65
|
+
|
|
66
|
+
把核心业务流程写成可审查条目:
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
business_flows:
|
|
70
|
+
- id: save-project
|
|
71
|
+
name: 保存项目
|
|
72
|
+
criticality: high
|
|
73
|
+
expected_behavior: 保存后重启应用,数据必须保持一致。
|
|
74
|
+
tests:
|
|
75
|
+
- test/save-project.test.mjs
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
如果没有填写真实流程,报告会给出 `USER_DECISION`。
|
|
79
|
+
|
|
80
|
+
## risk-policy.yml
|
|
81
|
+
|
|
82
|
+
默认:
|
|
83
|
+
|
|
84
|
+
```yaml
|
|
85
|
+
production:
|
|
86
|
+
block_on_coverage_gaps: false
|
|
87
|
+
block_on_user_decisions: false
|
|
88
|
+
require_intake: false
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
如果你希望生产证据缺口也直接失败:
|
|
92
|
+
|
|
93
|
+
```yaml
|
|
94
|
+
production:
|
|
95
|
+
block_on_coverage_gaps: true
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 状态含义
|
|
99
|
+
|
|
100
|
+
- `PASS`:已检查并通过。
|
|
101
|
+
- `FAIL`:已检查并失败。
|
|
102
|
+
- `WARN`:有风险但默认不阻断。
|
|
103
|
+
- `GAP`:缺少证据,无法判断。
|
|
104
|
+
- `N/A`:该项目不适用。
|
|
105
|
+
- `USER_DECISION`:需要项目负责人判断。
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Policy 和 Exceptions
|
|
2
|
+
|
|
3
|
+
## Policy
|
|
4
|
+
|
|
5
|
+
项目策略文件:
|
|
6
|
+
|
|
7
|
+
```text
|
|
8
|
+
.ai-maintainer/policy.yml
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
V2 默认策略面向开源项目维护者:
|
|
12
|
+
|
|
13
|
+
```yaml
|
|
14
|
+
profile: oss
|
|
15
|
+
mode: strict
|
|
16
|
+
checks:
|
|
17
|
+
gitleaks: block
|
|
18
|
+
trivy: block
|
|
19
|
+
semgrep: block
|
|
20
|
+
osv-scanner: warn
|
|
21
|
+
syft: warn
|
|
22
|
+
grype: warn
|
|
23
|
+
actionlint: block
|
|
24
|
+
zizmor: warn
|
|
25
|
+
checkov: warn
|
|
26
|
+
trivy-config: warn
|
|
27
|
+
scorecard: warn
|
|
28
|
+
megalinter: warn
|
|
29
|
+
pre-commit: warn
|
|
30
|
+
fail_on:
|
|
31
|
+
tests: true
|
|
32
|
+
secrets: true
|
|
33
|
+
dependency_high_or_critical: true
|
|
34
|
+
semgrep_blocking: true
|
|
35
|
+
trivy_unavailable: true
|
|
36
|
+
electron_dangerous_settings: true
|
|
37
|
+
ci_security_high: true
|
|
38
|
+
warn_on:
|
|
39
|
+
missing_optional_tools: true
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
`checks` 支持三个级别:
|
|
43
|
+
|
|
44
|
+
- `block`:失败会阻断门禁。
|
|
45
|
+
- `warn`:失败或缺失只进入警告和维护分,不阻断。
|
|
46
|
+
- `off`:关闭该检查。
|
|
47
|
+
|
|
48
|
+
## Exceptions
|
|
49
|
+
|
|
50
|
+
例外文件:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
.ai-maintainer/exceptions.yml
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
格式:
|
|
57
|
+
|
|
58
|
+
```yaml
|
|
59
|
+
exceptions:
|
|
60
|
+
- id: "example-dev-only-vuln"
|
|
61
|
+
check: "npm audit"
|
|
62
|
+
reason: "dev-only transitive dependency, not shipped"
|
|
63
|
+
expires: "2026-09-01"
|
|
64
|
+
owner: "repo-owner"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
必须包含:
|
|
68
|
+
|
|
69
|
+
- `id`
|
|
70
|
+
- `check`
|
|
71
|
+
- `reason`
|
|
72
|
+
- `expires`
|
|
73
|
+
- `owner`
|
|
74
|
+
|
|
75
|
+
## 规则
|
|
76
|
+
|
|
77
|
+
- 过期例外视为失败。
|
|
78
|
+
- 缺字段例外视为失败。
|
|
79
|
+
- 例外只能降级指定 finding,不能关闭整个工具。
|
|
80
|
+
- 例外使用情况会写入 JSON 和 Markdown 报告。
|
|
81
|
+
|
|
82
|
+
## 建议
|
|
83
|
+
|
|
84
|
+
适合例外:
|
|
85
|
+
|
|
86
|
+
- dev-only 传递依赖漏洞,确认不随产品发布。
|
|
87
|
+
- 明确误报,并有理由和负责人。
|
|
88
|
+
- 上游暂未修复,但有临时缓解措施和短过期时间。
|
|
89
|
+
|
|
90
|
+
不适合例外:
|
|
91
|
+
|
|
92
|
+
- 真实 secret 泄露。
|
|
93
|
+
- 生产依赖高危漏洞且没有缓解措施。
|
|
94
|
+
- 测试或构建失败。
|
|
95
|
+
- Electron 危险 IPC 或危险 webPreferences。
|
|
96
|
+
- 严格模式下 Trivy 数据库不可用。
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# 生产级半自动审查流程
|
|
2
|
+
|
|
3
|
+
这个流程面向个人开发者和 AI 协作维护生产级项目。目标不是证明项目绝对安全,而是把专业审查拆成可执行的证据链:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
项目画像 -> 资源清单 -> 审计计划 -> 门禁检查 -> AI 修复 -> 用户审批
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 1. 生成审查画像
|
|
10
|
+
|
|
11
|
+
```powershell
|
|
12
|
+
npx ai-project-maintainer init-audit "E:\我的项目"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
填写生成的文件:
|
|
16
|
+
|
|
17
|
+
```text
|
|
18
|
+
.ai-maintainer/project-profile.yml
|
|
19
|
+
.ai-maintainer/evidence-sources.yml
|
|
20
|
+
.ai-maintainer/business-flows.yml
|
|
21
|
+
.ai-maintainer/risk-policy.yml
|
|
22
|
+
.ai-maintainer/threat-model.md
|
|
23
|
+
.ai-maintainer/release-checklist.yml
|
|
24
|
+
.ai-maintainer/incident-runbook.md
|
|
25
|
+
.ai-maintainer/db-migration-policy.yml
|
|
26
|
+
.ai-maintainer/observability-checklist.yml
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
这些文件只记录证据来源和风险判断,不记录 token、密码、DSN 或云凭证。
|
|
30
|
+
|
|
31
|
+
## 2. 生成审计计划
|
|
32
|
+
|
|
33
|
+
```powershell
|
|
34
|
+
npx ai-project-maintainer audit-plan "E:\我的项目" --output reports/audit-plan.json
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
审计计划会说明:
|
|
38
|
+
|
|
39
|
+
- 哪些检查适用于当前项目。
|
|
40
|
+
- 哪些检查不适用,标记为 `N/A`。
|
|
41
|
+
- 哪些证据缺失,标记为 `GAP`。
|
|
42
|
+
- 哪些事项必须由项目负责人判断,标记为 `USER_DECISION`。
|
|
43
|
+
|
|
44
|
+
## 3. 执行生产门禁
|
|
45
|
+
|
|
46
|
+
```powershell
|
|
47
|
+
npx ai-project-maintainer gate "E:\我的项目" --production --strict --release --output reports/security-report.json
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
生产门禁会继续运行原有安全门禁,并额外加入生产准备度证据:
|
|
51
|
+
|
|
52
|
+
- 核心业务流程和测试覆盖。
|
|
53
|
+
- CI 和发布审批。
|
|
54
|
+
- 错误监控、日志、指标、告警。
|
|
55
|
+
- 数据库迁移、备份、回滚或 forward-fix。
|
|
56
|
+
- Electron IPC、preload、文件权限和更新机制。
|
|
57
|
+
|
|
58
|
+
## 4. 如何理解结果
|
|
59
|
+
|
|
60
|
+
- `PASS`:已检查并通过。
|
|
61
|
+
- `FAIL`:已检查并失败。
|
|
62
|
+
- `WARN`:有风险但默认不阻断。
|
|
63
|
+
- `GAP`:缺少证据,无法判断。
|
|
64
|
+
- `N/A`:该项目不适用。
|
|
65
|
+
- `USER_DECISION`:需要项目负责人判断。
|
|
66
|
+
|
|
67
|
+
默认情况下,`GAP` 不阻断;它代表“证据不足”,不是“安全”。如果你要把生产证据缺口作为硬门禁,设置:
|
|
68
|
+
|
|
69
|
+
```yaml
|
|
70
|
+
production:
|
|
71
|
+
block_on_coverage_gaps: true
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## 5. 用户和 AI 的分工
|
|
75
|
+
|
|
76
|
+
用户负责:
|
|
77
|
+
|
|
78
|
+
- 定义核心业务流程。
|
|
79
|
+
- 判断哪些风险不能接受。
|
|
80
|
+
- 提供只读证据来源或说明。
|
|
81
|
+
- 审批发布和例外。
|
|
82
|
+
|
|
83
|
+
AI/Codex 负责:
|
|
84
|
+
|
|
85
|
+
- 读取画像和审计计划。
|
|
86
|
+
- 执行检查。
|
|
87
|
+
- 修复阻断项。
|
|
88
|
+
- 重新运行门禁。
|
|
89
|
+
- 把缺口写成报告和下一步清单。
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# Promotion Kit
|
|
2
|
+
|
|
3
|
+
Use these posts after the repository has README, license, demo, issue templates, and a release.
|
|
4
|
+
|
|
5
|
+
## GitHub About
|
|
6
|
+
|
|
7
|
+
Description:
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Production-readiness audit and CI gate for AI-coded projects.
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Topics:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
ai-coding
|
|
17
|
+
devsecops
|
|
18
|
+
security
|
|
19
|
+
production-readiness
|
|
20
|
+
codex
|
|
21
|
+
github-actions
|
|
22
|
+
semgrep
|
|
23
|
+
trivy
|
|
24
|
+
gitleaks
|
|
25
|
+
ai-agents
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## English Short Post
|
|
29
|
+
|
|
30
|
+
```text
|
|
31
|
+
I built AI Project Maintainer: a production-readiness gate for AI-coded projects.
|
|
32
|
+
|
|
33
|
+
AI writes code fast, but shipping safely still needs tests, security checks, release evidence, monitoring gaps, and maintainer decisions.
|
|
34
|
+
|
|
35
|
+
This tool creates a project profile, generates an audit plan, runs local/CI gates, reports production evidence gaps, and lets Codex fix blockers until the release is defensible.
|
|
36
|
+
|
|
37
|
+
GitHub: https://github.com/xixifusi1213-gif/ai-project-maintainer
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Show HN
|
|
41
|
+
|
|
42
|
+
Title:
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
Show HN: AI Project Maintainer – production-readiness gate for AI-coded projects
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Body:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
I built a local/CI gate for AI-coded projects.
|
|
52
|
+
|
|
53
|
+
The idea is simple: AI can write code quickly, but the hard part is proving a project is ready enough to ship. This tool turns that into a repeatable loop:
|
|
54
|
+
|
|
55
|
+
project profile -> audit plan -> local/CI gate -> evidence report -> AI fixes -> rerun
|
|
56
|
+
|
|
57
|
+
It wraps common tools like Gitleaks, Trivy, Semgrep, OSV-Scanner, Syft, Grype, actionlint, zizmor, and Checkov, but adds a production audit layer. It reports missing monitoring, release approval, database backup/rollback evidence, and business-flow test gaps as explicit GAP or USER_DECISION items.
|
|
58
|
+
|
|
59
|
+
It is account-free by default. External APIs can be added later as optional user-provided evidence sources.
|
|
60
|
+
|
|
61
|
+
Feedback on the workflow and positioning would be very useful.
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Chinese Short Post
|
|
65
|
+
|
|
66
|
+
```text
|
|
67
|
+
我做了一个给 AI coding 项目的生产级半自动维护门禁:AI Project Maintainer。
|
|
68
|
+
|
|
69
|
+
它不是单纯安全扫描器,而是把项目画像、资源清单、审计计划、CI 门禁、生产证据缺口和 AI 修复串成一条链路。
|
|
70
|
+
|
|
71
|
+
流程是:
|
|
72
|
+
项目画像 -> 审计计划 -> 本地/CI 门禁 -> 证据报告 -> Codex 修阻断项 -> 重新运行
|
|
73
|
+
|
|
74
|
+
它会明确告诉你:
|
|
75
|
+
- 哪些检查通过了
|
|
76
|
+
- 哪些是阻断项
|
|
77
|
+
- 哪些生产证据缺失
|
|
78
|
+
- 哪些需要项目负责人判断
|
|
79
|
+
|
|
80
|
+
GitHub: https://github.com/xixifusi1213-gif/ai-project-maintainer
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## V2EX / Zhihu Outline
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
标题:我做了一个给 AI coding 项目的生产级半自动维护门禁
|
|
87
|
+
|
|
88
|
+
1. 背景:AI 写代码变快后,维护、测试、安全和生产证据成了新瓶颈。
|
|
89
|
+
2. 问题:个人开发者没有安全团队、SRE、DBA,但仍然要对上线负责。
|
|
90
|
+
3. 方案:把项目画像、审计计划、本地/CI 门禁和生产证据缺口串起来。
|
|
91
|
+
4. Demo:展示 init-audit、audit-plan、gate --production 的输出。
|
|
92
|
+
5. 边界:不是绝对安全,不替代最终人工审计,不托管用户数据。
|
|
93
|
+
6. 反馈:希望大家提真实项目场景、缺失检查、误报和改进方向。
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
## Reddit Targets
|
|
97
|
+
|
|
98
|
+
- `r/SideProject`
|
|
99
|
+
- `r/programming`
|
|
100
|
+
- `r/github`
|
|
101
|
+
- `r/LocalLLaMA`
|
|
102
|
+
|
|
103
|
+
Suggested title:
|
|
104
|
+
|
|
105
|
+
```text
|
|
106
|
+
I built a production-readiness gate for AI-coded projects
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Launch Checklist
|
|
110
|
+
|
|
111
|
+
- [ ] GitHub About description updated.
|
|
112
|
+
- [ ] Topics added.
|
|
113
|
+
- [ ] Social preview uploaded from `assets/social-preview.svg` or a PNG export.
|
|
114
|
+
- [ ] `v0.3.0` release created.
|
|
115
|
+
- [ ] Demo link works.
|
|
116
|
+
- [ ] README first screen explains the value in under 10 seconds.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# 升级路线图
|
|
2
|
+
|
|
3
|
+
## V2:开源维护者专业半自动平台
|
|
4
|
+
|
|
5
|
+
当前目标:
|
|
6
|
+
|
|
7
|
+
- 提供 npm/npx CLI。
|
|
8
|
+
- 保留 Codex skill 和旧 Node 脚本兼容。
|
|
9
|
+
- 使用插件化检查注册表。
|
|
10
|
+
- 使用 `yaml@2.9.0` 解析真实 YAML 配置。
|
|
11
|
+
- 生成 GitHub Actions、Dependabot、pre-commit 起步配置。
|
|
12
|
+
- 生成 JSON、Markdown、SARIF、SBOM 报告。
|
|
13
|
+
- 提供开源维护分。
|
|
14
|
+
|
|
15
|
+
V2 仍然免账号优先,不依赖 Bytebase、云、K8s、Sentry 或 Grafana。
|
|
16
|
+
|
|
17
|
+
## V2 后续增强
|
|
18
|
+
|
|
19
|
+
优先增强:
|
|
20
|
+
|
|
21
|
+
- GitHub Action 独立发布,减少 workflow 中的安装成本。
|
|
22
|
+
- OpenSSF Scorecard 更细粒度解析。
|
|
23
|
+
- MegaLinter profile 配置模板。
|
|
24
|
+
- pre-commit 官方 hook 模板。
|
|
25
|
+
- SARIF 更精确定位到文件和行。
|
|
26
|
+
- 报告转 GitHub PR comment。
|
|
27
|
+
|
|
28
|
+
## V3:平台证据接入
|
|
29
|
+
|
|
30
|
+
可选接入:
|
|
31
|
+
|
|
32
|
+
- Bytebase:SQL Review、审批流、发布状态。
|
|
33
|
+
- Sentry/Grafana/Loki/Datadog:发布后错误率、日志、trace 和事故时间线。
|
|
34
|
+
- 云平台:IAM、网络、安全组、公开入口。
|
|
35
|
+
- Kubernetes:RBAC、NetworkPolicy、PodSecurity、镜像和运行时风险。
|
|
36
|
+
|
|
37
|
+
这些能力需要账号或只读 token,所以不作为 V2 硬依赖。
|
|
38
|
+
|
|
39
|
+
## 不做
|
|
40
|
+
|
|
41
|
+
默认不做:
|
|
42
|
+
|
|
43
|
+
- 自动修改生产数据库。
|
|
44
|
+
- 主动攻击公网目标。
|
|
45
|
+
- 自动承担发布责任。
|
|
46
|
+
- 把扫描器二进制提交进仓库。
|
|
47
|
+
- 用 AI 替代维护者的最终判断。
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Local Security Gate: PASS
|
|
2
|
+
|
|
3
|
+
Root: `example/ai-coded-project`
|
|
4
|
+
Mode: strict=true, release=true, production=true
|
|
5
|
+
Open Source Maintenance Score: 82/100 (B)
|
|
6
|
+
|
|
7
|
+
## Blocking Checks
|
|
8
|
+
|
|
9
|
+
- None
|
|
10
|
+
|
|
11
|
+
## Warnings
|
|
12
|
+
|
|
13
|
+
- production audit: Critical business flows: USER_DECISION. The maintainer must declare the business flows that must not break.
|
|
14
|
+
- production audit: Error monitoring: GAP. Error monitoring evidence is missing.
|
|
15
|
+
- production audit: Production release approval: GAP. No production deployment approval evidence declared.
|
|
16
|
+
|
|
17
|
+
## Coverage Gaps
|
|
18
|
+
|
|
19
|
+
- Error monitoring: Error monitoring evidence is missing. Recommendation: declare Sentry, OpenTelemetry, or another error source in `.ai-maintainer/evidence-sources.yml`.
|
|
20
|
+
- Production logs: Production logs evidence is missing. Recommendation: declare log evidence before relying on production recovery.
|
|
21
|
+
- Production alerts: Production alerts evidence is missing. Recommendation: declare alert routing before release.
|
|
22
|
+
- Business flow tests: Critical flows are not linked to automated tests.
|
|
23
|
+
|
|
24
|
+
## Production Audit
|
|
25
|
+
|
|
26
|
+
Project Type: web
|
|
27
|
+
Database: true
|
|
28
|
+
CI: true
|
|
29
|
+
|
|
30
|
+
### Plan
|
|
31
|
+
|
|
32
|
+
- PASS Production audit intake: Project profile and evidence templates are present.
|
|
33
|
+
- USER_DECISION Critical business flows: The maintainer must declare the business flows that must not break.
|
|
34
|
+
- GAP Error monitoring: Error monitoring evidence is missing.
|
|
35
|
+
- GAP Production release approval: No production deployment approval evidence declared.
|
|
36
|
+
- PASS CI security review: GitHub Actions workflow evidence detected.
|
|
37
|
+
- GAP Database backup evidence: Database backup evidence is missing.
|
|
38
|
+
|
|
39
|
+
### User Decisions
|
|
40
|
+
|
|
41
|
+
- Critical business flows: Confirm the business flows that must not break.
|
|
42
|
+
- Business flow tests: Confirm which automated tests prove those flows.
|
|
43
|
+
|
|
44
|
+
## Tools
|
|
45
|
+
|
|
46
|
+
- node: v24.x
|
|
47
|
+
- git: git version 2.x
|
|
48
|
+
- gitleaks: available
|
|
49
|
+
- trivy: available
|
|
50
|
+
- semgrep: available
|
|
51
|
+
|
|
52
|
+
## Next Step
|
|
53
|
+
|
|
54
|
+
- Fill `business-flows.yml` with real flows.
|
|
55
|
+
- Add or document error monitoring.
|
|
56
|
+
- Add production release approval evidence.
|
|
57
|
+
- Rerun `gate --production --strict --release`.
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
# CI Dogfooding Implementation Plan
|
|
2
|
+
|
|
3
|
+
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
4
|
+
|
|
5
|
+
**Goal:** Add a real GitHub Actions CI gate so the repository dogfoods its own tests, syntax checks, package validation, and local safety gate.
|
|
6
|
+
|
|
7
|
+
**Architecture:** Use a single GitHub Actions workflow at `.github/workflows/ci.yml` that runs on pushes and pull requests to `main`. Keep the first version account-free and deterministic: install npm dependencies with `npm ci`, run Node tests and syntax checks, validate npm package contents, run `doctor` without Trivy DB as a non-blocking tool probe, and run a local gate smoke test that generates reports while treating external scanners as unavailable on day one.
|
|
8
|
+
|
|
9
|
+
**Tech Stack:** GitHub Actions, Node.js 20 and 22, npm, existing Node scripts in `ai-project-maintainer/scripts`.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
### Task 1: Add GitHub Actions CI Workflow
|
|
14
|
+
|
|
15
|
+
**Files:**
|
|
16
|
+
- Create: `.github/workflows/ci.yml`
|
|
17
|
+
- Create: `ai-project-maintainer/scripts/ci-smoke-gate.mjs`
|
|
18
|
+
|
|
19
|
+
- [ ] **Step 1: Create the workflow file**
|
|
20
|
+
|
|
21
|
+
Use this workflow content:
|
|
22
|
+
|
|
23
|
+
```yaml
|
|
24
|
+
name: CI
|
|
25
|
+
|
|
26
|
+
on:
|
|
27
|
+
push:
|
|
28
|
+
branches:
|
|
29
|
+
- main
|
|
30
|
+
pull_request:
|
|
31
|
+
branches:
|
|
32
|
+
- main
|
|
33
|
+
workflow_dispatch:
|
|
34
|
+
|
|
35
|
+
permissions:
|
|
36
|
+
contents: read
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
test:
|
|
40
|
+
name: Node ${{ matrix.node-version }}
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
strategy:
|
|
43
|
+
fail-fast: false
|
|
44
|
+
matrix:
|
|
45
|
+
node-version:
|
|
46
|
+
- 20
|
|
47
|
+
- 22
|
|
48
|
+
|
|
49
|
+
steps:
|
|
50
|
+
- name: Check out repository
|
|
51
|
+
uses: actions/checkout@v4
|
|
52
|
+
|
|
53
|
+
- name: Set up Node.js
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: ${{ matrix.node-version }}
|
|
57
|
+
cache: npm
|
|
58
|
+
|
|
59
|
+
- name: Install dependencies
|
|
60
|
+
run: npm ci
|
|
61
|
+
|
|
62
|
+
- name: Run tests
|
|
63
|
+
run: npm test
|
|
64
|
+
|
|
65
|
+
- name: Check script syntax
|
|
66
|
+
run: npm run check
|
|
67
|
+
|
|
68
|
+
- name: Validate package contents
|
|
69
|
+
run: npm pack --dry-run
|
|
70
|
+
|
|
71
|
+
- name: Probe local tool availability
|
|
72
|
+
continue-on-error: true
|
|
73
|
+
run: node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
|
|
74
|
+
|
|
75
|
+
- name: Run local gate smoke test
|
|
76
|
+
run: node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
|
|
77
|
+
|
|
78
|
+
- name: Upload gate reports
|
|
79
|
+
if: always()
|
|
80
|
+
uses: actions/upload-artifact@v4
|
|
81
|
+
with:
|
|
82
|
+
name: security-reports-node-${{ matrix.node-version }}
|
|
83
|
+
path: reports/
|
|
84
|
+
if-no-files-found: ignore
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
- [ ] **Step 2: Validate workflow can be parsed as YAML**
|
|
88
|
+
|
|
89
|
+
Run:
|
|
90
|
+
|
|
91
|
+
```powershell
|
|
92
|
+
node -e "import('yaml').then(({parse})=>{const fs=require('node:fs'); parse(fs.readFileSync('.github/workflows/ci.yml','utf8')); console.log('workflow yaml ok')})"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Expected: `workflow yaml ok`
|
|
96
|
+
|
|
97
|
+
### Task 2: Update README Trust Signals
|
|
98
|
+
|
|
99
|
+
**Files:**
|
|
100
|
+
- Modify: `README.md`
|
|
101
|
+
|
|
102
|
+
- [ ] **Step 1: Replace the static CI badge**
|
|
103
|
+
|
|
104
|
+
Replace:
|
|
105
|
+
|
|
106
|
+
```markdown
|
|
107
|
+

|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
With:
|
|
111
|
+
|
|
112
|
+
```markdown
|
|
113
|
+
[](https://github.com/xixifusi1213-gif/ai-project-maintainer/actions/workflows/ci.yml)
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
- [ ] **Step 2: Fix the README demo link separator**
|
|
117
|
+
|
|
118
|
+
Replace the corrupted link separator line with:
|
|
119
|
+
|
|
120
|
+
```markdown
|
|
121
|
+
[See the demo](docs/DEMO.md) · [中文演示](docs/DEMO.zh-CN.md) · [Production audit docs](docs/PRODUCTION-AUDIT.zh-CN.md)
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Task 3: Verify Locally
|
|
125
|
+
|
|
126
|
+
**Files:**
|
|
127
|
+
- No additional files.
|
|
128
|
+
|
|
129
|
+
- [ ] **Step 1: Run tests**
|
|
130
|
+
|
|
131
|
+
Run:
|
|
132
|
+
|
|
133
|
+
```powershell
|
|
134
|
+
npm test
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Expected: all tests pass.
|
|
138
|
+
|
|
139
|
+
- [ ] **Step 2: Run syntax checks**
|
|
140
|
+
|
|
141
|
+
Run:
|
|
142
|
+
|
|
143
|
+
```powershell
|
|
144
|
+
npm run check
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
Expected: syntax check passes.
|
|
148
|
+
|
|
149
|
+
- [ ] **Step 3: Validate package contents**
|
|
150
|
+
|
|
151
|
+
Run:
|
|
152
|
+
|
|
153
|
+
```powershell
|
|
154
|
+
npm pack --dry-run
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Expected: npm reports package `ai-project-maintainer@0.3.0` without errors.
|
|
158
|
+
|
|
159
|
+
- [ ] **Step 4: Run CI-equivalent local checks**
|
|
160
|
+
|
|
161
|
+
Run:
|
|
162
|
+
|
|
163
|
+
```powershell
|
|
164
|
+
node ai-project-maintainer/scripts/doctor.mjs --no-trivy-db
|
|
165
|
+
node ai-project-maintainer/scripts/ci-smoke-gate.mjs . reports/security-report.json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Expected: commands exit successfully and reports are generated.
|
|
169
|
+
|
|
170
|
+
### Task 4: Publish
|
|
171
|
+
|
|
172
|
+
**Files:**
|
|
173
|
+
- Commit: `.github/workflows/ci.yml`, `README.md`, `ai-project-maintainer/scripts/ci-smoke-gate.mjs`, `docs/superpowers/plans/2026-06-29-ci-dogfooding.md`
|
|
174
|
+
|
|
175
|
+
- [ ] **Step 1: Commit changes**
|
|
176
|
+
|
|
177
|
+
Run:
|
|
178
|
+
|
|
179
|
+
```powershell
|
|
180
|
+
git add .github/workflows/ci.yml README.md ai-project-maintainer/scripts/ci-smoke-gate.mjs docs/superpowers/plans/2026-06-29-ci-dogfooding.md
|
|
181
|
+
git commit -m "Add CI dogfooding workflow"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
- [ ] **Step 2: Push to GitHub**
|
|
185
|
+
|
|
186
|
+
Run:
|
|
187
|
+
|
|
188
|
+
```powershell
|
|
189
|
+
git push origin HEAD:main
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
- [ ] **Step 3: Check workflow registration**
|
|
193
|
+
|
|
194
|
+
Run:
|
|
195
|
+
|
|
196
|
+
```powershell
|
|
197
|
+
gh workflow list --repo xixifusi1213-gif/ai-project-maintainer
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Expected: workflow list includes `CI`.
|