Skip to content

Commit fe3b78f

Browse files
authored
feat(trace): production hardening — re-baseline to v0.2.0 + OSS hygiene (#7)
* feat(trace): re-baseline to v0.2.0 + OSS hygiene (PR template, .gitattributes, .editorconfig) Re-baselines trace's version to 0.2.0 and adds the three top-50 OSS standard files that were missing. Version 0.2.0 set in: - cmd/trace/cli/versioninfo/versioninfo.go (`var Version = "0.2.0"`) Aligns trace with the rest of the hawk-eco ecosystem (hawk, tok, eyrie, yaad, sight, inspect). Build-time `-ldflags` overrides remain the way release builds pin to a specific version; this is the source-of-truth default for local `go run`. CHANGELOG.md gains an [Unreleased] section that captures the re-baseline and the three new files. The existing 0.1.0 entry is preserved. New files: - .gitattributes — LF normalization (matches WINDOWS.md guidance — Windows-only `*.bat`/`*.cmd`/`*.ps1` keep CRLF), binary detection, GitHub linguist hints (collapse `go.sum`, `.opencode/package-lock.json`, and `.opencode/bun.lock` in PR diffs; mark `docs/**`, `AGENTS.md`, `CLAUDE.md`, `WINDOWS.md` as documentation so language stats reflect Go). - .editorconfig — UTF-8, LF, final newline, trim trailing whitespace by default; tabs for Go and Makefile, 2-space indent for YAML/JSON/ TOML/shell, no-trim for Markdown (preserves the trailing-2-spaces line-break syntax). - .github/PULL_REQUEST_TEMPLATE.md — Summary / Changes / Privacy & redaction impact / Agent compatibility / Testing / Checklist. The privacy/redaction section is specific to trace because every change in `redact/` can leak PII or secrets if regressed; the agent- compatibility section asks contributors to call out which of the seven supported agents (Claude Code, Codex, Gemini CLI, OpenCode, Cursor, Factory AI Droid, Copilot CLI) they tested against. Verification: - `go build ./...` clean - `go vet ./...` clean - `go test -race -count=1 -timeout=300s ./perf/... ./redact/... ./cmd/...` passes — 48 packages green, zero failures - `gofmt -l cmd/trace/cli/versioninfo/versioninfo.go` clean Out of scope (intentional follow-ups): - 33 pre-existing `gofmt` issues in untouched files. A separate `style: gofmt -w .` PR will clean them so this PR stays focused on the version bump and OSS hygiene. - The repo's `.golangci.yaml` references the `embeddedstructfieldcheck` linter, which the currently-installed golangci-lint version does not recognize. Tracked as a separate `fix(ci): pin golangci-lint version or relax unknown-linter` PR. * chore: standardize eco-wide infra (versioning, CI, hooks, templates) - 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.
1 parent 40a4e1a commit fe3b78f

16 files changed

Lines changed: 920 additions & 319 deletions

.editorconfig

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# EditorConfig — https://editorconfig.org
2+
# Canonical eco-wide template (.shared-templates/editorconfig.tmpl).
3+
4+
root = true
5+
6+
# Default for everything.
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 4
14+
15+
# Go uses tabs by convention.
16+
[*.go]
17+
indent_style = tab
18+
indent_size = 4
19+
20+
# Python — PEP 8.
21+
[*.py]
22+
indent_size = 4
23+
24+
# TypeScript / JavaScript — 2 spaces, ecosystem default.
25+
[*.{ts,tsx,js,jsx,mjs,cjs}]
26+
indent_size = 2
27+
28+
# Web assets.
29+
[*.{html,css,scss}]
30+
indent_size = 2
31+
32+
# YAML — 2 spaces (ecosystem standard, GitHub Actions, k8s, etc.).
33+
[*.{yml,yaml}]
34+
indent_size = 2
35+
36+
# JSON / JSONC.
37+
[*.{json,jsonc}]
38+
indent_size = 2
39+
40+
# TOML.
41+
[*.toml]
42+
indent_size = 2
43+
44+
# Markdown — 2 spaces, preserve trailing whitespace (used for line breaks).
45+
[*.md]
46+
trim_trailing_whitespace = false
47+
indent_size = 2
48+
49+
# Shell scripts.
50+
[*.{sh,bash,zsh,fish}]
51+
indent_size = 4
52+
53+
# Makefiles must use tabs.
54+
[{Makefile,*.mk}]
55+
indent_style = tab
56+
57+
# Dockerfiles.
58+
[Dockerfile*]
59+
indent_size = 4
60+
61+
# GitHub Actions workflows — 2 spaces.
62+
[.github/**/*.{yml,yaml}]
63+
indent_size = 2
64+
65+
# Config files.
66+
[*.{cfg,ini,conf}]
67+
indent_size = 4

.gitattributes

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Canonical eco-wide .gitattributes template (.shared-templates/gitattributes.tmpl).
2+
# Auto-detect text files and normalise line endings to LF.
3+
4+
* text=auto eol=lf
5+
6+
# --- Source code -----------------------------------------------------------
7+
*.go text eol=lf diff=golang
8+
*.py text eol=lf diff=python
9+
*.ts text eol=lf
10+
*.tsx text eol=lf
11+
*.js text eol=lf
12+
*.jsx text eol=lf
13+
*.mjs text eol=lf
14+
*.cjs text eol=lf
15+
*.rs text eol=lf diff=rust
16+
17+
# --- Shell + config --------------------------------------------------------
18+
*.sh text eol=lf
19+
*.bash text eol=lf
20+
*.toml text eol=lf
21+
*.yaml text eol=lf
22+
*.yml text eol=lf
23+
*.json text eol=lf linguist-language=JSON
24+
*.jsonc text eol=lf linguist-language=JSON
25+
*.cff text eol=lf
26+
27+
# --- Documentation ---------------------------------------------------------
28+
*.md text eol=lf diff=markdown
29+
*.txt text eol=lf
30+
31+
# --- Build / packaging ----------------------------------------------------
32+
Makefile text eol=lf
33+
*.mk text eol=lf
34+
Dockerfile* text eol=lf
35+
docker-compose*.yml text eol=lf
36+
.github/**/*.yml text eol=lf
37+
.github/**/*.yaml text eol=lf
38+
39+
# --- Generated artefacts (mark as such for diffs and language stats) ------
40+
go.mod text eol=lf linguist-generated
41+
go.sum text eol=lf linguist-generated
42+
*.pb.go linguist-generated
43+
*_generated.go linguist-generated
44+
package-lock.json linguist-generated
45+
pnpm-lock.yaml linguist-generated
46+
yarn.lock linguist-generated
47+
48+
# --- Vendored / external sources ------------------------------------------
49+
vendor/** linguist-vendored
50+
node_modules/** linguist-vendored
51+
testdata/** linguist-vendored
52+
benchmarks/data/** linguist-vendored
53+
54+
# --- Binary files (do not text-normalise) ---------------------------------
55+
*.exe binary
56+
*.dll binary
57+
*.so binary
58+
*.dylib binary
59+
*.a binary
60+
*.o binary
61+
*.db binary
62+
*.sqlite binary
63+
*.png binary
64+
*.jpg binary
65+
*.jpeg binary
66+
*.gif binary
67+
*.ico binary
68+
*.svg text eol=lf
69+
*.pdf binary
70+
*.zip binary
71+
*.tar.gz binary
72+
*.tgz binary
73+
*.whl binary
74+
75+
# --- Source archive hygiene (excluded from `git archive`) -----------------
76+
.github export-ignore
77+
.shared-templates export-ignore
78+
.gitattributes export-ignore
79+
.gitignore export-ignore
80+
.editorconfig export-ignore
81+
.golangci.yml export-ignore
82+
.goreleaser.yml export-ignore
83+
.goreleaser.yaml export-ignore
84+
testdata/ export-ignore
85+
benchmarks/ export-ignore
86+
e2e/ export-ignore

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
<!--
2+
Thanks for your contribution! Please fill out this template so reviewers can
3+
understand the change quickly. Anything that does not apply can be left in
4+
place; do not delete unanswered sections — write "n/a".
5+
-->
6+
7+
## Summary
8+
9+
<!--
10+
One paragraph describing what this PR does and why. Link the related
11+
issue(s) with `Fixes #N` or `Refs #N` if applicable.
12+
-->
13+
14+
## Changes
15+
16+
<!--
17+
Bullet list of what changed, grouped by area (cmd/trace, perf, redact,
18+
e2e, docs, CI). Reviewers should be able to skim this and know what to
19+
look at first.
20+
-->
21+
22+
-
23+
24+
## Privacy & redaction impact
25+
26+
<!--
27+
Trace records developer sessions. Any change that touches `redact/`,
28+
`cmd/trace/cli/checkpoint/`, or transcript serialization can leak PII,
29+
secrets, or proprietary code if regressed.
30+
31+
- Did you change `redact/redact.go`, `redact/pii.go`, the secret-pattern
32+
list, or any code that decides what gets persisted?
33+
- If yes: paste before/after `go test -count=1 ./redact/...` results
34+
and explicitly call out which redaction patterns were added, removed,
35+
or relaxed.
36+
- If no: write "n/a".
37+
-->
38+
39+
## Agent compatibility
40+
41+
<!--
42+
trace integrates with Claude Code, Codex, Gemini CLI, OpenCode, Cursor,
43+
Factory AI Droid, Copilot CLI, etc. Did you change any agent-specific
44+
parsing or transcript shape?
45+
46+
- Which agents did you test against? (`scripts/test-*-agent-integration.sh`,
47+
`e2e/agents/`, or manual.)
48+
- Note any agent that you could not test locally and why.
49+
-->
50+
51+
## Testing
52+
53+
<!--
54+
Describe how you tested. Paste output of `mise run test` (or `go test
55+
-race -count=1 ./...`) and the lint task. If you added new tests,
56+
list them.
57+
-->
58+
59+
```text
60+
$ go test -race -count=1 ./...
61+
...
62+
$ golangci-lint run ./...
63+
...
64+
```
65+
66+
## Checklist
67+
68+
- [ ] Commits follow [Conventional Commits](https://www.conventionalcommits.org/)
69+
(`feat:`, `fix:`, `perf:`, `refactor:`, `docs:`, `test:`, etc.)
70+
- [ ] `go build ./...` passes
71+
- [ ] `golangci-lint run ./...` passes (no new lint findings, no
72+
`nolint:…` without justification)
73+
- [ ] `go test -race -count=1 ./...` passes locally
74+
- [ ] e2e impact considered (relevant `e2e/` test added, updated, or
75+
verified) — n/a if change is contained to non-runtime code
76+
- [ ] Public APIs in `cmd/trace/cli/...` have godoc comments
77+
- [ ] `CHANGELOG.md` updated under `## [Unreleased]` if user-visible
78+
- [ ] No regression in `redact/` tests
79+
- [ ] No secrets, tokens, or PII added to the repo (test fixtures use
80+
synthetic values only)
81+
- [ ] No `Co-authored-by:` trailers (this is solo-developer work)

0 commit comments

Comments
 (0)