|
const fs = require("fs"); |
|
const path = require("path"); |
|
|
|
const SETTINGS_PATH = path.join( |
|
process.env.HOME, |
|
".claude", |
|
"settings.json" |
|
); |
|
|
|
const disclaimers = [ |
|
// neutral / professional |
|
"Disclaimer: Parts of this commit were written or reviewed with the help of an LLM.", |
|
"Disclaimer: This change was partially drafted and validated using AI assistance.", |
|
"Disclaimer: An LLM assisted in drafting and/or reviewing this commit.", |
|
"Disclaimer: Portions of this commit were assisted by an AI language model.", |
|
"Disclaimer: AI-assisted drafting; human-reviewed.", |
|
"Disclaimer: This commit was prepared with LLM support.", |
|
|
|
// light / friendly |
|
"Disclaimer: This commit had a helpful chat with an LLM.", |
|
"Disclaimer: AI assisted—humans supervised.", |
|
"Disclaimer: Drafted with a little help from an LLM (and a lot of human judgment).", |
|
"Disclaimer: AI helped with parts of this—keyboard still operated by a human.", |
|
"Disclaimer: LLM-assisted, coffee-fueled, human-approved.", |
|
"Disclaimer: Some lines were suggested by an LLM.", |
|
|
|
// witty / playful |
|
"Disclaimer: LLM involved. No robots were harmed in the making of this commit.", |
|
"Disclaimer: This commit was pair-programmed with an LLM.", |
|
"Disclaimer: AI helped—blame still belongs to me.", |
|
"Disclaimer: This commit consulted an LLM and ignored half its advice.", |
|
"Disclaimer: AI was involved. Judgment was optional.", |
|
"Disclaimer: LLM made suggestions. I made decisions.", |
|
"Disclaimer: This commit is not 100% organic.", |
|
"Disclaimer: Free-range human, cage-free AI.", |
|
|
|
// sarcastic / self-aware |
|
"Disclaimer: An LLM was involved, but I take full responsibility.", |
|
"Disclaimer: AI helped write this. If it breaks, that's on me.", |
|
"Disclaimer: LLM assisted. CI will be the real judge.", |
|
"Disclaimer: Written with AI assistance. Accountability remains human.", |
|
"Disclaimer: LLM helped—future me will deal with the consequences.", |
|
"Disclaimer: AI helped write this. Please direct complaints to me.", |
|
"Disclaimer: If this looks smart, thank the AI. If not, blame me.", |
|
"Disclaimer: AI-assisted. Ego fully human.", |
|
|
|
// meta / geeky |
|
"Disclaimer: Generated with human-in-the-loop LLM assistance.", |
|
"Disclaimer: Co-authored by a human and an LLM (in that order).", |
|
"Disclaimer: This commit contains traces of artificial intelligence.", |
|
"Disclaimer: This commit contains machine-generated text fragments.", |
|
"Disclaimer: LLM-assisted commit detected.", |
|
"Disclaimer: Co-authored by me and my silicon-based colleague.", |
|
"Disclaimer: This commit passed through an LLM before reaching git.", |
|
"Disclaimer: AI-in-the-loop, human-on-the-hook.", |
|
"Disclaimer: Generated with prompt engineering and hope.", |
|
|
|
// short footer |
|
"Disclaimer: LLM-assisted", |
|
"Disclaimer: AI-assisted commit", |
|
"Disclaimer: Assisted by LLM", |
|
"Disclaimer: LLM involved", |
|
"Disclaimer: AI inside", |
|
"Disclaimer: Partially synthetic", |
|
"Disclaimer: Assisted by machines", |
|
"Disclaimer: Not fully hand-crafted", |
|
]; |
|
|
|
try { |
|
if (disclaimers.length < 2) { |
|
throw new Error("Need at least 2 disclaimers"); |
|
} |
|
|
|
const commitIdx = Math.floor(Math.random() * disclaimers.length); |
|
let prIdx; |
|
do { |
|
prIdx = Math.floor(Math.random() * disclaimers.length); |
|
} while (prIdx === commitIdx); |
|
|
|
const settings = JSON.parse(fs.readFileSync(SETTINGS_PATH, "utf8")); |
|
settings.attribution = settings.attribution || {}; |
|
settings.attribution.commit = disclaimers[commitIdx]; |
|
settings.attribution.pr = disclaimers[prIdx]; |
|
|
|
fs.writeFileSync(SETTINGS_PATH, JSON.stringify(settings, null, 2) + "\n"); |
|
|
|
const now = new Date().toLocaleString(); |
|
console.log(`[${now}] commit: ${settings.attribution.commit}`); |
|
console.log(`[${now}] pr: ${settings.attribution.pr}`); |
|
} catch (err) { |
|
const now = new Date().toLocaleString(); |
|
console.error(`[${now}] Error: ${err.message}`); |
|
process.exit(1); |
|
} |