Skip to content

fix: resolve all pre-existing compliance violations#26

Merged
josealekhine merged 1 commit intoActiveMemory:mainfrom
bilersan:fix/compliance-violations
Mar 6, 2026
Merged

fix: resolve all pre-existing compliance violations#26
josealekhine merged 1 commit intoActiveMemory:mainfrom
bilersan:fix/compliance-violations

Conversation

@bilersan
Copy link
Contributor

@bilersan bilersan commented Mar 5, 2026

Fixes #25

Summary

Fix all 5 categories of pre-existing compliance violations caught by internal/compliance/compliance_test.go. Total: 46 files changed across the codebase.

Changes

1. SPDX License Headers (11 files)

  • Fixed truncated Apache-2.Apache-2.0 in 6 config files
  • Added missing headers to 5 files (drift/types, cli/task/path, validation/path, validation/path_test, validation/validate)

2. Missing doc.go Files (11 packages)

  • Created doc.go for: bootstrap, cli/decision, cli/task, context, crypto, drift, index, rc, recall/parser, task, tpl

3. Literal "\n"config.NewlineLF (9 files)

  • initialize/{claude,fs,makefile,plan,prompt,run}.go
  • pad/store.go, recall/run.go, system/check_persistence.go

4. Literal ".md"config.ExtMarkdown (4 files)

  • load/convert.go, recall/run.go, system/check_journal.go, system/check_persistence.go

5. cmd.Printf/cmd.PrintErrfcmd.Println/cmd.PrintErrln (20 files)

  • add/run.go, initialize/.go, pad/.go, permissions/run.go, recall/run.go, watch/{run,stream}.go

Verification

  • Build compiles cleanly (go build ./cmd/ctx)
  • go vet ./... passes
  • All 5 compliance tests pass:
    • ✅ TestLicenseHeader
    • ✅ TestDocGoExists
    • ✅ TestNoLiteralNewline
    • ✅ TestNoLiteralMdExtension
    • ✅ TestNoCmdPrintf

@bilersan bilersan requested a review from josealekhine as a code owner March 5, 2026 11:20
@bilersan bilersan force-pushed the fix/compliance-violations branch from bf92fef to daf908e Compare March 5, 2026 12:05
- Add compliance test suite (internal/compliance/compliance_test.go)
  20 tests covering SPDX headers, doc.go presence, literal strings,
  cmd.Printf usage, gofmt, go vet, golangci-lint, and more.

- Fix SPDX license headers (11 files)
  Truncated 'Apache-2.' → 'Apache-2.0' and add missing headers.

- Add doc.go files (19 packages)
  assets, bootstrap, cli/{decision,doctor,notify,pause,remind,resume,task},
  context, crypto, drift, eventlog, index, journal/state, notify, rc,
  recall/parser, task.

- Replace literal strings with config constants
  '\n' → config.NewlineLF (31 files)
  '.md' → config.ExtMarkdown (13 files)

- Replace cmd.Printf/PrintErrf with Println/Print + fmt.Sprintf (45 files)
  Preserves original newline behavior: Printf with trailing \\n uses
  Println, Printf without \\n uses Print.

- Fix golangci-lint staticcheck S1025 (validate.go)

- Update TestRequiredContextFilesInTemplate path to match current
  internal/assets/context/ structure.

All 20 compliance tests pass. No new test regressions introduced.

Closes ActiveMemory#25

Signed-off-by: ersan bilik <ersanbilik@gmail.com>
@bilersan bilersan force-pushed the fix/compliance-violations branch from daf908e to 39126cc Compare March 5, 2026 12:18
@josealekhine
Copy link
Member

Further changes might be done BUT

  1. This definitely leaves the code in a better shape than it was before.
  2. Does not break anything functional as far as I can see.

LGTM 🌮

I can use Daniel (my agent) to do a deeper sweep afterall :).

Thanks for your contribution @bilersan 🙏 .

@josealekhine josealekhine merged commit 38b1ad3 into ActiveMemory:main Mar 6, 2026
3 checks passed
@josealekhine
Copy link
Member

For context here were my initial findings:

  • Printf → Println: ~30 double-newline bugs
  • Import grouping: Needs cleanup
  • Compliance tests: Useful but overly broad regex: likely false positives on future code

All of them can be fixed by an agent sweep.

Even better, all of them can be asked for an agent to "write a linter" for future sweeps.

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.

Fix all pre-existing compliance test violations

2 participants