sneakoscope 6.1.2 → 6.2.0

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.
Files changed (64) hide show
  1. package/README.md +11 -4
  2. package/crates/sks-core/Cargo.lock +1 -1
  3. package/crates/sks-core/Cargo.toml +1 -1
  4. package/dist/cli/install-helpers.js +8 -3
  5. package/dist/config/skills-manifest.json +58 -58
  6. package/dist/core/agents/agent-effort-policy.js +28 -17
  7. package/dist/core/agents/agent-schema.js +1 -1
  8. package/dist/core/codex/codex-config-guard.js +178 -7
  9. package/dist/core/codex/codex-config-readability.js +21 -8
  10. package/dist/core/codex/codex-config-toml.js +14 -11
  11. package/dist/core/codex-app/mcp-manager.js +679 -0
  12. package/dist/core/codex-app/sks-menubar.js +405 -6
  13. package/dist/core/codex-control/codex-lb-launch-recovery.js +15 -0
  14. package/dist/core/codex-native/core-skill-manifest.js +1 -1
  15. package/dist/core/commands/mad-sks-command.js +44 -3
  16. package/dist/core/commands/menubar-command.js +94 -0
  17. package/dist/core/commands/naruto-command.js +3 -1
  18. package/dist/core/commands/wiki-command.js +11 -5
  19. package/dist/core/fsx.js +1 -0
  20. package/dist/core/hooks-runtime/code-pack-freshness-preflight.js +14 -8
  21. package/dist/core/hooks-runtime/naruto-decision-gate.js +184 -0
  22. package/dist/core/hooks-runtime/stop-repeat-guard.js +89 -0
  23. package/dist/core/hooks-runtime.js +36 -105
  24. package/dist/core/init/skills.js +4 -4
  25. package/dist/core/init.js +1 -1
  26. package/dist/core/managed-assets/managed-assets-manifest.js +178 -29
  27. package/dist/core/preflight/parallel-preflight-engine.js +16 -3
  28. package/dist/core/proof/route-adapter.js +1 -1
  29. package/dist/core/proof/selftest-proof-fixtures.js +3 -5
  30. package/dist/core/provider/model-router.js +15 -6
  31. package/dist/core/release/package-size-budget.js +4 -6
  32. package/dist/core/research/research-plan-markdown.js +123 -0
  33. package/dist/core/research/research-super-search.js +8 -4
  34. package/dist/core/research.js +4 -119
  35. package/dist/core/retention.js +70 -2
  36. package/dist/core/routes/dollar-manifest-lite.js +1 -1
  37. package/dist/core/routes.js +75 -22
  38. package/dist/core/subagents/agent-catalog.js +87 -15
  39. package/dist/core/subagents/model-policy.js +189 -48
  40. package/dist/core/subagents/naruto-help-contract.js +11 -4
  41. package/dist/core/subagents/official-subagent-preparation.js +55 -9
  42. package/dist/core/subagents/official-subagent-prompt.js +45 -23
  43. package/dist/core/subagents/thread-budget.js +1 -1
  44. package/dist/core/subagents/triwiki-attention.js +117 -14
  45. package/dist/core/triwiki/code-pack-head-freshness.js +291 -0
  46. package/dist/core/version.js +1 -1
  47. package/dist/core/zellij/zellij-launcher.js +12 -2
  48. package/dist/core/zellij/zellij-pane-proof.js +9 -1
  49. package/dist/core/zellij/zellij-update.js +14 -1
  50. package/dist/scripts/canonical-test-runner.js +7 -1
  51. package/dist/scripts/codex-lb-fast-mode-truth-check.js +11 -1
  52. package/dist/scripts/codex-lb-fast-ui-preservation-check.js +9 -2
  53. package/dist/scripts/codex-lb-gpt56-fast-profile-check.js +13 -2
  54. package/dist/scripts/codex-native-agent-role-content-check.js +13 -1
  55. package/dist/scripts/codex-sdk-backend-router-check.js +2 -0
  56. package/dist/scripts/lib/codex-sdk-gate-lib.js +4 -0
  57. package/dist/scripts/official-subagent-workflow-check.js +1 -1
  58. package/dist/scripts/packlist-performance-check.js +1 -18
  59. package/dist/scripts/python-codex-sdk-all-pipelines-check.js +8 -0
  60. package/dist/scripts/sks-menubar-install-check.js +6 -1
  61. package/dist/scripts/super-search-provider-interface-check.js +31 -18
  62. package/package.json +3 -1
  63. package/dist/scripts/codex-0139-feature-probes-check.js +0 -30
  64. package/dist/scripts/codex-0139-marketplace-source-check.js +0 -13
@@ -12,7 +12,6 @@ import { localizedFinalizationReason } from './language-preference.js';
12
12
  import { classifyToolError } from './evaluation.js';
13
13
  import { dollarCommand, routeRequiresSubagents, stripVisibleDecisionAnswerBlocks } from './routes.js';
14
14
  import { leanEngineeringCompactText } from './lean-engineering-policy.js';
15
- import { appendMissionStatus } from './recallpulse.js';
16
15
  import { scanAgentTextForRecursion } from './agents/agent-recursion-guard.js';
17
16
  import { evaluateLoopContinuation } from './loops/loop-continuation-enforcer.js';
18
17
  import { diagnosticPromptAllowedDuringNoQuestions } from './routes/diagnostic-allowlist.js';
@@ -22,6 +21,8 @@ import { codePackFreshnessNote } from './hooks-runtime/code-pack-freshness-prefl
22
21
  import { claimHookInvocation } from './hooks-runtime/hook-invocation-dedupe.js';
23
22
  import { joinSystemMessages, teamLiveDigest } from './hooks-runtime/team-digest.js';
24
23
  import { armLightTurnStopBypass, clearLightTurnStopBypass, consumeLightTurnStopBypass, hasMatchingLightTurnStopBypass } from './hooks-runtime/light-turn.js';
24
+ import { evaluateHookNarutoDecisionGate, looksLikeActiveContinuationPrompt } from './hooks-runtime/naruto-decision-gate.js';
25
+ import { finalizationRepeatDecision } from './hooks-runtime/stop-repeat-guard.js';
25
26
  import { classifyTaskProfile } from './runtime/task-profile.js';
26
27
  import { resolveSubagentThreadBudget } from './subagents/thread-budget.js';
27
28
  import { readOfficialSubagentConfig } from './subagents/official-subagent-config.js';
@@ -30,12 +31,8 @@ import { NARUTO_PARENT_EFFORT, NARUTO_PARENT_MODEL } from './subagents/model-pol
30
31
  import { officialSubagentRolePlan } from './subagents/agent-catalog.js';
31
32
  import { recordOfficialSubagentParentOutcomesTelemetry, recordOfficialSubagentZellijTelemetry } from './zellij/zellij-official-subagent-telemetry.js';
32
33
  import { bindTrustworthySubagentParentSummaryToRun, normalizeSubagentParentSummary, persistOrReuseTrustworthySubagentParentSummary, readSubagentEvents, recordSubagentEvent, SUBAGENT_EVIDENCE_FILENAME, SUBAGENT_PARENT_SUMMARY_FILENAME, writeSubagentEvidence } from './subagents/subagent-evidence.js';
33
- const STOP_REPEAT_GUARD_ARTIFACT = 'stop-hook-repeat-guard.json';
34
34
  const LIGHT_ROUTE_STOP_ARTIFACT = 'light-route-stop.json';
35
35
  const CODEX_GIT_ACTION_STOP_ARTIFACT = 'codex-git-action-stop-bypass.json';
36
- const STOP_REPEAT_GUARD_WINDOW_MS = 10 * 60 * 1000;
37
- const STOP_REPEAT_GUARD_MAX_ENTRIES = 25;
38
- const DEFAULT_STOP_REPEAT_GUARD_LIMIT = 2;
39
36
  const CODEX_GIT_ACTION_STOP_TTL_MS = 15 * 60 * 1000;
40
37
  const UPDATE_CHECK_HOOK_INVOCATION_POLICY = 'function-only:no-runSksUpdateCheck-call-in-hooks';
41
38
  // Update checks stay function-only in hooks: the policy marker above is checked
@@ -100,22 +97,32 @@ export async function evaluateHookPayload(name, payload = {}, opts = {}) {
100
97
  const loadedState = opts.state || await loadState(root, payload);
101
98
  const state = { ...loadedState, _session_key: loadedState?._session_key || sessionKey };
102
99
  const noQuestion = isNoQuestionRunning(state);
100
+ const sksNarutoDecision = await evaluateHookNarutoDecisionGate({
101
+ root,
102
+ name,
103
+ payload,
104
+ state,
105
+ sessionKey,
106
+ noQuestion,
107
+ parentLaunchMissionId: activeNarutoParentLaunchMissionId()
108
+ });
109
+ const withNarutoDecision = (result) => ({ ...result, sksNarutoDecision });
103
110
  if (name === 'user-prompt-submit') {
104
- return hookUserPrompt(root, state, payload, noQuestion, sessionKey);
111
+ return withNarutoDecision(await hookUserPrompt(root, state, payload, noQuestion, sessionKey));
105
112
  }
106
113
  if (name === 'pre-tool')
107
- return hookPreTool(root, state, payload, noQuestion, sessionKey);
114
+ return withNarutoDecision(await hookPreTool(root, state, payload, noQuestion, sessionKey));
108
115
  if (name === 'post-tool')
109
- return hookPostTool(root, state, payload, noQuestion, sessionKey);
116
+ return withNarutoDecision(await hookPostTool(root, state, payload, noQuestion, sessionKey));
110
117
  if (name === 'permission-request')
111
- return hookPermission(root, state, payload, noQuestion, sessionKey);
118
+ return withNarutoDecision(await hookPermission(root, state, payload, noQuestion, sessionKey));
112
119
  if (name === 'stop')
113
- return hookStop(root, state, payload, noQuestion, sessionKey);
120
+ return withNarutoDecision(await hookStop(root, state, payload, noQuestion, sessionKey));
114
121
  if (name === 'subagent-start')
115
- return hookSubagentStart(root, state, payload, sessionKey);
122
+ return withNarutoDecision(await hookSubagentStart(root, state, payload, sessionKey));
116
123
  if (name === 'subagent-stop')
117
- return hookSubagentStop(root, state, payload, sessionKey);
118
- return { continue: true };
124
+ return withNarutoDecision(await hookSubagentStop(root, state, payload, sessionKey));
125
+ return withNarutoDecision({ continue: true });
119
126
  }
120
127
  async function hookSubagentStart(root, state, payload = {}, sessionKey = null) {
121
128
  const artifactDir = officialSubagentArtifactDir(root, state, sessionKey);
@@ -166,6 +173,16 @@ async function recordAndRefreshSubagentEvidence(root, artifactDir, state, payloa
166
173
  }, async () => {
167
174
  const plan = await readJson(path.join(artifactDir, 'subagent-plan.json'), {});
168
175
  const workflowRunId = String(plan?.workflow_run_id || state?.official_subagent_run_id || '').trim();
176
+ const terminalGate = plan?.workflow === 'official_codex_subagent'
177
+ ? await readJson(path.join(artifactDir, 'naruto-gate.json'), null).catch(() => null)
178
+ : null;
179
+ const terminalRunId = String(terminalGate?.workflow_run_id || '').trim();
180
+ if (workflowRunId
181
+ && terminalRunId === workflowRunId
182
+ && terminalGate?.passed === true
183
+ && terminalGate?.terminal === true) {
184
+ return null;
185
+ }
169
186
  const eventPayload = workflowRunId && payload && typeof payload === 'object' && !Array.isArray(payload)
170
187
  ? { ...payload, workflow_run_id: workflowRunId }
171
188
  : payload;
@@ -249,9 +266,7 @@ async function hookUserPrompt(root, state, payload, noQuestion, sessionKey = nul
249
266
  })
250
267
  };
251
268
  }
252
- const parentLaunchMissionId = process.env.SKS_NARUTO_PARENT_LAUNCH === '1'
253
- ? String(process.env.SKS_NARUTO_PARENT_MISSION_ID || '').trim()
254
- : '';
269
+ const parentLaunchMissionId = activeNarutoParentLaunchMissionId();
255
270
  if (parentLaunchMissionId) {
256
271
  const attachedState = {
257
272
  ...state,
@@ -414,15 +429,6 @@ function shouldPrepareFreshRouteOnActivePrompt(prompt, route = null, opts = {})
414
429
  return false;
415
430
  return routeRequiresSubagents(route, prompt);
416
431
  }
417
- function looksLikeActiveContinuationPrompt(prompt = '') {
418
- const text = stripVisibleDecisionAnswerBlocks(String(prompt || ''))
419
- .trim()
420
- .replace(/[.!?。!?…,:;]+$/u, '')
421
- .trim();
422
- if (!text)
423
- return false;
424
- return /^(?:(?:please\s+)?(?:keep\s+going|continue|resume|go\s+on|proceed|carry\s+on)(?:\s+please)?|계속(?:\s*진행)?(?:\s*해\s*줘|\s*해주세요|\s*해)?|이어\s*서(?:\s*해\s*줘|\s*해주세요|\s*진행해)?|이어서(?:\s*해\s*줘|\s*해주세요|\s*진행해)?|진행(?:\s*해\s*줘|\s*해주세요|\s*해)?|마저\s*해(?:\s*줘|\s*주세요)?|다음|next)$/i.test(text);
425
- }
426
432
  function isClarificationAwaiting(state = {}) {
427
433
  const phase = String(state.phase || '');
428
434
  const stopGate = String(state.stop_gate || '');
@@ -435,6 +441,11 @@ function isClarificationAwaiting(state = {}) {
435
441
  return false;
436
442
  return Boolean(state.clarification_required || state.implementation_allowed === false);
437
443
  }
444
+ function activeNarutoParentLaunchMissionId() {
445
+ return process.env.SKS_NARUTO_PARENT_LAUNCH === '1'
446
+ ? String(process.env.SKS_NARUTO_PARENT_MISSION_ID || '').trim()
447
+ : '';
448
+ }
438
449
  function isBlockingClarificationAwaiting(state = {}) {
439
450
  return isClarificationAwaiting(state);
440
451
  }
@@ -999,86 +1010,6 @@ async function consumeCodexGitActionStopBypass(root, payload = {}) {
999
1010
  }).catch(() => null);
1000
1011
  return true;
1001
1012
  }
1002
- async function finalizationRepeatDecision(root, state = {}, payload = {}, reason = '', kind = 'finalization') {
1003
- const now = nowIso();
1004
- const guardPath = path.join(root, '.sneakoscope', 'state', STOP_REPEAT_GUARD_ARTIFACT);
1005
- const previous = await readJson(guardPath, {}).catch(() => ({}));
1006
- const limit = stopRepeatGuardLimit();
1007
- const entries = pruneStopRepeatEntries(previous.entries || {}, now);
1008
- const key = stopRepeatKey(state, payload, reason, kind);
1009
- const prior = entries[key] || {};
1010
- const repeatCount = stopRepeatInWindow(prior, now)
1011
- ? Number(prior.repeat_count || 0) + 1
1012
- : 1;
1013
- const record = {
1014
- schema_version: 1,
1015
- updated_at: now,
1016
- window_ms: STOP_REPEAT_GUARD_WINDOW_MS,
1017
- limit,
1018
- entries: {
1019
- ...entries,
1020
- [key]: {
1021
- kind,
1022
- route: state.route_command || state.route || state.mode || null,
1023
- mission_id: state.mission_id || null,
1024
- conversation_id: conversationId(payload),
1025
- first_seen: stopRepeatInWindow(prior, now) ? (prior.first_seen || now) : now,
1026
- last_seen: now,
1027
- repeat_count: repeatCount,
1028
- tripped: repeatCount >= limit,
1029
- reason
1030
- }
1031
- }
1032
- };
1033
- await writeJsonAtomic(guardPath, record).catch(() => null);
1034
- if (state.mission_id) {
1035
- await appendMissionStatus(root, state.mission_id, {
1036
- category: repeatCount >= limit ? 'warning' : 'blocker',
1037
- audience: ['user', 'route', 'final-summary'],
1038
- stage_id: 'before_final',
1039
- message: repeatCount >= limit
1040
- ? `Repeated ${kind} stop prompt was suppressed; route completion is still unclaimed until evidence passes.`
1041
- : reason,
1042
- dedupe_key: key,
1043
- evidence: [STOP_REPEAT_GUARD_ARTIFACT]
1044
- }).catch(() => null);
1045
- }
1046
- if (repeatCount < limit)
1047
- return null;
1048
- return {
1049
- continue: true,
1050
- systemMessage: `SKS stop hook repeat guard suppressed repeated ${kind} prompt after ${repeatCount} identical block(s). No completion success is claimed by the hook.`
1051
- };
1052
- }
1053
- function stopRepeatKey(state = {}, payload = {}, reason = '', kind = '') {
1054
- return sha256(JSON.stringify({
1055
- kind,
1056
- reason,
1057
- conversation_id: conversationId(payload),
1058
- mission_id: state.mission_id || null,
1059
- route: state.route_command || state.route || state.mode || null,
1060
- gate: state.stop_gate || null
1061
- })).slice(0, 24);
1062
- }
1063
- function stopRepeatGuardLimit() {
1064
- const raw = Number.parseInt(process.env.SKS_STOP_REPEAT_GUARD_LIMIT || '', 10);
1065
- if (!Number.isFinite(raw))
1066
- return DEFAULT_STOP_REPEAT_GUARD_LIMIT;
1067
- return Math.max(1, Math.min(20, raw));
1068
- }
1069
- function stopRepeatInWindow(entry = {}, now = nowIso()) {
1070
- const last = Date.parse(entry.last_seen || '');
1071
- const current = Date.parse(now);
1072
- if (!Number.isFinite(last) || !Number.isFinite(current))
1073
- return false;
1074
- return current - last <= STOP_REPEAT_GUARD_WINDOW_MS;
1075
- }
1076
- function pruneStopRepeatEntries(entries = {}, now = nowIso()) {
1077
- return Object.fromEntries(Object.entries(entries)
1078
- .filter(([, entry]) => stopRepeatInWindow(entry, now))
1079
- .sort((a, b) => Date.parse(b[1]?.last_seen || '') - Date.parse(a[1]?.last_seen || ''))
1080
- .slice(0, STOP_REPEAT_GUARD_MAX_ENTRIES));
1081
- }
1082
1013
  function hasHonestMode(text) {
1083
1014
  const s = String(text || '');
1084
1015
  return /(SKS Honest Mode|솔직모드|Honest Mode)/i.test(s)
@@ -34,7 +34,7 @@ async function installOfficialSkills(root) {
34
34
  'sks': `---\nname: sks\ndescription: General Sneakoscope Codex command route for $SKS or $sks usage, setup, status, and workflow help.\n---\n\nUse local SKS commands: bootstrap, deps, commands, quickstart, codex-app, context7, guard, conflicts, reasoning, wiki, pipeline status, pipeline plan, skill-dream. Promote code-changing work to Team unless Answer/DFix/Help/Wiki/safety route fits. Surface route/guard/scope, use TriWiki, do not edit installed harness files outside this engine repo, and require human-approved conflict cleanup. ${skillDreamPolicyText()}\n`,
35
35
  'plan': `---\nname: plan\ndescription: Plan scaffold only - writes a fixed-template .sneakoscope/plans/<slug>.md, never touches code. Not project-specific decision-complete planning. 예: $Plan "결제 모듈 리팩터"\n---\n\nUse when the user invokes $Plan or asks for a plan-only frontdoor. Produce a concrete plan artifact under .sneakoscope/plans/<slug>.md with goal, scope, files to inspect, implementation steps, acceptance checks, and rollback notes. Do not edit product/source files, generated harness files, package metadata, or docs beyond the plan artifact. Keep implementation_allowed=false and hand off execution to $Work only after the user or route explicitly moves from planning to work. Finish with what is planned, what remains unimplemented, and Honest Mode.\n`,
36
36
  'work': `---\nname: work\ndescription: Execute the latest plan with evidence-gated completion. 예: $Work\n---\n\nUse when the user invokes $Work or asks to execute the latest SKS plan. Resolve the newest .sneakoscope/plans/*.md, route execution through Naruto/Team evidence gates, keep leases and verification artifacts current, and do not claim completion without machine evidence or explicit blocker evidence. If no plan exists, block with a clear next action: run $Plan first or provide a task.\n`,
37
- 'swarm': `---\nname: swarm\ndescription: Deprecated $Swarm compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nWarn once that $Swarm is a deprecated alias, then follow the naruto skill. Use Codex official subagents and agent threads through \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. The parent runs on GPT-5.6 Sol Max, clear bounded worker slices use GPT-5.6 Luna Max, and reasoning-sensitive expert slices use GPT-5.6 Sol Max. Wait for all requested subagents and keep write slices disjoint. SubagentStart/SubagentStop prove lifecycle only; completion requires subagent-parent-summary.json with one structured parent outcome per thread. Canonical artifacts are subagent-plan.json, subagent-events.jsonl, subagent-parent-summary.json, subagent-evidence.json, naruto-summary.json, and naruto-gate.json. Finish with scoped verification, reflection when required, and Honest Mode.\n`,
37
+ 'swarm': `---\nname: swarm\ndescription: Deprecated $Swarm compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nWarn once that $Swarm is a deprecated alias, then follow the naruto skill. Use Codex official subagents and agent threads through \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. The parent runs on GPT-5.6 Sol Max. Luna Max is only for tiny short-context mechanical slices; ordinary implementation uses Sol High; review/debug/planning/security and other judgment uses Sol Max; long-context and Computer Use, Browser/Chrome, or image-generation execution uses Terra Medium. Split execution from judgment where possible, with Sol Max winning unsplittable conflicts. Wait for all requested subagents and keep write slices disjoint. SubagentStart/SubagentStop prove lifecycle only; completion requires subagent-parent-summary.json with one structured parent outcome per thread. Canonical artifacts are subagent-plan.json, subagent-events.jsonl, subagent-parent-summary.json, subagent-evidence.json, naruto-summary.json, and naruto-gate.json. Finish with scoped verification, reflection when required, and Honest Mode.\n`,
38
38
  'review': `---\nname: review\ndescription: Parallel diff review with machine-evidence first findings. 예: $Review 또는 sks review --staged\n---\n\nUse when the user asks for $Review or sks review. Review the selected diff read-only unless --fix is explicitly supplied. Machine evidence such as TypeScript, lint, tests, conflict markers, or secret scans outranks LLM findings and must be tagged evidence: machine; judgment-only findings must be tagged evidence: llm. --fix may attempt at most one machine-evidence fix pass and must re-run verification once. Do not mutate code for LLM-only opinions.\n`,
39
39
  'fast-mode': `---\nname: fast-mode\ndescription: Dollar-command route for $Fast-Mode, $Fast-On, and $Fast-Off global Codex Desktop Fast mode toggles.\n---\n\nUse when the user invokes $Fast-Mode, $Fast-On, $Fast-Off, or asks to turn SKS Fast mode on/off. Prefer \`sks fast-mode on|off|status|clear --json\`. By default on/off updates the global Codex Desktop config so GPT 5.5 Fast persists and also keeps .sneakoscope/state/fast-mode.json in sync for SKS workers. Use \`--project\` only when the user explicitly wants project-local worker preference without touching global Codex config. Explicit runtime flags still win: \`--fast\`, \`--no-fast\`, and \`--service-tier standard|fast\` override the saved preference for that run. Finish with a short status and Honest Mode; do not start Team or broad implementation for a toggle-only request.\n`,
40
40
  'fast-on': `---\nname: fast-on\ndescription: Alias for $Fast-On global Codex Desktop GPT 5.5 Fast enablement.\n---\n\nUse the same rules as fast-mode. Run or instruct \`sks fast-mode on --json\`, then report Global (desktop), Project (sks workers), state file, and the fact that explicit per-run flags still override the saved preference.\n`,
@@ -42,10 +42,10 @@ async function installOfficialSkills(root) {
42
42
  'with-local-llm-on': `---\nname: with-local-llm-on\ndescription: Dollar-command route for $with-local-llm-on local Ollama worker enablement.\n---\n\nUse when the user invokes $with-local-llm-on or asks to enable the optional local Ollama worker backend. Prefer \`sks with-local-llm on --json\`. The command writes the machine-local config at \`~/.sneakoscope/local-model.json\`. Default off means SKS stays GPT-only until this command enables local workers. Enabled mode only lets policy-eligible simple code patch-envelope or read-only collection worker slices use Ollama; GPT/Codex still owns strategy, planning, design, review, verification, safety, and integration. \`--no-ollama\` and \`SKS_OLLAMA_WORKERS=0\` still force local workers off for a run. Finish with a short status and Honest Mode; do not start Team for a toggle-only request.\n`,
43
43
  'with-local-llm-off': `---\nname: with-local-llm-off\ndescription: Dollar-command route for $with-local-llm-off local Ollama worker disablement.\n---\n\nUse when the user invokes $with-local-llm-off or asks to disable the optional local Ollama worker backend. Prefer \`sks with-local-llm off --json\`. The command writes the machine-local config at \`~/.sneakoscope/local-model.json\`. Disabled mode keeps SKS GPT-only by default. Strategy, planning, design, review, verification, safety, and integration remain GPT/Codex-owned regardless of this toggle. Finish with a short status and Honest Mode; do not start Team for a toggle-only request.\n`,
44
44
  'wiki': `---\nname: wiki\ndescription: Dollar-command route for $Wiki TriWiki refresh, pack, validate, and prune commands.\n---\n\nUse for $Wiki or Korean wiki-refresh requests. Refresh/update/갱신: run sks wiki refresh, then validate .sneakoscope/wiki/context-pack.json. Pack: run sks wiki pack, then validate. Prune/clean/정리: use sks wiki refresh --prune, or sks wiki prune --dry-run for inspection. Report claims, anchors, trust, attention.use_first/hydrate_first, validation, and blockers. Do not start ambiguity-gated implementation, subagents, or unrelated work.\n`,
45
- 'team': `---\nname: team\ndescription: Deprecated $Team compatibility alias; new execution missions use the $Naruto Codex official subagent workflow.\n---\n\nWarn once that $Team and \`sks team "<task>"\` are deprecated for new execution, then redirect implementation to \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Only legacy \`sks team log|tail|watch|lane|status\` remains, and it is strictly read-only observability for old missions. New work uses a GPT-5.6 Sol Max parent, Luna Max worker agents for clear bounded slices, Sol Max expert agents for judgment work, lifecycle-only SubagentStart/SubagentStop evidence, and a durable subagent-parent-summary.json containing one structured outcome per thread. Follow the canonical six-artifact Naruto contract. ${leanEngineeringCompactText()} ${outcomeRubricPolicyText()} ${speedLanePolicyText()} ${solutionScoutPolicyText('fix this broken behavior')} ${skillDreamPolicyText()}\n`,
45
+ 'team': `---\nname: team\ndescription: Deprecated $Team compatibility alias; new execution missions use the $Naruto Codex official subagent workflow.\n---\n\nWarn once that $Team and \`sks team "<task>"\` are deprecated for new execution, then redirect implementation to \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Only legacy \`sks team log|tail|watch|lane|status\` remains, and it is strictly read-only observability for old missions. New work uses a GPT-5.6 Sol Max parent and the fixed four-profile policy: Luna Max for tiny short-context mechanical work, Sol High for ordinary implementation, Sol Max for judgment-heavy work, and Terra Medium for long-context or Computer Use, Browser/Chrome, and image-generation execution. Split mixed execution/judgment slices when possible and prefer Sol Max when they cannot be separated. SubagentStart/SubagentStop are lifecycle-only evidence, and completion requires a durable subagent-parent-summary.json containing one structured outcome per thread. Follow the canonical six-artifact Naruto contract. ${leanEngineeringCompactText()} ${outcomeRubricPolicyText()} ${speedLanePolicyText()} ${solutionScoutPolicyText('fix this broken behavior')} ${skillDreamPolicyText()}\n`,
46
46
  'from-chat-img': `---\nname: from-chat-img\ndescription: Explicit $From-Chat-IMG Naruto add-on gate for chat screenshot plus attachment analysis.\n---\n\nUse only for From-Chat-IMG/$From-Chat-IMG. It enters the Naruto pipeline with from_chat_img_required=true and an add-on coverage gate, not the legacy Team pipeline. Treat uploads as chat screenshot plus originals. For web/browser/webapp targets use Codex Chrome Extension first; for native Mac/non-web app surfaces use Codex Computer Use visual inspection when available. List requirements first, match regions to attachments with confidence, write ${FROM_CHAT_IMG_COVERAGE_ARTIFACT}, ${FROM_CHAT_IMG_CHECKLIST_ARTIFACT}, ${FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT}, and ${FROM_CHAT_IMG_QA_LOOP_ARTIFACT}, then continue Naruto worker proof, review, reflection, and Honest Mode. ${CODEX_WEB_VERIFICATION_POLICY} ${CODEX_COMPUTER_USE_ONLY_POLICY} The ledger must account for every visible customer request, screenshot image region, and separate attachment; ${FROM_CHAT_IMG_CHECKLIST_ARTIFACT} must have a checked item for each request, image-region/attachment match, work item, scoped QA-LOOP, and verification step; ${FROM_CHAT_IMG_TEMP_TRIWIKI_ARTIFACT} stores temporary TriWiki-backed session context with expires_after_sessions=${FROM_CHAT_IMG_TEMP_TRIWIKI_SESSIONS}. ${FROM_CHAT_IMG_QA_LOOP_ARTIFACT} must prove QA-LOOP ran over the exact customer-request work-order range after implementation, with every work item covered, post-fix verification complete, and zero unresolved findings. naruto-gate.json cannot pass From-Chat-IMG completion until from_chat_img_request_coverage=true, unresolved_items is empty, every checklist box is checked, and scoped_qa_loop_completed=true.\n`,
47
- 'shadow-clone': `---\nname: shadow-clone\ndescription: Deprecated $ShadowClone compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nEmit one deprecation warning, translate the request to $Naruto, and use \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Do not describe the new default as clones, a process swarm, or a native kernel. Follow the naruto skill's Sol Max parent, Luna Max worker, Sol Max expert, lifecycle-only event evidence, structured subagent-parent-summary.json, max_depth=1, canonical six-artifact contract, scoped verification, reflection, and Honest Mode rules.\n`,
48
- 'kage-bunshin': `---\nname: kage-bunshin\ndescription: Deprecated $Kagebunshin compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nEmit one deprecation warning, translate the request to $Naruto, and use \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Legacy 影分身 terminology is compatibility-only and must not define the new runtime. Follow the naruto skill's Sol Max parent, Luna Max worker, Sol Max expert, lifecycle-only event evidence, structured subagent-parent-summary.json, max_depth=1, canonical six-artifact contract, scoped verification, reflection, and Honest Mode rules.\n`,
47
+ 'shadow-clone': `---\nname: shadow-clone\ndescription: Deprecated $ShadowClone compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nEmit one deprecation warning, translate the request to $Naruto, and use \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Do not describe the new default as clones, a process swarm, or a native kernel. Follow the naruto skill's Sol Max parent and four-profile child policy: Luna Max mechanical, Sol High implementation, Sol Max judgment, Terra Medium long-context/tool execution. Preserve lifecycle-only event evidence, structured subagent-parent-summary.json, max_depth=1, the canonical six-artifact contract, scoped verification, reflection, and Honest Mode rules.\n`,
48
+ 'kage-bunshin': `---\nname: kage-bunshin\ndescription: Deprecated $Kagebunshin compatibility alias for the $Naruto Codex official subagent workflow.\n---\n\nEmit one deprecation warning, translate the request to $Naruto, and use \`sks naruto run "<task>" [--agents N] [--max-threads N] [--json]\`. Legacy 影分身 terminology is compatibility-only and must not define the new runtime. Follow the naruto skill's Sol Max parent and four-profile child policy: Luna Max mechanical, Sol High implementation, Sol Max judgment, Terra Medium long-context/tool execution. Preserve lifecycle-only event evidence, structured subagent-parent-summary.json, max_depth=1, the canonical six-artifact contract, scoped verification, reflection, and Honest Mode rules.\n`,
49
49
  'qa-loop': `---\nname: qa-loop\ndescription: $QA-LOOP dogfoods UI/API as human proxy with safety gates, Codex Chrome Extension-first web UI evidence, safe fixes, rechecks, and a QA report.\n---\n\nUse only $QA-LOOP. Infer scope, target, mutation policy, and login boundary from the prompt plus TriWiki/current-code defaults; do not surface a prequestion sheet. Credentials are runtime-only; never save secrets. Web/browser/webapp UI-level E2E must run the Codex Chrome Extension readiness gate first; if the extension is missing or disabled, rapidly halt and ask the user to set it up, then resume only after the user confirms installation is complete. Codex Computer Use is reserved for native Mac/non-web surfaces and must not satisfy web UI evidence. Playwright, Selenium, Puppeteer, Browser Use, Chrome MCP, screenshots fabricated from code, and prose-only checks do not satisfy web UI/browser verification. ${CODEX_WEB_VERIFICATION_POLICY} Deployed targets are read-only; destructive removal is forbidden. After answer/run, dogfood real flows, apply safe contract-allowed code/test/docs fixes, recheck, and do not pass qa-gate.json with unresolved findings or without post_fix_verification_complete. Finish qa-ledger, date/version report, gate, completion summary, and Honest Mode.\n`,
50
50
  'ppt': `---\nname: ppt\ndescription: $PPT information-first HTML/PDF presentation pipeline with inferred STP, audience, pain-point, format, research, design-system, and verification contract.\n---\n\nUse only when the user invokes $PPT or asks to create a presentation, deck, slides, pitch deck, proposal deck, HTML presentation, or PDF presentation artifact. Before artifact work, auto-seal presentation-specific answers from prompt, TriWiki/current-code defaults, and conservative policy: delivery context, target audience profile including role/average age/job/industry/topic familiarity/decision power, STP strategy, decision context and objections, and 3+ pain-point to solution mappings with expected aha moments. Do not surface a prequestion sheet. Presentation design must be simple, restrained, and information-first: avoid over-designed decoration, ornamental gradients, nested cards, and effects that compete with the message. Design detail should be embedded through typography hierarchy, spacing, alignment, thin rules, source clarity, and subtle accents. ${pptPipelineAllowlistPolicyText()} Use Product Design plugin first for context, ideation, prototype direction, audit, design QA, and share handoff. Use design.md only as an existing project-local cache or fallback SSOT when Product Design is unavailable; if fallback creation is needed, use docs/Design-Sys-Prompt.md plus getdesign-reference and curated DESIGN.md examples from ${AWESOME_DESIGN_MD_REFERENCE.url} only as source inputs, then fuse them into route-local PPT style tokens with a recorded design_ssot instead of treating references as parallel authorities. The $PPT route always loads imagegen as a required skill, checks Codex App imagegen at route start, and runs SKS auto-repair once before any image-dependent build/review work. If repair fails, stop with codex_imagegen_unavailable and do not continue with image-free or API-substituted evidence. When the sealed contract needs a generated raster asset or generated slide visual critique, immediately invoke Codex App \`$imagegen\` with gpt-image-2, move/copy the selected output into the mission assets or review evidence path, and record the real file path in ppt-image-asset-ledger.json or ppt-review-ledger.json before building or passing the gate. Direct API fallback, placeholder files, HTML/CSS stand-ins, and prose-only substitutes do not satisfy the route gate. ${productDesignPluginPolicyText()} ${CODEX_IMAGEGEN_REQUIRED_POLICY} Use web or Context7 evidence only when external facts/libraries/current docs are required by the PPT contract, record verified claims in ppt-fact-ledger.json, record generated image asset plans/results/blockers in ppt-image-asset-ledger.json, then create the PDF plus editable source HTML under source-html/, keep independent strategy/render/file-write phases parallel where inputs allow, record ppt-parallel-report.json, run the bounded ppt-review-policy/ppt-review-ledger/ppt-iteration-report loop, and verify readability, overlap, format fit, source coverage, export state, unsupported-claim status, image-asset completion, review-loop termination, and temporary build files cleanup. Finish with reflection and Honest Mode.\n`,
51
51
  'computer-use-fast': `---\nname: computer-use-fast\ndescription: Alias for the maximum-speed $Computer-Use/$CU native Codex Computer Use lane.\n---\n\nUse the same rules as computer-use: skip Team debate, QA-LOOP clarification, upfront TriWiki refresh, Context7, subagents, and reflection unless explicitly requested. Use Codex Computer Use directly only for native macOS, desktop-app, OS-settings, or non-web visual tasks. Browser, localhost, website, webapp, and web-based app verification must use the Codex Chrome Extension path first and must halt if that extension is not installed/enabled. At the end only, refresh/pack TriWiki, validate it, then provide a concise completion summary plus Honest Mode. ${CODEX_WEB_VERIFICATION_POLICY} ${CODEX_COMPUTER_USE_ONLY_POLICY}\n`,
package/dist/core/init.js CHANGED
@@ -234,7 +234,7 @@ function isSksManagedHook(hook) {
234
234
  const AGENTS_BLOCK = "\n# Sneakoscope Codex Managed Rules\n\nThis repository uses Sneakoscope Codex.\n\n## Core Rules\n\n- Codex native `/goal` workflows are the persisted continuation surface; Ralph is removed from the user-facing SKS surface.\n- Keep runtime state bounded: raw logs go to files, prompts get tails/summaries, and `sks gc` may prune stale artifacts.\n- Codex App hooks, launch paths, and `sks doctor --fix` do not force SKS update prompts during ordinary work. Manual CLI update surfaces (`sks update-check`, `sks update check`, and `sks update now`) remain available when the operator explicitly asks for them.\n- Versioning is explicit: use `sks versioning bump` when preparing release metadata. SKS must not install Git pre-commit hooks.\n- Installed harness files are immutable to LLM edits: `.codex/*`, `.agents/skills/`, `.codex/agents/`, `.sneakoscope/*policy*.json`, `AGENTS.md`, and `node_modules/sneakoscope`. The Sneakoscope engine source repo is the only automatic exception.\n- OMX/DCodex conflicts block setup/doctor. Show `sks conflicts prompt`; cleanup requires explicit human approval.\n- Do not stop at a plan when implementation was requested. Finish, verify, or report the hard blocker.\n- Do not create unrequested fallback implementation code. If the requested path is impossible, block with evidence instead of inventing substitute behavior.\n\n## Routes\n\n- General execution/code-changing prompts default to `$Team`: native agent intake agents, TriWiki refresh/validate, read-only debate, consensus, concrete runtime task graph/inboxes, fresh executor team, minimum five-lane Team review, integration, Honest Mode.\n- `$Computer-Use` / `$CU` is the maximum-speed Codex Computer Use lane for native macOS, desktop-app, OS-settings, and non-web visual tasks only. Web, browser, localhost, website, webapp, and web-based app verification must use the Codex Chrome Extension path first and halt rapidly if the extension is not installed/enabled.\n- `$Goal` is a fast bridge/overlay for Codex native `/goal` create/pause/resume/clear persistence controls; implementation continues through the selected SKS execution route.\n- TriWiki recall must stay bounded. Use `sks wiki sweep` to record demote, soft-forget, archive, delete, promote-to-skill, and promote-to-rule candidates instead of injecting every old claim.\n- Team missions must keep schema-backed evidence current: `work-order-ledger.json`, `effort-decision.json`, `team-dashboard-state.json`, and route-specific visual/dogfood artifacts where applicable. Team completion requires at least five independent reviewer/QA validation lanes before integration or final, even when a prompt requests fewer reviewers. Use `sks validate-artifacts latest` before claiming those artifacts pass.\n- `$DFix` is Direct Fix: only tiny copy/config/docs/labels/spacing/translation/simple mechanical edits, bypassing the main pipeline, Team, TriWiki/TriFix/reflection recording, and persistent route state; it still uses a one-line DFix-specific Honest check before final. Broad implementation stays on `$Team`, while UI design specifics follow the relevant design/UI route rules. `$PPT` is the restrained, information-first HTML/PDF presentation route and must seal delivery context, audience profile, STP, decision context, and 3+ pain-point/solution/aha mappings before design/render work. It must avoid over-designed visuals, carry detail through hierarchy, spacing, alignment, thin rules, source clarity, and subtle accents, preserve editable source HTML under `source-html/`, record `ppt-parallel-report.json`, and clean PPT-only temporary build files before completion. `$Image-UX-Review` / `$UX-Review` is the imagegen/gpt-image-2 UI/UX review route: source screenshots must become generated annotated review images, those generated images must be extracted into issue ledgers, and text-only critique cannot pass the route gate. `$Answer`, `$Help`, and `$Wiki` stay lightweight.\n- For code work, surface route/guard/write scopes first, split independent worker scopes when available, and keep parent-owned integration and verification.\n- Design work reads `design.md` as the only design decision SSOT. If missing, create it through `design-system-builder` from `docs/Design-Sys-Prompt.md`; getdesign.md, getdesign-reference, and curated DESIGN.md examples from https://github.com/VoltAgent/awesome-design-md are source inputs to fuse into that SSOT or route-local style tokens, not parallel design authorities. Image/logo/raster assets use `imagegen`, which must prefer official Codex App built-in image generation via `$imagegen` / `gpt-image-2`; for newest-model image requests prompt explicitly for ChatGPT Images 2.0 / GPT Image 2.0 with `gpt-image-2`. Do not replace required raster evidence with placeholder SVG/HTML/CSS, prose-only reviews, or fabricated files.\n- Research, AutoResearch, performance, token, accuracy, SEO/GEO, or workflow-improvement claims need experiment/eval evidence. Do not claim live model accuracy without a scored dataset.\n- Treat handwritten files above 3000 lines as split-review risks. Run `sks code-structure scan` and prefer extraction before adding substantial logic.\n- Skill dreaming stays lightweight: route use records JSON counters in `.sneakoscope/skills/dream-state.json`, and full skill inventory/recommendation runs only after the configured 10-route-event threshold and cooldown. Reports are recommendation-only; deleting or merging skills needs explicit user approval.\n\n## Evidence And Context\n\n- Context7 is required for external libraries, APIs, MCPs, package managers, SDKs, and generated docs: resolve-library-id then query-docs.\n- When tech stack, framework, package, runtime, or deployment-platform versions change, use Context7 or official vendor web docs, record current syntax/security/limit guidance as high-priority TriWiki claims, then refresh and validate before coding.\n- TriWiki is the context-tracking SSOT for long-running missions, Team handoffs, and context-pressure recovery. Read `.sneakoscope/wiki/context-pack.json` before each stage, use `attention.use_first` for compact high-trust recall, hydrate `attention.hydrate_first` from source before risky or lower-trust decisions, refresh after findings or artifact changes, and validate before handoffs/final claims.\n- Source priority: current code/tests/config, decision contract, vgraph, beta, GX render/snapshot metadata, LLM Wiki coordinate index, then model knowledge only if allowed.\n- Final response before stop: summarize what was done, what changed for the user/repo, what was verified, and what remains unverified or blocked; then run Honest Mode. Say what passed and what was not verified.\n- `$From-Chat-IMG` uses forensic visual effort, not ordinary Team effort. Completion is blocked until source inventory, visual mapping, work-order coverage, scoped dogfood/QA, and post-fix verification artifacts are present and valid.\n\n## Safety\n\n- Database access is high risk. Use read-only inspection by default; live data mutation is out of scope unless a sealed contract allows local or branch-only migration files.\n- MAD and MAD-SKS widen only explicit scoped permissions; they still do not authorize unrequested fallback implementation code.\n- Task completion requires relevant tests or justification, zero unsupported critical claims, accepted visual/wiki drift, and final evidence.\n\n## Codex App\n\nUse `.codex/SNEAKOSCOPE.md`, generated `.agents/skills`, `.codex/hooks.json`, and SKS dollar commands (`$sks`, `$team`, `$computer-use`, `$cu`, `$ppt`, `$image-ux-review`, `$ux-review`, `$goal`, `$dfix`, `$qa-loop`, etc.) as the app control surface.\n";
235
235
  function agentsBlockText() {
236
236
  return AGENTS_BLOCK
237
- .replace('General execution/code-changing prompts default to `$Team`: native agent intake agents, TriWiki refresh/validate, read-only debate, consensus, concrete runtime task graph/inboxes, fresh executor team, minimum five-lane Team review, integration, Honest Mode.', 'General execution/code-changing prompts default to `$Team`, a compatibility alias for the `$Naruto` Codex official subagent workflow: parent-owned decomposition, project-scoped custom agents, disjoint write scopes, bounded TriWiki use, one child by default, risk-scoped expansion to at most three automatic children, parent integration, and Honest Mode.')
237
+ .replace('General execution/code-changing prompts default to `$Team`: native agent intake agents, TriWiki refresh/validate, read-only debate, consensus, concrete runtime task graph/inboxes, fresh executor team, minimum five-lane Team review, integration, Honest Mode.', 'General execution/code-changing prompts default to `$Team`, a compatibility alias for the `$Naruto` Codex official subagent workflow: parent-owned decomposition, project-scoped custom agents, disjoint write scopes, bounded query-aware TriWiki use, two independent children for non-trivial work, risk-scoped expansion to at most three automatic children, parent integration, and Honest Mode.\n- Official subagent model routing is fixed: Luna Max only for tiny short-context mechanical work; Sol High for ordinary UI/logic/backend/native implementation; Sol Max for review, debugging, planning, architecture, security, database, research, release, ambiguity, and judgment; Terra Medium for long-context analysis and direct Computer Use, Browser/Chrome, or image-generation execution. Split mixed execution and judgment when possible; otherwise Sol Max wins.')
238
238
  .replace('Team missions must keep schema-backed evidence current: `work-order-ledger.json`, `effort-decision.json`, `team-dashboard-state.json`, and route-specific visual/dogfood artifacts where applicable. Team completion requires at least five independent reviewer/QA validation lanes before integration or final, even when a prompt requests fewer reviewers. Use `sks validate-artifacts latest` before claiming those artifacts pass.', 'New `$Team` execution redirects to the Naruto official subagent workflow and must keep `subagent-plan.json`, `subagent-events.jsonl`, `subagent-parent-summary.json`, `subagent-evidence.json`, the work-order ledger, and route-specific visual/dogfood artifacts current where applicable. New work uses one focused reviewer by default, two only for independent review domains, and at most three automatic reviewers for critical multi-domain risk. Legacy Team observe/watch commands remain read-only for old missions. Use `sks validate-artifacts latest` before claiming artifacts pass.')
239
239
  .replace('TriWiki is the context-tracking SSOT for long-running missions, Team handoffs, and context-pressure recovery.', 'TriWiki is the context-tracking SSOT for long-running missions, official subagent handoffs, and context-pressure recovery.');
240
240
  }