Skip to content

fix: address architectural issues across framework and CLI#143

Closed
antosubash wants to merge 2 commits intomainfrom
claude/close-fixed-issues-cZB6n
Closed

fix: address architectural issues across framework and CLI#143
antosubash wants to merge 2 commits intomainfrom
claude/close-fixed-issues-cZB6n

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

Addresses concrete issues surfaced during the high-level architectural review of the framework and CLI.

CLI

  • sm doctor --fix was emitting broken project references. The path it wrote (..\modules\{name}\{name}\{name}.csproj) was missing the src\ segment used by sm new module, so any auto-fix produced a csproj entry that dotnet build rejected.
  • sm new module no longer leaves a module that compiles but silently 404s in the browser. It now scaffolds Views/IndexEndpoint.cs, Views/Index.tsx, Pages/index.ts, and vite.config.ts so a freshly generated module renders an Inertia page out of the box.
  • SlnxManipulator: removed dead FindFolderClosingTag helper that was never called.

Framework

  • AnthropicExtensions now resolves IOptions<AnthropicOptions> inside the singleton factory instead of re-reading IConfiguration. This restores parity with the OpenAI / Azure / Ollama providers and means services.PostConfigure<AnthropicOptions>(...) and test overrides actually take effect.
  • VectorKnowledgeStore builds a runtime VectorStoreCollectionDefinition from RagOptions.EmbeddingDimension. Previously the dimension was baked into KnowledgeRecord via [VectorStoreVector(1536)] and RagOptions.EmbeddingDimension was dead config — switching to a model with non-1536 vectors (Ollama nomic-embed-text at 768, text-embedding-3-large at 3072) silently mismatched. The attribute remains as a default for callers that bypass the store.
  • IModuleLifecycle removed. IModule already exposes OnStartAsync/OnStopAsync/CheckHealthAsync as default-interface methods; the parallel interface had no production implementors and forced ModuleLifecycleHostedService to branch on type. The hosted service now calls the IModule methods directly.
  • Generator no longer hardcodes ModuleName == "Localization". HostingExtensionsEmitter's string match and the entire LocalizationExtensionsEmitter are gone. LocalizationModule initializes its TranslationLoader via ConfigureHost(IHost), discovering module assemblies through DI — a renamed Localization module no longer silently breaks startup.

Not in this PR

  • Generator incremental pipeline migration (CompilationProvider.SelectForAttributeWithMetadataName): real IDE-perf win but a substantial rewrite that needs separate test coverage.
  • CLI snapshot tests: the cli/SimpleModule.Cli project has no test coverage today — needs a new SimpleModule.Cli.Tests project, out of scope here.
  • S3 DeleteAsync pre-flight: kept. The pre-flight is necessary to preserve the bool return semantic that Local and Azure providers honor; S3's DeleteObject returns 204 either way, so removing it would break parity.

Test plan

  • dotnet build clean across the entire solution
  • dotnet test passes for SimpleModule.Generator.Tests (195), SimpleModule.Core.Tests (209), SimpleModule.Localization.Tests (26), and the AI/Rag/Storage test projects
  • Manual: run sm new module Foo against a clean project and verify the generated module renders /foo in the browser
  • Manual: run sm doctor --fix after deleting a project reference and verify the rewritten csproj builds
  • Manual: configure Rag:EmbeddingDimension = 768 with Ollama nomic-embed-text and verify collection creation succeeds against Postgres pgvector

Generated by Claude Code

- DoctorCommand: correct project-reference path to include src\ segment so --fix produces buildable csproj entries
- SlnxManipulator: remove dead FindFolderClosingTag helper
- AnthropicExtensions: resolve options via IOptions<T> in factory instead of re-reading IConfiguration, restoring PostConfigure parity with the other AI providers
- VectorKnowledgeStore: build a runtime VectorStoreCollectionDefinition from RagOptions.EmbeddingDimension so callers can use models with non-1536 vectors (Ollama 768, etc.) without a silent dimension mismatch
- IModule lifecycle: remove the redundant IModuleLifecycle interface; modules use the IModule default-method overrides directly, simplifying ModuleLifecycleHostedService
- Generator: drop the hardcoded ModuleName == "Localization" check in HostingExtensionsEmitter and remove LocalizationExtensionsEmitter; LocalizationModule now initializes its TranslationLoader via ConfigureHost(IHost), discovering module assemblies from DI
- sm new module: scaffold Views/IndexEndpoint.cs, Views/Index.tsx, Pages/index.ts, and vite.config.ts so a freshly generated module renders a working Inertia page out of the box
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 1, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: 76dafc8
Status: ✅  Deploy successful!
Preview URL: https://8aa557bc.simplemodule-website.pages.dev
Branch Preview URL: https://claude-close-fixed-issues-cz.simplemodule-website.pages.dev

View logs

@antosubash antosubash closed this May 6, 2026
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.

2 participants