-
-
Notifications
You must be signed in to change notification settings - Fork 0
Development Guide
Eshan Roy edited this page Jun 16, 2026
·
2 revisions
- Go 1.25+
- Git
- golangci-lint (for linting)
- goreleaser (for releases, optional)
# Clone the repository
git clone https://github.com/eshanized/M31A.git
cd M31A
# Build optimized binary
make build
# Build debug binary (with symbols)
make debug
# Build and run immediately
make dev
# Install to $GOBIN
make installAll builds use CGO_ENABLED=0 for static binaries. Version info is injected via ldflags:
var (
Version = "dev" // git describe --tags
Commit = "..." // git rev-parse --short HEAD
Date = "..." // date -u
)# Run all tests with race detector and coverage
make test
# Run tests without race detector (faster)
make test-fast
# Run tests with verbose output
make test-verbose
# Run a specific test
make test-specific TEST=TestReplModel
# Run benchmarks
make bench
# Generate HTML coverage report
make cover| Package | Target |
|---|---|
| Overall | 75% |
pkg/taskrunner |
90% |
pkg/bisect |
90% |
pkg/rollback |
90% |
Tests follow Go conventions with _test.go files alongside source files. Additional test patterns:
-
*_extra_test.go-- Extended test coverage beyond the primary test file -
*_security_test.go-- Security-specific tests (SSRF, permissions, path traversal) -
*_integration_test.go-- Cross-package integration tests -
test_helpers_test.go-- Shared test utilities
# Run golangci-lint
make lint
# Run linter with auto-fix
make lint-fix
# Run go vet
make vet
# Format all Go files
make fmt
# Clean up go.mod
make tidy
# Run all checks (fmt + tidy + vet + test)
make checkSource: .golangci.yml
The project uses golangci-lint with a 5-minute timeout. Linting is run in CI on every push.
# Build for all supported platforms
make cross
# Build for a specific platform
make build-linux-amd64
make build-darwin-arm64
make build-windows-amd64Supported platforms:
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64, arm64)
Releases use GoReleaser:
# Snapshot release (local testing)
make release
# Dry run
make release-drySource: .goreleaser.yaml
Source: .github/workflows/ci.yml
CI runs on every push and pull request:
- Go setup with module caching
go vet ./...golangci-lint rungo test -race -cover ./...
Source: .github/dependabot.yml
Automated dependency updates for Go modules and GitHub Actions.
-
internal/packages are private (not importable by external projects) -
pkg/packages are public and importable - Each
pkg/package has adoc.gowith package-level documentation
-
*_unix.go/*_windows.go-- Platform-specific code using build tags -
*_test.go-- Standard Go tests -
*_extra_test.go-- Additional test coverage
import (
// Standard library
"context"
"fmt"
// Third-party
"github.com/charmbracelet/bubbletea"
// Internal packages
"github.com/eshanized/M31A/internal/config"
"github.com/eshanized/M31A/internal/types"
// Public packages
"github.com/eshanized/M31A/pkg/session"
)- Use sentinel errors from
internal/errors/for known failure modes - Wrap errors with context:
fmt.Errorf("save checkpoint: %w", err) - Use
UserMessage()for user-facing error display - Return
toolResultErrorfor soft tool errors, regular errors for hard failures
- Bubble Tea's single-threaded
Update()loop for TUI state -
sync.RWMutexfor provider registry and dispatcher -
sync.Oncefor lazy initialization (codeintel, tool definitions) -
atomic.Bool/atomic.Int64for lock-free counters and guards - Channel-based communication between workflow engine and TUI
See CONTRIBUTING.md for:
- Code style guidelines
- Architecture rules
- PR conventions
- Issue templates
Source: scripts/verify_v1.sh
The acceptance test suite validates the full V1 feature set:
- Build verification
- Tool execution
- Session persistence
- Provider fallback
- Workflow phases
# Show binary size
make size
# Show version info
make version
# Update dependencies
make deps
# Verify dependency checksums
make deps-verify
# Remove build artifacts
make clean
# Clean everything (including module cache)
make nuke