Repository navigation
docs: Document the contributor workflow (repo topology + engine vendoring) #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
61efb1f
b559fc9
883a071
a40fc6e
b2e3043
87c7e12
1606d1d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -63,12 +63,68 @@ adding the marketplace to browse the authoritative list. | |
|
|
||
| Individual programs may have additional requirements documented in their `SKILL.md`. | ||
|
|
||
| ## How it is built | ||
| ## Development | ||
|
|
||
| RepoMan is developed across three repositories: | ||
|
|
||
| | Repository | Role | | ||
| |------------|------| | ||
| | [rossoctl/automation](https://github.com/rossoctl/automation) | Engine source of truth: the flat scripts in `scripts/`, plus tests and specs. All engine changes are made and tested there first. | | ||
| | [rossoctl/agent-skills](https://github.com/rossoctl/agent-skills) | Skills designed to work standalone as well as with RepoMan. | | ||
| | [rossoctl/repoman](https://github.com/rossoctl/repoman) (this repo) | Distribution (`rossoctl-repoman` marketplace) and the canonical home for RepoMan-specific `SKILL.md`s. The engine is not authored here. | | ||
|
|
||
| See the `[CHANGELOG.md](https://github.com/rossoctl/repoman/blob/main/CHANGELOG.md)` for release history. | ||
|
|
||
| ### Contributor workflow | ||
|
|
||
| 1. **Place the work.** A skill that is useful on its own → author it in | ||
| agent-skills. A RepoMan-specific program (keeps state under `~/.repoman`) → | ||
| deterministic scripts in automation, `SKILL.md` in this repo. New programs | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Step 1 covers the deterministic script and the
As written, a contributor can follow this to the letter and still ship a skill nobody can install or a program
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 2a0d0d3. Step 1 now names all three: the Assisted-By: Claude Code |
||
| start from automation's `docs/program-template.md`. A new program also | ||
| needs repoman-side wiring that is not engine code: a | ||
| `.claude-plugin/marketplace.json` entry, a row in the README | ||
| `## Programs` table, and the program → skill mapping in | ||
| `skills/repoman/SKILL.md`. | ||
| 2. **Test in automation**, next to the existing tests in `tests/`. Bash 3.2 | ||
| only: no `mapfile`, no associative arrays, BSD fallbacks for GNU-only | ||
| flags. If the skill writes to `~/.repoman`, give its `SKILL.md` a | ||
| machine-readable `### Requirements` block so `repoman-check.sh` can gate | ||
| the run. | ||
| 3. **Keep real state out of test runs.** Point `REPOMAN_CONFIG_FILE` / | ||
| `REPOMAN_REPOS_FILE` at scratch files; never hand-edit `~/.repoman` | ||
| (`repoman-setup.sh` is its only writer); drive first runs through | ||
| `repoman-run.sh <program> owner/repo --dry-run` and drop `--dry-run` only | ||
| once the output looks right. | ||
| 4. **Vendor the engine** into this repo (below) — a new engine script must be | ||
| added to both the vendor manifest and its test fixture in | ||
| `tests/test-vendor-engine.sh`, including the expected counts — then run | ||
| that test. To try the plugin without reinstalling from the marketplace: | ||
| `claude plugin marketplace add <this-repo>` then | ||
| `claude plugin install repoman@rossoctl-repoman`. | ||
| 5. **Before the PR**: `git config core.hooksPath scripts/hooks`, sign off | ||
| with `git commit -s` (DCO), use a conventional title, one purpose per PR. | ||
|
|
||
| ### Vendoring the engine | ||
|
|
||
| `skills/repoman/scripts/` is **generated output** — a vendored copy of the | ||
| automation engine, stamped with its source commit in | ||
| [`_vendor.json`](skills/repoman/scripts/_vendor.json). Never edit those files | ||
| directly: an in-place fix bypasses automation's tests and is silently | ||
| overwritten on the next vendor. To pick up engine changes, run it from this | ||
| repo against a **clean automation checkout** — the stamp records the source | ||
| HEAD SHA, so vendoring uncommitted changes would produce a stamp that does not | ||
| match the copied bytes (the script rejects a dirty source unless | ||
| `--allow-dirty` is passed): | ||
|
|
||
| ```bash | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense — this section describes the current single-dest vendoring, and #5 will extend it to the per-program Assisted-By: Claude Code |
||
| scripts/vendor-engine.sh --source <path-to-automation-checkout> \ | ||
| --dest skills/repoman/scripts | ||
| ``` | ||
|
|
||
| The engine scripts are vendored from [rossoctl/automation](https://github.com/rossoctl/automation) | ||
| (the development source of truth) into this distribution repo, with a provenance stamp | ||
| (`skills/repoman/scripts/_vendor.json`) recording the exact source commit. See the | ||
| `CHANGELOG.md` for release history. | ||
| The script copies an explicit manifest (never a glob, so it cannot touch the | ||
| standalone skills' own `scripts/`), pre-validates the whole manifest before | ||
| copying anything, and rewrites `_vendor.json` with the automation HEAD SHA it | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 2a0d0d3 — docs side: the README invocation and the CLAUDE.md bullet now both require a clean automation checkout (fix committed), with the reason stated (the stamp records the source HEAD SHA, so a dirty tree stamps a SHA that does not contain the vendored bytes). Agreed the stronger fix — Assisted-By: Claude Code
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Filed as #20. One correction to the review's note: Assisted-By: Claude Code |
||
| vendored from. `tests/test-vendor-engine.sh` is its regression test. | ||
|
|
||
| ## License | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,17 +8,36 @@ set -uo pipefail | |
| # Part of the RepoMan v0.1.0 packaged release (epic rossoctl/automation#72). | ||
| # | ||
| # vendor-engine.sh --source <automation-repo> --dest <repoman-scripts-dir> | ||
| # [--allow-dirty] | ||
|
|
||
| SRC="" DEST="" | ||
| SRC="" DEST="" ALLOW_DIRTY=false | ||
| while [ $# -gt 0 ]; do | ||
| case "$1" in | ||
| --source) SRC="${2:-}"; shift 2 ;; | ||
| --dest) DEST="${2:-}"; shift 2 ;; | ||
| --allow-dirty) ALLOW_DIRTY=true; shift ;; | ||
| *) echo "ERROR: unknown arg: $1" >&2; exit 2 ;; | ||
| esac | ||
| done | ||
| [ -n "$SRC" ] && [ -n "$DEST" ] || { echo "ERROR: --source and --dest are required" >&2; exit 2; } | ||
|
|
||
| # Fail closed: if $SRC cannot be inspected at all (not a git checkout — e.g. | ||
| # a tarball extract — or git missing), the dirty check below would read the | ||
| # resulting empty output as "clean", the run would only die at the stamp | ||
| # step, and the dest would be left half-vendored with a stale _vendor.json. | ||
| # Unconditional: the stamp needs a source HEAD even with --allow-dirty. | ||
| if ! git -C "$SRC" rev-parse --git-dir >/dev/null 2>&1; then | ||
| echo "ERROR: cannot inspect $SRC (not a git checkout?); the provenance stamp requires a source HEAD" >&2; exit 1 | ||
| fi | ||
|
|
||
| # Provenance guard: the stamp records the source HEAD SHA, so vendoring a | ||
| # dirty tree would stamp a commit that does not contain the copied bytes | ||
| # (see repoman#20). Reject a dirty source unless --allow-dirty is passed | ||
| # (scratch experiments only; the stamp then knowingly lies about the bytes). | ||
| if [ "$ALLOW_DIRTY" = false ] && [ -n "$(git -C "$SRC" status --porcelain 2>/dev/null)" ]; then | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion — the guard fails open: Since the stamp requires if [ "$ALLOW_DIRTY" = false ]; then
if ! DIRTY=$(git -C "$SRC" status --porcelain 2>&1); then
echo "ERROR: cannot inspect $SRC for uncommitted changes (not a git checkout?)" >&2; exit 1
fi
[ -z "$DIRTY" ] || { echo "ERROR: source $SRC has uncommitted changes; commit or stash them so the provenance stamp matches the vendored bytes (or pass --allow-dirty)" >&2; exit 1; }
fiWorth a regression case too: a source directory with every manifest file but no
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jimcadden As the AI agents like to say "belt-and-suspenders". Worth fixing.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 1606d1d. Went with the fail-early shape from the sibling thread (an up-front Your regression case is in: Assisted-By: Claude Code
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion (non-blocking): the guard swallows Since the guard exists to keep the stamp honest, it should fail-closed when
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 1606d1d, along the lines of your suggestion: an up-front Also added the regression case clawgenti asked for on the sibling thread: a source holding the full manifest but no Assisted-By: Claude Code |
||
| echo "ERROR: source $SRC has uncommitted changes; commit or stash them so the provenance stamp matches the vendored bytes (or pass --allow-dirty)" >&2; exit 1 | ||
| fi | ||
|
|
||
| # The 26 engine shell scripts. Flat set: nearly all source program-lib.sh, | ||
| # which sources core.sh/github-api.sh/fork.sh/org.sh/repoman-requirements.sh. | ||
| MANIFEST="automation-health-dashboard core dep-bump-fixer dep-bump-scanner \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's about time to fix #5 before releasing
v0.1.3. I have assigned it to my local Claude, but with the instruction/understanding that merging a PR for it is non-blocking for this one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: #5 cannot land until this one merges because the mechanistic part of it to be done on
repomanwould also change the same set of files that this PR does.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acknowledged — sequencing noted: this merges first, then #5 (its mechanistic repoman-side changes touch the same files as this PR). No action here.
Assisted-By: Claude Code