sneakoscope 10.1.3 → 10.1.5

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 (91) hide show
  1. package/README.md +4 -3
  2. package/config/skills-hash-ledger.v1.json +9 -0
  3. package/crates/sks-core/Cargo.lock +1 -1
  4. package/crates/sks-core/Cargo.toml +1 -1
  5. package/dist/cli/install-helpers.js +2 -1
  6. package/dist/commands/doctor.js +2 -1
  7. package/dist/config/skills-manifest.json +21 -11
  8. package/dist/core/agents/agent-effort-policy.js +21 -140
  9. package/dist/core/agents/agent-orchestrator.js +4 -4
  10. package/dist/core/agents/native-worker-backend-router.js +26 -44
  11. package/dist/core/agents/official-subagent-helper-policy.js +2 -1
  12. package/dist/core/bench.js +1 -1
  13. package/dist/core/codex-app.js +6 -5
  14. package/dist/core/codex-compat/codex-hook-output-builders.js +0 -1
  15. package/dist/core/codex-lb/desktop-bridge/http-forward.js +11 -6
  16. package/dist/core/codex-lb/desktop-bridge/rejection-log.js +3 -0
  17. package/dist/core/codex-lb/desktop-bridge/responses-websocket.js +2 -2
  18. package/dist/core/codex-lb/desktop-bridge/security.js +4 -0
  19. package/dist/core/codex-lb/desktop-bridge/server.js +10 -1
  20. package/dist/core/codex-lb/desktop-bridge/types.js +12 -0
  21. package/dist/core/codex-native/core-skill-manifest.js +4 -3
  22. package/dist/core/codex-native/native-capability-repair-matrix.js +5 -4
  23. package/dist/core/commands/image-ux-review-command.js +23 -27
  24. package/dist/core/commands/ppt-command.js +4 -3
  25. package/dist/core/commands/qa-loop-command.js +8 -8
  26. package/dist/core/doctor/doctor-readiness-matrix.js +2 -1
  27. package/dist/core/doctor/imagegen-repair.js +4 -3
  28. package/dist/core/evidence/evidence-router.js +3 -3
  29. package/dist/core/evidence/evidence-schema.js +1 -1
  30. package/dist/core/feature-fixtures.js +2 -2
  31. package/dist/core/feature-registry.js +3 -2
  32. package/dist/core/hooks-runtime/hook-context.js +1 -1
  33. package/dist/core/hooks-runtime/hook-io.js +2 -1
  34. package/dist/core/hooks-runtime/subagent-context.js +7 -3
  35. package/dist/core/hooks-runtime/subagent-spawn-policy.js +15 -0
  36. package/dist/core/hooks-runtime.js +5 -1
  37. package/dist/core/image-ux-review/callout-extraction.js +1 -1
  38. package/dist/core/image-ux-review/imagegen-adapter.js +63 -185
  39. package/dist/core/image-ux-review/recapture.js +1 -1
  40. package/dist/core/image-ux-review.js +46 -46
  41. package/dist/core/imagegen/imagegen-auth-readiness.js +6 -13
  42. package/dist/core/imagegen/imagegen-capability.js +22 -15
  43. package/dist/core/imagegen/imagegen-model-policy.js +22 -0
  44. package/dist/core/imagegen/{gpt-image-2-request-validator.js → imagegen-request-validator.js} +13 -12
  45. package/dist/core/imagegen/require-imagegen.js +4 -2
  46. package/dist/core/init/skills.js +7 -6
  47. package/dist/core/init.js +4 -4
  48. package/dist/core/managed-assets/managed-assets-manifest.js +4 -3
  49. package/dist/core/performance-budgets.json +1 -1
  50. package/dist/core/pipeline-internals/runtime-core.js +3 -2
  51. package/dist/core/pipeline-internals/runtime-gates.js +9 -8
  52. package/dist/core/ppt-review/index.js +1 -1
  53. package/dist/core/ppt-review/ppt-patch-handoff.js +2 -1
  54. package/dist/core/ppt-review/slide-imagegen-review.js +14 -9
  55. package/dist/core/ppt-review/slide-issue-extraction.js +2 -2
  56. package/dist/core/ppt.js +25 -22
  57. package/dist/core/provider/model-router.js +9 -14
  58. package/dist/core/qa-loop/qa-contract.js +5 -5
  59. package/dist/core/qa-loop.js +55 -54
  60. package/dist/core/recallpulse.js +2 -1
  61. package/dist/core/routes/design-policy.js +2 -1
  62. package/dist/core/routes/dollar-manifest-lite.js +3 -2
  63. package/dist/core/routes/evidence.js +5 -4
  64. package/dist/core/routes/ppt-policy.js +2 -1
  65. package/dist/core/routes.js +10 -9
  66. package/dist/core/stop-gate/gate-evaluator.js +3 -3
  67. package/dist/core/subagents/agent-catalog.js +2 -1
  68. package/dist/core/subagents/model-policy.js +2 -2
  69. package/dist/core/subagents/naruto-help-contract.js +4 -4
  70. package/dist/core/subagents/naruto-host-credentials.js +7 -3
  71. package/dist/core/subagents/official-subagent-config.js +5 -3
  72. package/dist/core/subagents/official-subagent-preparation.js +8 -19
  73. package/dist/core/subagents/official-subagent-prompt.js +23 -67
  74. package/dist/core/subagents/role-model-preferences.js +18 -91
  75. package/dist/core/triwiki-wrongness/wrongness-schema.js +7 -6
  76. package/dist/core/trust-kernel/trust-report.js +6 -6
  77. package/dist/core/version.js +1 -1
  78. package/dist/core/wiki-image/callout-parser.js +1 -1
  79. package/dist/core/wiki-image/validation.js +2 -2
  80. package/dist/scripts/codex-native-agent-role-content-check.js +2 -2
  81. package/dist/scripts/codex-native-gate-lib.js +1 -1
  82. package/dist/scripts/imagegen-real-smoke-check.js +4 -5
  83. package/dist/scripts/ppt-real-imagegen-smoke-check.js +1 -1
  84. package/dist/scripts/ppt-real-imagegen-wiring-check.js +2 -2
  85. package/dist/scripts/search-visibility-gate-lib.js +0 -1
  86. package/dist/scripts/ux-review-imagegen-blackbox-check.js +3 -3
  87. package/dist/scripts/ux-review-real-imagegen-smoke-check.js +1 -1
  88. package/dist/scripts/ux-review-run-wires-imagegen-check.js +2 -2
  89. package/package.json +1 -1
  90. package/schemas/codex/image-ux-issue-ledger.schema.json +1 -1
  91. package/dist/core/image-ux-review/codex-app-generated-image-discovery.js +0 -100
package/README.md CHANGED
@@ -16,7 +16,7 @@
16
16
  Sneakoscope Codex (`sks`) is an open-source trust layer for Codex CLI and ChatGPT Desktop. It coordinates bounded AI coding agents, records machine-verifiable evidence, preserves project memory, and blocks release claims that are not supported by current tests or artifacts. Search visibility outcomes are measured separately; SKS does not promise rankings or traffic.
17
17
  <!-- END SKS SEARCH VISIBILITY MARKETING -->
18
18
 
19
- Current package: **SKS 10.1.3**. Install the latest stable release from npm.
19
+ Current package: **SKS 10.1.5**. Install the latest stable release from npm.
20
20
 
21
21
  [Quick start](#install-in-one-command) · [Commands](#everyday-commands) · [SKS Center](#sks-center-macos) · [Documentation](#documentation) · [Changelog](CHANGELOG.md)
22
22
 
@@ -133,12 +133,13 @@ configuration, transport checks, and recovery commands.
133
133
 
134
134
  ## Naruto workflow
135
135
 
136
- SKS uses official Codex subagents. The parent owns decomposition, integration,
136
+ SKS enforces GPT-6 Astra for every managed child and varies effort by task.
137
+ The parent owns decomposition, integration,
137
138
  and final verification; children receive bounded tasks and do not spawn children.
138
139
 
139
140
  | Work | Managed model | Effort |
140
141
  | --- | --- | --- |
141
- | Tiny mechanical tasks | GPT-5.6 Luna | max |
142
+ | Tiny mechanical tasks | GPT-6 Astra | low |
142
143
  | Exploration, large-context reads, and direct tool operation | GPT-6 Astra | medium |
143
144
  | Implementation | GPT-6 Astra | high |
144
145
  | Review, debugging, and focused judgment | GPT-6 Astra | max |
@@ -111,6 +111,7 @@
111
111
  {
112
112
  "canonical_name": "sks-design-artifact-expert",
113
113
  "trusted_sha256": [
114
+ "6db9a7088e5f8d21dec9c8eed00abe665e1e89f19dcbb6d8472d77e4551cb556",
114
115
  "a09daba0a2e479a68ed81ec6fba8d70e54c8398ed86f3d1879f874b98480b97c",
115
116
  "4a28d166eaf0bc4477b566b056034f972a7034165e36d8186daa9947bf92e3cf"
116
117
  ]
@@ -118,6 +119,7 @@
118
119
  {
119
120
  "canonical_name": "sks-design-system-builder",
120
121
  "trusted_sha256": [
122
+ "47654c9f74317abbd0a5a75f89cd2d563708e8234e8887cc7ab39bf49030abaa",
121
123
  "0a41e6ace960abaaf6abf5e7b1e53fd39f414e1e00b59fa725f2db9e3eb05b58",
122
124
  "c4f0007cad5774510bdc55e2815ce0911c220afa8d5dd4efc327ba1231c8f3da"
123
125
  ]
@@ -125,6 +127,7 @@
125
127
  {
126
128
  "canonical_name": "sks-design-ui-editor",
127
129
  "trusted_sha256": [
130
+ "6c24e950a12dec52c625964069c7c21a0220a58e0f69f977d802f44fdb03a940",
128
131
  "83a806cc93a3c5342e0dccfc6a45983382d5bf74d1226c4e3288228db22b737a",
129
132
  "1b65f0028a6dcb2f7eeab0b0df411a75546bc3aefa8a76067e1818da000c2249"
130
133
  ]
@@ -243,12 +246,14 @@
243
246
  {
244
247
  "canonical_name": "sks-image-ux-review",
245
248
  "trusted_sha256": [
249
+ "54d4169dc7f362ac9fe2d090bd2612e41d30acbc3e883d6bd382929bdfb9459e",
246
250
  "9293346873b5fb25a9d93b630064a2c8ceede2bfdfa4c6ffe7fbb7f64da6595c"
247
251
  ]
248
252
  },
249
253
  {
250
254
  "canonical_name": "sks-imagegen",
251
255
  "trusted_sha256": [
256
+ "478e3d8f805eed55c3f3e6c2069142482a7dbd8fa5d9a59f03b136e0e1cb77d0",
252
257
  "a7f466ba1829a757f38432fbe8c3a672e22e91948537dafe8f8ce09561d2256e",
253
258
  "7a1f9372b03975886233a623031f41e06fd782b1e7a3409517bb428d9c6b76dd"
254
259
  ]
@@ -256,6 +261,7 @@
256
261
  {
257
262
  "canonical_name": "sks-imagegen-source-scout",
258
263
  "trusted_sha256": [
264
+ "95faf4358f1c6567ca6894bfb577629f14a23d623716be70325c0ff9a893d42e",
259
265
  "95e71d4431a4c1f6911f0f76eaa1c2b475c52fd22d35c0a6c241e21e090507ad",
260
266
  "d648b571c674ed3be862bc0e8b2110f88c2bee54292bb009df0b0b2dbd6d400b"
261
267
  ]
@@ -282,6 +288,7 @@
282
288
  {
283
289
  "canonical_name": "sks-naruto",
284
290
  "trusted_sha256": [
291
+ "5df9c9678eb68fd79ceb998ae7a52dd54dc92336ad5169e8a01acca89f76bd60",
285
292
  "a1219f6dbad9c8c185953125ef0b8dccf081aa01efb8e8acaa543c6214ac049c",
286
293
  "d0d5968e78ac25e1d3e588735de1ddbcf149cfb3165edebca5dec1ed7c7a5c46",
287
294
  "34222c72e4e1ead3584907f4d905444b7de820283ee7348018f110d5e6b04461",
@@ -315,6 +322,7 @@
315
322
  {
316
323
  "canonical_name": "sks-ppt",
317
324
  "trusted_sha256": [
325
+ "c9a0d90e12560dd3f04959869051370e6baf46eda6eb63f708ea1661c5c9d041",
318
326
  "1d4de05afd42ee5739c0ed925af9e0ac4785fc746e659c60d3d908d465e6386c",
319
327
  "02e8a0758ec6d056ce9851a5a4505b1d32e302e730be3eb169a41392a5d6b2e2",
320
328
  "329fc6ee24bb04478b18fb6ccd3691cd7cbb50e1b77ca7b6136383d00b3b0bb4"
@@ -337,6 +345,7 @@
337
345
  {
338
346
  "canonical_name": "sks-reasoning-router",
339
347
  "trusted_sha256": [
348
+ "647f730520a1c7dc89c2642f5b8502624c65a861ae41aecf1fb137db40fd0611",
340
349
  "da0ddb58adc68ddeebdb9c45bf111c26eaa64d3e9dffe1dd39d7f30b943b8b88",
341
350
  "1595beabf2d31397217311fa1323bd62c801cf6c87db9029ff544c457efec8bb",
342
351
  "a7d879d157c6d5b6b81a67dba7b5b731ac18ea986841fe1ab2cafbd6623481c3",
@@ -259,7 +259,7 @@ dependencies = [
259
259
 
260
260
  [[package]]
261
261
  name = "sks-core"
262
- version = "10.1.3"
262
+ version = "10.1.5"
263
263
  dependencies = [
264
264
  "globset",
265
265
  "grep-matcher",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "sks-core"
3
- version = "10.1.3"
3
+ version = "10.1.5"
4
4
  edition = "2021"
5
5
 
6
6
  [dependencies]
@@ -1,3 +1,4 @@
1
+ import { IMAGEGEN_MODEL } from '../core/imagegen/imagegen-model-policy.js';
1
2
  import path from 'node:path';
2
3
  import fsp from 'node:fs/promises';
3
4
  import { stdin as input, stdout as output } from 'node:process';
@@ -60,7 +61,7 @@ export async function postinstall({ bootstrap }) {
60
61
  console.log('Configure providers explicitly with `sks bridge provider configure codex-lb ...` or `sks bridge provider configure openrouter ...`.');
61
62
  const imagegenRepair = await ensureCodexImagegenDuringInstall();
62
63
  if (imagegenRepair.status === 'ready')
63
- console.log('Codex App Image Gen: ready ($imagegen/gpt-image-2 detected).');
64
+ console.log(("Image generation provider capability ready (requested model: " + IMAGEGEN_MODEL + "; output not verified)."));
64
65
  else if (imagegenRepair.status === 'recovered')
65
66
  console.log('Codex App Image Gen: recovered and re-detected. Start a new Codex/Work task; restart the desktop app only if the new task still lacks $imagegen.');
66
67
  else if (imagegenRepair.status === 'blocked')
@@ -1,3 +1,4 @@
1
+ import { IMAGEGEN_MODEL } from '../core/imagegen/imagegen-model-policy.js';
1
2
  import os from 'node:os';
2
3
  import path from 'node:path';
3
4
  import { projectRoot, exists, formatBytes, nowIso, readText, writeJsonAtomic } from '../core/fsx.js';
@@ -1188,7 +1189,7 @@ async function runDoctor(args = [], root, doctorFix, deps = {}) {
1188
1189
  blockers: ['codex_imagegen_current_task_tool_manifest_unverified', 'codex_imagegen_real_output_unverified'],
1189
1190
  manual_actions: [
1190
1191
  'Start a fresh Codex/Work task so $imagegen is present in its tool manifest.',
1191
- 'Invoke $imagegen with gpt-image-2 and bind the selected raster output path to route evidence.'
1192
+ ("Invoke $imagegen with " + IMAGEGEN_MODEL + " and bind the selected raster output path to route evidence.")
1192
1193
  ],
1193
1194
  communication_test: {
1194
1195
  level: 'flag_level',
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schema": "sks.skills-manifest.v1",
3
- "package_version": "10.1.3",
3
+ "package_version": "10.1.5",
4
4
  "skills": [
5
5
  {
6
6
  "canonical_name": "sks",
@@ -138,8 +138,9 @@
138
138
  {
139
139
  "canonical_name": "sks-design-artifact-expert",
140
140
  "type": "official",
141
- "content_sha256": "a09daba0a2e479a68ed81ec6fba8d70e54c8398ed86f3d1879f874b98480b97c",
141
+ "content_sha256": "6db9a7088e5f8d21dec9c8eed00abe665e1e89f19dcbb6d8472d77e4551cb556",
142
142
  "hash_history": [
143
+ "a09daba0a2e479a68ed81ec6fba8d70e54c8398ed86f3d1879f874b98480b97c",
143
144
  "4a28d166eaf0bc4477b566b056034f972a7034165e36d8186daa9947bf92e3cf"
144
145
  ],
145
146
  "deprecated_aliases": []
@@ -147,8 +148,9 @@
147
148
  {
148
149
  "canonical_name": "sks-design-system-builder",
149
150
  "type": "official",
150
- "content_sha256": "0a41e6ace960abaaf6abf5e7b1e53fd39f414e1e00b59fa725f2db9e3eb05b58",
151
+ "content_sha256": "47654c9f74317abbd0a5a75f89cd2d563708e8234e8887cc7ab39bf49030abaa",
151
152
  "hash_history": [
153
+ "0a41e6ace960abaaf6abf5e7b1e53fd39f414e1e00b59fa725f2db9e3eb05b58",
152
154
  "c4f0007cad5774510bdc55e2815ce0911c220afa8d5dd4efc327ba1231c8f3da"
153
155
  ],
154
156
  "deprecated_aliases": []
@@ -156,8 +158,9 @@
156
158
  {
157
159
  "canonical_name": "sks-design-ui-editor",
158
160
  "type": "official",
159
- "content_sha256": "83a806cc93a3c5342e0dccfc6a45983382d5bf74d1226c4e3288228db22b737a",
161
+ "content_sha256": "6c24e950a12dec52c625964069c7c21a0220a58e0f69f977d802f44fdb03a940",
160
162
  "hash_history": [
163
+ "83a806cc93a3c5342e0dccfc6a45983382d5bf74d1226c4e3288228db22b737a",
161
164
  "1b65f0028a6dcb2f7eeab0b0df411a75546bc3aefa8a76067e1818da000c2249"
162
165
  ],
163
166
  "deprecated_aliases": []
@@ -305,15 +308,18 @@
305
308
  {
306
309
  "canonical_name": "sks-image-ux-review",
307
310
  "type": "core",
308
- "content_sha256": "9293346873b5fb25a9d93b630064a2c8ceede2bfdfa4c6ffe7fbb7f64da6595c",
309
- "hash_history": [],
311
+ "content_sha256": "54d4169dc7f362ac9fe2d090bd2612e41d30acbc3e883d6bd382929bdfb9459e",
312
+ "hash_history": [
313
+ "9293346873b5fb25a9d93b630064a2c8ceede2bfdfa4c6ffe7fbb7f64da6595c"
314
+ ],
310
315
  "deprecated_aliases": []
311
316
  },
312
317
  {
313
318
  "canonical_name": "sks-imagegen",
314
319
  "type": "official",
315
- "content_sha256": "a7f466ba1829a757f38432fbe8c3a672e22e91948537dafe8f8ce09561d2256e",
320
+ "content_sha256": "478e3d8f805eed55c3f3e6c2069142482a7dbd8fa5d9a59f03b136e0e1cb77d0",
316
321
  "hash_history": [
322
+ "a7f466ba1829a757f38432fbe8c3a672e22e91948537dafe8f8ce09561d2256e",
317
323
  "7a1f9372b03975886233a623031f41e06fd782b1e7a3409517bb428d9c6b76dd"
318
324
  ],
319
325
  "deprecated_aliases": []
@@ -321,8 +327,9 @@
321
327
  {
322
328
  "canonical_name": "sks-imagegen-source-scout",
323
329
  "type": "official",
324
- "content_sha256": "95e71d4431a4c1f6911f0f76eaa1c2b475c52fd22d35c0a6c241e21e090507ad",
330
+ "content_sha256": "95faf4358f1c6567ca6894bfb577629f14a23d623716be70325c0ff9a893d42e",
325
331
  "hash_history": [
332
+ "95e71d4431a4c1f6911f0f76eaa1c2b475c52fd22d35c0a6c241e21e090507ad",
326
333
  "d648b571c674ed3be862bc0e8b2110f88c2bee54292bb009df0b0b2dbd6d400b"
327
334
  ],
328
335
  "deprecated_aliases": []
@@ -346,8 +353,9 @@
346
353
  {
347
354
  "canonical_name": "sks-naruto",
348
355
  "type": "core",
349
- "content_sha256": "a1219f6dbad9c8c185953125ef0b8dccf081aa01efb8e8acaa543c6214ac049c",
356
+ "content_sha256": "5df9c9678eb68fd79ceb998ae7a52dd54dc92336ad5169e8a01acca89f76bd60",
350
357
  "hash_history": [
358
+ "a1219f6dbad9c8c185953125ef0b8dccf081aa01efb8e8acaa543c6214ac049c",
351
359
  "d0d5968e78ac25e1d3e588735de1ddbcf149cfb3165edebca5dec1ed7c7a5c46",
352
360
  "34222c72e4e1ead3584907f4d905444b7de820283ee7348018f110d5e6b04461",
353
361
  "f8e808622e222b4ad7dcb2907e5f06a890db83139ae443ec6c8c33781dfa3e37",
@@ -387,8 +395,9 @@
387
395
  {
388
396
  "canonical_name": "sks-ppt",
389
397
  "type": "official",
390
- "content_sha256": "1d4de05afd42ee5739c0ed925af9e0ac4785fc746e659c60d3d908d465e6386c",
398
+ "content_sha256": "c9a0d90e12560dd3f04959869051370e6baf46eda6eb63f708ea1661c5c9d041",
391
399
  "hash_history": [
400
+ "1d4de05afd42ee5739c0ed925af9e0ac4785fc746e659c60d3d908d465e6386c",
392
401
  "02e8a0758ec6d056ce9851a5a4505b1d32e302e730be3eb169a41392a5d6b2e2",
393
402
  "329fc6ee24bb04478b18fb6ccd3691cd7cbb50e1b77ca7b6136383d00b3b0bb4"
394
403
  ],
@@ -414,8 +423,9 @@
414
423
  {
415
424
  "canonical_name": "sks-reasoning-router",
416
425
  "type": "official",
417
- "content_sha256": "da0ddb58adc68ddeebdb9c45bf111c26eaa64d3e9dffe1dd39d7f30b943b8b88",
426
+ "content_sha256": "647f730520a1c7dc89c2642f5b8502624c65a861ae41aecf1fb137db40fd0611",
418
427
  "hash_history": [
428
+ "da0ddb58adc68ddeebdb9c45bf111c26eaa64d3e9dffe1dd39d7f30b943b8b88",
419
429
  "1595beabf2d31397217311fa1323bd62c801cf6c87db9029ff544c457efec8bb",
420
430
  "a7d879d157c6d5b6b81a67dba7b5b731ac18ea986841fe1ab2cafbd6623481c3",
421
431
  "dc0b8c6a4093269c2c36b58432b25409704d06fea8ca558f43b598625ca0d9de"
@@ -1,67 +1,8 @@
1
1
  import { codexModelEffortCapability } from '../codex-control/codex-model-capabilities.js';
2
- import { OPENROUTER_DEFAULT_MODEL } from '../codex-app/openrouter-provider.js';
3
2
  import { managedOfficialSubagentRoleByName } from '../managed-assets/managed-assets-manifest.js';
4
- import { isNarutoGpt56Model } from '../provider/model-router.js';
5
- import { decideSubagentModel, subagentModelProfile } from '../subagents/model-policy.js';
6
- const XHIGH_SIGNAL_RE = /(frontier|autoresearch|novelty|hypothesis|falsif|forensic|from-chat-img|image\s*work\s*order|새로운\s*연구|가설|포렌식)/i;
7
- const HIGH_SIGNAL_RE = /(database|supabase|sql|migration|security|permission|mad|release|publish|deploy|architecture|policy|schema|hook|rollback|db|보안|배포|마이그레이션|데이터베이스|권한|릴리즈)/i;
8
- const MEDIUM_SIGNAL_RE = /(terminal|cli|tool(?:\s|-)?call|router|routing|orchestrat|pipeline|multi[-\s]?session|multi[-\s]?agent|lease|ledger|proof|검증|파이프라인|오케스트레이션|병렬|에이전트)/i;
9
- const SIMPLE_SIGNAL_RE = /(tiny|simple|small|one[-\s]?line|typo|copy|label|spacing|rename|readme|docs?|간단|단순|오타|문구|라벨)/i;
10
- const SIMPLE_CODE_MOD_RE = /(tiny|simple|small|one[-\s]?line|typo|copy|label|spacing|rename|readme|docs?|minor|bounded|간단|단순|작은|오타|문구|라벨|이름\s*변경)/i;
3
+ import { ASTRA_SUBAGENT_MODEL, decideSubagentModel, subagentModelProfile } from '../subagents/model-policy.js';
11
4
  export function decideAgentEffort(input = {}) {
12
- const persona = input.persona || {};
13
- const prompt = String(input.prompt || '');
14
- const role = String(persona.role || '');
15
- const agentId = String(input.agentId || persona.id || 'agent');
16
- const text = [prompt, role, persona.risk_focus, persona.write_policy, persona.stable_id].join(' ');
17
- let effort = promptEffort(text);
18
- let reason = effortReason(effort);
19
- if (/(db|safety|security|release|schema)/i.test([role, agentId, persona.stable_id, persona.risk_focus].join(' '))) {
20
- effort = effort === 'xhigh' ? 'xhigh' : 'high';
21
- reason = 'risk_guardian_lane';
22
- }
23
- else if (/(integrator|architect|verifier)/i.test([role, agentId, persona.stable_id].join(' ')) && effort === 'low') {
24
- effort = 'medium';
25
- reason = 'planning_verification_minimum';
26
- }
27
- else if (input.readonly === true && SIMPLE_SIGNAL_RE.test(prompt) && !HIGH_SIGNAL_RE.test(text) && !MEDIUM_SIGNAL_RE.test(text)) {
28
- effort = 'low';
29
- reason = 'read_only_simple_slice';
30
- }
31
- else if (/implementer/i.test(role) && effort === 'xhigh') {
32
- effort = 'high';
33
- reason = 'implementation_lane_capped_at_high';
34
- }
35
- const modelDecision = decideAgentWorkerModel({ effort, prompt, role, agentId, readonly: input.readonly === true || persona.read_only === true, writePolicy: String(persona.write_policy || '') });
36
- const modelCapability = codexModelEffortCapability({ model: modelDecision.model, defaultEffort: modelDecision.model_reasoning_effort });
37
- return {
38
- schema: 'sks.agent-effort-decision.v1',
39
- policy_version: 1,
40
- agent_id: agentId,
41
- role,
42
- model: modelDecision.model,
43
- reasoning_effort: effort,
44
- model_reasoning_effort: modelDecision.model_reasoning_effort,
45
- model_tier: modelDecision.model_tier,
46
- model_profile: modelDecision.model_profile,
47
- model_selection_reason: modelDecision.reason,
48
- model_effort_capability: modelCapability,
49
- reasoning_profile: reasoningProfileName(effort),
50
- service_tier: 'fast',
51
- reason,
52
- dynamic: true,
53
- escalation_triggers: [
54
- 'DB/security/release/schema risk detected',
55
- 'lease conflict or proof blocker appears',
56
- 'verification fails or output schema validation fails',
57
- 'user requests real backend or broader agent fan-out'
58
- ],
59
- downshift_triggers: [
60
- 'read-only simple docs/copy slice',
61
- 'mock fixture backend with no risky file ownership',
62
- 'agent assigned narrow inventory-only work'
63
- ]
64
- };
5
+ return decideOfficialSubagentModel(input);
65
6
  }
66
7
  export function decideOfficialSubagentModel(input = {}) {
67
8
  const persona = input.persona || {};
@@ -104,7 +45,7 @@ export function decideOfficialSubagentModel(input = {}) {
104
45
  downshift_triggers: [
105
46
  'ordinary UI, logic, backend, or native implementation selects Astra High',
106
47
  'long-context, Browser/Chrome, Computer Use, image-generation, or large search selects Astra Medium',
107
- 'tiny short-context mechanical search/typing/rename work selects Luna Max'
48
+ 'tiny short-context mechanical search/typing/rename work selects Astra Low'
108
49
  ]
109
50
  };
110
51
  }
@@ -158,7 +99,7 @@ export function decideOfficialSubagentModel(input = {}) {
158
99
  downshift_triggers: [
159
100
  'ordinary UI, logic, backend, or native implementation selects Astra High',
160
101
  'long-context, Browser/Chrome, Computer Use, or image-generation execution selects Astra Medium',
161
- 'tiny short-context mechanical work selects Luna Max'
102
+ 'tiny short-context mechanical work selects Astra Low'
162
103
  ]
163
104
  };
164
105
  }
@@ -177,101 +118,41 @@ export function buildAgentEffortPolicy(roster = {}) {
177
118
  reason: agent.reasoning_reason,
178
119
  dynamic: true
179
120
  })) : [];
180
- const narutoFamilyOnly = decisions.length > 0 && decisions.every((decision) => isNarutoGpt56Model(decision.model));
181
121
  return {
182
122
  schema: 'sks.agent-effort-policy.v1',
183
123
  policy_version: 1,
184
124
  dynamic: true,
185
125
  service_tier: 'fast',
186
- model_catalog_policy: narutoFamilyOnly ? 'official_subagent_four_profile_matrix' : 'codex_catalog_passthrough',
187
- model_constraint: narutoFamilyOnly ? ['gpt-5.6-luna', 'gpt-6-astra'] : null,
188
- model_tiers: narutoFamilyOnly
189
- ? ['gpt-5.6-luna-max', 'gpt-6-astra-high', 'gpt-6-astra-max', 'gpt-6-astra-medium']
190
- : ['codex-selected-low', 'codex-selected-medium', 'codex-selected-high', 'codex-selected-xhigh', 'glm-5.2-minimal', 'glm-5.2-low', 'glm-5.2-high', 'glm-5.2-xhigh'],
191
- allowed_efforts: narutoFamilyOnly ? ['medium', 'high', 'max'] : codexModelEffortCapability().advertised_efforts,
192
- model_effort_capability: codexModelEffortCapability(),
126
+ model_catalog_policy: 'official_subagent_four_profile_matrix',
127
+ model_constraint: [ASTRA_SUBAGENT_MODEL],
128
+ model_tiers: ['low', 'medium', 'high', 'max'].map((effort) => `${ASTRA_SUBAGENT_MODEL}-${effort}`),
129
+ allowed_efforts: ['low', 'medium', 'high', 'max'],
130
+ model_effort_capability: codexModelEffortCapability({ model: ASTRA_SUBAGENT_MODEL }),
193
131
  max_agents: roster.max_agents || 20,
194
132
  agent_count: roster.agent_count || decisions.length,
195
133
  concurrency: roster.concurrency || decisions.length,
196
134
  decisions,
197
- rule: narutoFamilyOnly
198
- ? 'Official Naruto subagents use GPT-5.6 Luna Max only for tiny short-context mechanical work, GPT-6 Astra High for ordinary implementation, GPT-6 Astra Max for judgment-heavy work, and GPT-6 Astra Medium for long-context or Browser/Chrome, Computer Use, and image-generation execution. Judgment wins when one slice cannot be safely split.'
199
- : 'Codex/OpenAI workers inherit the current Codex-selected model, including future catalog entries; SKS changes only advertised reasoning effort. Explicit non-Codex provider modes retain their provider model.'
135
+ rule: 'All child agents use GPT-6 Astra: Low for tiny short-context mechanical work, Medium for reads and tool execution, High for ordinary implementation, and Max for focused judgment. The parent keeps its user-selected model.'
200
136
  };
201
137
  }
202
138
  export function reasoningProfileName(effort) {
203
139
  return 'sks-agent-' + String(effort || 'medium') + '-fast';
204
140
  }
205
- function promptEffort(text) {
206
- if (XHIGH_SIGNAL_RE.test(text))
207
- return 'xhigh';
208
- if (HIGH_SIGNAL_RE.test(text))
209
- return 'high';
210
- if (SIMPLE_SIGNAL_RE.test(text) && !MEDIUM_SIGNAL_RE.test(text))
211
- return 'low';
212
- if (MEDIUM_SIGNAL_RE.test(text))
213
- return 'medium';
214
- return 'medium';
215
- }
216
- function effortReason(effort) {
217
- if (effort === 'xhigh')
218
- return 'frontier_or_forensic_signal';
219
- if (effort === 'high')
220
- return 'safety_release_db_schema_signal';
221
- if (effort === 'low')
222
- return 'simple_bounded_slice';
223
- return 'default_orchestration_slice';
224
- }
225
141
  export function decideAgentWorkerModel(input = {}) {
226
- const mainModel = String(input.mainModel || process.env.SKS_CODEX_MODEL || process.env.CODEX_MODEL || '').trim();
227
- const glmMain = isGlmWorkerMode(mainModel);
228
- const effort = String(input.effort || 'medium');
229
- const text = [input.prompt, input.role, input.agentId, input.writePolicy].map((item) => String(item || '')).join(' ');
230
- const simpleText = [input.prompt, input.role, input.agentId].map((item) => String(item || '')).join(' ');
231
- const risky = HIGH_SIGNAL_RE.test(text) || XHIGH_SIGNAL_RE.test(text);
232
- const simple = SIMPLE_CODE_MOD_RE.test(simpleText) && !HIGH_SIGNAL_RE.test(simpleText) && !XHIGH_SIGNAL_RE.test(simpleText);
233
- if (glmMain) {
234
- const openRouterEffort = openRouterWorkerEffort({ effort, risky, simple });
235
- return {
236
- model: OPENROUTER_DEFAULT_MODEL,
237
- model_reasoning_effort: openRouterEffort,
238
- model_tier: `glm-5.2-${openRouterEffort === 'none' ? 'minimal' : openRouterEffort}`,
239
- model_profile: desktopBridgeOpenRouterProfile(openRouterEffort),
240
- reason: `desktop_bridge_openrouter_${openRouterEffort}_worker`
241
- };
242
- }
243
- const modelEffort = risky || effort === 'high' || effort === 'xhigh'
244
- ? 'high'
245
- : simple || effort === 'low'
246
- ? 'low'
247
- : 'medium';
248
- const modelLabel = mainModel || 'codex-selected';
142
+ const decision = decideOfficialSubagentModel({
143
+ persona: { role: String(input.role || ''), write_policy: String(input.writePolicy || '') },
144
+ prompt: String(input.prompt || ''),
145
+ agentId: String(input.agentId || 'agent'),
146
+ readonly: input.readonly === true
147
+ });
249
148
  return {
250
- model: mainModel,
251
- model_reasoning_effort: modelEffort,
252
- model_tier: `${modelLabel}-${modelEffort}`,
253
- model_profile: `sks-agent-${safeProfileSegment(modelLabel)}-${modelEffort}-fast`,
254
- reason: mainModel ? 'explicit_model_preserved' : 'codex_catalog_model_inherited'
149
+ model: decision.model,
150
+ model_reasoning_effort: decision.model_reasoning_effort,
151
+ model_tier: decision.model_tier,
152
+ model_profile: decision.model_profile,
153
+ reason: decision.model_selection_reason
255
154
  };
256
155
  }
257
156
  function safeProfileSegment(value) {
258
157
  return String(value || 'codex-selected').toLowerCase().replace(/[^a-z0-9.-]+/g, '-').replace(/^-+|-+$/g, '') || 'codex-selected';
259
158
  }
260
- function isGlmWorkerMode(mainModel) {
261
- const model = String(mainModel || '').trim().toLowerCase();
262
- return model === OPENROUTER_DEFAULT_MODEL
263
- || model === 'glm-5.2'
264
- || model === 'glm5.2';
265
- }
266
- function openRouterWorkerEffort(input) {
267
- if (input.effort === 'xhigh')
268
- return 'xhigh';
269
- if (input.risky || input.effort === 'high')
270
- return 'high';
271
- if (input.simple || input.effort === 'low')
272
- return 'minimal';
273
- return 'low';
274
- }
275
- function desktopBridgeOpenRouterProfile(effort) {
276
- return `desktop-bridge-openrouter-${effort}`;
277
- }
@@ -1925,12 +1925,12 @@ function buildProvidedAgentRoster(input, opts = {}) {
1925
1925
  index: index + 1,
1926
1926
  write_policy: String(entry.write_policy || (readOnly ? 'read-only' : 'route-local-artifact')),
1927
1927
  status: 'pending',
1928
- model: entry.model || modelDecision.model,
1928
+ model: modelDecision.model,
1929
1929
  reasoning_effort: reasoningEffort,
1930
1930
  model_reasoning_effort: modelReasoningEffort,
1931
- model_tier: entry.model_tier || modelDecision.model_tier,
1932
- model_profile: entry.model_profile || modelDecision.model_profile,
1933
- model_selection_reason: entry.model_selection_reason || modelDecision.reason,
1931
+ model_tier: modelDecision.model_tier,
1932
+ model_profile: modelDecision.model_profile,
1933
+ model_selection_reason: modelDecision.reason,
1934
1934
  reasoning_profile: entry.reasoning_profile || (readOnly ? 'sks-logic-high' : 'sks-logic-medium'),
1935
1935
  service_tier: entry.service_tier,
1936
1936
  reasoning_reason: entry.reasoning_reason || 'route_native_agent_plan',
@@ -10,7 +10,7 @@ import { leanEngineeringCompactText, leanPolicyReference } from '../lean-enginee
10
10
  import { readCodexLbModelCatalog, readLbHealth } from '../codex-lb/codex-lb-env.js';
11
11
  import { categoryForWorkerRole, isNarutoGpt56Model, modelRouteReason, routeModel } from '../provider/model-router.js';
12
12
  import { codexTimeoutClassForRoute } from '../codex-control/codex-reliability-shield.js';
13
- import { readConfiguredCodexModelRoutingContext } from '../codex-app/codex-model-catalog.js';
13
+ import { ASTRA_SUBAGENT_MODEL, decideSubagentModel } from '../subagents/model-policy.js';
14
14
  export const NATIVE_WORKER_BACKEND_ROUTER_SCHEMA = 'sks.native-worker-backend-router.v1';
15
15
  export async function runNativeWorkerBackendRouter(input) {
16
16
  const root = path.resolve(input.agentRoot);
@@ -227,22 +227,8 @@ export async function resolveWorkerModelRouting(input, deps = {}) {
227
227
  const riskText = [taskKindText, input.slice?.risk, input.slice?.risk_focus, input.slice?.acceptance, input.slice?.parent_prompt, input.slice?.description, input.intake?.prompt].map((value) => String(value || '')).join(' ');
228
228
  const category = categoryForWorkerRole(String(input.agent?.role || 'executor'), taskKindText);
229
229
  const env = deps.env || process.env;
230
- const configuredRouting = !Object.prototype.hasOwnProperty.call(deps, 'env') || env.CODEX_HOME || env.HOME
231
- ? await readConfiguredCodexModelRoutingContext({ env }).catch(() => null)
232
- : null;
233
- const sealedPlanModel = ['user_role_model_preference', 'active_main_model'].includes(String(input.agent?.routed_model_policy || ''))
234
- ? String(input.agent?.routed_model || '').trim()
235
- : '';
236
- const configuredMainModel = String(input.intake?.main_model
237
- || input.intake?.selected_model
238
- || input.intake?.provider_model
239
- || configuredRouting?.selected_model
240
- || '').trim();
241
- const managedAgentModel = String(input.agent?.model || '').trim();
242
- const inheritedModel = sealedPlanModel || configuredMainModel || managedAgentModel;
243
- const providerModelSelected = Boolean(sealedPlanModel || configuredMainModel);
244
230
  const lbHealth = Object.prototype.hasOwnProperty.call(deps, 'lbHealth') ? deps.lbHealth : await readLbHealth().catch(() => null);
245
- const lbCatalog = narutoOnly && !providerModelSelected
231
+ const lbCatalog = narutoOnly
246
232
  ? Object.prototype.hasOwnProperty.call(deps, 'lbCatalog')
247
233
  ? deps.lbCatalog
248
234
  : input.intake?.naruto_model_catalog || await readCodexLbModelCatalog().catch(() => null)
@@ -255,35 +241,31 @@ export async function resolveWorkerModelRouting(input, deps = {}) {
255
241
  const explicitNarutoModelInvalid = narutoOnly && Boolean(explicitModel) && !isNarutoGpt56Model(explicitModel);
256
242
  const explicitNarutoReasoningInvalid = narutoOnly && Boolean(explicitReasoningRaw) && !explicitReasoning;
257
243
  const explicitNarutoTierInvalid = narutoOnly && Boolean(explicitTierRaw) && !explicitTier;
258
- const inheritedReasoning = normalizeModelReasoning(sealedPlanModel
259
- ? input.agent?.routed_model_reasoning_effort
260
- : input.agent?.model_reasoning_effort);
261
- const routed = providerModelSelected
262
- ? {
263
- model: inheritedModel,
264
- reasoning: explicitReasoning || inheritedReasoning || 'medium',
244
+ const savedAstraEffort = input.agent?.routed_model_policy === 'user_role_model_preference'
245
+ && input.agent?.routed_model === ASTRA_SUBAGENT_MODEL
246
+ ? normalizeModelReasoning(input.agent?.routed_model_reasoning_effort)
247
+ : null;
248
+ const taskPolicy = decideSubagentModel({ title: taskKindText, description: riskText, role: input.agent?.role });
249
+ const routed = narutoOnly
250
+ ? await routeModel(category, {
251
+ lbHealth,
252
+ narutoOnly: true,
253
+ taskText: taskKindText,
254
+ riskText,
255
+ reasoningEffort: savedAstraEffort,
256
+ availableModels: lbCatalog?.models || [],
257
+ availableModelEfforts: lbCatalog?.model_efforts || {},
258
+ ...(explicitModel ? { model: explicitModel } : {})
259
+ })
260
+ : {
261
+ model: ASTRA_SUBAGENT_MODEL,
262
+ reasoning: explicitReasoning || savedAstraEffort || taskPolicy.modelReasoningEffort,
265
263
  serviceTier: explicitTier || input.fastModePolicy.service_tier || 'fast'
266
- }
267
- : explicitModel && !narutoOnly
268
- ? {
269
- model: explicitModel,
270
- reasoning: explicitReasoning || inheritedReasoning || 'medium',
271
- serviceTier: explicitTier || input.fastModePolicy.service_tier || 'fast'
272
- }
273
- : await routeModel(category, {
274
- lbHealth,
275
- ...(narutoOnly ? {
276
- narutoOnly: true,
277
- taskText: taskKindText,
278
- riskText,
279
- availableModels: lbCatalog?.models || [],
280
- availableModelEfforts: lbCatalog?.model_efforts || {},
281
- ...(explicitModel ? { model: explicitModel } : {})
282
- } : { model: inheritedModel || null })
283
- });
264
+ };
284
265
  const blockers = [
285
- ...(narutoOnly && !providerModelSelected && !lbCatalog?.ok ? (lbCatalog?.blockers || ['codex_lb_model_catalog_unavailable']) : []),
266
+ ...(narutoOnly && !lbCatalog?.ok ? (lbCatalog?.blockers || ['codex_lb_model_catalog_unavailable']) : []),
286
267
  ...(explicitNarutoModelInvalid ? ['naruto_worker_model_outside_gpt_5_6_family'] : []),
268
+ ...(!narutoOnly && explicitModel && explicitModel !== ASTRA_SUBAGENT_MODEL ? ['subagent_model_must_be_astra'] : []),
287
269
  ...(explicitNarutoReasoningInvalid ? ['naruto_reasoning_override_invalid'] : []),
288
270
  ...(explicitNarutoTierInvalid ? ['naruto_service_tier_override_invalid'] : []),
289
271
  ...(narutoOnly && explicitReasoning && explicitReasoning !== routed.reasoning ? ['naruto_reasoning_override_conflicts_with_policy'] : []),
@@ -293,12 +275,12 @@ export async function resolveWorkerModelRouting(input, deps = {}) {
293
275
  return {
294
276
  category,
295
277
  choice: routed,
296
- explicit: Boolean(explicitModel || providerModelSelected),
278
+ explicit: Boolean(explicitModel),
297
279
  lb_health: lbHealth,
298
280
  lb_catalog: lbCatalog,
299
281
  blockers: [...new Set(blockers)],
300
282
  reason: modelRouteReason(category, routed, {
301
- explicit: Boolean(explicitModel || providerModelSelected),
283
+ explicit: Boolean(explicitModel),
302
284
  quotaLow: lbHealth?.quota_low === true,
303
285
  degraded: lbHealth?.degraded_models || []
304
286
  })
@@ -1,3 +1,4 @@
1
+ import { IMAGEGEN_MODEL } from '../imagegen/imagegen-model-policy.js';
1
2
  import path from 'node:path';
2
3
  import { nowIso, readJson, readText, writeJsonAtomic } from '../fsx.js';
3
4
  export const OFFICIAL_SUBAGENT_HELPER_POLICY_SCHEMA = 'sks.official-subagent-helper-policy.v1';
@@ -42,7 +43,7 @@ export async function writeOfficialSubagentHelperPolicy(root, input = {}) {
42
43
  built_in_agents_allowed: builtInAgentsAllowed,
43
44
  codex_app_capabilities_allowed: codexAppCapabilitiesAllowed,
44
45
  codex_builtin_imagegen_helper_allowed: true,
45
- preferred_image_generation_surface: 'Codex App $imagegen/gpt-image-2',
46
+ preferred_image_generation_surface: ("Selected image provider: " + IMAGEGEN_MODEL + ""),
46
47
  codex_app_builtin_evidence_class: 'codex_app_builtin',
47
48
  api_fallback_evidence_class: 'api_fallback',
48
49
  provider_surface_evidence_required: true,
@@ -69,7 +69,7 @@ export const TRUST_VALIDATE_BENCH_COMMAND = 'sks trust validate bench-fixture --
69
69
  export const CORE_BENCH_WARMUP_ITERATIONS = 1;
70
70
  export const UX_REVIEW_STAGED_LATENCY_BUDGETS = Object.freeze({
71
71
  source_screenshot_ingest: 500,
72
- gpt_image_2_generation: 120_000,
72
+ imagegen_generation: 120_000,
73
73
  callout_extraction: 120_000,
74
74
  fix_task_planning: 500,
75
75
  recapture_re_review: 120_000,