delimit-cli 4.0.5 → 4.1.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/README.md CHANGED
@@ -10,5 +10,5 @@ The universal command for the Delimit Swarm. When you say **"Think and Build"**,
10
10
  - **"Vault"**: Manage local secrets and API keys (AES-256 encrypted).
11
11
 
12
12
  Works across any configuration — from a single model on a budget to an enterprise swarm of 4+ models.
13
- \n[![npm](https://img.shields.io/npm/v/delimit-cli)](https://www.npmjs.com/package/delimit-cli)\n[![GitHub Action](https://img.shields.io/badge/GitHub%20Action-v1.6.0-blue)](https://github.com/marketplace/actions/delimit-api-governance)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Glama](https://glama.ai/mcp/servers/delimit-ai/delimit/badge)](https://glama.ai/mcp/servers/delimit-ai/delimit)\n[![API Governance](https://delimit-ai.github.io/badge/pass.svg)](https://github.com/marketplace/actions/delimit-api-governance)\n\n<p align="center">\n <img src="docs/demo.gif" alt="Delimit detecting breaking API changes" width="700">\n</p>\n\n---\n\n## Try it in 2 minutes\n\n```bash\nnpx delimit-cli demo # See governance in action — no setup needed\nnpx delimit-cli init # Set up governance for your project\nnpx delimit-cli setup # Configure your AI assistants\n```\n\nNo API keys. No account. No config files.\n\n### Pick your first win\n\n**Protect my API** — catch breaking changes before merge:\n```bash\nnpx delimit-cli try\n# Creates a sample API, introduces breaking changes, shows what gets blocked.\n# Saves a governance report to delimit-report.md\n```\n\n**Watch for drift** — detect spec changes without review:\n```bash\nnpx delimit-cli init # Sets up governance + drift baseline\n# Weekly drift checks run automatically via GitHub Action\n```\n\n**Run PR copilot** — governance gates on every pull request:\n```yaml\n# .github/workflows/api-governance.yml\n- uses: delimit-ai/delimit-action@v1\n with:\n spec: api/openapi.yaml\n# Posts gate status, violations, and remediation in PR comments\n```\n\n---\n\n## What's New in v4.0\n\n- **Toolcard Delta Cache** -- SHA256 schema hashing, delta-only transmission, saves tokens\n- **Session Phoenix** -- cross-model session resurrection with soul capture\n- **Handoff Receipts** -- structured acknowledgment protocol between agents\n- **Cross-Model Audit** -- 3 lenses (security, correctness, governance) with deterministic synthesis\n- **4-model deliberation** -- Claude + Grok + Gemini + Codex debate until consensus\n- **Social target scanner** -- 6-platform engagement discovery\n- **Universal Swarm Triggers** -- "Think and Build", "Keep building", "Ask Delimit"
14
- - **174 MCP tools** -- governance, context, shipping, observability, orchestration, and swarm\n\n---\n\n## GitHub Action\n\nZero-config -- auto-detects your OpenAPI spec:\n\n```yaml\n- uses: delimit-ai/delimit-action@v1\n```\n\nOr with full configuration:\n\n```yaml\nname: API Contract Check\non: pull_request\n\njobs:\n delimit:\n runs-on: ubuntu-latest\n permissions:\n pull-requests: write\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: delimit-ai/delimit-action@v1\n with:\n spec: api/openapi.yaml\n```\n\nThat's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR comment with breaking changes, semver classification, migration guides, and governance gate results.\n\n[View on GitHub Marketplace](https://github.com/marketplace/actions/delimit-api-governance) | [See a live demo (23 breaking changes)](https://github.com/delimit-ai/delimit-action-demo/pull/2)\n\n### Example PR comment\n\n> **Breaking Changes Detected**\n>\n> | Change | Path | Severity |\n> |--------|------|----------|\n> | endpoint_removed | `DELETE /pets/{petId}` | error |\n> | type_changed | `/pets:GET:200[].id` (string -> integer) | warning |\n> | enum_value_removed | `/pets:GET:200[].status` | warning |\n>\n> **Semver**: MAJOR (1.0.0 -> 2.0.0)\n>\n> **Migration Guide**: 3 steps to update your integration\n>\n> ### Governance Gates\n> | Gate | Status | Chain |\n> |------|--------|-------|\n> | API Lint | Pass/Fail | lint -> semver -> gov_evaluate |\n> | Policy Compliance | Pass/Fail | policy -> evidence_collect |\n> | Security Audit | Pass | security_audit -> evidence_collect |\n> | Deploy Readiness | Ready/Blocked | deploy_plan -> security_audit |\n\n---\n\n## CLI commands\n\n```bash\nnpx delimit-cli quickstart # Clone demo project + guided walkthrough\nnpx delimit-cli try # Zero-risk demo — saves governance report\nnpx delimit-cli demo # Self-contained governance demo\nnpx delimit-cli init # Guided wizard with compliance templates\nnpx delimit-cli init --preset strict # Initialize with strict policy\nnpx delimit-cli setup # Install into all AI assistants\nnpx delimit-cli setup --dry-run # Preview changes first\nnpx delimit-cli lint api/openapi.yaml # Check for breaking changes\nnpx delimit-cli diff old.yaml new.yaml # Compare two specs\nnpx delimit-cli explain old.yaml new.yaml # Generate migration guide\nnpx delimit-cli doctor # Check setup health\nnpx delimit-cli uninstall --dry-run # Preview removal\n```\n\n### What the MCP toolkit adds\n\nWhen installed into your AI coding assistant, Delimit provides tools across two tiers:\n\n#### Free (no account needed)\n\n- **API governance** -- lint, diff, policy enforcement, semver classification\n- **Persistent ledger** -- track tasks across sessions, shared between all AI assistants\n- **Zero-spec extraction** -- generate OpenAPI specs from FastAPI, Express, or NestJS source\n- **Project scan** -- auto-detect specs, frameworks, security issues, and tests\n- **Quickstart** -- guided first-run that proves value in 60 seconds\n\n#### Pro\n\n- **Multi-model deliberation** -- Grok, Gemini, and Codex debate until they agree\n- **Security audit** -- dependency scanning, secret detection, SAST analysis\n- **Test verification** -- confirms tests ran, measures coverage, generates new tests\n- **Memory & vault** -- persistent context and encrypted secrets across sessions\n- **Evidence collection** -- governance audit trail for compliance\n- **Deploy pipeline** -- governed build, publish, and rollback\n- **OS layer** -- agent identity, execution plans, approval gates\n\n---\n\n## What It Detects\n\n27 change types (17 breaking, 10 non-breaking) -- deterministic rules, not AI inference. Same input always produces the same result.\n\n### Breaking Changes\n\n| # | Change Type | Example |\n|---|-------------|---------|\n| 1 | `endpoint_removed` | `DELETE /users/{id}` removed entirely |\n| 2 | `method_removed` | `PATCH /orders` no longer exists |\n| 3 | `required_param_added` | New required header on `GET /items` |\n| 4 | `param_removed` | `sort` query parameter removed |\n| 5 | `response_removed` | `200 OK` response dropped |\n| 6 | `required_field_added` | Request body now requires `tenant_id` |\n| 7 | `field_removed` | `email` dropped from response object |\n| 8 | `type_changed` | `id` went from `string` to `integer` |\n| 9 | `format_changed` | `date-time` changed to `date` |\n| 10 | `enum_value_removed` | `status: "pending"` no longer valid |\n| 11 | `param_type_changed` | Query param `limit` changed from `integer` to `string` |\n| 12 | `param_required_changed` | `filter` param became required |\n| 13 | `response_type_changed` | Response `data` changed from `array` to `object` |\n| 14 | `security_removed` | OAuth2 security scheme removed |\n| 15 | `security_scope_removed` | `write:pets` scope removed from OAuth2 |\n| 16 | `max_length_decreased` | `name` maxLength reduced from 255 to 100 |\n| 17 | `min_length_increased` | `code` minLength increased from 1 to 5 |\n\n### Non-Breaking Changes\n\n| # | Change Type | Example |\n|---|-------------|---------|\n| 18 | `endpoint_added` | New `POST /webhooks` endpoint |\n| 19 | `method_added` | `PATCH /users/{id}` method added |\n| 20 | `optional_param_added` | Optional `format` query param added |\n| 21 | `response_added` | `201 Created` response added |\n| 22 | `optional_field_added` | Optional `nickname` field added to response |\n| 23 | `enum_value_added` | `status: "archived"` value added |\n| 24 | `description_changed` | Updated description for `/health` endpoint |\n| 25 | `security_added` | API key security scheme added |\n| 26 | `deprecated_added` | `GET /v1/users` marked as deprecated |\n| 27 | `default_changed` | Default value for `page_size` changed from 10 to 20 |\n\n---\n\n## Policy presets\n\n```bash\nnpx delimit-cli init --preset strict # All violations are errors\nnpx delimit-cli init --preset default # Balanced (default)\nnpx delimit-cli init --preset relaxed # All violations are warnings\n```\n\nOr write custom rules in `.delimit/policies.yml`:\n\n```yaml\nrules:\n - id: freeze_v1\n name: Freeze V1 API\n change_types: [endpoint_removed, method_removed, field_removed]\n severity: error\n action: forbid\n conditions:\n path_pattern: "^/v1/.*"\n message: "V1 API is frozen. Changes must be made in V2."\n```\n\n---\n\n## Supported formats\n\n- OpenAPI 3.0 and 3.1\n- Swagger 2.0\n- YAML and JSON\n\n---\n\n## Links\n\n- [delimit.ai](https://delimit.ai) -- homepage\n- [Dashboard](https://app.delimit.ai) -- governance console\n- [Docs](https://delimit.ai/docs) -- full documentation\n- [GitHub Action](https://github.com/marketplace/actions/delimit-api-governance) -- Marketplace listing\n- [Quickstart](https://github.com/delimit-ai/delimit-mcp-server) -- try it in 2 minutes\n- [npm](https://www.npmjs.com/package/delimit-cli) -- CLI package\n- [Pricing](https://delimit.ai/pricing) -- free tier + Pro\n\nMIT License
13
+ \n[![npm](https://img.shields.io/npm/v/delimit-cli)](https://www.npmjs.com/package/delimit-cli)\n[![GitHub Action](https://img.shields.io/badge/GitHub%20Action-v1.6.0-blue)](https://github.com/marketplace/actions/delimit-api-governance)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n[![Glama](https://glama.ai/mcp/servers/delimit-ai/delimit/badge)](https://glama.ai/mcp/servers/delimit-ai/delimit)\n[![API Governance](https://delimit-ai.github.io/badge/pass.svg)](https://github.com/marketplace/actions/delimit-api-governance)\n\n<p align="center">\n <img src="docs/demo.gif" alt="Delimit detecting breaking API changes" width="700">\n</p>\n\n---\n\n## Try it in 2 minutes\n\n```bash\nnpx delimit-cli demo # See governance in action — no setup needed\nnpx delimit-cli init # Set up governance for your project\nnpx delimit-cli setup # Configure your AI assistants\n```\n\nNo API keys. No account. No config files.\n\n### Pick your first win\n\n**Protect my API** — catch breaking changes before merge:\n```bash\nnpx delimit-cli try\n# Creates a sample API, introduces breaking changes, shows what gets blocked.\n# Saves a governance report to delimit-report.md\n```\n\n**Watch for drift** — detect spec changes without review:\n```bash\nnpx delimit-cli init # Sets up governance + drift baseline\n# Weekly drift checks run automatically via GitHub Action\n```\n\n**Run PR copilot** — governance gates on every pull request:\n```yaml\n# .github/workflows/api-governance.yml\n- uses: delimit-ai/delimit-action@v1\n with:\n spec: api/openapi.yaml\n# Posts gate status, violations, and remediation in PR comments\n```\n\n---\n\n## What's New in v4.1\n\n- **TUI** -- terminal-native Ventures panel, real `delimit think` and `delimit build` commands\n- **Security hardening** -- notify.py stubbed in npm, axios pinned against supply chain attacks\n- **Free tier restructure** -- deliberations use Gemini Flash + GPT-4o-mini (cost: <$20/mo)\n- **Zero-config onboarding** -- auto-detect framework, scan, and first evidence in one command\n- **Auto-approve tools** -- `delimit setup` configures permissions for Claude Code, Codex, and Gemini CLI\n\n### v4.0\n\n- **Toolcard Delta Cache** -- SHA256 schema hashing, delta-only transmission, saves tokens\n- **Session Phoenix** -- cross-model session resurrection with soul capture\n- **Handoff Receipts** -- structured acknowledgment protocol between agents\n- **Cross-Model Audit** -- 3 lenses (security, correctness, governance) with deterministic synthesis\n- **4-model deliberation** -- Claude + Grok + Gemini + Codex debate until consensus\n- **Universal Swarm Triggers** -- "Think and Build", "Keep building", "Ask Delimit"
14
+ - **176 MCP tools** -- governance, context, shipping, observability, orchestration, and swarm\n\n---\n\n## GitHub Action\n\nZero-config -- auto-detects your OpenAPI spec:\n\n```yaml\n- uses: delimit-ai/delimit-action@v1\n```\n\nOr with full configuration:\n\n```yaml\nname: API Contract Check\non: pull_request\n\njobs:\n delimit:\n runs-on: ubuntu-latest\n permissions:\n pull-requests: write\n steps:\n - uses: actions/checkout@v4\n with:\n fetch-depth: 0\n - uses: delimit-ai/delimit-action@v1\n with:\n spec: api/openapi.yaml\n```\n\nThat's it. Delimit auto-fetches the base branch spec, diffs it, and posts a PR comment with breaking changes, semver classification, migration guides, and governance gate results.\n\n[View on GitHub Marketplace](https://github.com/marketplace/actions/delimit-api-governance) | [See a live demo (23 breaking changes)](https://github.com/delimit-ai/delimit-action-demo/pull/2)\n\n### Example PR comment\n\n> **Breaking Changes Detected**\n>\n> | Change | Path | Severity |\n> |--------|------|----------|\n> | endpoint_removed | `DELETE /pets/{petId}` | error |\n> | type_changed | `/pets:GET:200[].id` (string -> integer) | warning |\n> | enum_value_removed | `/pets:GET:200[].status` | warning |\n>\n> **Semver**: MAJOR (1.0.0 -> 2.0.0)\n>\n> **Migration Guide**: 3 steps to update your integration\n>\n> ### Governance Gates\n> | Gate | Status | Chain |\n> |------|--------|-------|\n> | API Lint | Pass/Fail | lint -> semver -> gov_evaluate |\n> | Policy Compliance | Pass/Fail | policy -> evidence_collect |\n> | Security Audit | Pass | security_audit -> evidence_collect |\n> | Deploy Readiness | Ready/Blocked | deploy_plan -> security_audit |\n\n---\n\n## CLI commands\n\n```bash\nnpx delimit-cli quickstart # Clone demo project + guided walkthrough\nnpx delimit-cli try # Zero-risk demo — saves governance report\nnpx delimit-cli demo # Self-contained governance demo\nnpx delimit-cli init # Guided wizard with compliance templates\nnpx delimit-cli init --preset strict # Initialize with strict policy\nnpx delimit-cli setup # Install into all AI assistants\nnpx delimit-cli setup --dry-run # Preview changes first\nnpx delimit-cli lint api/openapi.yaml # Check for breaking changes\nnpx delimit-cli diff old.yaml new.yaml # Compare two specs\nnpx delimit-cli explain old.yaml new.yaml # Generate migration guide\nnpx delimit-cli doctor # Check setup health\nnpx delimit-cli uninstall --dry-run # Preview removal\n```\n\n### What the MCP toolkit adds\n\nWhen installed into your AI coding assistant, Delimit provides tools across two tiers:\n\n#### Free (no account needed)\n\n- **API governance** -- lint, diff, policy enforcement, semver classification\n- **Persistent ledger** -- track tasks across sessions, shared between all AI assistants\n- **Zero-spec extraction** -- generate OpenAPI specs from FastAPI, Express, or NestJS source\n- **Project scan** -- auto-detect specs, frameworks, security issues, and tests\n- **Quickstart** -- guided first-run that proves value in 60 seconds\n\n#### Pro\n\n- **Multi-model deliberation** -- AI models debate until they agree (free: Gemini Flash + GPT-4o-mini; BYOK: any models)\n- **Security audit** -- dependency scanning, secret detection, SAST analysis\n- **Test verification** -- confirms tests ran, measures coverage, generates new tests\n- **Memory & vault** -- persistent context and encrypted secrets across sessions\n- **Evidence collection** -- governance audit trail for compliance\n- **Deploy pipeline** -- governed build, publish, and rollback\n- **OS layer** -- agent identity, execution plans, approval gates\n\n---\n\n## What It Detects\n\n27 change types (17 breaking, 10 non-breaking) -- deterministic rules, not AI inference. Same input always produces the same result.\n\n### Breaking Changes\n\n| # | Change Type | Example |\n|---|-------------|---------|\n| 1 | `endpoint_removed` | `DELETE /users/{id}` removed entirely |\n| 2 | `method_removed` | `PATCH /orders` no longer exists |\n| 3 | `required_param_added` | New required header on `GET /items` |\n| 4 | `param_removed` | `sort` query parameter removed |\n| 5 | `response_removed` | `200 OK` response dropped |\n| 6 | `required_field_added` | Request body now requires `tenant_id` |\n| 7 | `field_removed` | `email` dropped from response object |\n| 8 | `type_changed` | `id` went from `string` to `integer` |\n| 9 | `format_changed` | `date-time` changed to `date` |\n| 10 | `enum_value_removed` | `status: "pending"` no longer valid |\n| 11 | `param_type_changed` | Query param `limit` changed from `integer` to `string` |\n| 12 | `param_required_changed` | `filter` param became required |\n| 13 | `response_type_changed` | Response `data` changed from `array` to `object` |\n| 14 | `security_removed` | OAuth2 security scheme removed |\n| 15 | `security_scope_removed` | `write:pets` scope removed from OAuth2 |\n| 16 | `max_length_decreased` | `name` maxLength reduced from 255 to 100 |\n| 17 | `min_length_increased` | `code` minLength increased from 1 to 5 |\n\n### Non-Breaking Changes\n\n| # | Change Type | Example |\n|---|-------------|---------|\n| 18 | `endpoint_added` | New `POST /webhooks` endpoint |\n| 19 | `method_added` | `PATCH /users/{id}` method added |\n| 20 | `optional_param_added` | Optional `format` query param added |\n| 21 | `response_added` | `201 Created` response added |\n| 22 | `optional_field_added` | Optional `nickname` field added to response |\n| 23 | `enum_value_added` | `status: "archived"` value added |\n| 24 | `description_changed` | Updated description for `/health` endpoint |\n| 25 | `security_added` | API key security scheme added |\n| 26 | `deprecated_added` | `GET /v1/users` marked as deprecated |\n| 27 | `default_changed` | Default value for `page_size` changed from 10 to 20 |\n\n---\n\n## Policy presets\n\n```bash\nnpx delimit-cli init --preset strict # All violations are errors\nnpx delimit-cli init --preset default # Balanced (default)\nnpx delimit-cli init --preset relaxed # All violations are warnings\n```\n\nOr write custom rules in `.delimit/policies.yml`:\n\n```yaml\nrules:\n - id: freeze_v1\n name: Freeze V1 API\n change_types: [endpoint_removed, method_removed, field_removed]\n severity: error\n action: forbid\n conditions:\n path_pattern: "^/v1/.*"\n message: "V1 API is frozen. Changes must be made in V2."\n```\n\n---\n\n## Supported formats\n\n- OpenAPI 3.0 and 3.1\n- Swagger 2.0\n- YAML and JSON\n\n---\n\n## Links\n\n- [delimit.ai](https://delimit.ai) -- homepage\n- [Dashboard](https://app.delimit.ai) -- governance console\n- [Docs](https://delimit.ai/docs) -- full documentation\n- [GitHub Action](https://github.com/marketplace/actions/delimit-api-governance) -- Marketplace listing\n- [Quickstart](https://github.com/delimit-ai/delimit-mcp-server) -- try it in 2 minutes\n- [npm](https://www.npmjs.com/package/delimit-cli) -- CLI package\n- [Pricing](https://delimit.ai/pricing) -- free tier + Pro\n\nMIT License
@@ -439,6 +439,39 @@ program
439
439
  });
440
440
  });
441
441
 
442
+ program
443
+ .command('think [question...]')
444
+ .description('Run multi-model deliberation on a question')
445
+ .action(async (questionParts) => {
446
+ const question = Array.isArray(questionParts) ? questionParts.join(' ').trim() : '';
447
+ if (!question) {
448
+ console.log(chalk.yellow('Usage: delimit think <question>'));
449
+ console.log(chalk.gray('Example: delimit think "Should we use REST or GraphQL for the new API?"'));
450
+ return;
451
+ }
452
+ console.log(chalk.blue('Deliberating...'));
453
+ console.log(chalk.gray(`Question: ${question}`));
454
+ try {
455
+ const result = execSync(
456
+ `python3 -c "import sys; sys.path.insert(0, '${continuityContext.serverDir}'); from ai.deliberation import deliberate; import json; r = deliberate(question='${question.replace(/'/g, "\\'")}'); print(json.dumps(r, indent=2))"`,
457
+ { encoding: 'utf-8', timeout: 120000, cwd: continuityContext.serverDir }
458
+ );
459
+ const parsed = JSON.parse(result);
460
+ if (parsed.error) {
461
+ console.log(chalk.red(`Error: ${parsed.error}`));
462
+ } else if (parsed.synthesis) {
463
+ console.log(chalk.green('\nConsensus:'));
464
+ console.log(parsed.synthesis);
465
+ if (parsed.verdict) console.log(chalk.blue(`\nVerdict: ${parsed.verdict}`));
466
+ if (parsed.confidence) console.log(chalk.gray(`Confidence: ${parsed.confidence}`));
467
+ } else {
468
+ console.log(JSON.stringify(parsed, null, 2));
469
+ }
470
+ } catch (e) {
471
+ console.log(chalk.red(`Deliberation failed: ${e.message}`));
472
+ }
473
+ });
474
+
442
475
  program
443
476
  .command('open [venture]')
444
477
  .description('Open a venture session without changing directories')
@@ -0,0 +1,105 @@
1
+ #!/bin/bash
2
+ # Delimit OS — the AI developer operating system
3
+ # Type 'delimit' to launch the TUI, or 'delimit <command>' for CLI tools
4
+ #
5
+ # Usage:
6
+ # delimit → Launch TUI (interactive terminal dashboard)
7
+ # delimit --quick → Quick status (non-interactive)
8
+ # delimit think → Trigger deliberation
9
+ # delimit build → Start autonomous build loop
10
+ # delimit ask <query> → Ask the swarm
11
+ # delimit lint <spec> → Lint an API spec
12
+ # delimit init → Initialize governance in current repo
13
+ # delimit setup → Configure AI assistants
14
+
15
+ set -e
16
+
17
+ DELIMIT_HOME="${DELIMIT_HOME:-$HOME/.delimit}"
18
+ GATEWAY="$DELIMIT_HOME/server/ai"
19
+
20
+ # If no args, launch TUI (interactive if terminal, quick if piped)
21
+ if [ $# -eq 0 ]; then
22
+ if [ -f "$GATEWAY/tui.py" ]; then
23
+ if [ -t 1 ] && [ -t 0 ]; then
24
+ cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui
25
+ else
26
+ cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui --quick
27
+ fi
28
+ else
29
+ # Fallback to npm CLI
30
+ exec delimit-cli "$@"
31
+ fi
32
+ fi
33
+
34
+ # Route commands
35
+ case "$1" in
36
+ --quick|-q)
37
+ if [ -f "$GATEWAY/tui.py" ]; then
38
+ cd "$DELIMIT_HOME/server" && exec python3 -m ai.tui --quick
39
+ else
40
+ exec delimit-cli status
41
+ fi
42
+ ;;
43
+ think|deliberate)
44
+ shift
45
+ QUESTION="${*:-What should we build next based on the current ledger and signals?}"
46
+ echo "[Delimit OS] Triggering deliberation..."
47
+ cd "$DELIMIT_HOME/server" && python3 -c "
48
+ from ai.deliberation import deliberate
49
+ import json
50
+ result = deliberate('''$QUESTION''', mode='dialogue', max_rounds=3)
51
+ if 'error' in result:
52
+ print(f'Error: {result[\"error\"]}')
53
+ elif result.get('mode') == 'single_model_reflection':
54
+ print(f'Model: {result.get(\"model\", \"?\")}')
55
+ print(f'\\nAdvocate:\\n{result.get(\"advocate\", \"\")[:500]}')
56
+ print(f'\\nCritic:\\n{result.get(\"critic\", \"\")[:500]}')
57
+ print(f'\\nSynthesis:\\n{result.get(\"synthesis\", \"\")}')
58
+ else:
59
+ print(f'Verdict: {result.get(\"final_verdict\", \"no consensus\")[:500]}')
60
+ print(f'Rounds: {result.get(\"rounds\", 0)}')
61
+ " 2>&1
62
+ ;;
63
+ build|loop)
64
+ shift
65
+ echo "[Delimit OS] Starting autonomous build loop..."
66
+ echo "Checking ledger for next task..."
67
+ cd "$DELIMIT_HOME/server" && python3 -c "
68
+ from ai.ledger_manager import get_context
69
+ import json
70
+ result = get_context()
71
+ items = result.get('next_up', [])
72
+ if items:
73
+ print(f'Next up: {items[0].get(\"id\", \"?\")} [{items[0].get(\"priority\", \"?\")}] {items[0].get(\"title\", \"?\")[:60]}')
74
+ print(f'Total open: {result.get(\"open_items\", 0)}')
75
+ else:
76
+ print('Ledger is clear — nothing to build.')
77
+ " 2>&1
78
+ ;;
79
+ ask)
80
+ shift
81
+ QUERY="$*"
82
+ if [ -z "$QUERY" ]; then
83
+ echo "Usage: delimit ask <question>"
84
+ exit 1
85
+ fi
86
+ echo "[Delimit OS] Checking context..."
87
+ cd "$DELIMIT_HOME/server" && python3 -c "
88
+ from ai.ledger_manager import get_context
89
+ import json
90
+ result = get_context()
91
+ print(json.dumps(result, indent=2)[:2000])
92
+ " 2>&1
93
+ ;;
94
+ status)
95
+ if [ -f "$GATEWAY/tui.py" ]; then
96
+ cd "$GATEWAY/.." && exec python3 -m ai.tui --quick
97
+ else
98
+ exec delimit-cli status
99
+ fi
100
+ ;;
101
+ *)
102
+ # Pass through to delimit-cli for all other commands
103
+ exec delimit-cli "$@"
104
+ ;;
105
+ esac
@@ -61,10 +61,6 @@ def dispatch_task(
61
61
  tools_needed: Optional[List[str]] = None,
62
62
  constraints: Optional[List[str]] = None,
63
63
  context: str = "",
64
- task_type: str = "",
65
- venture: str = "",
66
- variables: Optional[Dict[str, Any]] = None,
67
- external_key: str = "",
68
64
  ) -> Dict[str, Any]:
69
65
  """Create a tracked agent task.
70
66
 
@@ -82,23 +78,6 @@ def dispatch_task(
82
78
  if priority not in VALID_PRIORITIES:
83
79
  return {"error": f"priority must be one of: {', '.join(sorted(VALID_PRIORITIES))}"}
84
80
 
85
- tasks = _load_tasks()
86
-
87
- normalized_external_key = external_key.strip()
88
- if normalized_external_key:
89
- for existing in tasks.values():
90
- if existing.get("external_key") != normalized_external_key:
91
- continue
92
- if existing.get("status") in ("dispatched", "in_progress", "handed_off", "done"):
93
- prompt = _build_agent_prompt(existing)
94
- return {
95
- "status": "deduped",
96
- "task_id": existing["id"],
97
- "task": existing,
98
- "agent_prompt": prompt,
99
- "message": f"Task {existing['id']} already exists for {normalized_external_key}",
100
- }
101
-
102
81
  task_id = f"AGT-{uuid.uuid4().hex[:8].upper()}"
103
82
 
104
83
  task = {
@@ -110,10 +89,6 @@ def dispatch_task(
110
89
  "tools_needed": tools_needed or [],
111
90
  "constraints": constraints or [],
112
91
  "context": context.strip(),
113
- "task_type": task_type.strip(),
114
- "venture": venture.strip(),
115
- "variables": variables or {},
116
- "external_key": normalized_external_key,
117
92
  "status": "dispatched",
118
93
  "created_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"),
119
94
  "updated_at": time.strftime("%Y-%m-%dT%H:%M:%SZ"),
@@ -122,6 +97,7 @@ def dispatch_task(
122
97
  "handoffs": [],
123
98
  }
124
99
 
100
+ tasks = _load_tasks()
125
101
  tasks[task_id] = task
126
102
  _save_tasks(tasks)
127
103
 
@@ -159,11 +135,6 @@ def _build_agent_prompt(task: Dict[str, Any]) -> str:
159
135
  if task.get("context"):
160
136
  lines.append(f"\n**Context:**\n{task['context']}")
161
137
 
162
- if task.get("variables"):
163
- lines.append("\n**Variables:**")
164
- for key, value in task["variables"].items():
165
- lines.append(f"- {key}: {value}")
166
-
167
138
  if task.get("tools_needed"):
168
139
  lines.append(f"\n**Tools needed:** {', '.join(task['tools_needed'])}")
169
140
 
@@ -476,10 +447,7 @@ def get_agent_dashboard() -> Dict[str, Any]:
476
447
  "tasks": [
477
448
  {"id": t["id"], "title": t["title"], "status": t["status"],
478
449
  "priority": t.get("priority", "P1"),
479
- "linked_ledger": t.get("linked_ledger_items", []),
480
- "task_type": t.get("task_type", ""),
481
- "venture": t.get("venture", ""),
482
- "variables": t.get("variables", {})}
450
+ "linked_ledger": t.get("linked_ledger_items", [])}
483
451
  for t in model_tasks
484
452
  ],
485
453
  }
@@ -30,7 +30,7 @@ OWN_REPOS = [
30
30
  "delimit-ai/delimit-quickstart",
31
31
  ]
32
32
 
33
- INTERNAL_USERS = set()
33
+ INTERNAL_USERS = set() # Populated at runtime from config
34
34
 
35
35
  COMPETITOR_ACTIONS = [
36
36
  "tufin/oasdiff-action",
@@ -91,20 +91,10 @@ def _register_venture(info: Dict[str, str]):
91
91
  VENTURES_FILE.write_text(json.dumps(ventures, indent=2))
92
92
 
93
93
 
94
- CENTRAL_LEDGER_DIR = Path.home() / ".delimit" / "ledger"
95
-
96
-
97
94
  def _project_ledger_dir(project_path: str = ".") -> Path:
98
- """Get the ledger directory ALWAYS uses central ~/.delimit/ledger/.
99
-
100
- Cross-model handoff fix: Codex and Gemini were writing to $PWD/.delimit/ledger/
101
- which caused ledger fragmentation. All models must use the same central location
102
- so Claude, Codex, and Gemini see the same items.
103
-
104
- The central ledger at ~/.delimit/ledger/ is the source of truth.
105
- Per-project .delimit/ dirs are for policies and config only, not ledger state.
106
- """
107
- return CENTRAL_LEDGER_DIR
95
+ """Get the ledger directory for the current project."""
96
+ p = Path(project_path).resolve()
97
+ return p / ".delimit" / "ledger"
108
98
 
109
99
 
110
100
  def _ensure(project_path: str = "."):