diff --git a/plugins/sharepoint-workbench/.apm/skills/publishing-sharepoint-pages/scripts/publish-spo-page.ps1 b/plugins/sharepoint-workbench/.apm/skills/publishing-sharepoint-pages/scripts/publish-spo-page.ps1
index 2a00016..8df38d5 100644
--- a/plugins/sharepoint-workbench/.apm/skills/publishing-sharepoint-pages/scripts/publish-spo-page.ps1
+++ b/plugins/sharepoint-workbench/.apm/skills/publishing-sharepoint-pages/scripts/publish-spo-page.ps1
@@ -24,7 +24,7 @@ the page first unless -ExistingPageBackupAction NoBackup.
- JSON execution plan, or JSON results after a gated tenant publication
.FUNCTION INDEX
-Get-SpoPageIdentity, Get-SpoAssetServerRelativePath, Get-SpoImagePixelSize,
+Get-SpoPageIdentity, Get-SpoAssetServerRelativePath, Get-SpoSitePageFileRefQuery, Get-SpoImagePixelSize,
Get-SpoImageProportionalHeight, Get-SpoImageComponentUrl,
ConvertTo-SpoPageHtml,
New-SpoInlineImageHtml, Get-SpoInlineImageAlignment,
@@ -137,6 +137,21 @@ function Get-SpoAssetServerRelativePath {
return $uri.AbsolutePath
}
+# Builds the recursive CAML query matching one Site Pages item by its stored FileRef.
+# AbsolutePath is percent-encoded ("Youth%20Court.aspx") but FileRef is stored decoded, and the
+# value sits inside XML, so it must be decoded and XML-escaped (e.g. "&" -> "&").
+function Get-SpoSitePageFileRefQuery {
+ [CmdletBinding()]
+ param(
+ [Parameter(Mandatory = $true)][string]$SiteUrl,
+ [Parameter(Mandatory = $true)][string]$PageServerRelativeUrl
+ )
+
+ $fileRef = [System.Uri]::UnescapeDataString((Get-SpoAssetServerRelativePath -SiteUrl $SiteUrl -AssetPath $PageServerRelativeUrl))
+ $escaped = [System.Security.SecurityElement]::Escape($fileRef)
+ return "
' }", False), diff --git a/references/map-debt.md b/references/map-debt.md index 4d3e133..4bb6ab5 100644 --- a/references/map-debt.md +++ b/references/map-debt.md @@ -66,3 +66,13 @@ Persistent tracking of architectural friction, structural anomalies, and unclose | DEBT-20261104-08 | Weakly structured documents had no summaries or hierarchical index for progressive discovery | PARTIAL | M | NO | 2026-11-04 | Step 3 of 4. `scripts/enrichment/navigation.py` (agent-mediated): per-topic summaries with keywords and synonyms, chapter/document roll-up and relations built from summaries only, `index.md`, `chapters/`, `navigation.json`, all carrying the AI notice and discovery-only metadata; human approval and a clean validation (notice, trust, pages, links, staleness) gate `publish`. Worked example in `assets/examples/enrichment-example/` built by `build_example.py`. Tests in `test_enrichment_navigation.py`. **Open:** evaluation mode and trust-model docs (PR 4). | this PR | | DEBT-20261104-09 | No way to measure whether structure and AI navigation aids help an agent reach authoritative content | RESOLVED | M | NO | 2026-11-04 | Step 4 of 4. `scripts/enrichment/evaluation.py` compares four arms (native PDF, large Markdown, topic Markdown, topic Markdown plus navigation): agent-mediated task files, run-record validation, deterministic scoring (retrieval accuracy, completeness, citation correctness, tokens, latency, files retrieved, answer length, failures to reach source) and a per-arm report. Trust model and optional workflow documented in `references/enrichment-trust-model.md`. Tests in `test_enrichment_evaluation.py`. **Open:** no evaluation has been run on a real corpus; results would apply to that corpus and agent only. | this PR | | DEBT-20261105-10 | Page publish: link mapping rewrote uploaded image paths, recovery published an empty shell, `:` styles unread | RESOLVED | M | NO | 2026-11-05 | Found migrating CSB news messages. The planner link mapper rewrote manifest `SiteAssets/...` image paths when the page sat under a mapped `/Pages/` prefix (now left untouched); `-RecoverPartialPage` accepted any single component and published an empty shell (now `Assert-SpoRecoverableComponent` refuses); image size and alignment readers ignored SharePoint's `:` for `:` (now decoded); the planner design-token wrapper had no opt-out (`-NoBcDesignTokens`); the contract wrongly required `-OutputPath` on the single-page publisher. Tests in `test_publish_page_fixes.py`. **Open:** recovery refusal is unit-tested only, not run against a tenant. | this PR | + +## Publish backup FileRef lookup — 2026-11-10 + +- Logged date: 2026-11-10 +- Artifact affected: publishing-sharepoint-pages/scripts/publish-spo-page.ps1 (backup and title-banner Site Pages lookups) +- Friction observed: overwriting a page whose name contains a space aborted at backup; the CAML FileRef value was percent-encoded and not XML-escaped. +- Fix: Get-SpoSitePageFileRefQuery decodes and XML-escapes the path; regression test added in tests/test_publish_page_fixes.py. Live DEV re-run pending. +- Severity: M +- Repeat: NO +- Status: RESOLVED