Skip to content

feat(golems): add reusable join-code enrollment for bot onboarding#7

Merged
alexk-dev merged 5 commits intomainfrom
feat/hive-bot-integration-epic
Mar 19, 2026
Merged

feat(golems): add reusable join-code enrollment for bot onboarding#7
alexk-dev merged 5 commits intomainfrom
feat/hive-bot-integration-epic

Conversation

@alexk-dev
Copy link
Copy Markdown
Owner

@alexk-dev alexk-dev commented Mar 18, 2026

Summary

This PR establishes the first Hive-side slice of the bot integration contract.

It changes enrollment from a one-time bootstrap secret into a reusable, revocable, TTL-bound join token, returns a copy-ready join code for golemcore-bot, and documents the cross-repo contract that the bot implementation will follow.

What Changed

Reusable enrollment tokens

  • enrollment tokens can now be used more than once until they expire or are revoked
  • Hive tracks registrationCount, lastUsedAt, and lastRegisteredGolemId instead of treating the token as single-use
  • legacy token records remain readable through schema normalization and field aliases during deserialization

Copy-ready join codes for bot onboarding

  • POST /api/v1/enrollment-tokens now returns both the raw token and a ready-made join code in the format <TOKEN>:<URL>
  • the join code uses hive.fleet.public-base-url when configured, with a safe request-derived fallback otherwise
  • the operator flow now matches the intended bot UX: copy the join code once, paste it into the bot, and let the bot register itself

UI updates for operators

  • the enrollment dialog now presents the join code as the primary artifact and adds one-click copy support
  • token messaging, labels, and empty states now describe reusable join tokens instead of one-time secrets
  • the tokens table now shows active/revoked state, registration counts, and the most recent golem registration

Contract and config documentation

  • adds docs/bot-integration-contract.md to freeze the Hive ↔ bot integration model for join codes, config authority, machine session state, and bot-facing endpoints
  • updates SPEC.md to align the product spec with reusable tokens, read-only managed Hive config in the bot, and the join-code-based onboarding flow
  • adds hive.fleet.public-base-url to application config examples so operators can generate externally valid join codes

Verification

  • ./mvnw test
  • cd ui && nvm use && npm run test
  • cd ui && nvm use && npm run build

Notes

  • this is intentionally the first Hive-side slice of the broader bot integration epic
  • follow-up PRs can now build against a more stable enrollment and config contract instead of continuing to iterate on one-time-token semantics

@alexk-dev alexk-dev marked this pull request as ready for review March 18, 2026 21:29
@alexk-dev alexk-dev changed the title feat(golems): start bot integration epic feat(golems): add reusable join-code enrollment for bot onboarding Mar 18, 2026
@alexk-dev alexk-dev merged commit 0ec75b6 into main Mar 19, 2026
2 checks passed
@alexk-dev alexk-dev deleted the feat/hive-bot-integration-epic branch March 21, 2026 15:58
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