snapshot-push
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseSkill: snapshot-push
Skill: snapshot-push
WHAT
WHAT
Purpose và context
Purpose 与 context
- Purpose: Push toàn bộ outer repo lên GitLab như một snapshot — kể cả content của
bonbon-aivàbe/(các sub-repos cófe/riêng). Dùng script.gitđể tự động hide/restorescripts/snapshot-push.shdirs..git - Trigger (when to use): "push snapshot", "snapshot push", "đẩy snapshot", "push outer repo".
- Non-goals: không push riêng từng sub-repo /
be/, không áp dụng cho repo khác ngoàife/.bonbon-ai
- Purpose: 将整个 outer repo 作为一个 snapshot 推送到 GitLab——包括
bonbon-ai和be/的内容(这些是拥有各自fe/的 sub-repos)。使用.git自动隐藏和恢复scripts/snapshot-push.sh目录。.git - Trigger(何时使用): “push snapshot”、“snapshot push”、“推送 snapshot”、“push outer repo”。
- Non-goals: 不单独 push /
be/中的各个 sub-repo;不适用于fe/以外的 repo。bonbon-ai
Mental model
Mental model
repo root bonbon-ai → snapshot-push.sh (hide .git của be/ fe/ → commit + push → restore .git) → commit hash + số files changedrepo root bonbon-ai → snapshot-push.sh(隐藏 be/ fe/ 的 .git → commit + push → 恢复 .git)→ commit hash + files changed 数量Input và output contract
Input 与 output contract
| Field | Required? | Ý nghĩa | |
|---|---|---|---|
| In | message | không | commit message tuỳ chọn, truyền cho script |
| Out | kết quả push | có | commit hash + số files changed báo cho user |
| Input/Output | Field | Required? | 含义 |
|---|---|---|---|
| In | message | 否 | 可选的 commit message,传递给 script |
| Out | push 结果 | 是 | 向用户报告 commit hash + files changed 数量 |
Rules và capabilities
Rules 与 capabilities
- RULE-01 (MUST): Verify đang ở đúng repo root () trước khi chạy script.
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai - Capabilities: đọc/ghi git của outer repo qua script có sẵn; ghi remote GitLab (push).
- RULE-01 (MUST):运行 script 前,验证当前位于正确的 repo root()。
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai - Capabilities:通过现有 script 读取和写入 outer repo 的 Git;写入 GitLab remote(push)。
Failure boundaries
Failure boundaries
- Không ở đúng repo root → blocked, không chạy script.
- Script lỗi (push fail) → failed, báo nguyên output lỗi cho user.
- 不在正确的 repo root → blocked,不运行 script。
- Script 错误(push 失败)→ failed,向用户提供完整的错误输出。
HOW
HOW
Main workflow
Main workflow
| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | deterministic | cwd | Verify repo root | đúng root | sai → blocked |
| W02 | effect | message | Chạy script snapshot-push | commit + push | lỗi → failed |
| W03 | deterministic | output script | Report commit hash + số files changed | báo cáo | — |
Chi tiết từng bước (nguồn chân lý cho W01–W03):
- Verify đang ở đúng repo root ()
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai - Chạy:
bash scripts/snapshot-push.sh "<optional message>" - Report kết quả: commit hash + số files changed
| Step | Type | Inputs | Action | Outputs/exit | Failure/next |
|---|---|---|---|---|---|
| W01 | deterministic | cwd | 验证 repo root | 正确的 root | 错误 → blocked |
| W02 | effect | message | 运行 snapshot-push script | commit + push | 错误 → failed |
| W03 | deterministic | script 输出 | 报告 commit hash + files changed 数量 | 报告结果 | — |
各步骤详情(W01–W03 的事实来源):
- 验证当前位于正确的 repo root()
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai - 运行:
bash scripts/snapshot-push.sh "<optional message>" - 报告结果:commit hash + files changed 数量
Branches
Branches
Không có nhánh phụ trong version này.
此版本没有分支。
Validation và stopping
Validation 与 stopping
Thành công = script trả rc 0 và in commit hash. Không retry tự động khi push lỗi.
成功 = script 返回 rc 0 并打印 commit hash。push 失败时不自动 retry。
Examples
Examples
- Positive: "đẩy snapshot" tại →
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai→ báo commit hash + số files changed, gồm cả file trongbash scripts/snapshot-push.sh "snapshot"vàbe/.fe/ - Boundary/failure: gọi khi cwd là → W01 thấy không phải repo root → dừng, báo user chuyển về root, không chạy script.
be/
- Positive: 在 执行“推送 snapshot” →
/Volumes/giatbhSSD(APFS)/workspace/bonbon-ai→ 报告 commit hash + files changed 数量,其中包括bash scripts/snapshot-push.sh "snapshot"和be/内的文件。fe/ - Boundary/failure: 在 cwd 为 时调用 → W01 检测到当前不是 repo root → 停止,告知用户切换到 root,不运行 script。
be/