Skip to content

feat: Machine Capability Discovery & needs:* Label Routing (#514)#520

Merged
bradygaster merged 4 commits intobradygaster:devfrom
tamirdresher:tamirdresher/514-machine-capability-routing
Mar 23, 2026
Merged

feat: Machine Capability Discovery & needs:* Label Routing (#514)#520
bradygaster merged 4 commits intobradygaster:devfrom
tamirdresher:tamirdresher/514-machine-capability-routing

Conversation

@tamirdresher
Copy link
Copy Markdown
Collaborator

Closes #514

Adds machine capability discovery and needs:* label-based issue filtering for Ralph.

Changes

  • New SDK module: packages/squad-sdk/src/ralph/capabilities.ts

    • loadCapabilities(): Reads machine-capabilities.json from project or home dir
    • extractNeeds(): Extracts needs:* labels from issues
    • canHandleIssue(): Checks if machine can handle an issue
    • filterByCapabilities(): Filters issue list by machine capabilities
    • KNOWN_CAPABILITIES: 8 well-known capability identifiers
  • New template: .squad-templates/machine-capabilities.md

    • Setup guide for capability manifests
    • Label reference table
    • Kubernetes integration (node labels + DaemonSet)
  • Tests: test/capabilities.test.ts (12 test cases)

  • Changeset included

How It Works

  1. Machine declares capabilities in ~/.squad/machine-capabilities.json
  2. Issues tagged needs:gpu, needs:browser etc. are filtered
  3. Ralph skips issues where required capabilities are missing
  4. Issues without needs:* labels always pass through (opt-in)

Context

Based on production experience running Squad across laptops, DevBoxes, and AKS clusters with 8 different capability types.

Copilot and others added 2 commits March 22, 2026 22:14
…er#514)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…er#514)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Owner

@bradygaster bradygaster left a comment

Choose a reason for hiding this comment

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

Solid feature — the opt-in capability system is clean and the watch.ts integration is surgical. Two things to address:\n\n1. package-lock.json changes: This PR bumps the Node engine requirement from >=20.0.0\ to >=22.5.0\ across root, CLI, and SDK packages. This is a breaking change that needs its own discussion/decision — please revert the package-lock.json changes so this PR stays scoped to the capability feature.\n2. Stray test file: \ est/capabilities.test.ts\ should be in this PR (not #519 where it currently also appears). Make sure it's included here.\n\nArchitecture-wise, the discriminated union return type and null-capabilities pass-through are exactly right. Nice work! 👍

bradygaster added a commit to tamirdresher/squad that referenced this pull request Mar 23, 2026
…r#520)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
bradygaster added a commit that referenced this pull request Mar 23, 2026
* docs: KEDA external scaler template for autoscaling (#516)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: remove stray test/capabilities.test.ts (belongs to PR #520)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: bradygaster <bradyg@microsoft.com>
bradygaster and others added 2 commits March 22, 2026 21:18
The lockfile had been regenerated with >=22.5.0 engine requirements,
which is a breaking change. Reverting to keep Node >=20 compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…exports)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bradygaster bradygaster merged commit 8d49066 into bradygaster:dev Mar 23, 2026
0 of 2 checks passed
diberry pushed a commit to diberry/squad that referenced this pull request Mar 23, 2026
Flight review blocker — config file was .squad/config.json, should be
machine-capabilities.json per PR bradygaster#520's loadCapabilities() implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
diberry pushed a commit to diberry/squad that referenced this pull request Mar 23, 2026
Flight review blocker — config file was .squad/config.json, should be
machine-capabilities.json per PR bradygaster#520's loadCapabilities() implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
chrislomonico pushed a commit to clomonico/squad that referenced this pull request Mar 26, 2026
bradygaster#545)

Adds opt-in OTel shell metrics (SQUAD_TELEMETRY=1): session_count, session_duration_ms, agent_response_latency_ms, error_count. Zero overhead when off.

Closes bradygaster#508, Closes bradygaster#520, Closes bradygaster#526, Closes bradygaster#530, Closes bradygaster#531

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
atuannguyen1101 pushed a commit to atuannguyen1101/squad that referenced this pull request Mar 31, 2026
Flight review blocker — config file was .squad/config.json, should be
machine-capabilities.json per PR bradygaster#520's loadCapabilities() implementation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.

feat: Machine Capability Discovery & Label-Based Issue Routing for Ralph

2 participants