@ngockhoale/ukit 1.2.1 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,13 @@ All notable changes to UKit are documented here.
4
4
 
5
5
  ## Unreleased
6
6
 
7
+ ## 1.2.2 - 2026-05-05
8
+
9
+ - Removed the `.claude/ukit/.env` / `.env.example` config surface so UKit runtime tuning lives in `.ukit/storage/config.json` only.
10
+ - Added full Vietnamese `_help` guidance inside `templates/ukit/storage/config.json`, including common edits for changing the internal model and Codex compact thresholds.
11
+ - Set Codex Desktop compact budget default to 100,000 tokens as a quality/safety balance, with compact handoff target 150 lines and hard max 170 lines.
12
+ - Preserved Claude PreCompact/reinject and OpenCode native auto/prune compaction while keeping `ukit-small-task-maintainer` as a non-blocking sidecar lane.
13
+
7
14
  ## 1.2.1 - 2026-05-05
8
15
 
9
16
  ### Local AI Task Queue
@@ -13,7 +20,7 @@ All notable changes to UKit are documented here.
13
20
  - Added safe default cleanup rules: remove exact duplicates, prune `Done Recently` to 10 compact lines, move stale/vague work to deferred review, and never delete unfinished human-authored tasks unless explicitly asked and clearly obsolete/duplicated.
14
21
  - Updated `next-step`, `update-status`, and `docs-quality` guidance plus route signals so queued-task selection goes to `next-step` while task cleanup/editing goes to `docs-quality`.
15
22
  - Added `docs/STATUS.md` and `docs/TASKS.md` to generated gitignore handling so living local AI state does not pollute project commits.
16
- - Added the internal `ukit-small-task-maintainer` subagent, powered by optional `UKIT_SMALL_TASK_MODEL=unic-lite`, for safe UKit decisions such as task cleanup, compact decisions, doc summarization, classification, auto-triage, queue maintenance, and small reversible cleanup while keeping risky/security/release work on the main model.
23
+ - Added the internal `ukit-small-task-maintainer` subagent, powered by optional `subagents.smallTaskModel=unic-lite`, for safe UKit decisions such as task cleanup, compact decisions, doc summarization, classification, auto-triage, queue maintenance, and small reversible cleanup while keeping risky/security/release work on the main model.
17
24
 
18
25
  ## 1.1.8 - 2026-05-05
19
26
 
package/README.md CHANGED
@@ -68,7 +68,7 @@ If maintainers roll out a newer CLI build, the in-project workflow still stays t
68
68
  - `.ukit/` — hidden shared runtime storage for config, cache, and cross-agent memory
69
69
  - `docs/` — PROJECT / MEMORY / STATUS / TASKS / WORKLOG baseline
70
70
 
71
- ## UKit v1.2.1 Runtime
71
+ ## UKit v1.2.2 Runtime
72
72
 
73
73
  UKit now installs a hidden shared local runtime at `.ukit/` for production-oriented state that should survive across agent sessions:
74
74
 
@@ -85,7 +85,7 @@ When long sessions approach the compact threshold, UKit now uses a conservative
85
85
  - compact only safe-zone history/noise
86
86
  - preserve active task, rules, decisions, and current code focus
87
87
 
88
- UKit v1.2.1 keeps the same shared runtime contract while adding a local AI task queue alongside living project status routing:
88
+ UKit v1.2.2 keeps the same shared runtime contract while adding a local AI task queue alongside living project status routing:
89
89
 
90
90
  - install globally with `npm install -g @ngockhoale/ukit`
91
91
  - keep using the exact same human workflow inside projects: `ukit install`
@@ -96,7 +96,7 @@ UKit v1.2.1 keeps the same shared runtime contract while adding a local AI task
96
96
  - auto-route explicit handoff/wrap-up requests to the `update-status` skill while skipping trivial/no-state-change tasks
97
97
  - keep concrete debug/implementation/review prompts primary, so project status never replaces source/index-first task work
98
98
 
99
- UKit v1.2.1 also keeps the fast path improvements from the recent runtime releases:
99
+ UKit v1.2.2 also keeps the fast path improvements from the recent runtime releases:
100
100
 
101
101
  - Vietnamese prompts now normalize more effectively for English-heavy code symbols and paths
102
102
  - localized simple direct-target lanes skip extra previous-context / recent-output work when it would not change the next action
@@ -131,8 +131,8 @@ UKit is built so the team can stop memorizing UKit subcommands and focus on prod
131
131
  - let Claude Code / Codex / OpenCode auto-detect and use the right project-local skill from the prompt and the files/tools involved
132
132
  - let the AI prefer targeted verification first, then widen only when shared/risky scope justifies it
133
133
  - let the AI selectively auto-delegate internal subagents only when that actually reduces context/noise or unlocks parallel progress; small localized work should stay direct
134
- - keep long sessions compact across agents: Claude keeps PreCompact/reinject, OpenCode keeps native auto/prune compaction, and Codex Desktop uses internal `UKIT_CODEX_COMPACT_TARGET` soft handoffs (default 150 lines; 120-150 preferred, hard max 170), without asking end users to manage context manually
135
- - let UKit internally use the `ukit-small-task-maintainer` subagent with `UKIT_SMALL_TASK_MODEL=unic-lite` for safe task cleanup, fast-vs-slow/safe-vs-risky lane hints, skill-routing/step-budget hints, agent context-budget decisions, compact decisions, doc summarization, classification, and queue maintenance while risky/security/release/quality-risk work stays on the main model
134
+ - keep long sessions compact across agents: Claude keeps PreCompact/reinject, OpenCode keeps native auto/prune compaction, and Codex Desktop uses internal `compact.codexContext.compactTarget` soft handoffs (default 150 lines; 120-150 preferred, hard max 170), without asking end users to manage context manually
135
+ - let UKit internally use the `ukit-small-task-maintainer` subagent with `subagents.smallTaskModel=unic-lite` for safe task cleanup, fast-vs-slow/safe-vs-risky lane hints, skill-routing/step-budget hints, agent context-budget decisions, compact decisions, doc summarization, classification, and queue maintenance while risky/security/release/quality-risk work stays on the main model
136
136
  - rerun `ukit install` when you need to refresh the workspace
137
137
 
138
138
  End users should **not** need to know or memorize skill names.
@@ -77,18 +77,6 @@ items:
77
77
  packs:
78
78
  - core
79
79
 
80
- - id: ukit-env-example
81
- type: config
82
- sourceTemplate: .claude/ukit/.env.example
83
- targetPath: .claude/ukit/.env.example
84
- requires:
85
- - runtime-config
86
- mergeStrategy: overwrite_with_backup
87
- variables: []
88
- enabledByDefault: true
89
- packs:
90
- - core
91
-
92
80
  - id: root-claude-md
93
81
  type: config
94
82
  sourceTemplate: CLAUDE.md
@@ -824,7 +812,7 @@ items:
824
812
  sourceTemplate: .claude/agents/ukit-small-task-maintainer.md
825
813
  targetPath: .claude/agents/ukit-small-task-maintainer.md
826
814
  requires:
827
- - ukit-env-example
815
+ - runtime-config
828
816
  mergeStrategy: overwrite_with_backup
829
817
  variables:
830
818
  - ukit.version
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngockhoale/ukit",
3
- "version": "1.2.1",
3
+ "version": "1.2.2",
4
4
  "description": "Install/update an index-first AI workspace for Claude Code, Antigravity, OpenAI Codex, and OpenCode.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -18,6 +18,10 @@ const AUTO_PRUNE_OBSOLETE_PREFIXES = [
18
18
  '.claude/skills/',
19
19
  ];
20
20
 
21
+ const AUTO_PRUNE_OBSOLETE_PATHS = new Set([
22
+ '.claude/ukit/.env.example',
23
+ ]);
24
+
21
25
  function normalizeRelativePath(relativePath) {
22
26
  if (typeof relativePath !== 'string') {
23
27
  return null;
@@ -49,7 +53,8 @@ function buildTrackedManagedRelativePathSet(plan, projectRoot) {
49
53
  }
50
54
 
51
55
  function shouldAutoPruneObsoletePath(relativePath) {
52
- return AUTO_PRUNE_OBSOLETE_PREFIXES.some((prefix) => relativePath.startsWith(prefix));
56
+ return AUTO_PRUNE_OBSOLETE_PATHS.has(relativePath)
57
+ || AUTO_PRUNE_OBSOLETE_PREFIXES.some((prefix) => relativePath.startsWith(prefix));
53
58
  }
54
59
 
55
60
  async function isDirEmpty(dirPath) {
@@ -45,103 +45,11 @@ function pushNonEmptyStringError(errors, value, label) {
45
45
  }
46
46
  }
47
47
 
48
- function parseRuntimeEnv(content = '') {
49
- const result = {};
50
- for (const rawLine of String(content || '').split(/\r?\n/)) {
51
- const line = rawLine.trim();
52
- if (!line || line.startsWith('#') || !line.includes('=')) {
53
- continue;
54
- }
55
- const index = line.indexOf('=');
56
- const key = line.slice(0, index).trim();
57
- let value = line.slice(index + 1).trim();
58
- if (
59
- (value.startsWith('"') && value.endsWith('"'))
60
- || (value.startsWith("'") && value.endsWith("'"))
61
- ) {
62
- value = value.slice(1, -1);
63
- }
64
- result[key] = value;
65
- }
66
- return result;
67
- }
68
-
69
- async function loadRuntimeEnv(projectRoot) {
70
- const envPath = path.join(projectRoot, '.claude', 'ukit', '.env');
71
- try {
72
- return parseRuntimeEnv(await fs.readFile(envPath, 'utf8'));
73
- } catch (error) {
74
- if (error?.code !== 'ENOENT') {
75
- throw error;
76
- }
77
- return {};
78
- }
79
- }
80
-
81
- function parsePositiveIntegerEnv(value) {
82
- if (typeof value !== 'string' || value.trim() === '') {
83
- return null;
84
- }
85
- const parsed = Number.parseInt(value.trim(), 10);
86
- return Number.isFinite(parsed) && parsed > 0 ? parsed : null;
87
- }
88
-
89
- function buildEnvOverrides(env = process.env) {
90
- const overrides = {};
91
- const smallTaskModel = env.UKIT_SMALL_TASK_MODEL;
92
- if (typeof smallTaskModel === 'string' && smallTaskModel.trim() !== '') {
93
- overrides.subagents = {
94
- ...(overrides.subagents ?? {}),
95
- smallTaskModel: smallTaskModel.trim(),
96
- };
97
- }
98
-
99
- const rawCodexCompactTarget = parsePositiveIntegerEnv(env.UKIT_CODEX_COMPACT_TARGET);
100
- const codexCompactTarget = rawCodexCompactTarget ? Math.min(rawCodexCompactTarget, 170) : null;
101
- const codexContextBudget = parsePositiveIntegerEnv(env.UKIT_CODEX_CONTEXT_BUDGET);
102
- const codexAutoCompact = typeof env.UKIT_CODEX_AUTO_COMPACT === 'string'
103
- ? !['0', 'false', 'no', 'off'].includes(env.UKIT_CODEX_AUTO_COMPACT.trim().toLowerCase())
104
- : null;
105
-
106
- if (codexCompactTarget || codexContextBudget || codexAutoCompact !== null) {
107
- overrides.compact = {
108
- ...(overrides.compact ?? {}),
109
- agentContext: {
110
- enabled: true,
111
- decisionModelEnv: 'UKIT_SMALL_TASK_MODEL',
112
- decisionAgent: 'ukit-small-task-maintainer',
113
- executionMode: 'sidecar-parallel',
114
- mustNotBlockMainTask: true,
115
- targets: {
116
- claude: { autoCompact: true, mode: 'precompact-reinject', preserveExistingHooks: true },
117
- opencode: { autoCompact: true, mode: 'native-auto-prune', preserveExistingCompaction: true },
118
- codex: {
119
- autoCompact: true,
120
- mode: 'soft-handoff',
121
- compactTarget: 150,
122
- compactTargetUnit: 'lines',
123
- compactTargetRecommendedRange: [120, 170],
124
- compactTargetMax: 170,
125
- },
126
- },
127
- },
128
- codexContext: {
129
- ...(overrides.compact?.codexContext ?? {}),
130
- ...(codexCompactTarget ? { compactTarget: codexCompactTarget } : {}),
131
- ...(codexContextBudget ? { budgetTokens: codexContextBudget } : {}),
132
- ...(codexAutoCompact !== null ? { autoCompact: codexAutoCompact } : {}),
133
- },
134
- };
135
- }
136
-
137
- return overrides;
138
- }
139
-
140
48
  export function buildDefaultRuntimeConfig(overrides = {}) {
141
49
  const safeOverrides = isPlainObject(overrides) ? overrides : {};
142
50
 
143
51
  return mergeObjects({
144
- version: '1.2.1',
52
+ version: '1.2.2',
145
53
  agent: 'claude-code',
146
54
  compact: {
147
55
  enabled: true,
@@ -150,7 +58,6 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
150
58
  askBeforeDrop: true,
151
59
  agentContext: {
152
60
  enabled: true,
153
- decisionModelEnv: 'UKIT_SMALL_TASK_MODEL',
154
61
  decisionAgent: 'ukit-small-task-maintainer',
155
62
  executionMode: 'sidecar-parallel',
156
63
  mustNotBlockMainTask: true,
@@ -170,12 +77,11 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
170
77
  codexContext: {
171
78
  enabled: true,
172
79
  autoCompact: true,
173
- budgetTokens: 60_000,
80
+ budgetTokens: 100_000,
174
81
  compactTarget: 150,
175
82
  compactTargetUnit: 'lines',
176
83
  compactTargetRecommendedRange: [120, 170],
177
84
  compactTargetMax: 170,
178
- decisionModelEnv: 'UKIT_SMALL_TASK_MODEL',
179
85
  decisionAgent: 'ukit-small-task-maintainer',
180
86
  mode: 'soft-handoff',
181
87
  preserve: [
@@ -292,7 +198,6 @@ export function validateRuntimeConfig(config) {
292
198
  errors.push('compact.agentContext must be an object.');
293
199
  } else {
294
200
  pushBooleanError(errors, config.compact.agentContext.enabled, 'compact.agentContext.enabled');
295
- pushNonEmptyStringError(errors, config.compact.agentContext.decisionModelEnv, 'compact.agentContext.decisionModelEnv');
296
201
  pushNonEmptyStringError(errors, config.compact.agentContext.decisionAgent, 'compact.agentContext.decisionAgent');
297
202
  pushNonEmptyStringError(errors, config.compact.agentContext.executionMode, 'compact.agentContext.executionMode');
298
203
  pushBooleanError(errors, config.compact.agentContext.mustNotBlockMainTask, 'compact.agentContext.mustNotBlockMainTask');
@@ -315,7 +220,6 @@ export function validateRuntimeConfig(config) {
315
220
  if (Number(config.compact.codexContext.compactTarget) > Number(config.compact.codexContext.compactTargetMax)) {
316
221
  errors.push('compact.codexContext.compactTarget must be <= compact.codexContext.compactTargetMax.');
317
222
  }
318
- pushNonEmptyStringError(errors, config.compact.codexContext.decisionModelEnv, 'compact.codexContext.decisionModelEnv');
319
223
  pushNonEmptyStringError(errors, config.compact.codexContext.decisionAgent, 'compact.codexContext.decisionAgent');
320
224
  pushNonEmptyStringError(errors, config.compact.codexContext.mode, 'compact.codexContext.mode');
321
225
  if (!Array.isArray(config.compact.codexContext.preserve)) {
@@ -407,31 +311,19 @@ export async function inspectRuntimeConfig(projectRoot) {
407
311
  }
408
312
  }
409
313
 
410
- let runtimeEnv = {};
411
- let envError = null;
412
- try {
413
- runtimeEnv = await loadRuntimeEnv(projectRoot);
414
- } catch (error) {
415
- envError = error?.message ?? String(error);
416
- }
417
-
418
- const config = buildDefaultRuntimeConfig(
419
- mergeObjects(rawConfig ?? {}, buildEnvOverrides({ ...runtimeEnv, ...process.env })),
420
- );
314
+ const config = buildDefaultRuntimeConfig(rawConfig ?? {});
421
315
  const validation = validateRuntimeConfig(config);
422
316
  const errors = [
423
317
  ...(parseError ? [`config.json parse error: ${parseError}`] : []),
424
- ...(envError ? [`runtime .env error: ${envError}`] : []),
425
318
  ...validation.errors,
426
319
  ];
427
320
 
428
321
  return {
429
322
  exists,
430
323
  rawConfig,
431
- runtimeEnv,
432
324
  config,
433
325
  parseError,
434
- valid: exists && !parseError && !envError && validation.valid,
326
+ valid: exists && !parseError && validation.valid,
435
327
  errors,
436
328
  };
437
329
  }
@@ -6,13 +6,13 @@ color: cyan
6
6
  tools: ["Read", "Grep", "Glob", "Edit", "Write"]
7
7
  ---
8
8
 
9
- You are UKit's internal small-task maintainer. You run as a sidecar/parallel/non-blocking lane for safe, reversible UKit orchestration chores so the end user can stay focused on product work and only remember `ukit install`. You must follow `docs/UKIT_CODEV_PRINCIPLES.md`: hide complexity, preserve output quality, and never trade correctness for speed or token savings.
9
+ You are UKit's internal small-task maintainer. You run as a sidecar/parallel/non-blocking lane for safe, reversible UKit orchestration chores so the end user can stay focused on product work and only remember `ukit install`. Runtime tuning lives in `.ukit/storage/config.json`. You must follow `docs/UKIT_CODEV_PRINCIPLES.md`: hide complexity, preserve output quality, and never trade correctness for speed or token savings.
10
10
 
11
11
  ## Model Policy
12
12
 
13
- - Use the model selected by `UKIT_SMALL_TASK_MODEL` when the host supports model selection for this subagent.
13
+ - Use the model selected by `subagents.smallTaskModel` when the host supports model selection for this subagent.
14
14
  - Default intended model: `unic-lite`.
15
- - If the host cannot bind a model from env directly, still follow this role and report that the configured model is a hint.
15
+ - If the host cannot bind a model from config directly, still follow this role and report that the configured model is a hint.
16
16
  - This lane must run separately from the user's main task model. It must never replace, pause, or slow down the main task.
17
17
 
18
18
  ## Use For
@@ -24,7 +24,7 @@ You are UKit's internal small-task maintainer. You run as a sidecar/parallel/non
24
24
  - Summarizing `docs/STATUS.md`, `docs/TASKS.md`, `docs/WORKLOG.md`, or memory snippets into compact handoff notes.
25
25
  - Deciding fast vs slow lane, safe vs risky lane, whether a skill should be activated, and whether the current prompt has enough steps planned.
26
26
  - Choosing compact-now vs compact-later and summarize-vs-keep-detail for UKit context hygiene.
27
- - Keeping agent context compact without removing existing lanes: Claude PreCompact/reinject stays active, OpenCode native auto/prune compaction stays active, and Codex Desktop soft handoffs use `UKIT_CODEX_COMPACT_TARGET` (default 150 lines; preferred 120-150; hard max 170) while preserving critical state.
27
+ - Keeping agent context compact without removing existing lanes: Claude PreCompact/reinject stays active, OpenCode native auto/prune compaction stays active, and Codex Desktop soft handoffs use `compact.codexContext.compactTarget` (default 150 lines; preferred 120-150; hard max 170) while preserving critical state.
28
28
  - Small, reversible UKit runtime maintenance decisions.
29
29
 
30
30
  ## Never Use For
@@ -53,7 +53,7 @@ You are UKit's internal small-task maintainer. You run as a sidecar/parallel/non
53
53
 
54
54
  ```
55
55
  STATUS: DONE | SKIPPED | HAND_BACK
56
- MODEL_HINT: UKIT_SMALL_TASK_MODEL=<value-or-default>
56
+ MODEL_HINT: subagents.smallTaskModel=<value-or-default>
57
57
  SUMMARY: [one sentence]
58
58
  CHANGES:
59
59
  - [file/area]: [what changed]
@@ -12,7 +12,7 @@ Auto-generated by UKit for OpenAI Codex.
12
12
  - Do not make end users memorize skill names, helper scripts, or routing internals unless they are debugging UKit itself.
13
13
  - **Treat helper commands as internal orchestration. Do not ask end users to run them.**
14
14
 
15
- ## UKit v1.2.1 Shared Runtime
15
+ ## UKit v1.2.2 Shared Runtime
16
16
 
17
17
  - Shared runtime state lives in `.ukit/storage/`.
18
18
  - Treat `.ukit/storage/config.json` as the source of compact, token-pipeline, router, memory, and validation toggles.
@@ -23,7 +23,7 @@ Auto-generated by UKit for OpenAI Codex.
23
23
  - Maintainers can inspect runtime state with `ukit status` and `ukit memory export`.
24
24
  - Reuse compact `previous-context` / `recent-output` route snapshots before replaying raw history.
25
25
  - Threshold-based compact pressure is internal orchestration; Codex users should not need to manage it manually.
26
- - UKit keeps Claude PreCompact/reinject and OpenCode native auto/prune compaction intact. For Codex Desktop long sessions, UKit can use `UKIT_SMALL_TASK_MODEL` through `ukit-small-task-maintainer` to decide soft auto-compact handoffs. Default `UKIT_CODEX_COMPACT_TARGET=150` means about 150 compact handoff lines (120-150 preferred, hard max 170), not 150 app-context tokens.
26
+ - UKit keeps Claude PreCompact/reinject and OpenCode native auto/prune compaction intact. For Codex Desktop long sessions, UKit can use `subagents.smallTaskModel` through `ukit-small-task-maintainer` to decide soft auto-compact handoffs. Default `compact.codexContext.compactTarget=150` means about 150 compact handoff lines (120-150 preferred, hard max 170), not 150 app-context tokens.
27
27
 
28
28
  ## Speed / Reading Contract
29
29
 
@@ -148,7 +148,6 @@
148
148
  }
149
149
  },
150
150
  "smallTaskModel": {
151
- "env": "UKIT_SMALL_TASK_MODEL",
152
151
  "default": "unic-lite",
153
152
  "agent": "ukit-small-task-maintainer",
154
153
  "useFor": [
@@ -209,12 +208,9 @@
209
208
  },
210
209
  "codexContext": {
211
210
  "autoCompact": true,
212
- "budgetTokens": 60000,
211
+ "budgetTokens": 100000,
213
212
  "compactTarget": 150,
214
213
  "compactTargetUnit": "lines",
215
- "targetEnv": "UKIT_CODEX_COMPACT_TARGET",
216
- "budgetEnv": "UKIT_CODEX_CONTEXT_BUDGET",
217
- "autoCompactEnv": "UKIT_CODEX_AUTO_COMPACT",
218
214
  "mode": "soft-handoff",
219
215
  "preserve": [
220
216
  "current-goal",
@@ -229,19 +225,20 @@
229
225
  120,
230
226
  170
231
227
  ],
232
- "compactTargetMax": 170
228
+ "compactTargetMax": 170,
229
+ "configPath": ".ukit/storage/config.json",
230
+ "targetField": "compact.codexContext.compactTarget",
231
+ "budgetField": "compact.codexContext.budgetTokens",
232
+ "autoCompactField": "compact.codexContext.autoCompact"
233
233
  },
234
234
  "agentContext": {
235
235
  "preserveClaudePreCompact": true,
236
236
  "preserveOpenCodeCompaction": true,
237
237
  "codexSoftHandoff": {
238
238
  "autoCompact": true,
239
- "budgetTokens": 60000,
239
+ "budgetTokens": 100000,
240
240
  "compactTarget": 150,
241
241
  "compactTargetUnit": "lines",
242
- "targetEnv": "UKIT_CODEX_COMPACT_TARGET",
243
- "budgetEnv": "UKIT_CODEX_CONTEXT_BUDGET",
244
- "autoCompactEnv": "UKIT_CODEX_AUTO_COMPACT",
245
242
  "mode": "soft-handoff",
246
243
  "preserve": [
247
244
  "current-goal",
@@ -258,7 +255,9 @@
258
255
  ],
259
256
  "compactTargetMax": 170
260
257
  }
261
- }
258
+ },
259
+ "configPath": ".ukit/storage/config.json",
260
+ "configField": "subagents.smallTaskModel"
262
261
  }
263
262
  },
264
263
  "execution": {
@@ -18,7 +18,6 @@ out/
18
18
  .env.development.local
19
19
  .env.test.local
20
20
  .env.production.local
21
- .claude/ukit/.env
22
21
 
23
22
  # Logs
24
23
  logs/
@@ -43,7 +43,7 @@
43
43
  - If a concrete verification lane is needed, prefer `node .claude/ukit/index/verify-context.mjs ...`.
44
44
  - These helper/index commands are internal orchestration. Run them yourself when needed; never turn them into required end-user workflow.
45
45
 
46
- ## UKit v1.2.1 Shared Runtime
46
+ ## UKit v1.2.2 Shared Runtime
47
47
 
48
48
  - Shared runtime state lives in `.ukit/storage/`.
49
49
  - Treat `.ukit/storage/config.json` as the source of runtime toggles for compact, token pipeline, router, memory, and validation behavior.
@@ -78,10 +78,10 @@
78
78
 
79
79
  ## Small-Task Maintainer (internal)
80
80
 
81
- - UKit may route low-risk internal decisions to the `ukit-small-task-maintainer` subagent using `UKIT_SMALL_TASK_MODEL` (default `unic-lite`).
81
+ - UKit may route low-risk internal decisions to the `ukit-small-task-maintainer` subagent using `subagents.smallTaskModel` (default `unic-lite`).
82
82
  - Use it for safe/reversible UKit chores: dọn `docs/TASKS.md`, queued-task classification, fast-vs-slow/safe-vs-risky lane decisions, skill-routing/step-budget hints, agent context-budget decisions, compact/summary decisions, docs/status summarization, auto-triage, queue maintenance, and small workspace cleanup.
83
83
  - Run it as a sidecar/parallel lane only; do not block, replace, or slow the user task. Do not block the main AI flow: if the small-task lane sees security, risky/shared code, release/publish, data-loss, architecture, deep-reasoning risk, weak context, or quality risk, it hands back to the main model instead of asking the end user to decide.
84
- - This is optional internal orchestration config from `.claude/ukit/.env` / `.ukit/storage/config.json`; never turn it into an end-user workflow. End users still only need `ukit install` and natural-language product work. Always preserve the CoDev priority: quality > safety > speed > token discipline. Keep Claude PreCompact/reinject and OpenCode native auto/prune compaction enabled. For Codex Desktop long sessions, `UKIT_CODEX_COMPACT_TARGET` defaults to 150 compact handoff lines (120-150 preferred, hard max 170), decided internally by the small-task maintainer.
84
+ - This is optional internal orchestration config from `.ukit/storage/config.json`; never turn it into an end-user workflow. End users still only need `ukit install` and natural-language product work. Always preserve the CoDev priority: quality > safety > speed > token discipline. Keep Claude PreCompact/reinject and OpenCode native auto/prune compaction enabled. For Codex Desktop long sessions, `compact.codexContext.compactTarget` defaults to 150 compact handoff lines (120-150 preferred, hard max 170), decided internally by the small-task maintainer.
85
85
 
86
86
  ## Subagent Policy (internal only)
87
87
 
@@ -42,7 +42,7 @@
42
42
  - **Do not ask normal contributors to run internal helper commands**; run them yourself or tell them to rerun `ukit install`.
43
43
  - Do not ask normal contributors to memorize `ukit doctor`, `ukit diff`, `ukit uninstall`, or `ukit index ...` unless they explicitly need maintainer/debug help.
44
44
 
45
- ## UKit v1.2.1 Shared Runtime
45
+ ## UKit v1.2.2 Shared Runtime
46
46
 
47
47
  - Shared runtime state lives in `.ukit/storage/`.
48
48
  - Treat `.ukit/storage/config.json` as the source of runtime toggles for compact, token pipeline, router, memory, and validation behavior.
@@ -75,10 +75,10 @@
75
75
 
76
76
  ## Small-Task Maintainer (internal)
77
77
 
78
- - UKit may route low-risk internal decisions to the `ukit-small-task-maintainer` subagent using `UKIT_SMALL_TASK_MODEL` (default `unic-lite`).
78
+ - UKit may route low-risk internal decisions to the `ukit-small-task-maintainer` subagent using `subagents.smallTaskModel` (default `unic-lite`).
79
79
  - Use it for safe/reversible UKit chores: dọn `docs/TASKS.md`, queued-task classification, fast-vs-slow/safe-vs-risky lane decisions, skill-routing/step-budget hints, agent context-budget decisions, compact/summary decisions, docs/status summarization, auto-triage, queue maintenance, and small workspace cleanup.
80
80
  - Run it as a sidecar/parallel lane only; do not block, replace, or slow the user task. Do not block the main AI flow: if the small-task lane sees security, risky/shared code, release/publish, data-loss, architecture, deep-reasoning risk, weak context, or quality risk, it hands back to the main model instead of asking the end user to decide.
81
- - This is optional internal orchestration config from `.claude/ukit/.env` / `.ukit/storage/config.json`; never turn it into an end-user workflow. End users still only need `ukit install` and natural-language product work. Always preserve the CoDev priority: quality > safety > speed > token discipline. Keep Claude PreCompact/reinject and OpenCode native auto/prune compaction enabled. For Codex Desktop long sessions, `UKIT_CODEX_COMPACT_TARGET` defaults to 150 compact handoff lines (120-150 preferred, hard max 170), decided internally by the small-task maintainer.
81
+ - This is optional internal orchestration config from `.ukit/storage/config.json`; never turn it into an end-user workflow. End users still only need `ukit install` and natural-language product work. Always preserve the CoDev priority: quality > safety > speed > token discipline. Keep Claude PreCompact/reinject and OpenCode native auto/prune compaction enabled. For Codex Desktop long sessions, `compact.codexContext.compactTarget` defaults to 150 compact handoff lines (120-150 preferred, hard max 170), decided internally by the small-task maintainer.
82
82
 
83
83
  ## Selective Subagent Policy (internal only)
84
84
 
@@ -1,6 +1,6 @@
1
1
  # UKit Shared Runtime
2
2
 
3
- This folder stores shared UKit runtime state for v1.2.1 features.
3
+ This folder stores shared UKit runtime state for v1.2.2 features.
4
4
 
5
5
  - `storage/config.json` — runtime feature flags and defaults
6
6
  - `storage/cache/` — prompt-cache, compact history, compact pressure state, output summaries, and preserved raw tool outputs under `storage/cache/tee/`
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.2.1",
2
+ "version": "1.2.2",
3
3
  "agent": "claude-code",
4
4
  "compact": {
5
5
  "enabled": true,
@@ -9,10 +9,9 @@
9
9
  "codexContext": {
10
10
  "enabled": true,
11
11
  "autoCompact": true,
12
- "budgetTokens": 60000,
12
+ "budgetTokens": 100000,
13
13
  "compactTarget": 150,
14
14
  "compactTargetUnit": "lines",
15
- "decisionModelEnv": "UKIT_SMALL_TASK_MODEL",
16
15
  "decisionAgent": "ukit-small-task-maintainer",
17
16
  "mode": "soft-handoff",
18
17
  "preserve": [
@@ -32,7 +31,6 @@
32
31
  },
33
32
  "agentContext": {
34
33
  "enabled": true,
35
- "decisionModelEnv": "UKIT_SMALL_TASK_MODEL",
36
34
  "decisionAgent": "ukit-small-task-maintainer",
37
35
  "executionMode": "sidecar-parallel",
38
36
  "mustNotBlockMainTask": true,
@@ -147,5 +145,134 @@
147
145
  "mustNotBlockMainTask": true,
148
146
  "maxSidecarWaitMs": 0
149
147
  }
148
+ },
149
+ "_help": {
150
+ "README": {
151
+ "muc_dich": "Đây là file cấu hình runtime duy nhất của UKit, khi install sẽ nằm ở .ukit/storage/config.json. Không dùng .env để chỉnh UKit nữa.",
152
+ "ai_nen_sua": "Người dùng bình thường vẫn chỉ cần nhớ `ukit install`. Maintainer hoặc power user mới cần sửa file JSON này để chỉnh cách UKit tự điều phối AI.",
153
+ "cach_sua": "Chỉ sửa value, không đổi tên key. Đây là JSON chuẩn: string phải dùng dấu nháy kép, có dấu phẩy giữa các field, không dùng // comment.",
154
+ "nguyen_tac_chat_luong": "Luôn theo UKit CoDev: chất lượng > an toàn > tốc độ > tiết kiệm token. Không chỉnh cho nhanh nếu làm AI trả lời kém hơn.",
155
+ "sau_khi_sua": "Sau khi sửa file này, nên mở session AI mới. Nếu muốn refresh template trong repo thì chạy lại `ukit install`."
156
+ },
157
+ "cac_chinh_sua_thuong_gap": {
158
+ "doi_model_noi_bo": {
159
+ "field": "subagents.smallTaskModel",
160
+ "mac_dinh": "unic-lite",
161
+ "y_nghia": "Model nội bộ chạy sidecar cho các quyết định nhỏ/an toàn của UKit. Không thay thế model chính đang làm task của user.",
162
+ "vi_du": "Đổi subagents.smallTaskModel sang tên model khác nếu unic-lite không dùng được hoặc bạn muốn model nội bộ khác."
163
+ },
164
+ "compact_codex_khi_gan_150k_token": {
165
+ "field": "compact.codexContext.budgetTokens",
166
+ "mac_dinh": 100000,
167
+ "co_the_tang_len": 150000,
168
+ "khuyen_nghi": "100000 là mức cân bằng: đủ context cho chất lượng nhưng tránh để phiên chạy tới 150k-180k token dễ gặp lỗi connection/capacity.",
169
+ "y_nghia": "Ngưỡng token context của Codex Desktop trước khi UKit chuẩn bị compact/handoff. Ví dụ 100000 nghĩa là gần 100k token thì compact."
170
+ },
171
+ "doi_do_dai_ban_tom_tat_codex": {
172
+ "field": "compact.codexContext.compactTarget",
173
+ "mac_dinh": 150,
174
+ "khoang_goi_y": [
175
+ 120,
176
+ 170
177
+ ],
178
+ "y_nghia": "Độ dài bản handoff sau compact, tính bằng dòng, không phải token. Không set 150000 ở đây."
179
+ },
180
+ "tat_auto_compact_codex": {
181
+ "field": "compact.codexContext.autoCompact",
182
+ "mac_dinh": true,
183
+ "y_nghia": "Chỉ set false khi đang debug hành vi compact của UKit."
184
+ }
185
+ },
186
+ "version": "Phiên bản config runtime đi kèm package UKit.",
187
+ "agent": "Adapter mặc định của workspace. Thường giữ nguyên theo lúc install.",
188
+ "compact": {
189
+ "enabled": "Bật/tắt toàn bộ helper compact của UKit.",
190
+ "tokenThreshold": "Ngưỡng token chung cho runtime compact dùng chung.",
191
+ "contextRotDetection": "Phát hiện context quá dài/dễ mục để giữ lại state quan trọng trước khi AI nhớ sai.",
192
+ "askBeforeDrop": "Giữ thái độ thận trọng trước khi bỏ context quan trọng. Nếu rủi ro thì hand back cho main model.",
193
+ "agentContext": {
194
+ "enabled": "Bật policy compact context theo từng agent.",
195
+ "decisionAgent": "Agent nội bộ hỗ trợ quyết định compact/handoff trong trường hợp an toàn.",
196
+ "executionMode": "sidecar-parallel nghĩa là lane quyết định compact chạy song song với task chính.",
197
+ "mustNotBlockMainTask": "Nếu true, sidecar nội bộ không được dừng/thay thế/làm chậm task chính của user.",
198
+ "targets": {
199
+ "claude": {
200
+ "autoCompact": "Giữ compact lane của Claude bật.",
201
+ "mode": "precompact-reinject nghĩa là Claude được bơm context quan trọng trước/sau compact.",
202
+ "preserveExistingHooks": "Nên giữ true để không gỡ PreCompact/reinject của Claude."
203
+ },
204
+ "opencode": {
205
+ "autoCompact": "Giữ compact lane của OpenCode bật.",
206
+ "mode": "native-auto-prune nghĩa là OpenCode dùng compaction.auto/prune native.",
207
+ "preserveExistingCompaction": "Nên giữ true để không gỡ compact native của OpenCode."
208
+ },
209
+ "codex": {
210
+ "autoCompact": "Bật policy soft handoff compact cho Codex Desktop.",
211
+ "mode": "soft-handoff nghĩa là UKit tạo/dùng state tóm tắt, không can thiệp trực tiếp vào internals của app Codex.",
212
+ "compactTarget": "Độ dài bản handoff sau compact, tính bằng dòng.",
213
+ "compactTargetUnit": "Đơn vị của compactTarget. Nên giữ là lines.",
214
+ "compactTargetRecommendedRange": "Khoảng số dòng khuyến nghị cho bản handoff.",
215
+ "compactTargetMax": "Số dòng tối đa cho bản handoff, tránh lỡ tay set quá dài."
216
+ }
217
+ }
218
+ },
219
+ "codexContext": {
220
+ "enabled": "Bật policy soft context handoff cho Codex Desktop.",
221
+ "autoCompact": "Cho phép UKit tự quyết định compact/handoff khi context Codex dài.",
222
+ "budgetTokens": "Ngưỡng token context của Codex Desktop trước khi compact. Mặc định 100000 để cân bằng chất lượng và giảm lỗi capacity/connection. Có thể tăng 150000 nếu cần, nhưng không nên để quá dài.",
223
+ "compactTarget": "Độ dài bản handoff sau compact, tính bằng dòng, không phải token. Mặc định 150; nên 120-150; tối đa 170.",
224
+ "compactTargetUnit": "Đơn vị của compactTarget. Nên giữ là lines.",
225
+ "compactTargetRecommendedRange": "Khoảng số dòng khuyến nghị. Nên ở trong khoảng này nếu không có lý do đặc biệt.",
226
+ "compactTargetMax": "Số dòng tối đa cho bản handoff. Chặn trường hợp lỡ set 150000 dòng.",
227
+ "decisionAgent": "Agent nội bộ dùng cho quyết định compact an toàn.",
228
+ "mode": "soft-handoff nghĩa là UKit tóm tắt state để tiếp tục thay vì replay toàn bộ transcript.",
229
+ "preserve": "Những thứ bắt buộc phải giữ khi compact: mục tiêu, rule, file đang làm, quyết định, lỗi chưa xử lý, bằng chứng verify, bước tiếp theo."
230
+ }
231
+ },
232
+ "tokenPipeline": {
233
+ "inputCompression": "Nén/tái sử dụng input context khi an toàn.",
234
+ "outputCompression": "Tóm tắt output command ồn nhưng vẫn giữ recovery hint.",
235
+ "promptCache": "Dùng cache prompt/context compact để giảm lặp lại."
236
+ },
237
+ "router": {
238
+ "enabled": "Bật task routing nội bộ.",
239
+ "defaultModel": "Model hint cân bằng cho công việc bình thường. Adapter/provider có thể map khác.",
240
+ "advisorModel": "Model hint mạnh hơn cho planning/reasoning khó khi được bật.",
241
+ "advisorEnabled": "Cho phép advisor-style planning cho task phức tạp.",
242
+ "maxAdvisorCalls": "Giới hạn số lần gọi advisor để không lãng phí."
243
+ },
244
+ "memory": {
245
+ "enabled": "Bật memory local của UKit.",
246
+ "autoCapture": "Cho phép UKit lưu decision/rule bền vững khi an toàn.",
247
+ "progressiveRetrieval": "Lấy memory liên quan nhỏ trước, chỉ mở rộng khi cần.",
248
+ "maxInjectionTokens": "Số token memory tối đa được inject vào context.",
249
+ "archiveAfterDays": "Sau bao nhiêu ngày memory có thể được archive/compact.",
250
+ "maxSessions": "Số session memory gần đây giữ active.",
251
+ "redactSecrets": "Cố tránh lưu secret vào memory."
252
+ },
253
+ "validation": {
254
+ "enabled": "Bật kiểm tra output nhẹ.",
255
+ "autoRetry": "Cho phép retry an toàn một lần khi validation thấy lỗi rõ.",
256
+ "maxRetries": "Số lần retry tối đa.",
257
+ "confidenceThreshold": "Ngưỡng confidence tối thiểu trước khi báo thận trọng."
258
+ },
259
+ "subagents": {
260
+ "enabled": "Cho phép UKit dùng các lane subagent nội bộ khi hữu ích.",
261
+ "smallTaskModel": "Model sidecar nội bộ cho quyết định nhỏ/an toàn của UKit. Đổi key này nếu muốn đổi model nội bộ.",
262
+ "smallTaskAgent": "Tên agent nội bộ phụ trách quyết định nhỏ không block task chính.",
263
+ "smallTaskUseCases": "Các loại việc an toàn sidecar có thể xử lý: dọn task, compact decision, phân loại, triage, queue maintenance, workspace maintenance.",
264
+ "keepMainModelFor": "Các việc rủi ro phải giữ ở main model: security, code risky, release, data-loss, architecture, deep reasoning.",
265
+ "decisionPolicy": {
266
+ "nonBlocking": "Sidecar nội bộ không được block task chính của user.",
267
+ "endUserInvisible": "Không biến orchestration nội bộ thành thứ end user phải học.",
268
+ "handBackOnRisk": "Nếu sidecar thấy rủi ro thì trả lại main model quyết định.",
269
+ "executionMode": "sidecar-parallel nghĩa là việc nội bộ có thể chạy riêng/song song với task chính.",
270
+ "mustNotBlockMainTask": "True nghĩa là sidecar không được dừng/thay thế/làm chậm task chính.",
271
+ "maxSidecarWaitMs": "0 nghĩa là không chờ sidecar trước khi tiếp tục task chính.",
272
+ "optimizeOrder": "Thứ tự ưu tiên khi ra quyết định nội bộ.",
273
+ "decisions": "Nhóm quyết định sidecar được phép hỗ trợ.",
274
+ "stepBudgets": "Gợi ý số bước planning tối đa theo độ lớn task trước khi reassess."
275
+ }
276
+ }
150
277
  }
151
278
  }
@@ -1,17 +0,0 @@
1
- # UKit optional local runtime overrides.
2
- # Copy to .claude/ukit/.env only if you need machine-local overrides.
3
- # This is internal orchestration config; normal teammates still only need `ukit install`.
4
-
5
- # Lightweight model for the internal UKit small-task maintainer subagent.
6
- # Used for safe UKit decisions such as task cleanup, compact decisions,
7
- # doc summarization, classification, auto-triage, and queue maintenance.
8
- # It follows UKit CoDev principles: quality > speed > token savings.
9
- # Risky/shared/security/release/data-loss/architecture work must keep the main model.
10
- UKIT_SMALL_TASK_MODEL=unic-lite
11
-
12
- # Codex Desktop soft auto-compact handoff budget.
13
- # Target is compact handoff length (lines), not full app context tokens.
14
- # 120-150 is preferred; 170 lines is the hard max for this lane.
15
- UKIT_CODEX_AUTO_COMPACT=true
16
- UKIT_CODEX_CONTEXT_BUDGET=60000
17
- UKIT_CODEX_COMPACT_TARGET=150