feat: build & test relayflows core against @agent-relay 8.x
User description
Summary
Brings packages/core to a compiling, building state for the first time in this repo (it was imported from the relay monorepo mid-migration and never built here), migrates it off the removed v7 @agent-relay/sdk broker API onto @agent-relay/harness-driver 8.2, and rebrands the primitives to the @relayflows scope.
Depends on @agent-relay/harness-driver@8.2.0 (the SpawnedAgentHandle lifecycle primitive, added in AgentWorkforce/relay#1050).
Primitives
- Rename
@agent-relay/{github,slack,browser}-primitive→@relayflows/*, aligned to the0.1.0lineage. Updates core deps, imports, README, and the publish workflow's release notes + build order.
Core SDK migration (v7 → v8)
- Broker surface swapped from the removed v7
AgentRelaytoHarnessDriverClient: construction viaHarnessDriverClient.spawn({ onStderr }); the 7 legacy named listeners rewritten as a singleonEvent(BrokerEvent)dispatcher (the named event bus isn't fed in direct-client usage);spawnPty,listAgents/release,shutdown; idle-nudge viasendMessage. - Consumes the new
SpawnedAgentHandle(waitForExit/waitForIdle/exitCode) through a thin localWorkflowAgentHandlewrapper that preserves the runner's existing string contract (sowaitForExitWithIdleNudgingis unchanged). - Vendored the deleted CLI utilities (
getCliDefinition/resolveCliSync/resolveSpawnPolicy) intocore/src/cli-registry.ts;stripAnsi→strip-ansi. - Bumped
@agent-relay/{cloud,config,sdk,harness-driver,harnesses}to^8.2.0; unified the repo on one SDK major (droppedbrowser-primitive's vestigial7.1.1pin).
✅ core + cli typecheck clean and build.
Tests — ⚠️ in progress (why this is a draft)
- ✅ Repaired monorepo-era import paths (
../workflows/*,../../provisioner/*) and the builtin-templates path (yaml-validation: 0 → 143 passing). - ✅ Established + applied the
HarnessDriverClientmock pattern:workflow-runner.test.ts0 → 59/65, via aBrokerEvent-translatingemitMockEventshim +fail-fastreconciliation (the runner now defaults tostrategy:'retry', so first-pass failure tests opt into fail-fast). - 🔧 Remaining: migrate the same mock shape across ~11 more broker-mock test files (they currently spawn real brokers), and reconcile the supervised/owner/review behavioral assertions to the current runner. These were broken on extraction from the monorepo, independent of the SDK change.
See docs/sdk-v8-migration-plan.md for the full plan and findings.
🤖 Generated with Claude Code
Summary by cubic
Migrated packages/core from v7 @agent-relay/sdk to @agent-relay/harness-driver@8.2, rebranded primitives to @relayflows/*, and brought the core test suite to green.
-
Refactors
- Swapped v7 broker API for
HarnessDriverClientwith a singleonEvent(BrokerEvent); preserved runner behavior via aWorkflowAgentHandleadapter overSpawnedAgentHandle. - Vendored CLI helpers (
getCliDefinition,resolveCliSync,resolveSpawnPolicy) intocore/src/cli-registry.ts; switched tostrip-ansi. Updated integrations to@relayflows/*and publish order to build primitives first. - Minor cleanup: ignore
**/.agent-relay/in VCS and validate script file extensions before existence checks.
- Swapped v7 broker API for
-
Tests
- Repaired and migrated the suite to the new driver: mock
HarnessDriverClient, use the runner’sexecutorseam to avoid real spawns, and reconcile to{ reason }results and fail-fast behavior. Full suite passing. - Added vitest configs with a plugin to externalize the
node:sqlitebuiltin and capped fork concurrency; updated trajectory path expectations and permission-audit path via@agent-relay/cloud’sgetDefaultPermissionAuditPath.
- Repaired and migrated the suite to the new driver: mock
CodeAnt-AI Description
Move core to the v8 agent runtime and rename the primitives to @relayflows
What Changed
- Core now uses the v8 harness driver for agent spawning, lifecycle tracking, idle nudges, and broker events.
- The workflow runner keeps the same user-facing behavior while handling the new agent handle format behind the scenes.
- GitHub, Slack, and Browser primitives were renamed to the
@relayflows/*package scope, and the publish workflow now builds them before core. - Workflow tests were updated to match the new runtime behavior, including fail-fast cases, review decisions, idle nudges, and trajectory file locations.
Impact
✅ Workflows run against the v8 agent runtime
✅ Fewer breakages from renamed packages
✅ Clearer workflow test coverage for retry, review, and idle behavior
💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
@codeant-ai ask: Your question here
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
@codeant-ai ask: Can you suggest a safer alternative to storing this secret?
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
@codeant-ai: Your feedback here
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
@codeant-ai: Do not flag unused imports.
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
@codeant-ai: review
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.