snapshot-push

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Skill: snapshot-push

Skill: snapshot-push

WHAT

WHAT

Purpose và context

Purpose 与 context

  • Purpose: Push toàn bộ outer repo
    bonbon-ai
    lên GitLab như một snapshot — kể cả content của
    be/
    và
    fe/
    (các sub-repos có
    .git
    riêng). Dùng script
    scripts/snapshot-push.sh
    để tự động hide/restore
    .git
    dirs.
  • 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/
    /
    fe/
    , không áp dụng cho repo khác ngoài
    bonbon-ai
    .
  • Purpose: 将整个 outer repo
    bonbon-ai
    作为一个 snapshot 推送到 GitLab——包括
    be/
    和
    fe/
    的内容(这些是拥有各自
    .git
    的 sub-repos)。使用
    scripts/snapshot-push.sh
    自动隐藏和恢复
    .git
    目录。
  • Trigger(何时使用): “push snapshot”、“snapshot push”、“推送 snapshot”、“push outer repo”。
  • Non-goals: 不单独 push
    be/
    /
    fe/
    中的各个 sub-repo;不适用于
    bonbon-ai
    以外的 repo。

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 changed
.
repo root bonbon-ai → snapshot-push.sh(隐藏 be/ fe/ 的 .git → commit + push → 恢复 .git)→ commit hash + files changed 数量
。

Input và output contract

Input 与 output contract

FieldRequired?Ý nghĩa
Inmessagekhôngcommit message tuỳ chọn, truyền cho script
Outkết quả pushcócommit hash + số files changed báo cho user
Input/OutputFieldRequired?含义
Inmessage否可选的 commit message,传递给 script
Outpush 结果是向用户报告 commit hash + files changed 数量

Rules và capabilities

Rules 与 capabilities

  • RULE-01 (MUST): Verify đang ở đúng repo root (
    /Volumes/giatbhSSD(APFS)/workspace/bonbon-ai
    ) trước khi chạy script.
  • 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

StepTypeInputsActionOutputs/exitFailure/next
W01deterministiccwdVerify repo rootđúng rootsai → blocked
W02effectmessageChạy script snapshot-pushcommit + pushlỗi → failed
W03deterministicoutput scriptReport commit hash + số files changedbáo cáo—
Chi tiết từng bước (nguồn chân lý cho W01–W03):
  1. Verify đang ở đúng repo root (
    /Volumes/giatbhSSD(APFS)/workspace/bonbon-ai
    )
  2. Chạy:
    bash scripts/snapshot-push.sh "<optional message>"
  3. Report kết quả: commit hash + số files changed
StepTypeInputsActionOutputs/exitFailure/next
W01deterministiccwd验证 repo root正确的 root错误 → blocked
W02effectmessage运行 snapshot-push scriptcommit + push错误 → failed
W03deterministicscript 输出报告 commit hash + files changed 数量报告结果—
各步骤详情(W01–W03 的事实来源):
  1. 验证当前位于正确的 repo root(
    /Volumes/giatbhSSD(APFS)/workspace/bonbon-ai
    )
  2. 运行:
    bash scripts/snapshot-push.sh "<optional message>"
  3. 报告结果: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
    →
    bash scripts/snapshot-push.sh "snapshot"
    → báo commit hash + số files changed, gồm cả file trong
    be/
    và
    fe/
    .
  • Boundary/failure: gọi khi cwd là
    be/
    → W01 thấy không phải repo root → dừng, báo user chuyển về root, không chạy script.
  • Positive: 在
    /Volumes/giatbhSSD(APFS)/workspace/bonbon-ai
    执行“推送 snapshot” →
    bash scripts/snapshot-push.sh "snapshot"
    → 报告 commit hash + files changed 数量,其中包括
    be/
    和
    fe/
    内的文件。
  • Boundary/failure: 在 cwd 为
    be/
    时调用 → W01 检测到当前不是 repo root → 停止,告知用户切换到 root,不运行 script。