Context-Prompt: Webring Winding Number
Research prototype plan for topological webring navigation

Table of Contents

Meta

This is a context-prompt document for metaplanning an LLM research prototype. It captures the design rationale, mathematical grounding, and implementation constraints for adding winding number semantics to the wal.sh webring footer.

Beads

Bead ID Title Status
http://www.wal.sh-736x Research webring winding number concept open
http://www.wal.sh-7ndx Webring footer: show n, p, w with info tooltip blocked by 736x

CPRR Tracking

ID Conjecture Status
C1 Winding number is the correct algebraic object for ord=1 ring confirmed
C2 URL-encoded state (?w=N) is sufficient for static sites confirmed
C3 Footer display ord=1 k=1 w=0 is the right density confirmed
C4 Info tooltip makes the notation self-documenting open
C5 At ord=1, winding number is experientially opaque (degeneracy) confirmed
C6 Fractional display w=3(3/1) reveals scaling structure at ord=1 open

Problem Statement

The wal.sh site has a webring footer with ord=1 member. The current footer reads:

[← prev]  webring (ord=1)  [next →]

Both prev and next link to https://wal.sh/, creating a degenerate ring. We want to replace the static label with a meaningful notation that captures the topology of traversal — not position (trivially 1), not pagination (doesn't go negative), but the net number of complete revolutions a visitor has made around the ring.

Why Standard Metaphors Fail

Metaphor Problem for ord=1
Pagination Cannot go negative, implies finite pages
Odometer Only increments, no direction
Position Always 1, never changes
Clock/Epoch Requires 12 members for the hour metaphor
Counter Unsigned, loses prev/next directionality

The winding number from algebraic topology is the exact fit.

Mathematical Foundation

Winding Number

Source: Winding number (Wikipedia)

The winding number of a closed curve in the plane around a given point is an integer representing the total number of times the curve travels counterclockwise around the point.

Key properties:

  • \(w \in \mathbb{Z}\) — unbounded signed integer
  • Counterclockwise (next) is positive: \(w \to w + 1\)
  • Clockwise (prev) is negative: \(w \to w - 1\)
  • Additive: net winding is independent of path order
  • Topological invariant: homotopy class in \(\pi_1(S^1) \cong \mathbb{Z}\)

Application to Webring

A webring of \(\text{ord}=1\) is topologically \(S^1\) (the circle). Each click of prev or next completes a full revolution (since there is only one node). The winding number counts net revolutions:

  • Initial page load (no param): \(w = 0\) — at the origin
  • Click "next →": \(w \to w + 1\) — counterclockwise revolution
  • Click "← prev": \(w \to w - 1\) — clockwise revolution

The visitor is the origin point. The red curve (their click path) winds around them.

Visual Reference

An object traveling along the red curve makes two counterclockwise turns around the person at the origin. — Wikipedia, Winding Number

  • Animation: Winding_Number_Animation_Small.gif
  • Static w=2 diagram: static/images/Winding_Number_2_svg.png

Scaling to ord > 1

When the ring grows to \(\text{ord}\) members, each click advances position by 1 but increments \(w\) by \(1/\text{ord}\). A full winding (\(w = 1\)) requires traversing all \(\text{ord}\) members. The fundamental group structure is preserved.

ord Clicks for w=1 w per click
1 1 1
2 2 1/2
12 12 1/12

The ord=1 Degeneracy

IMPORTANT FOR IMPLEMENTING AGENTS: This section explains why the winding number appears trivial at ord=1 and why the full semantics only become visible at ord≥2. If you are working on an ord=1 deployment, read this carefully.

At \(\text{ord} = 1\), every click completes a full revolution. The winding number \(w\) reduces to a signed click counter: next increments by \(1/1 = 1\), prev decrements by \(1/1 = 1\). This is mathematically correct — \(\pi_1(S^1) \cong \mathbb{Z}\) — but experientially opaque. The visitor clicks "next", lands on the same page with =\(w=1=\) instead of =\(w=0=\), and has no sense of having traversed anything.

The distinction between "winding number" and "signed counter" is invisible at \(\text{ord} = 1\) because:

  1. There is no fractional accumulation: \(w\) is always an integer, same as a counter
  2. There is no visiting-other-sites: the ring has one member, so "traversal" is instantaneous
  3. There is no experiential loop closure: at \(\text{ord} = 7\), visiting all 7 sites to reach \(w = 1\) feels like completing a circuit. At \(\text{ord} = 1\), one click = one circuit = no perceived journey.

The winding number's value as a concept comes from \(\text{ord} \geq 2\), where the \(1/\text{ord}\) fractional increment creates a visible accumulation arc and ring traversal becomes a real multi-step experience. The \(\text{ord} = 1\) case is the correct degenerate limit, not the motivating example.

Strategies for Communicating at ord=1

Strategy Display at w=3 Tradeoff
Raw integer w=3 Clean but indistinguishable from count
Fractional hint w=3 (3/1) Shows scaling structure, odd for ord=1
Placeholder members Seed ring with ord=3 Full semantics visible, requires stubs
Commentary tooltip ⓘ explains degeneracy No display change, relies on curiosity

Cylinder Topology (Corrected)

The state space \((k, w) \in \mathbb{Z}_{\text{ord}} \times \mathbb{Z}\) is a cylinder, not a torus. The winding number \(w \in \mathbb{Z}\) is unbounded — it never wraps. The fundamental group \(\pi_1(S^1 \times \mathbb{R}) \cong \mathbb{Z}\) has one generator: the ring loop.

  • \(k \in \mathbb{Z}_{\text{ord}}\): ring position — cyclic, wraps around
  • \(w \in \mathbb{Z}\): winding — covering space coordinate, accumulates indefinitely

The winding number is the vertical coordinate on a spiral staircase around the ring. Each revolution takes you one floor up (or down). There is no second loop — no hole to wind through.

Visitor Actions (Squid Metaphor)

The curve head (the "squid") represents a visitor navigating the ring. Three possible actions:

  • next → advance \(k\) by 1, accumulate \(+1/\text{ord}\) toward \(w\)
  • prev → retreat \(k\) by 1, accumulate \(-1/\text{ord}\) toward \(w\)
  • stay → browse current site, perform outside actions. \(w\) and \(k\) frozen. The URL carries ?w=N unchanged during internal browsing.

Design

Footer Display

[← prev]  ord=1 k=1 w=0  [next →]  ⓘ

Variable Semantics

Symbol Name Type Mutability Description
ord order static deploy Order of cyclic group Zord  
k element static deploy Element in Zord (1-indexed)
w winding dynamic click Visitor state: net revolutions

Two static (change only on deploy), one dynamic (changes per click).

State Encoding

State lives entirely in the URL query parameter:

https://wal.sh/?w=0      # initial
https://wal.sh/?w=1      # one next click
https://wal.sh/?w=-3     # three prev clicks

No server state. No cookies. No localStorage. The winding number is carried in the link itself, which is topologically appropriate — it encodes an element of \(\pi_1(S^1)\).

Info Tooltip Content

The icon shows a popup explaining:

Webring navigation
  ord = order of cyclic group |Z_ord|
  k   = element in Z_ord (this site's position)
  w   = winding number (net traversals, + for next, − for prev)
See: https://en.wikipedia.org/wiki/Winding_number

State Diagram

Data Flow

Implementation Plan

Phase 1: Research (bead 736x)

- [ ] Document winding number semantics in site research/
- [ ] Create research page: research/webring-winding/index.org
- [ ] Include Wikipedia animation reference
- [ ] Include w=2 static diagram (already in static/images/)
- [ ] Define variable semantics (n, p, w) formally
- [ ] Document scaling behavior for n > 1
- [ ] Confirm CPRR conjecture C1 with evidence

Phase 2: Implementation (bead 7ndx, blocked by 736x)

Registry File

{
  "version": 1,
  "ring": [
    {
      "position": 1,
      "domain": "wal.sh",
      "name": "Jason Walsh",
      "joined": "2026-02-01"
    }
  ]
}

Footer HTML Fragment

<nav class="webring" aria-label="Webring navigation">
  <a id="webring-prev" href="/?w=-1" rel="prev">← prev</a>
  <span id="webring-status">ord=1 k=1 w=0</span>
  <a id="webring-next" href="/?w=1" rel="next">next →</a>
  <span class="webring-info" tabindex="0" role="button"
        aria-label="What do these values mean?"
        title="Webring: ord=|Z_ord|, k=element in Z_ord, w=winding number (net traversals). See: https://en.wikipedia.org/wiki/Winding_number">ⓘ</span>
</nav>

Inline JavaScript

(function () {
  var params = new URLSearchParams(window.location.search);
  var w = parseInt(params.get('w'), 10) || 0;

  // Ring configuration (build-time constants)
  var ord = 1;  // order of cyclic group |Z_ord|
  var k = 1;    // element in Z_ord (1-indexed)

  // Update display: C = ⟨ord, k, w, t, d⟩
  var status = document.getElementById('webring-status');
  if (status) {
    status.textContent = 'ord=' + ord + ' k=' + k + ' w=' + w;
  }

  // Update nav links with w±1
  var prev = document.getElementById('webring-prev');
  var next = document.getElementById('webring-next');
  if (prev) prev.href = '/?w=' + (w - 1);
  if (next) next.href = '/?w=' + (w + 1);
})();

Minimal CSS

.webring {
  display: flex;
  align-items: center;
  gap: 1em;
  font-family: monospace;
  font-size: 0.85em;
}

.webring-info {
  cursor: help;
  opacity: 0.6;
  font-size: 0.9em;
}

.webring-info:hover,
.webring-info:focus {
  opacity: 1;
}

Build Integration

# Addition to existing Makefile
WEBRING_JSON := webring.json

# Generate webring fragment at build time
webring: $(WEBRING_JSON)
    @echo "Webring: ord=$(jq '.ring | length' $(WEBRING_JSON)), k=1"

# Existing build target depends on webring
build: webring org-export

Phase 3: Deploy and Verify

- [ ] Build site with updated footer
- [ ] Verify ?w=0 renders correctly
- [ ] Verify ?w=5 shows w=5, links to ?w=4 and ?w=6
- [ ] Verify ?w=-3 shows w=-3, links to ?w=-4 and ?w=-2
- [ ] Verify no-JS fallback shows ord=1 k=1 w=0 (static default)
- [ ] Verify ⓘ tooltip is accessible (keyboard focusable)
- [ ] Update beads: close 736x, unblock and close 7ndx
- [ ] CPRR: advance remaining conjectures

Constraints

Infrastructure

  • Static site: org-mode → HTML via Makefile
  • Hosted on FreeBSD infrastructure (nexus/hydra)
  • No server-side state, no databases
  • Minimal inline JS (progressive enhancement)
  • Must work with no JavaScript (static fallback)

Design

  • Footer must remain sparse: ord=1 k=1 w=0 not prose
  • Info icon (ⓘ) provides discoverability without clutter
  • Monospace font for the status display
  • No external dependencies (no frameworks, no CDN)

Mathematical

  • \(w \in \mathbb{Z}\): must handle negative values
  • For \(n = 1\): every click is a complete revolution
  • For \(n > 1\) (future): \(w\) increments by \(1/n\) per click
  • Zero is the identity: fresh page load = no winding

Agent Instructions

For Research Agent (bead 736x)

You are building a research page for wal.sh/research/ documenting the winding number concept as applied to webring navigation.

  1. Create research/webring-winding/index.org following the style of existing research pages (see research/tla-plus-system-design/ or research/ads-b/ for structure)
  2. Include the mathematical definition, the Wikipedia animation reference, and the variable semantics table
  3. Explain why standard metaphors (pagination, odometer, counter) fail for a ring of one
  4. Document the \(\pi_1(S^1) \cong \mathbb{Z}\) connection
  5. Include Mermaid diagrams for state transitions and data flow
  6. Keep the tone technical but accessible — this is a personal research site, not a paper

For Implementation Agent (bead 7ndx)

You are implementing the webring footer for wal.sh.

  1. The site is built from org-mode with :tangle and :mkdirp t
  2. The footer currently shows [← prev] webring (ord=1) [next →]
  3. Replace with the HTML/JS/CSS fragments defined above
  4. The webring.json registry is the source of truth for ord and k
  5. The winding number w is read from ?w=N query parameter
  6. Prev/next links encode w-1 and w+1 respectively
  7. The ⓘ uses a native title attribute — no tooltip library
  8. Test: curl -s 'https://wal.sh/?w=42' should show w=42 in source (the JS rewrites client-side, so static HTML shows w=0 default)
  9. READ "The ord=1 Degeneracy" section. At ord=1, the winding number is mathematically correct but experientially indistinguishable from a signed counter. This is expected. The design anticipates ord>1 where the 1/ord fractional accumulation becomes visible. Do not "simplify" w to a plain counter — the algebraic structure must be preserved for when the ring grows.

For Visualization Agent

You are building an interactive animation showing the cylinder topology of webring traversal with ord nodes — a spiral staircase, not a torus.

  1. READ "The ord=1 Degeneracy" and "Cylinder Topology" sections first. The animation must make the winding number semantics visible, which means defaulting to ord≥3 (recommended: ord=7, matching the wal.sh logo).
  2. The ring of ord nodes forms the circular cross-section of the cylinder. The winding number \(w\) is the vertical axis — each revolution moves one floor up (next) or down (prev).
  3. One generator only: ring traversal (k). The winding \(w\) is the covering space coordinate, not a second loop. \(\pi_1(S^1 \times \mathbb{R}) \cong \mathbb{Z}\).
  4. The curve head ("squid") tracks angular position. Active node = whichever node is angularly closest to the curve head.
  5. Edge highlighting: show traversal progress as partial fills along edges 1→2→3→…→ord→1. Visited edges stay brighter.
  6. Controls: w (−2 to 3), ord (1, 3, 5, 7, 12), speed, helix mode (flat/3D), pause.
  7. HUD displays live ord=X k=Y w=Z matching the footer notation.
  8. At ord=1 the animation should still work but the degeneracy should be visually apparent — the ring collapses to a single dot and each click is a full revolution. This contrast with ord=7 is pedagogically valuable.

For Review Agent

Verify:

  • [ ] No server-side state introduced
  • [ ] Graceful degradation without JavaScript
  • [ ] Negative winding numbers handled correctly
  • [ ] Info tooltip is accessible (keyboard, screen reader)
  • [ ] Existing footer structure and styling preserved
  • [ ] webring.json schema is extensible for future members

References

Changelog

Date Change
2026-02-07 Initial context-prompt from Claude conversation
2026-02-07 Confirmed winding number semantics (CPRR C1)
2026-02-07 Confirmed URL-encoded state approach (CPRR C2)
2026-02-07 Confirmed footer display format (CPRR C3)
2026-02-07 Added ord=1 degeneracy section (CPRR C5 confirmed)
2026-02-07 Fixed: cylinder not torus (π₁(S¹×ℝ) ≅ ℤ)
2026-02-07 Added visualization agent instructions
2026-02-07 Added squid metaphor: visitor actions next/prev/stay
2026-02-07 Added CPRR C6: fractional display hypothesis

Author: jwalsh

jwalsh@nexus

Last Updated: 2026-02-07 15:35:35

build: 2026-04-17 18:34 | sha: 792b203