Add agent readiness runtime support#345
Conversation
Code Review — PR #345: Add agent readiness runtime supportOverviewThis PR adds Apache Positives
Issues1. Bug —
|
Code Review: PR #345 — Add agent readiness runtime supportOverviewThis PR adds Apache The feature is well-scoped and the implementation is consistent with the existing Code Quality and Best PracticesPositives:
Minor concerns:
Potential Bugs
Performance Considerations
Security Considerations
Summary
Suggested before merge:
|
Code Review — PR #345: Add agent readiness runtime supportOverviewThis PR adds Apache The change is well-scoped and the new model, service, schema, and tests all hang together coherently. Potential Bug: Unconditional Apache file read in
|
Code Review – PR #345: Add agent readiness runtime supportOverviewThis PR adds reusable Apache The overall implementation is solid: good security practices, path traversal protection, injection escaping, and comprehensive tests. Strengths
Issues and Suggestions1.
- AppendApacheHeaderSet(sb, "Content-Type", contentType, indent: " ");
+ AppendApacheHeaderAlwaysSet(sb, "Content-Type", contentType, indent: " ");Or rename the helper to accept an 2. var apachePath = apacheEnabled
? ResolveSitePath(siteRoot, spec.Apache!.EffectiveOutputPath)
: ResolveSitePath(siteRoot, AgentApacheSupportSpec.DefaultOutputPath); // never usedWhen var apachePath = apacheEnabled
? ResolveSitePath(siteRoot, spec.Apache!.EffectiveOutputPath)
: (string?)null;
var apacheText = apachePath is not null && File.Exists(apachePath) ? File.ReadAllText(apachePath) : string.Empty;
var effectiveHeadersPath = File.Exists(headersPath) ? headersPath : (apachePath ?? headersPath);...would remove the implicit fallback that only resolves to 3. var parts = line.Split((char[]?)null, StringSplitOptions.RemoveEmptyEntries);The 4. var markdownExtension = NormalizeMarkdownExtension(spec.MarkdownArtifacts?.Extension);
...
sb.Append(" AddType text/markdown ").Append(markdownExtension).AppendLine();If 5. Long inline HTML in tests (minor readability) Several test methods embed the same single-line <body><header><nav><a href="/">Home</a></nav></header><main><h1>Example?</h1>...</main><footer>Footer</footer></body>A small private helper (e.g. TestsCoverage for the new code is good:
One gap worth considering: no test covers the case where SummaryThis is a clean, well-thought-out addition. The security considerations (escaping, path traversal, injection tests) are handled correctly, and the behavior changes to optional discovery checks are clearly motivated. The four issues above are all minor; the most actionable is probably |
Code Review: PR #345 — Add agent readiness runtime supportOverviewThis PR adds Apache The implementation is solid overall. A few items worth discussing: Potential Bugs
var effectiveHeadersPath = File.Exists(headersPath) ? headersPath : (apachePath ?? headersPath);When both
sb.Append('<').Append(target.Href).Append(">; rel=\"").Append(target.Rel).Append('"');If Behavioral Change Worth Flagging
// Before
agentSkills.Success && ValidateAgentSkillsIndexText(agentSkills.Text) ? "pass" : "fail"
// After
agentSkillsValid ? "pass" : "info"This is a silent severity downgrade for any existing pipeline that depends on those scan failures to block a deploy. The PR description mentions it, but since Minor Issues
The substring pre-check
public string? OutputPath { get; set; } = DefaultOutputPath;
public string EffectiveOutputPath => string.IsNullOrWhiteSpace(OutputPath) ? DefaultOutputPath : OutputPath!;Both the property initializer and Missing Test Cases
What's Well Done
Overall this is a well-structured addition. The main asks before merging: address the |
Code Review: PR #345 — Add agent readiness runtime support (Apache
|
Code Review: PR #345 — Add agent readiness runtime support (Follow-up / Synthesis)Note: several prior reviews exist on this PR. This comment corrects a few inaccurate findings in those reviews and consolidates what actually needs attention. Corrections to Prior Review FindingsSeveral earlier comments flagged issues that the actual diff already handles correctly:
Genuine Issues Remaining1. Changing 2. Empty
The one real variant: if 3. var parts = line.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);This is correct, but several prior reviews mistakenly described this as a compiled regex. For clarity: no regex is used in What Is Well Done
SummaryThe implementation is correct. The one genuine pre-merge ask is a changelog or PR description note for the |
Summary
Adds reusable PowerForge.Web support for agent-readiness runtime behavior across Apache-hosted sites.
Changes
.htaccessbehavior.Linkheaders,Content-Signal, markdown negotiation, discovery resource headers, and markdown content types..htaccessheaders and declarative WebMCP annotations.Operator Note
Missing optional
agent-skillsandagents-jsonremote scan resources now reportinfoinstead offail. Sites that used those failures as CI gates should enable explicit required discovery checks or inspect those IDs directly if they want absence to remain blocking.Why
Cloudflare/isagentready-style checks expect runtime headers and agent discovery signals that static artifacts alone cannot express reliably on Apache deployments. This makes the behavior reusable from the engine instead of requiring site-specific
.htaccesshacks.Validation
dotnet test .\PowerForge.Tests\PowerForge.Tests.csproj --filter "WebAgentReadinessTests|WebSiteAuditOptimizeBuildTests" --no-restoredotnet build .\PowerForge.Web\PowerForge.Web.csproj --no-restoregit diff --check