feat(yaad): production hardening#2
Merged
Merged
Conversation
…ad code removal - Strengthened golangci-lint config: errcheck, staticcheck, unused, gocritic, bodyclose, noctx - Fixed 135+ errcheck issues (Storage.Close, rows.Close, tx.Rollback, os.MkdirAll, resp.Body.Close) - Removed unused loadHNSWFromStore method - Added .editorconfig
….key
Re-baselines yaad's version to 0.2.0 across every authoritative location,
adds the top-50 OSS standard files that were missing, and fixes a small
security issue: `.yaad/integrity.key` was committed to git.
Version 0.2.0 set in:
- internal/server/mcp.go (MCP server advertised version)
- sdk/python/pyproject.toml
- sdk/typescript/package.json
- Formula/yaad.rb (formula version + every release-asset URL)
- openapi.yaml (header version + /yaad/health example value)
Aligns yaad with the rest of the hawk-eco ecosystem (hawk, tok, eyrie,
sight, inspect).
Security:
- Stop tracking `.yaad/integrity.key` — this is a per-installation
HMAC key for memory-integrity verification. Committing it meant
every clone shared the same key, defeating the purpose. The file
is now in .gitignore and yaad will regenerate it locally on first
run if missing. Existing local files are kept intact; only the
git-tracked copy is removed (`git rm --cached`).
- Expanded .gitignore to also exclude `.yaad/*.db`,
`.yaad/*.db-shm`, `.yaad/*.db-wal`, `coverage.html`, and the
.gocache/ / .gomodcache/ Go build caches.
Cleanup of staged-but-uncommitted hardening from the prior commit:
- internal/tls/tls.go: `defer cf.Close()` and `defer kf.Close()` →
`defer func() { _ = cf.Close() }()` style for errcheck.
- internal/server/mcp.go: gofmt import sorting (third-party imports
were not alphabetised by full path).
CHANGELOG.md gains an [Unreleased] section that captures the re-baseline,
the security fix, and the production-hardening pass already on this
branch (strict golangci v2 config, errcheck fixes across many packages,
dead-code removal).
New top-level OSS files:
- .gitattributes — LF normalization, binary detection, GitHub linguist
hints (mark sdk/python/** as Python, sdk/typescript/** as
TypeScript, openapi.yaml/ARCHITECTURE.md/PLAN.md/COMPARISON.md as
documentation so language stats reflect the Go core)
- CODE_OF_CONDUCT.md — Contributor Covenant 2.1
- .github/dependabot.yml — weekly gomod, pip (sdk/python), npm
(sdk/typescript), and github-actions updates; gomod grouped by
modernc and mark3labs/mcp-go to reduce PR noise
- .github/PULL_REQUEST_TEMPLATE.md — Summary / Changes / Memory-/
retrieval-quality impact / Schema-data-format impact / Testing /
Checklist (with explicit reminder to never re-add integrity.key)
- .github/ISSUE_TEMPLATE/bug_report.yml — structured bug report with
surface dropdown (CLI / MCP / REST / Go SDK / Python SDK /
TypeScript SDK / embedded library)
- .github/ISSUE_TEMPLATE/feature_request.yml — feature request with
a kind selector covering all 12 functional areas (recall, ingestion,
graph, decay/compaction, privacy, embeddings, storage, MCP, REST,
CLI/TUI, SDKs, tooling) and solo-dev fit checks
- .github/ISSUE_TEMPLATE/config.yml — routes security to advisories,
questions to discussions, blocks blank issues
Verification:
- `go build ./...` clean
- `go vet ./...` clean
- `go test -race -count=1 -timeout=180s -short ./...` passes on every
package (root yaad, dedup, embeddings, engine, exportimport, git,
graph, hooks, ingest, intent, internal/daemon, internal/proactive,
internal/search, internal/server, internal/temporal, mental,
privacy, skill, storage, temporal, utils, conflict, compact, browse,
config)
- `gofmt -l` clean for all files I touched
- 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.
8 new engine modules: - prospective: trigger-action pairs for proactive memory - zeigarnik: open loop detection, unfinished tasks resist decay - epistemic: active inference, agent questions its own knowledge gaps - temporal_validity: validFrom/validUntil on graph edges - reconsolidation: labile window after recall for memory updates - spacing: spaced repetition scoring for access patterns - somatic: emotional pre-filtering before expensive retrieval - curiosity: structured gap detection for exploration targets
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 yaad that brings the repo closer to top-50 OSS
repository standards. The branch contains two commits — a code-quality pass
and a re-baseline + OSS-hygiene + small-security-fix pass — both targeting
dev.The mandate (per
GOAL.md) is that yaad be the reference Go memory layerfor AI coding agents, comparable in quality to mem0 / MemGPT-Letta / Zep /
LangChain memory / kernel-memory, and built for solo developers who run
their coding agent locally.
Commits
feat(yaad): production hardening — strict linting, errcheck fixes, dead code removalfeat(yaad): re-baseline to v0.2.0 + OSS standards + untrack integrity.keyWhat's in commit 1 — code-quality pass
.golangci.yml— strict v2 config:errcheck,staticcheck,gocritic(diagnostic + performance),unused,ineffassign,misspell,noctx,bodyclose,unconvert,whitespace.(
engine/,storage/,ingest/,embeddings/,graph/,internal/...).unusedlinter.What's in commit 2 — version + OSS standards + small security fix
Version 0.2.0 across the repo
internal/server/mcp.gomcpserver.NewMCPServer("yaad", "0.2.0", ...)sdk/python/pyproject.tomlversion = "0.2.0"sdk/typescript/package.json"version": "0.2.0"Formula/yaad.rbversion "0.2.0"+ every release-asset URLopenapi.yamlversion: "0.2.0"+/yaad/healthexampleThe build-time injected
internal/version.Version(defaults to"dev"during local
go run, overridden via-ldflagsfor release builds) isunchanged — that's the right pattern; the hardcoded sites above are the
ones that matter for SBOM / homebrew / OpenAPI / SDK consumers.
Security: stop tracking
.yaad/integrity.key.yaad/integrity.keyis a 32-byte HMAC key used for memory-integrityverification. It was committed in
557662c("feat: major retrievaloverhaul"). Committing it meant every clone shared the same key, which
defeats the purpose of the integrity check (anyone with the repo could
forge integrity-verified entries).
This PR:
git rm --cached .yaad/integrity.key(thelocal copy on contributors' disks is not deleted; yaad will keep
using it).
.yaad/integrity.keyto.gitignoreso it cannot be re-addedaccidentally.
to re-add it.
The yaad runtime is expected to regenerate the key on first run if
missing — please verify on a fresh clone before merge.
CHANGELOG.md
## [Unreleased]describing the re-baseline, the security fix,and the full hardening pass (both commits together).
0.1.0and earlier release notes preserved.Cleanup of staged-but-uncommitted hardening from the prior commit
internal/tls/tls.go:defer cf.Close()/defer kf.Close()→defer func() { _ = cf.Close() }()style forerrcheck.internal/server/mcp.go: gofmt import sorting (third-party importswere not alphabetised by full path;
github.com/GrayCodeAI/...sortsbefore
github.com/mark3labs/...).New OSS standard files
.gitattributes*.db), GitHub linguist hints (marksdk/python/**as Python,sdk/typescript/**as TypeScript, large planning docs as documentation)CODE_OF_CONDUCT.md.github/dependabot.ymlgomod,pip(sdk/python),npm(sdk/typescript),github-actions; gomod grouped bymoderncandmark3labs/mcp-go.github/PULL_REQUEST_TEMPLATE.md.github/ISSUE_TEMPLATE/bug_report.yml.github/ISSUE_TEMPLATE/feature_request.ymlkindselector covering 12 functional areas (recall, ingestion, graph, decay/compaction, privacy, embeddings, storage, MCP, REST, CLI/TUI, SDKs, tooling).github/ISSUE_TEMPLATE/config.ymlExpanded
.gitignoreAlso covers
.yaad/*.db,.yaad/*.db-shm,.yaad/*.db-wal,coverage.html,.gocache/,.gomodcache/.Verification
go build ./...go vet ./...go test -race -count=1 -timeout=180s -short ./...dedup,embeddings,engine,exportimport,git,graph,hooks,ingest,intent,internal/daemon,internal/proactive,internal/search,internal/server,internal/temporal,mental,privacy,skill,storage,temporal,utils, rootyaad,conflict,compact,browse,configgofmt -lfor files I touchedTest plan
make buildmake testwith-racego vet ./...gofmt -lfor touched files is emptyyaad regenerates
.yaad/integrity.keyon first run, and existinginstallations continue to work with their existing key.