Skip to content

[AAASM-6444] ✨ (init): Add org_id and registration_key to init_assembly - #390

Merged
Chisanan232 merged 5 commits into
mainfrom
v0.0.1/AAASM-6444/feat/sdk_org_identity
Nov 10, 2026
Merged

Chisanan232 merged 5 commits into
mainfrom
v0.0.1/AAASM-6444/feat/sdk_org_identity

Conversation

@Chisanan232

Copy link
Copy Markdown
Contributor

Description

init_assembly() can now carry an organization claim and the operator key the gateway binds it to. Without them an agent registers org-less, as before; with org_id plus a registration_key bound to that org the gateway accepts the claim, and a later process of the same agent (including after a gateway restart) re-binds to its registry identity instead of being refused.

  • Python: org_id and registration_key parameters of init_assembly are passed down to the runtime client (commit 697e37b, with unit tests in test/unit/core/test_init_org_identity.py).
  • Native: the PyO3 RuntimeClient.register takes the same two optional arguments, and the shared agent-assembly crates are pinned to the AAASM-6451 merge (core main d4093e89b), which provides AssemblyConfig::org_id / registration_key and the gateway-side org binding and restart re-bind. The binding and the pin are one commit because neither compiles without the other.

Limits: an identifier alone never authorizes a re-bind; a running process that is already registered when the gateway restarts must itself restart (the SDK does not re-register on Unauthenticated).

Type of Change

  • ✨ New feature

Breaking Changes

  • No (both arguments are optional)

Related Issues

  • Related Jira ticket: AAASM-6444
  • Related: AAASM-6447, AAASM-6451 (agent-assembly #2848)

Testing

  • Unit tests added / updated

  • test/unit/core/test_init_org_identity.py: 4 passed.

  • cargo check --all-targets and cargo clippy --all-targets -- -D warnings in native/aa-ffi-python against the new pin: exit 0.

  • ruff check and ruff format --check: clean. mypy agent_assembly reports only environment errors in the local dev venv (the native agent_assembly._core module and grpc stubs are not installed there), none in changed files.

  • Real stack, release-candidate build of core d4093e89b with a wheel built from this tree (ephemeral build): J59 20/20 and J56 11/11 CANDIDATE_VERIFIED, and a kill -9 gateway restart check 12/12 (same registry ids after restart, no duplicate, a second holder of the label becomes a separate agent, an org claim without the key is refused).

Checklist

  • Code follows project style guidelines
  • Self-review of the diff completed
  • Commits are small and follow the Gitmoji convention

🤖 Generated with Claude Code

https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4

Chisanan232 and others added 2 commits November 6, 2026 09:25
The organization is a claim the gateway validates against the operator
registration key. Both are forwarded to the native register only when set, so
the existing call shape is unchanged, and a native build that cannot carry them
fails init instead of registering the agent org-less.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4
…gister

Pin the shared agent-assembly crates to the AAASM-6451 merge (main d4093e89b), which
adds AssemblyConfig::org_id and registration_key, and expose both as optional
arguments of the PyO3 register call. Absent means an org-less registration, as before.
The two changes are one unit: the binding does not compile against the old pin and
the new pin does not compile without the binding.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4
@codecov

codecov Bot commented Nov 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Chisanan232 and others added 2 commits November 10, 2026 05:21
An empty key reached the native client as Some(""), which overrides the
AA_REGISTRATION_KEY environment fallback and sends an empty header the gateway
refuses; an empty org_id became an empty claim. Normalise both to None in
init_assembly. Found in independent review of the org identity change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4
…ailure output

The leak test fails when the key is interpolated into the unregistered warning
(checked by mutation) and passes without it.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4
@Chisanan232

Copy link
Copy Markdown
Contributor Author

OWNER-MERGE-REVIEW head=0f6eb5546f66311d7f24652c27800d1cbd9daf1b verdict=PASS blocking=0 reviewer=claude-independent-agent

Brings in the FUNDING.yml-only change (HORO-2531) so the branch is current.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TLpw696KjUDUg4QjH83En4
@sonarqubecloud

Copy link
Copy Markdown

@Chisanan232

Copy link
Copy Markdown
Contributor Author

OWNER-MERGE-REVIEW head=90f085b348ec0c9dc2b3b65e836e8667e53933ac verdict=PASS blocking=0 reviewer=claude-independent-agent

@Chisanan232

Copy link
Copy Markdown
Contributor Author

OWNER-ADMIN-MERGE (same-identity REVIEW_REQUIRED deadlock exception, engineering-workflow exception 2) for head 90f085b. Verified identity: Chisanan232 (author; org AI-agent-assembly role=admin, checked just now). Only remaining blocker: GitHub required approving review, which the author cannot supply for their own PR. At this head: independent adversarial review clean (no Critical/High), OWNER-MERGE-REVIEW PASS comment posted, 23 checks success + 7 skipped, mergeable, 0 unresolved threads, 0 REQUEST_CHANGES. Evidence recorded earlier: J59 20/20, J56 11/11, gateway-restart 12/12, J08 6/6 on an ephemeral wheel (evidence only). Merge by merge commit pinned to this head, on the owner explicit instruction; host Allow once / Deny prompt applies. Merging does not tag or publish anything.

@Chisanan232
Chisanan232 merged commit bff6b75 into main Nov 10, 2026
30 checks passed
@Chisanan232
Chisanan232 deleted the v0.0.1/AAASM-6444/feat/sdk_org_identity branch November 10, 2026 10:35
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