Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2ed1fac
feat(verification): add syntax candidates for changed files and enhan…
codewithshinde Sep 30, 2026
dd753b2
feat(verification): integrate tree-sitter syntax checks and enhance d…
codewithshinde Sep 30, 2026
682fe8f
feat: add git_signoff_range tool for DCO compliance
codewithshinde Sep 30, 2026
8e1fbc3
feat(request-intake): enhance intake pipeline with meta command handl…
codewithshinde Sep 30, 2026
422aab5
feat: implement turn kind handling in intent classification and enhan…
codewithshinde Sep 30, 2026
1cecbbf
feat(session-control): implement session control commands and integra…
codewithshinde Sep 30, 2026
1d34ecc
Refactor intent classification and task analysis logic
codewithshinde Sep 30, 2026
9df7260
feat: introduce grant profiles and enhance tool grant logic
codewithshinde Sep 30, 2026
06ed79e
feat: implement maximum output token handling across various components
codewithshinde Sep 30, 2026
b8100b7
feat: add support for serializable extra fragments in prompt construc…
codewithshinde Sep 30, 2026
a991aee
feat: implement instruction bodies handling for context-epoch mid-upd…
codewithshinde Sep 30, 2026
376eea6
feat: add optional L1 skill catalog injection to prompt construction
codewithshinde Oct 1, 2026
3376829
feat: enhance patch validation and recovery mechanisms for bracket ba…
codewithshinde Oct 1, 2026
565b105
feat: Enhance Rule Intent Classifier with Evidence Pack and Size Draft
codewithshinde Oct 1, 2026
fcbb0cf
feat: Enhance assistant response handling and readiness evaluation
codewithshinde Oct 1, 2026
13cadda
feat: Implement mutate lock mechanisms and related tools for enhanced…
codewithshinde Oct 1, 2026
4735e42
feat: Add context window configuration and related utilities for enha…
codewithshinde Oct 1, 2026
0d5e6cd
feat(desktop): move logo to top bar and add new-chat button
codewithshinde Oct 1, 2026
cae7951
feat: add index pipeline health tracking and reporting
codewithshinde Oct 1, 2026
fcb6cdf
feat(desktop): add index pipeline health logging and settings error s…
codewithshinde Oct 1, 2026
68ec960
merge: sync development into feat/v8-engine-rewrite
codewithshinde Oct 1, 2026
9412ea4
docs: point orchestration ownership at v8-engine
codewithshinde Oct 1, 2026
cc1eef6
fix(desktop): restore MCP persist enabled and vitest import for conte…
codewithshinde Oct 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<a href="LICENSE"><img alt="License: AGPL v3" src="https://img.shields.io/badge/License-AGPL_v3-blue.svg"></a>
<a href="https://code.visualstudio.com/"><img alt="VS Code 1.124+" src="https://img.shields.io/badge/VS%20Code-1.124%2B-007ACC?logo=visualstudiocode"></a>
<a href="https://nodejs.org/"><img alt="Node 20+" src="https://img.shields.io/badge/Node-20%2B-339933?logo=node.js"></a>
<img alt="Version 2.9.123" src="https://img.shields.io/badge/version-2.9.123-111111">
<img alt="Version 2.10.8" src="https://img.shields.io/badge/version-2.10.8-111111">
<a href="https://docs.mitii.dev"><img alt="Documentation" src="https://img.shields.io/badge/docs-docs.mitii.dev-ff751f"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion apps/acp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mitii/acp",
"version": "2.9.123",
"version": "2.10.8",
"description": "Mitii ACP-lite stdio bridge (Phase 3). Decision Policy remains authority; V8 does not import ACP.",
"license": "AGPL-3.0-or-later",
"type": "module",
Expand Down
4 changes: 4 additions & 0 deletions apps/acp/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
createWorkspaceCheckpointStore,
createWorkspaceKnowledgeGraph,
createWorkspaceVerificationStore,
createOptionalVerificationSyntaxPort,
detectSandboxBackend,
getProviderPreset,
inferHostProviderType,
Expand Down Expand Up @@ -226,6 +227,9 @@ async function createHostAcpClient(cwd: string): Promise<MitiiClient> {
workspaceRoot: cwd,
}),
records: createWorkspaceVerificationStore(cwd),
...(await createOptionalVerificationSyntaxPort().then((syntax) =>
syntax ? { syntax } : {},
)),
});
const repositoryState = new RepositoryStatePipeline({
store: new InMemoryRepositoryStateStore(),
Expand Down
5 changes: 3 additions & 2 deletions apps/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ mitii -v # or: mitii --version / mitii version
mitii ask "What is recursion?" --echo
mitii run --auto "run tests and fix failures" --echo
mitii index
mitii index --status --json
mitii status --json
mitii session
mitii export-session "Summarize this repo" --out session.json --echo
Expand All @@ -70,9 +71,9 @@ mitii export-session "Summarize this repo" --out session.json --echo
| `changelog` | Draft Keep a Changelog entry (auto-attaches `release-changelog`) |
| `run --auto "<task>"` | Unattended CI run (agent + apply autonomy; no prompts) |
| `session` | Interactive prompt loop with MITII banner |
| `index` | Full workspace index + publish repository state |
| `index` | Full workspace index + publish; `--status` shows Code/FTS/Embeddings pipeline health (no reindex) |
| `review` | Deterministic review prep / SARIF (`--preview`, `--from`/`--to`, `--commit`, `--format`, `--output`). For LLM findings use `mitii ask … --skill code-review-and-quality` (recipe/skill) or the VS Code **Review** button for working-tree changes |
| `status` | Show latest persisted repository state |
| `status` | Show latest persisted repository state + index pipeline health |
| `export-session` | Run ask and write secret-free JSON export |
| `connect` | Bridge Mitii into Telegram, Discord, or Slack |
| `schedule` | CRUD / trigger / history for automation schedules |
Expand Down
6 changes: 4 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mitii/cli",
"version": "2.9.123",
"version": "2.10.8",
"description": "Mitii headless CLI over @mitii/sdk. Phase 0: --origin/--autonomy/--agent for CI automation.",
"license": "AGPL-3.0-or-later",
"publishConfig": {
Expand Down Expand Up @@ -33,7 +33,9 @@
"@mitii/mcp": "workspace:*",
"@mitii/sdk": "workspace:*",
"@mitii/v8": "workspace:*",
"better-sqlite3": "^12.11.1"
"better-sqlite3": "^12.11.1",
"tree-sitter-wasms": "^0.1.13",
"web-tree-sitter": "^0.24.7"
},
"devDependencies": {
"@types/node": "^20.14.0",
Expand Down
3 changes: 3 additions & 0 deletions apps/cli/scripts/build-cli.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ const builtins = new Set([
const externals = new Set([
'@lancedb/lancedb',
'better-sqlite3',
// web-tree-sitter uses __dirname in Parser.init; bundling into ESM breaks it.
'web-tree-sitter',
'tree-sitter-wasms',
'typescript',
'vscode',
]);
Expand Down
47 changes: 45 additions & 2 deletions apps/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import { buildWorkspaceSnapshot } from './workspaceSnapshot.js';
import { runFullWorkspaceIndex } from './fullWorkspaceIndex.js';
import { loadMitiiHostConfig } from './config.js';
import { resolveCliSemanticIndexSettings } from './semanticIndex.js';
import {
formatIndexPipelineHealthLines,
readIndexPipelineHealth,
} from '@mitii/host';
import {
loadPersistedRepositoryState,
persistLatestRepositoryState,
Expand Down Expand Up @@ -171,6 +175,31 @@ function writeRepositoryCapabilityLines(
}
}

function writeIndexHealthLines(io: SessionIo, cwd: string): void {
const health = readIndexPipelineHealth({ workspaceRoot: cwd });
for (const line of formatIndexPipelineHealthLines(health)) {
io.writeStdout(`${line}\n`);
}
}

async function runIndexStatus(options: {
cwd: string;
json: boolean;
io: SessionIo;
}): Promise<number> {
const health = readIndexPipelineHealth({ workspaceRoot: options.cwd });
if (options.json) {
options.io.writeStdout(`${serializeCliJson({ health })}\n`);
} else {
for (const line of formatIndexPipelineHealthLines(health)) {
options.io.writeStdout(`${line}\n`);
}
}
if (health.overall === 'missing') return 1;
if (health.overall === 'failed') return 1;
return 0;
}

async function runIndex(options: {
cwd: string;
json: boolean;
Expand Down Expand Up @@ -253,12 +282,14 @@ async function runIndex(options: {
persistLatestRepositoryState(options.cwd, published.descriptor);
}
if (options.json) {
const health = readIndexPipelineHealth({ workspaceRoot: options.cwd });
options.io.writeStdout(
`${serializeCliJson({
published,
fileCount,
truncated,
indexMode,
health,
...(indexingDiagnostics ? { indexing: indexingDiagnostics } : {}),
...(published.status === 'published'
? {
Expand All @@ -281,6 +312,7 @@ async function runIndex(options: {
);
}
writeRepositoryCapabilityLines(options.io, published.descriptor);
writeIndexHealthLines(options.io, options.cwd);
for (const reason of published.descriptor.reasons) {
options.io.writeStderr(`[mitii] ${reason.code}: ${reason.message}\n`);
}
Expand All @@ -306,27 +338,31 @@ async function runStatus(options: {
const latest =
(await client.getLatestRepositoryState(ports.workspaceId)) ??
loadPersistedRepositoryState(options.cwd);
const health = readIndexPipelineHealth({ workspaceRoot: options.cwd });
if (options.json) {
options.io.writeStdout(
`${serializeCliJson({
latest,
health,
...(latest
? { capabilitySummary: summarizeRepositoryCapabilities(latest) }
: {}),
})}\n`,
);
return latest ? 0 : 1;
return latest || health.overall !== 'missing' ? 0 : 1;
}
if (!latest) {
options.io.writeStderr(
'[mitii] no published repository state — run `mitii index` first\n',
);
return 1;
writeIndexHealthLines(options.io, options.cwd);
return health.overall === 'missing' ? 1 : 0;
}
options.io.writeStdout(
`status workspaceId=${latest.workspaceId} readiness=${latest.readiness} scan=${latest.scanCompleteness} stateToken=${latest.stateToken.slice(0, 16)}…\n`,
);
writeRepositoryCapabilityLines(options.io, latest);
writeIndexHealthLines(options.io, options.cwd);
for (const reason of latest.reasons) {
options.io.writeStderr(`[mitii] ${reason.code}: ${reason.message}\n`);
}
Expand Down Expand Up @@ -478,6 +514,13 @@ export async function main(
return code;
}
case 'index':
if (parsed.indexStatus === true) {
return runIndexStatus({
cwd,
json: parsed.json === true,
io: sessionIo,
});
}
return runIndex({
cwd,
json: parsed.json === true,
Expand Down
14 changes: 14 additions & 0 deletions apps/cli/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ export interface MitiiHostConfig {
/** Never read API keys from config files — env / SecretStorage only. */
workspaceId?: string;
defaultMode?: 'ask' | 'plan' | 'agent';
/**
* Explicit context window for the run LLM (tokens). When unset, CLI infers
* from MITII_CONTEXT_WINDOW / model tags / provider defaults.
*/
contextWindowTokens?: number;
/**
* Optional lab loop/stall overrides (power users / benchmarks).
* Leave unset or enabled:false for shipped window-band standards.
Expand Down Expand Up @@ -99,6 +104,12 @@ function parseConfigObject(raw: Record<string, unknown>): MitiiHostConfig {
safe.defaultMode === 'agent'
? safe.defaultMode
: undefined,
contextWindowTokens:
typeof safe.contextWindowTokens === 'number' &&
Number.isFinite(safe.contextWindowTokens) &&
safe.contextWindowTokens > 0
? Math.floor(safe.contextWindowTokens)
: undefined,
loopPolicy: parseLoopPolicyConfig(safe.loopPolicy),
};
}
Expand Down Expand Up @@ -167,6 +178,9 @@ export function saveMitiiHostConfig(
}
if (merged.workspaceId) payload.workspaceId = merged.workspaceId;
if (merged.defaultMode) payload.defaultMode = merged.defaultMode;
if (merged.contextWindowTokens !== undefined) {
payload.contextWindowTokens = merged.contextWindowTokens;
}
const loopPolicyPayload = serializeLoopPolicyConfig(merged.loopPolicy);
if (loopPolicyPayload) payload.loopPolicy = loopPolicyPayload;

Expand Down
4 changes: 3 additions & 1 deletion apps/cli/src/help.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Usage:
mitii run --auto "<task>" [options]
mitii session [options]
mitii index [--cwd <path>] [--json]
mitii index --status [--cwd <path>] [--json]
mitii review [--preview] [--from <ref> --to <ref>] [--commit <hash>] [--format json|sarif] [--output <path>] [--effort low|medium|high]
mitii status [--cwd <path>] [--json]
mitii export-session <prompt> --out <file> [--echo]
Expand All @@ -39,6 +40,7 @@ Commands:
run --auto Unattended CI run (agent + apply autonomy; no prompts)
session Interactive REPL (MITII banner + prompts)
index Full workspace index + publish repository state
--status Show Code/FTS/Embeddings pipeline health (no reindex)
review Deterministic review preview/prepare (+ SARIF); LLM findings via ask
--preview Selection preview only (no prepare)
--from/--to <ref> Diff range (required together unless --commit)
Expand All @@ -48,7 +50,7 @@ Commands:
--effort low|medium|high Prep effort band
Full LLM review: VS Code Review button (git changes), or:
mitii ask "review these changes" --mode ask --skill code-review-and-quality
status Show latest persisted repository state
status Show latest persisted repository state + index pipeline health
export-session Run ask and write secret-free JSON export
restore Undo Agent file mutations to a RestorePoint (or --list)
recipe Run a parameterized RecipeSpec (prompt/mode/skills only)
Expand Down
9 changes: 9 additions & 0 deletions apps/cli/src/parseCliArgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ export interface ParsedCliArgs {
loopPolicyJson?: string;
/** Force window-band standards even if config enables loopPolicy. */
noLoopPolicy?: boolean;
/** `mitii index --status` — report pipeline health without reindexing. */
indexStatus?: boolean;
/** Passthrough args after `connect` (channel + channel flags). */
rest: string[];
}
Expand Down Expand Up @@ -146,6 +148,10 @@ export function parseCliArgs(argv: string[]): ParsedCliArgs {
flags.add('json');
continue;
}
if (arg === '--status') {
flags.add('status');
continue;
}
if (arg === '--stream-json') {
flags.add('stream-json');
continue;
Expand Down Expand Up @@ -477,6 +483,9 @@ export function parseCliArgs(argv: string[]): ParsedCliArgs {
mode,
loopPolicyJson,
noLoopPolicy: flags.has('no-loop-policy'),
...(command === 'index' && flags.has('status')
? { indexStatus: true }
: {}),
rest,
};
}
Expand Down
14 changes: 14 additions & 0 deletions apps/cli/src/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ import {
createWorkspaceVerificationStore,
createWorkspaceMemoryStore,
createWorkspaceKnowledgeGraph,
createOptionalVerificationSyntaxPort,
createHeuristicAdversary,
detectSandboxBackend,
getProviderPreset,
inferHostProviderType,
isHostProviderType,
resolveHostContextWindowTokens,
resolveMemoryEmbeddingPort,
resolveProviderApiKey,
resolveSandboxPolicy,
Expand Down Expand Up @@ -147,6 +149,15 @@ export function resolveCliPorts(
model,
...(baseUrl ? { baseUrl } : {}),
...(apiKey ? { apiKey } : {}),
capabilities: {
contextWindowTokens: resolveHostContextWindowTokens({
env,
model,
providerType: type,
configContextWindowTokens: config.contextWindowTokens,
}),
supportsTools: true,
},
});
return {
understandingLlm: ports.understandingLlm,
Expand Down Expand Up @@ -242,6 +253,9 @@ export async function createCliClient(options: {
workspaceRoot: options.cwd,
}),
records: createWorkspaceVerificationStore(options.cwd),
...(await createOptionalVerificationSyntaxPort().then((syntax) =>
syntax ? { syntax } : {},
)),
});
const repositoryState = new RepositoryStatePipeline({
store: new InMemoryRepositoryStateStore(),
Expand Down
1 change: 1 addition & 0 deletions apps/cli/src/runAskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ export async function runAsk(options: {
databaseOverlay?.startFields.userSafetyRules,
);
const environmentBlock = formatEnvironmentDetailsBlock({
todayDate: new Date().toLocaleDateString("en-CA"),
modeReminder: databaseOverlay
? `Database (${effectiveMode})`
: compiledMode
Expand Down
Loading
Loading