Skip to content

feat(hawk-sdk-go): production hardening#1

Merged
Patel230 merged 3 commits into
mainfrom
feat/hawk-sdk-go-production-hardening
May 16, 2026
Merged

feat(hawk-sdk-go): production hardening#1
Patel230 merged 3 commits into
mainfrom
feat/hawk-sdk-go-production-hardening

Conversation

@Patel230
Copy link
Copy Markdown
Contributor

@Patel230 Patel230 commented May 14, 2026

Summary

Production-hardening pass for hawk-sdk-go that brings the repo to top-50
OSS repository standards. The branch contains two commits — a code-quality
pass and a re-baseline + full-OSS-bootstrap pass — both targeting main
(this repo does not have a dev branch).

This SDK had no README, LICENSE, CHANGELOG, CONTRIBUTING, SECURITY,
CODE_OF_CONDUCT, .gitignore, .gitattributes, or .github/ directory at all

— it was a brand-new module without any of the standard OSS scaffolding.
This PR lands the full bootstrap and aligns the SDK version with the rest of
the hawk-eco ecosystem (hawk, tok, eyrie, yaad, trace, sight,
inspect).

The mandate (per GOAL.md) is that this SDK be the reference Go SDK for
hawk daemon clients
, comparable in quality to openai-go,
anthropic-sdk-go, langchaingo, sashabaranov/go-openai.

Commits

  1. feat(hawk-sdk-go): production hardening — linter, errcheck, infrastructure
  2. feat(hawk-sdk-go): re-baseline to v0.2.0, add Version + User-Agent, full OSS bootstrap

What's in commit 1 — code-quality pass

  • .golangci.yml — strict v2 config: errcheck, staticcheck,
    gocritic (diagnostic + performance), unused, ineffassign,
    misspell, noctx, bodyclose, unconvert, whitespace.
  • All errcheck issues fixed — every resp.Body.Close() is
    deferred-and-discarded explicitly.
  • Makefile with standard targets.
  • .editorconfig.

What's in commit 2 — version + User-Agent + full OSS bootstrap

Version 0.2.0 — new surface

File Change
version.go (NEW) const Version = "0.2.0" + userAgent() helper
client.go every outbound HTTP request now sets User-Agent: hawk-sdk-go/0.2.0 (8 sites: Health, Chat, ChatStream, Sessions, Session, Messages, DeleteSession, Stats)
client_test.go daemon-version mock fixture 0.3.00.2.0 (cosmetic — the test does not assert on this value)

The User-Agent pattern matches eyrie's client/client.go so a single
ecosystem-wide convention applies.

New OSS bootstrap (every one of these was missing)

File Purpose
LICENSE MIT
README.md install, usage (Health / Chat / ChatStream / custom base URL / typed errors), full API surface, versioning, semver guarantees
CHANGELOG.md Keep-a-Changelog format with [Unreleased] for this PR + a backfilled [0.0.1] entry for the two prior commits
CONTRIBUTING.md quick start, branch flow (this repo branches from main), conventional commits, code standards (incl. the User-Agent rule), testing, version-bump procedure
SECURITY.md vulnerability reporting via GitHub Security Advisories, in-scope examples (token leakage, TLS misuse, redirect host escape), out-of-scope pointers (daemon issues → hawk repo)
CODE_OF_CONDUCT.md Contributor Covenant 2.1
.gitignore Go test artifacts, IDE, OS, build caches, go.work
.gitattributes LF normalization, binary detection, linguist hint to collapse go.sum
.github/workflows/ci.yml race tests + coverage upload, golangci-lint v2, govulncheck, multi-platform build matrix (linux/darwin/windows × amd64/arm64)
.github/dependabot.yml weekly gomod + github-actions
.github/PULL_REQUEST_TEMPLATE.md Summary / Changes / API impact (with version-bump reminder) / Daemon compatibility (asks which daemon SHA was tested against) / Testing / Checklist
.github/ISSUE_TEMPLATE/bug_report.yml surface dropdown (Client / ChatStream / Retry / Errors / Agent-Tool-Workflow / Build), required SDK + daemon + Go versions
.github/ISSUE_TEMPLATE/feature_request.yml kind selector + solo-dev fit checks incl. "does not break wire-compatibility with existing daemon versions"
.github/ISSUE_TEMPLATE/config.yml routes security to advisories, questions to discussions, blocks blank issues

Cleanup

  • gofmt -w on client.go and retry.go to remove trailing-blank-line
    drift from commit 1.

Verification

Check Status
go build ./... ✅ clean
go vet ./... ✅ clean
go test -race -count=1 -timeout=60s ./... ✅ pass
gofmt -l . ✅ empty (whole module is gofmt-clean)

Test plan

  • make build
  • make test with -race
  • go vet ./...
  • gofmt -l . empty
  • CI on this PR will run lint, security scan (govulncheck),
    tests, and the multi-platform build matrix

Patel230 added 3 commits May 14, 2026 21:20
…cture

- Added golangci-lint config (errcheck, staticcheck, unused, gocritic, bodyclose, noctx)
- Fixed all errcheck issues (resp.Body.Close in defer and error paths)
- Added Makefile with standard targets
- Added .editorconfig
…ull OSS bootstrap

This SDK had no README, LICENSE, CHANGELOG, CONTRIBUTING, SECURITY,
CODE_OF_CONDUCT, .gitignore, .gitattributes, or .github/ directory at
all. This commit lands the full top-50 OSS bootstrap and aligns the
SDK with the rest of the hawk-eco ecosystem (hawk, tok, eyrie, yaad,
trace, sight, inspect).

Version surface (new):
  - version.go — `const Version = "0.2.0"` and `userAgent()` helper.
  - client.go — every outbound HTTP request now sets
    `User-Agent: hawk-sdk-go/0.2.0` (Health, Chat, ChatStream,
    Sessions, Session, Messages, DeleteSession, Stats). Lets daemon
    operators identify SDK clients in logs and reject misbehaving
    versions cleanly. Pattern matches eyrie's userAgent().
  - client_test.go — daemon-version mock fixture updated 0.3.0 → 0.2.0
    for ecosystem consistency. The test does not assert on this value;
    the change is cosmetic.

New OSS files (all of these were missing):
  - LICENSE — MIT.
  - README.md — install, usage (Health / Chat / ChatStream / custom
    base URL / typed errors), full API surface, versioning, semver
    guarantees, contributing pointer.
  - CHANGELOG.md — Keep-a-Changelog format with [Unreleased] capturing
    this PR + a backfilled [0.0.1] entry for the prior two commits
    (initial SDK + hardening).
  - CONTRIBUTING.md — quick start, branch flow (this repo branches
    from main, not dev), conventional commits, code standards
    (User-Agent rule, error-wrapping, table-driven tests), testing,
    SDK-version-bump procedure.
  - SECURITY.md — vulnerability reporting via GitHub Security
    Advisories, in-scope examples (token leakage, TLS misuse, header
    smuggling, panic on attacker input, redirect host escape),
    out-of-scope pointers (daemon issues to hawk repo, dep issues
    upstream).
  - CODE_OF_CONDUCT.md — Contributor Covenant 2.1.
  - .gitignore — Go test artifacts, IDE, OS, build caches, go.work.
  - .gitattributes — LF normalization, binary detection, GitHub
    linguist hint to collapse go.sum.
  - .github/workflows/ci.yml — race tests + coverage upload, golangci-
    lint v2 action, govulncheck, multi-platform build matrix
    (linux/darwin/windows × amd64/arm64).
  - .github/dependabot.yml — weekly gomod + github-actions updates.
  - .github/PULL_REQUEST_TEMPLATE.md — Summary / Changes / API impact
    (with version-bump reminder) / Daemon compatibility (which daemon
    SHA was tested) / Testing / Checklist (incl. 'every new outbound
    request sets User-Agent via userAgent()').
  - .github/ISSUE_TEMPLATE/bug_report.yml — surface dropdown
    (Client / ChatStream / Retry / Errors / Agent-Tool-Workflow /
    Build-module), required SDK + daemon + Go versions.
  - .github/ISSUE_TEMPLATE/feature_request.yml — kind selector
    (new Client method / streaming / retry / typed errors / agent
    orchestration / config / tooling) + solo-dev fit checks (incl.
    'does not break wire-compatibility with existing daemon
    versions').
  - .github/ISSUE_TEMPLATE/config.yml — routes security to
    advisories, questions to discussions, blocks blank issues.

Cleanup:
  - gofmt -w on client.go and retry.go to remove trailing-blank-line
    drift from the prior hardening commit.

Verification:
  - `go build ./...` clean
  - `go vet ./...` clean
  - `go test -race -count=1 -timeout=60s ./...` passes
  - `gofmt -l .` empty (whole module is gofmt-clean)
- VERSION file as single source of truth
- CODEOWNERS for auto-review routing
- Canonical Makefile with standard targets
- release-please config + workflow
- lefthook/pre-commit hooks (conventional commits, fmt, lint, secrets)
- Canonical CI + release GitHub Actions workflows
- Standardized .editorconfig, .gitattributes, CODE_OF_CONDUCT, SECURITY, CONTRIBUTING
- goreleaser config (where applicable)

Part of hawk-eco standardization sweep.
@Patel230 Patel230 merged commit 5d3845c into main May 16, 2026
2 of 5 checks passed
@Patel230 Patel230 deleted the feat/hawk-sdk-go-production-hardening branch May 16, 2026 00:54
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.

1 participant