Skip to content

[secrets] - Dialog contract + no-op dialog host #1246

Description

@JoshuaRowePhantom

Commit 5 — Dialog contract + no-op dialog host

Part of design: #1241 — secret-store
Design document: https://github.com/JoshuaRowePhantom/Phantom.Workspaces/blob/design/docs/design/secret-store.md

Scope

Introduce the manifest-agnostic dialog contract in Llm.Core.Secrets, plus a TestDialogHost in test-support that returns a scripted result. No Avalonia yet. The contract accepts only SecretRequest / SecretUseMemory / SecretSource — no manifest, no scope.

Files

  • Phantom.Workspaces.Llm.Core\Secrets\SecretUseDialogInput.cs
  • Phantom.Workspaces.Llm.Core\Secrets\SecretUseDialogResult.cs
  • Phantom.Workspaces.Llm.Core\Secrets\ISecretUseDialogHost.cs
  • Phantom.Workspaces.Llm.Core.Tests\Secrets\TestDialogHost.cs (test-support)

Detailed design

Namespace: Phantom.Workspaces.Llm.Secrets.

public record SecretUseDialogInput(IReadOnlyList<SecretRequest> Rows);

public record SecretUseDialogRow(
    SecretRequest Request,
    SecretUseMemory ChosenMemory,
    SecretSource ChosenSource);

public record SecretUseDialogResult(bool Accepted, IReadOnlyList<SecretUseDialogRow> Rows);

public interface ISecretUseDialogHost
{
    Task<SecretUseDialogResult> ShowAsync(SecretUseDialogInput input, CancellationToken ct);
}

The contract deliberately never exposes AgentManifest or SecretUseScope types; Llm.Core never sees Avalonia. The GUI project (Commit 9) implements ISecretUseDialogHost.

TestDialogHost (test-support): stores a scripted SecretUseDialogResult and returns it from ShowAsync. Also records the received input for assertion. Used by SecretProviderTests (Commit 6) and the end-to-end tests (Commit 12).

Tests

Compile-only for this commit. Behavioural tests exercise the contract via SecretProviderTests in Commit 6.

Dependencies

Depends on: #1242 — Data model + canonical JSON + scope preimages

Metadata

Metadata

Labels

enhancementNew feature or requestqueuedIn the active work queue (tracked in work-queue.md)verified-locallyImplementation has been verified locally

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions