Skip to content

fix(swarm): align local swarm.json anchors and ketchup plan.json with agy 1.5.9 - #6

Merged
caelaxie merged 3 commits into
mainfrom
fix/local-swarm-anchor-and-ketchup-plan
Nov 15, 2026
Merged

caelaxie merged 3 commits into
mainfrom
fix/local-swarm-anchor-and-ketchup-plan

Conversation

@caelaxie

Copy link
Copy Markdown
Contributor

Why

Our compatibility audit against agy 1.5.9 native swarm surfaced two minor maintenance gaps in local swarm anchor parsing and /ketchup Overview inspection. agy 1.5.9 writes .system_generated/swarm/swarm.json with backend set to "local" and swarm_id set to the coordinator conversation ID on local swarms, and writes .system_generated/swarm/plan.json when swarm_pane is active. This PR aligns hooks/guard.mjs and /ketchup with both agy 1.5.9 runtime artifacts.

What changed

  • Updated getAnchorCoordinatorId, parseRemoteSwarmAnchor, and inspectSwarmDirectory in hooks/guard.mjs so backend "local" swarm.json anchors resolve swarm_id locally, never invoke remote swarm CLIs, and allow non-worker-roots.json caching when members.json is absent.
  • Added behavioral regression coverage in hooks/guard.test.mjs covering full local swarms, orphaned title-only local swarm.json anchors, plain-swarm suppression, and resolved or unresolved remote spanner anchors.
  • Updated skills/ketchup/SKILL.md and README.md so ro-swarm and ro-history inspect .system_generated/swarm/plan.json and board Screenshot lines alongside optional narrator view.json, while documenting the agy CLI fallback when swarm_pane and swarm_narrator are omitted from <skills>.

Scope

  • Covers local swarm.json anchor handling in hooks/guard.mjs and plan.json inspection guidance in skills/ketchup/SKILL.md and README.md.
  • Leaves remote spanner roster resolution and existing worker role-capsule rules unchanged.

Blast Radius

hooks/guard.mjs runs on SessionStart, PreInvocation, and PreToolUse across coordinator and swarm worker sessions. Existing local swarms with members.json and remote spanner anchors retain identical behavior, while orphaned local swarm.json files stop bypassing non-worker-roots.json caching or probing remote board CLIs.

Verification

  • Confirmed the new regression test in hooks/guard.test.mjs fails before the hooks/guard.mjs fix (1 failed) and passes on HEAD (TMPDIR=/tmp node --test hooks/guard.test.mjs, 30/30 passed across 10 suites).
  • Ran agy plugin validate --strict --json . and a clean temporary HOME agy plugin install . plus manifest and permissions check (13 skills, 4 capsules, 6 topologies, 1 hook, 0 findings).
  • Ran ./skills/pstack/scripts/watch-pr --help (exit 0).

Update skills/ketchup/SKILL.md (frontmatter description, ro-swarm, and ro-history) and the /ketchup row in README.md so Swarm UI Overview inspection checks .system_generated/swarm/plan.json and board.jsonl Screenshot lines alongside optional narrator view.json.

Refine the agy CLI fallback note to state that agy CLI sessions omit both swarm_pane and swarm_narrator from <skills>, so ketchup falls back to board.jsonl and members.json when neither plan.json nor view.json exists.

Verified with agy plugin validate --strict . and agy plugin validate --strict --json . (exit 0, 13 skills, 1 hook, 0 findings).
@caelaxie
caelaxie merged commit 5ae7d5b into main Nov 15, 2026
1 check passed
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.

1 participant