Repository navigation
feat(site,config,runtime,brand): rebuild docs and homepage, generate agent data, tighten provider configuration - #426
Conversation
… byte-comparing gitignored sources
…es in RerankEndpointError
…hero note in Chromium
# Conflicts: # CHANGELOG.md # chunkhound/utils/websearch_core.py # site/src/components/configurator-data.ts # site/src/pages/docs/configuration.md # tests/conftest.py # tests/integration/test_websearch_fetch_page.py # tests/site/test_configurator_contract.py
|
Summary: The site and config work is sound and most earlier findings are fixed, but I'd still request changes. A Chrome-launch rewrite is bundled in with undisclosed behavior changes, AGENTS.md is edited without recorded approval, and the brand POC is still included. I ran no tests; all four agents read code only. Site tests need Node ≥22.18, which I didn't confirm is available here. Local main is stale, so I used the GitHub diff of the PR rather than a local diff. Grouping (no shared files): backend config, websearch and CI, configurator, site content and brand. This pass covered the changes up to head 011bb70, which is 261 files. CI is green at that head, but GitHub reports the PR as blocked, and one reviewer's "changes requested" is still on record. Strengths
Issues Major
Minor
Reusability
Decision: REQUEST CHANGES. Before merge:
|
grzegorznowak
left a comment
There was a problem hiding this comment.
Given the scale of this PR I was only able to focus on some of the surfaces it touches, mostly around the core CH features, rather than the site/presentation layers.
Nothing terribly blocking but some areas are worth having some additional look into
| return "\\" in value or any(char.isspace() for char in value) | ||
|
|
||
|
|
||
| def url_for_log(value: str) -> str: |
There was a problem hiding this comment.
Optional follow-up: this PR adds url_for_log for endpoint diagnostics, but some existing web-fetch/research diagnostics still print raw URLs:
- chunkhound/utils/websearch_core.py:1185–1191: fetch progress and failure messages.
- chunkhound/services/web_research_service.py:601,705,727,784: parse/refetch/replay warnings.
These messages reach CLI output and, for warnings, MCP responses without sanitization. URLs containing credentials or signed query parameters could
therefore be repeated in diagnostics, including for failed sources that never appear in the final citations.
Could we track applying the same redaction policy to these diagnostic fields? Redacting only the explicit URL may not suffice: some fetch exceptions also
embed URLs, so their formatting needs attention too. Actual request URLs and intentional source citations should remain unchanged.
These paths predate this PR, so I suggest a follow-up rather than blocking this change.
There was a problem hiding this comment.
CI cost / over-building — potential problems
Static reading of .github/workflows/ci.yml at 011bb70 against base 5a01b27. No workflow runs were executed, so runtimes and billed minutes are not
verified. Counts describe a complete configured run, excluding retries and early failures.
Per-run work (build count unchanged from base, content increased)
- Four full Astro builds per CI run: one artifact build (
site-build,ci.yml:18-47) plus three validation builds on ubuntu/macos/windows
(site-build-validation,ci.yml:49-81). Only the Ubuntusite-distartifact is consumed downstream (ci-python-setup/action.yml:51-62, Pages at
ci.yml:406-414); validation uploads no artifact, so its generated output is not transferred. Its status still gates deployment. - Repeated build-hook work across those four builds:
prebuildrunsprepare:siteeach time (site/package.json:14-18), so OG image generation,
changelog sync, and llms-txt generation execute four times per run, in addition to separate generator-test invocations. - Seven live contributor-fetch sequences per run: one in the artifact build, plus
precheckandprebuildon each of the three validation OSes
(site/package.json:12,14,17). Pagination can multiply actual HTTP requests. - Thirteen
npm ciinstallations per run: four build jobs plus nine site-test shards, which install throughci-python-setup/action.yml:41-43. - Nine site-test jobs each repeat environment setup: Python dependencies, native extension build (
build-rust-extension/action.yml:40-44), and
Chromium installation are redone per shard (ci-python-setup/action.yml:44-64).
Duplicated coverage
- The three-OS validation rebuild validates static output deployed through one Pages deployment. OS-sensitive parts are covered elsewhere: dedicated site
tests execute the OG generator cross-OS, and POSIX/PowerShell command generation selects the platform as an explicit argument
(configurator/builders.ts:131-140), so an Astro rebuild on Windows generates those commands but does not execute them. - Cross-OS consumer coverage still exists in
site-tests; the redundant part is the repeated build, not the OS matrix itself.
No dependency or path scoping
- The workflow has no
paths/paths-ignorefilters (ci.yml:3-8), so the full site pipeline runs on every PR update, including changes that cannot
affect site output. A naive docs-only filter would also be wrong: CHANGELOG feeds generated output, and site docs feed llms output. README positioning is
checked separately rather than consumed by the build. Backend coupling is real for specific contracts, not every backend change.
Related gate risk
site-testsusescontinue-on-errorand delegates the failure decision tocheck_flaky_annotations.py. That script exits 0 for a well-formed JUnit
report containing zero testcases, and for skipped-only reports. It does not fail missing or malformed files. There is also no freshness check across retry
attempts: an earlier annotated-failure report can survive a retry killed before XML finalization and pass the gate. Unsplit collection runs beforehand, so
zero-selection is a narrower case than it first appears.
Attribution
- The four-build pattern and thirteen installs predate this PR; base also built four times. This PR adds three
astro checkruns, four build-hook llms
generations, seven contributor fetches, and nine dedicated site matrix jobs. Per-run cost increases even though the build count does not; any comment on the
four-build pattern concerns inherited structure, not a regression introduced here.
There was a problem hiding this comment.
Rerank validation is not coherent between the configurator and the backend
The PR introduces a shared Python reranker-URL rule set (chunkhound/core/utils/rerank_url.py) and an independent TypeScript mirror
(site/src/components/configurator/rerank-validate.ts), tied together by a parity test. Comparing the two sides reveals at least two input classes the
configurator accepts and emits but the backend rejects at config load. Neither is covered by the current parity matrix.
- Unmatched [ in rerank URL userinfo
- Site: rerank-validate.ts validates through WHATWG new URL, which accepts an unmatched [ inside userinfo (for example https://user:pass[@host/rerank);
canonicalRerankUrl only lowercases the scheme, so builders.ts emits the raw bracket. - Backend: normalize_rerank_url → _validate_http_authority runs Python's urlsplit, which rejects an unmatched bracket anywhere in netloc, including
userinfo. Active rerank validation (embedding_config.py's validate_rerank_configuration / validate_rerank_config) therefore raises at load. - Result: a configuration the site marks as valid cannot be loaded by the engine it configures.
- Whitespace-only model accepted by the UI, treated as unset by the backend
- Site: model normalization uses JS .trim(), which does not strip U+0085 (NEL) or U+001C–U+001F. A cohere reranker whose model field contains only such
characters passes rerank-validate.ts (hasModel is true) and is emitted. - Backend: embedding_config.py normalizes with v.strip() or None, which maps exactly those characters to unset, after which the missing-Cohere-model check
raises. - Result: the same string is a valid model in the site and a missing model in the backend. Note the mirror deliberately replicates Python whitespace
semantics for URL characters (PYTHON_WHITESPACE_RE) because JS \s differs, but the model-normalization path does not apply the same treatment.
Both are narrow edge cases, but they are the kind of cross-language acceptance drift the parity tests are intended to prevent, and neither is currently
covered: test_cohere_format_rejects_blank_model covers ASCII spaces only, and the URL acceptance matrix has no userinfo-bracket case. Verified against
pinned head 011bb70 by static read (no runtime probes).
# Conflicts: # CHANGELOG.md
|
Summary: The PR is large (GitHub reports 261 files, +35k/−12k) and mostly sound. Most of the earlier reviewers' blockers no longer reproduce at head 172e0d8, and what's left is process and scope: the AGENTS.md edit, the brand POC and test brittleness. How I grouped it: I made four groups that share no files and reviewed them in parallel. The agents read code but did not run tests, ruff or mypy. I did not re-read the code myself.
Caveat on scope: My local main is stale. gited 331 files, against GitHub's 261. Agent 4's scope-creep items may therefore already be on upstream main:
Re-check them against upstream/main before raising them with the author. Strengths:
Earlier findings that did not reproduce at h
Issues:
Reusability:
Decision: REQUEST CHANGES.
|
I'm dismissing the review since this PR isn't converging. Per our discussion on Discord, I'm merging this anyway
# Conflicts: # CHANGELOG.md
# Conflicts: # .github/workflows/ci.yml # chunkhound/providers/embeddings/voyageai_provider.py # tests/unit/test_docs_version_workflow_contract.py
Note: This PR was generated by an AI agent. If you'd like to talk with other humans, drop by our Discord!
Summary
This branch rebuilds chunkhound.ai and turns the docs into a generated product. It also closes the provider-configuration gaps and hardens browser startup and CI. Humans and agents now read the same story, because the site, the configurator,
llms.txt, andllms-full.txtderive from shared inputs. Provider facts come from the backend, so the shipped catalog cannot drift. The agent files rebuild on every build, so published text cannot go stale.This is not a site-only PR. It also changes backend runtime (Chrome launch), config validation, product identity (
AGENTS.md,README.md,pyproject.toml), release notes, and adds a brand POC. Each is called out below.Why this ships as one PR. The site work is the driver, but it exposed two blockers outside the site. First, the site's browser contracts made the Chrome launch flakiness visible; a bounded, owned launch was required before those tests could run reliably. Second, that same test work surfaced the suite failures that the CI split, the UTF-8 subprocess handling, and the shard rebalance fix. Both stay here because the site work is not verifiable without them: reverting either puts the site tests back to red. The brand POC and the identity wording travel with the same positioning update.
Behavior changes
rerank_format="voyage"with a non-VoyageAI providerrerank_formator use VoyageAIembedding.rerank_urlzd.start()with zendriver's 2.5 s connect ladderpyproject.toml,README.md,AGENTS.mdReview map
site/src/**,site/astro.config.mjsscripts/generate_site_provider_catalog.py,site/scripts/**chunkhound/core/config/**,chunkhound/providers/**chunkhound/utils/websearch_core.py.github/**,tests/**brand/**fontToolsAGENTS.md,README.md,pyproject.toml,CHANGELOG.mdUnreleasedentries1. One story for humans and agents
Astro 7. The site moves from Astro 6.3 to 7.3. Astro 7 parses GitHub-Flavored Markdown directly, so
remark-gfmandmermaidleave the dependency set. Astro 7 also compresses HTML with JSX rules by default, which glues inline siblings such aslaptop.Build.compressHTML: truekeeps render-affecting spaces.tests/site/test_inline_spacing_contract.pyfails if the setting regresses.New homepage. The page now argues one case in sequence: scale, locality, research sources, research questions, enterprise fit, setup, start.
ProvenAtScalecarries the origin story and the metrics.NothingLeavesstates what the local index keeps.ResearchStoryandResearchQuestionsconnect repo sources with web sources.EnterpriseTeaserandStartHereclose the path. Section banding derives from page position, so reordering sections cannot desynchronize the rhythm.Hero terminal. The demo runs as a small state machine, split into session, run, typing, viewport, controls, and timing modules. Pacing, transcript, and narration each have one owner. The card reserves the settled transcript height and clips from the top, like a real scrollback. A Stop control satisfies WCAG 2.2.2 for the 19-second run. Reduced motion writes the full transcript with no sleeps and no CSS animation. Teardown is bfcache-aware, and every async write checks for a destroyed session.
Architecture page.
/docs/architecture/explains why the engine has this shape: chunking, retrieval, adaptive cutoff, token routing, and index freshness. Five diagram components render fromsite/src/lib/architecture.ts. A build-time length check stops a dropped connector from shipping. Prose claims and table-of-contents anchors have tests.New guide pages.
Workflowscovers theworkflow.*pi-schematic API and includes a live demo.Software Factory(pi-schematic) explains the control plane and the human checkpoints.Enterprise Setupcovers remote configuration and usage analytics across a fleet. The old/enterprise/architectureroute redirects to the new architecture page, so external links keep working.Configurator. The monolithic component and its data file split into typed modules under
site/src/components/configurator/: presets, requirements, builders, catalog facts, rerank validation, highlighting, and shell output. New visitors start with Pi and Vercel AI Gateway. A reranker editor validates URL, format, and model in the browser with the backend rules. The copy action stays disabled while the rerank configuration is invalid. Provider search counts query matches only, so a zero-match query announces "No providers found" and still keeps the checked row visible.Navigation.
site/src/lib/nav.tsowns guide groups, page metadata, and top-nav destinations.DocsNavrenders the sidebar and the mobile menu from that model, so one edit reaches both. The filter matches whole groups, the drawer traps focus, and the search shortcut opens the drawer before it focuses the input.Agent corpus.
site/scripts/generate-llms-txt.mjsbuildsllms.txtandllms-full.txtfrom the same nav model,positioning.json, and the Markdown docs. Frontmatter goes, code spans stay literal, and presentation markup flattens to prose..astropages are.md-incompatible, sollms.txtlinks them instead. Both files are gitignored, andprebuildregenerates them. A--checkmode exists for local use; CI relies ontests/site/test_generate_llms_txt.py, because the build already regenerates the files before any check could compare them.Design system.
DESIGN_SYSTEM.mdnow records the tokens, diagram rules, and terminal behavior that the new pages use. The Inter face ships with its OFL license, and sticker sources keep rendered PNGs out of version control.2. Generated data with two guards
The backend owns provider identity and provider facts. The site does not retype them.
scripts/generate_site_provider_catalog.pyreadsLLMProviderLiteral,REMOVED_PROVIDERS,OPENAI_COMPATIBLE_PROVIDERS,LLMConfig.requires_explicit_model, and the embedding provider union. It writessite/src/components/configurator/provider-catalog.gen.jsonwith sorted IDs, fixed field order, LF endings, and no timestamps. The committed file makes site builds independent of a Python run.Two guards keep that file honest:
test_committed_catalog_matches_backend_registrycompares the committed bytes with a fresh render.--checkexits with code 1 and prints the regeneration command when the file is stale or missing.catalogDriftchecks the hand-authored presets against the catalog: every backend provider needs a preset, no preset may name an unknown provider, and any provider that needs a model must pin one. It also mirrors the custom-endpoint rule, including the lookalikeapi.openai.com.evil.comhost.Every failure names
uv run python scripts/generate_site_provider_catalog.py. A copied key URL would create a second source of truth, sorequirements.tsthrows when a caller overrides a registryauthUrl. Marketing copy stays inpositioning.json;README.mdreceives a marker-delimited block from it, and CI runs that sync with--check.3. Configuration
Vercel AI Gateway.
provider: verceljoins the OpenAI-compatible registry withhttps://ai-gateway.vercel.sh/v1. The gateway routes to many upstream models, so structured output stays on the prompt-injection fallback and reasoning support is probed per model. The gateway documentsmax_tokensas optional, so provider-managed synthesis omits the cap, as it does for OpenRouter. Like every registry provider, Vercel needs an explicit model. The configurator pinsdeepseek/deepseek-v4.1-flashin both gateway presets, so a switch between them needs no model change.Ollama. Ollama remains a local OpenAI-compatible endpoint, not a reranker host. Its embedding preset no longer bundles
qwen3-reranker, and its setup hint pulls the embedding model only. Web search, fetch, and research need a reranker, so the configurator now shows that dependency as required for such presets. The docs state the same and show a separate vLLM service for local reranking.Explicit models.
LLMConfig.requires_explicit_model()reports when no baked-in default exists. The generator carries that fact to the site, and the drift guard makes each preset pin a model. Documentation repeats the rule per provider.Frozen Voyage defaults.
voyage-3.5andrerank-2.5stay as runtime fallbacks for configs that omit a model. Those values must not follow the site recommendation, because a changed fallback would rewrite existing indexes. The configurator instead emitsvoyage-4-liteandrerank-3-liteexplicitly. The upgrade hint stays print-only, and the map now pointsvoyage-3.5atvoyage-4-lite.One rerank URL module.
chunkhound/core/utils/rerank_url.pyowns normalization, resolution, and redaction.EmbeddingConfig, the factory, and both HTTP providers use it. The module lowercases only the scheme and rejects backslashes, incomplete authorities, and whitespace, because browsers and HTTP clients disagree on those forms. Providers keep their own relative-path join rule. A relative URL withoutbase_url, or an invalid URL, is dropped with a warning that names the sanitized endpoint. Credentials, query, and fragment never reach the log. An unusedrerank_urlno longer blocks config load, a blankrerank_modelresolves to the provider default, andrerank_format="voyage"is limited to VoyageAI. The site mirror inrerank-validate.tsuses the same acceptance matrix, including Python whitespace semantics.4. Runtime, CI, and test surface
Chrome.
_managed_browsernow starts one owned browser with a hard 20-second bound. The connection budget stays generous for a cold CI launch (0.5 s × 30 tries ≈ 15 s), and a failed start closes its CDP session within 2 seconds. A failed stop gets 10 seconds before the urllib fallback. Failure, cancellation, and a failed stop all reap the owned process tree and the temporary profile.This is the code the site's browser contracts needed. Their failures exposed the launch path, and the old retry ladder plus exit-time cleanup net were replaced rather than patched. Cleanup reads zendriver's
_process,_process_pid, andget_registered_instances, sozendriverstays pinned at0.15.3. Chrome older than 124 still fails the version probe, because zendriver cannot parse itsResponse.charsetevents, and every unusable case warns before falling back to urllib.BOM and legacy encodings.
read_json_filedecodes UTF-8 with an optional signature first, then retries with the platform locale. Config load, remote-config persistence, Code Mapper overrides, and the CLI timeout prompt use it. A file that neither encoding can read still fails, but with the friendly invalid-JSON message. Rewritten configs normalize to plain UTF-8. Subprocess output is pinned to UTF-8 with replacement, and a byte-exact test guards that rule.CI. The site build now runs
astro checkand the README positioning check, then builds;prebuildgenerates the agent corpus. Unit and integration tests run withouttests/site, so a browser dependency cannot slow them. A newsite-testsjob runs three shards on three operating systems withleast_durationsplitting and a 700-second per-test cap.CHUNKHOUND_REQUIRE_SITE=1turns a missing toolchain into a failure, not a skip. The test jobs share a setup action, keep the flaky-annotation gate, and join the release gate.tests/unit/test_ci_site_split_contract.pyholds the split.Test surface.
tests/siteis 22 files and roughly 4.3k added lines, and it is why this PR's CI job was split. Each file guards a user-visible contract: rendered markup and spacing, terminal behavior and reduced motion, configurator output and rerank validation, generatedllms.txtcontent, navigation and focus, color contrast, and build output.CHUNKHOUND_REQUIRE_SITE=1keeps those tests honest: a missing toolchain fails instead of skipping.Browser tests. Component behavior runs in happy-dom against the real built markup, with fakes only at browser boundaries such as
IntersectionObserver, rAF, and media queries. Geometry, typography, contrast, theme, and keyboard contracts run in Playwright Chromium against a hermetic server that aborts external requests. Font fixtures come from the shipped face, so text metrics match the real page. The oversized-chunk reproduction left pytest and lives intests/debug/as a manual script.5. Brand POC and product identity
Brand POC.
brand/stickers/replaces the deleted PNG-based brand assets with printable SVG sources. PNGs stay out of version control, so the SVG is the only source of truth. Both generators run from that directory:uv run --with fonttools python outline_text.pyoutlines Inter Bold text into glyph paths, anduv run python gen_showcases.pyrenders the lid showcases.fontToolsis fetched per run, so it is not a project dependency. The showcases reproduce Apple, Lenovo, and ThinkPad badge geometry for placement preview only; any print or distribution needs a maintainer sign-off.Identity.
AGENTS.mdchanges three lines: the project tagline, the purpose line, and the lint command (make lint). Approved by @ofriw, the contributor who submitted this PR.README.mdandpyproject.tomlcarry the same tagline, so the site, the package, and the agent context tell one story.