GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — id(web): parseWorldSeed still silently reinterprets non-decimal forms — '0x10' installs seed 16, '1e3' seed 1000 (#707 residual) · Issue #832 · developing-today/code

id(web): parseWorldSeed still silently reinterprets non-decimal forms — '0x10' installs seed 16, '1e3' seed 1000 (#707 residual) #832

New issue
Copy link
New issue
Copy link
Closed
#833
Closed
id(web): parseWorldSeed still silently reinterprets non-decimal forms — '0x10' installs seed 16, '1e3' seed 1000 (#707 residual)#832
#833
Copy link
Assignees
dezren39
Labels
status:in-review

Description

@dezren39
dezren39
opened on Oct 25, 2026
Issue body actions

Problem

parseWorldSeed (pkgs/id/web/src/world-seed.ts:9-14) — the parser for the world install/compile seed field, used by both flows in pkgs/id/web/src/world.ts:343 and world.ts:465 — validates with Number() coercion:

const seed = Number(trimmed);
return Number.isSafeInteger(seed) && seed >= 0 ? seed : null;

Number() accepts every JavaScript numeric literal form, so text the admin typed is silently reinterpreted as a different seed than the digits shown:

input parsed seed
"0x10" 16
"0b101" 5
"0o17" 15
"1e3" 1000
"+5" 5

Verified this run with a node probe of the exact function body on main d95000a1.

Why it matters

  • This is the residual half of id(web): clearing the world seed field silently installs with seed 0 — empty input passes the Number() guard in both install and compile flows #707: that fix stopped an empty field silently becoming seed 0 because the seed must be "anything the admin did not actually choose" — the module docstring says exactly that. A hex/scientific string is the same class of silent reinterpretation: the field shows one thing, the world installs with another.
  • The seed is load-bearing: the install form states "The current world restarts at its module seed" (pkgs/id/src/web/templates.rs:804), so a mis-parsed seed silently produces different world state with no error anywhere.
  • The sibling numeric parser in the same UI is deliberately strict about surface forms: goto-line.ts documents why it avoids bare parseInt semantics. parseWorldSeed should hold the same line — a seed field is a decimal integer field (the input is type="number", templates.rs:796).

Acceptance criteria

  • parseWorldSeed accepts only an optional-whitespace-wrapped run of ASCII decimal digits (leading zeros OK) that fits a non-negative safe integer; "0x10", "0b101", "0o17", "1e3", "+5" all return null.
  • Existing behavior is unchanged for ""/whitespace (null), "0" (0), " 42 " (42), Number.MAX_SAFE_INTEGER, negatives, fractions, and unsafe integers.
  • world-seed.test.ts gains cases covering the rejected literal forms above.
  • The web vitest suite passes.

Activity

  1. developing-today commented on Oct 25, 2026

    @developing-today
    developing-todayBot
    on Oct 25, 2026 – with developing.today
    Contributor
    More actions

    CODE-125

  2. github-actions
    assigned
    dezren39
    on Oct 25, 2026
  3. developing-today
    added
    status:in-review
    on Oct 25, 2026
  4. dezren39
    closed this as completedin 30bc537on Oct 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @dezren39
    dezren39

Labels

status:in-review

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.