@mcptoolshop/housekeeping 1.3.1 → 1.5.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/CHANGELOG.md +69 -0
- package/README.es.md +171 -81
- package/README.fr.md +161 -76
- package/README.hi.md +123 -67
- package/README.it.md +184 -81
- package/README.ja.md +116 -72
- package/README.md +91 -23
- package/README.pt-BR.md +179 -93
- package/README.zh.md +122 -75
- package/housekeeping.config.example.json +3 -1
- package/package.json +1 -1
- package/rules/atlas-map.md +6 -1
- package/rules/github-actions.md +7 -3
- package/src/analyze.mjs +148 -41
- package/src/cli.mjs +85 -2
- package/src/collect.mjs +78 -5
- package/src/config.mjs +22 -4
- package/src/load.mjs +62 -6
- package/src/report.mjs +13 -9
- package/src/schema.sql +35 -1
- package/src/workflow-risks.mjs +160 -2
package/README.ja.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<a href="README.md">English</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
|
|
2
|
+
<a href="README.md">English</a> | <a href="README.ja.md">日本語</a> | <a href="README.zh.md">中文</a> | <a href="README.es.md">Español</a> | <a href="README.fr.md">Français</a> | <a href="README.hi.md">हिन्दी</a> | <a href="README.it.md">Italiano</a> | <a href="README.pt-BR.md">Português (BR)</a>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<p align="center">
|
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
An operational-health warehouse for a GitHub organization.<br>
|
|
13
|
-
One sweep, one SQLite database, findings you can argue with
|
|
13
|
+
One sweep, one SQLite database, findings you can argue with,<br>
|
|
14
|
+
and the whole-organization view an AI agent needs to coordinate every repository.
|
|
14
15
|
</p>
|
|
15
16
|
|
|
16
17
|
<p align="center">
|
|
@@ -20,43 +21,101 @@
|
|
|
20
21
|
<a href="https://mcp-tool-shop-org.github.io/housekeeping/handbook/"><img src="https://img.shields.io/badge/Handbook-read-blue" alt="Handbook" /></a>
|
|
21
22
|
</p>
|
|
22
23
|
|
|
23
|
-
1
|
|
24
|
+
1回のスキャンで、各リポジトリのCIステータス、未解決の問題、プルリクエスト、リリース、バージョンタグ、ワークフローファイル、ブランチ保護、セキュリティアラート、ロックファイル、およびActionsの課金をSQLiteに収集し、次に、それらすべてを記述されたルールに対して監査します。
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
これにより、組織全体に対して、以下の質問に一度に回答できます。
|
|
26
27
|
|
|
27
28
|
- どのデフォルトブランチが問題があり、それが壊れたメインラインまたは古い履歴ですか?
|
|
28
29
|
- 必須チェックが何も実行されていないために、どのプルリクエストもマージできませんか?
|
|
29
|
-
-
|
|
30
|
+
- リポジトリ自体の設定で、どのデプロイが拒否されていますか?
|
|
30
31
|
- `package.json`、Gitタグ、およびnpmレジストリは、どこで乖離していますか?
|
|
31
|
-
- どのワークフローがActions
|
|
32
|
-
-
|
|
32
|
+
- どのワークフローがActionsのコストルールに違反し、そのコストはいくらで、どのジョブがそのコストを負担しましたか?
|
|
33
|
+
- どのリポジトリが、GitHub自体のアラートカウントでは検出されないアドバイザリーを保持していますか?
|
|
33
34
|
|
|
34
35
|
これは監査ツールであり、修正ツールではありません。GitHubを読み取り、何も変更しません。
|
|
35
36
|
|
|
37
|
+
## 各リポジトリに1つのエージェント
|
|
38
|
+
|
|
39
|
+
数十のリポジトリを持つ組織では、その状態が保存されている単一の場所はありません。housekeepingがその場所であり、そのMCPサーバーである`hk-mcp`が、AIエージェントにそれを渡します。これにより、1つのエージェントが組織全体のコーディネーターとして機能できます。
|
|
40
|
+
|
|
41
|
+
1. **スキャン。** `hk refresh`は、各リポジトリのスナップショットを1つ取得します。
|
|
42
|
+
2. **トリアージ。** エージェントは、何が問題があり、何がブロックされており、何が悪化しているかを尋ね、壊れたメインラインと古い履歴、および競合が発生しているプルリクエストと停止しているプルリクエストを区別できる回答を取得します。
|
|
43
|
+
3. **一連の処理を計画。** 1つの`hk_sql`クエリで、同じ形状を持つすべてのリポジトリを見つけ、修正を1つのリポジトリあたり1つのプルリクエストにすることで、修正作業が効率化されます。
|
|
44
|
+
4. **作業の実行。** housekeepingは書き込みを行いません。エージェントは、独自のツールと独自の権限を使用して、プルリクエストを開き、レビューを行います。
|
|
45
|
+
5. **検証。** 再度スキャンします。問題が解決されているか、またはされていないかを確認し、2つのスナップショット間の変更をクエリとして実行します。
|
|
46
|
+
|
|
47
|
+
エージェントが1回の呼び出しで回答する質問:
|
|
48
|
+
|
|
49
|
+
- どのデフォルトブランチが問題があり、どのジョブとステップが原因ですか?
|
|
50
|
+
- どのプルリクエストもマージできず、トリガーまたは競合が原因ですか?
|
|
51
|
+
- どのリポジトリが、GitHubではアラートが表示されないプロダクションアドバイザリーを保持していますか?
|
|
52
|
+
- どのスケジュールされたワークフローがスケジュールルールに違反し、どのように違反していますか?
|
|
53
|
+
- Actionsのコストはいくらで、どのジョブがそのコストを負担しましたか?
|
|
54
|
+
- 最後のスキャン以降、何が変更されましたか?
|
|
55
|
+
|
|
56
|
+
| ツール | 回答内容 |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `hk_summary` | 最新のスキャンにおける合計:リポジトリ、問題、プルリクエスト、ワークフロー、検出結果。 |
|
|
59
|
+
| `hk_findings` | コード、重大度、カテゴリ、またはリポジトリごとの検出結果。フィルターを適用していない場合のコードごとのカウント。問題のあるメインラインの検出結果は、問題を引き起こしたジョブとステップの名前を示します。 |
|
|
60
|
+
| `hk_ci` | デフォルトブランチが問題のあるリポジトリと、失敗したワークフロー。また、失敗したスケジュール、失敗したプルリクエストブランチ、およびCIを実行していないリポジトリ。 |
|
|
61
|
+
| `hk_repo` | 完全な1つのリポジトリ:検出結果、ワークフロー、未解決のプルリクエストと問題。 |
|
|
62
|
+
| `hk_backlog` | 組織全体の未解決のプルリクエストまたは問題(古いものから)。 |
|
|
63
|
+
| `hk_health` | リポジトリごとの健全性スコア(最も低いものから)。 |
|
|
64
|
+
| `hk_cost` | リポジトリ、ワークフロー、またはジョブごとのActionsの消費量(総額と純額)。 |
|
|
65
|
+
| `hk_sql` | 読み取り専用の1つの`SELECT`または`WITH`ステートメントをデータウェアハウスに対して実行します。 |
|
|
66
|
+
| `hk_schema` | `hk_sql`クエリを記述するためのテーブルと列。 |
|
|
67
|
+
|
|
68
|
+
すべての回答は、最新のスナップショットから取得され、読み取り専用で開かれます。失敗した呼び出しは、構造化されたエラーを返し、スタックトレースは返しません。
|
|
69
|
+
|
|
70
|
+
### 接続
|
|
71
|
+
|
|
72
|
+
```json
|
|
73
|
+
{
|
|
74
|
+
"mcpServers": {
|
|
75
|
+
"housekeeping": { "command": "hk-mcp", "env": { "HK_HOME": "/path/to/warehouse" } },
|
|
76
|
+
"atlas": { "command": "atlas", "args": ["mcp"] }
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
`HK_HOME`は、スキャンを開始するディレクトリです。クローンから、`"command": "node", "args": ["/path/to/housekeeping/src/mcp.mjs"]`を使用します。2番目のサーバーは[Atlas](https://github.com/dogfood-lab/testing-os/tree/main/packages/atlas)であり、これは1つのリポジトリに対して同じエージェントに回答します(以下を参照)。Windowsでは、グローバルにインストールされたコマンドを`cmd /c`を通じて起動します。
|
|
82
|
+
|
|
83
|
+
## housekeepingとAtlas
|
|
84
|
+
|
|
85
|
+
[Atlas](https://github.com/dogfood-lab/testing-os/tree/main/packages/atlas)
|
|
86
|
+
(`@dogfood-lab/atlas`)は、あるリポジトリ、つまりその構成要素と、ワークフローが実行、公開、デプロイする内容をマッピングします。このマッピングは、`atlas/`としてコミットされ、CIでチェックインされます。ハウスキーピングは、組織の視点です。これら2つは、連携して機能するように設計されています。
|
|
87
|
+
|
|
88
|
+
- **すべてのマップをスキャン。** スキャンは、各リポジトリのコミットされたマップと、その他のすべての情報を読み取り、どのリポジトリにマップがないか、どのリポジトリが`atlas check`を実行していないか、およびどのリポジトリが、組織の残りの部分で使用されているものとは異なるエンジンを保持しているかを報告します。
|
|
89
|
+
- **問題のある実行がどこで発生したか。** デフォルトブランチに問題がある場合、検出結果は、問題を引き起こしたジョブとステップの名前を示し、マップを通じて、そのステップが実行するコマンドも示されるため、修正は適切なファイルから開始できます。
|
|
90
|
+
- **マップからのデプロイメントの事実。** ジョブがデプロイする環境は、マップに記録されている環境から取得されるため、両方のツールはワークフローを同じ方法で読み取ります。
|
|
91
|
+
- **フリート全体での警告。** Atlasは、実行前に問題が発生するワークフローステップ(たとえば、ジョブがインストールするよりも新しいランタイムを必要とするツール)をフラグします。レポートには、これらがすべてのリポジトリに対して一度にリストされます。
|
|
92
|
+
|
|
93
|
+
両方のサーバーを持つエージェントは、「これらの12個のリポジトリがブロックされています」(housekeeping)から、「これはワークフロー、ジョブ、および変更が到達するファイルです」(Atlas)へと移行し、各リポジトリを手動で開く必要はありません。
|
|
94
|
+
|
|
36
95
|
## この構造になっている理由
|
|
37
96
|
|
|
38
97
|
| レイヤー | 選択 | 理由 |
|
|
39
98
|
|---|---|---|
|
|
40
|
-
|
|
|
41
|
-
| 収集 | GitHub GraphQL、ページング | 1
|
|
99
|
+
| トランスポート | `gh` CLI | すでにトークンを保持しています。ツールは、認証情報を保存または要求しません。 |
|
|
100
|
+
| 収集 | GitHub GraphQL、ページング | 1つのクエリは、リポジトリのページに関するメタデータ、未解決の問題、未解決のプルリクエスト、リリース、およびファイルツリーを返します。タイムアウトが発生し続けるページは、半分に分割され、同じカーソルから再要求されます。 |
|
|
42
101
|
| Actionsの実行 | REST | GraphQLにはActionsのインターフェースはありません。 |
|
|
43
|
-
| Actionsのコスト |
|
|
44
|
-
|
|
|
45
|
-
| ストレージ | 組み込みの`node:sqlite
|
|
46
|
-
|
|
|
47
|
-
| スキャンログ | `data/sweeps.jsonl` | 1
|
|
102
|
+
| Actionsのコスト | 課金APIと、ジョブごとの期間 | 請求書にはどのリポジトリが記載されており、どのワークフローが実行されたかはジョブにのみ記載されます。GitHubの`/timing`エンドポイントはゼロを返します。そのため、ジョブごとの合計が再計算され、その後、請求書と照合されます。 |
|
|
103
|
+
| ランナー料金 | 請求書から読み取ります | 請求される料金は、リスト価格と異なる場合があり、ソースコード内の定数はすべての数値を誤って表示します。 |
|
|
104
|
+
| ストレージ | 組み込みの`node:sqlite`を通じてSQLiteにアクセスします | ネイティブのビルドステップはありません。 |
|
|
105
|
+
| 信頼できる情報源 | `data/snapshots/*.json` | 生のデータで、差分を比較でき、追加のみ可能です。データベースはそこから派生します。`npm run rebuild`はオフラインでデータベースを再構築します。 |
|
|
106
|
+
| スキャンログ | `data/sweeps.jsonl` | 1回のスキャンにつき1行。失敗したスキャンと新しい情報が見つからなかったスキャンも含まれます。 |
|
|
48
107
|
|
|
49
|
-
|
|
108
|
+
スナップショットは不変で累積的であるため、2つの日付間のドリフトは`JOIN`です。
|
|
50
109
|
|
|
51
110
|
## 要件
|
|
52
111
|
|
|
53
|
-
- Node.js 22.5
|
|
54
|
-
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
- Windows
|
|
59
|
-
|
|
112
|
+
- Node.js 22.5 以降。
|
|
113
|
+
- [GitHub CLI]([https://cli.github.com/])に、[`gh auth status`]としてログイン
|
|
114
|
+
組織の情報を閲覧できるアカウント。請求書やセキュリティアラートの確認が可能。
|
|
115
|
+
対応するアクセス権が必要です。そうでない場合、測定を行っても「測定不能」と記録されます。
|
|
116
|
+
処理を続行します。必要な権限が見つからない場合でも、エラーとして記録することはありません。
|
|
117
|
+
- WindowsまたはLinux。開発はWindowsで行い、テストはLinux上で実行します。
|
|
118
|
+
CIの機能であるmacOSは動作するはずですが、テストは行われていません。
|
|
60
119
|
|
|
61
120
|
## 使用方法
|
|
62
121
|
|
|
@@ -66,9 +125,9 @@ mkdir warehouse && cd warehouse # housekeeping keeps its data here
|
|
|
66
125
|
hk refresh your-org # collect, load, analyze, write reports/AUDIT-<date>.md
|
|
67
126
|
```
|
|
68
127
|
|
|
69
|
-
スキャン間で設定を保持するには、そのディレクトリに`housekeeping.config.json`を配置します(構成を参照)。その後、`hk refresh
|
|
128
|
+
スキャン間で設定を保持するには、そのディレクトリに`housekeeping.config.json`を配置します(構成を参照)。その後、`hk refresh`には引数が必要ありません。
|
|
70
129
|
|
|
71
|
-
|
|
130
|
+
または、クローンから実行すると、そのデータはクローンに保存されます。
|
|
72
131
|
|
|
73
132
|
```bash
|
|
74
133
|
git clone https://github.com/mcp-tool-shop-org/housekeeping.git
|
|
@@ -88,6 +147,8 @@ hk findings # findings grouped by severity and code
|
|
|
88
147
|
hk health # per-repository health score, worst first
|
|
89
148
|
hk repo <name> # one repository in full
|
|
90
149
|
hk prs # every open pull request by age
|
|
150
|
+
hk branches # branches by state: merged, moved after merge, no PR
|
|
151
|
+
hk watch # open PRs, alerts and branches for a short watch list
|
|
91
152
|
hk versions # package.json against git tag against npm
|
|
92
153
|
hk actions # every workflow and its rule flags
|
|
93
154
|
hk cost # Actions cost, gross and net side by side
|
|
@@ -95,17 +156,17 @@ hk sql "SELECT ..." # one read-only statement
|
|
|
95
156
|
hk help # every command and flag
|
|
96
157
|
```
|
|
97
158
|
|
|
98
|
-
`npm link`がないクローンでは、各`hk <command>`は`node src/cli.mjs <command
|
|
159
|
+
`npm link`がないクローンでは、各`hk <command>`は`node src/cli.mjs <command>`です。
|
|
99
160
|
|
|
100
|
-
`npm run rebuild
|
|
161
|
+
`npm run rebuild`は、ディスク上の既存のスナップショットからデータベースとレポートを再派生させ、ネットワークアクセスは行いません。
|
|
101
162
|
|
|
102
|
-
|
|
163
|
+
完全なスキャンでは、数百回のAPI呼び出しが行われます。`refresh`をループで実行しないでください。
|
|
103
164
|
|
|
104
|
-
結果は標準出力に出力され、進行状況とエラーは標準エラーに出力されます。すべてのエラーには、コードとヒントが出力されます。終了コード:0(正常)、1(ユーザーエラー)、2(実行時エラー)、3
|
|
165
|
+
結果は標準出力に出力され、進行状況とエラーは標準エラーに出力されます。すべてのエラーには、コードとヒントが出力されます。終了コード:0(正常)、1(ユーザーエラー)、2(実行時エラー)、3(部分的な完了 - スキャンは完了しましたが、ギャップがあります)。
|
|
105
166
|
|
|
106
167
|
## 構成
|
|
107
168
|
|
|
108
|
-
|
|
169
|
+
ハウスキーピングが実行されるディレクトリにある`housekeeping.config.json`(下記参照):
|
|
109
170
|
|
|
110
171
|
```json
|
|
111
172
|
{
|
|
@@ -114,12 +175,12 @@ hk help # every command and flag
|
|
|
114
175
|
}
|
|
115
176
|
```
|
|
116
177
|
|
|
117
|
-
- `org
|
|
118
|
-
- `metaRepos
|
|
178
|
+
- `org`はスキャンする組織です。`hk refresh <org>`でオーバーライドできます。どちらも指定されていない場合、スキャンは開始されません。
|
|
179
|
+
- `metaRepos`は、組織のデフォルト、アセット、またはツールを保持するリポジトリであり、出荷される製品ではありません。これらは、製品にのみ意味がある結果(README、LICENSEなどのファイルがない、ワークフローがない、リリースがない)から除外されます。
|
|
119
180
|
|
|
120
181
|
形式が正しくないファイルはエラーであり、サイレントなデフォルトになることはありません。不明なキー、誤った型、または破損したJSONは、実行を停止します。
|
|
121
182
|
|
|
122
|
-
|
|
183
|
+
クローンから実行すると、ハウスキーピングは`data/`、`reports/`、および構成ファイルをクローンに保持します。インストールされたパッケージとして実行すると、実行するディレクトリまたは`HK_HOME`(設定されている場合)に保持されます。
|
|
123
184
|
|
|
124
185
|
環境:`HK_HOME`(データ、レポート、および構成が保存される場所)、`HK_CONFIG`(構成パス)、`HK_DB`(データベースパス)、`HK_LOG`(`silent`、`normal`、`verbose`、または`debug`)、`HK_COST_REPOS`、および`HK_COST_BUDGET`(ジョブごとのコストの範囲)、`GH_PATH`(`gh`へのパス)。
|
|
125
186
|
|
|
@@ -127,60 +188,43 @@ hk help # every command and flag
|
|
|
127
188
|
|
|
128
189
|
**スキャンによって書き込まれる内容は機密情報です。`data/`または`reports/`をパブリックリポジトリにコミットしないでください。**
|
|
129
190
|
|
|
130
|
-
|
|
191
|
+
スナップショットには、プライベートリポジトリの名前と説明、パッケージ名とともに開いているすべてのセキュリティアラート、ワークフローファイル、およびActionsの請求情報が記録されます。GitHubは、意図的にパブリックリポジトリのセキュリティアラートを、そのリポジトリのメンテナー以外のすべてのユーザーから隠します。公開されたスナップショットは、そのリストを公開することになります。
|
|
131
192
|
|
|
132
193
|
このリポジトリの`.gitignore`は、`data/`、`reports/`、および`housekeeping.config.json`を除外します。履歴を保持することがスナップショットの目的であるため、独自の**プライベート**リポジトリからツールを実行し、そこにコミットしてください。
|
|
133
194
|
|
|
134
|
-
## MCPサーバー
|
|
135
|
-
|
|
136
|
-
`hk-mcp`(またはクローン内の`npm run mcp`)は、標準入出力(stdio)を介してデータストアにアクセスするため、アシスタントは数メガバイトのデータ全体を読み込むことなく質問をすることができます。
|
|
137
|
-
|
|
138
|
-
`hk_summary` · `hk_findings` · `hk_ci` · `hk_repo` · `hk_backlog` · `hk_health` · `hk_cost` · `hk_sql` · `hk_schema`
|
|
139
|
-
|
|
140
|
-
```json
|
|
141
|
-
{
|
|
142
|
-
"mcpServers": {
|
|
143
|
-
"housekeeping": { "command": "hk-mcp", "env": { "HK_HOME": "/path/to/warehouse" } }
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
`HK_HOME`は、スキャンを開始するディレクトリです。クローンから実行する場合は、代わりに`"command": "node", "args": ["/path/to/housekeeping/src/mcp.mjs"]`を使用します。
|
|
149
|
-
|
|
150
|
-
`hk_sql`は、単一の`SELECT`または`WITH`ステートメントを受け入れ、データベースを読み取り専用で開きます。失敗した呼び出しは、スタックトレースではなく、構造化されたエラーを返します。
|
|
151
|
-
|
|
152
195
|
## 検出結果
|
|
153
196
|
|
|
154
|
-
ルールは`src/analyze.mjs
|
|
197
|
+
ルールは`src/analyze.mjs`に保存されます。各ルールは、適用するルールを引用するため、検出結果は標準に対して議論可能であり、個人の好みに基づくものではありません。このリポジトリに同梱されているルールは、[`rules/`](rules/)にあります。
|
|
155
198
|
|
|
156
|
-
- [`rules/github-actions.md`](rules/github-actions.md)
|
|
157
|
-
- [`rules/shipcheck-product-standards.md`](rules/shipcheck-product-standards.md)
|
|
158
|
-
- [`rules/repo-first.md`](rules/repo-first.md)
|
|
159
|
-
- [`rules/atlas-map.md`](rules/atlas-map.md)
|
|
199
|
+
- [`rules/github-actions.md`](rules/github-actions.md):パスフィルター、ランナー、マトリックスサイズ、ワークフローファイルの制限、同時実行。
|
|
200
|
+
- [`rules/shipcheck-product-standards.md`](rules/shipcheck-product-standards.md):CIは合格している必要がある、出荷ゲート、バージョン。
|
|
201
|
+
- [`rules/repo-first.md`](rules/repo-first.md):デフォルトブランチ。
|
|
202
|
+
- [`rules/atlas-map.md`](rules/atlas-map.md):各リポジトリのコミットされたマップ。CIでチェックされます。
|
|
160
203
|
|
|
161
|
-
|
|
204
|
+
これらは、ある組織の標準です。異なる場合は、ルールファイルとルールを一緒に変更してください。
|
|
162
205
|
|
|
163
|
-
|
|
206
|
+
ルールは、似たもの同士を区別するように注意深く設計されています。それらをまとめてしまうと、ノイズが発生するからです。
|
|
164
207
|
|
|
165
|
-
-
|
|
166
|
-
-
|
|
167
|
-
-
|
|
168
|
-
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
208
|
+
- **デフォルトの赤いブランチは、赤いプルリクエストのブランチではありません。** 依存関係の更新に失敗した Dependabot のブランチは、未処理のタスクです。デフォルトブランチで `push` の実行が失敗した場合、それは問題です。どちらであるかは、実行イベントによって決まります。
|
|
209
|
+
- **履歴は問題ではありません。** リリース専用のトリガーに移行したワークフローは、デフォルトブランチでの最後の失敗を永久に保持します。削除されたワークフローは、その実行履歴を保持します。どちらも、現在の欠陥ではありません。
|
|
210
|
+
- **実行できないチェックは、ここで実行されなかったチェックではありません。** 片方は、その要件を削除すべきだと言い、もう片方は、トリガーを修正すべきだと言います。これらの修正は、互いに矛盾しています。
|
|
211
|
+
- **トリガーがスキップしたプルリクエストは、競合が発生したプルリクエストではありません。** GitHub は、競合が発生しているプルリクエストに対して、プルリクエストのワークフローを実行しません。そのため、欠落しているチェックは、トリガーについて何も示唆しません。この場合は、リベースが必要です。
|
|
212
|
+
- **失敗した実行は、キャンセルされた実行ではありません。** `cancel-in-progress` は、古い実行を終了させるために存在します。そのため、キャンセルされた時間は、通常、同時実行ルールが機能していることを示します。
|
|
213
|
+
- **総コストは、純コストではありません。** GitHub は、パブリックリポジトリを定価で計測し、割引を適用してゼロにします。総コストは実際の計算資源であり、純コストは実際の費用です。これらは決して合計されません。
|
|
214
|
+
- **計測されていないものは、問題ありません。** リポジトリ GitHub は、スキャンレポートでゼロ件の警告を表示していません。コストのチェックに達しなかったリポジトリには、コストの行がありません。どちらも、不明として報告されます。
|
|
171
215
|
|
|
172
|
-
|
|
216
|
+
重大度は、ヘルススコアを決定します。重大なものは40、高いものは15、中程度のものは6、低いものは2、情報提供のみのものは0であり、100から差し引かれます。スコアは、品質ではなく、注意の優先順位を示します。
|
|
173
217
|
|
|
174
|
-
[ハンドブック](https://mcp-tool-shop-org.github.io/housekeeping/handbook/)
|
|
218
|
+
[ハンドブック](https://mcp-tool-shop-org.github.io/housekeeping/handbook/)には、すべての調査結果、コマンド、エラーコード、およびテーブルが記載されています。
|
|
175
219
|
|
|
176
220
|
## セキュリティ
|
|
177
221
|
|
|
178
|
-
- **読み取り専用。** コレクターは、GraphQL
|
|
179
|
-
- **認証情報なし。** 認証は、`gh
|
|
180
|
-
-
|
|
181
|
-
-
|
|
222
|
+
- **読み取り専用。** コレクターは、GraphQL個のクエリとREST `GET`を送信します。設定をマージ、プッシュ、リリース、公開、または編集することはありません。
|
|
223
|
+
- **認証情報なし。** 認証は、`gh`ですでに保持されているものを使用します。それに関する情報はディスクに書き込まれません。
|
|
224
|
+
- **テレメトリなし。** 連絡するホストは、`gh`を通じてGitHub APIにアクセスし、バージョンとアドバイザリを検索するためにnpmレジストリにアクセスするだけです。
|
|
225
|
+
- **保存する内容**が機密性の高い部分です。「データを非公開に保つ」を参照してください。
|
|
182
226
|
|
|
183
|
-
[SECURITY.md]
|
|
227
|
+
脆弱性を[SECURITY.md](SECURITY.md)に記載されている方法で報告してください。
|
|
184
228
|
|
|
185
229
|
## テスト
|
|
186
230
|
|
|
@@ -188,7 +232,7 @@ hk help # every command and flag
|
|
|
188
232
|
npm test
|
|
189
233
|
```
|
|
190
234
|
|
|
191
|
-
|
|
235
|
+
すべてのルールは、両方向でテストされます。つまり、トリガーされるべき形状と、トリガーされるべきでない隣接する形状です。別の検証ツールは、独自のトランスポートを通じて、ライブのGitHubから調査結果のサンプルを再生成し、データベースまたはネットワークがない場合は、エラーメッセージを大きく表示します。
|
|
192
236
|
|
|
193
237
|
## ライセンス
|
|
194
238
|
|
package/README.md
CHANGED
|
@@ -10,7 +10,8 @@
|
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
12
12
|
An operational-health warehouse for a GitHub organization.<br>
|
|
13
|
-
One sweep, one SQLite database, findings you can argue with
|
|
13
|
+
One sweep, one SQLite database, findings you can argue with,<br>
|
|
14
|
+
and the whole-organization view an AI agent needs to coordinate every repository.
|
|
14
15
|
</p>
|
|
15
16
|
|
|
16
17
|
<p align="center">
|
|
@@ -36,6 +37,90 @@ It answers, for the whole organization at once:
|
|
|
36
37
|
|
|
37
38
|
It is an audit instrument, not a fixer. It reads GitHub and changes nothing.
|
|
38
39
|
|
|
40
|
+
## An agent over every repository
|
|
41
|
+
|
|
42
|
+
An organization with dozens of repositories has no single place where its
|
|
43
|
+
state lives. housekeeping is that place, and its MCP server, `hk-mcp`, hands
|
|
44
|
+
it to an AI agent. With it, one agent can act as the coordinator for the whole
|
|
45
|
+
organization:
|
|
46
|
+
|
|
47
|
+
1. **Sweep.** `hk refresh` takes one snapshot of every repository.
|
|
48
|
+
2. **Triage.** The agent asks what is red, what is blocked and what got worse,
|
|
49
|
+
and gets answers that already tell a broken mainline from stale history, and
|
|
50
|
+
a stuck pull request from a conflicted one.
|
|
51
|
+
3. **Plan a wave.** One `hk_sql` query finds every repository with the same
|
|
52
|
+
shape, so a fix becomes one pull request per repository instead of a hunt.
|
|
53
|
+
4. **Do the work.** housekeeping never writes. The agent opens pull requests
|
|
54
|
+
with its own tools, under its own permissions and your review.
|
|
55
|
+
5. **Verify.** Sweep again. The finding is gone or it is not, and the change
|
|
56
|
+
between two snapshots is a query.
|
|
57
|
+
|
|
58
|
+
Questions an agent answers in a call or two:
|
|
59
|
+
|
|
60
|
+
- Which default branches are red, and which job and step broke?
|
|
61
|
+
- Which pull requests can never merge, and is the trigger or a conflict to blame?
|
|
62
|
+
- Which repositories carry a production advisory that GitHub shows no alert for?
|
|
63
|
+
- Which scheduled workflows break the rules for schedules, and how?
|
|
64
|
+
- What did Actions cost, and which job spent it?
|
|
65
|
+
- What changed since the last sweep?
|
|
66
|
+
|
|
67
|
+
| Tool | What it answers |
|
|
68
|
+
|---|---|
|
|
69
|
+
| `hk_summary` | Totals for the newest sweep: repositories, issues, pull requests, workflows, findings. |
|
|
70
|
+
| `hk_findings` | Findings by code, severity, category or repository; counts by code when unfiltered. A red mainline's finding names the job and step that broke. |
|
|
71
|
+
| `hk_ci` | Repositories whose default branch is red and the workflows that failed; also failing schedules, failing pull-request branches, and repositories with no CI. |
|
|
72
|
+
| `hk_repo` | One repository in full: findings, workflows, open pull requests and issues. |
|
|
73
|
+
| `hk_backlog` | Open pull requests or issues across the organization, oldest first. |
|
|
74
|
+
| `hk_health` | A health score per repository, worst first. |
|
|
75
|
+
| `hk_cost` | Actions spend by repository, workflow or job, gross and net apart. |
|
|
76
|
+
| `hk_sql` | One read-only `SELECT` or `WITH` statement against the warehouse. |
|
|
77
|
+
| `hk_schema` | The tables and columns, for writing `hk_sql` queries. |
|
|
78
|
+
|
|
79
|
+
Every answer comes from the newest snapshot, opened read-only. A failing call
|
|
80
|
+
returns a structured error, never a stack trace.
|
|
81
|
+
|
|
82
|
+
### Connect it
|
|
83
|
+
|
|
84
|
+
```json
|
|
85
|
+
{
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"housekeeping": { "command": "hk-mcp", "env": { "HK_HOME": "/path/to/warehouse" } },
|
|
88
|
+
"atlas": { "command": "atlas", "args": ["mcp"] }
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`HK_HOME` is the directory you sweep from. From a clone, use
|
|
94
|
+
`"command": "node", "args": ["/path/to/housekeeping/src/mcp.mjs"]`. The second
|
|
95
|
+
server is [Atlas](https://github.com/dogfood-lab/testing-os/tree/main/packages/atlas),
|
|
96
|
+
which answers the same agent about one repository at a time (see below). On
|
|
97
|
+
Windows, start a globally installed command through `cmd /c`.
|
|
98
|
+
|
|
99
|
+
## housekeeping and Atlas
|
|
100
|
+
|
|
101
|
+
[Atlas](https://github.com/dogfood-lab/testing-os/tree/main/packages/atlas)
|
|
102
|
+
(`@dogfood-lab/atlas`) maps one repository: its parts, and its doors, meaning
|
|
103
|
+
every workflow with what it runs, publishes and deploys. The map is committed
|
|
104
|
+
as `atlas/` and checked in CI. housekeeping is the organization view. The two
|
|
105
|
+
are built to work together.
|
|
106
|
+
|
|
107
|
+
- **Every map, swept.** A sweep reads each repository's committed map along
|
|
108
|
+
with everything else, and reports which repositories have none, which never
|
|
109
|
+
run `atlas check`, and which carry an engine behind the one the rest of the
|
|
110
|
+
organization pins.
|
|
111
|
+
- **Where a red run broke.** When a default branch is red, the finding names
|
|
112
|
+
the job and step that failed and, through the map, the command that step
|
|
113
|
+
runs, so the repair starts in the right file.
|
|
114
|
+
- **Deploy facts from the map.** The environment a job deploys to is taken from
|
|
115
|
+
the map where it records one, so both tools read a workflow the same way.
|
|
116
|
+
- **Warnings across the fleet.** Atlas flags a workflow step that will break
|
|
117
|
+
before it runs, such as a tool that needs a newer runtime than the job
|
|
118
|
+
installs. The report lists these for every repository at once.
|
|
119
|
+
|
|
120
|
+
An agent with both servers moves from "these twelve repositories are blocked"
|
|
121
|
+
(housekeeping) to "this is the workflow, the job and the files a change will
|
|
122
|
+
reach" (Atlas), without opening each repository by hand.
|
|
123
|
+
|
|
39
124
|
## Why it is shaped this way
|
|
40
125
|
|
|
41
126
|
| Layer | Choice | Reason |
|
|
@@ -92,6 +177,8 @@ hk findings # findings grouped by severity and code
|
|
|
92
177
|
hk health # per-repository health score, worst first
|
|
93
178
|
hk repo <name> # one repository in full
|
|
94
179
|
hk prs # every open pull request by age
|
|
180
|
+
hk branches # branches by state: merged, moved after merge, no PR
|
|
181
|
+
hk watch # open PRs, alerts and branches for a short watch list
|
|
95
182
|
hk versions # package.json against git tag against npm
|
|
96
183
|
hk actions # every workflow and its rule flags
|
|
97
184
|
hk cost # Actions cost, gross and net side by side
|
|
@@ -154,28 +241,6 @@ This repository's `.gitignore` excludes `data/`, `reports/` and
|
|
|
154
241
|
`housekeeping.config.json`. To keep history, which is the point of snapshots,
|
|
155
242
|
run the tool from a **private** repository of your own and commit them there.
|
|
156
243
|
|
|
157
|
-
## MCP server
|
|
158
|
-
|
|
159
|
-
`hk-mcp` (or `npm run mcp` in a clone) serves the warehouse over stdio, so an
|
|
160
|
-
assistant can ask questions without reading a multi-megabyte snapshot:
|
|
161
|
-
|
|
162
|
-
`hk_summary` · `hk_findings` · `hk_ci` · `hk_repo` · `hk_backlog` ·
|
|
163
|
-
`hk_health` · `hk_cost` · `hk_sql` · `hk_schema`
|
|
164
|
-
|
|
165
|
-
```json
|
|
166
|
-
{
|
|
167
|
-
"mcpServers": {
|
|
168
|
-
"housekeeping": { "command": "hk-mcp", "env": { "HK_HOME": "/path/to/warehouse" } }
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
`HK_HOME` is the directory you sweep from. From a clone, use
|
|
174
|
-
`"command": "node", "args": ["/path/to/housekeeping/src/mcp.mjs"]` instead.
|
|
175
|
-
|
|
176
|
-
`hk_sql` accepts a single `SELECT` or `WITH` statement and opens the database
|
|
177
|
-
read-only. A failing call returns a structured error, never a stack trace.
|
|
178
|
-
|
|
179
244
|
## Findings
|
|
180
245
|
|
|
181
246
|
Rules live in `src/analyze.mjs`. Each one cites the written rule it enforces,
|
|
@@ -202,6 +267,9 @@ them produces noise:
|
|
|
202
267
|
- **A required check nothing can emit is not a check that did not run here.**
|
|
203
268
|
One says drop the requirement; the other says fix the trigger. The repairs
|
|
204
269
|
contradict each other.
|
|
270
|
+
- **A pull request the trigger skipped is not a conflicted one.** GitHub runs
|
|
271
|
+
no pull-request workflow on a pull request with conflicts, so its missing
|
|
272
|
+
check says nothing about the trigger. That one needs a rebase.
|
|
205
273
|
- **A failed run is not a cancelled one.** `cancel-in-progress` exists to kill
|
|
206
274
|
superseded runs, so cancelled minutes are usually the concurrency rule working.
|
|
207
275
|
- **Gross cost is not net cost.** GitHub meters public repositories at full
|