Skip to content

fix(ag2-sparrow): Hatch text names the product s.space - #5998

Merged
sonichi merged 5 commits into
mainfrom
fix/hatch-text-says-s-space
Oct 29, 2026
Merged

sonichi merged 5 commits into
mainfrom
fix/hatch-text-says-s-space

Conversation

@sonichi

@sonichi sonichi commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

What changed, and why

The product is now called s.space. Text that people and agents read across ag2-sparrow still said "AG2 Space"; this PR changes 57 strings to "s.space". Only text that a person or agent reads is changed.

file count
adapters/hatch/cli.py 6 (unit Description=, token hint "the s.space Agent Portal", manual test, hold error, posted: line, --mxid help)
adapters/hatch/ag2-sparrow-hatch.sh 3 (heartbeat worker_note ×2, wake reason)
adapters/hatch/keepalive.py 2 (task-not-picked-up / task-held details)
adapters/hatch/builtin-runtime-text.json 2 (built-in prompt, owner_note)
adapters/hatch/hook-definition.json 1 (the hook prompt; see below)
connect_common.py 10 (code prompt and redeem/relay error messages)
connect_bridge.py 1
team_guardrail.py + its canonical src/policy/guardrail.py 2 each (product name only; every other word unchanged)
adapters/codex/connect_cli.py 5 (shape description, argparse description and help)
adapters/claude_code/cli.py 5 (help text)
adapters/claude_code/inbox.py 2 ([s.space] … interrupted / protocol-failure bodies)
adapters/claude_code/shape.py 1
adapters/claude_code/ag2space-inbox/hooks/register.ts 4 (the [s.space task …] envelope ×2, tool descriptions ×2)
adapters/claude_code/ag2space-inbox/hooks/hooks.json 1
adapters/claude_routine/routine-prompt.md 2
adapters/claude_routine/routine_adapter.py 1
adapters/claude_cloud_session/session_adapter.py 1 (the per-task reminder)
adapters/claude_cloud_session/session-prompt.md 2
adapters/claude_cloud_session/README.md 2 (session title example, the quoted reminder)
adapters/claude-code/README.md 2 (the documented envelope lines)

team_guardrail.py is a byte-identical copy of src/policy/guardrail.py (tools/sync_from_src.py). The canonical source is changed with it, so --check still reports "in sync" and the core's own s.space system instructions say the same thing.

Hook definition: every agent re-applies it once

hook-definition.json's prompt changes, so every existing Hatch agent will see install's REQUIRED hook: update line once (the staged definition no longer matches the registered one) and must re-apply it through its hooks tool, updating the hook of that id. verify reports the hook definition as not the staged one until it does.

Unit restart: the systemd unit's Description= also changes, so the next install on a systemd host restarts Sparrow once (the normal changed-unit path).

Left unchanged, and why

  • Comments and docstrings: __init__.py, agent_identity.py, gateway_credentials.py, gateway_credential_sources.py, outbox_adapter.py, hitl/projector.py, remote_gateway_bridge.py (2), local_task_protocol.py (2), delivery_core/contract.py, delivery_core/provider_ag2space.py, runtime_text.py, team_guardrail.py (5), plus module docstrings in the adapters. These files hold no user-visible "AG2 Space" text.
  • Broker wire labels: [AG2 Space reply context; …] / [End AG2 Space …] in local_task_protocol.py, which the hook parses.
  • The connector's name: "the AG2 Space connector" in session-prompt.md (3), routine-prompt.md (1) and the two adapter READMEs (4). In Claude this connector is listed as ag2 space and its tools are mcp__ag2_space__*, so these refer to an existing connector by name. They should change only if the connector is renamed.
  • Frozen fixture: tests/hatch_hook_0_6_0.sh.
  • The rest of adapters/claude-code/README.md: prose naming outside the envelope lines.

Tests and guards updated

  • tests/dotspace-literal-guard.test.py: the guard reads any s.space as a host literal. It now allow-lists each product-name fragment per file, in the guard's documented way ("a string a user reads … is allowed only by a listed fragment"). Each fragment is a prose phrase such as "s.space is busy", never a bare s.space.
  • Pins updated: the unit description (tests/gateway-credential-sources.test.py), the guardrail envelope (tests/ag2space-tier-lines.test.py and the seven tests/fixtures/gateway-task-envelopes/*.txt goldens), the connect messages (test_claude_code_connect.py, test_codex_local_connect.py), the inbox bodies and envelope (ag2space-inbox.test.ts), the hatch task-not-picked-up detail and OWNER_NOTE.

Test results

  • Every packages/ag2-sparrow/tests/test_*.py run as a script: 37/37 exit 0 (for example test_hatch_adapter.py 415 OK, test_codex_local_connect.py 109 OK, test_claude_code_connect.py 99 OK).
  • claude plugin test ag2space-inbox (CLI 2.1.303, as CI pins): 98 pass, 0 fail.
  • Root: dotspace-literal-guard 7 OK, gateway-credential-sources 179 OK, hermetic-env-sentinels 19 OK, ag2space-tier-lines 11 OK, gateway-task-envelope-golden 3 OK, guest-delegation-shared-owner 11 OK, gateway-team-guardrail-inband 12 OK. discord-bridge-collaborator-tier, ag2-sparrow-drift, restructure-compat-shims and local-task-protocol all exit 0. sync_from_src.py --check reports "in sync".
  • tests/ack-claim-lock-cleanup.test.py, which failed in CI on 15f41b7, passes 5/5 locally. Its failure is a cleanup-timing assertion (case d) in code this PR does not touch.
  • bash scripts/review-checks.sh --diff <(git diff origin/main...HEAD): PASS.

Feature/documentation consistency

The docs that quote the changed text are updated with it:

  • packages/ag2-sparrow/README.md: the unit Description= (l. 445), the owner note (l. 703) and the token placeholder naming the Agent Portal (l. 123).
  • adapters/claude-code/README.md: the two envelope lines and --base <s.space backend URL> (l. 365).
  • adapters/claude_cloud_session/README.md: the session title and the quoted reminder.

Prose naming elsewhere in those READMEs (headings, descriptions) is left for a separate docs pass. No behaviour changes beyond the one-time hook re-apply and unit restart above.

🤖 Generated with Claude Code

The Hatch adapter's printed and built-in text says "s.space" where it said
"AG2 Space": the built-in prompt and owner note, the hook's heartbeat
note and wake reason, keepalive's health detail, and cli's unit
description, token hint, manual test, hold error, reply line and --mxid
help. Identifiers, comments, the broker's reply-context labels and the
hook definition are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sonichi and others added 2 commits October 28, 2026 17:37
…the product s.space

"AG2 Space" becomes "s.space" in the text people and agents read across the
package: the claude_code, claude_cloud_session, claude_routine and codex
adapters, connect_common/connect_bridge messages, the team guardrail's two
product mentions (and its canonical src/policy/guardrail.py, so the
vendored copy stays in sync), and the Hatch hook definition's prompt.
Comments, docstrings, identifiers, the broker's reply-context labels and
the "ag2 space" connector's name are unchanged.

The DotSpace literal guard now lists each product-name fragment as prose,
and the unit-description, guardrail-envelope and connect-message pins
follow the new text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-space

# Conflicts:
#	tests/dotspace-literal-guard.test.py
@github-actions

Copy link
Copy Markdown
Contributor

Coverage Gate

✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 94%.

Diff Coverage

Diff: origin/main...HEAD, staged and unstaged changes

  • packages/ag2-sparrow/ag2_sparrow/adapters/claude_cloud_session/session_adapter.py (100%)
  • packages/ag2-sparrow/ag2_sparrow/adapters/claude_code/cli.py (100%)
  • packages/ag2-sparrow/ag2_sparrow/adapters/claude_code/inbox.py (100%)
  • packages/ag2-sparrow/ag2_sparrow/adapters/codex/connect_cli.py (100%)
  • packages/ag2-sparrow/ag2_sparrow/adapters/hatch/cli.py (100%)
  • packages/ag2-sparrow/ag2_sparrow/connect_common.py (100%)
  • packages/ag2-sparrow/tests/test_claude_code_connect.py (100%)
  • packages/ag2-sparrow/tests/test_codex_local_connect.py (100%)
  • packages/ag2-sparrow/tests/test_hatch_adapter.py (100%)
  • packages/ag2-sparrow/tests/test_hatch_served_setup.py (100%)
  • src/policy/guardrail.py (100%)

Summary

  • Total: 31 lines
  • Missing: 0 lines
  • Coverage: 100%

@liususan091219 liususan091219 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Changes requested. Reviewed at head 76e20d99. The code change is sound. The one blocker is a claim in the PR body that the diff does not deliver.

Blocking (false claim, docs only)

The body says "Docs that quote the changed text (the two adapter READMEs) are updated with it." But the package README quotes two of the changed strings word for word, and it is not in the diff:

  • packages/ag2-sparrow/README.md:445 still shows Description=ag2-sparrow (AG2 Space listener). That is the unit text ag2_sparrow/adapters/hatch/cli.py:402 now renders as (s.space listener).
  • packages/ag2-sparrow/README.md:703 still quotes the owner note as "owner's AG2 Space DM". builtin-runtime-text.json:6 now says "owner's s.space DM", and tests/test_hatch_served_setup.py:47 pins that wording.

Please update both lines, or list them under "Left unchanged" with a reason. Either clears this.

Checked, no issue

  • No machine parsing. A repo-wide grep finds no consumer of the renamed text outside the touched files. That covers the [AG2 Space task envelope, the [AG2 Space] prefix, the GUEST-tier line and the hatch wake reason.
  • Wire labels untouched. The broker wire labels in local_task_protocol.py:311,332 are correctly left alone.
  • Guardrail files identical. src/policy/guardrail.py and team_guardrail.py are byte-identical.
  • Tests use the real modules. They exercise redeem_code and the guardrail from src/policy. Nothing greps the source text.
  • Status. No hardcoded paths. Base is main, CI is green and license/cla passed.

Non-blocking

adapters/claude-code/README.md:365 still reads --base <AG2 Space backend URL>. The help text it documents now says "the s.space backend URL".

Not checked: sibling repos (the desktop app, the broker, sutando-skills) that might match on the old envelope text.

— Sutando (susans-MacBook-Pro)

sonichi and others added 2 commits October 28, 2026 19:14
…and --base say s.space

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ortal, as the hint does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

@cla-assistant check

@sonichi

sonichi commented Oct 29, 2026

Copy link
Copy Markdown
Owner Author

@liususan091219 thanks, both are fixed at 84750bf:

  • packages/ag2-sparrow/README.md:445 now reads Description=ag2-sparrow (s.space listener), which matches what cli.py renders.
  • README.md:703 now quotes "owner's s.space DM", the same as builtin-runtime-text.json and the test_hatch_served_setup.py pin.

I also took your non-blocking point: adapters/claude-code/README.md:365 now says --base <s.space backend URL>. And README.md:123's token placeholder now names "the s.space Agent Portal", as the not-connected hint does. The PR body's documentation section now lists exactly which README lines quote the changed text, and says the rest of the README prose is left for a separate docs pass. review-checks.sh passes. On the sibling repos you didn't check: this PR changes only the text that sutando produces.

@qingyun-wu qingyun-wu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Agent-assisted review by Mars, Qingyun's Sutando seat. Reviewed at 84750bf. I read the full diff and did not run the tests. This approval waited for every check at this head to pass.

The diff is the rename it says it is: every changed line is "AG2 Space" → "s.space" in text a person or agent reads, plus tests/dotspace-literal-guard.test.py extending its file list so the guard holds the line on each changed file. The guardrail change (src/policy/guardrail.py and its team_guardrail.py copy) touches only the product name; the rule text is otherwise unchanged.

Susan's blocker at 76e20d9 was the package README still quoting the old unit description and token hint. The two commits since (35d7a00, 84750bf) bring those quotes in line, so the body's claim now holds and her request is addressed.

Not blocking: the README's explanatory prose about the transport (lines 26, 33, 49, 128–129) still says "AG2 Space". It isn't a quoted string from the code, so it is outside this PR's stated scope, but it reads oddly next to the renamed quotes. Worth a follow-up if the product name is meant to be s.space everywhere.

@liususan091219 liususan091219 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved. Re-reviewed at head 84750bfe. The blocker from my change request at 76e20d99 is fixed.

Blocker, now resolved

  • packages/ag2-sparrow/README.md:445 now reads Description=ag2-sparrow (s.space listener), which matches hatch/cli.py.
  • packages/ag2-sparrow/README.md:703 now quotes the owner note as "owner's s.space DM", which matches builtin-runtime-text.json and tests/test_hatch_served_setup.py.
  • The PR body's docs section now lists exactly these lines. The claim matches the diff.

Also fixed

  • The non-blocking note: adapters/claude-code/README.md:365 now reads --base <s.space backend URL>.
  • README.md:123, the token placeholder, now names the s.space Agent Portal, as the hint does.

Checked

  • The compare from 76e20d99 to 84750bfe changes docs only (2 commits, 2 README files). The code I called sound in my last review is unchanged.
  • The "AG2 Space" left in packages/ag2-sparrow/README.md (l. 26, 33, 49, 128–129, 210, 616, 705) is prose about the platform. None of it quotes a changed string, and the body's "Left unchanged" section covers it.
  • All CI checks pass at this head. license/cla passed. qingyun-wu approved at 84750bfe.

Not checked, as before: sibling repos that might match on the old envelope text.

— Sutando (susans-MacBook-Pro)

@sonichi
sonichi merged commit d68157f into main Oct 29, 2026
61 of 63 checks passed
@sonichi
sonichi deleted the fix/hatch-text-says-s-space branch October 29, 2026 04:40
qingyun-wu pushed a commit that referenced this pull request Oct 29, 2026
Hatch install replaces a Sparrow that serves another id or started before
relay.env last changed, and verify fails on an identity mismatch (#5990);
the package's user- and agent-visible text names the product s.space, and
the Hatch hook definition's prompt with it (#5998).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.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.

3 participants