feat(hawk-sdk-go): production hardening#1
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Production-hardening pass for
hawk-sdk-gothat brings the repo to top-50OSS 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
devbranch).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 forhawk daemon clients, comparable in quality to
openai-go,anthropic-sdk-go,langchaingo,sashabaranov/go-openai.Commits
feat(hawk-sdk-go): production hardening — linter, errcheck, infrastructurefeat(hawk-sdk-go): re-baseline to v0.2.0, add Version + User-Agent, full OSS bootstrapWhat's in commit 1 — code-quality pass
.golangci.yml— strict v2 config:errcheck,staticcheck,gocritic(diagnostic + performance),unused,ineffassign,misspell,noctx,bodyclose,unconvert,whitespace.errcheckissues fixed — everyresp.Body.Close()isdeferred-and-discarded explicitly.
Makefilewith standard targets..editorconfig.What's in commit 2 — version + User-Agent + full OSS bootstrap
Version 0.2.0 — new surface
version.go(NEW)const Version = "0.2.0"+userAgent()helperclient.goUser-Agent: hawk-sdk-go/0.2.0(8 sites:Health,Chat,ChatStream,Sessions,Session,Messages,DeleteSession,Stats)client_test.go0.3.0→0.2.0(cosmetic — the test does not assert on this value)The
User-Agentpattern matcheseyrie'sclient/client.goso a singleecosystem-wide convention applies.
New OSS bootstrap (every one of these was missing)
LICENSEREADME.mdCHANGELOG.md[Unreleased]for this PR + a backfilled[0.0.1]entry for the two prior commitsCONTRIBUTING.mdmain), conventional commits, code standards (incl. the User-Agent rule), testing, version-bump procedureSECURITY.mdCODE_OF_CONDUCT.md.gitignorego.work.gitattributesgo.sum.github/workflows/ci.yml.github/dependabot.ymlgomod+github-actions.github/PULL_REQUEST_TEMPLATE.md.github/ISSUE_TEMPLATE/bug_report.yml.github/ISSUE_TEMPLATE/feature_request.ymlkindselector + solo-dev fit checks incl. "does not break wire-compatibility with existing daemon versions".github/ISSUE_TEMPLATE/config.ymlCleanup
gofmt -wonclient.goandretry.goto remove trailing-blank-linedrift from commit 1.
Verification
go build ./...go vet ./...go test -race -count=1 -timeout=60s ./...gofmt -l .Test plan
make buildmake testwith-racego vet ./...gofmt -l .emptygovulncheck),tests, and the multi-platform build matrix