Skip to content

Commit 34cc8d4

Browse files
Claudeclaude
authored andcommitted
feat: add feedback opt-in step to init wizard (OD-780)
Init wizard now prompts users to opt into anonymous feedback sharing. Defaults to No — consent requires explicit acceptance. Config defaults written to .gitmem/config.json with feedback_enabled: false. The contribute_feedback tool already gates remote submission on this flag. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 2668a93 commit 34cc8d4

1 file changed

Lines changed: 52 additions & 1 deletion

File tree

bin/init-wizard.js

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ async function stepMemoryStore() {
439439
// Config
440440
const configPath = join(gitmemDir, "config.json");
441441
if (!existsSync(configPath)) {
442-
const config = {};
442+
const config = { feedback_enabled: false, telemetry_enabled: false };
443443
if (projectName) config.project = projectName;
444444
writeJson(configPath, config);
445445
} else if (projectName) {
@@ -849,6 +849,54 @@ async function stepGitignore() {
849849
return { done: true };
850850
}
851851

852+
async function stepFeedbackOptIn() {
853+
const configPath = join(gitmemDir, "config.json");
854+
const config = readJson(configPath) || {};
855+
856+
// Already opted in — skip
857+
if (config.feedback_enabled === true) {
858+
log(CHECK, "Feedback sharing already enabled");
859+
return { done: false };
860+
}
861+
862+
// Non-interactive default install: show what's off and move on
863+
if (!interactive && autoYes) {
864+
log(CHECK,
865+
"Anonymous feedback sharing is off",
866+
"Run with --interactive to enable, or set feedback_enabled in .gitmem/config.json"
867+
);
868+
return { done: false };
869+
}
870+
871+
// Ask the user
872+
const accepted = await confirm(
873+
"Help improve gitmem by sharing anonymous feedback? (no code, no content — just tool friction reports)",
874+
false // default No
875+
);
876+
877+
if (!accepted) {
878+
log(CHECK,
879+
"Anonymous feedback sharing is off",
880+
"You can enable it later in .gitmem/config.json"
881+
);
882+
return { done: false };
883+
}
884+
885+
if (dryRun) {
886+
log(CHECK, "Would enable feedback sharing in config.json", "[dry-run]");
887+
return { done: true };
888+
}
889+
890+
config.feedback_enabled = true;
891+
writeJson(configPath, config);
892+
893+
log(CHECK,
894+
"Anonymous feedback sharing enabled",
895+
"Agents can report friction \u2014 no code or content is ever sent"
896+
);
897+
return { done: true };
898+
}
899+
852900
// ── Main ──
853901

854902
async function main() {
@@ -902,6 +950,9 @@ async function main() {
902950
const r6 = await stepGitignore();
903951
if (r6.done) configured++;
904952

953+
const r7 = await stepFeedbackOptIn();
954+
if (r7.done) configured++;
955+
905956
// ── Footer ──
906957
if (dryRun) {
907958
console.log(`${C.dim}Dry run complete \u2014 no files were modified.${C.reset}`);

0 commit comments

Comments
 (0)