mirror of
https://github.com/garrytan/gstack.git
synced 2026-08-04 21:38:36 +02:00
feat: add Confusion Protocol to preamble resolver
Injects a high-stakes ambiguity gate at preamble tier >= 2 so all workflow skills get it. Fires when Claude encounters architectural decisions, data model changes, destructive operations, or contradictory requirements. Does NOT fire on routine coding. Addresses Karpathy failure mode #1 (wrong assumptions) with an inline STOP gate instead of relying on workflow skill invocation. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c6e6a21d1a
commit
76f50c1843
@@ -426,6 +426,21 @@ Use AskUserQuestion:
|
|||||||
- Note in output: "Pre-existing test failure skipped: <test-name>"`;
|
- Note in output: "Pre-existing test failure skipped: <test-name>"`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateConfusionProtocol(): string {
|
||||||
|
return `## Confusion Protocol
|
||||||
|
|
||||||
|
When you encounter high-stakes ambiguity during coding:
|
||||||
|
- Two plausible architectures or data models for the same requirement
|
||||||
|
- A request that contradicts existing patterns and you're unsure which to follow
|
||||||
|
- A destructive operation where the scope is unclear
|
||||||
|
- Missing context that would change your approach significantly
|
||||||
|
|
||||||
|
STOP. Name the ambiguity in one sentence. Present 2-3 options with tradeoffs.
|
||||||
|
Ask the user. Do not guess on architectural or data model decisions.
|
||||||
|
|
||||||
|
This does NOT apply to routine coding, small features, or obvious changes.`;
|
||||||
|
}
|
||||||
|
|
||||||
function generateSearchBeforeBuildingSection(ctx: TemplateContext): string {
|
function generateSearchBeforeBuildingSection(ctx: TemplateContext): string {
|
||||||
return `## Search Before Building
|
return `## Search Before Building
|
||||||
|
|
||||||
@@ -731,7 +746,7 @@ export function generatePreamble(ctx: TemplateContext): string {
|
|||||||
generateVendoringDeprecation(ctx),
|
generateVendoringDeprecation(ctx),
|
||||||
generateSpawnedSessionCheck(),
|
generateSpawnedSessionCheck(),
|
||||||
generateVoiceDirective(tier),
|
generateVoiceDirective(tier),
|
||||||
...(tier >= 2 ? [generateContextRecovery(ctx), generateAskUserFormat(ctx), generateCompletenessSection()] : []),
|
...(tier >= 2 ? [generateContextRecovery(ctx), generateAskUserFormat(ctx), generateCompletenessSection(), generateConfusionProtocol()] : []),
|
||||||
...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []),
|
...(tier >= 3 ? [generateRepoModeSection(), generateSearchBeforeBuildingSection(ctx)] : []),
|
||||||
generateCompletionStatus(ctx),
|
generateCompletionStatus(ctx),
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user