Skip to content

Piece 1: help and version in Go, default when parity passes #4218

Open

Description

@pithead-developer

What's the problem

Every CLI invocation parses a generated Bash script of about 21,300 lines (raw lines on develop 2604817, comments included). Help and version pay that for no work.

What it impacts

Every operator call of these verbs; this first piece also proves the per-piece switch and release flow.

How I found it

Benchmark track (frozen 662afe6, offline fixtures, two guests): wall ratio help warm about 0.08, version warm about 0.08, above the noise floor; fresh guest help warm 121.6 ms Bash vs 9.4 ms Go. Known gap: Go failed-write diagnostics differ from Bash. Justification is startup cost and parity, not a performance-critical finding.

How important is it

Medium: the only measured gain, smallest piece, lowest risk.

Acceptance criteria

  • The piece selector name defined by the switch issue selects Go for exactly help and version; every other argv falls back to Bash.
  • Existing Bash suites covering them pass unchanged in both modes; the failed-write diagnostic difference is fixed in Go, not by editing tests.
  • On the release candidate, Go median wall time is not above Bash median on the committed harness, A/A floor recorded.
  • Default flips to Go in the release where both hold; otherwise it stays opt-in and the table records the roll.

Possible solutions

Re-land go/internal/help and go/internal/cli with their tests from go-port/3811 behind the launcher; leave the dashboard and doctor packages out.

Activity

  1. added
    enhancement
    refactor
    size:S
    on Nov 17, 2026
  2. pithead-developer commented on Nov 25, 2026

    @pithead-developer
    ContributorAuthor

    Referenced by blocker: #4227 (retire go-port/3811 and benchmark branches after pieces land). #4227 blocks on all pieces 1-9 landing.

  3. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4220 (Go module landing, PR #4527).

    Every deliverable of this piece is Go code inside the go/ module: re-landing go/internal/cli and go/internal/help with their tests from go-port/3811 behind the launcher, fixing the failed-write diagnostic difference in Go, and the both-mode parity that the Shell workflow's every-piece leg runs once it builds go/bin/pithead. The module does not exist on develop-v2.1.0 yet — it lands once through #4220 (PR #4527 carries go/go.mod, the cmd/pithead handoff contract, and the workflow step that builds the binary beside the entry point). Piece issues must not create go/ themselves; they merge the base that carries it, so this piece cannot compile, test, or open its PR until #4527 merges.

    What is already in place, verified on current develop-v2.1.0 at 190234b:

    • The launcher side of this piece shipped with Per-piece PITHEAD_IMPL launcher and release-default table #4214: the piece selector name for this piece is help; the verb-to-piece map routes exactly help, -h, --help, version, -V, --version to it and every other argv falls through to Bash; the release-default table row exists with default bash; the fallback contract and the dual-mode suites are tested. This piece is purely additive on the Go side.
    • The parity evidence base exists (help warm ~0.08, version warm ~0.08 wall ratios, A/A floor recorded), and Measure per-verb CLI cost and timer-triggered verb frequency on the bench #4216 confirms it is "not a dependency of the help/version piece, whose evidence exists" — no harness dependency either. The one known gap to close in code is the failed-write diagnostic difference, fixed in Go, not by editing tests.
    • The flip decision stays with this piece as written: default flips to Go only when both acceptance criteria hold on the release candidate; otherwise the row stays opt-in and the table records the roll.

    Unblocks when: PR #4527 merges and #4220 closes; the runner resumes this session, and the Go side lands from the frozen go-port/3811 tree at f550f0e behind the already-shipped help selector.

  4. pithead-developer commented on Nov 27, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4220. Piece 1 is blocked on #4220 (its PR #4527 introduces the stdlib-only go/ module — go.mod, the cmd/pithead handoff contract, and the Shell-workflow build of go/bin/pithead). Nothing under go/ exists on develop-v2.1.0, and piece issues must not create the module themselves; every deliverable of this piece is Go code inside it (re-landing go/internal/cli and go/internal/help from go-port/3811 behind the launcher, the failed-write diagnostic fix in Go, and the both-mode parity the every-piece CI leg runs). Verified on current base 190234b that the launcher side already shipped with #4214 — the help piece selector, verb map (help/-h/--help/version/-V/--version, everything else falls back to Bash), the bash-default table row, fallback contract tests — and that #4216 explicitly excludes the harness from this piece's dependencies since help/version parity evidence exists; the one code gap to close is the failed-write diagnostic difference. Blocking explanation posted on #4218. Unblocks when PR #4527 merges and #4220 closes; the runner then resumes this session and the Go side lands from the frozen go-port/3811 tree at f550f0e.

    The runner resumes this issue when that one closes.

  5. added
    blocked
    on Nov 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedenhancementrefactorsize:S

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions