Avoid solver graph dependency when sitemap indexing is disabled

This commit is contained in:
Nick Beckley 2026-11-03 20:42:22 +00:00
parent ba33b698cf
commit b7d87c72df
3 changed files with 14 additions and 2 deletions

View File

@ -88,3 +88,11 @@ Verification: existing record-workspaces browser suite passed for nine real Razo
Traced global ProjectAccessFilter and current-user access service before evaluating repository calls. Existing export and restore controllers are guarded by the global filter; Maps also checks access explicitly. Added behavioural tests that run the real filter and access service against an isolated repository boundary: reject foreign projects and scene exports, reject collaborator owner-only backup export, reject foreign restore-point download/restore/delete, preserve valid collaborator reads, propagate current author, and reject anonymous/invalid identities without querying data. No permission rules changed.
Verification: solution build and full executable harness passed. Corrected B4 security analysis above after tracing the global filter; the retired null-project aggregate fallback was the remaining issue. D1 commit: ab5325d.
### H — Sitemap resilience and live public SEO verification
When WritingSolver:EnableIndexing is false, sitemap generation now skips loading the solver graph entirely. Previously a graph-loading failure could fail a sitemap that does not include solver pages. Expanded the existing publication regression to make the solver repository unavailable while indexing is disabled. Indexing flags and Development noindex policy are unchanged.
Verification: solution build and full harness passed, including eligible solution URLs, inactive/unindexed exclusions and Development/Production indexing boundaries. Read-only live public audit found 505 sitemap URLs and exactly 52 solution pages, all successful with matching clean canonical URLs, unique descriptions, one H1 and parseable structured data; none had noindex metadata. Development GET verified X-Robots-Tag: noindex, follow. Public robots points at the canonical production sitemap. No Production changes performed. Audit details in /tmp/plotdirector-public-seo-audit.json (temporary evidence).
Deployment preflight: verified effective database name PlotDirector_Development. Read-only status counts show no queued/running intelligence jobs, runs, synthesis, enrichment or import commits; pipeline is NeedsReview and candidate generations Ready. Recheck immediately before any restart.

View File

@ -18,7 +18,9 @@ internal static class WritingSolverSeoTests
{
private sealed class Repository(SolverGraph graph) : IWritingSolverRepository
{
public Task<SolverGraph> GetAsync() => Task.FromResult(graph);
public bool Unavailable { get; set; }
public Task<SolverGraph> GetAsync() => Unavailable
? throw new InvalidOperationException("Solver graph unavailable") : Task.FromResult(graph);
public Task PublishAsync(string json, string editor) => throw new NotSupportedException();
}
private sealed class Host(string environment) : IWebHostEnvironment
@ -85,7 +87,9 @@ internal static class WritingSolverSeoTests
Check(!Sitemap(config).Contains(PublicSeo.AbsoluteUrl(config, "/problem-solver/" + first.Slug)), "Unpublished index flag ignored by sitemap."); first.Index = true;
first.Active = false; Check(!Sitemap(config).Contains(PublicSeo.AbsoluteUrl(config, "/problem-solver/" + first.Slug)), "Inactive diagnosis entered sitemap."); first.Active = true;
var disabled = new ConfigurationBuilder().AddInMemoryCollection(new Dictionary<string,string?> { ["WritingSolver:EnableIndexing"] = "false" }).Build();
repo.Unavailable = true;
Check(!Sitemap(disabled).Any(u => new Uri(u).AbsolutePath.StartsWith("/problem-solver")), "Disabled Solver entered sitemap.");
repo.Unavailable = false;
foreach (var environment in new[] { "Production", "Development" })
{
using var services = new ServiceCollection().AddSingleton<IWebHostEnvironment>(new Host(environment)).BuildServiceProvider();

View File

@ -25,9 +25,9 @@ public sealed class SitemapController(IHelpService help, IConfiguration configur
new("/terms", "yearly", "0.3")
};
var graph = await solver.GetAsync();
if (configuration.GetValue("WritingSolver:EnableIndexing", true))
{
var graph = await solver.GetAsync();
urls.Add(new("/problem-solver", "monthly", "0.8"));
if(editorial is not null)
{