Skip to content

feat(consent): add consent package — telemetry/broadcasts/reviews flags (PILOT-392)#16

Merged
TeoSlayer merged 1 commit into
mainfrom
feat/pilot-392-consent-flags
Jun 17, 2026
Merged

feat(consent): add consent package — telemetry/broadcasts/reviews flags (PILOT-392)#16
TeoSlayer merged 1 commit into
mainfrom
feat/pilot-392-consent-flags

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Summary

  • Adds github.com/pilot-protocol/common/consent package with GetConsent / SetConsent APIs
  • Three flags: telemetry, broadcasts, reviews — all default to true (opt-out model)
  • Persists to ~/.pilot/config.json under a "consent" subkey; reads/writes only that subkey, leaving all other top-level keys intact
  • Writes are atomic via fsutil.AtomicWrite (temp-file + fsync + rename + dir fsync)
  • Invalid flag name returns a descriptive error listing the three valid names

Test plan

  • GOWORK=off go test -race ./consent/... — all 16 tests pass
  • Absent config file → all three flags return true
  • Set one flag to false → only that flag changes, others still true
  • Set flag false then true → reads back true
  • Invalid flag name → descriptive error, no file created
  • Atomic write — no .tmp file left after successful write
  • Other top-level config keys and unrelated consent flags are preserved on each write

Closes PILOT-392

🤖 Generated with Claude Code

…gs (PILOT-392)

Introduces github.com/pilot-protocol/common/consent with GetConsent and
SetConsent APIs that read/write the "consent" subkey in ~/.pilot/config.json.
All three flags default to true (opt-out model); writes are atomic via
fsutil.AtomicWrite (temp-file + rename + dir fsync).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov

codecov Bot commented Jun 17, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 72.54902% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
consent/consent.go 72.54% 7 Missing and 7 partials ⚠️

📢 Thoughts on this report? Let us know!

@TeoSlayer TeoSlayer merged commit 05b8692 into main Jun 17, 2026
1 of 2 checks passed
@TeoSlayer TeoSlayer deleted the feat/pilot-392-consent-flags branch June 17, 2026 09:08
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.

2 participants