Skip to content

Add Go M0 validation scripts#46

Merged
Vasanthdev2004 merged 3 commits into
mainfrom
feat/go-m0-ci-scripts
Jun 4, 2026
Merged

Add Go M0 validation scripts#46
Vasanthdev2004 merged 3 commits into
mainfrom
feat/go-m0-ci-scripts

Conversation

@anandh8x

@anandh8x anandh8x commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add stable package scripts for Go test, build, and artifact smoke validation
  • wire CI Go steps through those package scripts and add a Go smoke step
  • document the npm wrapper smoke checklist and pin the contracts with focused tests

Testing

  • bun test tests/foundation-tools.test.ts --timeout 15000
  • bun run test:go
  • bun run build:go
  • bun run smoke:go
  • bun run typecheck

Notes

  • Local latest-main full bun run test had 5 pre-existing failures in headless-exec/MCP before this branch; this PR does not touch those areas.

Summary by CodeRabbit

  • Documentation

    • Clarified project direction to a Go-native core with an npm wrapper, updated quickstart/prereqs and architecture diagrams, and added an npm-wrapper smoke checklist.
  • Chores

    • CI now invokes Go test/build/smoke via repository scripts; added scripts to run Go tests, build the Go entrypoint, and perform Go smoke checks; added a Go build smoke-test utility.
  • Tests

    • Extended test suite to validate repo scripts, CI steps, and smoke-check documentation.

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Zero automated PR review

Verdict: No blockers found

Blockers

  • None found.

Validation

  • [pass] Diff hygiene: git diff --check
  • [pass] Typecheck: bun run typecheck
  • [pass] Tests: bun run test
  • [pass] Build: bun run build
  • [pass] Smoke build: bun run smoke:build

Scope

Head: a2c3bb90bafd
Changed files (6): .github/workflows/ci.yml, README.md, docs/NPM_WRAPPER_SMOKE.md, package.json, scripts/smoke-go.ts, tests/foundation-tools.test.ts

This deterministic review checks validation status and basic diff hygiene. A human reviewer still owns product judgment and design quality.

@coderabbitai

coderabbitai Bot commented Jun 4, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3467d8fe-94ab-46ad-a0e8-63a351c663d8

📥 Commits

Reviewing files that changed from the base of the PR and between 364d33a and a2c3bb9.

📒 Files selected for processing (1)
  • README.md
✅ Files skipped from review due to trivial changes (1)
  • README.md

Walkthrough

This PR adds npm scripts to run Go tests/build/smoke via Bun, implements a TypeScript smoke test that validates the built Go CLI's exit code and version output, updates CI and README to use the Bun-run Go commands and document the Go layout, and extends foundation tests to verify the wiring.

Changes

Go workflow scripting and smoke test infrastructure

Layer / File(s) Summary
Go npm scripts wiring
package.json
Three scripts added: test:go runs go test ./..., build:go compiles cmd/zero, and smoke:go invokes the smoke-test TypeScript script.
Go smoke test implementation
scripts/smoke-go.ts
Smoke test spawns the compiled Go binary with --version, validates exit code, parses package.json for version, compares zero <version> to stdout, and emits detailed failure or success messages.
CI workflow and developer documentation
.github/workflows/ci.yml, README.md, docs/NPM_WRAPPER_SMOKE.md
CI smoke job switched to bun run Go commands; README documents cmd/zero and internal/cli, development commands, and links to the smoke checklist; new NPM_WRAPPER_SMOKE.md defines required Bun steps and conditional Go checks plus wrapper/package assertions.
Foundation test coverage
tests/foundation-tools.test.ts
Adds assertions verifying new Go npm scripts exist, CI smoke job includes bun run Go commands, and the smoke checklist document references Bun and Go smoke steps.

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant Bun
  participant SmokeScript as scripts/smoke-go.ts
  participant GoBinary as cmd/zero

  GitHubActions->>Bun: bun run build:go
  Bun->>GoBinary: go build ./cmd/zero (produce binary)
  GitHubActions->>Bun: bun run smoke:go
  Bun->>SmokeScript: invoke scripts/smoke-go.ts
  SmokeScript->>GoBinary: ./cmd/zero --version
  GoBinary-->>SmokeScript: stdout "zero <version>" / exit code
  SmokeScript->>SmokeScript: read package.json version and compare
  SmokeScript-->>Bun: exit success/failure
  Bun-->>GitHubActions: return job status
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • gnanam1990
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Go M0 validation scripts' accurately describes the main change: introducing Go-related validation scripts (test, build, smoke) alongside CI wiring and supporting documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/go-m0-ci-scripts

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/smoke-go.ts`:
- Around line 30-36: After parsing packageText into JSON, validate that the
extracted version field is a string before assigning to expectedVersion: check
that parsedPackage?.version is of type string (e.g., typeof
parsedPackage.version === "string"); if not, log a clear error like "Invalid
package.json: version is not a string" (include the actual value for debugging)
and call process.exit(1). Update the try block that currently assigns
expectedVersion = JSON.parse(packageText).version to first parse into a variable
(e.g., parsedPackage), perform the string type check, and only set
expectedVersion when the check passes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 73f9de4f-422f-44ab-a788-742b737f01b6

📥 Commits

Reviewing files that changed from the base of the PR and between 711a5f9 and 2978110.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • README.md
  • docs/NPM_WRAPPER_SMOKE.md
  • package.json
  • scripts/smoke-go.ts
  • tests/foundation-tools.test.ts

Comment thread scripts/smoke-go.ts
@Vasanthdev2004

Copy link
Copy Markdown
Collaborator

Blockers

  • README is still internally inconsistent with the new Go-native plan while this PR is adding Go M0 validation docs to that same README. The added test:go / build:go / smoke:go section is useful, but the top of the public README still says runtime Bun, TypeScript strict, TUI-Ink, and “One TypeScript codebase powers…” the product. After Update PRD for Go-native Zero direction #44, docs/PRD.md and docs/WORK_SPLIT_PRD.md make Go-native core + Bubble Tea/Lip Gloss + npm wrapper the source of truth, so a README-touching Go migration PR should not leave the public quick-start/architecture copy pointing contributors back at the old TS/Bun/Ink product architecture. Please update the README wording/badges to mark TS/Bun as transitional/reference or scope the README change so it does not present the old architecture as current.

Non-Blocking

  • The validation-script wiring itself looks good: CI now calls stable package scripts for go test ./..., go build ./cmd/zero, and the new Go smoke check before the legacy TS/Bun build/test path.
  • The local review host does not have go installed, so bun run test:go fails locally with bun: command not found: go; I verified the actual Go steps through GitHub CI instead. CI shows Go test/build/smoke passing on ubuntu, macos, and windows.
  • scripts/smoke-go.ts checks the platform-specific artifact name and validates zero --version against package.json, which is the right contract for this M0 entrypoint smoke.

Looks Good

  • docs/NPM_WRAPPER_SMOKE.md gives a concrete wrapper checklist and includes when to run the Go checks.
  • Targeted package-script tests now assert the Go scripts, CI wiring, and npm wrapper smoke doc exist.
  • Validation I ran:
    • bun install --frozen-lockfile PASS
    • bun run typecheck PASS
    • bun test tests/foundation-tools.test.ts --timeout 15000 PASS, 9 pass / 0 fail
    • bun test ./tests --timeout 15000 PASS, 279 pass / 0 fail
    • bun run build PASS
    • bun run smoke:build PASS
    • bun run perf:smoke PASS, no warnings
    • git diff --check PASS
    • GitHub CI for PR head 364d33a: Go test/build/smoke PASS on ubuntu/macos/windows, plus TS/Bun test/typecheck/build/smoke PASS.

@Vasanthdev2004 Vasanthdev2004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes because the PR touches README for Go M0 validation but leaves the public README presenting the old Bun/TypeScript/Ink architecture as current, conflicting with the new Go-native PRD. Full validation details are in my review comment.

@anandh8x
anandh8x requested a review from Vasanthdev2004 June 4, 2026 07:57
@Vasanthdev2004

Copy link
Copy Markdown
Collaborator

Blockers
None.

Non-Blocking

  • Local review host still does not have go installed, so bun run test:go fails locally with bun: command not found: go. I verified the Go-specific validation through GitHub CI instead: Go test/build/smoke all pass on ubuntu, macos, and windows for head a2c3bb9.
  • The README now correctly frames the TypeScript/Bun implementation and Ink surface as transitional during the Go migration, while pointing the production target at Go-native core + Bubble Tea/Lip Gloss + npm wrapper. That resolves my earlier docs blocker.
  • package.json still has bin.zero pointing at src/index.ts; that is acceptable for this PR because the README/checklist now describes it as the current transitional npm wrapper rather than the final Go wrapper.

Looks Good

  • The Go M0 validation scripts are wired consistently: test:go, build:go, and smoke:go are in package.json, CI calls them before the TS/Bun validation path, and scripts/smoke-go.ts verifies the platform-specific Go artifact version against package.json.
  • docs/NPM_WRAPPER_SMOKE.md gives a clear checklist for wrapper/package changes and conditionally includes the Go smoke path when Go entrypoint/artifact behavior changes.
  • Validation I ran:
    • bun install --frozen-lockfile PASS
    • bun run typecheck PASS
    • bun test tests/foundation-tools.test.ts --timeout 15000 PASS, 9 pass / 0 fail
    • bun test ./tests --timeout 15000 PASS, 279 pass / 0 fail
    • bun run build PASS
    • bun run smoke:build PASS
    • bun run perf:smoke PASS, no warnings
    • git diff --check PASS
    • GitHub CI for head a2c3bb9: Go test/build/smoke PASS on ubuntu/macos/windows, plus TS/Bun test/typecheck/build/smoke PASS.

@Vasanthdev2004 Vasanthdev2004 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved current head a2c3bb9 after verifying the README now aligns with the Go-native migration and validation/CI are passing.

@Vasanthdev2004
Vasanthdev2004 merged commit 375184d into main Jun 4, 2026
6 checks passed
@Vasanthdev2004
Vasanthdev2004 deleted the feat/go-m0-ci-scripts branch June 28, 2026 08:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants