@ngockhoale/ukit 2.6.10 → 2.7.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.
- package/CHANGELOG.md +70 -0
- package/manifests/documentation.yaml +24 -2
- package/manifests/instructionRules.yaml +62 -0
- package/manifests/platform.full.yaml +11 -0
- package/package.json +1 -1
- package/scripts/perf/audit-perf.mjs +920 -0
- package/src/cli/commands/doctor.js +23 -4
- package/src/cli/commands/feedback.js +97 -0
- package/src/cli/commands/memory.js +250 -1
- package/src/cli/commands/metrics.js +109 -1
- package/src/cli/index.js +7 -0
- package/src/core/codeintel/retriever.js +65 -0
- package/src/core/diffPlan.js +8 -0
- package/src/core/memory/store.js +7 -2
- package/src/core/ompConfigMerge.js +222 -0
- package/src/core/runInstallPipeline.js +11 -0
- package/src/core/runtimeConfig.js +64 -0
- package/src/core/unattendedDoctor.js +227 -0
- package/src/diagnostics/failurePatterns.js +1 -34
- package/src/diagnostics/feedbackEvents.js +196 -0
- package/src/diagnostics/laneStats.js +111 -0
- package/src/diagnostics/ledgerFiles.js +47 -0
- package/src/diagnostics/skillAccuracy.js +158 -0
- package/src/learning/patternProposals.js +151 -0
- package/src/learning/tuning.js +213 -0
- package/templates/.claude/hooks/block-dangerous.sh +76 -9
- package/templates/.claude/hooks/context-hardcap-gate.sh +26 -8
- package/templates/.claude/hooks/project-important.sh +70 -9
- package/templates/.claude/hooks/protect-files.sh +24 -7
- package/templates/.claude/hooks/sensitive-data-guard.sh +57 -5
- package/templates/.claude/hooks/session-episode.sh +84 -0
- package/templates/.claude/settings.json +29 -113
- package/templates/.claude/ukit/index/route-task.mjs +6 -0
- package/templates/.claude/ukit/runtime/hook-chain-runner.mjs +217 -10
- package/templates/.claude/ukit/runtime/hook-input.sh +119 -0
- package/templates/.omp/config.yml +32 -4
- package/templates/.omp/hooks/pre/ukit-bridge.js +12 -1
- package/templates/AGENTS.md +22 -10
- package/templates/CLAUDE.md +22 -10
- package/templates/adapter-presets/opencode/opencode.template.json +1 -1
- package/templates/docs/UKIT_INTERNALS.md +17 -0
- package/templates/instructions/core.md +22 -10
- package/templates/instructions/layout.yaml +12 -12
- package/templates/ukit/storage/config.json +20 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://opencode.ai/config.json","default_agent":"build","share":"disabled","compaction":{"auto":true,"prune":true,"reserved":10000},"watcher":{"ignore":[".git/**","node_modules/**",".cache/**",".ukit/**",".claude/ukit/permission-usage.json",".claude/ukit/permission-audit.log"]},"permission":{"doom_loop":"deny"},"command":{"ukit-route":{"description":"Internal shared UKit route. Run at the start of every non-trivial task to get skill and context hints before writing code.","agent":"build","template":"Run `node .claude/ukit/index/route-task.mjs \"<task>\" --adapter opencode`; reuse `.claude/ukit/skill-router-state.json`."},"ukit-context":{"description":"Internal UKit context.","agent":"build","template":"Run `node .claude/ukit/index/resolve-context.mjs \"<intent>\" [--target <file>]`."},"ukit-verify":{"description":"Internal UKit verify lane.","agent":"build","template":"Run `node .claude/ukit/index/verify-context.mjs \"<intent>\" [--target <file>]`."},"ukit-triage":{"description":"Internal UKit triage.","agent":"build","template":"Run `node .claude/ukit/index/triage.mjs \"<error>\"`."},"ukit-query":{"description":"Internal UKit query.","agent":"build","template":"Run `node .claude/ukit/index/query-index.mjs \"<error|symbol|path>\"`."},"ukit-index":{"description":"Internal UKit index.","agent":"build","template":"Run `node .claude/ukit/index/refresh-index.mjs` (fallback: `node .claude/ukit/index/build-index.mjs`)."},"ukit-handoff-status":{"description":"Handoff dashboard — show current cycle status (read-only).","agent":"build","template":"Read `docs/AI_HANDOFF/INDEX.md`, `docs/AI_HANDOFF/ACTIVE.md`, and `docs/AI_HANDOFF/PLAN.md`. Report: active cycle name, task table with status, any blockers. No writes."},"ukit-handoff-create":{"description":"Create a new handoff cycle — Phase 1+2: write PLAN.md + TASK-xxx.md files.","agent":"build","template":"Read `.claude/commands/ukit/create-handoff.md` for full instructions, then execute. Description: <what to build>"},"ukit-handoff-implement":{"description":"Execute handoff tasks — Phase 3: implement the next Ready task.","agent":"build","template":"Read `.claude/commands/ukit/implement-handoff.md` for full instructions, then execute. Task ID (optional): <TASK-xxx>"},"ukit-handoff-review":{"description":"Review handoff results — Phase 4: verify implementation and give verdict.","agent":"build","template":"Read `.claude/commands/ukit/review-handoff.md` for full instructions, then execute. Task ID (optional): <TASK-xxx>"},"ukit-handoff-clear":{"description":"Archive and reset the current handoff cycle.","agent":"build","template":"Read `.claude/commands/ukit/clear-handoff.md` for full instructions, then execute."}},"agent":{"build":{"description":"UKit build agent. Follow AGENTS.md. For every non-trivial task: run /ukit-route first, use index-first loop, activate matching skill, never claim done after read-only steps. Keep internal ukit-* helpers hidden; users only need ukit install.","permission":{"edit":"allow","task":"allow","skill":"allow","bash":{"*":"ask","pwd":"allow","ls":"allow","ls *":"allow","find *":"allow","rg *":"allow","grep *":"allow","cat *":"allow","sed *":"allow","head *":"allow","tail *":"allow","wc *":"allow","echo *":"allow","printf *":"allow","awk *":"allow","tr *":"allow","cut *":"allow","sort *":"allow","uniq *":"allow","diff *":"allow","jq *":"allow","stat *":"allow","file *":"allow","which *":"allow","date *":"allow","basename *":"allow","dirname *":"allow","realpath *":"allow","xargs *":"allow","mkdir *":"allow","touch *":"allow","cp *":"allow","vitest *":"allow","jest *":"allow","git status":"allow","git status *":"allow","git diff":"allow","git diff *":"allow","git log":"allow","git log *":"allow","git show *":"allow","git grep *":"allow","git rev-parse *":"allow","git branch *":"allow","git stash list":"allow","git ls-files *":"allow","git tag *":"allow","node .claude/ukit/index/*":"allow","node .claude/ukit/runtime/*":"allow","{{runtime.packageManager}} test":"allow","{{runtime.packageManager}} test *":"allow","{{runtime.packageManager}} lint":"allow","{{runtime.packageManager}} lint *":"allow","{{runtime.packageManager}} typecheck":"allow","{{runtime.packageManager}} typecheck *":"allow","{{runtime.packageManager}} build":"allow","{{runtime.packageManager}} build *":"allow","npm run test":"allow","npm run test *":"allow","npm run lint":"allow","npm run lint *":"allow","npm run typecheck":"allow","npm run typecheck *":"allow","npm run build":"allow","npm run build *":"allow","pnpm test":"allow","pnpm test *":"allow","pnpm lint":"allow","pnpm lint *":"allow","pnpm typecheck":"allow","pnpm typecheck *":"allow","pnpm build":"allow","pnpm build *":"allow","pnpm run test":"allow","pnpm run test *":"allow","pnpm run lint":"allow","pnpm run lint *":"allow","pnpm run typecheck":"allow","pnpm run typecheck *":"allow","pnpm run build":"allow","pnpm run build *":"allow","bun test":"allow","bun test *":"allow","bun run test":"allow","bun run test *":"allow","bun run lint":"allow","bun run lint *":"allow","bun run typecheck":"allow","bun run typecheck *":"allow","bun run build":"allow","bun run build *":"allow","git commit":"
|
|
1
|
+
{"$schema":"https://opencode.ai/config.json","default_agent":"build","share":"disabled","compaction":{"auto":true,"prune":true,"reserved":10000},"watcher":{"ignore":[".git/**","node_modules/**",".cache/**",".ukit/**",".claude/ukit/permission-usage.json",".claude/ukit/permission-audit.log"]},"permission":{"doom_loop":"deny"},"command":{"ukit-route":{"description":"Internal shared UKit route. Run at the start of every non-trivial task to get skill and context hints before writing code.","agent":"build","template":"Run `node .claude/ukit/index/route-task.mjs \"<task>\" --adapter opencode`; reuse `.claude/ukit/skill-router-state.json`."},"ukit-context":{"description":"Internal UKit context.","agent":"build","template":"Run `node .claude/ukit/index/resolve-context.mjs \"<intent>\" [--target <file>]`."},"ukit-verify":{"description":"Internal UKit verify lane.","agent":"build","template":"Run `node .claude/ukit/index/verify-context.mjs \"<intent>\" [--target <file>]`."},"ukit-triage":{"description":"Internal UKit triage.","agent":"build","template":"Run `node .claude/ukit/index/triage.mjs \"<error>\"`."},"ukit-query":{"description":"Internal UKit query.","agent":"build","template":"Run `node .claude/ukit/index/query-index.mjs \"<error|symbol|path>\"`."},"ukit-index":{"description":"Internal UKit index.","agent":"build","template":"Run `node .claude/ukit/index/refresh-index.mjs` (fallback: `node .claude/ukit/index/build-index.mjs`)."},"ukit-handoff-status":{"description":"Handoff dashboard — show current cycle status (read-only).","agent":"build","template":"Read `docs/AI_HANDOFF/INDEX.md`, `docs/AI_HANDOFF/ACTIVE.md`, and `docs/AI_HANDOFF/PLAN.md`. Report: active cycle name, task table with status, any blockers. No writes."},"ukit-handoff-create":{"description":"Create a new handoff cycle — Phase 1+2: write PLAN.md + TASK-xxx.md files.","agent":"build","template":"Read `.claude/commands/ukit/create-handoff.md` for full instructions, then execute. Description: <what to build>"},"ukit-handoff-implement":{"description":"Execute handoff tasks — Phase 3: implement the next Ready task.","agent":"build","template":"Read `.claude/commands/ukit/implement-handoff.md` for full instructions, then execute. Task ID (optional): <TASK-xxx>"},"ukit-handoff-review":{"description":"Review handoff results — Phase 4: verify implementation and give verdict.","agent":"build","template":"Read `.claude/commands/ukit/review-handoff.md` for full instructions, then execute. Task ID (optional): <TASK-xxx>"},"ukit-handoff-clear":{"description":"Archive and reset the current handoff cycle.","agent":"build","template":"Read `.claude/commands/ukit/clear-handoff.md` for full instructions, then execute."}},"agent":{"build":{"description":"UKit build agent. Follow AGENTS.md. For every non-trivial task: run /ukit-route first, use index-first loop, activate matching skill, never claim done after read-only steps. Keep internal ukit-* helpers hidden; users only need ukit install.","permission":{"edit":"allow","task":"allow","skill":"allow","bash":{"*":"ask","pwd":"allow","ls":"allow","ls *":"allow","find *":"allow","rg *":"allow","grep *":"allow","cat *":"allow","sed *":"allow","head *":"allow","tail *":"allow","wc *":"allow","echo *":"allow","printf *":"allow","awk *":"allow","tr *":"allow","cut *":"allow","sort *":"allow","uniq *":"allow","diff *":"allow","jq *":"allow","stat *":"allow","file *":"allow","which *":"allow","date *":"allow","basename *":"allow","dirname *":"allow","realpath *":"allow","xargs *":"allow","mkdir *":"allow","touch *":"allow","cp *":"allow","vitest *":"allow","jest *":"allow","git status":"allow","git status *":"allow","git diff":"allow","git diff *":"allow","git log":"allow","git log *":"allow","git show *":"allow","git grep *":"allow","git rev-parse *":"allow","git branch *":"allow","git stash list":"allow","git ls-files *":"allow","git tag *":"allow","git add *":"allow","git checkout *":"allow","git switch *":"allow","git restore *":"allow","git mv *":"allow","mv *":"allow","node *":"allow","node .claude/ukit/index/*":"allow","node .claude/ukit/runtime/*":"allow","npx *":"allow","npm test":"allow","npm test *":"allow","{{runtime.packageManager}} test":"allow","{{runtime.packageManager}} test *":"allow","{{runtime.packageManager}} lint":"allow","{{runtime.packageManager}} lint *":"allow","{{runtime.packageManager}} typecheck":"allow","{{runtime.packageManager}} typecheck *":"allow","{{runtime.packageManager}} build":"allow","{{runtime.packageManager}} build *":"allow","npm run test":"allow","npm run test *":"allow","npm run lint":"allow","npm run lint *":"allow","npm run typecheck":"allow","npm run typecheck *":"allow","npm run build":"allow","npm run build *":"allow","pnpm test":"allow","pnpm test *":"allow","pnpm lint":"allow","pnpm lint *":"allow","pnpm typecheck":"allow","pnpm typecheck *":"allow","pnpm build":"allow","pnpm build *":"allow","pnpm run test":"allow","pnpm run test *":"allow","pnpm run lint":"allow","pnpm run lint *":"allow","pnpm run typecheck":"allow","pnpm run typecheck *":"allow","pnpm run build":"allow","pnpm run build *":"allow","bun test":"allow","bun test *":"allow","bun run test":"allow","bun run test *":"allow","bun run lint":"allow","bun run lint *":"allow","bun run typecheck":"allow","bun run typecheck *":"allow","bun run build":"allow","bun run build *":"allow","git commit":"allow","git commit *":"allow","git push":"allow","git push *":"allow","git clean":"deny","git clean *":"deny","git reset":"deny","git reset *":"deny","rm *":"deny"}}},"plan":{"permission":{"edit":"ask","bash":"ask"}}}}
|
|
@@ -221,3 +221,20 @@ otherwise route to the specialist.
|
|
|
221
221
|
- `.claude/skills/duraone/references/sql.md`
|
|
222
222
|
- `.claude/skills/duraone/references/workflow.md`
|
|
223
223
|
- Khi không active: dùng generic coding standards + project-specific patterns từ index.
|
|
224
|
+
|
|
225
|
+
## Learning loop — detail
|
|
226
|
+
|
|
227
|
+
Phase-4 telemetry → advisory tuning loop (FR-206, TASK-232).
|
|
228
|
+
|
|
229
|
+
- **Config namespace `learning.*`** (optional-present; absent → defaults merge + valid):
|
|
230
|
+
- `learning.feedback.enabled` (default `true`) — gates `collectFeedbackEvents`.
|
|
231
|
+
- `learning.feedback.maxEvents` (default `200`) — cap on labeled feedback events.
|
|
232
|
+
- `learning.proposals.minCount` / `learning.proposals.minSessions` (defaults `3`/`2`) — pattern-proposal thresholds.
|
|
233
|
+
- `learning.episodes.autoWrite` (default `false`) — gates the SessionEnd episode hook.
|
|
234
|
+
- `learning.tuning.enabled` / `learning.tuning.applyMode` (defaults `true`/`'manual'`; `'off'` disables computation).
|
|
235
|
+
- **Artifacts** (all under `.ukit/storage/`, written tmp+rename):
|
|
236
|
+
- `learning/feedback-events.json` — labeled wrong-route events (`rescue`, `re-route`, `repeat-stall`, `user-correction`).
|
|
237
|
+
- `learning/skill-accuracy.json` — per-skill trigger/join/accuracy roll-up.
|
|
238
|
+
- `learning/suggestions.json` — result of `computeTuningSuggestions(projectRoot)` (`src/learning/tuning.js`).
|
|
239
|
+
- `cache/retriever-lanes.jsonl` — per-query lane hit/weight telemetry consumed by `collectLaneStats`.
|
|
240
|
+
- **Advisory-only contract**: `suggestions` carry `{target, current, suggested, evidence}`; `applied` is always `[]`. `applyMode` is restricted to `manual|off` — **no writer ever mutates `codeIntel.retriever.weights` or `orchestration.escalation.debugLoopThreshold`**. Rules: lane weight ±0.1 step (clamped `[0.1, 2.0]`) when events ≥ 50 with a >0.5 dominant lane and a <0.02 starved lane; `debugLoopThreshold − 1` (min 1) when repeat-stall events ≥ 10. `ukit metrics` prints a `learning` section (pending count + targets; `n/a` when the artifact is absent).
|
|
@@ -23,6 +23,14 @@
|
|
|
23
23
|
<!-- RULE: EXEC-04 -->
|
|
24
24
|
- **Every stop says why — no silent idle.** Turns ending on a user-only action open with `WAITING ON YOU: <command/action>` plus a one-shot wakeup (~20-30 min) when available — an ended turn cannot observe external changes, so without it idle looks identical to a stall. Report any error verbatim the same turn.
|
|
25
25
|
|
|
26
|
+
## Stall & Wait Reporting
|
|
27
|
+
<!-- RULE: STALL-01 -->
|
|
28
|
+
- Announce long waits as they happen: `Waiting for API response / tool result — will keep retrying; check your network/API provider if this persists`. Surface any API/tool error **verbatim** in the same turn, and name network/API as the suspect on long stalls — **never blame UKit**. This guidance makes the model's side of a wait visible; it cannot detect a stall inside the host's own request loop.
|
|
29
|
+
<!-- RULE: STALL-02 -->
|
|
30
|
+
- Every stop still says why (Execution Contract EXEC-04) — the stall rules above extend it, they do not replace it.
|
|
31
|
+
<!-- RULE: STALL-03 -->
|
|
32
|
+
- **Conditional workaround only:** fall back to one tool call per assistant message ONLY when malformed/concatenated tool-input errors are observed or the harness version is known-affected — otherwise keep using legitimate parallel calls; serializing healthy hosts contradicts batching guidance.
|
|
33
|
+
|
|
26
34
|
## Long-Run Continuity
|
|
27
35
|
<!-- RULES: LONG-01 LONG-02 -->
|
|
28
36
|
- Near token-cap: **LAND one thing** end-to-end (edit + verify, ≤3 tool calls), **DEFER** the rest into `docs/STATUS.md` or bounded `docs/AI_HANDOFF/` tasks, **DELEGATE** broad work to subagents. Only then compact.
|
|
@@ -66,8 +74,8 @@ For any task needing code context:
|
|
|
66
74
|
|
|
67
75
|
## UKit v{{ukit.version}} Shared Runtime
|
|
68
76
|
- Runtime state lives in `.ukit/storage/`; `.ukit/storage/config.json` holds runtime toggles (compact, token pipeline, router, memory, validation, Safe Patch).
|
|
69
|
-
- Reuse `.ukit/storage/memory/` + `ukit memory recall "<current task>"` before asking users to restate decisions; inspect via `ukit status` / `ukit memory export`.
|
|
70
|
-
- Route memory: `.claude/ukit/skill-router-state.json` — reuse compact `previous-context`/`recent-output` first. Cache state: `.ukit/storage/cache/output-history.json`, tee
|
|
77
|
+
- Reuse `.ukit/storage/memory/` + `ukit memory recall "<current task>"` before asking users to restate decisions; `ukit memory learn` surfaces pending proposals, `ukit memory promote` writes approved rules to MEMORY.md, `ukit memory episode` records session episodes; inspect via `ukit status` / `ukit memory export`.
|
|
78
|
+
- Route memory: `.claude/ukit/skill-router-state.json` — reuse compact `previous-context`/`recent-output` first. Cache state: `.ukit/storage/cache/output-history.json`, `retriever-lanes.jsonl`, `tee/`. Lifecycle hooks all degrade to exit 0 (SessionEnd `session-episode.sh` auto-writes episodes; full map: `docs/UKIT_INTERNALS.md`). Missing/corrupt runtime or old `ukit/` root → rerun `ukit install`. Detail: `docs/UKIT_INTERNALS.md`.
|
|
71
79
|
|
|
72
80
|
## Prompt Caching
|
|
73
81
|
<!-- RULES: CTX-01 CTX-02 CTX-03 CTX-04 CTX-05 CTX-06 CTX-07 CTX-08 CTX-09 CTX-10 -->
|
|
@@ -81,9 +89,7 @@ For any task needing code context:
|
|
|
81
89
|
|
|
82
90
|
## Handoff Quality Gate — OPT-IN
|
|
83
91
|
<!-- RULE: HAND-01 -->
|
|
84
|
-
CHỈ kích hoạt khi task đi qua `docs/AI_HANDOFF/` (user nói "execute task TASK-xxx" hoặc target là `docs/AI_HANDOFF/tasks/*.md`). Daily prompt → KHÔNG đụng, flow cũ giữ nguyên.
|
|
85
|
-
|
|
86
|
-
Khi Handoff mode: đọc `docs/AI_HANDOFF/RULES.md` để biết 4 phase (Idea+Plan → Create Tasks → Implement+Test → Review+Test) + state machine + self-report model. Config: `.ukit/storage/config.json` → `handoff.*`.
|
|
92
|
+
CHỈ kích hoạt khi task đi qua `docs/AI_HANDOFF/` (user nói "execute task TASK-xxx" hoặc target là `docs/AI_HANDOFF/tasks/*.md`). Daily prompt → KHÔNG đụng, flow cũ giữ nguyên. Khi Handoff mode: đọc `docs/AI_HANDOFF/RULES.md` để biết 4 phase (Idea+Plan → Create Tasks → Implement+Test → Review+Test) + state machine + self-report model. Config: `.ukit/storage/config.json` → `handoff.*`.
|
|
87
93
|
|
|
88
94
|
## Context + Verification Budget
|
|
89
95
|
<!-- RULE: BUDGET-01 -->
|
|
@@ -96,14 +102,10 @@ Khi Handoff mode: đọc `docs/AI_HANDOFF/RULES.md` để biết 4 phase (Idea+P
|
|
|
96
102
|
- `docs/STATUS.md` captures compact current state — not source truth, never replaces source/index-first investigation.
|
|
97
103
|
- "What next?"/"continue" → `next-step` with a freshness cue; after meaningful work → `update-status`. `docs/TASKS.md` is the local AI task queue — prefer `Ready for AI`. Detail: `docs/UKIT_INTERNALS.md`.
|
|
98
104
|
|
|
99
|
-
##
|
|
105
|
+
## Subagent Lanes (internal)
|
|
100
106
|
<!-- RULE: SUBAG-02 -->
|
|
101
107
|
- The `ukit-small-task-maintainer` subagent (`subagents.smallTaskModel`, default `unic-lite`) handles safe/reversible UKit chores as a sidecar lane — never block or slow the user task; risky work hands back to the main model. Detail: `docs/UKIT_INTERNALS.md`.
|
|
102
|
-
|
|
103
|
-
## Post-Edit Sidecar Review (internal)
|
|
104
108
|
- When routed state's `routeSummary.line` carries `review=code-reviewer(diff)`, launch `code-reviewer` in background (`smart` tier) **only after** write + verification evidence; findings advisory — never block the reported completion. Detail: `docs/UKIT_INTERNALS.md`.
|
|
105
|
-
|
|
106
|
-
## Selective Subagent Policy (internal only)
|
|
107
109
|
<!-- RULE: SUBAG-01 -->
|
|
108
110
|
- Direct execution is default for trivial/simple work; delegate only on meaningful context shrink or parallel gains (noisy side lanes, 3+ independent failures, batch plans). Never ask end users to name agents or remember agent commands.
|
|
109
111
|
|
|
@@ -111,6 +113,16 @@ Khi Handoff mode: đọc `docs/AI_HANDOFF/RULES.md` để biết 4 phase (Idea+P
|
|
|
111
113
|
<!-- RULE: AUTO-01 -->
|
|
112
114
|
- `autonomy.level` in `.ukit/storage/config.json` controls how much UKit acts without asking: `conservative` (ask more), `balanced` (default), `free-run` (auto-run more), `vibecode` (one prompt to a finished result; the gate stops only on completion evidence, a genuine blocker, or a dangerous-command decision). End users should not need to change it.
|
|
113
115
|
|
|
116
|
+
## Unattended Completion Loop
|
|
117
|
+
<!-- RULE: UNATTENDED-01 -->
|
|
118
|
+
- Under `orchestration.permissionMode: unattended` there is no human in the loop — the loop is UNDERSTAND → PLAN → IMPLEMENT → VERIFY → FIX → REVERIFY → COMPLETE. A turn ends only on COMPLETE evidence, a real external blocker, or a deny decision.
|
|
119
|
+
<!-- RULE: UNATTENDED-02 -->
|
|
120
|
+
- `maxAttemptsPerFailure: 5` per failing verification, `maxRecoveryStrategies: 3` distinct fix strategies before reassessing — retry the same edit, fix the cause differently, then reduce scope/approach; do not loop one strategy.
|
|
121
|
+
<!-- RULE: UNATTENDED-03 -->
|
|
122
|
+
- BLOCKED only on true external blockers: missing credentials, dead service, unreachable network/API. Test failures, lint errors, review findings, and ambiguity are NOT blockers — they feed FIX.
|
|
123
|
+
<!-- RULE: UNATTENDED-04 -->
|
|
124
|
+
- A deny (hook/gate/permission) never becomes a question: pick the next safer alternative that satisfies the intent and record the substitution. Never emit "do you want me to…" — decide and proceed.
|
|
125
|
+
|
|
114
126
|
## 3-Tier Model Routing
|
|
115
127
|
<!-- RULES: TIER-01 TIER-02 -->
|
|
116
128
|
**Internal orchestration only — end users still just use natural language. No new commands.**
|
|
@@ -14,6 +14,7 @@ outputs:
|
|
|
14
14
|
- { from: core, heading: Core Rule }
|
|
15
15
|
- { from: core, heading: Fast Classification }
|
|
16
16
|
- { from: core, heading: Execution Contract (mandatory) }
|
|
17
|
+
- { from: core, heading: Stall & Wait Reporting }
|
|
17
18
|
- { from: core, heading: Long-Run Continuity }
|
|
18
19
|
- { from: core, heading: Index-First Loop }
|
|
19
20
|
- { from: core, heading: Automatic Skill Activation (mandatory) }
|
|
@@ -25,10 +26,9 @@ outputs:
|
|
|
25
26
|
- { from: core, heading: Handoff Quality Gate — OPT-IN }
|
|
26
27
|
- { from: core, heading: Context + Verification Budget }
|
|
27
28
|
- { from: core, heading: Living Status Workflow }
|
|
28
|
-
- { from: core, heading:
|
|
29
|
-
- { from: core, heading: Post-Edit Sidecar Review (internal) }
|
|
30
|
-
- { from: core, heading: Selective Subagent Policy (internal only) }
|
|
29
|
+
- { from: core, heading: Subagent Lanes (internal) }
|
|
31
30
|
- { from: core, heading: Adaptive Autonomy }
|
|
31
|
+
- { from: core, heading: Unattended Completion Loop }
|
|
32
32
|
- { from: core, heading: 3-Tier Model Routing }
|
|
33
33
|
- { from: core, heading: Skills }
|
|
34
34
|
- { from: core, heading: Project Snapshot }
|
|
@@ -46,6 +46,7 @@ outputs:
|
|
|
46
46
|
- { from: core, heading: Core Rule }
|
|
47
47
|
- { from: core, heading: Fast Classification }
|
|
48
48
|
- { from: core, heading: Execution Contract (mandatory) }
|
|
49
|
+
- { from: core, heading: Stall & Wait Reporting }
|
|
49
50
|
- { from: core, heading: Long-Run Continuity }
|
|
50
51
|
- { from: core, heading: Index-First Loop }
|
|
51
52
|
- { from: core, heading: Automatic Skill Activation (mandatory) }
|
|
@@ -57,10 +58,9 @@ outputs:
|
|
|
57
58
|
- { from: core, heading: Handoff Quality Gate — OPT-IN }
|
|
58
59
|
- { from: core, heading: Context + Verification Budget }
|
|
59
60
|
- { from: core, heading: Living Status Workflow }
|
|
60
|
-
- { from: core, heading:
|
|
61
|
-
- { from: core, heading: Post-Edit Sidecar Review (internal) }
|
|
62
|
-
- { from: core, heading: Selective Subagent Policy (internal only) }
|
|
61
|
+
- { from: core, heading: Subagent Lanes (internal) }
|
|
63
62
|
- { from: core, heading: Adaptive Autonomy }
|
|
63
|
+
- { from: core, heading: Unattended Completion Loop }
|
|
64
64
|
- { from: core, heading: 3-Tier Model Routing }
|
|
65
65
|
- { from: 'overlay:agents', heading: Session Start — OpenCode }
|
|
66
66
|
- { from: 'overlay:agents', heading: Project Owner Instructions — Codex and OpenCode }
|
|
@@ -88,6 +88,7 @@ outputs:
|
|
|
88
88
|
- { from: core, heading: Core Rule }
|
|
89
89
|
- { from: core, heading: Fast Classification }
|
|
90
90
|
- { from: core, heading: Execution Contract (mandatory) }
|
|
91
|
+
- { from: core, heading: Stall & Wait Reporting }
|
|
91
92
|
- { from: core, heading: Long-Run Continuity }
|
|
92
93
|
- { from: core, heading: Index-First Loop }
|
|
93
94
|
- { from: core, heading: Automatic Skill Activation (mandatory) }
|
|
@@ -99,10 +100,9 @@ outputs:
|
|
|
99
100
|
- { from: core, heading: Handoff Quality Gate — OPT-IN }
|
|
100
101
|
- { from: core, heading: Context + Verification Budget }
|
|
101
102
|
- { from: core, heading: Living Status Workflow }
|
|
102
|
-
- { from: core, heading:
|
|
103
|
-
- { from: core, heading: Post-Edit Sidecar Review (internal) }
|
|
104
|
-
- { from: core, heading: Selective Subagent Policy (internal only) }
|
|
103
|
+
- { from: core, heading: Subagent Lanes (internal) }
|
|
105
104
|
- { from: core, heading: Adaptive Autonomy }
|
|
105
|
+
- { from: core, heading: Unattended Completion Loop }
|
|
106
106
|
- { from: core, heading: 3-Tier Model Routing }
|
|
107
107
|
- { from: core, heading: Skills }
|
|
108
108
|
- { from: core, heading: Project Snapshot }
|
|
@@ -121,6 +121,7 @@ outputs:
|
|
|
121
121
|
- { from: core, heading: Core Rule }
|
|
122
122
|
- { from: core, heading: Fast Classification }
|
|
123
123
|
- { from: core, heading: Execution Contract (mandatory) }
|
|
124
|
+
- { from: core, heading: Stall & Wait Reporting }
|
|
124
125
|
- { from: core, heading: Long-Run Continuity }
|
|
125
126
|
- { from: core, heading: Index-First Loop }
|
|
126
127
|
- { from: core, heading: Automatic Skill Activation (mandatory) }
|
|
@@ -132,10 +133,9 @@ outputs:
|
|
|
132
133
|
- { from: core, heading: Handoff Quality Gate — OPT-IN }
|
|
133
134
|
- { from: core, heading: Context + Verification Budget }
|
|
134
135
|
- { from: core, heading: Living Status Workflow }
|
|
135
|
-
- { from: core, heading:
|
|
136
|
-
- { from: core, heading: Post-Edit Sidecar Review (internal) }
|
|
137
|
-
- { from: core, heading: Selective Subagent Policy (internal only) }
|
|
136
|
+
- { from: core, heading: Subagent Lanes (internal) }
|
|
138
137
|
- { from: core, heading: Adaptive Autonomy }
|
|
138
|
+
- { from: core, heading: Unattended Completion Loop }
|
|
139
139
|
- { from: core, heading: 3-Tier Model Routing }
|
|
140
140
|
- { from: 'overlay:agents', heading: Session Start — OpenCode }
|
|
141
141
|
- { from: 'overlay:agents', heading: Project Owner Instructions — Codex and OpenCode }
|
|
@@ -93,6 +93,7 @@
|
|
|
93
93
|
"enabled": true,
|
|
94
94
|
"orchestratorModel": "claude-sonnet-5",
|
|
95
95
|
"advisorEnabled": true,
|
|
96
|
+
"permissionMode": "unattended",
|
|
96
97
|
"contracts": {
|
|
97
98
|
"tiny-fix": {
|
|
98
99
|
"maxReadPasses": 0,
|
|
@@ -225,6 +226,12 @@
|
|
|
225
226
|
"maxRetries": 1,
|
|
226
227
|
"confidenceThreshold": 50
|
|
227
228
|
},
|
|
229
|
+
"learning": {
|
|
230
|
+
"feedback": { "enabled": true, "maxEvents": 200 },
|
|
231
|
+
"proposals": { "minCount": 3, "minSessions": 2 },
|
|
232
|
+
"episodes": { "autoWrite": false },
|
|
233
|
+
"tuning": { "enabled": true, "applyMode": "manual" }
|
|
234
|
+
},
|
|
228
235
|
"safePatch": {
|
|
229
236
|
"enabled": true,
|
|
230
237
|
"strictSharedRisk": true,
|
|
@@ -454,6 +461,18 @@
|
|
|
454
461
|
"mac_dinh": true,
|
|
455
462
|
"y_nghia": "Planner phải hoàn thành PLAN.md §4 (Test Plan) trước khi task chuyển ready. Tắt sẽ làm UKit cho phép skip TDD — kéo theo executor dễ làm sót.",
|
|
456
463
|
"khuyen_nghi": "Giữ true."
|
|
464
|
+
},
|
|
465
|
+
"tu_ghi_episode_ket_thuc_session": {
|
|
466
|
+
"field": "learning.episodes.autoWrite",
|
|
467
|
+
"mac_dinh": false,
|
|
468
|
+
"y_nghia": "Nếu true, hook SessionEnd tự ghi episode vào memory v2 khi kết thúc session (cần `ukit` có trên PATH). Mặc định tắt để tránh ghi memory khi user chưa muốn.",
|
|
469
|
+
"khi_nao_bat": "Chỉ bật khi anh muốn UKit tự lưu episode mỗi session; dữ liệu vẫn nằm local trong .ukit/storage."
|
|
470
|
+
},
|
|
471
|
+
"tat_goi_y_tuning": {
|
|
472
|
+
"field": "learning.tuning.applyMode",
|
|
473
|
+
"mac_dinh": "manual",
|
|
474
|
+
"y_nghia": "manual = UKit chỉ tính và lưu gợi ý tuning vào .ukit/storage/learning/suggestions.json, KHÔNG bao giờ tự sửa weights/threshold. off = tắt luôn việc tính gợi ý.",
|
|
475
|
+
"khuyen_nghi": "Giữ manual. Không có chế độ auto-apply — mọi thay đổi weights/threshold đều do người dùng tự sửa."
|
|
457
476
|
}
|
|
458
477
|
},
|
|
459
478
|
"version": "Phiên bản config runtime đi kèm package UKit.",
|
|
@@ -536,6 +555,7 @@
|
|
|
536
555
|
"enabled": "Bật ladder điều phối nội bộ của UKit. Ladder này thay cách nghĩ LITE/FULL cứng nhắc bằng các tầng tiny-fix → review-release an toàn hơn.",
|
|
537
556
|
"orchestratorModel": "Model điều phối chất lượng cao để chọn execution layer. Đây là model quan trọng cho chất lượng completion, không nên dùng model quá yếu.",
|
|
538
557
|
"advisorEnabled": "Cho phép UKit dùng advisor-style reasoning khi chọn layer trong tình huống mơ hồ.",
|
|
558
|
+
"permissionMode": "Chế độ quyền của orchestration. Ba giá trị dành riêng: interactive, safe-auto, unattended. Chu kỳ này chỉ triển khai unattended.",
|
|
539
559
|
"contracts": "Bộ contract cho 7 tầng điều phối: tiny-fix, local-fix, local-build, find-cause, shared-edit, map-impact, review-release. Khi mơ hồ, UKit nên lệch lên tầng an toàn hơn dù tốn token hơn."
|
|
540
560
|
},
|
|
541
561
|
"memory": {
|