Skip to content

core: add fork maintenance policy, sync helper, and audit CI - #19

Merged
carochacs merged 4 commits into
mainfrom
claude/fork-maintenance-rules-d31pbe
Aug 2, 2026
Merged

core: add fork maintenance policy, sync helper, and audit CI#19
carochacs merged 4 commits into
mainfrom
claude/fork-maintenance-rules-d31pbe

Conversation

@carochacs

@carochacs carochacs commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

What

Adds a personal-fork maintenance policy and the tooling to enforce it, so keeping this fork in sync with got-feedback/feedBack stays cheap.

  • docs/fork-maintenance.md — a priority matrix (upstream sync > hook injection > plugin isolation > direct core edits), commit-labeling rules (core:/hook:/sync: prefixes for anything touching a core path), and a decision tree. Includes an audit of this fork's current state as a baseline: no upstream remote was configured, and three existing fork-only commits are direct, unlabeled core edits (recorded for reference, not retroactively flagged).
  • scripts/fork-sync.sh — sets up the missing upstream remote, reports how far ahead/behind origin/HEAD is vs got-feedback/feedBack:main, and merges it in (--report-only to just check).
  • .github/workflows/fork-audit.yml — a new, fork-only CI workflow (intentionally not added as a job inside ci.yml/ship-ci.yml, so pulling upstream changes to those files never conflicts with this policy):
    • core-commit-labeling fails a PR if any commit it introduces touches a core path without a core:/hook:/sync: subject prefix. Only diffs new commits against the PR base, so existing history isn't retroactively broken.
    • upstream-drift is advisory-only — warns (never fails) when the PR's base branch is more than 50 commits behind got-feedback/feedBack:main.

No behavior change to the app itself — this is process/tooling only.

feedpak surface

  • This PR does not change how the app reads/writes feedpaks (manifest keys, pack files, folder layout)

Checklist

  • CHANGELOG.md [Unreleased] updated — skipped; this is internal fork tooling, not a user-visible app change
  • Tests added/updated for new behaviour — n/a, no app behavior changed; the CI logic itself was manually verified against this fork's actual commit history (see PR discussion if needed)
  • Commits are DCO signed off (git commit -s) — not signed off; this PR targets this fork's own main, not got-feedback/feedBack, so DCO wasn't applied. Happy to add sign-off if this fork wants to hold itself to the same standard.

Generated by Claude Code

Personal-fork governance: a priority matrix (sync > hooks > plugin
isolation > direct core edits), commit-labeling rules, and a decision
tree, plus the tooling to actually enforce it — scripts/fork-sync.sh sets
up the missing upstream remote and reports/merges drift, and
.github/workflows/fork-audit.yml fails new PR commits that touch core
paths without a core:/hook:/sync: label (existing history is left alone)
and warns when the branch falls far behind got-feedback/feedBack:main.

Kept as new files rather than edits to ci.yml/ship-ci.yml/CLAUDE.md so
the policy doesn't itself create the exact conflicts it's meant to avoid.
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@carochacs, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 88c86123-05b2-40eb-89c9-8a874d13aa5c

📥 Commits

Reviewing files that changed from the base of the PR and between 0c2ebee and 5a2c6c0.

📒 Files selected for processing (1)
  • .github/workflows/fork-audit.yml
📝 Walkthrough

Walkthrough

Adds a fork maintenance policy, an upstream synchronization script, and a GitHub Actions workflow. The workflow audits core commit prefixes and reports upstream drift.

Changes

Fork maintenance controls

Layer / File(s) Summary
Maintenance policy and routing
docs/fork-maintenance.md
Defines maintenance priorities, core paths, decision rules, enforcement mechanisms, and the current audit baseline.
Upstream synchronization script
scripts/fork-sync.sh
Adds strict argument handling, upstream remote setup, divergence reporting, report-only mode, drift warnings, and optional merging.
Pull-request fork audit
.github/workflows/fork-audit.yml
Adds read-only checks for core-touching commit prefixes and pull-request base drift from upstream main.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant PullRequest
  participant GitHubActions
  participant CommitHistory
  participant UpstreamMain
  PullRequest->>GitHubActions: trigger fork-audit
  GitHubActions->>CommitHistory: inspect introduced commits
  CommitHistory-->>GitHubActions: return core paths and commit subjects
  GitHubActions->>UpstreamMain: compare pull-request base
  UpstreamMain-->>GitHubActions: return commit divergence
Loading
sequenceDiagram
  participant ForkBranch
  participant ForkSync
  participant UpstreamRemote
  ForkSync->>UpstreamRemote: fetch upstream/main
  UpstreamRemote-->>ForkSync: return upstream/main
  ForkSync->>ForkBranch: compare branch divergence
  ForkSync->>ForkBranch: merge upstream/main when required
Loading
🚥 Pre-merge checks | ✅ 22
✅ Passed checks (22 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Plugin Folder Name Matches Manifest Id ✅ Passed The repository uses plugins// layouts; all 12 plugin.json ids exactly match their containing folder names, including case. No plugin manifest changes are in the PR diff.
No Print()/Console.Log In Routes.Py ✅ Passed The PR diff contains only .github/workflows/fork-audit.yml, docs/fork-maintenance.md, and scripts/fork-sync.sh; it has no modified Python files or route logic.
Sibling Imports Use Load_sibling ✅ Passed The PR diff adds only workflow, documentation, and Bash files; it adds no Python module inside plugins/ and no new sibling import.
Routes Namespaced Under /Api/Plugins/Id ✅ Passed The full PR diff adds only workflow, documentation, and sync-script files; no plugin routes.py or plugin.json changes introduce a new route.
Blocking Route Handlers Use Def Not Async ✅ Passed The PR changes only workflow, documentation, and sync-script files; no routes.py file or async route handler is new or modified.
Plugin.Json Version Bumped On Change ✅ Passed The PR changes only CI, Markdown documentation, and a fork-sync tooling script; no files under plugins or plugin source changed, so no plugin.json version bump applies.
No Per-Frame Dom Queries In Draw/Raf ✅ Passed The PR changes only YAML, Markdown, and shell files; no modified .js file contains the prohibited DOM queries, callbacks, or MutationObserver pattern.
Shortcuts Unregistered With Matching Scope ✅ Passed The pull request adds no window.registerShortcut call, so no matching unregisterShortcut or panel cleanup is required.
Idempotent Guard On Top-Level Listeners ✅ Passed The PR diff adds only workflow, documentation, and sync-script files; no plugin screen.js file changes or new top-level listeners exist to check.
Server_files Entries Are Safe Relpaths ✅ Passed The PR diff adds only the workflow, documentation, and sync script; no plugin.json file changes exist, so no server_files entries require validation.
Setrenderer Factory Has Init/Draw/Destroy ✅ Passed The full PR diff adds only .github/workflows/fork-audit.yml, docs/fork-maintenance.md, and scripts/fork-sync.sh; it adds or modifies no window.feedBackViz_ factory.
Overlay Gates On Isdefaultrenderer Instructions ✅ Passed The PR diff adds workflow, documentation, and sync-shell code only; it adds no overlay drawing path or highway.project/fretX positioning that requires renderer or RAF gates.
V3 Ui Mounts Via Playercontrolslot ✅ Passed The PR adds only workflow, documentation, and sync-script content; its added lines contain no #player-controls queries or DOM injection calls.
New Feedpak Manifest Keys Declared In Spec ✅ Passed The PR diff adds only .github/workflows/fork-audit.yml, docs/fork-maintenance.md, and scripts/fork-sync.sh; no named manifest implementation path changes.
Feedpak Manifest Required Keys Present ✅ Passed The PR changes only fork-audit.yml, fork-maintenance.md, and fork-sync.sh; no manifest-assembly code or feedpak/plugin assembly paths are touched.
Changelog Unreleased Section Updated ✅ Passed The full PR diff adds only a fork-audit workflow, maintenance documentation, and a Git sync helper; it does not change application or library behavior, so CHANGELOG.md is not required.
New Python Modules Have Pytest Coverage ✅ Passed The PR adds only YAML, Markdown, and Bash files; no new Python module exists, so the pytest-coverage condition does not apply.
No Hardcoded Secrets Or Tokens In Diff ✅ Passed All 272 added lines were scanned; no AWS-style keys, PEM private-key headers, or literal _TOKEN/_SECRET/_API_KEY/_PASSWORD assignments were found.
Title check ✅ Passed The title clearly summarizes the main changes: fork maintenance policy, synchronization helper, and audit CI.
Description check ✅ Passed The description follows the required template and explains the changes, feedpak impact, checklist exceptions, and verification details.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/fork-maintenance-rules-d31pbe

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fork-audit.yml:
- Line 24: Pin both actions/checkout uses in .github/workflows/fork-audit.yml at
lines 24 and 55 to the immutable commit SHA
11d5960a326750d5838078e36cf38b85af677262 instead of `@v4`.

In `@scripts/fork-sync.sh`:
- Around line 23-26: Update the upstream-remote setup in the fork-sync script to
read the existing upstream URL before fetching or merging. Add the remote only
when absent; if present, require it to match the canonical got-feedback/feedBack
repository URL and stop with an actionable error otherwise. Preserve the
existing fetch and merge flow only after validation succeeds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: b6cce138-9bcb-48bc-9d14-3072d82233a8

📥 Commits

Reviewing files that changed from the base of the PR and between b9e7c3d and adb863c.

📒 Files selected for processing (3)
  • .github/workflows/fork-audit.yml
  • docs/fork-maintenance.md
  • scripts/fork-sync.sh

Comment thread .github/workflows/fork-audit.yml Outdated
Comment thread scripts/fork-sync.sh Outdated
Pin both actions/checkout uses in fork-audit.yml to the immutable
commit SHA (v4.4.0) instead of the mutable @v4 tag.

fork-sync.sh: validate a pre-existing 'upstream' remote's URL before
fetching/merging, instead of trusting any remote named 'upstream'. An
unrelated remote with that name would otherwise get silently fetched
and merged into the branch.

Copy link
Copy Markdown
Collaborator Author

Addressed both CodeRabbit findings in bee4c7a:

  • Pinned both actions/checkout uses in fork-audit.yml to the immutable commit SHA (11d5960a326750d5838078e36cf38b85af677262, currently v4.4.0) instead of the mutable @v4 tag — verified independently via git ls-remote before applying.
  • fork-sync.sh now validates a pre-existing upstream remote's URL matches the canonical got-feedback/feedBack repo before fetching/merging, and refuses with an explicit error otherwise, rather than trusting any remote named upstream.

Generated by Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
.github/workflows/fork-audit.yml (1)

62-64: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Keep upstream drift advisory when the fetch fails.

A failed git fetch or git rev-list exits this step before the warning logic runs. A transient network failure can therefore fail the PR check, despite this job being documented as advisory-only.

Handle both failures explicitly, emit a warning, and exit successfully when drift cannot be measured.

Proposed fix
-          git fetch --no-tags https://github.com/got-feedback/feedBack.git main:refs/remotes/canonical-upstream/main
+          if ! git fetch --no-tags https://github.com/got-feedback/feedBack.git main:refs/remotes/canonical-upstream/main; then
+            echo "::warning::Unable to fetch got-feedback/feedBack:main; skipping upstream drift check."
+            exit 0
+          fi
           BASE_SHA="${{ github.event.pull_request.base.sha }}"
-          behind=$(git rev-list --count "$BASE_SHA"..canonical-upstream/main)
+          if ! behind=$(git rev-list --count "$BASE_SHA"..canonical-upstream/main); then
+            echo "::warning::Unable to calculate upstream drift; skipping check."
+            exit 0
+          fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/fork-audit.yml around lines 62 - 64, Update the upstream
drift calculation around the git fetch and rev-list commands in the workflow so
both failures are handled explicitly. When either command fails, emit a warning
and exit successfully without failing the advisory check; retain the existing
drift warning behavior when the count is measured successfully.
scripts/fork-sync.sh (1)

29-35: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Fetch main into upstream/main.

When remote.upstream.fetch is missing or custom, git fetch upstream main may not update upstream/main. The drift checks and merge then use a stale or missing ref.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/fork-sync.sh` around lines 29 - 35, Update the upstream fetch step in
scripts/fork-sync.sh to explicitly map the fetched main branch to the
upstream/main remote-tracking ref, regardless of the configured
remote.upstream.fetch refspec. Preserve the existing upstream remote setup and
ensure subsequent drift checks and merge operations use the freshly fetched
upstream/main.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/fork-sync.sh`:
- Around line 23-26: Update the upstream remote mismatch handling around
upstream_url so the stderr message never prints the configured remote URL or
embedded credentials; report only that the upstream remote is non-canonical,
while preserving the refusal and remediation guidance.

---

Outside diff comments:
In @.github/workflows/fork-audit.yml:
- Around line 62-64: Update the upstream drift calculation around the git fetch
and rev-list commands in the workflow so both failures are handled explicitly.
When either command fails, emit a warning and exit successfully without failing
the advisory check; retain the existing drift warning behavior when the count is
measured successfully.

In `@scripts/fork-sync.sh`:
- Around line 29-35: Update the upstream fetch step in scripts/fork-sync.sh to
explicitly map the fetched main branch to the upstream/main remote-tracking ref,
regardless of the configured remote.upstream.fetch refspec. Preserve the
existing upstream remote setup and ensure subsequent drift checks and merge
operations use the freshly fetched upstream/main.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 155aeb02-2057-4e74-ad3f-3b3aa3d3688e

📥 Commits

Reviewing files that changed from the base of the PR and between adb863c and bee4c7a.

📒 Files selected for processing (2)
  • .github/workflows/fork-audit.yml
  • scripts/fork-sync.sh

Comment thread scripts/fork-sync.sh Outdated
scripts/fork-sync.sh:
- Don't print the mismatched 'upstream' remote URL to stderr — it could
  contain embedded credentials (https://user:token@...). Report only
  that it isn't canonical.
- Fetch explicitly into refs/remotes/upstream/main instead of relying
  on the default refspec, so a pre-existing 'upstream' remote with a
  customized fetch refspec can't leave upstream/main stale.

fork-audit.yml upstream-drift job:
- GitHub Actions run steps default to `bash -eo pipefail`, so a failed
  fetch/rev-list would fail the job despite it being documented as
  advisory-only. Handle both failures explicitly and exit 0 with a
  warning instead of hard-failing on a transient network error.

Copy link
Copy Markdown
Collaborator Author

Addressed this round's 3 findings in 0c2ebee:

  • fork-sync.sh no longer prints the mismatched upstream remote URL (could carry embedded credentials) — the error now just says it isn't canonical.
  • fork-sync.sh now fetches explicitly into refs/remotes/upstream/main rather than relying on the default refspec, so a pre-existing upstream remote with a nonstandard fetch refspec can't leave that ref stale.
  • fork-audit.yml's upstream-drift job now handles a failed fetch/rev-list explicitly (warn + exit 0) instead of hard-failing — GitHub Actions run steps default to bash -eo pipefail, so a transient network error would otherwise have failed a check documented as advisory-only.

Generated by Claude Code

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/fork-audit.yml:
- Around line 66-67: Move the pull request base and head SHA values from inline
shell assignments/interpolation into the appropriate workflow env blocks, then
update the audit commands to reference those environment variables in quoted
shell arguments. Apply this to the SHA values used around the fork-audit logic,
including the BASE_SHA assignment near the canonical-upstream comparison and the
corresponding HEAD_SHA usage.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 94cdc7bc-d670-405d-80b7-3a9074c7eb29

📥 Commits

Reviewing files that changed from the base of the PR and between bee4c7a and 0c2ebee.

📒 Files selected for processing (2)
  • .github/workflows/fork-audit.yml
  • scripts/fork-sync.sh

Comment thread .github/workflows/fork-audit.yml Outdated
github.event.pull_request.{base,head}.sha were interpolated directly
into run: shell blocks. zizmor flags this as template-injection
regardless of whether the specific field is attacker-controlled — pass
them through env: and reference as shell variables instead, per
GitHub's Actions hardening guidance.

Copy link
Copy Markdown
Collaborator Author

Addressed in 5a2c6c0: BASE_SHA/HEAD_SHA now come from env: blocks instead of direct ${{ }} interpolation in the run: shell — the standard fix for zizmor's template-injection warning, even though these particular fields (commit SHAs) aren't attacker-controlled free text.

CI was fully green on the prior commit (0c2ebee) before this trivial hardening pass.


Generated by Claude Code

@carochacs
carochacs merged commit 6b2e5f0 into main Aug 2, 2026
8 checks passed
carochacs added a commit that referenced this pull request Aug 5, 2026
* core: add fork maintenance policy, sync helper, and audit CI

Personal-fork governance: a priority matrix (sync > hooks > plugin
isolation > direct core edits), commit-labeling rules, and a decision
tree, plus the tooling to actually enforce it — scripts/fork-sync.sh sets
up the missing upstream remote and reports/merges drift, and
.github/workflows/fork-audit.yml fails new PR commits that touch core
paths without a core:/hook:/sync: label (existing history is left alone)
and warns when the branch falls far behind got-feedback/feedBack:main.

Kept as new files rather than edits to ci.yml/ship-ci.yml/CLAUDE.md so
the policy doesn't itself create the exact conflicts it's meant to avoid.

* core: address CodeRabbit review — pin checkout, validate upstream remote

Pin both actions/checkout uses in fork-audit.yml to the immutable
commit SHA (v4.4.0) instead of the mutable @v4 tag.

fork-sync.sh: validate a pre-existing 'upstream' remote's URL before
fetching/merging, instead of trusting any remote named 'upstream'. An
unrelated remote with that name would otherwise get silently fetched
and merged into the branch.

* core: fix credential leak, fail-safety, and fetch-refspec issues

scripts/fork-sync.sh:
- Don't print the mismatched 'upstream' remote URL to stderr — it could
  contain embedded credentials (https://user:token@...). Report only
  that it isn't canonical.
- Fetch explicitly into refs/remotes/upstream/main instead of relying
  on the default refspec, so a pre-existing 'upstream' remote with a
  customized fetch refspec can't leave upstream/main stale.

fork-audit.yml upstream-drift job:
- GitHub Actions run steps default to `bash -eo pipefail`, so a failed
  fetch/rev-list would fail the job despite it being documented as
  advisory-only. Handle both failures explicitly and exit 0 with a
  warning instead of hard-failing on a transient network error.

* core: pass PR SHAs through env instead of template interpolation

github.event.pull_request.{base,head}.sha were interpolated directly
into run: shell blocks. zizmor flags this as template-injection
regardless of whether the specific field is attacker-controlled — pass
them through env: and reference as shell variables instead, per
GitHub's Actions hardening guidance.

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants