runops 0.2.0__py3-none-any.whl
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.
- runops/__init__.py +5 -0
- runops/_data/README.md +476 -0
- runops/adapters/__init__.py +29 -0
- runops/adapters/_utils/__init__.py +36 -0
- runops/adapters/_utils/toml_utils.py +81 -0
- runops/adapters/base.py +335 -0
- runops/adapters/contrib/__init__.py +5 -0
- runops/adapters/contrib/beach.py +837 -0
- runops/adapters/contrib/emses.py +1010 -0
- runops/adapters/generic.py +439 -0
- runops/adapters/registry.py +244 -0
- runops/cli/__init__.py +3 -0
- runops/cli/analyze.py +222 -0
- runops/cli/clone.py +104 -0
- runops/cli/config.py +217 -0
- runops/cli/context.py +56 -0
- runops/cli/create.py +263 -0
- runops/cli/dashboard.py +179 -0
- runops/cli/extend.py +204 -0
- runops/cli/history.py +105 -0
- runops/cli/init.py +1432 -0
- runops/cli/jobs.py +145 -0
- runops/cli/knowledge.py +1017 -0
- runops/cli/list.py +102 -0
- runops/cli/log.py +163 -0
- runops/cli/main.py +96 -0
- runops/cli/manage.py +231 -0
- runops/cli/new.py +343 -0
- runops/cli/notes.py +257 -0
- runops/cli/run_lookup.py +148 -0
- runops/cli/setup.py +174 -0
- runops/cli/status.py +187 -0
- runops/cli/submit.py +297 -0
- runops/cli/update.py +113 -0
- runops/cli/update_harness.py +245 -0
- runops/cli/update_refs.py +370 -0
- runops/core/__init__.py +3 -0
- runops/core/actions.py +1186 -0
- runops/core/analysis.py +1090 -0
- runops/core/campaign.py +156 -0
- runops/core/case.py +307 -0
- runops/core/context.py +426 -0
- runops/core/discovery.py +192 -0
- runops/core/environment.py +266 -0
- runops/core/exceptions.py +93 -0
- runops/core/knowledge.py +595 -0
- runops/core/knowledge_source.py +1204 -0
- runops/core/manifest.py +219 -0
- runops/core/project.py +171 -0
- runops/core/provenance.py +147 -0
- runops/core/retry.py +193 -0
- runops/core/run.py +170 -0
- runops/core/run_creation.py +456 -0
- runops/core/site.py +337 -0
- runops/core/state.py +197 -0
- runops/core/survey.py +380 -0
- runops/core/validation.py +40 -0
- runops/harness/__init__.py +27 -0
- runops/harness/builder.py +327 -0
- runops/harness/claude.py +189 -0
- runops/jobgen/__init__.py +3 -0
- runops/jobgen/generator.py +295 -0
- runops/launchers/__init__.py +17 -0
- runops/launchers/base.py +313 -0
- runops/launchers/mpiexec.py +131 -0
- runops/launchers/mpirun.py +132 -0
- runops/launchers/srun.py +126 -0
- runops/sites/__init__.py +0 -0
- runops/sites/camphor.md +98 -0
- runops/sites/camphor.toml +27 -0
- runops/slurm/__init__.py +3 -0
- runops/slurm/query.py +384 -0
- runops/slurm/submit.py +203 -0
- runops/templates/__init__.py +29 -0
- runops/templates/adapters/beach/agent_guide.md +50 -0
- runops/templates/adapters/beach/beach.toml +19 -0
- runops/templates/adapters/beach/case.toml +16 -0
- runops/templates/adapters/beach/summarize.py +272 -0
- runops/templates/adapters/emses/agent_guide.md +39 -0
- runops/templates/adapters/emses/case.toml +18 -0
- runops/templates/adapters/emses/plasma.toml +118 -0
- runops/templates/adapters/emses/summarize.py +413 -0
- runops/templates/adapters/generic/case.toml.j2 +13 -0
- runops/templates/adapters/generic/summarize.py +21 -0
- runops/templates/agent.md +156 -0
- runops/templates/rules/cookbook.md +22 -0
- runops/templates/scaffold/campaign.toml.j2 +10 -0
- runops/templates/scaffold/cases_claude.md +22 -0
- runops/templates/scaffold/facts.toml +2 -0
- runops/templates/scaffold/gitignore.txt +30 -0
- runops/templates/scaffold/notes/README.md +69 -0
- runops/templates/scaffold/rules/plan-before-act.md +17 -0
- runops/templates/scaffold/rules/runops-workflow.md +84 -0
- runops/templates/scaffold/rules/upstream-feedback.md +85 -0
- runops/templates/scaffold/runs_claude.md +24 -0
- runops/templates/scaffold/vscode_settings.json +9 -0
- runops/templates/skills/analyze/SKILL.md +40 -0
- runops/templates/skills/check-status/SKILL.md +29 -0
- runops/templates/skills/cleanup/SKILL.md +43 -0
- runops/templates/skills/create-run/SKILL.md +135 -0
- runops/templates/skills/debug-failed/SKILL.md +38 -0
- runops/templates/skills/learn/SKILL.md +54 -0
- runops/templates/skills/new-case/SKILL.md +108 -0
- runops/templates/skills/note/SKILL.md +107 -0
- runops/templates/skills/run-all/SKILL.md +47 -0
- runops/templates/skills/runops-reference/SKILL.md +203 -0
- runops/templates/skills/setup-campaign/SKILL.md +111 -0
- runops/templates/skills/setup-env/SKILL.md +32 -0
- runops/templates/skills/survey-design/SKILL.md +73 -0
- runops/templates/survey.toml.j2 +22 -0
- runops-0.2.0.dist-info/METADATA +491 -0
- runops-0.2.0.dist-info/RECORD +115 -0
- runops-0.2.0.dist-info/WHEEL +4 -0
- runops-0.2.0.dist-info/entry_points.txt +2 -0
- runops-0.2.0.dist-info/licenses/LICENSE +201 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# notes/ — lab notebook & reports
|
|
2
|
+
|
|
3
|
+
`.runops/insights/` と `.runops/facts.toml` は **curated knowledge** (整理済の
|
|
4
|
+
名前付き知見) を入れる場所。本ディレクトリ `notes/` は **逐次的な実験ノート
|
|
5
|
+
と長文レポート** を入れる場所で、両者は明確に役割を分ける。
|
|
6
|
+
|
|
7
|
+
## どこに何を書くか
|
|
8
|
+
|
|
9
|
+
| 場所 | 用途 | 性質 |
|
|
10
|
+
| --- | --- | --- |
|
|
11
|
+
| `.runops/facts.toml` | 機械可読 atomic claim | curated, atomic |
|
|
12
|
+
| `.runops/insights/<name>.md` | 名前付き整理済知見 (`/learn` で書く) | curated, durable |
|
|
13
|
+
| **`notes/YYYY-MM-DD.md`** | **日次の lab notebook (append-only)** | **chronological** |
|
|
14
|
+
| **`notes/reports/<topic>.md`**| **長文レポート / 解析記事** | **refined, 改稿可** |
|
|
15
|
+
| `runs/<run>/analysis/` | 個別 run の curated 出力 | run 単位 |
|
|
16
|
+
|
|
17
|
+
## 規約
|
|
18
|
+
|
|
19
|
+
### 日次 lab notebook (`notes/YYYY-MM-DD.md`)
|
|
20
|
+
|
|
21
|
+
- **append-only**: 新しい entry を **末尾に追記**する。過去の entry は触らない
|
|
22
|
+
- 1 ファイル = 1 日。日付は ISO 形式 (`2026-04-08.md`)
|
|
23
|
+
- 各 entry は `## HH:MM <短いタイトル>` で始まる
|
|
24
|
+
- 内容は自由 (試したこと, 見たこと, 仮説, 失敗, TODO, etc.)
|
|
25
|
+
- 思考の chain of thought を残しておく場所と思えばよい
|
|
26
|
+
|
|
27
|
+
例:
|
|
28
|
+
|
|
29
|
+
```markdown
|
|
30
|
+
## 14:32 cs scaling preview
|
|
31
|
+
|
|
32
|
+
3 点で `tan α = 0.79 (cs/vflow) + 0.02, R² = 0.9997` が出た。vti scaling
|
|
33
|
+
(R² = 0.991, intercept 0.073) より明らかに良い。3 点だけなのが心配。
|
|
34
|
+
Series B 完走で確かめる。
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 長文レポート (`notes/reports/<topic>.md`)
|
|
38
|
+
|
|
39
|
+
- 1 トピック = 1 ファイル
|
|
40
|
+
- 何度書き直してもよい (lab notebook と違って refined)
|
|
41
|
+
- 図は `notes/reports/figures/` に置くか、`runs/_compare_*/` への相対 link
|
|
42
|
+
- 完成度が高くなってから論文用素材として paper repo に移送する
|
|
43
|
+
|
|
44
|
+
## 補助コマンド
|
|
45
|
+
|
|
46
|
+
- **`runops notes append "<title>" "<body>"`** — 今日の `notes/YYYY-MM-DD.md`
|
|
47
|
+
に新しい entry を append する。`-` または引数省略で stdin から本文を読む
|
|
48
|
+
- **`runops notes list`** — 最近の lab notebook 日付一覧
|
|
49
|
+
- **`runops notes show [DATE|today|latest]`** — 指定日 (省略時は today) の内容を表示
|
|
50
|
+
- **`/note` skill** — agent から呼んで note を append (内部で `runops notes append` を呼ぶ)
|
|
51
|
+
|
|
52
|
+
## なぜ `runops knowledge save` ではダメか
|
|
53
|
+
|
|
54
|
+
- `knowledge save` は **同名で書くと上書き** で chronology と相性が悪い
|
|
55
|
+
- knowledge は「最終的な findings」を整理する場所であって、「今日試したこと
|
|
56
|
+
のメモ」は意味的にも違う
|
|
57
|
+
- 個別 fact / insight に昇格する価値が出てきたら、そのときに `/learn` で
|
|
58
|
+
knowledge layer に移送すればよい
|
|
59
|
+
|
|
60
|
+
## 昇格パス
|
|
61
|
+
|
|
62
|
+
```
|
|
63
|
+
notes/YYYY-MM-DD.md ← 日次の chain of thought
|
|
64
|
+
↓ (ストーリーが固まる)
|
|
65
|
+
notes/reports/<topic>.md ← 整理済 long form report
|
|
66
|
+
↓ (atomic な知見を抽出)
|
|
67
|
+
.runops/insights/<name>.md ← 名前付き curated insight
|
|
68
|
+
.runops/facts.toml ← 機械可読 atomic claim
|
|
69
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# 実行前ルール
|
|
2
|
+
|
|
3
|
+
複数ファイル編集または高コスト操作の前には、短い plan を出す。
|
|
4
|
+
|
|
5
|
+
```json
|
|
6
|
+
{
|
|
7
|
+
"goal": "what you want to achieve",
|
|
8
|
+
"edits": ["file1.toml", "file2.toml"],
|
|
9
|
+
"commands": ["runops runs sweep ...", "runops runs submit --all ..."],
|
|
10
|
+
"checkpoints": ["Confirm survey size before bulk submit"]
|
|
11
|
+
}
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
- 高コスト操作では run 数・queue・retry 理由を書く
|
|
15
|
+
- plan にない高コスト操作をいきなり実行しない
|
|
16
|
+
- approval が必要な操作は、plan を出したところで止まる
|
|
17
|
+
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# runops ワークフロールール
|
|
2
|
+
|
|
3
|
+
このファイルは、以前 PreToolUse hook (`protect-files.sh`, `guard-bash.sh`,
|
|
4
|
+
`approve-run.sh`) で強制していた挙動を、AI エージェントが読む rule として
|
|
5
|
+
記述する。permissions.deny で機械的に止められるものは settings.json に
|
|
6
|
+
任せ、ここでは「Agent が判断すべき振る舞い」を明示する。
|
|
7
|
+
|
|
8
|
+
## ファイル操作の制約
|
|
9
|
+
|
|
10
|
+
以下は permissions.deny でも止めるが、Bash 経由 (cp, mv, rm, sed -i,
|
|
11
|
+
リダイレクト等) では permissions が効かないので、Agent 側の自制で守る:
|
|
12
|
+
|
|
13
|
+
- run ディレクトリ (`Rxxxx/`) は手で作らない
|
|
14
|
+
- `manifest.toml` は手動編集も Bash 書き込みもしない
|
|
15
|
+
- `Rxxxx/input/*` を直接作らない (case template から再生成する)
|
|
16
|
+
- `Rxxxx/submit/job.sh` は手書きしない (runops が生成する)
|
|
17
|
+
- run は必ず `runops runs create` または `runops runs sweep` で生成する
|
|
18
|
+
- `work/` の出力は読み取り専用扱い (移動・削除しない)
|
|
19
|
+
- `.runops/knowledge/` の自動生成物は手で整形しない
|
|
20
|
+
- `.runops/insights/` と `.runops/facts.toml` は直接編集せず、
|
|
21
|
+
`runops knowledge save` / `runops knowledge add-fact` を使う
|
|
22
|
+
- `SITE.md` は site profile 由来の生成ドキュメントとして直接編集しない
|
|
23
|
+
- `refs/` 配下は外部リポジトリのミラーなので書き込まない
|
|
24
|
+
- `runs/**/input/*` を緊急修正した場合は、同じ修正を上流の case へ戻す
|
|
25
|
+
|
|
26
|
+
## tools/runops の編集
|
|
27
|
+
|
|
28
|
+
- `tools/runops/` は editable install されているので、必要なら
|
|
29
|
+
ソースを直接編集して即試せる (settings.json でも allow になっている)
|
|
30
|
+
- 修正は基本 `runops` 本体側で先に行い、commit / push してから
|
|
31
|
+
プロジェクト側に反映する
|
|
32
|
+
|
|
33
|
+
## venv
|
|
34
|
+
|
|
35
|
+
- **runops コマンド実行前に `.venv/` を activate する**
|
|
36
|
+
|
|
37
|
+
## case 作成
|
|
38
|
+
|
|
39
|
+
- **case は `runops case new <name> -s <simulator>` で生成する**
|
|
40
|
+
(`cases/<sim>/` に自動配置)
|
|
41
|
+
- 生成された `case.toml` や入力テンプレートの編集は自由
|
|
42
|
+
|
|
43
|
+
## ジョブ投入の承認フロー
|
|
44
|
+
|
|
45
|
+
`runops runs submit` は permissions.ask で毎回確認が入る (フックは廃止
|
|
46
|
+
したのでルールベース)。Agent 側で守るべき振る舞い:
|
|
47
|
+
|
|
48
|
+
- 実行前に **投入内容 (コマンド・対象 run・queue・資源量) をユーザーに提示**
|
|
49
|
+
してから submit を呼ぶ
|
|
50
|
+
- `--dry-run` と `--help` は確認用なのでそのまま実行してよい
|
|
51
|
+
- 承認なしに実ジョブ投入を繰り返し試行しない
|
|
52
|
+
- 一度の submit で複数 run が走る (例: `--all`) ときは特に慎重に説明する
|
|
53
|
+
|
|
54
|
+
## 設定ファイルの変更
|
|
55
|
+
|
|
56
|
+
以下は permissions.ask でユーザー承認が必要なファイル:
|
|
57
|
+
`runops.toml`, `simulators.toml`, `launchers.toml`, `CLAUDE.md`,
|
|
58
|
+
`AGENTS.md`, `.claude/settings.json`, `.claude/hooks/**`. 変更前に意図と
|
|
59
|
+
差分を提示する。
|
|
60
|
+
|
|
61
|
+
## コミットの義務
|
|
62
|
+
|
|
63
|
+
意味のある作業単位ごとに必ず Git コミットして履歴を残す。詳細は CLAUDE.md
|
|
64
|
+
の「進捗のコミット (義務)」セクションを参照。最低限以下のタイミングで
|
|
65
|
+
コミットする:
|
|
66
|
+
|
|
67
|
+
- campaign / case / survey の新規作成・大幅変更
|
|
68
|
+
- `runops runs sweep` で新しい run を生成したとき
|
|
69
|
+
- 解析結果・知見を保存したとき
|
|
70
|
+
- `tools/runops/` を修正してテストが通ったとき
|
|
71
|
+
- `runops runs submit` の前 (投入前のスナップショット)
|
|
72
|
+
|
|
73
|
+
## 知見の記録
|
|
74
|
+
|
|
75
|
+
- 実験の知見・結果は Agent の memory ではなく `/learn` で保存する
|
|
76
|
+
- 保存先: `.runops/insights/`, `.runops/facts.toml`
|
|
77
|
+
- 外部 source から来た候補 fact は `.runops/knowledge/candidates/facts/` に入る
|
|
78
|
+
- 候補 fact を採用するときは `runops knowledge promote-fact <source>:<fact_id>` を使う
|
|
79
|
+
- `high` confidence は複数 run の再現か deterministic 確認がある場合だけ使う
|
|
80
|
+
|
|
81
|
+
## 解析 scratch
|
|
82
|
+
|
|
83
|
+
- 試行中の図・ノート・一時集計は `runs/**/analysis/scratch/` に置く
|
|
84
|
+
- `analysis/summary.json` や curated figure を scratch 出力で上書きしない
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# runops へのフィードバック (upstream feedback)
|
|
2
|
+
|
|
3
|
+
このプロジェクトは `runops` (https://github.com/Nkzono99/runops) 上で
|
|
4
|
+
運用されている。Agent は日常運用の過程で runops 自体の改善点
|
|
5
|
+
(バグ・使いにくさ・不足している機能・分かりにくい docs / エラーメッセージ・
|
|
6
|
+
抜けている adapter / launcher サポート 等) に気づいたら、upstream に
|
|
7
|
+
フィードバックして runops を育てることもタスクに含める。
|
|
8
|
+
|
|
9
|
+
## いつフィードバックするか
|
|
10
|
+
|
|
11
|
+
- `runops <command>` がクラッシュした、または unhelpful なエラーで止まった
|
|
12
|
+
- コマンド体系や help が実態と噛み合っていない
|
|
13
|
+
- 「もう一段抽象化してあれば手作業が減る」ワークフローが繰り返し出てきた
|
|
14
|
+
- `CLAUDE.md` / skill / rule の記述と実装が食い違っている
|
|
15
|
+
- 新しい simulator / launcher / site を足したくなった
|
|
16
|
+
- `tools/runops/` のコードを読んでいて明らかなバグ・dead code を発見した
|
|
17
|
+
|
|
18
|
+
「この 1 回だけ回避できればよい」ではなく、**次に別のプロジェクトで同じ作業を
|
|
19
|
+
する人 (自分含む) が困らないようにする** という視点で判断する。
|
|
20
|
+
|
|
21
|
+
## フィードバック手順
|
|
22
|
+
|
|
23
|
+
1. **まずユーザーに提案する** — issue を切る前に必ず「こういう点で
|
|
24
|
+
runops に issue を立てようと思うがどうか」と相談する。勝手に issue を
|
|
25
|
+
投げない。
|
|
26
|
+
2. ユーザーが OK したら、`.venv` を activate した状態で `gh` を使って
|
|
27
|
+
issue を作成する:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
gh issue create \
|
|
31
|
+
--repo Nkzono99/runops \
|
|
32
|
+
--title "<短い要約>" \
|
|
33
|
+
--body "$(cat <<'EOF'
|
|
34
|
+
## 概要
|
|
35
|
+
<何が問題か / どんな改善を提案するか>
|
|
36
|
+
|
|
37
|
+
## 再現手順 (bug の場合)
|
|
38
|
+
1. ...
|
|
39
|
+
2. ...
|
|
40
|
+
|
|
41
|
+
## 期待する挙動
|
|
42
|
+
<どうあるべきか>
|
|
43
|
+
|
|
44
|
+
## 実際の挙動
|
|
45
|
+
<いま何が起きているか / エラーメッセージ>
|
|
46
|
+
|
|
47
|
+
## 環境
|
|
48
|
+
- runops version: $(runops --version 2>/dev/null || echo unknown)
|
|
49
|
+
- OS: $(uname -srm)
|
|
50
|
+
- simulator: <該当 adapter 名 / バージョン>
|
|
51
|
+
- 関連 run: <run_id があれば>
|
|
52
|
+
|
|
53
|
+
## 補足
|
|
54
|
+
<ログ抜粋, 関連ファイルパス, 既に試した workaround など>
|
|
55
|
+
EOF
|
|
56
|
+
)"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
3. 投げた issue の URL を `notes/YYYY-MM-DD.md` (`runops notes append`) に
|
|
60
|
+
記録しておく。後から「あのとき投げた issue」で辿れるようにする。
|
|
61
|
+
|
|
62
|
+
## 軽微な修正は直接 PR でもよい
|
|
63
|
+
|
|
64
|
+
`tools/runops/` は editable install されているので、typo 修正や
|
|
65
|
+
small な挙動改善は以下の手順で直接 upstream に投げられる:
|
|
66
|
+
|
|
67
|
+
1. `cd tools/runops && git checkout -b fix/<short-name>`
|
|
68
|
+
2. 修正を入れて `uv run pytest` などでテストが通ることを確認
|
|
69
|
+
3. プロジェクト側の再現環境で実挙動を確認
|
|
70
|
+
4. `git push origin fix/<short-name>` → `gh pr create --repo Nkzono99/runops`
|
|
71
|
+
5. 作成した PR の URL をユーザーに共有し、承認を求める
|
|
72
|
+
|
|
73
|
+
大きな変更 (API 変更, 新 adapter, ワークフロー変更) は PR の前に issue で
|
|
74
|
+
先に設計を合意する。
|
|
75
|
+
|
|
76
|
+
## しないこと
|
|
77
|
+
|
|
78
|
+
- ユーザーに相談せずに issue や PR を作らない
|
|
79
|
+
- 同じ内容の issue が既にあるか確認せずに重複 issue を切らない
|
|
80
|
+
(`gh issue list --repo Nkzono99/runops --search "<keyword>"` で検索)
|
|
81
|
+
- プロジェクト固有の private 情報 (実データパス, クラスタ固有の秘密など)
|
|
82
|
+
を issue 本文に貼らない
|
|
83
|
+
- フィードバックを **理由にして現プロジェクトの作業を止めない** — issue や
|
|
84
|
+
PR は作業のサイドチャネルとして投げ、当面の研究タスクは workaround で
|
|
85
|
+
進める
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# runs/ ディレクトリ
|
|
2
|
+
|
|
3
|
+
ここには simulation run が格納される。すべて `runops runs create` / `runops runs sweep` で生成。
|
|
4
|
+
|
|
5
|
+
## 構造
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
runs/<path>/Rxxxx/
|
|
9
|
+
manifest.toml # 正本 (状態・由来・provenance)
|
|
10
|
+
input/ # 入力ファイル (自動生成)
|
|
11
|
+
submit/ # job.sh 等 (自動生成)
|
|
12
|
+
work/ # 実行時出力 (.gitignore 対象)
|
|
13
|
+
analysis/ # 解析結果
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## ルール
|
|
17
|
+
|
|
18
|
+
- run ディレクトリ (`Rxxxx/`) を手で作らない
|
|
19
|
+
- `manifest.toml` を手動編集しない
|
|
20
|
+
- `input/*`, `submit/job.sh` を直接作らない
|
|
21
|
+
- 状態確認は `runops runs status`、同期は `runops runs sync`
|
|
22
|
+
- 解析は `runops analyze summarize` / `runops analyze collect`
|
|
23
|
+
- 試行中の図・メモ・一時解析物は `analysis/scratch/` に置く
|
|
24
|
+
- 共有したい図や summary は `analysis/` の curated 出力に昇格する
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
{
|
|
2
|
+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
|
|
3
|
+
"python.terminal.activateEnvironment": false,
|
|
4
|
+
"terminal.integrated.env.linux": {
|
|
5
|
+
"VIRTUAL_ENV": "${workspaceFolder}/.venv",
|
|
6
|
+
"PATH": "${workspaceFolder}/.venv/bin:${env:PATH}",
|
|
7
|
+
"VIRTUAL_ENV_DISABLE_PROMPT": "1"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: analyze
|
|
3
|
+
description: Analyze completed runs and collect survey results. Use after runs complete to summarize findings.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 完了した Run の結果を解析・集計する
|
|
7
|
+
|
|
8
|
+
## 個別 run の要約
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
cd <run_dir>
|
|
12
|
+
runops analyze summarize
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## survey の集計
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
runops analyze collect $ARGUMENTS
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## survey の plot
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
runops analyze plot $ARGUMENTS --list-columns
|
|
25
|
+
runops analyze plot $ARGUMENTS --list-recipes
|
|
26
|
+
runops analyze plot $ARGUMENTS --recipe completion-vs-dt
|
|
27
|
+
runops analyze plot $ARGUMENTS --x param.some_axis --y some_metric
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## 手順
|
|
31
|
+
|
|
32
|
+
1. `runops analyze summarize` で各 run の要約を生成する
|
|
33
|
+
2. survey の場合は `runops analyze collect <dir>` を実行する
|
|
34
|
+
3. `collect` が生成した `summary/survey_summary.csv`, `summary/survey_summary.json`, `summary/figures_index.json`, `summary/survey_summary.md` を確認する
|
|
35
|
+
4. まず `runops analyze plot <dir> --list-recipes` を試し、使える recipe があれば `--recipe` を優先する
|
|
36
|
+
5. recipe が無い場合は `runops analyze plot <dir> --list-columns` で列を確認し、`--x/--y` を指定して図を生成する
|
|
37
|
+
6. 試行中の図やメモは `runs/**/analysis/scratch/` に置き、curated な出力だけを `analysis/` に残す
|
|
38
|
+
7. completed run に `analysis/summary.json` が無い場合、`collect` が自動 summarize することを前提に進めてよい
|
|
39
|
+
8. 結果の概要と注目すべき傾向を報告する
|
|
40
|
+
9. 知見があれば `/learn` で保存する
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: check-status
|
|
3
|
+
description: Check and sync run or survey status. Use when monitoring job progress or after submission.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run / Survey の状態を確認・同期する
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# プロジェクト全体の active jobs
|
|
10
|
+
runops runs jobs
|
|
11
|
+
|
|
12
|
+
# 特定ディレクトリの run 一覧
|
|
13
|
+
runops runs list $ARGUMENTS
|
|
14
|
+
|
|
15
|
+
# 個別 run の同期と確認
|
|
16
|
+
cd <run_dir>
|
|
17
|
+
runops runs sync
|
|
18
|
+
runops runs status
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## survey 全体のステータスを確認する場合
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
runops runs list $ARGUMENTS
|
|
25
|
+
runops runs jobs
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
状態をサマリーとして報告する: completed / running / failed / submitted の数。
|
|
29
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: cleanup
|
|
3
|
+
description: Archive completed runs, purge unnecessary work files, cancel running jobs, or hard-delete unused runs. Use for housekeeping after experiments.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 完了・不要な Run を整理する
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
# 状態を確認
|
|
10
|
+
runops runs list $ARGUMENTS
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## completed run の整理 (通常フロー)
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# completed run をアーカイブ
|
|
17
|
+
cd <run_dir>
|
|
18
|
+
runops runs archive
|
|
19
|
+
|
|
20
|
+
# work/ の不要ファイルを削除 (archived のみ)
|
|
21
|
+
runops runs purge-work
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 実行中 job の停止
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
# scancel + sync を一回で。submitted/running の run を cancelled に遷移
|
|
28
|
+
runops runs cancel
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## created / cancelled / failed の run を捨てる
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# 失敗 run などをディレクトリごと削除 (completed/archived には使えない)
|
|
35
|
+
runops runs delete
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## 注意
|
|
39
|
+
|
|
40
|
+
- `archive` / `purge-work` / `delete` は確認が必要な操作
|
|
41
|
+
- `cancel` は追加確認プロンプトなしで進めてよいが、実行前に対象と理由を必ず報告する
|
|
42
|
+
- `delete` は不可逆。`completed` / `archived` の run を捨てたい場合は
|
|
43
|
+
`archive` → `purge-work` を使う
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: create-run
|
|
3
|
+
description: Create runs or expand a survey from cases. Use when generating simulation runs with runops runs create or runops runs sweep.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Run / Survey を生成する
|
|
7
|
+
|
|
8
|
+
## 手順
|
|
9
|
+
|
|
10
|
+
1. 使用するケースの case.toml を確認する
|
|
11
|
+
2. 単一 run か survey (パラメータスイープ) かを判断する
|
|
12
|
+
3. run を生成する
|
|
13
|
+
4. 生成結果を確認する
|
|
14
|
+
|
|
15
|
+
## 単一 Run の生成
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
# 生成先ディレクトリへ移動して実行
|
|
19
|
+
cd runs/test/basic
|
|
20
|
+
runops runs create <case_name>
|
|
21
|
+
|
|
22
|
+
# または --dest で生成先を指定
|
|
23
|
+
runops runs create <case_name> --dest runs/test/basic
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
生成される run:
|
|
27
|
+
```
|
|
28
|
+
runs/test/basic/Rxxxxxxxx-xxxx/
|
|
29
|
+
manifest.toml # 状態・由来・provenance (正本)
|
|
30
|
+
input/ # 入力ファイル (case から自動生成)
|
|
31
|
+
submit/ # job.sh (自動生成)
|
|
32
|
+
work/ # 実行時出力用 (空)
|
|
33
|
+
analysis/ # 解析結果用 (空)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Survey の展開
|
|
37
|
+
|
|
38
|
+
survey.toml がある場合、パラメータの直積で複数 run を一括生成する。
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# survey.toml のあるディレクトリを指定
|
|
42
|
+
runops runs sweep runs/sheath/angle_scan
|
|
43
|
+
|
|
44
|
+
# または cwd で
|
|
45
|
+
cd runs/sheath/angle_scan
|
|
46
|
+
runops runs sweep
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### survey.toml の準備
|
|
50
|
+
|
|
51
|
+
survey.toml が未作成の場合は、先にケースと survey を作成する:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# ケース作成時に --survey で同時生成
|
|
55
|
+
runops case new my_case -s emses --survey
|
|
56
|
+
|
|
57
|
+
# または既存ケースに survey を追加
|
|
58
|
+
mkdir -p runs/<survey_name>
|
|
59
|
+
# survey.toml を作成 (フォーマットは /survey-design スキル参照)
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### survey.toml の例
|
|
63
|
+
|
|
64
|
+
```toml
|
|
65
|
+
[survey]
|
|
66
|
+
name = "angle sweep"
|
|
67
|
+
base_case = "emses/my_case"
|
|
68
|
+
simulator = "emses"
|
|
69
|
+
launcher = "default"
|
|
70
|
+
|
|
71
|
+
[axes]
|
|
72
|
+
"species[2].ray_zenith_angle_deg" = [0, 20, 40, 60, 80]
|
|
73
|
+
"tmgrid.dt" = [0.5, 1.0]
|
|
74
|
+
|
|
75
|
+
[naming]
|
|
76
|
+
display_name = "angle{%raw%}{{ray_zenith_angle_deg}}{%endraw%}_dt{%raw%}{{tmgrid_dt}}{%endraw%}"
|
|
77
|
+
|
|
78
|
+
[job]
|
|
79
|
+
partition = "compute"
|
|
80
|
+
nodes = 4
|
|
81
|
+
ntasks = 32
|
|
82
|
+
walltime = "02:00:00"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
この例では 5 x 2 = 10 個の run が生成される。
|
|
86
|
+
|
|
87
|
+
## 生成結果の確認
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
# run 一覧を表示
|
|
91
|
+
runops runs list
|
|
92
|
+
runops runs list runs/sheath/angle_scan
|
|
93
|
+
|
|
94
|
+
# 生成数と設定を確認
|
|
95
|
+
runops runs status
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## 生成後の次ステップ
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
# 単一 run を投入
|
|
102
|
+
cd runs/test/basic/Rxxxxxxxx-xxxx
|
|
103
|
+
runops runs submit -qn <partition>
|
|
104
|
+
|
|
105
|
+
# survey 全体を投入 (/run-all スキル推奨)
|
|
106
|
+
cd runs/sheath/angle_scan
|
|
107
|
+
runops runs submit --all -qn <partition>
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## 注意
|
|
111
|
+
|
|
112
|
+
- run ディレクトリを手で作らない (必ず `runops runs create` / `runops runs sweep` を使う)
|
|
113
|
+
- manifest.toml を手動編集しない
|
|
114
|
+
- input/ や submit/job.sh を直接作らない
|
|
115
|
+
- survey の run 数が多い場合は投入前に plan を出して承認を取る
|
|
116
|
+
- `runops runs submit --all --dry-run` で投入前に確認できる
|
|
117
|
+
|
|
118
|
+
## `/note` で残すべきこと
|
|
119
|
+
|
|
120
|
+
run / survey 生成の前後で lab notebook に記録する:
|
|
121
|
+
|
|
122
|
+
- 何 run 生成したか (件数, 内訳, 命名規則)
|
|
123
|
+
- 想定総コスト (core-h, walltime)
|
|
124
|
+
- どの case を base にしたか, 上書きしたパラメータの一覧
|
|
125
|
+
- sweep 軸の意味付け (e.g. "vti を 1-19 eV にしたのは…")
|
|
126
|
+
- 投入前の commit hash (`git rev-parse HEAD`)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
runops notes append "Series A sweep 生成" - <<'EOF'
|
|
130
|
+
runs/series_A_flat_plate/ に 10 run.
|
|
131
|
+
base case: cases/emses/flat_plate, sweep 軸: ions[0].vti = 1..19 eV.
|
|
132
|
+
display_name: vti{vti}.
|
|
133
|
+
total core-h ≈ 64k. snapshot commit: 53a7e62.
|
|
134
|
+
EOF
|
|
135
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: debug-failed
|
|
3
|
+
description: Diagnose failed runs and propose fixes. Use when a run has failed and needs investigation.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 失敗した Run を診断する
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
cd $ARGUMENTS
|
|
10
|
+
runops runs sync
|
|
11
|
+
runops runs status
|
|
12
|
+
runops runs log -e
|
|
13
|
+
runops runs log
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
必要なら `work/` 以下も確認:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
ls work/
|
|
20
|
+
tail -n 100 work/*.err
|
|
21
|
+
tail -n 100 work/*.out
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## 判断の目安
|
|
25
|
+
|
|
26
|
+
| failure_reason | 対処 |
|
|
27
|
+
|---|---|
|
|
28
|
+
| `timeout` | walltime 延長候補 |
|
|
29
|
+
| `oom` | メモリ増加または問題サイズ縮小 |
|
|
30
|
+
| `preempted` | 同条件再投入 |
|
|
31
|
+
| `exit_error` | log / err を確認してから判断 |
|
|
32
|
+
|
|
33
|
+
## retry の進め方
|
|
34
|
+
|
|
35
|
+
- case.toml または survey.toml を修正して新しい run を生成する
|
|
36
|
+
- 同じ run の試行回数が 3 回前後に達したら、自動 retry を止めて原因を要約する
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learn
|
|
3
|
+
description: Save knowledge insights and structured facts from experiment results. Use after analyzing runs to capture findings. Reads notes/ first to gather raw material before crystallizing.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# 実験結果から知見を記録する
|
|
7
|
+
|
|
8
|
+
`/learn` は curated knowledge (`.runops/insights/`, `.runops/facts.toml`)
|
|
9
|
+
への永続化スキル。これに対して `/note` は raw な lab notebook (`notes/`) への
|
|
10
|
+
時系列追記。`/learn` は **`/note` の中身を素材として利用** する関係になる。
|
|
11
|
+
|
|
12
|
+
## 手順
|
|
13
|
+
|
|
14
|
+
1. **`notes/` を素材として集める** (curated knowledge を作る前段)
|
|
15
|
+
- `runops notes list` で最近の lab notebook 日付を確認
|
|
16
|
+
- 関連するテーマの `runops notes show <YYYY-MM-DD>` で読む
|
|
17
|
+
- 散らばった観察・仮説・反例・却下案を集める
|
|
18
|
+
2. 完了した run の結果 (`runops analyze summarize`, ログ, 出力) を読む
|
|
19
|
+
3. 新たに分かったこと・期待と異なる結果を特定する
|
|
20
|
+
4. 知見の種類を判断する (constraint / result / analysis / dependency)
|
|
21
|
+
5. 出処になった `notes/<date>.md` の日付を insight 本文に書き残す
|
|
22
|
+
(後から検証可能・raw material trail として)
|
|
23
|
+
|
|
24
|
+
## 人向け知見の保存
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
runops knowledge save <name> -t <type> -s <simulator> -m "<内容>"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
タイプ: `constraint`, `result`, `analysis`, `dependency`
|
|
31
|
+
|
|
32
|
+
例:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
runops knowledge save mag_scan_summary -t result -s emses \
|
|
36
|
+
-m "磁場角度 0-90 度のサーベイ。45度で最もイオン加速が効率的。"
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 機械可読な fact の追加
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
runops knowledge add-fact "<claim>" \
|
|
43
|
+
-t <type> -s <simulator> \
|
|
44
|
+
--param-name <param> --scope-text "<scope>" \
|
|
45
|
+
--evidence-kind <kind> --evidence-ref <ref> \
|
|
46
|
+
-c <confidence> --tags "<tags>"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
タイプ: `observation`, `constraint`, `dependency`, `policy`, `hypothesis`
|
|
50
|
+
|
|
51
|
+
- `high` confidence は複数 run の再現か deterministic 確認がある場合だけ使う
|
|
52
|
+
- 既存 fact を修正するときは `--supersedes fNNN` を使う
|
|
53
|
+
- 外部 source から同期された candidate fact は `runops knowledge facts` で確認できる
|
|
54
|
+
- 採用する candidate fact は `runops knowledge promote-fact <source>:<fact_id>` で local fact に昇格する
|