Skip to content

Implement Team-first console workspace#163

Draft
potter-sun wants to merge 168 commits intocodex/fix/2026-04-08_console-web-test-fixesfrom
feat/2026-04-09_console-web-team-first-clean
Draft

Implement Team-first console workspace#163
potter-sun wants to merge 168 commits intocodex/fix/2026-04-08_console-web-test-fixesfrom
feat/2026-04-09_console-web-team-first-clean

Conversation

@potter-sun
Copy link
Copy Markdown
Collaborator

Summary

  • introduce a Team-first console entry with /teams and /teams/:scopeId
  • add a dedicated team workspace shell with runtime lens, trust rail, compare, and playback
  • deep-link Team playback into runtime runs and explorer while preserving scopeId, runId, and serviceId
  • add product definition and frontend implementation checklist docs for the Team-first rollout

What Changed

  • add AEVATAR_CONSOLE_TEAM_FIRST_ENABLED and Team-first home routing
  • add shared team/scope navigation helpers and current-team resolution
  • add new teams pages, runtime lens derivation, and Team detail UI/tests
  • update Studio and Explorer navigation to keep Team scope context across deep links
  • keep the previous scope overview path working during the transition

Verification

  • pnpm test -- --runInBand src/pages/teams/index.test.tsx src/pages/teams/runtime/teamRuntimeLens.test.ts src/pages/teams/detail.test.tsx src/pages/studio/index.test.tsx src/pages/actors/index.test.tsx src/shared/navigation/scopeRoutes.test.ts src/shared/navigation/consoleHome.test.ts src/shared/studio/navigation.test.ts src/shared/config/consoleFeatures.test.ts
  • pnpm tsc --noEmit
  • pnpm build

Docs

  • updated docs/design/2026-04-08-aevatar-product-definition.md
  • added docs/design/2026-04-09-aevatar-console-web-frontend-implementation-checklist.md

potter-sun and others added 30 commits April 3, 2026 18:25
…2026-04-01_console-web-gagent-binding-control-plane

# Conflicts:
#	apps/aevatar-console-web/src/pages/studio/components/StudioWorkbenchSections.tsx
Implement the channel runtime architecture (issue #113) that allows
Aevatar to receive bot platform webhooks directly instead of relying
on NyxID as a relay middleman. Nyx remains the credentialed outbound
provider for sending messages.

New project: agents/Aevatar.GAgents.ChannelRuntime with:
- IPlatformAdapter abstraction for multi-platform support
- LarkPlatformAdapter: URL verification + im.message.receive_v1 parsing
- ChannelBotRegistrationStore: persistent protobuf-based config store
- ChannelCallbackEndpoints: webhook receiver + registration CRUD
- Async acknowledge-then-respond pattern (platforms have short timeouts)
- Outbound replies via NyxIdApiClient.ProxyRequestAsync

Existing NyxID relay path (/api/webhooks/nyxid-relay) is untouched.

Closes #113

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…apter)

15 tests covering:
- ChannelBotRegistrationStore: CRUD operations, persistence, edge cases
- LarkPlatformAdapter: URL verification, message parsing, bot filtering,
  empty text handling, missing header handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensure that session completion response is published immediately to consumers (relay, SSE) before attempting persistence. Persistence is now best-effort with logging for failures, preventing concurrency conflicts from blocking the reply to the user.
Standalone ASP.NET minimal API server at tools/Aevatar.Tools.MockNyxId
that simulates the NyxID external service. Enables end-to-end testing
of channel runtime, LLM calls, and proxy operations without a real
NyxID instance.

Endpoints:
- GET  /api/v1/users/me — mock user info
- POST /api/v1/auth/test-token — issue test JWTs
- GET  /api/v1/proxy/services — service discovery (api-lark-bot, api-github)
- *    /api/v1/proxy/s/{slug}/{**path} — catch-all proxy with Lark/Telegram-aware responses
- POST /api/v1/llm/gateway/v1/chat/completions — OpenAI-compatible (streaming + non-streaming)

Usage:
  dotnet run --project tools/Aevatar.Tools.MockNyxId
  export Aevatar__NyxId__Authority=http://localhost:5199

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1. Verify Lark callback token before accepting verification challenges
   and event callbacks — rejects forged payloads when a verification
   token is configured on the registration.

2. Include registration ID in channel actor key to prevent cross-tenant
   state bleed when two registrations share the same platform chat ID.

3. Filter subscribed stream events by session_id so overlapping
   callbacks for the same actor cannot consume each other's responses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the autonomous home AI agent as described in issue #97.
HouseholdEntity inherits AIGAgentBase with a Perceive-Reason-Act loop
driven by stream events (sensor, camera, chat, heartbeat) with safety
guardrails (kill switch, rate limiting, debounce) and dynamic context
injection into LLM system prompt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TelegramPlatformAdapter: parse Telegram Update webhooks, reply via
  NyxID proxy sendMessage, ignore bot/non-text messages
- Auto-configure Telegram webhook on registration: when webhook_base_url
  is provided, call setWebhook via NyxID proxy so Telegram sends updates
  directly to Aevatar's callback endpoint
- Proto: add webhook_url field to ChannelBotRegistrationEntry
- Registration endpoint: accept webhook_base_url, auto-call setWebhook
- MockNyxId: add setWebhook mock response
- 8 new unit tests for Telegram adapter (27 total)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements the Agent-as-Tool pattern: NyxIdChatGAgent's LLM can call
the "household" tool to dispatch home automation requests to a
HouseholdEntity actor.

- HouseholdEntityTool: IAgentTool that dispatches HouseholdChatEvent
  to HouseholdEntity via IActorRuntime, returns environment state and
  last action as JSON
- HouseholdEntityToolSource: IAgentToolSource for auto-discovery
- ServiceCollectionExtensions.AddHouseholdEntityTools() for DI
- 10 new tests (32 total)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The NyxID proxy automatically prepends "bot<TOKEN>/" to the path, so we should pass only the bare method name (e.g., "sendMessage", "setWebhook") instead of the full path "bot/sendMessage". This fixes Telegram webhook registration and message sending operations.
Introduce ChannelUserGAgent to manage user identity state and orchestrate the full inbound message flow. This actor tracks sender identity, resolves access tokens, dispatches to chat actors, and sends replies via platform adapters. Move complex callback logic from ChannelCallbackEndpoints to the actor, simplifying the endpoint and improving separation of concerns.
Add NyxIdOrgToken metadata key to allow passing organization tokens alongside user tokens. Enhance NyxIdProxyTool to merge service discovery from both tokens and automatically fallback to org token when user token lacks access to a service. This enables users to access organization-level services even when they haven't personally connected them.

Update ChannelUserGAgent to pass both user and org tokens to chat requests. Also add configuration loading for distributed hosting to support deployment-specific settings.
- Add /arch-audit skill (.claude/skills/arch-audit/SKILL.md) for
  repeatable milestone-oriented architecture compliance audits
- Add first scorecard (docs/audit-scorecard/2026-04-08-architecture-audit.md):
  overall 5.0/10, 6 milestone blockers, 6 backlog items
- Add arch-audit routing to CLAUDE.md skill routing section

Key findings from first audit:
- CI guards pass (9/10) but don't scan agents/ directory
- Host layer bypasses projection pipeline (3 endpoints)
- agents/ has ConcurrentDictionary singletons as fact sources
- agents/ has zero test coverage
- Both frontend projects fail to build

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Introduce a comprehensive analysis report for the architecture audit, expanding on the initial scorecard findings.
- Include detailed evaluations across multiple dimensions, highlighting compliance scores, critical violations, and proposed remediation strategies.
- Document specific code paths and issues related to projection consistency, middleware state leakage, and query integrity.

Key insights:
- Identified multiple critical violations in projection handling and state management.
- Provided a structured approach for addressing architectural deficiencies and improving overall system health.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…scores

- Adjusted the overall architecture health score from 4.9 to 5.1, reflecting improvements in governance capabilities.
- Removed outdated sections on governance analysis and streamlined the report for clarity.
- Enhanced the documentation of compliance issues and architectural insights, focusing on serialization compliance and governance abstractions.

Key updates:
- Improved governance score due to the implementation of a runtime policy evaluation engine.
- Clarified missing governance abstractions and compliance issues in the architecture.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Deleted the architecture audit report for 2026-04-08, which contained detailed evaluations and scores across various dimensions.
- The removal is part of a cleanup effort to streamline documentation and focus on more current audit findings.

Key points:
- The report included critical violations and governance insights that are no longer relevant.
- This action helps maintain the accuracy and relevance of the audit documentation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…cores and detailed analysis

- Adjusted the CI Guards compliance score from 9/10 to 8/10, noting that three rules remain unautomated.
- Expanded the report to include additional dimensions, raising the overall architecture health score from 5.1 to 5.3.
- Introduced a comprehensive analysis of test coverage, identifying 7-9 projects with zero coverage and outlining associated risks.
- Added detailed assessments of middleware compliance and workflow engine resilience, highlighting critical violations and remediation strategies.

Key updates:
- Enhanced clarity on compliance issues and architectural insights, focusing on areas requiring immediate attention.
- Provided actionable recommendations for improving test coverage and addressing identified risks.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ice access

Introduce dual-token credential routing to allow channel users to access personal NyxID services while falling back to org-level services. Add IServiceDiscoveryCache abstraction with in-memory implementation to avoid N+1 calls. Secure registration endpoints and validate platform adapters. Update documentation with ADR-0008.
eanzhao and others added 30 commits April 12, 2026 15:31
An orphaned projection document (from a deleted registration) retains
a stale StateVersion. Token-only polling could falsely confirm against
the orphaned data when the actor silently dropped the command.

Added GetStateVersionAsync to IChannelBotRegistrationQueryPort.
Both update_token paths now snapshot the projection version before
dispatch and require version > versionBefore AND token == desired
before reporting success. Orphaned documents never get re-projected,
so their version stays frozen and the check correctly fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Covers the update_token confirmation path:
- GAgent: token update, same-token idempotency, non-existent registration,
  isolation from other registrations
- QueryPort: GetStateVersionAsync returns version, null for missing/blank
- Tool: validation errors, version+token confirmation on success,
  version-stuck detection for orphaned projections

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Added tests that isolate each condition as independently necessary:
- version advances but token wrong → must fail (locks in token check)
- version stuck but token matches → must fail (existing, locks in version)
- both conditions met → success (existing happy path)
- dispatch verification: actor.HandleEventAsync received exactly once

Removing either the version check or the token check would now break
a specific test.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The dispatch test only checked route targeting. Now it unpacks the
ChannelBotUpdateTokenCommand from the envelope and asserts both
RegistrationId and NyxUserToken match the expected values.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fix(channel-runtime): projection persistence + tool DI + system prompt migration
…am-first-clean

Feat/2026 04 09 console web team first clean
…rinciples

docs: add Actor design principles from #155 eng review
…am-first-clean

Refactor console web team-first workflow views
…6-04-01_console-web-gagent-binding-control-plane

# Conflicts:
#	apps/aevatar-console-web/config/config.ts
#	apps/aevatar-console-web/src/pages/runs/index.tsx
#	apps/aevatar-console-web/src/pages/scopes/invoke.test.tsx
#	apps/aevatar-console-web/src/pages/scopes/invoke.tsx
#	apps/aevatar-console-web/src/pages/studio/components/StudioEditorPage.test.tsx
#	apps/aevatar-console-web/src/pages/studio/components/StudioShell.test.tsx
#	apps/aevatar-console-web/src/pages/studio/components/StudioShell.tsx
#	apps/aevatar-console-web/src/pages/studio/components/StudioWorkbenchSections.tsx
#	apps/aevatar-console-web/src/pages/studio/components/StudioWorkflowsPage.test.tsx
#	apps/aevatar-console-web/src/pages/studio/index.test.tsx
#	apps/aevatar-console-web/src/pages/studio/index.tsx
…gent-binding-control-plane

Feat/2026 04 01 console web gagent binding control plane
…gent-binding-control-plane

Feat/2026 04 01 console web gagent binding control plane
…am-first-clean

Feat/2026 04 09 console web team first clean
…b-ui-refactor

Align console web teams and platform UI
…6-04-09_console-web-team-first-clean

# Conflicts:
#	apps/aevatar-console-web/src/pages/scopes/overview.test.tsx
#	apps/aevatar-console-web/src/pages/scopes/overview.tsx
#	apps/aevatar-console-web/src/pages/teams/detail.test.tsx
#	apps/aevatar-console-web/src/pages/teams/detail.tsx
#	apps/aevatar-console-web/src/shared/ui/aevatarPageShells.tsx
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.

5 participants