Add a repo status snapshot for faster session handoff
Constraint: Future sessions need a quick machine-readable summary of the verified repo state and next commands Rejected: Depend on manual reconstruction from docs and git history alone | Slower and more error-prone during handoff Confidence: high Scope-risk: narrow Directive: Keep the snapshot script aligned with the real default docs, drop zones, smoke outputs, and next-step commands Tested: /usr/local/miniconda3/bin/python scripts/status_snapshot.py Not-tested: Consumption of the snapshot by external automation beyond manual review
Showing
4 changed files
with
60 additions
and
0 deletions
| ... | @@ -10,6 +10,7 @@ Use this checklist when a new session starts working on the repo. | ... | @@ -10,6 +10,7 @@ Use this checklist when a new session starts working on the repo. |
| 10 | ## 2. Verify repo health | 10 | ## 2. Verify repo health |
| 11 | ```bash | 11 | ```bash |
| 12 | git status --short | 12 | git status --short |
| 13 | /usr/local/miniconda3/bin/python scripts/status_snapshot.py | ||
| 13 | ``` | 14 | ``` |
| 14 | 15 | ||
| 15 | ## 3. Verify open-dataset tooling | 16 | ## 3. Verify open-dataset tooling | ... | ... |
acr-engine/scripts/status_snapshot.py
0 → 100755
| 1 | #!/usr/bin/env python3 | ||
| 2 | import json | ||
| 3 | import subprocess | ||
| 4 | from pathlib import Path | ||
| 5 | |||
| 6 | root = Path.cwd() | ||
| 7 | workspace_root = root.parent | ||
| 8 | |||
| 9 | def sh(cmd): | ||
| 10 | return subprocess.check_output(cmd, shell=True, text=True).strip() | ||
| 11 | |||
| 12 | snapshot = { | ||
| 13 | 'latest_commit': sh('git log --oneline -n 1'), | ||
| 14 | 'docs': { | ||
| 15 | 'readme': str((workspace_root / 'docs/README.md').resolve()), | ||
| 16 | 'handoff': str((workspace_root / 'docs/session-handoff.md').resolve()), | ||
| 17 | 'workflow': str((workspace_root / 'docs/open-dataset-workflow.md').resolve()), | ||
| 18 | }, | ||
| 19 | 'drop_zones': { | ||
| 20 | 'fma': str((root / 'data/raw/fma_small_audio').resolve()), | ||
| 21 | 'mtg_jamendo': str((root / 'data/raw/mtg_jamendo_audio').resolve()), | ||
| 22 | }, | ||
| 23 | 'verified_open_smoke_dirs': { | ||
| 24 | 'manifests': str((root / 'data/external_ingested/synthetic_as_open_fixed/fma/manifests').resolve()), | ||
| 25 | 'reports': str((root / 'reports/open-smoke-fixed/fma').resolve()), | ||
| 26 | 'one_shot_reports': str((root / 'data/external_smoke/fma_reports_smoke').resolve()), | ||
| 27 | }, | ||
| 28 | 'next_commands': { | ||
| 29 | 'inspect_fma': '/usr/local/miniconda3/bin/python src/data/external_adapters.py inspect-local fma data/raw/fma_small_audio --eval-ratio 0.2 --query-duration 8.0', | ||
| 30 | 'smoke_fma': '/usr/local/miniconda3/bin/python src/data/external_adapters.py smoke-local fma data/raw/fma_small_audio --output-root data/external_smoke --eval-ratio 0.2 --query-duration 8.0 --train-epochs 1 --batch-size 2', | ||
| 31 | 'inspect_jamendo': '/usr/local/miniconda3/bin/python src/data/external_adapters.py inspect-local mtg_jamendo data/raw/mtg_jamendo_audio --eval-ratio 0.2 --query-duration 8.0', | ||
| 32 | 'smoke_jamendo': '/usr/local/miniconda3/bin/python src/data/external_adapters.py smoke-local mtg_jamendo data/raw/mtg_jamendo_audio --output-root data/external_smoke --eval-ratio 0.2 --query-duration 8.0 --train-epochs 1 --batch-size 2' | ||
| 33 | } | ||
| 34 | } | ||
| 35 | print(json.dumps(snapshot, ensure_ascii=False, indent=2)) |
| ... | @@ -179,6 +179,29 @@ | ... | @@ -179,6 +179,29 @@ |
| 179 | - 新 session 现在可以更快进入有效开发状态 | 179 | - 新 session 现在可以更快进入有效开发状态 |
| 180 | - 启动成本和漏看关键文档/命令的风险进一步下降 | 180 | - 启动成本和漏看关键文档/命令的风险进一步下降 |
| 181 | 181 | ||
| 182 | ### Stage: 状态快照脚本 | ||
| 183 | |||
| 184 | 完成项: | ||
| 185 | - 新增 [acr-engine/scripts/status_snapshot.py](../acr-engine/scripts/status_snapshot.py) | ||
| 186 | - 统一输出: | ||
| 187 | - latest commit | ||
| 188 | - 核心 docs 路径 | ||
| 189 | - 真实数据 drop zones | ||
| 190 | - 已验证 smoke 目录 | ||
| 191 | - 下一步推荐命令 | ||
| 192 | - 将脚本接入 handoff 文档与 first-run checklist | ||
| 193 | |||
| 194 | 验证结果: | ||
| 195 | - `/usr/local/miniconda3/bin/python scripts/status_snapshot.py` 成功 | ||
| 196 | - 输出已正确指向: | ||
| 197 | - `/workspace/docs/README.md` | ||
| 198 | - `/workspace/docs/session-handoff.md` | ||
| 199 | - `/workspace/docs/open-dataset-workflow.md` | ||
| 200 | |||
| 201 | 结论: | ||
| 202 | - 新 session 现在不只靠静态文档,也可以直接读取当前仓库状态快照 | ||
| 203 | - 持续开发交接更稳 | ||
| 204 | |||
| 182 | ### Stage: confused 定向优化 v6(sample-level weighting) | 205 | ### Stage: confused 定向优化 v6(sample-level weighting) |
| 183 | 206 | ||
| 184 | 完成项: | 207 | 完成项: | ... | ... |
| ... | @@ -275,6 +275,7 @@ | ... | @@ -275,6 +275,7 @@ |
| 275 | - [docs/open-dataset-workflow.md](./open-dataset-workflow.md) | 275 | - [docs/open-dataset-workflow.md](./open-dataset-workflow.md) |
| 276 | - [docs/session-handoff.md](./session-handoff.md) | 276 | - [docs/session-handoff.md](./session-handoff.md) |
| 277 | - [acr-engine/FIRST_RUN_CHECKLIST.md](../acr-engine/FIRST_RUN_CHECKLIST.md) | 277 | - [acr-engine/FIRST_RUN_CHECKLIST.md](../acr-engine/FIRST_RUN_CHECKLIST.md) |
| 278 | - 运行 [acr-engine/scripts/status_snapshot.py](../acr-engine/scripts/status_snapshot.py) | ||
| 278 | 279 | ||
| 279 | 2. 检查真实数据是否已落位: | 280 | 2. 检查真实数据是否已落位: |
| 280 | - `acr-engine/data/raw/fma_small_audio/` | 281 | - `acr-engine/data/raw/fma_small_audio/` | ... | ... |
-
Please register or sign in to post a comment