Spaces:
Sleeping
Download docs/guides/git-and-pr-rules.md from DecodeMarketing/decode_tools: direct link, hf CLI and curl.
- Browser
- Download file 4.8 kB
-
https://huggingface.co/spaces/DecodeMarketing/decode_tools/resolve/main/docs/guides/git-and-pr-rules.md
- Command line
-
hf download hf://spaces/DecodeMarketing/decode_tools/docs/guides/git-and-pr-rules.md
-
curl -L -o git-and-pr-rules.md https://huggingface.co/spaces/DecodeMarketing/decode_tools/resolve/main/docs/guides/git-and-pr-rules.md
A newer version of the Streamlit SDK is available: 1.67.0
Git and PR rules
Default flow
- Branch from
main:git checkout -b feature/<scope-kebab>. - Commit on the feature branch. Stage files explicitly (
git add path/to/file, nevergit add -A/git add .). The pre-commit gate runs ruff on staged Python; the commit-msg gate enforces the reviewer marker. Both are bypassable only via[override-reviewer: <reason>](audit-logged). - Push the feature branch:
git push -u origin feature/<scope-kebab>. - Open a PR against
main. Fill in the PR template at.github/pull_request_template.md. - Wait for CI:
gate.yml(ruff + override-audit),repo_validate.yml(py_compile sweep),check-file-size.yml(LFS warning). - Get review: the
feature-dev:code-reviewersubagent locally (writes.decode-reviewer-clean), plus at least one human approver on the PR. - Merge to
main. Note: merging tomaintriggers an HF Space deploy. Seeprotected-boundary-policy.mdfor the deploy-continuity check expected after merge.
Branch naming
feature/<scope-kebab>β new feature or change.debug/<scope-kebab>β short-lived branch for investigation (do not merge β close with discussion in a comment).hotfix/<scope-kebab>β emergency fix going tomain. Requires explicit owner sign-off per the protected-boundary policy.
Anything that does not fit one of these prefixes should be discussed before pushing.
Commit message rules
From CLAUDE.md (base rules):
- No AI attribution. Conventional Commits format (
feat:,fix:,docs:,chore:,refactor:,test:), human author. - No
Co-Authored-Bylines naming an AI model. - The override marker is the only AI-specific text permitted:
[override-reviewer: <reason>]inline in the message.
The local agent harness applies these rules as well.
PR target
main is the PR target for all routine work. There is no develop / dev PR target in active use today (see "Observed branches" below).
Observed branches on origin (status: not yet defined in repo docs)
These branches exist on origin at the time of writing:
| Branch | Observed state | Documented role |
|---|---|---|
main |
Default branch. Auto-deploys to HF Space. | Yes β this doc + protected-boundary-policy.md. |
dev |
Exists on origin. | No. Team should confirm intended role. |
staging |
Exists on origin. | No. Team should confirm intended role. |
hardening/decode-gates |
Source of the DECODE hardening commits merged into main 2026-05. | Historical; closed/archive candidate. |
sandbox |
Old, unused. | No. Likely archive/delete candidate. |
feature/refresh-codeowners-posture-2026-05-11 |
Existing feature branch. | In-flight feature work (not this remediation). |
Open team decision β do dev and staging participate in a planned promotion model (e.g., feature/* β dev β staging β main)? If yes, document it here and rewire .github/workflows/main.yml so the HF deploy trigger fires only at the right step. If no, archive them.
This doc records what is observed, not what is prescribed. Do not invent a promotion model in the absence of team confirmation.
What pull request reviewers should look for
PR reviewer checklist (also in .github/pull_request_template.md):
- Does this change touch any deploy-boundary file? (See
protected-boundary-policy.md.) - Does this change add a new shared utility that should live in
helper.py, not in a tab file? (Seedocs/architecture/active-surface.md.) - Does this change add a new doc that should also be linked from
docs/INDEX.md? - Did
gate.yml,repo_validate.yml, andcheck-file-size.ymlall pass? - Is there a
[override-reviewer: ...]line in the commit history of this PR? If yes, is the reason real?
Merging strategy
Squash-merge is the recommended option for the in-repo flow. The HF deploy sees one commit per merged PR, which keeps the rebuild log clean.
Force push and destructive ops
Blocked by .claude/hooks/block-dangerous-git.sh at the Claude Code tool layer. If you genuinely need one (e.g., to clean up a feature branch before PR review), ask the user to run the command manually in their own terminal. Never force-push main under any circumstance.