Skip to content

id(world): the plain id world join pump bypasses the shared line grammar for /input — unvalidated hex is sent to the server and dropped, a bare /input is posted as chat, and the two-space form is accepted here but rejected by the grammar #3134

Closed

Description

@dezren39

Problem

pkgs/id/src/world_line.rs declares itself the single parser for the world's line grammar — its module docs (lines 1–7) say the SSH command mode, the id world join stdin pump, and the id world CLI subcommands "all speak the same verbs", with parse_line mapping one line to one action "so a sentence works identically" on every surface. The command-mode pump honours that (pump_command, pkgs/id/src/commands/world.rs:1694 calls parse_line). The plain (non-command-mode) pump does not: at pkgs/id/src/commands/world.rs:1630–1633 it hand-rolls /input handling —

match line.strip_prefix("/input ") {
    Some(hex) => serde_json::json!({"type": "input", "data_hex": hex.trim()}),
    None => serde_json::json!({"type": "chat", "text": line}),
}

— with no hex validation, no lowercase normalisation, and no usage message. The same typed line therefore behaves differently depending on whether the user passed --command-mode:

Line typed Shared grammar (parse_line, command mode / SSH) Plain pump
/input ZZ local usage: /input <hex>, nothing sent frame sent; server replies error frame input data must be hexadecimal (world_session/mod.rs:2212–2219), input dropped
/input 0 (odd length) local usage: /input <hex>, nothing sent frame sent; same server error, input dropped
/input (bare) local usage: /input <hex>, nothing sent sent as chat text — the literal word /input is posted into the world
/input 00af (two spaces) local usage: /input <hex>, nothing sent accepted (hex.trim()), input delivered — the inverse divergence
/input 00AF normalised to 00af before sending sent as typed (00AF); the server happens to accept it

Verified this run with a verbatim-copy probe (parse_line copied byte-for-byte from main b878339e, diff-checked; the plain-pump arm and the server's decode_hex gate replicated): laptop ~/git/fleet/probe-2026-10-31-laneA-pump-input/probe.txt.

Why it matters

  • The plain pump is the scripted surface (id world join reading stdin lines from a pipe). A typo'd hex string silently becomes a dropped input plus a server error frame on stdout — the pump's own contract is that stdout stays a clean stream of frames and user-facing notes go to stderr (commands/world.rs pump docs) — instead of an immediate local usage message.
  • A bare /input (easy to type when a script emits a verb with an empty argument) is posted into the world as chat text.
  • The two surfaces disagree in both directions (the plain pump also accepts the two-space form the grammar rejects), so a script tested against one surface breaks on the other.

Distinct from existing issues

Acceptance criteria

  • The plain pump validates /input through the shared grammar's rules (even length, ASCII hex only) before sending: invalid hex and a bare /input produce the local usage: /input <hex> message on stderr and send nothing.
  • /input is never delivered to the world as chat text.
  • Valid hex is normalised the same way on both pump paths (lowercased), so the frame bytes do not depend on --command-mode.
  • The two-space behaviour matches the grammar's (whatever id(world): /document and /input reject two spaces after the command — sibling commands in the same grammar trim, these two do not #1946 decides there, both surfaces agree).
  • Tests cover the plain-pump mapping for: valid hex, uppercase hex, non-hex, odd-length hex, bare /input, and a non-/input chat line.

Activity

  1. added
    kind/bugSomething isn't working (prefixed form of the classic bug label)
    priority/lowNice to have; do when convenient
    source/creatorFiled by the new-issue-creator job
    task/triageQueue packet kind: verify, reproduce, and route this item
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    effort/sSmall: expected under 2 hours of work
    on Oct 31, 2026
  2. dezren39 commented on Oct 31, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · filed

    • Agent: new-issue-creator job (new-issue-creator-code-a)
    • Session / ID: new-issue-creator-code-a run 2026-10-31T16:12Z
    • Found via: filed this run
    • Task: Filed this issue — the plain (non-command-mode) id world join stdin pump hand-rolls /input at commands/world.rs:1630-1633 instead of using the shared world_line::parse_line grammar, so unvalidated hex is sent to the server and dropped with an error frame, a bare /input is posted as chat text, and the two-space form is accepted here but rejected by the grammar. Verified on main b878339 with a verbatim-copy laptop probe (parse_line diff-checked byte-for-byte; plain-pump arm and server decode_hex gate replicated). Enqueued as a triage packet in queue repo-health-code-pilot.
    • Expectation: effort/s — route the plain pump's /input through the shared grammar's validation so both pump paths agree; invalid/bare forms answer locally with usage and send nothing.
    • Links: evidence issue body (hidden_files/issue-code-world-pump-input-body.md); probe laptop ~/git/fleet/probe-2026-10-31-laneA-pump-input/probe.txt; distinct from id(world): /document and /input reject two spaces after the command — sibling commands in the same grammar trim, these two do not #1946 (parse_line-internal two-space handling)
  3. added
    work/assignedQueue worker lifecycle state
    queue/claimedQueue worker lifecycle state
    and removed on Nov 1, 2026
  4. 38 remaining items

  5. added
    queue/claimedQueue worker lifecycle state
    and removed
    status/triagedTriaged and routed (see agent note)
    on Nov 3, 2026
  6. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Agent note — picked up (PR shepherd)

  7. added 2 commits that reference this issue on Nov 3, 2026
  8. dezren39 commented on Nov 3, 2026

    @dezren39
    MemberAuthor

    Agent note — done (PR shepherded and merged)

  9. developing-today commented on Nov 3, 2026

    @developing-today
    Contributor

    agent-note:v1
    state: triaged (coverage pass)
    Coverage pass 2026-11-03: reviewed in the fleet-wide per-issue pass (drift / overlap / already-handled / stale / blockers / ordering). Verdict: still live; queued in repo-health-code-pilot as triage at priority 30 (priority/low). If this is already handled at current main, the triage closes it with evidence; if it needs splitting, the triage files the split.
    Found via: coverage pass 2026-11-03

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/sSmall: expected under 2 hours of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientqueue/queuedHas a queued queue tasksource/creatorFiled by the new-issue-creator jobstatus/needs-triageNot yet triaged; needs a first looktask/triageQueue packet kind: verify, reproduce, and route this item

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions