Skip to content

Add machine-readable health metadata - #2384

Merged
bradygaster merged 8 commits into
github:devfrom
omercangumus:omercangumus/2357-structured-health
Nov 5, 2026
Merged

bradygaster merged 8 commits into
github:devfrom
omercangumus:omercangumus/2357-structured-health

Conversation

@omercangumus

Copy link
Copy Markdown
Contributor

Summary

  • Add versioned runtime metadata to squad health --json without changing human output.
  • Emit a JSON health metadata line from squad_state_health while retaining its existing state and storage lines.
  • Document both contracts and cover the fields with focused tests.

Validation

  • SDK and CLI builds, TypeScript lint, markdownlint, and cspell passed.
  • Focused health and state-MCP tests: 70 passed.
  • The full local suite showed unrelated workflow/subprocess failures in this Windows environment (including missing jq); it was stopped after those failures accumulated.

Closes #2357

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

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🟠 Impact Analysis — PR #2384

Risk tier: 🟠 HIGH

📊 Summary

Metric Count
Files changed 8
Files added 1
Files modified 7
Files deleted 0
Modules touched 5
Critical files 1

🎯 Risk Factors

  • 8 files changed (6-20 → MEDIUM)
  • 5 modules touched (5-8 → HIGH)
  • Critical files touched: packages/squad-sdk/src/tools/index.ts

📦 Modules Affected

docs (1 file)
  • docs/src/content/docs/reference/cli.md
root (1 file)
  • .changeset/blue-health-metadata.md
squad-cli (2 files)
  • packages/squad-cli/src/cli/commands/health.ts
  • packages/squad-cli/src/cli/commands/state-mcp.ts
squad-sdk (1 file)
  • packages/squad-sdk/src/tools/index.ts
tests (3 files)
  • test/cli/health-command.test.ts
  • test/cli/state-mcp.test.ts
  • test/tools.test.ts

⚠️ Critical Files

  • packages/squad-sdk/src/tools/index.ts

This report is generated automatically for every PR. See #733 for details.

@github-actions

github-actions Bot commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

🛫 PR Readiness Check

ℹ️ This comment updates on each push. Last checked: commit cc90f92

PR Scope: 📦🔧 Mixed (product + infrastructure)

⚠️ 3 item(s) to address before review

Status Check Details
❌ Single commit 8 commits — consider squashing before review
✅ Not in draft Ready for review
✅ Branch up to date Up to date with dev
❌ Copilot review No Copilot review yet — it may still be processing
✅ Changeset present Changeset file found
✅ Scope clean No .squad/ or docs/proposals/ files
✅ No merge conflicts No merge conflicts
✅ Copilot threads resolved 1 active Copilot thread(s) resolved (3 outdated skipped)
❌ CI passing 14 check(s) still running

Files Changed (8 files, +236 −14)

File +/−
.changeset/blue-health-metadata.md +6 −0
docs/src/content/docs/reference/cli.md +5 −0
packages/squad-cli/src/cli/commands/health.ts +79 −4
packages/squad-cli/src/cli/commands/state-mcp.ts +2 −0
packages/squad-sdk/src/tools/index.ts +48 −7
test/cli/health-command.test.ts +67 −2
test/cli/state-mcp.test.ts +17 −1
test/tools.test.ts +12 −0

Total: +236 −14


This check runs automatically on every push. Fix any ❌ items and push again.
See CONTRIBUTING.md and PR Requirements for details.

@omercangumus
omercangumus marked this pull request as ready for review November 1, 2026 21:00
@bradygaster
bradygaster requested a balanced review from Copilot November 4, 2026 23:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Health metadata misreports the resolved backend and drops team identifiers from supported state roots, causing CLI/MCP inconsistencies and indistinguishable paths for sibling teams.

2 open issues
What changed in this PR

Adds machine-readable health metadata for external coordinators using Squad’s CLI and state MCP bridge, addressing #2357 while preserving existing human-readable health output.

Changes:

  • Adds version, backend, resolved team directory, and launch metadata to CLI JSON and MCP health responses.
  • Extends focused tests and documents both output contracts.
  • Includes patch changesets for the CLI and SDK.
File Description
test/​cli/​state-mcp.test.ts Verifies the MCP metadata payload and aligns the SDK cache-reset import.
test/​cli/​health-command.test.ts Checks metadata in successful and failed CLI reports.
packages/​squad-sdk/​src/​tools/​index.ts Adds versioned JSON metadata to the state health tool.
packages/​squad-cli/​src/​cli/​commands/​state-mcp.ts Supplies CLI version and stdio launch mode to the registry.
packages/​squad-cli/​src/​cli/​commands/​health.ts Adds runtime metadata to structured health reports.
docs/​src/​content/​docs/​reference/​cli.md Documents CLI and MCP health metadata.
.changeset/​blue-health-metadata.md Records CLI and SDK patch releases.

Review effort: Balanced

brady gaster and others added 3 commits November 4, 2026 15:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Linked-team health metadata can report the shared team’s backend instead of the project’s runtime backend, causing inconsistent health results when their settings differ.

1 open issue
2 resolved since last review

Review effort: Balanced

brady gaster and others added 2 commits November 4, 2026 16:06
Part of github#2357

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Passing the normalized backend setting as an override can make health metadata report two-layer while the runtime uses local for a whitespace-padded configuration value.

1 open issue
1 resolved since last review

Review effort: Balanced

brady gaster and others added 2 commits November 4, 2026 16:18
Part of github#2357

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the CLI and MCP health-metadata changes.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@bradygaster
bradygaster merged commit 7b731ec into github:dev Nov 5, 2026
23 checks 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.

health: structured machine readable output (version, backend, resolved team dir) for external coordinators

3 participants