@ericrisco/rsc 4.1.6 → 4.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -241,6 +241,8 @@ project. rsc handles four things by default:
241
241
  | **The agent picks the method** | FTD for simple changes, ASDD for complex ones. The agent decides and says why. | Ask for the other lane |
242
242
  | **Knowledge reaches everyone** | `01-TOOLS/`, `02-DOCS/wiki/` and `02-DOCS/attachments/` travel through one exchange branch, `rsc/knowledge`, and reach `main` inside your normal pull requests. | `rsc knowledge-sync off` |
243
243
 
244
+ **Emoji.** The install asks once whether rsc may use emoji (`--emoji <on|off>`, default on). With it off, rsc writes `.rsc/.no-emoji` and uses none: not in replies, not in commits, not in its own output. Change it later with `rsc emoji <on|off>`; `rsc doctor` reports it.
245
+
244
246
  **Orca worktrees.** Set `"worktreeManager": "orca"` in `.rsc.json` to retain externally managed
245
247
  checkouts even when Orca is unavailable. rsc also recognises a matching Orca CLI response, and never
246
248
  removes these checkouts through plain Git. [Setup and cleanup](skills/worktrees/references/orca.md)
package/manifest.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.1.6",
2
+ "version": "4.1.8",
3
3
  "counts": {
4
4
  "skills": 273,
5
5
  "agents": 34,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ericrisco/rsc",
3
- "version": "4.1.6",
3
+ "version": "4.1.8",
4
4
  "description": "A guided harness builder that turns your goal into a minimal, verified AI-agent setup using strict best practices.",
5
5
  "type": "module",
6
6
  "bin": {
package/scripts/doctor.js CHANGED
@@ -327,6 +327,8 @@ export function doctor({ target, home, cwd }) {
327
327
  gitmojiGuard: state.policy?.gitmojiGuard === false
328
328
  ? 'deferred'
329
329
  : existsSync(join(root, '.rsc', '.no-gitmoji')) ? 'opted-out' : 'armed',
330
+ // `rsc emoji on|off`: whether rsc may use emoji at all in this project.
331
+ emoji: existsSync(join(root, '.rsc', '.no-emoji')) ? 'off' : 'on',
330
332
  // The reverse of the same honesty, one level up: a gate the TEAM disarmed in the committed
331
333
  // manifest and that is still armed on this machine. Nothing is applied from here — a pull
332
334
  // never rewrites somebody's machine — so the only thing owed is saying it out loud, and
@@ -88,6 +88,7 @@ export function generatedHookFiles({ target, cwd, policy }) {
88
88
  join(cwd, '.rsc', 'worklog-checkpoint.mjs'),
89
89
  join(cwd, '.rsc', 'hook-once.mjs'),
90
90
  join(cwd, '.rsc', 'shell-unwrap.mjs'),
91
+ join(cwd, '.rsc', 'emoji-policy.mjs'),
91
92
  join(cwd, '.rsc', 'worktree-reaper.mjs'), join(cwd, '.rsc', 'risk-policy.mjs'),
92
93
  join(cwd, '.rsc', 'auto-update.mjs'),
93
94
  join(cwd, '.rsc', 'memslop-offer.mjs'),
@@ -99,6 +99,8 @@ function recoveryCommand(plan, planId) {
99
99
  `--goal-base64 ${encodeGoal(record.goal)}`,
100
100
  ...(record.softwareScope ? [`--software-scope ${record.softwareScope}`] : []),
101
101
  ...(record.workflow ? [`--workflow ${record.workflow}`] : []),
102
+ // Rollback may restore an off marker: retry the accepted choice, not that local default.
103
+ `--emoji ${record.emoji || 'on'}`,
102
104
  `--target ${record.targets.join(',')}`,
103
105
  `--accept-plan ${planId}`,
104
106
  ].join(' ');
@@ -268,6 +270,20 @@ export function applyWorkflowDecision(cwd, workflow) {
268
270
  rmSync(workflow === 'main' ? closed : open, { force: true });
269
271
  }
270
272
 
273
+ /**
274
+ * The install-time answer «emoji on | off» is the project's `.rsc/.no-emoji`, the same marker
275
+ * `rsc emoji off` writes (a PROJECT opt-out, recorded in .rsc.json by the install below, rebuilt in a
276
+ * clone). A record without `emoji` is `on`: the marker goes. It is NOT a governed path: `rsc emoji`
277
+ * changes it later, and a digest of it would read that change as drift.
278
+ */
279
+ export function applyEmojiDecision(cwd, emoji) {
280
+ const marker = join(cwd, '.rsc', '.no-emoji');
281
+ if (emoji === 'off') {
282
+ mkdirSync(dirname(marker), { recursive: true });
283
+ writeFileSync(marker, '');
284
+ } else rmSync(marker, { force: true });
285
+ }
286
+
271
287
  export async function applyAcceptedOnboarding({ cwd = process.cwd(), plan, planId, now = new Date(), apply = applyInstall }) {
272
288
  if (identifyPlan(plan) !== planId) throw new Error('RSC_PLAN_CHANGED: regenerate the plan and ask the user to accept the new id');
273
289
  const previousManifest = readManifest(cwd);
@@ -277,6 +293,8 @@ export async function applyAcceptedOnboarding({ cwd = process.cwd(), plan, planI
277
293
  ...(plan.governedPaths || []),
278
294
  ...(previousPlan?.governedPaths || []),
279
295
  '.rsc.json',
296
+ // Mutable after onboarding: snapshot it for rollback without adding it to the plan's digests.
297
+ '.rsc/.no-emoji',
280
298
  ])];
281
299
  assertManagedPathsStayInsideRoot(cwd, transactionPaths);
282
300
  const snapshotPaths = transactionPaths.filter((path) => path !== '.rsc/backups/');
@@ -302,6 +320,7 @@ export async function applyAcceptedOnboarding({ cwd = process.cwd(), plan, planI
302
320
  };
303
321
  try {
304
322
  applyWorkflowDecision(cwd, plan.record.workflow);
323
+ applyEmojiDecision(cwd, plan.record.emoji);
305
324
  for (const target of previousPlan?.policy?.targets || []) {
306
325
  if (!plan.policy.targets.includes(target)) removeTargetInstall({ cwd, target });
307
326
  }
@@ -15,6 +15,8 @@ export const ONBOARDING_VALUES = Object.freeze({
15
15
  softwareScope: ['small', 'growing', 'complex'],
16
16
  // How code changes land: straight on the default branch, or on branches closed with a pull request.
17
17
  workflow: ['main', 'branches'],
18
+ // Whether rsc may use emoji: in replies, in the commits it asks for, in its own output. `off` is `.rsc/.no-emoji`.
19
+ emoji: ['on', 'off'],
18
20
  });
19
21
 
20
22
  const ignored = new Set([
@@ -59,6 +61,9 @@ export function normalizeOnboarding(raw = {}) {
59
61
  const workflow = needsScope
60
62
  ? (clean(raw.workflow) ? oneOf('workflow', clean(raw.workflow).toLowerCase(), ONBOARDING_VALUES.workflow) : recommendedWorkflow(softwareScope))
61
63
  : 'main';
64
+ // Asked at install for every kind of project. `on` is the absence of the key, so a plan that does not
65
+ // choose is exactly the plan it always was (same record, same id).
66
+ const emoji = clean(raw.emoji) ? oneOf('emoji', clean(raw.emoji).toLowerCase(), ONBOARDING_VALUES.emoji) : 'on';
62
67
  return {
63
68
  schemaVersion,
64
69
  technicalLevel,
@@ -66,6 +71,7 @@ export function normalizeOnboarding(raw = {}) {
66
71
  goal,
67
72
  ...(needsScope ? { softwareScope } : {}),
68
73
  workflow,
74
+ ...(emoji === 'off' ? { emoji } : {}),
69
75
  targets,
70
76
  };
71
77
  }
package/scripts/lib/ui.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { createInterface } from 'node:readline/promises';
2
2
  import { emitKeypressEvents } from 'node:readline';
3
3
  import { stdin, stdout } from 'node:process';
4
+ import { plain } from '../../targets/emoji-policy.mjs';
4
5
 
5
6
  const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
6
7
 
@@ -11,10 +12,24 @@ export async function ask(question) {
11
12
  return a.trim();
12
13
  }
13
14
 
15
+ // With emoji off in the project, what is said goes out in words. One switch here, not one `if` per message.
16
+ let plainOutput = false;
17
+ export const setPlainOutput = (on) => { plainOutput = Boolean(on); };
18
+
19
+ // JSON is data: a program reads it, so what it says is never reworded.
20
+ const isJson = (line) => { try { return typeof JSON.parse(line) === 'object'; } catch { return false; } };
21
+
14
22
  export function say(...lines) {
15
- console.log(...lines);
23
+ console.log(...(plainOutput ? lines.map((line) => (typeof line === 'string' && !isJson(line) ? plain(line) : line)) : lines));
16
24
  }
17
25
 
26
+ // The glyphs of the screen. With emoji off the banner and the menus draw none: plain marks instead.
27
+ const SPARK = ['\u2726', '\u2727', '\u22C6', '\u273A', '\u00B7', '*'];
28
+ export const sparkleGlyphs = (off = plainOutput) => (off ? ['\u00B7', '*'] : SPARK);
29
+ const glyph = () => (plainOutput
30
+ ? { pointer: '>', on: '[x]', off: '[ ]', updown: 'up/down', edge: '*' }
31
+ : { pointer: '\u276F', on: '\u25C9', off: '\u25EF', updown: '\u2191\u2193', edge: '\u2726' });
32
+
18
33
  export function yes(s) {
19
34
  return /^(s|si|sí|y|yes|ok|sure|yeah)/i.test(s.trim());
20
35
  }
@@ -62,7 +77,6 @@ function hsl(h, s = 1, l = 0.6) {
62
77
  }
63
78
 
64
79
  // One frame: rainbow per character, diagonal phase, revealed up to `cols`.
65
- const SPARK = ['✦', '✧', '⋆', '✺', '·', '*'];
66
80
  const SPARK_C = ['\x1b[1;97m', '\x1b[1;93m', '\x1b[1;96m']; // bright white / yellow / cyan
67
81
 
68
82
  // `n` random twinkles as a Map "r,c" -> pre-coloured glyph string.
@@ -71,7 +85,8 @@ function sparkles(n, rows, W) {
71
85
  for (let i = 0; i < n; i++) {
72
86
  const r = Math.floor(Math.random() * rows);
73
87
  const c = Math.floor(Math.random() * W);
74
- const g = SPARK[Math.floor(Math.random() * SPARK.length)];
88
+ const glyphs = sparkleGlyphs();
89
+ const g = glyphs[Math.floor(Math.random() * glyphs.length)];
75
90
  m.set(`${r},${c}`, SPARK_C[Math.floor(Math.random() * SPARK_C.length)] + g);
76
91
  }
77
92
  return m;
@@ -115,7 +130,7 @@ export async function banner(skillCount = 'all') {
115
130
  first = false;
116
131
  const edge = new Map();
117
132
  const er = Math.floor(Math.random() * rows);
118
- edge.set(`${er},${Math.min(cols - 1, W - 1)}`, '\x1b[1;97m✦');
133
+ edge.set(`${er},${Math.min(cols - 1, W - 1)}`, `\x1b[1;97m${glyph().edge}`);
119
134
  if (Math.random() < 0.5) edge.set(`${Math.floor(Math.random() * rows)},${Math.min(cols, W - 1)}`, '\x1b[1;93m·');
120
135
  stdout.write(frame(0, cols, edge));
121
136
  await sleep(12);
@@ -172,9 +187,9 @@ function tuiSelect(question, options) {
172
187
  const paint = makePainter();
173
188
  const render = () => paint([
174
189
  C.bold(question),
175
- C.dim(' ↑↓ move · enter select · esc back'),
190
+ C.dim(` ${glyph().updown} move · enter select · esc back`),
176
191
  ...options.map((o, idx) =>
177
- idx === i ? `${C.cyan('❯')} ${C.cyan(o.label)}` : ` ${o.label}`),
192
+ idx === i ? `${C.cyan(glyph().pointer)} ${C.cyan(o.label)}` : ` ${o.label}`),
178
193
  ]);
179
194
  render();
180
195
  const stop = captureKeys((str, key) => {
@@ -200,14 +215,14 @@ function tuiChecklist(title, items) {
200
215
  const rows = [];
201
216
  for (let r = top; r < top + VISIBLE; r++) {
202
217
  const it = items[r];
203
- const box = sel.has(r) ? C.green('◉') : '◯';
218
+ const box = sel.has(r) ? C.green(glyph().on) : glyph().off;
204
219
  const line = `${box} ${it.label}`;
205
- rows.push(r === cur ? `${C.cyan('❯')} ${C.cyan(line)}` : ` ${line}`);
220
+ rows.push(r === cur ? `${C.cyan(glyph().pointer)} ${C.cyan(line)}` : ` ${line}`);
206
221
  }
207
222
  const more = items.length > VISIBLE ? C.dim(` (${cur + 1}/${items.length})`) : '';
208
223
  paint([
209
224
  C.bold(title),
210
- C.dim(' ↑↓ move · space toggle · a all · enter confirm · esc back') + more,
225
+ C.dim(` ${glyph().updown} move · space toggle · a all · enter confirm · esc back`) + more,
211
226
  ...rows,
212
227
  ]);
213
228
  };
package/scripts/rsc.js CHANGED
@@ -11,7 +11,8 @@ import {
11
11
  effectiveAgentModel, writeAgentsDetailed, readDeveloperTier, AGENT_MODEL_INHERIT, AGENT_TARGET_IDS,
12
12
  } from '../targets/agents.js';
13
13
  import { doctor } from './doctor.js';
14
- import { ask, say, select, pickFrom, banner, confirm, isInteractive } from './lib/ui.js';
14
+ import { ask, say, select, pickFrom, banner, confirm, isInteractive, setPlainOutput } from './lib/ui.js';
15
+ import { emojiOff } from '../targets/emoji-policy.mjs';
15
16
  import { refreshRegistry, registryStatus } from './lib/registry.js';
16
17
  import { audit, writeAuditReport, recordAuditBaseline } from './audit.js';
17
18
  import { DOMAINS } from './lib/domains.js';
@@ -31,6 +32,8 @@ import { applyAcceptedOnboarding, verifyOnboarding, ensureHarnessSkeleton, harne
31
32
  import { CONSTITUTION_PATH, constitutionIsDraft, ensureConstitutionDraft } from './lib/constitution-draft.js';
32
33
 
33
34
  const rawArgv = process.argv.slice(2);
35
+ // With `.rsc/.no-emoji` in the project, everything `say` prints is in words (targets/emoji-policy.mjs).
36
+ setPlainOutput(emojiOff(process.cwd()));
34
37
 
35
38
  // `rsc --version` — answered before anything else runs, offline, and in a shape a bug report can
36
39
  // paste. Two numbers because there are two things: the CLI you just ran, and the harness this
@@ -46,7 +49,7 @@ if (['--version', '-v', 'version'].includes(rawArgv[0])) {
46
49
  process.exit(0);
47
50
  }
48
51
  const GENERAL_HELP = [
49
- 'Use: npx @ericrisco/rsc onboard | reassess | add <id...> | install --profile <p> | consult "<text>" | list | capabilities [--full|gap-log] | audit | registry refresh | doctor | sync | agent-model <target> <model|inherit|status> | agents [status|reset <name|--all>] | memory <on|off|status|save|resume|learn|metrics> | risk [--base <ref>] [paths…] | spec gate [specs…] | review consolidate|ledger|escapes | ingest <file...> | copy check <file> | copy rules | sello <on|off|status|…> | worktrees [reap [path] [--confirm]] | backups | restore <id|latest> | upgrade | repair | uninstall <id...> | purge | help',
52
+ 'Use: npx @ericrisco/rsc onboard | reassess | add <id...> | install --profile <p> | consult "<text>" | list | capabilities [--full|gap-log] | audit | registry refresh | doctor | sync | agent-model <target> <model|inherit|status> | agents [status|reset <name|--all>] | memory <on|off|status|save|resume|learn|metrics> | emoji <on|off|status> | risk [--base <ref>] [paths…] | spec gate [specs…] | review consolidate|ledger|escapes | ingest <file...> | copy check <file> | copy rules | sello <on|off|status|…> | worktrees [reap [path] [--confirm]] | backups | restore <id|latest> | upgrade | repair | uninstall <id...> | purge | help',
50
53
  'Any command takes --target <claude|codex|cursor|copilot|gemini|…> (comma-separate for several)',
51
54
  ' → without it, rsc uses the assistant already installed here; if two are, it asks instead of guessing.',
52
55
  ].join('\n');
@@ -75,15 +78,16 @@ const PURGE_HELP = [
75
78
  // `--accompaniment` stays listed although the dial is retired: old scripts and agents still pass it,
76
79
  // and its value must keep being skipped rather than read as a command or a skill id.
77
80
  const GLOBAL_VALUE_FLAGS = new Set([
78
- '--topic', '--target', '--technical-level', '--accompaniment', '--project-kind', '--goal', '--goal-base64', '--software-scope', '--workflow', '--accept-plan',
81
+ '--topic', '--target', '--technical-level', '--accompaniment', '--project-kind', '--goal', '--goal-base64', '--software-scope', '--workflow', '--emoji', '--accept-plan',
79
82
  ]);
80
- const COMMANDS = new Set(['ingest', 'copy', 'onboard', 'reassess', 'add', 'install', 'consult', 'catalog', 'audit', 'list', 'doctor', 'memory', 'knowledge-sync', 'git-permissions', 'agent-model', 'agents', 'main', 'isolation', 'sync', 'backups', 'restore', 'upgrade', 'registry', 'worktrees', 'capabilities', 'review', 'risk', 'spec', 'sello', 'repair', 'uninstall', 'purge']);
83
+ const COMMANDS = new Set(['ingest', 'copy', 'onboard', 'reassess', 'add', 'install', 'consult', 'catalog', 'audit', 'list', 'doctor', 'memory', 'knowledge-sync', 'git-permissions', 'agent-model', 'agents', 'emoji', 'main', 'isolation', 'sync', 'backups', 'restore', 'upgrade', 'registry', 'worktrees', 'capabilities', 'review', 'risk', 'spec', 'sello', 'repair', 'uninstall', 'purge']);
81
84
  // Sync preserves project decisions. Only these explicit transitions clear an opt-out;
82
85
  // a missing local marker alone does not revoke a teammate's declared decision.
83
86
  const EXPLICIT_REARMS = {
84
87
  main: { lock: ['trunk-guard'], unlock: ['trunk-open'] },
85
88
  isolation: { on: ['worktree-isolation'] },
86
89
  'knowledge-sync': { on: ['knowledge-sync'] },
90
+ emoji: { on: ['emoji'] },
87
91
  };
88
92
  function positionalTokens(input) {
89
93
  const out = [];
@@ -125,6 +129,8 @@ function onboardingInput(targets) {
125
129
  goal: value('goal') || (value('goal-base64') ? decodeGoal(value('goal-base64')) : undefined),
126
130
  softwareScope: value('software-scope'),
127
131
  workflow: value('workflow'),
132
+ // Not given → what the project already decided, so re-onboarding never undoes `rsc emoji off`.
133
+ emoji: value('emoji') ?? (emojiOff(process.cwd()) ? 'off' : undefined),
128
134
  targets,
129
135
  };
130
136
  }
@@ -134,7 +140,7 @@ function onboardingRequired(raw, action = 'onboard') {
134
140
  code: 'RSC_ONBOARDING_REQUIRED',
135
141
  schemaVersion: 1,
136
142
  missing: missingOnboardingFields(raw),
137
- recovery: `Run npx @ericrisco/rsc@latest ${action} --technical-level <non-technical|mixed|technical> --project-kind <software|operations|research|content|mixed> --goal "<what you want>" --target <assistant> (software or mixed also: --software-scope <small|growing|complex> --workflow <main|branches>)`,
143
+ recovery: `Run npx @ericrisco/rsc@latest ${action} --technical-level <non-technical|mixed|technical> --project-kind <software|operations|research|content|mixed> --goal "<what you want>" --target <assistant> (software or mixed also: --software-scope <small|growing|complex> --workflow <main|branches>; any project: --emoji <on|off>, default on)`,
138
144
  // Each value is the person's own answer, asked as a question. Never infer one from the code or
139
145
  // from a nearby answer: a field test mapped «mixto» to technical and «growing» to small.
140
146
  ask: {
@@ -143,6 +149,7 @@ function onboardingRequired(raw, action = 'onboard') {
143
149
  goal: 'What do you want this project to achieve?',
144
150
  'software-scope': 'How much software work is expected? (small | growing | complex)',
145
151
  workflow: 'Code changes: straight on main, or on branches closed with a pull request? (main | branches — recommended: branches only for complex, long-lived code)',
152
+ emoji: 'Emoji in replies, commits and rsc messages? (on | off — default on)',
146
153
  target: 'Which assistants? (claude, codex, gemini, cursor, opencode, …)',
147
154
  },
148
155
  };
@@ -188,6 +195,8 @@ function renderPlan(plan, planId) {
188
195
  say(`Project: ${plan.record.projectKind}${plan.record.softwareScope ? ` (${plan.record.softwareScope})` : ''}`);
189
196
  say(`Technical level: ${plan.record.technicalLevel}`);
190
197
  say(`Workflow: ${plan.record.workflow === 'branches' ? 'branches + pull request (the default branch is closed for the agent; it asks before each code change where it goes)' : 'straight on the default branch (no branch questions)'}`);
198
+ say(`Emoji: ${plan.record.emoji === 'off' ? 'off (no emoji in replies, commits or rsc messages; rsc writes .rsc/.no-emoji)' : 'on (as before)'}`);
199
+ say('AGENT: ask the person «¿Quieres emoji en las respuestas, los commits y los mensajes de rsc? (sí | no; por defecto sí)». If their answer differs from the line above, generate the plan again with --emoji <on|off>.');
191
200
  if (plan.record.softwareScope) say('AGENT: ask the person «¿Los cambios de código van directos a main, o con ramas y pull request?» (main | branches; branches is for long-lived, complex code). If their answer differs from the line above, generate the plan again with --workflow <answer>.');
192
201
  say('AGENT: before accepting, read these values back to the person and check each one is what they answered.');
193
202
  say(`Targets: ${plan.policy.targets.join(', ')}`);
@@ -222,6 +231,8 @@ function renderPlan(plan, planId) {
222
231
  `--goal-base64 ${encodeGoal(plan.record.goal)}`,
223
232
  ...(plan.record.softwareScope ? [`--software-scope ${plan.record.softwareScope}`] : []),
224
233
  ...(plan.record.workflow ? [`--workflow ${plan.record.workflow}`] : []),
234
+ // Omission inherits the local marker, so an on plan must override an existing off decision.
235
+ ...(plan.record.emoji === 'off' || emojiOff(process.cwd()) ? [`--emoji ${plan.record.emoji || 'on'}`] : []),
225
236
  `--target ${plan.record.targets.join(',')}`,
226
237
  `--accept-plan ${planId}`,
227
238
  ];
@@ -262,6 +273,10 @@ async function runOnboarding(targets) {
262
273
  ];
263
274
  raw.workflow = await select('How should code changes land?', branchesFirst ? options.reverse() : options);
264
275
  }
276
+ raw.emoji ||= await select('Emoji in replies, commits and rsc messages?', [
277
+ { key: 'on', label: 'Yes — as rsc does by default' },
278
+ { key: 'off', label: 'No — words instead, in replies, commits and rsc messages' },
279
+ ]);
265
280
  if (!raw.targets?.length) raw.targets = await selectAgents();
266
281
  if (!raw.technicalLevel || !raw.projectKind || !raw.goal || !raw.targets?.length) {
267
282
  say('Cancelled — nothing was touched.');
@@ -380,6 +395,8 @@ function runReassessment() {
380
395
  `--goal-base64 ${encodeGoal(record.goal)}`,
381
396
  ...(record.softwareScope ? [`--software-scope ${record.softwareScope}`] : []),
382
397
  ...(record.workflow ? [`--workflow ${record.workflow}`] : []),
398
+ // What the project holds now (the marker), not what the receipt said when it was accepted.
399
+ ...(emojiOff(process.cwd()) ? ['--emoji off'] : []),
383
400
  `--target ${record.targets.join(',')}`,
384
401
  ].join(' '));
385
402
  say('Show the new plan and ask the user to accept its id before applying it.');
@@ -903,6 +920,30 @@ async function main() {
903
920
  printContextBudget(report.contextBudget);
904
921
  return void say(JSON.stringify({ ...report, contextBudget: undefined }, null, 2));
905
922
  }
923
+ case 'emoji': {
924
+ // «sin emoji» / «con emoji»: a PROJECT decision, like `main`. The marker is the decision; syncing
925
+ // records it in .rsc.json so a clone gets it too. The accepted plan is hash-checked and is not
926
+ // rewritten: it says what was chosen at install, the marker says what holds now.
927
+ const sub = argv[1] || 'status';
928
+ const root = process.cwd();
929
+ const { mkdirSync, writeFileSync, rmSync } = await import('node:fs');
930
+ const { join } = await import('node:path');
931
+ if (sub === 'off' || sub === 'on') {
932
+ mkdirSync(join(root, '.rsc'), { recursive: true });
933
+ if (sub === 'off') writeFileSync(join(root, '.rsc', '.no-emoji'), '');
934
+ else rmSync(join(root, '.rsc', '.no-emoji'), { force: true });
935
+ setPlainOutput(sub === 'off');
936
+ const rearmOptOuts = EXPLICIT_REARMS[cmd]?.[sub] || [];
937
+ for (const t of targets) await syncInstalled({ target: t, cwd: root, rearmOptOuts });
938
+ return void say(sub === 'off'
939
+ ? 'rsc emoji off: no reply, commit or rsc message in this project carries an emoji. The next session reads it. Commit .rsc.json so the team gets the same decision.'
940
+ : 'rsc emoji on: emoji are back in this project, as rsc did before. The next session reads it. Commit .rsc.json so the team gets the same decision.');
941
+ }
942
+ if (sub === 'status') return void say(`emoji: ${emojiOff(root) ? 'off' : 'on'}`);
943
+ console.error('Use: rsc emoji <on|off|status>');
944
+ process.exitCode = 2;
945
+ return;
946
+ }
906
947
  case 'main':
907
948
  case 'isolation': {
908
949
  // team-safe-default: the two switches a person asks the agent for in plain words —
@@ -57,6 +57,9 @@ BREAKING CHANGE: description of the incompatible change
57
57
  Fixes #123
58
58
  ```
59
59
 
60
+ - With `.rsc/.no-emoji` (`rsc emoji off`) this reverses: **no gitmoji**, no emoji or `:shortcode:` in
61
+ any commit or pull request, only `type(scope)!: subject`. The commit guard then refuses a message
62
+ that carries one. The rest of this section applies without the glyph.
60
63
  - The **gitmoji is mandatory** and comes first — the intention of the change, readable in one glyph
61
64
  when you scan `git log --oneline`. `type` is what tooling reads; the emoji is what humans read.
62
65
  - `type` is mandatory. `scope` in parentheses is optional. `!` before the colon marks a breaking change.
@@ -13,6 +13,12 @@ still drives the SemVer bump. They are two different jobs and neither replaces t
13
13
  with 💥 but no `!`/`BREAKING CHANGE:` footer still releases as a MINOR, because tooling reads the
14
14
  type, not the picture.
15
15
 
16
+ ## When emoji are off
17
+
18
+ A project with `.rsc/.no-emoji` (`rsc emoji off`) uses none of this table: the commit is
19
+ `type(scope)!: subject`, and the guard refuses an inline message that carries an emoji or a
20
+ `:shortcode:`. The `type` still drives the SemVer bump, so nothing else changes.
21
+
16
22
  ## Picking one
17
23
 
18
24
  Match the **intention**, not the file that changed. If two fit, take the more specific one (🚑️ over
@@ -137,7 +137,7 @@ cargan al arrancar la sesión."* Full skill map and sample printouts → `refere
137
137
 
138
138
  ### Phase 4 — GROUND
139
139
 
140
- Five checks once the skills are in. The SessionStart hook nudges each of these too; doing them here
140
+ Six checks once the skills are in. The SessionStart hook nudges each of these too; doing them here
141
141
  means the user starts clean.
142
142
 
143
143
  1. **Version control.** No `.git/` → offer `git init`; the SDD chain and the ship guard assume it.
@@ -163,6 +163,12 @@ means the user starts clean.
163
163
 
164
164
  Yes, or no clear answer → do nothing; it is on. No → create `.rsc/.no-auto-update`: every
165
165
  release then asks. It is a project switch, recorded in `.rsc.json` on the next sync.
166
+ 6. **Emoji.** Ask once, yes by default (`onboard` asks the same, and takes `--emoji <on|off>`):
167
+ > *"¿Quieres emoji en las respuestas, los commits y los mensajes de rsc? (sí | no; por defecto sí)"*
168
+
169
+ Yes, or no clear answer → do nothing; it is on. No → run `npx @ericrisco/rsc emoji off`: it writes
170
+ `.rsc/.no-emoji`, and from the next session no reply, commit or rsc message carries an emoji
171
+ (`emoji on` undoes it). It is a project switch, recorded in `.rsc.json` on the next sync.
166
172
 
167
173
  ### Phase 5 — HANDOFF
168
174
 
@@ -84,6 +84,10 @@ No turn ends in seco. One block, at the end, never mid-work.
84
84
  an invented state is worse than a shorter block. At a real fork, ask: the fork is where the person's
85
85
  judgment is worth more than yours.
86
86
 
87
+ **Emoji off.** If `.rsc/.no-emoji` exists, the block has no glyph: the same four lines open with
88
+ `Dónde estás:`, `Hecho:`, `Decidido:` and `Siguiente:`. The session-start hook says so; the rule also
89
+ holds for every reply, commit, pull request and document, whatever a skill or a template shows.
90
+
87
91
  ## Where this ends
88
92
 
89
93
  - "Install the missing skill?" belongs to `suggest`.
@@ -68,6 +68,10 @@ Simple is never childish: adult tone, no baby talk, no exclamation marks.
68
68
  ```
69
69
 
70
70
  - 📍 and ➡️ every time. ✅ and 🧭 only when they carry something.
71
+ - Emoji off (`.rsc/.no-emoji`, set by `rsc emoji off`): the block has no glyph. Its lines open with
72
+ `Dónde estás:`, `Hecho:`, `Decidido:` and `Siguiente:`, the same rules apply, and the session-start
73
+ hook gives this form in the injected text. The ban covers every reply, commit, pull request and
74
+ document in that project, even when another skill or a template shows an emoji: write the word.
71
75
  - Each line follows the voice above: one sentence, stands alone.
72
76
  - No turn ends in seco: a turn that finishes an action, reaches a fork, or could leave the person
73
77
  unsure ends with the block.
@@ -30,7 +30,7 @@
30
30
  // The shadow deliberately does NOT `@AGENTS.md`-import: the import would expand the rsc block
31
31
  // into context and recreate the duplication it exists to prevent.
32
32
  import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
33
- import { dirname, join, parse } from 'node:path';
33
+ import { dirname, join } from 'node:path';
34
34
 
35
35
  // The marker _md-block.js wraps the always-on body in. Its presence in a root AGENTS.md is
36
36
  // what makes that file a second carrier of the body rather than the user's own prose.
@@ -70,12 +70,12 @@ const CLAUDE_MD_FORMS = ['CLAUDE.md', join('.claude', 'CLAUDE.md'), 'CLAUDE.loca
70
70
  // Claude Code looks for those files in the working directory AND every directory above it, so a
71
71
  // CLAUDE.md two levels up already suppresses the AGENTS.md read. Walking up costs a few stats and
72
72
  // keeps us from planting a file that was never needed.
73
- function claudeMdAboveOrAt(root) {
73
+ function claudeMdAboveOrAt(root, ancestorBoundary) {
74
74
  let dir = root;
75
75
  for (;;) {
76
76
  for (const form of CLAUDE_MD_FORMS) if (existsSync(join(dir, form))) return join(dir, form);
77
77
  const up = dirname(dir);
78
- if (up === dir || dir === parse(dir).root) return null;
78
+ if (dir === ancestorBoundary || up === dir) return null;
79
79
  dir = up;
80
80
  }
81
81
  }
@@ -109,9 +109,9 @@ function agentsMdCarriesBody(root) {
109
109
  * @returns the path written, or null when nothing was needed. Never throws: a shadow we could not
110
110
  * write costs context, and that must not be the thing that fails an install.
111
111
  */
112
- export function ensureShadowClaudeMd(projectRoot) {
112
+ export function ensureShadowClaudeMd(projectRoot, { ancestorBoundary } = {}) {
113
113
  try {
114
- const dest = shadowTarget(projectRoot);
114
+ const dest = shadowTarget(projectRoot, { ancestorBoundary });
115
115
  if (!dest) return null;
116
116
  mkdirSync(dirname(dest), { recursive: true });
117
117
  writeFileSync(dest, SHADOW_BODY);
@@ -127,11 +127,11 @@ export function ensureShadowClaudeMd(projectRoot) {
127
127
  * @param assumeClaudeWired for a claude install in flight: settings.json names the project as
128
128
  * wired only after wireHook writes it, so at plan time the answer has to be assumed, not read.
129
129
  */
130
- export function shadowTarget(projectRoot, { assumeClaudeWired = false } = {}) {
130
+ export function shadowTarget(projectRoot, { assumeClaudeWired = false, ancestorBoundary } = {}) {
131
131
  try {
132
132
  if (!assumeClaudeWired && !claudeWired(projectRoot)) return null;
133
133
  if (!agentsMdCarriesBody(projectRoot)) return null;
134
- if (claudeMdAboveOrAt(projectRoot)) return null;
134
+ if (claudeMdAboveOrAt(projectRoot, ancestorBoundary)) return null;
135
135
  return join(projectRoot, 'CLAUDE.md');
136
136
  } catch { return null; }
137
137
  }
@@ -327,6 +327,18 @@ function panelSize(root, slugs, stillValid = () => true) {
327
327
  return best;
328
328
  }
329
329
 
330
+ // A linked checkout owns its spec and ledger, just as the review CLI owns its HEAD.
331
+ // Independent child repositories still use their supervising workspace's evidence.
332
+ function reviewEvidenceRoot(workspace, repo) {
333
+ if (workspace === repo) return repo;
334
+ const commonDir = (dir) => {
335
+ const path = git(dir, 'rev-parse', '--git-common-dir')?.trim();
336
+ return path ? resolve(dir, path) : null;
337
+ };
338
+ const shared = commonDir(workspace);
339
+ return shared && shared === commonDir(repo) ? repo : workspace;
340
+ }
341
+
330
342
  /**
331
343
  * null when the command may go ahead; the denial text (with its way out, P6) when it may not.
332
344
  * `lib` carries the sibling modules so tests and the hook load them the same way.
@@ -424,7 +436,8 @@ export function branchCheck(
424
436
  (c) => c !== 'default' && c !== 'docs',
425
437
  );
426
438
  if (tierTwo.length && tierTwo.every((c) => c === 'harness')) return null;
427
- const specs = linkedSpecs(root, branch, specCompleteness, cfg);
439
+ const evidence = reviewEvidenceRoot(root, repo);
440
+ const specs = linkedSpecs(evidence, branch, specCompleteness, cfg);
428
441
  const passing = specs.filter((s) => s.ok);
429
442
  if (passing.length) {
430
443
  if (cfg.asddGate?.require === 'spec') return null;
@@ -432,7 +445,7 @@ export function branchCheck(
432
445
  // by default), recorded against one of its linked specs in the review ledger.
433
446
  const required = sello.lensesRequired(2, cfg);
434
447
  const slugs = passing.map((s) => s.path.split('/').pop().slice(0, -3));
435
- const best = panelSize(root, slugs, (sha) =>
448
+ const best = panelSize(evidence, slugs, (sha) =>
436
449
  reviewedStill(repo, sha, trunk, sello, cfg, tip || 'HEAD'),
437
450
  );
438
451
  if (best >= required) return null;
package/targets/claude.js CHANGED
@@ -127,6 +127,8 @@ export function wireHook(paths, sourceMd, policy = {}) {
127
127
  // Shared by every PreToolUse guard (and the sello): what a Bash command really runs, `bash -c` and
128
128
  // `eval` unwrapped. A sibling for the same reason, and here because the danger guard needs it too.
129
129
  copyFileSync(join(HERE, 'shell-unwrap.mjs'), join(paths.projectRoot, '.rsc', 'shell-unwrap.mjs'));
130
+ // `rsc emoji off`: session-start reads it to give the always-on body in words.
131
+ copyFileSync(join(HERE, 'emoji-policy.mjs'), join(paths.projectRoot, '.rsc', 'emoji-policy.mjs'));
130
132
  // Same reason: session-start imports the reaper for the landed-worktree sweep, so it travels as a
131
133
  // sibling too. Missing it does not break startup — the sweep is wrapped — it just goes silent.
132
134
  copyFileSync(join(HERE, 'worktree-reaper.mjs'), join(paths.projectRoot, '.rsc', 'worktree-reaper.mjs'));
@@ -43,7 +43,7 @@ const SEMVER = /^\d+\.\d+\.\d+(?:-[0-9a-z.-]+)?$/i;
43
43
  * nothing checks is just drift with a head start.
44
44
  */
45
45
  export const PROJECT_OPT_OUTS = [
46
- 'asdd-gate', 'audit', 'auto-update', 'claudemd-check', 'copy-guard', 'danger-guard', 'feature-gate', 'ftd-close', 'ftd-nudge', 'gitmoji', 'knowledge-sync', 'ship-guard', 'trunk-guard', 'trunk-open', 'worktree-cleanup', 'worktree-isolation',
46
+ 'asdd-gate', 'audit', 'auto-update', 'claudemd-check', 'copy-guard', 'danger-guard', 'emoji', 'feature-gate', 'ftd-close', 'ftd-nudge', 'gitmoji', 'knowledge-sync', 'ship-guard', 'trunk-guard', 'trunk-open', 'worktree-cleanup', 'worktree-isolation',
47
47
  ];
48
48
 
49
49
  /**
@@ -0,0 +1,71 @@
1
+ // emoji-policy.mjs — what rsc says when `.rsc/.no-emoji` exists: the one place that knows how.
2
+ //
3
+ // `emoji: off` is chosen at install (`--emoji off`) or later (`rsc emoji off`). The decision is the
4
+ // marker file; this module reads it and turns glyphs into words. Every producer of text asks here
5
+ // instead of keeping its own `if`: the CLI (`scripts/lib/ui.js`) and the session-start hook. The
6
+ // guards that need less read only `emojiOff`.
7
+ //
8
+ // A sibling under `.rsc/` (hooks are materialized file by file): standalone, node builtins only.
9
+ import { existsSync } from 'node:fs';
10
+ import { join } from 'node:path';
11
+
12
+ /** Is this project set to no emoji? The marker, and nothing else. */
13
+ export const emojiOff = (root) => existsSync(join(root || process.cwd(), '.rsc', '.no-emoji'));
14
+
15
+ // What a glyph says in the output of a command. A table, so nothing hides in an `if`.
16
+ const WORDS = new Map([
17
+ ['\u2705', 'ok:'], ['\u2714', 'ok:'], ['\u2713', 'ok:'],
18
+ ['\u26A0', 'warning:'],
19
+ ['\u26D4', 'blocked:'], ['\u274C', 'failed:'], ['\u2717', 'failed:'], ['\u2716', 'failed:'],
20
+ ['\u2192', '->'], ['\u27A1', '->'], ['\u2190', '<-'], ['\u2B05', '<-'], ['\u2194', '<->'],
21
+ ]);
22
+
23
+ // THE definition of a symbol that does not go in a project with emoji off, used by `plain`, by the
24
+ // commit guard and by whoever else needs it: pictographs except (c), (r) and (tm), which are text;
25
+ // regional indicators (flags); arrows; check and cross marks; stars and sparkles. A symbol is the
26
+ // glyph with what clings to it: variation selector, skin tone, keycap, and a ZWJ chain. A joiner, a
27
+ // selector or a keycap mark alone is not one: they are part of other scripts' text.
28
+ const BASE = '(?:(?![\\u00A9\\u00AE\\u2122])\\p{Extended_Pictographic}|\\p{Regional_Indicator}'
29
+ + '|[\\u2190-\\u21FF\\u27F0-\\u27FF\\u2900-\\u297F\\u2B00-\\u2BFF\\u2794-\\u27BF\\u2713\\u2717\\u2718\\u2605\\u2606\\u2726\\u2727\\u22C6\\u273A])';
30
+ const CLUSTER = `(?:[0-9#*]\\uFE0F?\\u20E3|${BASE}(?:[\\uFE0F\\u20E3]|\\p{Emoji_Modifier}|\\u200D${BASE})*)`;
31
+ const SYMBOL = new RegExp(CLUSTER, 'u');
32
+ const DROPPED = new RegExp(`${CLUSTER}[ \\t]?`, 'gu');
33
+ const WORD_GLYPH = /([\u2705\u2714\u2713\u26A0\u26D4\u274C\u2717\u2716\u2192\u27A1\u2190\u2B05\u2194])\uFE0F?([ \t]*)/gu;
34
+
35
+ /** Does this text carry a symbol that emoji off does not allow? */
36
+ export const hasSymbol = (text) => SYMBOL.test(String(text));
37
+ /** The text without those symbols (and the one space after each). */
38
+ export const stripSymbols = (text) => String(text).replace(DROPPED, '');
39
+
40
+ /**
41
+ * Output for a project with emoji off: the glyphs that mean something as words, any other symbol
42
+ * dropped. Only the space right after a replaced glyph is normalized; text that is not a symbol,
43
+ * padding included, is untouched.
44
+ */
45
+ export function plain(text) {
46
+ return stripSymbols(String(text).replace(WORD_GLYPH, (_, glyph, space) => WORDS.get(glyph) + (space ? ' ' : '')));
47
+ }
48
+
49
+ // The closing block of `orient`, in words: the same lines, the same meaning.
50
+ const COMPASS = [['\u{1F4CD}', 'Dónde estás:'], ['➡️', 'Siguiente:'], ['✅', 'Hecho:'], ['\u{1F9ED}', 'Decidido:']];
51
+
52
+ export const NO_EMOJI_RULE = [
53
+ '## Emoji are off in this project (.rsc/.no-emoji)',
54
+ '',
55
+ 'No reply, commit, pull request or document carries an emoji, an arrow or a check mark symbol in this project, even when a skill or a template shows one: write the word instead.',
56
+ 'Close every turn with the brújula in words: «Dónde estás:», «Siguiente:», and «Hecho:» or «Decidido:» when they carry something.',
57
+ '',
58
+ ].join('\n');
59
+
60
+ /**
61
+ * The always-on body for a project with emoji off. Deterministic: the compass sentence of `suggest`
62
+ * is written with its words, any other glyph goes through `plain`, and the rule is appended. Applied
63
+ * twice it gives the same text.
64
+ */
65
+ export function noEmojiBody(body) {
66
+ const text = String(body);
67
+ if (text.includes(NO_EMOJI_RULE)) return text;
68
+ let out = text.replace(/\(\u{1F4CD}[^)]*\)/u, '(«Dónde estás:» · «Siguiente:», terminando en pregunta; «Hecho:» y «Decidido:» cuando hay algo hecho o decidido)');
69
+ for (const [glyph, word] of COMPASS) out = out.split(glyph).join(word);
70
+ return `${plain(out).replace(/\n*$/, '\n')}\n${NO_EMOJI_RULE}`;
71
+ }
@@ -18,6 +18,10 @@
18
18
  // read. Anything it cannot read with certainty (editor commit, -F file, --amend
19
19
  // --no-edit, an unparseable command) is ALLOWED: a guard that guesses is a guard that
20
20
  // gets turned off. Every deny names its recovery. Opt out with .rsc/.no-gitmoji.
21
+ //
22
+ // With .rsc/.no-emoji (`rsc emoji off`) the guard turns around: it no longer asks for a gitmoji and
23
+ // refuses an inline commit that carries one. It wins over .no-gitmoji: that file turns the convention
24
+ // off, not the ban on emoji.
21
25
  import { fileURLToPath } from 'node:url';
22
26
  import { existsSync, readFileSync, realpathSync } from 'node:fs';
23
27
  import { join } from 'node:path';
@@ -148,6 +152,8 @@ const RUNS_GIT = /^\s*(?:(?:sudo|env|command|exec|nohup)\s+|[A-Za-z_][A-Za-z0-9_
148
152
  // A commit handed to a shell as a string (`bash -c "git commit -m …"`, `eval …`) is read inside
149
153
  // that string (E2E defect 15). shell-unwrap.mjs is a sibling under `.rsc/`; without it, as before.
150
154
  const SH = await import(new URL('./shell-unwrap.mjs', import.meta.url)).catch(() => null);
155
+ // What counts as a symbol with emoji off lives in one place, a sibling (also read by the CLI output).
156
+ const EP = await import(new URL('./emoji-policy.mjs', import.meta.url)).catch(() => null);
151
157
 
152
158
  const SEPARATORS = /&&|\|\||[;\n]/;
153
159
 
@@ -168,25 +174,48 @@ function heredocBody(command) {
168
174
  }
169
175
 
170
176
  // -m/--message value, quoted or bare.
171
- function inlineMessage(segment) {
172
- const m = segment.match(/(?:^|\s)(?:-[a-zA-Z]*m|--message)(?:=|\s+)("([^"]*)"|'([^']*)'|([^\s'"][^\s]*))/);
173
- if (!m) return null;
174
- return m[2] ?? m[3] ?? m[4] ?? null;
177
+ // Every -m is a paragraph of the message; the first one is the subject. `full` joins them all.
178
+ function inlineMessage(segment, full) {
179
+ const found = [...segment.matchAll(/(?:^|\s)(?:-[a-zA-Z]*m|--message)(?:=|\s+)("([^"]*)"|'([^']*)'|([^\s'"][^\s]*))/g)]
180
+ .map((m) => m[2] ?? m[3] ?? m[4] ?? '');
181
+ if (!found.length) return null;
182
+ return full ? found.join('\n\n') : found[0];
175
183
  }
176
184
 
177
185
  // Every commit message this command would write, or null when nothing is checkable.
178
- export function commitMessages(command) {
186
+ // `full`: the whole message (every -m, the whole heredoc body) instead of its subject line. The emoji
187
+ // ban reads all of it; the gitmoji rule only ever judges the subject.
188
+ export function commitMessages(command, { full = false } = {}) {
179
189
  const cmd = String(command ?? '');
180
190
  if (!COMMIT.test(cmd)) return [];
181
191
  const inner = SH ? SH.innerScripts(cmd) : [];
182
- if (!inner.length) return directMessages(cmd);
192
+ if (!inner.length) return directMessages(cmd, full);
183
193
  // The wrapped strings are read on their own; the rest of the chain without them, so a commit is
184
194
  // never read twice (once naively through the quotes, once unwrapped).
185
195
  const rest = SH.segments(SH.withoutHeredocs(cmd)).filter((seg) => SH.unwrap(seg)?.inner === undefined).join('\n');
186
- return [...directMessages(rest), ...inner.flatMap(commitMessages)];
196
+ return [...directMessages(rest, full), ...inner.flatMap((c) => commitMessages(c, { full }))];
197
+ }
198
+
199
+ // Split a command line at && || ; and newlines, except inside quotes: a message with a body is one
200
+ // argument, and its blank lines are not the end of the command.
201
+ function commandSegments(cmd) {
202
+ const out = [];
203
+ let cur = '';
204
+ let quote = null;
205
+ for (let i = 0; i < cmd.length; i++) {
206
+ const ch = cmd[i];
207
+ if (quote) { if (ch === quote) quote = null; cur += ch; continue; }
208
+ if (ch === '"' || ch === "'") { quote = ch; cur += ch; continue; }
209
+ const two = cmd.slice(i, i + 2);
210
+ if (two === '&&' || two === '||') { out.push(cur); cur = ''; i++; continue; }
211
+ if (ch === ';' || ch === '\n') { out.push(cur); cur = ''; continue; }
212
+ cur += ch;
213
+ }
214
+ out.push(cur);
215
+ return out;
187
216
  }
188
217
 
189
- function directMessages(cmd) {
218
+ function directMessages(cmd, full) {
190
219
 
191
220
  // The heredoc form must be handled before any splitting: its body is the message and
192
221
  // may legitimately contain && or ;. The command that owns it is whatever runs just
@@ -198,13 +227,15 @@ function directMessages(cmd) {
198
227
  const body = heredocBody(cmd);
199
228
  if (body === null) return [];
200
229
  const first = body.split(/\r?\n/).find((l) => l.trim() !== '');
201
- return first === undefined ? [] : [first];
230
+ return first === undefined ? [] : [full ? body.replace(/^\s*\r?\n/, '') : first];
202
231
  }
203
232
 
204
233
  const out = [];
205
- for (const segment of cmd.split(SEPARATORS)) {
234
+ // Quote-aware only for the emoji ban (which reads whole messages); the gitmoji rule keeps the
235
+ // plain split it always had, so with emoji on every decision is the one it always was.
236
+ for (const segment of full ? commandSegments(cmd) : cmd.split(SEPARATORS)) {
206
237
  if (!readableCommit(segment)) continue;
207
- const msg = inlineMessage(segment);
238
+ const msg = inlineMessage(segment, full);
208
239
  if (msg === null) continue; // editor commit — cannot read it here
209
240
  if (/^\$/.test(msg.trim())) continue; // a variable/substitution, not a literal
210
241
  out.push(msg);
@@ -219,6 +250,20 @@ export const SUGGESTIONS = [
219
250
  ['perf', '⚡️'], ['chore', '🔧'], ['ci', '👷'], ['style', '🎨'], ['revert', '⏪️'],
220
251
  ];
221
252
 
253
+ // Any symbol or :shortcode: anywhere in the whole message — with emoji off, none may be there.
254
+ const SHORTCODE = /(?:^|\s):[a-z0-9_+-]{2,}:(?=\s|$)/m;
255
+ export const hasEmoji = (message) => (EP?.hasSymbol(message ?? '') ?? false) || SHORTCODE.test(String(message ?? ''));
256
+
257
+ export function denyEmojiMessage(message) {
258
+ const subject = String(message ?? '').split(/\r?\n/, 1)[0].trim();
259
+ const clean = (EP?.stripSymbols(subject) ?? subject).replace(/(?:^|\s):[a-z0-9_+-]{2,}:(?=\s|$)/g, ' ').replace(/\s+/g, ' ').trim();
260
+ return [
261
+ 'This commit message carries an emoji.',
262
+ 'Emoji are off in this project (.rsc/.no-emoji): a commit says what changed in words, as Conventional Commits does: type(scope): subject.',
263
+ `Recover: re-run the commit without the emoji or the :shortcode: — \`${clean || '<type>(<scope>): <subject>'}\`. To allow emoji again, run \`rsc emoji on\`.`,
264
+ ].join('\n');
265
+ }
266
+
222
267
  export function denyMessage(message) {
223
268
  const subject = String(message ?? '').split(/\r?\n/, 1)[0].trim();
224
269
  const type = subject.match(/^([a-zA-Z]+)(\([^)\n]*\))?!?:/)?.[1]?.toLowerCase();
@@ -266,7 +311,8 @@ if (isMainModule(import.meta.url)) {
266
311
  const root = process.argv[2] || process.cwd();
267
312
  const allow = () => process.exit(0);
268
313
 
269
- if (existsSync(join(root, '.rsc', '.no-gitmoji'))) allow();
314
+ const emojiOff = existsSync(join(root, '.rsc', '.no-emoji'));
315
+ if (!emojiOff && existsSync(join(root, '.rsc', '.no-gitmoji'))) allow();
270
316
 
271
317
  let input = {};
272
318
  try { input = JSON.parse(readFileSync(0, 'utf8') || '{}'); } catch { allow(); }
@@ -276,7 +322,7 @@ if (isMainModule(import.meta.url)) {
276
322
 
277
323
  let offender = null;
278
324
  try {
279
- offender = commitMessages(command).find((m) => !hasGitmoji(m)) ?? null;
325
+ offender = commitMessages(command, { full: emojiOff }).find((m) => (emojiOff ? hasEmoji(m) : !hasGitmoji(m))) ?? null;
280
326
  } catch { allow(); } // any parsing surprise → allow (fail open, by design)
281
327
  if (offender === null) allow();
282
328
 
@@ -284,7 +330,7 @@ if (isMainModule(import.meta.url)) {
284
330
  hookSpecificOutput: {
285
331
  hookEventName: 'PreToolUse',
286
332
  permissionDecision: 'deny',
287
- permissionDecisionReason: denyMessage(offender),
333
+ permissionDecisionReason: emojiOff ? denyEmojiMessage(offender) : denyMessage(offender),
288
334
  },
289
335
  }));
290
336
  process.exit(0);
@@ -54,6 +54,13 @@ export const KNOWLEDGE_BRANCH = 'rsc/knowledge';
54
54
  /** The subject of what `applyIncoming` commits: content that came FROM the exchange branch. */
55
55
  const SYNC_SUBJECT = `📥 docs(auto): sync desde ${KNOWLEDGE_BRANCH}`;
56
56
 
57
+ // `rsc emoji off` (.rsc/.no-emoji): rsc writes its commits and its messages without emoji. The detection
58
+ // of its own commits accepts both forms, so a project that turns emoji on or off mid-life still
59
+ // recognizes what it wrote before.
60
+ const tag = (root, glyph) => (existsSync(join(root, '.rsc', '.no-emoji')) ? '' : `${glyph} `);
61
+ const syncSubject = (root) => `${tag(root, '📥')}docs(auto): sync desde ${KNOWLEDGE_BRANCH}`;
62
+ const isSyncSubject = (subject) => subject === SYNC_SUBJECT || subject === SYNC_SUBJECT.slice(3);
63
+
57
64
  const STATE = 'knowledge-sync.json';
58
65
  const LOCK = 'knowledge-sync.lock';
59
66
  const FETCH_EVERY_MS = 60_000;
@@ -290,7 +297,7 @@ export function commitLocal(root, s) {
290
297
  // No [skip ci] HERE: this commit lands on the working branch, often as its newest commit, and the
291
298
  // next ordinary push of that branch would skip CI on main (E2E 2026-10-07). Only the copy on the
292
299
  // exchange branch carries it (see `ship`).
293
- const message = (names) => `📝 docs(auto): ${summary(names)}`;
300
+ const message = (names) => `${tag(root, '📝')}docs(auto): ${summary(names)}`;
294
301
  // Closed trunk, or code of the agent's still uncommitted: no commit of ours on the branch. The
295
302
  // snapshot goes up the same way and the files stay modified, to be committed WITH that work.
296
303
  if ((branch === defaultBranch(root) && trunkClosed(root)) || workPending(root)) {
@@ -351,7 +358,7 @@ export function queueCommitted(root, s) {
351
358
  const commits = git(root, ['rev-list', '--reverse', '--no-merges', '--first-parent', `${from}..${head}`, ...not, '--', ...KNOWLEDGE]).split('\n').filter(Boolean);
352
359
  for (const c of commits) {
353
360
  if (s.queue.includes(c) || s.ours.includes(c)) continue;
354
- if (line(root, ['log', '-1', '--format=%s', c]) === SYNC_SUBJECT) continue;
361
+ if (isSyncSubject(line(root, ['log', '-1', '--format=%s', c]))) continue;
355
362
  s.queue.push(c);
356
363
  }
357
364
  }
@@ -484,10 +491,10 @@ export function ship(root, s) {
484
491
  // A commit of somebody's own (code + docs) goes up as its knowledge part, under a message that
485
492
  // says so and carries [skip ci]: its own message would describe code that is not there, and
486
493
  // would run CI on the exchange branch.
487
- const ownAuto = /^📝 docs\(auto\):/.test(rest[0] || '');
494
+ const ownAuto = /^(?:📝 )?docs\(auto\):/.test(rest[0] || '');
488
495
  const body = ownAuto ? [`${rest[0].replace(SKIP_CI, '').trim()} ${SKIP_CI}`, ...rest.slice(1)]
489
496
  : rest.join('\n').includes(SKIP_CI) ? rest : [
490
- `📝 docs(auto): ${summary(zlist(git(root, ['diff-tree', '--no-commit-id', '--name-only', '-r', '-z', sha, '--', ...KNOWLEDGE])).filter(isKnowledge))} ${SKIP_CI}`,
497
+ `${tag(root, '📝')}docs(auto): ${summary(zlist(git(root, ['diff-tree', '--no-commit-id', '--name-only', '-r', '-z', sha, '--', ...KNOWLEDGE])).filter(isKnowledge))} ${SKIP_CI}`,
491
498
  '', `Desde: ${rest[0] || sha.slice(0, 7)}`];
492
499
  base = git(root, ['commit-tree', tree, '-p', base, '-F', '-'], {
493
500
  input: body.join('\n'),
@@ -571,7 +578,7 @@ export function applyIncoming(root, s) {
571
578
  s.waiting[branch] = tip;
572
579
  const pending = know.filter((f) => worktreeBlob(root, f) !== blob(root, tip, f));
573
580
  if (!pending.length) return said;
574
- said.push(`📥 Hay cambios de conocimiento en ${KNOWLEDGE_BRANCH} (${byAuthor(root, pending, touchedBy, s.ours)}). ` +
581
+ said.push(`${tag(root, '📥')}Hay cambios de conocimiento en ${KNOWLEDGE_BRANCH} (${byAuthor(root, pending, touchedBy, s.ours)}). ` +
575
582
  `En ${branch} (cerrada) no los escribo, porque bloquearían tu próximo git pull: llegan con el pull ` +
576
583
  'cuando se fusionen, o a la rama que abras en su primer mensaje. ' +
577
584
  `Para leer uno ya: git show origin/${KNOWLEDGE_BRANCH}:<fichero>.`);
@@ -600,8 +607,8 @@ export function applyIncoming(root, s) {
600
607
  const present = take.filter((f) => blob(root, tip, f));
601
608
  if (present.length) git(root, ['--literal-pathspecs', 'checkout', tip, '--', ...present]);
602
609
  if (gone.length) git(root, ['--literal-pathspecs', 'rm', '--quiet', '--', ...gone]);
603
- git(root, ['--literal-pathspecs', 'commit', '--quiet', '--no-verify', '--only', '-m', SYNC_SUBJECT, '--', ...take]);
604
- said.push(`📥 Traídos ${take.length} fichero(s) de conocimiento (${byAuthor(root, take, touchedBy, s.ours)}).`);
610
+ git(root, ['--literal-pathspecs', 'commit', '--quiet', '--no-verify', '--only', '-m', syncSubject(root), '--', ...take]);
611
+ said.push(`${tag(root, '📥')}Traídos ${take.length} fichero(s) de conocimiento (${byAuthor(root, take, touchedBy, s.ours)}).`);
605
612
  }
606
613
  if (clash.length) {
607
614
  const who = authorsOf(root, [...new Set(clash.flatMap(touchedBy))].filter((c) => !s.ours.includes(c)));
@@ -626,7 +633,7 @@ export function applyIncoming(root, s) {
626
633
  // carries docs. The checkout is not touched, so the closed main stays clean and the next pull works.
627
634
 
628
635
  export const FTD_CLOSE_OPT_OUT = '.no-ftd-close';
629
- const CLOSE_SUBJECT = '📝 docs(auto): cierre FTD';
636
+ const closeSubject = (root) => `${tag(root, '📝')}docs(auto): cierre FTD`;
630
637
  /** Trailer of a close: `Cierra: <blob it replaces> <path>`, so a teammate's branch takes it (applyIncoming). */
631
638
  const CLOSES = 'Cierra:';
632
639
  const isFtdDoc = (p) => /^02-DOCS\/wiki\/ftd\/[^/]+\.md$/.test(p);
@@ -755,7 +762,7 @@ function closuresFor(root, orig, head, def, read) {
755
762
  if (owner && owner !== name) continue;
756
763
  if (!owner) {
757
764
  const own = (line(root, ['log', '--no-merges', '--format=%s', `${base}..${tip}`, '--', f]) || '').split('\n').filter(Boolean);
758
- if (!own.some((s) => s !== SYNC_SUBJECT)) continue;
765
+ if (!own.some((s) => !isSyncSubject(s))) continue;
759
766
  }
760
767
  landing ||= landingOf(root, orig, head, tip);
761
768
  const created = (line(root, ['log', '--diff-filter=A', '--format=%an', tip, '--', f]) || '').split('\n').filter(Boolean).pop();
@@ -825,7 +832,7 @@ export function closeLanded(root, { spawnShip = true } = {}) {
825
832
  trailers.push(`${CLOSES} ${blob(root, 'HEAD', f)} ${f}`);
826
833
  }
827
834
  const tree = line(root, ['write-tree'], { env });
828
- sha = git(root, ['commit-tree', tree, '-p', head, '-F', '-'], { input: `${CLOSE_SUBJECT}: ${summary(files)}\n\n${trailers.join('\n')}\n` }).trim();
835
+ sha = git(root, ['commit-tree', tree, '-p', head, '-F', '-'], { input: `${closeSubject(root)}: ${summary(files)}\n\n${trailers.join('\n')}\n` }).trim();
829
836
  } finally {
830
837
  try { unlinkSync(env.GIT_INDEX_FILE); } catch { /* never created */ }
831
838
  }
@@ -833,7 +840,7 @@ export function closeLanded(root, { spawnShip = true } = {}) {
833
840
  if (open) {
834
841
  // Open: it lands here like any docs(auto) commit — HEAD moves only if nobody moved it meanwhile,
835
842
  // then the index and the files follow, for these paths only.
836
- git(root, ['update-ref', '-m', `rsc: ${CLOSE_SUBJECT}`, 'HEAD', sha, head]);
843
+ git(root, ['update-ref', '-m', `rsc: ${closeSubject(root)}`, 'HEAD', sha, head]);
837
844
  for (const [f, text] of docs) writeFileSync(join(root, f), text);
838
845
  git(root, ['--literal-pathspecs', 'update-index', '--', ...files]);
839
846
  return { closed: files, via: 'local' };
@@ -881,7 +888,7 @@ function fetchDown(root, timeout) {
881
888
  return false;
882
889
  }
883
890
 
884
- const ANNOUNCE = '🔄 La sincronización del conocimiento está activa: lo que cambies en 01-TOOLS/, 02-DOCS/wiki/ ' +
891
+ const announcement = (root) => `${tag(root, '🔄')}La sincronización del conocimiento está activa: lo que cambies en 01-TOOLS/, 02-DOCS/wiki/ ` +
885
892
  `y 02-DOCS/attachments/ viaja a tu equipo por la rama ${KNOWLEDGE_BRANCH} (nunca a la principal; allí con ` +
886
893
  '[skip ci]) y lo de los demás te llega a tu rama de trabajo. Llega a la principal dentro de vuestras PRs. ' +
887
894
  'Para apagarla en este proyecto: `rsc knowledge-sync off`.';
@@ -899,7 +906,7 @@ export function onRequest(root, { spawnFetch = true } = {}) {
899
906
  const said = locked(root, (s) => {
900
907
  const out = [];
901
908
  if (fresh) s.lastFetch = Date.now();
902
- if (!s.announced) { out.push(ANNOUNCE); s.announced = true; }
909
+ if (!s.announced) { out.push(announcement(root)); s.announced = true; }
903
910
  try { out.push(...applyIncoming(root, s)); } catch (e) { out.push(`La sincronización del conocimiento falló al traer cambios: ${clean(e.message, 160)}`); }
904
911
  try { out.push(...openNotices(root, s)); } catch { out.push(...s.notices); }
905
912
  s.notices = [];
@@ -23,6 +23,7 @@ export const PROJECT_OPT_OUTS = [
23
23
  'claudemd-check', // the root CLAUDE.md context budget
24
24
  'copy-guard', // the Stop hook that enforces the project's banned phrases in delivered copy
25
25
  'danger-guard', // foot-gun denial, keyed to the committed user profile
26
+ 'emoji', // «no emoji»: no reply, commit or message of rsc carries one, for the whole team
26
27
  'feature-gate', // per-turn re-injection of the SDD gate
27
28
  'ftd-close', // a landed branch's feature documents marked done by the post-merge hook
28
29
  'ftd-nudge', // once-per-session reminder: code changed and no feature document yet
@@ -196,7 +196,7 @@ function fingerprintFiles(worktree, files) {
196
196
 
197
197
  // `📥 docs(auto): sync desde rsc/knowledge` — written by knowledge-sync.mjs when it imports the team's
198
198
  // documents. Authored locally, but its content is other people's.
199
- const KNOWLEDGE_IMPORT = /^\S*\s*docs\(auto\): sync desde /u;
199
+ export const KNOWLEDGE_IMPORT = /^(?:\S+\s+)?docs\(auto\): sync desde /u;
200
200
 
201
201
  // Where the agent is — branch and worktree — and nothing else: two processes, not a full snapshot.
202
202
  function position(cwd) {
@@ -49,7 +49,13 @@ function auditDue() {
49
49
  }
50
50
 
51
51
  if (emitBody) {
52
- try { process.stdout.write(readFileSync(suggestMd, 'utf8')); } catch { /* missing → emit nothing */ }
52
+ try {
53
+ const body = readFileSync(suggestMd, 'utf8');
54
+ // `rsc emoji off`: the body closes in words and carries the rule. A sibling under `.rsc/`; if it is
55
+ // missing the body goes out as it is (fail open: startup is never worth breaking for this).
56
+ const E = has('.rsc', '.no-emoji') ? await import('./emoji-policy.mjs').catch(() => null) : null;
57
+ process.stdout.write(E ? E.noEmojiBody(body) : body);
58
+ } catch { /* missing → emit nothing */ }
53
59
  }
54
60
 
55
61
  // De-dup above only works when EVERY wired scope runs an updated hook. A scope left behind keeps
@@ -137,7 +137,7 @@ function mergesIntoTrunk(segment) {
137
137
  if (!parking && !judged.some((s) => TRUNK.test(s) || mergesIntoTrunk(s))) allow();
138
138
 
139
139
  // Commits in a range that are the person's: rsc's own knowledge commits are left out.
140
- const RSC_OWN = /^(?:📥|📝) docs\(auto\)/u;
140
+ const RSC_OWN = /^(?:(?:📥|📝) )?docs\(auto\)/u;
141
141
  function ownCommits(range) {
142
142
  const log = git('log', '--format=%s', range);
143
143
  if (log === null) return null;