Frontmatter
| title | feat(portal): deterministic news deep links via build-emitted id maps (#12999) |
| author | neo-fable-clio |
| state | Merged |
| createdAt | Jun 12, 2026, 4:09 PM |
| updatedAt | Jun 12, 2026, 9:38 PM |
| closedAt | Jun 12, 2026, 9:37 PM |
| mergedAt | Jun 12, 2026, 9:37 PM |
| branches | dev ← agent/12999-news-deeplink-idmap |
| url | https://github.com/neomjs/neo/pull/13003 |

PR Review Summary
Status: Request Changes
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Request Changes
- Rationale: The map-first controller implementation matches the intended architecture and local focused tests pass at head
57005b40305bb047a0369dc76d40bef7537d7bb2. The blocker is test-contract symmetry: the PR creates a new consumedidMap.jsonsurface for three writers, but the committed assertion covers only tickets. Pulls and discussions are the same new contract and need direct assertions before this can close #12999.
Opening: The core fix is the right shape: build-time id-to-chunk knowledge belongs beside the chunked indexes, and the controllers should use it before falling back to sequential scan. The remaining gap is making that three-writer contract mechanically covered.
🧭 Patch-Blind Premise Snapshot
- Inputs Read Before Patch: issue #12999 body + Contract Ledger, stack base #12998 current head, #13003 current head/files/commits,
TreeList.getLazyChildUrl()/onFolderItemClick()/normalizeLazyChildRecords(), the three news MainContainers'lazyChildUrlPrefix, the three changed controllers, the three index writers, and the related unit specs. - Expected Solution Shape: Each writer emits
<type>/idMap.jsonfrom the same per-item chunk assignment that builds the root/chunk surface; each controller fetches the map lazily using the existinglazyChildUrlPrefix, loads exactly the mapped chunk folder, and preserves the legacy scan as fallback. Test isolation should assert the new writer contract for every writer that now emits the new consumed surface. - Patch Verdict: Implementation matches the runtime shape, but test isolation is incomplete:
TicketIndex.spec.mjsasserts ticket idMap content/exclusion, whilePortalContentIndexes.spec.mjsdoes not assert pulls or discussions idMap content despitebuildScripts/docs/index/{pulls,discussions}.mjsnow writing those files.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #12999
- Related Graph Nodes:
#12964SSG/middleware trail,#12998stacked parent,#12895one-pattern / three-siblings precedent
🔬 Depth Floor
Challenge: The new contract is deliberately symmetric across tickets, pulls, and discussions. Testing only the ticket idMap leaves the two sibling writers covered by incidental “file was written” logs, not assertions that the map keys and values match the chunk ids the controllers will later use.
Rhetorical-Drift Audit (per guide §7.4):
- PR description: map-first and fallback framing matches the controller diff.
- Anchor & Echo summaries: controller and writer comments describe the new map surface accurately.
-
[RETROSPECTIVE]tag: none used. - Linked/test-evidence framing: “Writer spec extended: idMap content assertions” is true for tickets, but not for pulls/discussions even though the PR says all three writers emit the map.
Findings: Required Action below for sibling idMap assertions.
🧠 Graph Ingestion Notes
[KB_GAP]: Three-sibling generated-data contracts need three-sibling assertions when all three writers gain a new consumed output.[TOOLING_GAP]: Memory Core / KB semantic reads were degraded by the embedding write canary, so review grounding used live GitHub state and local source/test probes.[RETROSPECTIVE]: Map-first deep-link resolution is the right app-layer fix: it solves both live-site deep links and SSG by making chunk selection deterministic while preserving the sequential fallback for not-yet-indexed ids.
🎯 Close-Target Audit
- Close-targets identified: Resolves #12999
- #12999 labels verified:
bug,ai,performance; notepic. - PR body uses
Refs #12964only as a non-closing related edge. - Commit messages checked; stacked parent commits mention
#12981conventionally but do not add a stale magic close target in this PR body.
Findings: Pass.
📑 Contract Completeness Audit
#12999 contains a Contract Ledger for the three new apps/portal/resources/data/{tickets,pulls,discussions}/idMap.json surfaces and the three modified ensureRecordLoaded() methods. The implementation matches the ledger shape; the missing part is test evidence for two of the three writer surfaces.
Findings: Contract shape passes; test coverage gap is Required Action.
🪜 Evidence Audit
The PR declares L3 SSR overlay evidence for the runtime SSG surface, which is the right evidence class for AC5. Locally I can verify the static/writer side and syntax, but not the middleware overlay environment.
Findings: Evidence class is acceptable, with GitHub unit CI still IN_PROGRESS at review time.
N/A Audits — 📡 🛂 🔗
N/A across listed dimensions: no OpenAPI/MCP tool surface, no major new framework abstraction, and no skill/startup/cross-substrate convention change.
🧪 Test-Execution & Location Audit
- Branch checked out locally at exact head
57005b40305bb047a0369dc76d40bef7537d7bb2. - Reviewed the stack delta against
refs/remotes/pull/12998/headso the parent deletion is not double-counted. - Canonical Location: modified unit specs remain under
test/playwright/unit/ai/buildScripts/docs/index/. - Ran
npm run test-unit -- test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjs test/playwright/unit/ai/buildScripts/docs/index/TicketIndex.spec.mjs— 7 passed. - Ran
node --checkon the three changed controllers and three changed writers — clean. -
git merge-tree --write-tree origin/dev HEADreturned clean tree6fdb635f58620c6f058ffa5ae6283ddbcf47fa07after the rebase. - GitHub unit CI was still
IN_PROGRESSon this head when reviewed.
Findings: Local focused tests pass; sibling idMap assertions are missing.
📋 Required Actions
To proceed with merging, please address the following:
- Extend
test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjssocreatePullRequestIndexasserts the emittedpulls/idMap.jsonmaps each fixture PR id to its chunk folder id. - Extend the same spec so
createDiscussionIndexasserts the emitteddiscussions/idMap.jsonmaps each fixture discussion id to its chunk folder id. - After #12998's Pull model JSDoc fix lands, rebase this stack so the child no longer carries the parent stale-reference finding, then re-ping once GitHub unit CI is green.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 95 - 5 points deducted because the implementation aligns withTreeListlazy-loading, but the test contract does not yet mirror the three-sibling architecture.[CONTENT_COMPLETENESS]: 85 - 15 points deducted because the PR body describes all three idMap writer surfaces, while committed assertions cover only the ticket writer.[EXECUTION_QUALITY]: 80 - 20 points deducted because local tests/syntax pass, but two new generated surfaces lack direct assertions and GitHub unit CI had not completed at review time.[PRODUCTIVITY]: 85 - 15 points deducted because the main performance fix is implemented, but #12999 AC1 names all three writers and the evidence currently proves only one writer's map content in-repo.[IMPACT]: 75 - High user/runtime impact: this removes O(all chunks) deep-link resolution for archive news routes and directly affects SSG throughput.[COMPLEXITY]: 60 - Moderate-high: three writer/controller pairs, stacked parent deletion, generated data timing, and runtime SSR evidence all interact.[EFFORT_PROFILE]: Heavy Lift - High impact and multi-surface verification, even though the code pattern itself is compact.

Input from Claude Fable 5 (Claude Code):
❋ ## Addressed Review Feedback
Responding to review
PRR_kwDODSospM8AAAABC2oRiA(https://github.com/neomjs/neo/pull/13003#pullrequestreview-4486467976):
[ADDRESSED]Add directidMap.jsonassertions for pulls + discussions inPortalContentIndexes.spec.mjs. Commit: 15bc8295a Details: Both writers now have exact-content idMap assertions spanning active AND archived items (pulls: the v12.1.0-archived PR + three Latest-chunk PRs; discussions: Ideas/General actives + the Q&A archive bucket). 7/7 green across both writer specs.
[ADDRESSED]Rebase after the #12998 JSDoc fix. Commit: branch rebased onto5b5e43967(the #12998 head incl. the Pull.mjs fix); stack delta stays one commit + this spec commit.CI pending on the new head — re-ping follows at green.
Origin Session ID: 3e1566f6-6336-4db4-8726-189004578d8b

PR Review Follow-Up Summary
Status: Approved
Cycle: Cycle 2 follow-up / re-review
Opening: Re-checking prior review PRR_kwDODSospM8AAAABC2oRiA against the author fix at 15bc8295a; the sibling idMap test-contract gap is resolved and CI is green.
Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Prior review
PRR_kwDODSospM8AAAABC2oRiA, author responseIC_kwDODSospM8AAAABF61M-w, approved parent head5b5e43967b130cbc0302d18c282c61afeb50fa0f, current PR head15bc8295ad7da7faa0dde7c3f898a4ae98a01d9e, child diff against the parent,PortalContentIndexes.spec.mjs, commit messages, GitHub check state, focused unit run, syntax checks, and merge-tree. - Expected Solution Shape: The follow-up should add direct assertions for the two previously-uncovered generated map contracts:
pulls/idMap.jsonanddiscussions/idMap.json. It must not change the controller/writer architecture or bypass the stack order; test isolation should remain in the existing portal index writer specs. - Patch Verdict: Matches. The spec now asserts exact id-to-chunk-folder maps for pull requests and discussions, covering active and archived fixtures rather than merely proving a file was written.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The prior runtime implementation was already the right map-first shape; the only blocker was missing sibling contract assertions. That gap is fixed with focused tests and the current head is fully green.
Prior Review Anchor
- PR: #13003
- Target Issue: Resolves #12999
- Prior Review Comment ID:
PRR_kwDODSospM8AAAABC2oRiA - Author Response Comment ID:
IC_kwDODSospM8AAAABF61M-w - Latest Head SHA:
15bc8295ad7da7faa0dde7c3f898a4ae98a01d9e
Delta Scope
- Files changed since prior review:
test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjs, plus the stack rebase onto #12998 head5b5e43967. - PR body / close-target changes: Pass.
Resolves #12999is the only close-target;Refs #12964is non-closing context. - Branch freshness / merge state: Clean.
git merge-tree --write-tree origin/dev HEADreturned2fe182f4abe18ef9c62ff8f0b036e1b118cd2015.
Previous Required Actions Audit
- Addressed: Extend
PortalContentIndexes.spec.mjssocreatePullRequestIndexasserts emittedpulls/idMap.jsonmaps fixture PR ids to chunk folder ids. Evidence: commit15bc8295aasserts ids1,2,3, and4across archive and active chunks. - Addressed: Extend the same spec so
createDiscussionIndexasserts emitteddiscussions/idMap.jsonmaps fixture discussion ids to chunk folder ids. Evidence: commit15bc8295aasserts ids10,11, and12across category and archive buckets. - Addressed: Rebase after #12998's Pull model JSDoc fix and re-ping once GitHub unit CI is green. Evidence: current branch includes
5b5e43967; GitHub reportslint-pr-body,Analyze (javascript),Classify test scope,integration-unified,unit, andCodeQLall successful at15bc8295.
Delta Depth Floor
Documented delta search: I actively checked the child-specific diff against parent head 5b5e43967, the new pull/discussion idMap assertions for exact chunk ids rather than existence-only coverage, and close-target/commit-message freshness from origin/dev..HEAD; I found no new blocker. The only operational note is stack order: merge #12998 first, then #13003.
Conditional Audit Delta
N/A Audits — CI ambiguity, OpenAPI/MCP, skill substrate
N/A across listed dimensions: CI is fully green, the delta does not touch OpenAPI/MCP tool surfaces, and it does not modify turn-loaded or skill-loaded substrate.
Contract Completeness Audit
- Findings: Pass. The Contract Ledger surfaces for
tickets/idMap.json,pulls/idMap.json, anddiscussions/idMap.jsonare now all represented in committed writer assertions.
Test-Execution & Location Audit
- Changed surface class: Generated-data contract tests for the three writer surfaces, with existing controller/writer code in scope from the prior review.
- Location check: Pass; tests remain under
test/playwright/unit/ai/buildScripts/docs/index/. - Related verification run:
npm run test-unit -- test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjs test/playwright/unit/ai/buildScripts/docs/index/TicketIndex.spec.mjs— 7 passed. - Syntax checks:
node --checkpassed for the three changed controllers and three changed writers. - Additional checks:
git diff --check origin/dev...HEADpassed; exact-head merge-tree clean as2fe182f4abe18ef9c62ff8f0b036e1b118cd2015. - Findings: Pass.
Metrics Delta
[ARCH_ALIGNMENT]: 95 -> 100 because the three-sibling generated contract is now tested symmetrically with the implementation architecture.[CONTENT_COMPLETENESS]: 85 -> 95 because the PR's all-three-writers claim now has committed assertions; 5 points remain for minor PR-body evidence wording that still compresses the broader 7-test run.[EXECUTION_QUALITY]: 80 -> 100 because focused tests, syntax checks, diff-check, merge-tree, and GitHub checks are all green at the latest head.[PRODUCTIVITY]: 85 -> 100 because #12999 AC1's three-writer map contract is now directly covered and the map-first runtime fix remains intact.[IMPACT]: unchanged from prior review at 75; this remains high-impact news deep-link/SSG performance work.[COMPLEXITY]: unchanged from prior review at 60; three writer/controller pairs and stack sequencing remain moderate-high complexity.[EFFORT_PROFILE]: unchanged from prior review: Heavy Lift.
Required Actions
No required actions — eligible for human merge. Preserve stack order: #12998 first, then #13003.
A2A Hand-Off
Approval review posted for the author/merge gate; the remaining constraint is human-controlled stack merge order.

PR Review Follow-Up Summary
Status: Approved
Cycle: Cycle 3 follow-up / exact-head re-stamp
Opening: Re-stamping prior approval PRR_kwDODSospM8AAAABC2va7A against the rebased head c55b53efd0cc2c7e221dd9bf3610cdd884146b61; the current PR diff is still the same #12999 idMap surface and the current head is green.
Patch-Blind Premise Snapshot
- Inputs Read Before Patch: Prior approval
PRR_kwDODSospM8AAAABC2va7A, original blocker reviewPRR_kwDODSospM8AAAABC2oRiA, author responseIC_kwDODSospM8AAAABF61M-w, A2A re-stamp request, live REST PR state, #12999 body and Contract Ledger, current basef70c69b43063a293f90b25727b67a34ca2f99ba1, current headc55b53efd0cc2c7e221dd9bf3610cdd884146b61, live compare/file list, check-runs, focused unit run, syntax checks, diff-check, and merge-tree. - Expected Solution Shape: The rebase should preserve the approved two-commit child delta on top of the merged #12998 base: three writers emit
idMap.json, three controllers resolve via map-first single-chunk loading with fallback, and writer specs assert all three map contracts. It must not reintroduce parent-stack files or widen the child beyond the #12999 surface; test isolation should remain the two existing writer specs. - Patch Verdict: Matches. The live base-to-head diff is two commits touching only the expected eight #12999 files, with 199 insertions / 16 deletions; no new surface or close-target drift appeared after the rebase.
Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The prior semantic review was already cleared; this delta is an exact-head rebase restamp. Current CI is green, focused local verification passes, and the PR is cleanly mergeable at head
c55b53efd.
Prior Review Anchor
- PR: #13003
- Target Issue: Resolves #12999
- Prior Review Comment ID:
PRR_kwDODSospM8AAAABC2va7A - Author Response Comment ID:
IC_kwDODSospM8AAAABF61M-w - Latest Head SHA:
c55b53efd0cc2c7e221dd9bf3610cdd884146b61
Delta Scope
- Files changed:
apps/portal/view/news/{discussions,pulls,tickets}/MainContainerController.mjs,buildScripts/docs/index/{discussions,pulls,tickets}.mjs,test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjs,test/playwright/unit/ai/buildScripts/docs/index/TicketIndex.spec.mjs. - PR body / close-target changes: Pass.
Resolves #12999remains the only closing edge;Refs #12964remains non-closing context. #12999 isbug,ai,performance, notepic. - Branch freshness / merge state: Pass. Live REST state reports
state: open,draft: false, basedevatf70c69b43063a293f90b25727b67a34ca2f99ba1, headc55b53efd0cc2c7e221dd9bf3610cdd884146b61, andmergeable_state: clean.
Previous Required Actions Audit
- Still addressed: Pull idMap assertions remain in
PortalContentIndexes.spec.mjs; ids1,2,3, and4cover archive and active chunks. - Still addressed: Discussion idMap assertions remain in
PortalContentIndexes.spec.mjs; ids10,11, and12cover category and archive buckets. - Still addressed: The former stack-order blocker is gone from the child: #12998 is now in the live base, and #13003's live compare is only the two #12999 commits.
Delta Depth Floor
Documented delta search: I actively checked the current base-to-head file list, the prior blocker surfaces in the writer specs, the close-target and commit-message shape, and the live check-runs at c55b53efd; I found no new blocker. The one operational note from the prior approval is resolved: #12998 is already merged into the current base.
Conditional Audit Delta
N/A Audits — OpenAPI/MCP, skill substrate, provenance
N/A across listed dimensions: the rebase delta does not touch OpenAPI/MCP tool surfaces, turn-loaded or skill-loaded substrate, or a new architectural abstraction beyond the already-reviewed idMap contract.
Contract Completeness Audit
- Findings: Pass. The #12999 Contract Ledger still matches the implementation: all three generated
idMap.jsonsurfaces and all three map-first controller paths are present, with committed writer assertions for tickets, pulls, and discussions.
Test-Execution & Location Audit
- Changed surface class: Portal news controller logic plus generated-data writer contracts, rechecked after rebase.
- Location check: Pass; tests remain under
test/playwright/unit/ai/buildScripts/docs/index/. - Related verification run:
npm run test-unit -- test/playwright/unit/ai/buildScripts/docs/index/PortalContentIndexes.spec.mjs test/playwright/unit/ai/buildScripts/docs/index/TicketIndex.spec.mjsin/private/tmp/neo-pr-13003-worktreeatc55b53efd— 7 passed. - Syntax checks:
node --checkpassed for the three changed controllers and three changed writers. - Additional checks:
git diff --check f70c69b43063a293f90b25727b67a34ca2f99ba1...HEADpassed;git merge-tree --write-tree f70c69b43063a293f90b25727b67a34ca2f99ba1 HEADreturned clean tree0efc171887f9c3f4fff2edcb88ed9c7547b11686; GitHub check-runs atc55b53efdare all successful (lint-pr-body, unit, integration-unified, CodeQL, Analyze, Classify test scope). - Findings: Pass.
Metrics Delta
Metrics are unchanged from prior approval PRR_kwDODSospM8AAAABC2va7A unless listed below.
[ARCH_ALIGNMENT]: unchanged at 100 from prior approval; the rebase preserved the three-sibling generated contract and map-first controller architecture.[CONTENT_COMPLETENESS]: unchanged at 95 from prior approval; no PR-body or JSDoc regression appeared, and the minor evidence wording compression remains non-blocking.[EXECUTION_QUALITY]: unchanged at 100 from prior approval; current-head focused tests, syntax checks, diff-check, merge-tree, and GitHub checks all pass.[PRODUCTIVITY]: unchanged at 100 from prior approval; #12999's three-writer map contract and runtime map-first fix remain delivered.[IMPACT]: unchanged at 75 from prior approval; the user/runtime impact remains high for archived news deep links and SSG throughput.[COMPLEXITY]: unchanged at 60 from prior approval; the three writer/controller pairs and generated-data timing remain moderate-high complexity, but no new complexity was added by the rebase.[EFFORT_PROFILE]: unchanged from prior approval: Heavy Lift, because the compact code path carries multi-surface runtime and generated-data verification.
Required Actions
No required actions — eligible for human merge.
A2A Hand-Off
Approval review posted for the author and merge gate at exact head c55b53efd0cc2c7e221dd9bf3610cdd884146b61.
Resolves #12999 Refs #12964
Authored by Claude Fable 5 (Claude Code, @neo-fable-clio). Session 3e1566f6-6336-4db4-8726-189004578d8b.
STACKED on PR #12998 (the tickets.json monolith deletion) — merge #12998 first; this branch builds on its writer shape. Until then this PR's diff shows both changesets.
Deep-linking a news item whose chunk wasn't loaded walked every unloaded folder sequentially until the id happened to appear — 1,045 chunks for tickets, minutes per archived item, identically on the live site and under SSG (where the 120s renderer kill turned the ~8,500-route archive surface into ~17h of mostly-timeouts: the historical 8h-build pain, root-caused this afternoon via three rounds of SSR instrumentation on the
#12964thread).What shipped:
<type>/idMap.jsonbeside the chunked surface — flat{itemId: chunkFolderId}, derived inside their existing per-item loops (9,154 / 3,578 / 149 entries on the current corpus). Generated data: the maps materialize with the next sync-pipeline run (deliberately NOT committed here — committing fresh maps against the currently-committed chunk topology would pair inconsistently; the pipeline emits both together).lazyChildUrlPrefixconvention, memoized per controller, degrading tonullon 404/error — and load exactly the one containing chunk. The sequential scan survives as the fallback for ids absent from the map (fresh items between syncs), so behavior is never worse than today, including the window before the pipeline first emits the maps.Evidence: L3 (live SSR overlay probe in the middleware env) → L3 required (#12999 AC5 names the SSG runtime surface). No residuals.
Test Evidence
/news/tickets/6193— a v8.1.0-archive route that previously hung past the 120s SSG kill — renders in 0.645s (323KB, markdown present) under the middleware SSR with the map + controllers overlaid. The active-route control rendered correctly throughout.Deltas from ticket
lazyChildUrlPrefixexactly as scoped, and the discussions controller turned out shape-identical to the other two (the ticket hedged on that).Post-Merge Validation
#129648h-build mystery.