← Public packages
@brandontroberts/sync-fork
Automatically sync forked Kody community packages with upstream in Kody Cloud using Graft's repo-mode fork mechanism.
Files
AGENTS.md
Guidance for coding agents working with @brandontroberts/sync-fork.
What this package does
- Subscribes to
community.fork.upstream_updatedand runs Graft's repo-modeforksync natively in Kody Cloud (workerd) by default over Git Smart HTTP v1 (kody.packageGetGitRemote+ public upstream.gitremote), with no Execution Context required. - Automatically delegates forks that configure host shell commands (
testCommand,agentCommand, orexecution: 'context') to./sync-on-contexton an Execution Context viaworkflows.create. - Stores per-fork policies (
fork_policies) and sync run history (sync_runs, includingreportMd) inpackageStorage(). - Emits
@brandontroberts/sync-fork.completedafter every run (directly on Kody Cloud, or via./emit-sync-completedfrom Execution Context runs).
Rules
- No
node:*imports insrc/. Kody bundlessrc/forworkerd; cloud git/graft operations live in pure JS (git-objects.ts,git-http.ts,merge3.ts,cloud-graft.ts,cloud-sync.ts) and host operations go throughCommandRunner(kody.command.run). - Use
.tsextensions on relative imports insrc/. Kody resolves relative module specifiers verbatim against workspace files (./storage.ts, never./storage.js). - Only published npm dependencies in
package.json. Becausepackages/kodyis published viagit subtree split, never useworkspace:*inpackages/kody/package.json. - Keep
src/cloud-sync.ts,src/cloud-graft.ts,src/git-http.ts,src/route.ts,src/sync.ts,src/storage.ts, andsrc/completion-event.tspure/injectable so Vitest can test them directly against realgit(including realgit upload-pack/git receive-packHTTP), realgraft, and real SQLite without Kody cloud. - No cross-scope
kody:strings anywhere in source or docs (Kody's publish check scans docs too). - Never claim behavior was verified unless
testCommandor the project's tests ran and passed. Graft checks fit, not behavior. - Fail loudly. Missing commits, git errors, failed tests, or unschedulable host-command policies must never silently push, publish, or skip checks.