Skip to content

feat(shape): add valley pattern (high→low→high, inverse of pyramid)#847

Open
jonathaneoliver wants to merge 2 commits into
devfrom
feat/valley-pattern
Open

feat(shape): add valley pattern (high→low→high, inverse of pyramid)#847
jonathaneoliver wants to merge 2 commits into
devfrom
feat/valley-pattern

Conversation

@jonathaneoliver

Copy link
Copy Markdown
Owner

What

A new bandwidth-shaping pattern, valley — the inverse of pyramid. Starts at the top cap, dips to the floored trough, climbs back: high → low → high.

Why

pyramid starts low, so the player cold-starts by over-selecting a high rung it can't load under the cap → startup wedge (you have to add is.peak_bitrate_mbps to avoid it). valley starts high, so the player cold-starts at full bandwidth cleanly — no startup cap needed. The trough is the rate-limiting stress; the climb-back tests recovery. (Surfaced while trying to run a group rate-limit test and repeatedly hitting the documented cold-start over-selection wedge.)

Changes

  • go-proxy/pkg/ladder/pattern.goBuildPattern valley case: reversedFloat(asc) then asc[1:] (descend, then ascend dropping the trough dupe), sharing the pyramid over-selection floor so the trough stays sustainable. + a mirrored TestBuildPattern assertion (high→low→high, floored, symmetric, same length as pyramid).
  • Wiring: proxy TemplateMode gate (main.go), OpenAPI v2 enum (proxy.yaml), regenerated harness client (proxy.Valley) + dashboard types (v2.ts), harness --pattern valley (shape.go), Pattern field doc (experiment.go), dashboard pattern picker (NetworkShapingPattern.vue).
  • Docs: README.md, .claude/standards/server-behavior.md, .claude/skills/CONVENTIONS.md, and the test-author skill's mode→shape registry.

Verified

go-proxy + harness-cli build; TestBuildPattern passes. Generated files regenerated via make gen-harness-cli-client + npm run gen-types (not hand-edited).

Usage

proxy.shape: { pattern: valley, step_seconds: 12 }   # no startup cap needed

🤖 Generated with Claude Code

…amid

A bandwidth-shaping pattern that starts at the TOP cap, dips to the
floored trough, then climbs back. Because it starts high, the player
cold-starts at full bandwidth — no over-selection wedge — so it needs
NO startup cap (is.peak_bitrate_mbps), unlike pyramid which starts low.
The trough is the rate-limiting stress; the climb tests recovery.

- go-proxy/pkg/ladder/pattern.go: BuildPattern `valley` case (desc then
  asc, dropping the trough dupe, sharing the pyramid over-selection
  floor so the trough stays sustainable) + a mirrored unit test.
- go-proxy proxy gate, OpenAPI v2 enum, regenerated harness client
  (proxy.Valley) + dashboard types (v2.ts), harness `--pattern valley`
  (shape.go), the Pattern field doc, the dashboard pattern picker.
- Docs: README, server-behavior.md, CONVENTIONS.md, and the test-author
  skill's mode→shape registry.

Verified: go-proxy + harness-cli build; TestBuildPattern passes
(valley is high→low→high, floored, symmetric, same length as pyramid).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added the enhancement New feature or request label Jun 24, 2026
… api-docs

Three sites the first pass missed (caught by a plumb-everywhere audit +
the dashboard's TS type check on deploy):

- go-proxy/pkg/v2oapigen/oapigen.gen.go: regenerated so PatternTemplate
  + .Valid() include valley (the v2 server's own enum).
- NetworkShapingPattern.vue: TEMPLATE_LABELS needed a `valley` entry
  (the Record<Template,string> made it required once valley joined the
  TEMPLATES union) — '🏞 Valley'.
- content/dashboard/api-docs/proxy-v2.yaml: re-synced the spec copy.

Verified: go-proxy builds, dashboard `npm run build` passes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant