Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .bootstrap/managed-files.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"schemaVersion": 1,
"owner": "bootstrap",
"templateVersion": "2026.03.28.2",
"regenerationCommand": "bootstrap apply repo --manifest ./project.bootstrap.yaml",
"managedFiles": {
".githooks/pre-commit": {
"sha256": "992bc9b04d62f84df70ba1e42d7159a1d976190eae41597810aaafaa30252a4d",
"source": "bootstrap"
},
".github/ISSUE_TEMPLATE/flow_blocker.yml": {
"sha256": "bda981825dd7dd683f239a8d6507bab5c722274c0089f00f2ad1cedafa957d3a",
"source": "bootstrap"
},
".github/ISSUE_TEMPLATE/implementation.yml": {
"sha256": "539e9d31f2c6b50dab9c25e8d8964d60ae2d750bf957fbca76cb5f3f96d572be",
"source": "bootstrap"
},
".github/PULL_REQUEST_TEMPLATE.md": {
"sha256": "681efdaa71dd6ce77074cafc248b177ebb05a81062ecaa24327ece290cbcc659",
"source": "bootstrap"
},
"AGENTS.md": {
"sha256": "8acfcb8fe4d902e7892abdee9db7073c4f5fe33ac4733813c83a83434885a997",
"source": "bootstrap"
},
"CODEOWNERS": {
"sha256": "d5b88668ece5258a10e66ab476d2135250623474ff24d14748d071c5076559b0",
"source": "bootstrap"
},
"CONTRIBUTING.md": {
"sha256": "deb6f861b3f8cce70593809017a62266fe320782c46f9837b764c86b6c99f448",
"source": "bootstrap"
},
"docs/bootstrap/onboarding.md": {
"sha256": "dec1128151f05b75213c15b39a4d542d637eb62dc4c24bd4636748d35dd5c890",
"source": "bootstrap"
}
}
}
29 changes: 29 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/usr/bin/env bash
set -euo pipefail

branch="$(git symbolic-ref --quiet --short HEAD 2>/dev/null || echo HEAD)"
if [[ "$branch" == "main" || "$branch" == "master" ]]; then
echo "ERROR: commits to $branch are blocked. Create a feature branch." >&2
exit 1
fi

staged_files=()
while IFS= read -r -d '' staged_file; do
staged_files+=("$staged_file")
done < <(git diff --cached --name-only --diff-filter=ACMR -z)

for f in "${staged_files[@]:-}"; do
[[ -n "$f" ]] || continue
case "$f" in
*.env|.env.*)
if [[ "$f" != *.example ]]; then
echo "ERROR: cannot commit env file '$f'. Use .env.example templates instead." >&2
exit 1
fi
;;
esac
done

if [[ -x scripts/check-detect-secrets.sh ]]; then
bash scripts/check-detect-secrets.sh --staged
fi
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ Refs #<issue-number> <!-- use Closes/Fixes/Resolves only when this PR fully com
## Validation

- [ ] Relevant local checks passed
- [ ] Agent-authored changes passed `autoreview` against the intended PR diff with no accepted/actionable findings
- Autoreview command and result:
- [ ] Required PR checks are expected to satisfy `CI Gate`
- [ ] Skipped checks are explained below

Expand All @@ -19,6 +21,9 @@ Refs #<issue-number> <!-- use Closes/Fixes/Resolves only when this PR fully com
- [ ] PR author enabled auto-merge where GitHub allows it, or GitHub plan-limit evidence/unavailable reason is recorded and the fallback merge-readiness policy applies
- [ ] No real secrets, runtime auth, or machine-local env files are committed

Material change: no
ADR: docs/decisions/ADR-<number>-<slug>.md <!-- required when Material change is yes; ADR status must be Accepted -->

## Flow Contract

- Owner lane:
Expand Down
5 changes: 3 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
- Always work on a feature branch. Hooks block commits to `main` and `master`; enable them with `git config core.hooksPath .githooks`.
- Stack baseline: Generic polyglot.
- CI baseline: fast PR checks stay cheap and shell-safe; extended validation runs on `main`, nightly, or manual dispatch.
- Self-hosted runner policy: shell-safe jobs may use `[self-hosted, synology, shell-only, public]`; anything needing Docker, service containers, browser infra, or `container:` must stay on GitHub-hosted runners.
- Build the tests first for every change: add or update the relevant test target before implementation, then run `swift test` before any standalone `swift build`.
- Self-hosted runner policy: private-repository trusted jobs may use their matching capability pool. Public repository security workflows use GitHub-hosted isolation; fork pull-request jobs always remain read-only and GitHub-hosted.
- Add or update tests for every interactive, branching, or operator-facing behavior change.
- For a task that may open or update a PR, handle autoreview access before implementation: request required network access immediately and, for a private repository, explicit authorization to send the forthcoming intended PR diff to the external reviewer. At closeout, use the `autoreview` skill against the actual base. Verify every finding, fix accepted in-scope findings, and rerun affected tests and autoreview after changes. Proceed only when no accepted/actionable findings remain, and record the final command and result in the PR validation evidence. If authorization is declined or the skill is unavailable or cannot complete, stop and report the blocker instead of bypassing the gate.
- PRs must use the generated pull request template. The required PR gate validates summary, issue linkage, validation evidence, and risk notes.
- Never commit real secrets, runtime auth, or machine-local env files. Use templates and GitHub environments instead.

Expand Down
3 changes: 1 addition & 2 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# OMT-Global code ownership
* @OMT-Global/omt-codeowners
* @jmcte
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ Contributions should start from a GitHub issue that is assigned or explicitly en

## Validation

- Run `bash scripts/ci/run-fast-checks.sh` before opening a PR unless the PR explains why a check is not applicable.
- Run the relevant local checks before opening a PR.
- At the start of agent-authored PR work, request autoreview network access and, for private repository diffs, explicit authorization for the forthcoming intended PR diff. At closeout, use the `autoreview` skill against the actual base. Verify every finding, address accepted in-scope findings, and rerun affected checks and autoreview after edits until no accepted/actionable findings remain.
- Record the final autoreview command and result in the PR. If authorization is declined or the skill is unavailable or cannot complete, stop and report that blocker instead of opening or updating the PR.
- For this bootstrap contract, the required PR check surface is `CI Gate`.
- Document any skipped checks in the PR with a concrete reason.

Expand Down
88 changes: 84 additions & 4 deletions docs/bootstrap/onboarding.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,87 @@
# Repository onboarding
# Bootstrap Onboarding

This repository is a Swift macOS CLI using the generic-polyglot bootstrap archetype. Before merging, confirm `project.bootstrap.yaml` still names OMT-Global, requires `CI Gate`, one non-author CODEOWNER approval, auto-merge, and the hybrid-safe runner policy.
Use this checklist after the first bootstrap render or whenever `project.bootstrap.yaml` changes in a way that affects GitHub policy, environments, or home-profile sync.

Shell-safe PR checks may use the public shell-only runner labels. Release jobs require Xcode, codesign, notarytool, and hdiutil and therefore run on GitHub-hosted `macos-14`, never the shell-only runner.
## Project

The `release` environment must require maintainer approval and contain only the secret names documented in [release.md](../release.md). Never place certificates, private keys, notarization credentials, or exported keychains in the repository or portable Codex profiles.
- Product name: `iCloud CLI`
- Repository: `OMT-Global/icloud-cli`
- Manifest: `project.bootstrap.yaml`

## Repo Governance

- Confirm branch protection or rulesets on `main` require one approval, code owner review, and approval from someone other than the most recent pusher.
- Confirm branch protection points at the `CI Gate` status.
- Confirm `CONTRIBUTING.md` and `.github/PULL_REQUEST_TEMPLATE.md` are present as the required contributor and PR guidance surfaces.
- Confirm `AGENTS.md` requires the `autoreview` skill against the intended PR diff before an agent opens or updates a PR, and that the PR template records the final command and result.
- Confirm the pull request template is present and PR Fast CI validates the required PR description sections before CI Gate can pass.
- Confirm `Issue Hygiene Report` runs weekly with read-only issue permission and retains its JSON evidence artifact.
- Confirm `delete branch on merge` and `allow auto-merge` are enabled when the GitHub plan supports them; otherwise record the plan-limit evidence and use the fallback merge-readiness policy.
- Fallback merge readiness requires passing or intentionally skipped required checks, satisfied approvals, resolved conversations, no blocking review state, and a manual maintainer merge.



## Public Security Baseline

- Review `docs/bootstrap/security.md` before changing security workflow events, permissions, or runner labels.
- Confirm dependency review is the only security job reachable from fork pull requests and runs on GitHub-hosted isolation; CodeQL and SBOM jobs must remain trusted-event only and GitHub-hosted.
- Capture the seven required GitHub capability observations before treating remote security controls as verified.
- Confirm `SECURITY.md` private reporting and response targets match the maintained operational policy.

## Environments

- `dev`: open by default for rapid iteration.
- `stage`: one reviewer required and self-review blocked.
- `prod`: one reviewer required, self-review blocked, deployments limited to `main`.

## Runner Policy

- Private-repository trusted shell-safe jobs use `[self-hosted, linux, shell-only, private]`.
- Public repository security workflows use GitHub-hosted isolation. Fork pull-request jobs always remain read-only and GitHub-hosted.
- Native repos must use self-hosted runners for trusted required automation; Docker, service-container, browser, and `container:` workloads require a dedicated self-hosted runner pool with matching capability labels.
- Keep PR checks cheap. Add heavy validation to `scripts/ci/run-extended-validation.sh` instead of the PR lane.

- Consume shared security, release, and AI attestation workflows from the control-plane repo once those contracts are pinned for production use.

## Contributor And PR Guidance

- `CONTRIBUTING.md` defines the contributor workflow, branch expectations, validation expectations, and secret-handling baseline.
- `.github/PULL_REQUEST_TEMPLATE.md` defines the standard PR shape: summary, governing issue link, validation notes, and bootstrap governance checklist.
- To retrofit an existing bootstrapped repo, add `CONTRIBUTING.md` and `.github/PULL_REQUEST_TEMPLATE.md` to `repo.managedPaths` when that repo restricts managed paths, then run `bootstrap apply repo --manifest ./project.bootstrap.yaml`.
- Keep these files repo-generic unless project metadata or the manifest requires a stricter local rule.

## Issue Hygiene

- Review `docs/bootstrap/issue-hygiene.md` before acting on a 30-day review or 90-day close-or-rescope proposal.
- The scheduled workflow is report-only: it never comments, labels, closes, or reschedules issues.
- A 90-day proposal always requires a maintainer decision. Record a structured, evidenced future action when the issue should remain open.

## Licensing

- Repository visibility never selects or grants a license. Declare `license.mode` explicitly before Bootstrap manages `LICENSE`.
- Current manifest mode: not declared; Bootstrap will not create, replace, or remove a license.
- Keep `THIRD_PARTY_NOTICES.md` separate from the first-party notice and inventory dependencies, assets, fonts, media, and incorporated source.
- Any existing-license replacement requires legal ownership, contributor, distribution-history, issue, and approver evidence in the manifest. Previously granted rights are not revoked.
- Verify GitHub license detection after publishing an SPDX license. Never describe a proprietary notice as SPDX, OSI approved, or GitHub-recognized.

## Fleet Reconciliation

- Run `bootstrap reconcile --workspace-root ~/src --report bootstrap-reconcile.json` first; this is plan-only and does not write files.
- Add `--org OMT-Global` when OpenClaw should enumerate GitHub repos first; missing local checkouts or repos without `project.bootstrap.yaml` are skipped and reported.
- Use `--repo <name...>` as the initial allowlist when onboarding daily OpenClaw reconciliation.
- Use `--apply-repo --create-pr` for unattended repo drift so generated changes go through draft PRs instead of default-branch pushes.
- Use `--apply-github` only after the report shape is trusted because it mutates repository settings, environments, branch protection, and labels directly through the GitHub API.
- Dirty target worktrees are blocked and reported instead of being overwritten.

## Release Standard

- Use immutable exact SemVer tags such as `v1.2.3` as the source of truth.
- Automatically advance `v1.2` and `v1` to the newest compatible exact tag; never retag an exact release.
- Cut patch releases from `release/X.Y` when you maintain older minors; cut new minors and majors from `main`.



## Home Profiles

- Run `bootstrap apply home --manifest ./project.bootstrap.yaml` after reviewing the bundled profile content.
- The bootstrap manages portable Codex assets only. Auth, sessions, caches, and machine-local state stay unmanaged.
7 changes: 6 additions & 1 deletion project.bootstrap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@ repo:
- .github/PULL_REQUEST_TEMPLATE.md
- .github/ISSUE_TEMPLATE/implementation.yml
- .github/ISSUE_TEMPLATE/flow_blocker.yml
- .githooks/pre-commit
- docs/bootstrap/onboarding.md
archetype:
kind: generic-polyglot
kind: generic-empty
packageManager: swift
moduleName: icloud_cli
github:
Expand All @@ -35,6 +37,9 @@ github:
hasDiscussions: false
ci:
runnerPolicy: hybrid-safe
codeqlLanguages:
- python
- swift
fastChecks:
- build
- test
Expand Down
Loading