Skip to content

feat: surface crawl exclude settings in viewer summary - #262

Merged
YusukeHirao merged 3 commits into
devfrom
worktree-resilient-twirling-music
Aug 7, 2026
Merged

feat: surface crawl exclude settings in viewer summary#262
YusukeHirao merged 3 commits into
devfrom
worktree-resilient-twirling-music

Conversation

@YusukeHirao

Copy link
Copy Markdown
Member

Summary

  • Surface crawl exclude settings (excludes, excludeKeywords, excludeUrls, maxExcludedDepth) on the viewer summary screen, next to the existing roots list — closes viewer summary does not surface crawl exclude settings (excludes/excludeKeywords/excludeUrls/maxExcludedDepth) #261
  • SummaryResult gains the four fields; getSummary() / getViewerSummary() merge them in from accessor.getConfig() at read time, following the existing baseUrl/roots convention (no viewer_summary read-model schema change or version bump needed)
  • Guard the on-disk summary cache against artefacts written by an older nitpicker build: the cache's content-hash key doesn't change on a version upgrade, so a pre-upgrade summary.json missing the new fields could otherwise be replayed as-is and crash the view. getOrComputeOnDisk now accepts an optional isValid callback, treated the same as corrupt JSON on failure
  • Normalize maxExcludedDepth to 0 when NULL in the info table, matching the fallback already applied to its sibling exclude fields

Test plan

  • yarn lint — 0 errors
  • yarn build (with NX_WORKSPACE_ROOT_PATH set for the worktree)
  • yarn test — 602 files / 4372 tests passed
  • Unit tests added: get-summary.spec.ts, get-viewer-summary.spec.ts (both empty-default and non-empty passthrough), database.spec.ts (NULL maxExcludedDepth fallback), precomputed-disk-cache.spec.ts / summary-cache.spec.ts (stale-cache-shape guard)
  • End-to-end coverage: create-app.spec.ts's GET /api/summary test now asserts exclude settings survive the full archive.setConfig()getSummaryFastPath → HTTP JSON pipeline

🤖 Generated with Claude Code

…able

Sibling exclude-setting fields already fall back via getJSON's default
argument, but maxExcludedDepth is a plain integer column with no such
guard, so a NULL row would leak through as null despite the Config type
declaring number.
Add excludes, excludeKeywords, excludeUrls, and maxExcludedDepth to
SummaryResult so getSummary() and getViewerSummary() report the same
crawl-exclusion config already visible as baseUrl/roots. Both follow
the existing baseUrl/roots convention: the fields are merged in from
accessor.getConfig() at read time rather than stored in the
viewer_summary read model, since they are config-derived and
independent of the pages aggregation.
Render excludes, excludeKeywords, excludeUrls, and maxExcludedDepth
below the existing roots list, matching its <p> row style. Each row is
suppressed when its value is empty or zero, since most archives crawl
without exclusions.

Also guard the on-disk summary cache against artefacts written by an
older nitpicker build: the cache's content-hash key does not change on
a version upgrade, so a pre-upgrade summary.json missing the new
fields would otherwise be replayed as-is and crash the view's
data.excludes.length read. getOrComputeOnDisk now accepts an optional
isValid callback, treating a failed check the same as corrupt JSON.
@YusukeHirao
YusukeHirao merged commit fef53aa into dev Aug 7, 2026
10 checks passed
@YusukeHirao
YusukeHirao deleted the worktree-resilient-twirling-music branch August 7, 2026 08:16
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.

viewer summary does not surface crawl exclude settings (excludes/excludeKeywords/excludeUrls/maxExcludedDepth)

1 participant