Phase 128: Code validation, scaffold enrichment, and chat UX collapse - #6
Open
xingh wants to merge 25 commits into
Open
Phase 128: Code validation, scaffold enrichment, and chat UX collapse#6xingh wants to merge 25 commits into
xingh wants to merge 25 commits into
Conversation
- Remove username TEXT NOT NULL and users_username_unique constraint
from the users table definition (matches V043 SQLite table recreation)
- Update handle_auth_user_created trigger to not INSERT username
- Add idempotent ALTER TABLE users DROP COLUMN IF EXISTS username block
for existing Postgres/Supabase deployments upgrading from pre-V043
- Bump mirror version comment V001–V042 → V001–V043
Note: the user_id PK rewrite (usr_{hex} → email) from V043 does not
apply to Postgres/Supabase — user_id there has always been the GoTrue
UUID. Only the username column drop is reflected here.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
PostgresSchema.sql is now standalone Postgres only — Supabase-specific trigger functions, RLS stubs, and GoTrue notes removed. db/supabase/migrations/20260625000000_initial_schema.sql is the new Supabase path: full schema + GoTrue mirror triggers + commented RLS policies. Run migrations from db/supabase/ with the Supabase CLI. Both files updated to schema version 43 (V043 username drop reflected). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All database files now live under db/: db/postgres/PostgresSchema.sql — standalone Postgres (embedded resource) db/supabase/migrations/... — Supabase CLI migrations Sovrant.Runtime.csproj updated to embed from new path (LogicalName preserved so PostgresSchemaInitializer lookup is unchanged). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ation - Schema version V042 → V043 throughout - All PostgresSchema.sql path references → db/postgres/ and db/supabase/migrations/ - File layout section replaced with db/ directory structure explanation - Admin customization workflow added to Supabase setup guide - Standalone Postgres setup guide no longer warns about Supabase section - Trigger pseudocode: removed stale username from INSERT - Pending implementation table updated to reflect db/ split as done Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ommit) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Activates the commented-out RLS policy skeletons via a second Supabase migration (20260625000001_enable_rls.sql). Service-role key retains full unrestricted access; JWT-authenticated direct-DB callers are scoped to their own data at the DB layer, closing the dashboard/Edge Function gap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both providers run locally with no authentication. Placing a dummy key was required before; now the validation guard is skipped for local providers and an empty string is stored in the credential (the runtime OllamaProvider already uses string.Empty for auth). Web: label shows (optional) and placeholder changes when Ollama/LM Studio is selected. Desktop: ApiKeyLabel/ApiKeyWatermark computed properties bound in SettingsView.axaml; SelectedProvider change notifies both via NotifyPropertyChangedFor. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
OnSelectedProviderChanged clears ApiKey before LoadModelsForProviderAsync fires, so OpenRouter and other key-gated providers always fetched with an empty key and returned nothing. Fix: resolve an effectiveKey — form field when populated, otherwise the saved credential from the matching SavedProfiles entry. Ollama and LM Studio are unaffected (they use local HTTP with no auth). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
FetchModelIdsAsync and FetchAuthenticatedModelIdsAsync unconditionally set
Authorization: Bearer {key}, producing a malformed header when the key is
empty. Ollama rejects this and returns no models.
Only set the Authorization header when the sanitized key is non-empty.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Personal workspace is now checked by default; all other workspaces are opt-in. Matches user expectation that adding a provider makes it available to yourself immediately without any extra clicks. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nt to V043 - Header: bump Last updated to 2026-06-29; add Phase 123, V040-V043, schema split (db/postgres + db/supabase/migrations) notes - Current State: 39 versioned migrations → 43 (V001–V043); add V040–V043 descriptions (stable MCP IDs, workspace memory privacy, memory owner scoping, email-as-user-id) - Current Focus table: add v1.3 wave rows for Phase 105 (MCP workspace gating) and Phase 123 (Memory System), both ✅ - Still pending Last audited: 2026-05-26 → 2026-06-29; list newly shipped phases (96, 105-partial, 123, V043, 40C schema split) - Phase 91 Knowledge Authoring: Deferred → Partial ✅ (Guidelines/Documents done; Skills Duplicate button + AvaloniaEdit Desktop fixes remain) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Current Focus: add v1.3 row for Phase 91 partial (admin Knowledge editing, Monaco editor, Avalonia 11→12 migration) - Current Focus: add v1.4 rows for V043 email-as-user-id breaking change and Ollama routing + project FK bug fixes - Current State: 2,222 tests → 2,208 (reflects current suite across 10 projects) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Current Focus table: add v1.5 wave rows for Phase 114 (skill enrichment), Phase 74 (markdown document templates), Phase 128 (code generation quality gates) — ordered by effort/impact - Last Updated header: note Phase 128 planned and v1.5 focus - Still pending table: add Phase 128 row - Phase 128 full section: ICodeValidator per-language, self-correction loop (max 2 rounds), guideline conformance check, V044 production scaffold enrichment (CI, .gitignore, Dockerfile, security scan, README, editorconfig) for all 21 templates; designed to work with any code-capable LLM Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…s (V044) V044 migration updates every BuiltIn skill row (workspace_id='') with: - 2-3 sentence descriptions covering what/when/output for the IKnowledgeRouter harness and Skills page visibility - Agent list wiring for 9 skills that had natural delegations but NULL agents: billing-ops → data-analyst, content-engine/crosspost → content-writer, doc-update → doc-updater, lead-intelligence → sales-intelligence+researcher, project-flow → project-manager, prompt-optimize → prompt-optimizer, refactor → refactor-cleaner, search-first → researcher - verification-loop tools corrected: removes non-existent `Verify` tool Test assertions updated: schema version 43 → 44, migration count 43 → 44. Roadmap: Phase 114 marked Done, migration count 43 → 44, v1.5 row updated. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Phase 129 full section: surface-label rename only (no DB/runtime changes), dedicated Workflows page (goal-first launch form, active/recent cards, journal + artifacts detail view), positioning callout distinguishing AI-driven workflows from trigger-automation (n8n/Zapier/Make via MCP), /v1/workflows API alias proxying to /v1/missions, Phase 119 run-modes in the launch form; explicit non-goals table (no node editor, no cron, no connector library) - Still pending table: Phase 129 row added - v1.5 focus table: Phase 129 row added after Phase 126 - Last Updated header: note Phase 129 and v1.5 focus update Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
A — Artifact security hardening - ArtifactRoutes.cs: zip download endpoint with correct content-disposition - ArtifactRoutes.cs: #pragma disable CA1849 around ZipArchiveEntry.Open() (no async overload) - Program.cs: X-Content-Type-Options / Cache-Control headers on artifact serve; force-download for unsafe-inline file types (html, js, svg, etc.) - Artifacts.razor: remove LocalArtifactStore cast; use IArtifactStore.ListAsync + IWorkspaceService.ListAllAsync; ReadAsync for preview; ArtifactItem gains WorkspaceId/WorkspaceName, drops FullDiskPath; .sln/.editorconfig added to TextExtensions - RemoteArtifactStore: field-name fix (stub SetCodeMetadataAsync added) B — Code manifest in ArtifactManifest - ArtifactManifest: new CodeManifest nested type (template_id, language, kind, build/run/test commands, entry_point); ArtifactManifest.Code property - IArtifactStore: SetCodeMetadataAsync(handle, metadata, ct) - LocalArtifactStore: async SetCodeMetadataAsync reads/merges _manifest.json - ScaffoldCommands.cs: new static helper deriving build/run/test/entry-point per language+kind for all 21 scaffold types (#pragma CA1308 — ASCII IDs) - CodeCreateTool/CodeCreateMultiTool: call SetCodeMetadataAsync after scaffold C — Scaffold enrichment (all 21 templates) - All 5 .NET scaffolds: .sln (SDK-style GUIDs), Directory.Build.props, .editorconfig, .github/workflows/ci.yml (dotnet build + test) - All 16 non-.NET scaffolds: .github/workflows/ci.yml per language (node/go/python/rust/java/kotlin/ruby/swift/lua/zig/cpp) D — LLM instruction enrichment - IProjectTemplate: optional default interface members BuildCommand, RunCommand, TestCommand, EntryPoint (null = ScaffoldCommands default; no existing impl changes) - CodeCreateTool: build_command/run_command/test_command/next_steps in response; BuildCodeManifest prefers template overrides over ScaffoldCommands defaults; ToolDefinition.Description updated - CodeCreateMultiTool: per-component commands + next_steps in response; ToolDefinition.Description updated - V045: seed knowledge_pages kind=''tools'' BuiltIn rows for CodeCreate and CodeCreateMulti with usage guide bodies - MigrationRunnerTests/OldDbUpgradeTests: bump schema version assertions to 45 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e scaffolds New CodeValidateTool (IArtifactStore-backed, no compiler required): - Reads run manifest (_manifest.json) to discover language, kind, build commands - Lists all files in the artifact run via IArtifactStore.ListAsync - Applies language-specific critical gates: .sln/.slnx for dotnet, package.json for node, go.mod for Go, Cargo.toml for Rust, pom.xml for Java, Package.swift for Swift, Gemfile for Ruby, build.zig for Zig, CMakeLists.txt for C++, *.rockspec for Lua, build.gradle.kts for Kotlin, pyproject.toml/setup.py for Python - Applies universal warning gates: README.md, .gitignore, .github/workflows/ci.yml - Returns pass/fail per gate with severity and remediation steps - Tool guide seeded via V046 migration (knowledge_pages kind=''tools'' BuiltIn) - Registered in ServiceCollectionExtensions alongside CodeCreate/CodeCreateMulti Tests (32 cases, 437 total passing): - All 21 scaffold templates pass CodeValidateTool via theory test - Targeted gate tests: dotnet sln/.slnx, node package.json, Go commands - Error cases: missing run_id, empty run, no code manifest - Remediation: critical gate failures include [CRITICAL] prefix - MigrationRunnerTests/OldDbUpgradeTests bumped to schema version 46 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…sh out Phase 126 color/contrast section - Phase 128 (code generation quality gates): mark done everywhere (Current Focus, gap table, detail section status line), bump migration count to V001-V046 (V045/V046 seed tool guides) - Phase 129 (Missions -> Workflows): add dual-path execution idea - route through Claude Agent SDK dynamic workflow orchestration when a qualifying Claude tier is active, else fall back to Sovrant's own mission engine as the base version; model/tier gate left as an open design question - Phase 126 (chat conversation UX): add a dedicated color & contrast subsection grounded in the existing sovrant.css / Sovrant*Colors.axaml tokens - flags that status colors (pass/warn/fail) aren't actually re-themed between dark and light today, and sets a rule (icon+fill only, no colored text) until that's verified
…r non-admins
TopContextBar's "Set up →" for an unconfigured provider pointed at
/settings?tab=providers, a URL Settings.razor silently ignores (no such
tab exists) — the link was a dead end for every user, admin or not.
Point it at the real page (/admin/providers?provider=X) and have that
page read the query param to preselect the provider, matching Desktop's
existing Settings:Providers:{name} deep link. Since /admin/providers is
gated to system admins and non-admins have no path to act on an
unconfigured provider, the "Set up" prompt list is now admin-only —
non-admins only ever see providers already enabled for their workspace.
Also adds the Phase 130 roadmap item: OpenRouter account registration
and in-app key issuance via OAuth PKCE.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMGtGTeAbrmu7gaF3v1Y6e
…ership auth to artifact routes
Removes workspace-level (project-less) artifact storage. Every artifact
now nests under {ws}/projects/{proj}/artifacts/{run}; DefaultProjectId
is a real project folder like any other, not a routing bypass.
ArtifactScope.IsWorkspaceLevel is gone along with every branch that
consumed it (LocalArtifactStore, ArtifactLayoutMigrator, tests).
Also corrects the on-disk root default from ~/.sovrant/artifacts to
~/.sovrant/workspaces, matching the "workspace-first layout" the
existing docstrings already claimed but the path constant didn't.
Security fix: the two artifact-serving HTTP routes in Program.cs had
no authorization check — any authenticated user could fetch any
workspace's artifacts by guessing the URL. Both now 403 non-members
(admins and workspace members pass), matching
WorkspaceAuthGuards.RequireWorkspaceAccessAsync's existing rule for
the /v1/artifacts API. Artifacts.razor's listing page is scoped the
same way instead of calling ListAllAsync() for every viewer.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DMGtGTeAbrmu7gaF3v1Y6e
…-first layout Replaces the per-tool-call box stack with a single collapsible work strip per turn, on both Web and Desktop: - Collapsed by default: "N actions · Read x3 · Grep x2 · 2.4s" - Two-level expand: strip header -> one row per tool -> full detail for one tool at a time (expanding a second row collapses the first) - Live "doing X" indicator while tools are executing, synchronized with the tool-use row so there's no gap between the animated state and the strip appearing - Answer-first: completed turn renders the answer above the (now subordinate) work strip, with a thin separator between them - Error/warning state: header shows a ⚠ + count, expanded rows highlight red via the status dot, not colored text - Pending tool confirmations stay outside the strip and always visible — no change to the Allow once / Allow for turn / Deny flow Web: new WorkStrip.razor component, wired into ChatMessage.razor. Desktop: MessageViewModel gains work-strip state (IsWorkStripExpanded, ActiveDetailToolId, computed labels), ChatView.axaml replaces the old execution-status bar and per-tool ItemsControl with the strip markup. Color/contrast pass: sovrant.css now defines --status-pass/warn/fail in the light theme block instead of silently inheriting the dark values. Also removes a colored-text rule (.work-strip-row-error .work-strip-row-name) that colored the tool name red on error — measured ~3.7:1 against the light tool-use background, short of the 4.5:1 text threshold the phase's own color rule sets; the status dot fill + header icon already carry the error signal, matching what Desktop's XAML already did. Verified: solution builds clean, no references to removed pre-strip members (ToolUseViewModel.IsExpanded/ResultMaxLines/etc.). Smoke- tested the Web server boot + chat page load + fixed CSS being served; full interactive browser/Desktop verification pending UAT (roadmap updated to reflect Phase 126 as implemented, pending UAT sign-off). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DMGtGTeAbrmu7gaF3v1Y6e
Captured from a live run of v1.4.0 (embedded mode, fresh database): 27 screenshots covering the full first-run flow — admin registration, chat home, knowledge/agents/projects sections, settings, provider setup, and all admin surfaces — plus docs/user-flow.md tying each screen to its route. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018SVh5XtRFCx7ta36PhGY2m
…new-version-user-flow-tfcoj5 # Conflicts: # src/Sovrant.Desktop/Views/ChatView.axaml # src/Sovrant.Web/Components/Shared/ChatMessage.razor
After merging upstream development (Phase 126 chat UX and friends), all 27 web screens were re-captured against a fresh database. Each image now shows dark mode (left) and light mode (right) at 1440x900 per half, composited at identical resolution. Also fixes the schema-version test expectation upstream missed when adding migrations V045/V046. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018SVh5XtRFCx7ta36PhGY2m
There was a problem hiding this comment.
Pull request overview
This PR completes Phase 128/126 by adding structural validation for scaffolded code artifacts (CodeValidateTool), enriching scaffolds with CI/build metadata and manifest commands, evolving artifact storage/layout handling, and refactoring the chat tool-execution UI into a collapsed/collapsible “work strip” (Web + Desktop). It also adds Supabase migration support and expands/updates DB migrations and docs accordingly.
Changes:
- Add
CodeValidateTool+ tests, plus manifest command derivation (ScaffoldCommands) and code metadata persisted into_manifest.json. - Enrich project scaffolds across languages with CI workflows and .NET solution GUIDs; update artifact storage layout to projects-only and add artifact zip download/security headers.
- Refactor chat UX to an answer-first layout with a collapsible work strip component (Web + Desktop), plus supporting CSS and view model changes.
Reviewed changes
Copilot reviewed 68 out of 95 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Sovrant.Tools.Tests/Projects/CodeValidateToolTests.cs | Adds coverage for structural validation across languages and scaffolds. |
| tests/Sovrant.Runtime.Tests/Storage/SqliteStorageProviderTests.cs | Updates expected schema head version in tests. |
| tests/Sovrant.Runtime.Tests/Storage/OldDbUpgradeTests.cs | Updates upgrade test expectations for new schema head. |
| tests/Sovrant.Runtime.Tests/Storage/MigrationRunnerTests.cs | Updates migration runner tests for new schema head. |
| tests/Sovrant.Runtime.Tests/Artifacts/LocalArtifactStoreTests.cs | Updates tests for projects-only artifact layout defaults. |
| tests/Sovrant.Runtime.Tests/Artifacts/LegacyArtifactImporterTests.cs | Updates importer tests for projects-only artifact layout. |
| src/Sovrant.Web/wwwroot/css/sovrant.css | Adds styling for collapsed work strip and status variables; removes old status bar styles. |
| src/Sovrant.Web/Program.cs | Hardens artifact serving headers and adds local artifact zip download; updates path layout resolution. |
| src/Sovrant.Web/Components/Shared/WorkStrip.razor | New collapsible work strip component for tool use summaries/details. |
| src/Sovrant.Web/Components/Shared/ChatMessage.razor | Refactors message rendering to answer-first + work strip + separate pending tool confirmations. |
| src/Sovrant.Web/Components/Pages/Diagnostics.razor | Updates default artifacts root path display. |
| src/Sovrant.Web/Components/Pages/Artifacts.razor | Refactors artifact listing/loading to be workspace-scoped via IArtifactStore + membership. |
| src/Sovrant.Web/Components/Pages/AdminProviders.razor | Makes API key optional for local providers and supports deep-link provider selection. |
| src/Sovrant.Web/Components/Layout/TopContextBar.razor | Adjusts provider setup prompt visibility and makes model fetch auth header optional. |
| src/Sovrant.Tools/ServiceCollectionExtensions.cs | Registers CodeValidateTool with DI as an available tool. |
| src/Sovrant.Tools/Projects/Scaffolds/ScaffoldCommands.cs | Introduces derived build/run/test commands and entry points per language/kind. |
| src/Sovrant.Tools/Projects/Scaffolds/Rust/RustCliScaffold.cs | Adds CI workflow to Rust scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Python/PythonScriptScaffold.cs | Adds CI workflow to Python script scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Python/PythonFastApiScaffold.cs | Adds CI workflow to Python FastAPI scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Node/NodeNextJsScaffold.cs | Adds CI workflow to Next.js scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Node/NodeMonorepoScaffold.cs | Adds CI workflow to pnpm monorepo scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Node/NodeLibraryScaffold.cs | Adds CI workflow to Node library scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Node/NodeExpressApiScaffold.cs | Adds CI workflow to Node Express scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Node/NodeCliScaffold.cs | Adds CI workflow to Node CLI scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/ZigCliScaffold.cs | Adds CI workflow to Zig scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/SwiftCliScaffold.cs | Adds CI workflow to Swift scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/RubyScriptScaffold.cs | Adds CI workflow to Ruby scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/LuaScriptScaffold.cs | Adds CI workflow to Lua scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/KotlinConsoleScaffold.cs | Adds CI workflow to Kotlin scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Minimal/CppCmakeScaffold.cs | Adds CI workflow to C++/CMake scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Java/JavaMavenAppScaffold.cs | Adds CI workflow to Java/Maven scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/Go/GoApiScaffold.cs | Adds CI workflow to Go scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/DotNet/DotNetWorkerScaffold.cs | Adds .sln/.editorconfig/CI and GUID wiring for Worker scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/DotNet/DotNetWebApiScaffold.cs | Adds .sln/.editorconfig/CI and GUID wiring for WebAPI scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/DotNet/DotNetLibraryScaffold.cs | Adds .sln/.editorconfig/CI and GUID wiring for Library scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/DotNet/DotNetConsoleScaffold.cs | Adds .sln/.editorconfig/CI and GUID wiring for Console scaffold. |
| src/Sovrant.Tools/Projects/Scaffolds/DotNet/DotNetBlazorScaffold.cs | Adds .sln/.editorconfig/CI and GUID wiring for Blazor scaffold. |
| src/Sovrant.Tools/Projects/CodeValidateTool.cs | New structural code validation tool with gates/remediation output. |
| src/Sovrant.Tools/Projects/CodeCreateTool.cs | Writes code metadata (commands/entrypoint) into manifest and returns next_steps. |
| src/Sovrant.Tools/Projects/CodeCreateMultiTool.cs | Adds per-component commands + top-level manifest metadata and next_steps. |
| src/Sovrant.Tools/Core/WriteFileTool.cs | Updates default artifacts root path to workspaces layout. |
| src/Sovrant.Server/Routes/ArtifactRoutes.cs | Adds zip download endpoint + applies artifact security headers. |
| src/Sovrant.Runtime/Storage/Migrations/V046__seed_code_validate_tool_guide.sql | Adds tool guide seed migration for CodeValidate. |
| src/Sovrant.Runtime/Storage/Migrations/V045__seed_builtin_tool_guides.sql | Adds tool guide seed migrations for CodeCreate/CodeCreateMulti. |
| src/Sovrant.Runtime/Storage/Migrations/V044__enrich_builtin_skills.sql | Enriches built-in skill descriptions and tool lists. |
| src/Sovrant.Runtime/Sovrant.Runtime.csproj | Embeds standalone Postgres schema from db/postgres/. |
| src/Sovrant.Runtime/Projects/Templates/IProjectTemplate.cs | Adds optional per-template command/entrypoint overrides. |
| src/Sovrant.Runtime/Config/BootstrapConfig.cs | Updates artifacts root documentation to workspaces layout. |
| src/Sovrant.Runtime/Artifacts/LocalArtifactStore.cs | Enforces projects-only layout, prevents manifest overwrite, adds code metadata merge. |
| src/Sovrant.Runtime/Artifacts/IArtifactStore.cs | Adds SetCodeMetadataAsync API. |
| src/Sovrant.Runtime/Artifacts/ArtifactScope.cs | Removes workspace-level routing and defaults ProjectId to default-project. |
| src/Sovrant.Runtime/Artifacts/ArtifactManifest.cs | Adds CodeManifest to persist scaffold commands/metadata. |
| src/Sovrant.Runtime/Artifacts/ArtifactLayoutMigrator.cs | Updates migration routing to projects-only layout. |
| src/Sovrant.Desktop/Views/SettingsView.axaml | Binds provider-specific API key label/watermark. |
| src/Sovrant.Desktop/Views/ChatView.axaml | Refactors tool-use rendering into pending confirmations + collapsed work strip UI. |
| src/Sovrant.Desktop/ViewModels/SettingsViewModel.cs | Makes API key optional for local providers; fixes model load key selection; adds label/watermark properties. |
| src/Sovrant.Desktop/ViewModels/MessageViewModel.cs | Adds work strip state (expanded/detail selection) and separator logic. |
| src/Sovrant.Desktop/ViewModels/DiagnosticsViewModel.cs | Updates artifacts root path display to workspaces layout. |
| src/Sovrant.Cli/DocumentCommand.cs | Adds document lint command for Scriban + fields_json validation. |
| src/Sovrant.Api.Client/RemoteArtifactStore.cs | Updates list parsing to snake_case API fields and adds LastModified/RunId mapping. |
| src/Sovrant.Agents/Shared/WorkspaceContext.cs | Updates legacy fallback artifacts root path to workspaces layout. |
| docs/user-flow.md | Adds a web app user flow walkthrough with screenshots and capture method. |
| docs/persistence.md | Updates persistence docs for Postgres/Supabase split and schema notes (needs further version alignment). |
| docs/document-templates.md | Adds authoring guide for document templates + CLI lint usage. |
| db/supabase/migrations/20260625000000_initial_schema.sql | Adds initial Supabase schema + GoTrue mirror triggers; currently pinned to V043. |
| db/supabase/config.toml | Adds Supabase CLI project config. |
| db/postgres/PostgresSchema.sql | Moves standalone Postgres schema to db/ and updates to V043; version parity concerns remain. |
Suppressed comments (2)
docs/persistence.md:196
- The "Database Inventory" section still says there are 43 migrations (V001–V043). With V044–V046 added, the doc should reflect 46 migrations and ideally note that V044–V046 are seed/data-only migrations (no schema shape changes).
db/postgres/PostgresSchema.sql:778 - This schema file tracks itself as version 43, but the SQLite migration head is now 46 (tests updated). Also, V044–V046 include knowledge_pages seed updates (skills + tool guides) that won't be present for standalone Postgres installs if this script remains at V043 parity. Consider updating this script to apply V044–V046 (or ensuring equivalent seeding happens at app startup) and bumping sovrant_schema_version accordingly.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+46
to
+49
| new("readme", "README.md present", "warning", HasFile("README.md")), | ||
| new("gitignore", ".gitignore present", "warning", HasFile(".gitignore")), | ||
| new("ci-workflow", ".github/workflows/ci.yml present", "warning", HasPathSegment(".github/workflows/ci")), | ||
| ]; |
Comment on lines
+69
to
+77
| private static (string? build, string? run, string? test) Node(string kind) => | ||
| kind switch | ||
| { | ||
| "nextjs" => ("npm install && npm run build", "npm run dev", "npm test"), | ||
| "monorepo" => ("npm install", "npm run dev --workspaces", "npm test --workspaces"), | ||
| "library" => ("npm install && npm run build", null, "npm test"), | ||
| // cli, express-api, and everything else | ||
| _ => ("npm install", "npm start", "npm test"), | ||
| }; |
| var ext = Path.GetExtension(fullPath); | ||
| var contentType = Sovrant.Web.Services.ArtifactMime.For(ext); | ||
|
|
||
| // Security: non-rendereable LLM-generated content must not execute in-browser. |
Comment on lines
+40
to
+46
| <div class="work-strip-row @(tool.IsError ? "work-strip-row-error" : "") @(_activeToolId == tool.ToolUseId ? "work-strip-row-active" : "")" | ||
| @onclick="() => ToggleDetail(tool.ToolUseId)"> | ||
| <span class="work-strip-status-dot @StatusDotClass(tool)"></span> | ||
| <span class="tool-icon"><SovrantIcon Name="tools" /></span> | ||
| <span class="work-strip-row-name">@ChatMessageModel.FriendlyToolLabel(tool.ToolName)</span> | ||
| <span class="work-strip-row-preview">@Preview(tool.Result)</span> | ||
| </div> |
Comment on lines
1
to
4
| # Sovrant — Persistence Layer | ||
|
|
||
| **Phases 32–42.5, 51, 52, 55, 57, 78, 85, 87, 88, 90, 93, 98, 108–116, 123, 124** | **Last updated:** 2026-06-18 | **Current schema:** V042 | ||
| **Phases 32–42.5, 51, 52, 55, 57, 78, 85, 87, 88, 90, 93, 98, 108–116, 123–126** | **Last updated:** 2026-06-25 | **Current schema:** V043 | ||
|
|
Comment on lines
+1
to
+11
| -- Sovrant initial schema for Supabase deployments. | ||
| -- Mirrors V001–V043 SQLite migrations. Safe to run multiple times (idempotent). | ||
| -- For standalone PostgreSQL use db/postgres/PostgresSchema.sql instead. | ||
| -- | ||
| -- Timestamps are stored as TEXT (ISO 8601) for wire-compatibility with SQLite stores. | ||
| -- BYTEA used for encrypted blobs (credentials table). | ||
| -- V035/V037 (built-in knowledge seed data) are handled by the app at startup, not here. | ||
| -- | ||
| -- NOTE: user_id remains the GoTrue UUID (auth.users.id::TEXT) in Supabase mode. | ||
| -- V043's PK rewrite (usr_{hex} → email) applies to SQLite standalone deployments only. | ||
|
|
Comment on lines
388
to
+392
| if (!File.Exists(fullPath)) | ||
| return Results.NotFound(); | ||
|
|
||
| var contentType = Sovrant.Web.Services.ArtifactMime.For(Path.GetExtension(fullPath)); | ||
| var ext = Path.GetExtension(fullPath); | ||
| var contentType = Sovrant.Web.Services.ArtifactMime.For(ext); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR completes Phase 128 (artifact security hardening, code manifest, scaffold enrichment, LLM instruction enrichment) and Phase 126 (collapsed chat work strip UX). It introduces structural code validation via
CodeValidateTool, enriches all 21 language scaffolds with CI/CD workflows and build metadata, adds Supabase migration support, and refactors the chat message work strip into a collapsible component.Key Changes
Code Validation & Scaffolding (Phase 128)
CodeValidateTool(src/Sovrant.Tools/Projects/CodeValidateTool.cs): Validates scaffolded code artifacts structurally (no compiler required). Checks for language-specific marker files (.sln, package.json, go.mod, etc.) and universal files (.gitignore, README.md, .github/workflows/ci.yml). Returns pass/fail per gate with severity and remediation steps.ScaffoldCommands(src/Sovrant.Tools/Projects/Scaffolds/ScaffoldCommands.cs): Derives canonical build/run/test shell commands and entry points for each language/kind combination..github/workflows/ci.ymlCI/CD templates and unique GUIDs for .NET project files.ArtifactManifestexpansion (src/Sovrant.Runtime/Artifacts/ArtifactManifest.cs): AddedCodeManifestproperty to track language, kind, build/run/test commands, and entry point for code-generated artifacts.IProjectTemplateinterface (src/Sovrant.Runtime/Projects/Templates/IProjectTemplate.cs): AddedBuildCommand,RunCommand,TestCommand, andEntryPointproperties for template-specific command overrides.CodeCreateTool&CodeCreateMultiToolupdates: Now populate manifest with scaffold commands viaScaffoldCommands.Chat UX Refactor (Phase 126)
WorkStrip.razorcomponent. Tool list is now subordinate to the answer, hidden by default, expandable via caret toggle.MessageViewModelexpansion (src/Sovrant.Desktop/ViewModels/MessageViewModel.cs): AddedIsWorkStripExpanded,ActiveDetailToolId, andNonPendingToolCountproperties to manage work strip state.ActionSummary: Deleted action summary text display from both Web (ChatMessage.razor) and Desktop (ChatView.axaml) chat views.src/Sovrant.Web/wwwroot/css/sovrant.css): Added.work-separatordivider and status color variables (--status-pass, --status-warn, --status-fail).Database & Deployment
db/supabase/migrations/20260625000000_initial_schema.sql): Complete idempotent schema (V001–V043) for Supabase deployments with GoTrue auth integration. Timestamps as ISO 8601 TEXT, BYTEA for encrypted blobs, email-as-user-id (V043).db/supabase/config.toml: Supabase CLI configuration for running migrations.db/postgres/PostgresSchema.sql(standalone) and added Supabase-specific migration path. Updated comments to clarify deployment modes.Documentation & Testing
https://claude.ai/code/session_018SVh5XtRFCx7ta36PhGY2m