No description
  • C# 91.4%
  • HTML 7.5%
  • CSS 1.1%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Bryan Fred 2b91eed414 feat(Module): StartNewChatController -- 'Start New Chat' action runs ladder, opens DetailView
Lands the structural foundation of the chat-first UI per
docs/UNITEKCLAW-ARCHITECTURE.md sec 3.

Adds a top-level SimpleAction on the main window that, on click:

  1. Resolves the current user's bonded UserAgentClaw.
  2. Calls IUniTEKClawSessionOrchestrator.OrchestrateSessionOpen,
     which applies the Pairing Failure Ladder gates (PAUSE first,
     then Tier 1 bond verify, then Tier 2 PairingWorkflow, etc.).
  3. On success, navigates the user to the new ChatSession's
     DetailView so they can see the session context.
  4. On failure, surfaces a clear message describing why the
     session could not be opened.

============================================================
ONE FILE
============================================================

  UniTEKClaw.Module/Controllers/StartNewChatController.cs (new)

A WindowController (TargetWindowType = WindowType.Main) that
exposes the orchestrator as a single-click action and renders the
result.

============================================================
WHY THIS COMMIT IS CHAT SHELL v1, NOT FULL CHAT UI
============================================================

The chat-first surface has two layers:

  Layer A: chat ENTRY POINT -- the action that says 'open a new
           session', runs the ladder, and gives the user a place
           to land.

  Layer B: chat RENDERING -- the message-history view, the input
           box, the streaming responses, the substrate-backed
           conversation.

This commit lands Layer A. Layer B (custom Win editor + custom
Blazor editor for ChatSession's conversation surface) lands in a
follow-up arc because:

  - The substrate adapter is still a stub
    (StubBondVerificationService); without a real adapter, the
    rendering layer has nothing to render except placeholder
    text.

  - The Pairing Failure Ladder gates are now testable end-to-end
    through XAF's standard DetailView, which surfaces all
    structural fields of ChatSession (StartedOnUtc,
    SolutionFolder, audit entries). This is enough for Bryan to
    verify the orchestrator runs correctly.

  - Custom XAF editors are non-trivial commits in their own
    right and deserve their own arc.

============================================================
ACTION SHAPE
============================================================

SimpleAction id: 'UniTEKClaw_StartNewChat'
Category: PredefinedCategory.View
Caption: 'Start New Chat'
ToolTip: 'Open a new paired-work session with your AgentClaw.'
ImageName: 'BO_Document'
PaintStyle: ActionItemPaintStyle.Image
TargetWindow: WindowType.Main

The action sits on the main window's toolbar. No ObjectSpace or
View context required at the Action level -- the controller
creates its own ObjectSpace inside the execute handler.

============================================================
ASYNC EXECUTION PATTERN
============================================================

XAF's SimpleAction.Execute is a synchronous event. The orchestrator
is async (it awaits Tier 1 bond verify, Tier 2 PairingWorkflow,
etc.). The pattern used here:

  Execute handler (sync) -> _ = RunStartNewChatAsync(e) (fire and
                            forget)
  RunStartNewChatAsync   -> awaits orchestrator, sets
                            e.ShowViewParameters on completion

This is the same pattern as the canonical
ProtectedBankDetailWorkflowApprovalController in UniCORE.Module --
sync action handler, async work, ShowMessage surface for any
failure path.

============================================================
30-SECOND TIMEOUT ON ORCHESTRATOR
============================================================

The orchestrator call is wrapped in a CancellationTokenSource set
to 30 seconds. If a Tier 1 bond verify or Tier 2 PairingWorkflow
stalls (substrate hang, network partition, etc.), the action
times out and surfaces:

  'The session-open request timed out. Try again in a moment.'

This prevents the user from staring at a hung toolbar action
indefinitely.

============================================================
DEFENSIVE OBJECT SPACE LIFECYCLE
============================================================

The action creates an IObjectSpace at the start of the work. On
success it is transferred to the DetailView (which then owns its
lifecycle). On any failure path, the finally block disposes it
explicitly via the 'ownershipTransferred' flag. This prevents an
ObjectSpace leak on the ladder-rejected branch.

Pattern verified against the canonical AboutActionController.cs
in UniCORE.Module.

============================================================
USER-AGENTCLAW REHYDRATION
============================================================

SecuritySystem.CurrentUser may belong to a different ObjectSpace
than the action's ObjectSpace. Before reading the user's
AgentClaw association we re-hydrate via:

    actionObjectSpace.GetObjectByKey<ApplicationUser>(currentUser.Oid)

This is the same cross-ObjectSpace safety pattern used in
CurrentUserBondStateService (commit 4d60c31). If the user has no
AgentClaw (no UserAgentClaw row yet), we surface a clear message
and abort.

============================================================
FAILURE MESSAGES
============================================================

Each failure path has a deliberate user-facing message:

  - Orchestrator not registered (DI configuration bug):
    'Session orchestrator is not registered. Cannot start a chat.'

  - ObjectSpace creation failed:
    'Could not create an ObjectSpace for the chat session.'

  - No authenticated user:
    'No authenticated user; cannot open a chat session.'

  - No bonded AgentClaw:
    'Your user has no bonded AgentClaw yet. The application-tier
    AgentClaw must seed a UserAgentClaw before you can open a
    chat session.'

  - Orchestrator returned null (ladder blocked open):
    'Session could not be opened. The application may be in
    PAUSE state, or the Pairing Failure Ladder may have blocked
    the open. Check the PAUSE banner and recent PairingIncident
    rows for detail.'

  - Timeout:
    'The session-open request timed out. Try again in a moment.'

  - Unexpected exception:
    'An unexpected error occurred while opening the chat session:
    {ex.Message}'

All messages route through ShowViewStrategy.ShowMessage with
InformationType.Warning. Host chrome (Win or Blazor) decides
final presentation.

============================================================
EM-DASH POSTURE
============================================================

0 em-dashes in new file (verified via grep).

============================================================
EXPECTED BUILD STATE
============================================================

12/12 GREEN expected. All XAF APIs used match the canonical
UniCORE.Module patterns:

  - SimpleAction + Execute (UniCORE.Module/Controllers/*)
  - ShowViewStrategy.ShowMessage (ProtectedBankDetailDetailController.cs:157)
  - Application.CreateObjectSpace + CreateDetailView
    (AboutActionController.cs:44-56)
  - SecuritySystem.CurrentUser + GetObjectByKey re-hydration
    (CurrentUserBondStateService.cs)

No new package references. UniTEKClaw.Module/UniTEKClaw.Module.csproj
unchanged.

============================================================
ITEM (3) PHASE 1 COMPLETE
============================================================

The chat-first entry point is now live:

  - User clicks 'Start New Chat' on the main window.
  - Orchestrator runs the Pairing Failure Ladder.
  - PAUSE banner / Bond-Verified badge surfaces respond
    automatically (cross-host, already landed).
  - On success, user lands on a ChatSession DetailView with
    StartedOnUtc, SolutionFolder, audit entries visible.

Phase 2 (custom chat editors for Win + Blazor) follows once the
substrate adapter is real. The structural foundation is now in
place for that work to slot onto.

Drafted in paired session with MyClaw.ai (Claude).
2026-05-16 17:56:59 +00:00
docs docs(template-lineage): correct Template vs Template0 framing after full diff 2026-05-16 15:05:54 +00:00
UniTEKClaw.Blazor.Server feat(badge): ICurrentUserBondStateService + Blazor BondVerifiedBadgeComponent 2026-05-16 14:42:33 +00:00
UniTEKClaw.E2E.Tests feat: rebase UniTEKClaw on UniCORE-v25.2.7-Template2 (canonical Blazor+Win+E2E+Module) 2026-05-16 09:49:43 +00:00
UniTEKClaw.Module feat(Module): StartNewChatController -- 'Start New Chat' action runs ladder, opens DetailView 2026-05-16 17:56:59 +00:00
UniTEKClaw.Win feat(Win): BondVerifiedWinBadge -- canonical bond badge in main form footer 2026-05-16 17:51:40 +00:00
.gitignore Initial commit: foundational scaffolding (README, AGENTS.md, .gitignore) 2026-05-16 05:18:50 +00:00
AGENTS.md docs(template-lineage): correct Template vs Template0 framing after full diff 2026-05-16 15:05:54 +00:00
README.md docs: add authorised-parties section -- default Unitek group + rare third-party EUL exception 2026-05-16 05:21:23 +00:00
UniTEKClaw.sln feat: rebase UniTEKClaw on UniCORE-v25.2.7-Template2 (canonical Blazor+Win+E2E+Module) 2026-05-16 09:49:43 +00:00

UniTEKClaw-Claw

Unitek Systems Limited's internal utility application for producing programme work.

⚠️ Private repository. This codebase is the private utility application of Unitek Systems Limited (UK Companies House 04228041) and its 100%-owned subsidiaries. It is not part of the UniVERSE / TrueAI / UniCORE-AI public corpus, not gift-licensed, and not for sale.

Access is by default restricted to Unitek Systems Limited and the seven Unitek group entities listed under "Authorised parties" below. Third-party access exists only under a separate end-user licence granted by Unitek Systems Limited as part of a specific service engagement (typically a prototype phase). Such grants are rare and deliberate; they are how Unitek delivers services, not how Unitek sells software.


What this is

UniTEKClaw is the internal application Unitek Systems Limited uses to develop everything Unitek produces:

  • The public foundation triad: UniVERSE, TrueAI, UniCORE-AI (CC BY 4.0 public gift; not for sale).
  • The Vertical CORE prototype: UniCORE-Law-Claw (private prototype today; mandatory-public on Badge per the published rules).
  • The future Vertical CORE template: UniCORE-Claw (does not yet exist; will be derived from UniCORE-Law-Claw after Badge).
  • Future Vertical COREs (Medical, Accountancy, Banking, etc.) as Generation IT pairs produce them.
  • UniTEKClaw itself.

UniTEKClaw is a tool that lets Unitek Systems Limited provide services against the programme materials. The customer-facing services Unitek sells (consulting, implementation, integration, training, hosting on the private cloud stack) are produced with UniTEKClaw. The tool itself is never the deliverable.

That distinction — tool for producing services versus thing being sold — is the structural reason this repository is private. Selling the tool would be selling the means of production rather than the production. Keeping it private is correct.

What this is not

  • Not part of the foundation triad gift layer.
  • Not a commercial product. Not licensed for resale, redistribution, or use outside Unitek Systems Limited.
  • Not an L3 Vertical CORE Solution (those are UniCORE-Law-Claw, UniCORE-Claw when derived, and the per-vertical variants).
  • Not a public-facing reference implementation.

Stack

  • .NET 10 Core, Win, Blazor.Server, E2E.Tests.
  • DevExpress XAF + XPO.
  • No MiddleTier. No Api. Single-machine application. Talks to its database, to Visual Studio (compile / run / test), and to the local file system directly.

Default working scope

Per user:

C:\Users\<user>\source\repos\

where <user> is the Windows-login identity of whoever is using the machine. UniTEKClaw resolves the path at runtime from the Windows login; it does not hard-code any specific user.

By default, C:\Users\<user>\source\repos\ is the only folder UniTEKClaw can read and write. Anything outside is out of scope unless the user explicitly extends scope.

Pairing posture

UniTEKClaw is Foundation-aligned. Every user pairs with their own AgentClaw at login:

1 Claw / 1 Human / 1 source-repo root

A user's AgentClaw is named UniTEKClaw.User<NN>. The bond mechanism, session-opening protocol (Names → Foundation → Level corpus), bond lifecycle, and failure ladder are specified in:

UniTEKClaw is the second Foundation-aligned Solution (after UniCORE-Law-Claw) and the first to deploy these specifications in an internal-tooling context.

Tool grants

UniTEKClaw invokes other local tools to do its work. Each tool grant is declared, granted, and recorded:

  • Visual Studio 2026 (compile / run / debug / test).
  • .NET 10 SDK (dotnet build, dotnet test, dotnet run).
  • MSBuild.
  • GitHub (clone / commit / push / pull / branch / merge against the repositories the user has scoped to their Solution Folders).

No tool is invoked silently. Every grant is recorded for audit. Operators see what UniTEKClaw has been authorised to do on their behalf.

Copyright © Unitek Systems Limited (UK Companies House 04228041), and Unitek Systems USA Inc. All rights reserved.

Authored by Bryan Fred (Author and Creator of UniVERSE, TrueAI, and UniCORE-AI; Senior Solutions Architect, Unitek Systems Limited / Unitek Systems USA Inc).

Authorised parties

Default authorised parties. UniTEKClaw is licensed for use by Unitek Systems Limited and its 100%-owned subsidiaries:

Unitek Systems Limited (UK — parent)
  ├─ 100% Unitek Systems USA Inc
  ├─ 100% Unitek UniVERSE Ltd (UK)
  ├─ 100% Unitek TrueAI Ltd (UK)
  ├─ 100% Unitek UniCORE-AI Ltd (UK)
  ├─ 100% Unitek UniVERSE USA Inc
  ├─ 100% Unitek TrueAI USA Inc
  └─ 100% Unitek UniCORE-AI USA Inc

The corporate group above operates UniTEKClaw as its internal development environment.

Exception: separate end-user licence grants. Unitek Systems Limited may grant a third party access to UniTEKClaw under a separate end-user licence as part of a specific service engagement — typically a prototype phase. Such grants are:

  • Rare. UniTEKClaw is not a general-distribution product; it is the means by which Unitek produces work for clients. Third-party grants are the exception, not the norm.
  • Deliberate. Each grant is an explicit decision tied to a specific service engagement, not a default consequence of having a relationship with Unitek.
  • Service-anchored. The grant exists to enable Unitek to deliver its services. It is not a route to obtain UniTEKClaw as a product; it is a route by which a client benefits from Unitek's use of UniTEKClaw during an engagement.
  • Bounded. Each grant is bounded by the engagement to which it relates. When the engagement ends, the grant ends.

The end-user licence itself is not authored speculatively. It is drafted at the time of the first third-party engagement that needs it. The mechanism exists; the document is authored when the situation requires it.


Status

Day-one scaffolding. Per-repo rules at AGENTS.md. Implementation begins immediately following commit 1.