doc: check links with UriReference (URI slice 10) #134
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
doc: check links with
UriReference(URI slice 10)Goal
compiler/src/documentation/links.trb(pageLinkProblems) classifies a link target with fourstartsWithtests (http://,https://,mailto:,/). Replace them withUriReference.tryFrom(target)andresolved(against:), sodocs checkreads a link target the way every other URI in the toolchain is read.Design record
URI.md slice 10 ("answering exactly what they answer today") and the migration table row "
docs check's link targets" (URI.md section 11).UriReferenceis built (slice 2,std/uri, done); the dependency slice 7 (the compiler importsstd/uri) is done (compiler/src/semantics/checker/literal.trbalready does).Acceptance criteria (proposed, pending the owner decision below)
pageLinkProblemsno longer callsstartsWith("http://"),startsWith("https://"),startsWith("mailto:")orstartsWith("/")on a link target; it classifies throughUriReference(scheme present = external, skipped; no scheme and an absolute path = the existing "is absolute" problem; otherwise internal).compiler/tests/documentation.test.trbcover gives the same problems (same text, same line) as before.//host/x,scheme:restthat is not a URL, a targetUriReference.tryFromrefuses such as one with a space).sh tools/gates.sh agreen;docs checkon this repo reports no new problem.Seed
Does not touch the seed: no syntax, native, driver flag or compiler-looked-up std name.
std/uriis already in the fixpoint (slice 7), so the change is a plain library-use change incompiler/src/documentation/links.trband its tests. One PR, one Conventional Commit (refactor(docs): ...), possibly a second for added tests.Open design choice
resolved(against:)takes aUribase (URI.md 3a), but a documentation page only has a relative path, no scheme. AndUriReferencereads some targets differently from the fourstartsWithtests. See the[loop:torbscript] owner decision:comment; this issue is notreadyuntil it is answered.Moved from the planning lists of the docs; the design record stays the specification.
[loop:torbscript] claim refine by session:loop-torbscript until 2026-10-06T08:43:56Z
[loop:torbscript] owner decision: how
docs checkshould applyUriReferenceto link targets (issue #134, URI.md slice 10 says "exactly what they answer today" but does not settle these).What is open
resolved(against:)needs aUribase; documentation pages are plain relative paths. TodaynormalizePath(joinDocumentationPath(page.folder, target))does the join.UriReferencediffers from the fourstartsWithtests on some inputs://host/x(has an authority; today only "starts with /" -> "is absolute" error),foo:bar.md(has a scheme, so it would count as external and be skipped; today it is a path and fails as not-a-page), and targetstryFromrefuses (a space, e.g.my file.md; today they resolve as paths).Options
UriReferencefor external/absolute/internal and keepnormalizePath/joinDocumentationPathfor the path join; refused targets stay path-checked. Minimal, no synthetic base, behavior identical except//host/x(still an error) andscheme:rest(now external, skipped).resolved(against:)with a synthetic base such asdocs:///<folder>/, then map the resulting path back. Matches the slice text literally, but invents a scheme and changes the diagnostics for refused targets.tryFromrefuses becomes its own link problem ("not a valid link target"). Stricter than today, so a behavior change.Recommendation: A, with
scheme:resttreated as external and a test pinning it; amend slice 10's wording in URI.md to "classifies throughUriReference; the join stays path-based" in the same PR. Needs Torben's answer in this issue before the loop labels itready.[loop:torbscript] refine: rewrote the body (goal, criteria, design point, no seed change, one PR;
UriReferenceand slice 7 are already done, no dependency), but the link-target semantics (synthetic base vs. classify-only,//host/x,scheme:rest, refused targets) are not settled by URI.md, so I filed an owner decision and did not labelready, next: wait for Torben's answer in this issue.[loop:torbscript] owner decision recorded (torben, 2026-10-06, relayed from the TorbScript WhatsApp group): the owner delegated this one to Orion's recommendation after careful review. Option A:
UriReferenceonly classifies a target (external / absolute / internal). The join stays path-based (normalizePath(joinDocumentationPath(...))); no syntheticdocs:///base.scheme:rest(e.g.foo:bar.md) counts as external and is skipped; a test pins it.//host/xstays an error (as today).tryFromrefuses (e.g.my file.md) keep today's path check; no new diagnostic (option C rejected as a behaviour change without need).UriReference; the join stays path-based".Labelled
ready.[loop:torbscript] claim implement by session:loop-torbscript-20261007 until 2026-10-07T17:13:05Z
[loop:torbscript] implement: the worker session was lost (gateway execution context ended after ~16 min; no branch, no PR, no commits pushed). Claim released; the next tick starts a fresh worker. next: implement
[loop:torbscript] claim implement by session:loop-torbscript-20261007 until 2026-10-07T21:31:00Z
[loop:torbscript] implement: PR #158 is open (
Closes #134, one commitrefactor(docs): classify link targets through UriReference, branchloop/134-docs-check-uri-reference).pageLinkProblemsclassifies a link target throughUriReference.tryFrom(scheme = external, authority or root path = absolute, rest = internal; path join unchanged), per the recorded Option A; three new tests pinscheme:rest,//host/xand a refused target; URI.md slice 10 amended and marked done. Gates: worker host has no C compiler, sosh tools/gates.sh aran in agcc:14container (4 CPUs / 10 GB, removed afterwards) - green after one formatter fix,tools/check-commits.sh origin/main HEADclean; forge CI of the PR is green (all 12 jobs, 8 skipped by design). Review requested from argus. Worker token usage not measurable from inside the worker. next: review (waiting on merge gate argus)