mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-12 06:06:37 +03:00
chore(skill): slim per-event carbonize reminders
Previous hardening emitted a 7-line todo array and a 10-line ASCII-bar stderr banner on every accept event, both printed to the agent's transcript. Per-event overhead added up fast on multi-variant sessions. Keep the three-layer defence but shrink the per-event noise: - todo is now a single string: "REQUIRED before next poll: carbonize cleanup in FILE. See reference/live.md ..." - stderr is one line with the same pointer. - reference/live.md keeps the full five-step checklist (loaded once per session, so its verbosity is a fixed cost — no repetition tax). Attention signal still triple-redundant: stdout todo, stderr line, reference section.
This commit is contained in:
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
@@ -79,20 +79,11 @@ Output (JSON):
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, carbonize: false, ...result }));
|
||||
} else {
|
||||
const result = handleAccept(id, variantNum, lines, targetFile);
|
||||
// When carbonize is needed, emit an explicit todo in the payload so the
|
||||
// agent can't miss it. The five steps are mirrored from reference/live.md
|
||||
// "Required after accept" and are intentionally verbose: past runs skipped
|
||||
// cleanup when the instruction was a single bullet.
|
||||
// Single-line attention-grabber when cleanup is required. The full
|
||||
// five-step checklist lives in reference/live.md (loaded once per
|
||||
// session); repeating it per-event would waste tokens.
|
||||
if (result.carbonize) {
|
||||
result.todo = [
|
||||
'REQUIRED before next poll: post-accept carbonize cleanup.',
|
||||
'1. Move the inline <style data-impeccable-css="' + id + '"> rules into the project stylesheet.',
|
||||
'2. Rewrite @scope ([data-impeccable-variant="N"]) selectors to use the element\'s real classes.',
|
||||
'3. Drop the <div data-impeccable-variant="N" style="display: contents"> wrapper around the accepted content.',
|
||||
'4. Delete the <!-- impeccable-carbonize-start/end --> marker comments and the inline <style> block.',
|
||||
'5. Remove any @scope blocks for variants other than the accepted one (dead code).',
|
||||
'See reference/live.md "Required after accept" for the full checklist.',
|
||||
];
|
||||
result.todo = 'REQUIRED before next poll: carbonize cleanup in ' + relFile + '. See reference/live.md "Required after accept".';
|
||||
}
|
||||
console.log(JSON.stringify({ handled: true, file: relFile, ...result }));
|
||||
}
|
||||
|
||||
@@ -156,24 +156,11 @@ Options:
|
||||
}
|
||||
}
|
||||
|
||||
// Loud stderr banner so the agent sees the cleanup requirement even if
|
||||
// it parses stdout JSON and ignores nested fields. carbonize: true means
|
||||
// the accepted variant was stitched in with helper markers + inline CSS
|
||||
// that must be cleaned up before the next poll — see reference/live.md
|
||||
// "Required after accept".
|
||||
// Second signal path: stderr banner in case the agent parses stdout
|
||||
// JSON but skips nested fields. One line is enough — the full checklist
|
||||
// is in reference/live.md.
|
||||
if (event._acceptResult?.carbonize === true) {
|
||||
process.stderr.write(
|
||||
'\n' +
|
||||
'========================================================================\n' +
|
||||
' REQUIRED: post-accept carbonize cleanup before the next poll.\n' +
|
||||
' 1. Move inline <style> rules into the project stylesheet.\n' +
|
||||
' 2. Rewrite @scope ([data-impeccable-variant]) to real classes.\n' +
|
||||
' 3. Drop the <div data-impeccable-variant> wrapper.\n' +
|
||||
' 4. Delete impeccable-carbonize-start/end marker comments.\n' +
|
||||
' 5. Drop @scope blocks for unaccepted variants.\n' +
|
||||
' Full checklist: reference/live.md, "Required after accept".\n' +
|
||||
'========================================================================\n\n'
|
||||
);
|
||||
process.stderr.write('\n⚠ Carbonize cleanup REQUIRED before next poll. See reference/live.md "Required after accept".\n\n');
|
||||
}
|
||||
|
||||
// Print the event as JSON — the agent reads this from stdout
|
||||
|
||||
Reference in New Issue
Block a user