chore(site): serve the docs from the codearbiter.dev apex domain - #588
Conversation
Points the Astro build at the purchased apex domain and ships the GitHub Pages CNAME in the built artifact, so the site resolves at https://codearbiter.dev instead of the arbiterforge.github.io/codeArbiter project path. DNS is not yet cut over; the old URL keeps serving and GitHub redirects it once the custom domain is live. BASE is "" rather than "/". rehypeBaseLinks prefixes root-absolute href/src values with BASE, and "/" would turn "/diagrams/x.svg" into "//diagrams/x.svg" — a protocol-relative URL resolving against another host, failing silently rather than 404-ing. Empty string makes the plugin a correct no-op. Astro still needs a real path, so it takes `BASE || "/"`. The 19 diagram <img src> attributes across 16 pages were not defects: hardcoding the base literal is the sanctioned Task-21 convention for .md/.mdx, because raw HTML in markdown is not walked by rehypeBaseLinks. The literal simply moves with the base, so all 19 become root-absolute. BASE is now exported and the four tests that assert base-dependent output import it instead of re-declaring the literal. Three kept their own copy, which is what turned a one-line base change into four failures — the convention guard now derives its regex from the config it is supposed to be guarding. One assertion changed meaning rather than value: astro-config's "does not contain the unprefixed href" check asserts the opposite of correct behaviour when BASE is "", so it is now conditional on a non-empty base. Verified: 496/496 site tests green; the convention guard dies to a bare-relative src mutant and recovers; the build emits pages at the root with dist/CNAME present, zero surviving /codeArbiter/ asset paths in the HTML, and the sitemap on the new host.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe site now targets ChangesApex domain deployment
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@site/test/astro-config.test.ts`:
- Line 23: Add site/astro.config.d.mts declaring typed BASE and the default
Astro configuration so strict TypeScript accepts all named imports from
astro.config.mjs. Remove the existing suppression in
site/test/astro-config.test.ts and apply the shared declaration to the imports
in site/test/content/documentation-presentation.test.ts,
site/test/generator/diagram-href-convention.test.ts, and
site/test/generator/diagrams.test.ts.
In `@site/test/generator/diagram-href-convention.test.ts`:
- Around line 50-53: Update the regular expression construction in the diagram
href validation to escape the BASE value before interpolating it into RegExp.
Preserve the existing BASE-derived path matching while ensuring regex
metacharacters, including periods, are treated literally.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: 6d1c3796-06c7-41ab-9f96-a5a28282f68f
📒 Files selected for processing (22)
site/astro.config.mjssite/public/CNAMEsite/src/content/docs/codearbiter-directory.mdsite/src/content/docs/concepts/gated-lanes.mdsite/src/content/docs/concepts/jit-context-injection.mdsite/src/content/docs/concepts/provenance-drift.mdsite/src/content/docs/enforcement.mdsite/src/content/docs/feature-forge/overview.mdsite/src/content/docs/getting-started/claude-code-and-codex.mdsite/src/content/docs/guides/adding-a-dependency.mdsite/src/content/docs/guides/autonomous-sprints.mdsite/src/content/docs/guides/feature-lane.mdsite/src/content/docs/guides/opt-in-a-repo.mdsite/src/content/docs/guides/recording-adrs.mdsite/src/content/docs/guides/releasing-a-version.mdsite/src/content/docs/guides/the-statusline.mdsite/src/content/docs/guides/troubleshooting.mdsite/src/content/docs/overview.mdsite/test/astro-config.test.tssite/test/content/documentation-presentation.test.tssite/test/generator/diagram-href-convention.test.tssite/test/generator/diagrams.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (5)
- GitHub Check: Analyze (rust)
- GitHub Check: Analyze (python)
- GitHub Check: Analyze (go)
- GitHub Check: Analyze (javascript-typescript)
- GitHub Check: Analyze (actions)
⚠️ CI failures not shown inline (2)
GitHub Actions: Deploy docs / 1_Site [Build] - Astro Pages.txt: chore(site): serve the docs from the codearbiter.dev apex domain
Conclusion: failure
ure/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/fix/ (outside base path: resolves to /reference/commands/fix/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/init/ (outside base path: resolves to /reference/commands/init/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/metrics/ (outside base path: resolves to /reference/commands/metrics/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/new-skill/ (outside base path: resolves to /reference/commands/new-skill/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/override/ (outside base path: resolves to /reference/commands/override/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/pr/ (outside base path: resolves to /reference/commands/pr/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/preview/ (outside base path: resolves to /reference/commands/preview/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/prune/ (outside base path: resolves to /reference/commands/prune/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/reconcile/ (outside base path: resolves to /reference/commands/reconcile/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/refactor/ (outside base path: resolves to /reference/commands/refactor/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/release/ (outside base path: resolves to /reference/commands/release/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/review/ (outside base path: resolves to /reference/commands/review/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /referen...
GitHub Actions: Deploy docs / Site [Build] - Astro Pages: chore(site): serve the docs from the codearbiter.dev apex domain
Conclusion: failure
ure/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/fix/ (outside base path: resolves to /reference/commands/fix/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/init/ (outside base path: resolves to /reference/commands/init/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/metrics/ (outside base path: resolves to /reference/commands/metrics/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/new-skill/ (outside base path: resolves to /reference/commands/new-skill/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/override/ (outside base path: resolves to /reference/commands/override/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/pr/ (outside base path: resolves to /reference/commands/pr/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/preview/ (outside base path: resolves to /reference/commands/preview/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/prune/ (outside base path: resolves to /reference/commands/prune/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/reconcile/ (outside base path: resolves to /reference/commands/reconcile/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/refactor/ (outside base path: resolves to /reference/commands/refactor/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/release/ (outside base path: resolves to /reference/commands/release/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /reference/commands/review/ (outside base path: resolves to /reference/commands/review/, not under /codeArbiter)
reference/skills/tribunal/index.html -> /referen...
🧰 Additional context used
📓 Path-based instructions (1)
**/*.md
⚙️ CodeRabbit configuration file
Prose in this repo is part of the product — skills and commands are read and executed by agents, so an ambiguous instruction is a defect, not a style nit. Prioritise findings where prose and the mechanism it describes disagree, where a documented command or flag no longer exists, or where an instruction cannot be followed literally without a contradiction. Deprioritise wording, tone and formatting preferences.
Files:
site/src/content/docs/concepts/provenance-drift.mdsite/src/content/docs/feature-forge/overview.mdsite/src/content/docs/concepts/jit-context-injection.mdsite/src/content/docs/guides/recording-adrs.mdsite/src/content/docs/guides/autonomous-sprints.mdsite/src/content/docs/getting-started/claude-code-and-codex.mdsite/src/content/docs/guides/feature-lane.mdsite/src/content/docs/enforcement.mdsite/src/content/docs/codearbiter-directory.mdsite/src/content/docs/guides/opt-in-a-repo.mdsite/src/content/docs/overview.mdsite/src/content/docs/guides/releasing-a-version.mdsite/src/content/docs/guides/troubleshooting.mdsite/src/content/docs/guides/the-statusline.mdsite/src/content/docs/guides/adding-a-dependency.mdsite/src/content/docs/concepts/gated-lanes.md
🪛 ast-grep (0.45.0)
site/test/generator/diagram-href-convention.test.ts
[warning] 52-52: Regular expression constructed from variable input detected. This can lead to Regular Expression Denial of Service (ReDoS) attacks if the variable contains malicious patterns. Use libraries like 'recheck' to validate regex safety or use static patterns.
Context: new RegExp(^${BASE}/diagrams/[\\w.-]+\\.svg$)
Note: [CWE-1333] Inefficient Regular Expression Complexity
(regexp-from-variable)
🪛 GitHub Actions: Deploy docs / 2_Site [Test] - Generator.txt
site/test/astro-config.test.ts
[error] 23-23: TypeScript typecheck failed in 'npm run typecheck' (tsc --noEmit): Could not find a declaration file for module '../astro.config.mjs'; the module implicitly has an 'any' type (TS7016).
🪛 GitHub Actions: Deploy docs / Site [Test] - Generator
site/test/astro-config.test.ts
[error] 23-23: TypeScript error TS7016: Could not find a declaration file for module '../astro.config.mjs'; the module implicitly has an 'any' type. Command failed: npm run typecheck.
🔇 Additional comments (22)
site/astro.config.mjs (1)
9-21: LGTM!Also applies to: 47-48, 57-77
site/src/content/docs/guides/opt-in-a-repo.md (1)
26-26: LGTM!site/src/content/docs/guides/recording-adrs.md (1)
21-21: LGTM!site/src/content/docs/guides/releasing-a-version.md (1)
20-20: LGTM!site/src/content/docs/guides/the-statusline.md (1)
25-25: LGTM!site/src/content/docs/guides/troubleshooting.md (1)
75-75: LGTM!site/src/content/docs/overview.md (1)
49-49: LGTM!site/test/astro-config.test.ts (1)
44-51: LGTM!site/test/content/documentation-presentation.test.ts (1)
100-101: LGTM!site/test/generator/diagram-href-convention.test.ts (1)
8-11: LGTM!site/test/generator/diagrams.test.ts (1)
108-108: LGTM!site/public/CNAME (1)
1-1: LGTM!site/src/content/docs/codearbiter-directory.md (1)
75-75: LGTM!site/src/content/docs/concepts/gated-lanes.md (1)
27-27: LGTM!Also applies to: 56-56
site/src/content/docs/concepts/jit-context-injection.md (1)
57-57: LGTM!site/src/content/docs/concepts/provenance-drift.md (1)
35-35: LGTM!site/src/content/docs/enforcement.md (1)
59-59: LGTM!Also applies to: 109-109
site/src/content/docs/feature-forge/overview.md (1)
24-32: LGTM!site/src/content/docs/getting-started/claude-code-and-codex.md (1)
66-66: LGTM!site/src/content/docs/guides/adding-a-dependency.md (1)
23-23: LGTM!site/src/content/docs/guides/autonomous-sprints.md (1)
21-21: LGTM!site/src/content/docs/guides/feature-lane.md (1)
32-32: LGTM!
CI caught two failures the local run missed, both the same root cause:
the base literal was copied into six places, each with a comment saying
it had to match the others. The apex move desynced all six at once.
- tsc (not vitest) failed on four untyped .mjs imports; `npm test`
runs vitest only, so the local run was green while CI was red.
- link-audit reported 19,940 failures because
scripts/link-audit/lib.ts held its own "/codeArbiter" constant.
site/base.mjs is now the only definition. astro.config.mjs re-exports it
so existing importers are unchanged, and link-audit imports it directly
instead of restating it. The resolution logic already handled an empty
base correctly; only the literal was wrong.
The link-audit unit tests now pin a fixed TEST_BASE rather than the
site's live value. They exercise prefix stripping and the outside-base
classification, which only exist when the base is non-empty — binding
them to the live base made nine cases silently stop testing anything the
moment the site moved to an apex domain.
A new describe block covers the apex case, and it records a real
behaviour change rather than asserting a comfortable one: with base "",
posix.normalize clamps at the root, so every root-absolute target is
inside the base and the outside-base guard is INERT. What still catches
a bad target is the dangling-file check. Pinned so the next reader does
not assume a protection that no longer bears load.
Verified: 500/500 vitest, tsc clean, build green, link-audit resolves
20,057 links across 140 pages.
The convention guard built its matcher with
`new RegExp(\`^${BASE}/diagrams/...\`)`. Interpolating a value into a
regex means any metacharacter it contains changes the pattern's meaning:
a base such as "/docs.v2" or "/v1.0" carries a "." that matches any
character, so the guard would accept "/docsXv2/diagrams/a.svg" and
quietly stop guarding. This file exists specifically to survive a base
change, so it must not be the thing that breaks on one.
Matching the base as a plain string prefix and validating the remainder
against a literal regex removes the class of problem outright, and is
simpler than escaping would be.
Honest scope note: this is hardening against a defect in principle, not
a demonstrated live failure. Repeated attempts to reproduce the
metacharacter case in a throwaway script were confounded by shell and
template-literal escaping — the harness kept degrading the pattern so
that it failed the legitimate case too. The behaviour was never
reproduced against the real code, whose current base is "" and therefore
carries no metacharacters at all.
Guard still dies to a bare-relative src mutant and recovers.
500/500 vitest green, tsc clean.
Points the docs site at the purchased apex domain
codearbiter.devand ships the GitHub PagesCNAMEin the built artifact.DNS is not cut over yet. The old
arbiterforge.github.io/codeArbiter/URL keeps serving untilthe Pages custom domain is set, and GitHub redirects it afterwards. This PR is the repo half, ready
to merge the moment DNS resolves.
The trap worth knowing about
BASEis"", not"/".rehypeBaseLinksprefixes every root-absolutehref/srcwithBASE,so
"/"would rewrite/diagrams/x.svginto//diagrams/x.svg— a protocol-relative URL thatresolves against a different host. That fails silently rather than 404-ing, which makes it far
worse than a broken link. Empty string makes the plugin a correct no-op. Astro's own
basestillneeds a real path, so it takes
BASE || "/".A correction to an earlier read
The 19 diagram
<img src>attributes across 16 pages are not defects. Hardcoding the baseliteral is the sanctioned Task-21 convention for
.md/.mdx, because raw HTML in markdown is notwalked by
rehypeBaseLinks. The literal simply moves with the base, so all 19 becomeroot-absolute.
astro.config.mjspreviously read as though hardcoding was banned outright; thatcomment now states the documented exception and points at the guard.
Root cause of the four test failures
BASEis now exported, and the four tests that assert base-dependent output import it insteadof re-declaring the literal. Three kept their own
const BASE = "/codeArbiter"— that duplicationis what turned a one-line base change into four failures. The convention guard in particular now
derives its regex from the config it exists to guard, so the two cannot disagree again.
One assertion changed meaning, not just value: astro-config's "does not contain the unprefixed
href" check asserts the opposite of correct behaviour once
BASEis"", so it is now conditionalon a non-empty base rather than quietly deleted.
Verification
npm test, the vitest generator suite — a build alone does not run it)src="diagrams/x.svg") and recovers,so it still detects drift rather than matching everything
dist/CNAMEpresent, zero surviving/codeArbiter/assetpaths in built HTML, sitemap and canonical on
https://codearbiter.devRemaining, outside this PR
DNS at Spaceship (four A records at
@→ the Pages IPs,wwwCNAME →arbiterforge.github.io),then setting the Pages custom domain and enforcing HTTPS once the cert provisions.