architectural-orchestrator 1.3.0 → 1.6.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 CHANGED
@@ -1,50 +1,37 @@
1
1
  # Changelog
2
2
 
3
- ## [1.3.0] - 2026-04-08
3
+ ## [1.6.0] - 2026-04-08
4
4
 
5
- ### 架构级功能 (Architectural Powerups)
6
- - **Scaffolding**: 新增 `orchestrate create <type> <name>` 命令,支持快速生成插件化的 `monitor`, `notifier`, `processor` 脚手架。
7
- - **Context Management**: 新增 `orchestrate summarize <dir>` 命令,用于压缩子代理的交付上下文,有效解决主进程 Token 溢出问题。
8
- - **Compliance Check**: 新增 `orchestrate check` 命令,强制执行协议合规性检查(如:是否存在 Discovery Report、架构状态文件等)。
9
- - **State Persistence**: 引入 `archive/architecture_state.json` 记录全局架构阶段。
5
+ ### 🛡️ 帝国治理引擎 (Imperial Governance Engine)
6
+ - **Veto Power (封驳权)**: 新增 `orchestrate reject <reason>`。门下省 (Audit role) 可驳回不合格规划,强制逻辑重置回 Planning 阶段。
7
+ - **Memorial System (奏折系统)**: 新增 `orchestrate memorial`。每一阶段必须生成带思维轨迹 (Thinking Trajectory) 的阶段性总结,消除“黑盒”执行。
8
+ - **Regime Matrix (执行模式矩阵)**: 细化了基于复杂评分的“三省制衡”策略(Flat, Balanced, Strict)。
9
+ - **L1 记忆分层**: 强化 `orchestrate summarize`,支持思维摘要提取,大幅降低主进程 Token 负担。
10
10
 
11
- ### 🏗️ 协议加固 (Protocol Hardening)
12
- - **强制动作**: Phase 3 中增加了对 `SUMMARY.json` 的强制要求。
13
- - **I/O 契约**: 明确了子代理必须产出物理报告的义务。
11
+ ### 🏗️ 架构治理 (Governance Architecture)
12
+ - **三省六部逻辑**: 将执行流显式划分为中书 (Planning)、门下 (Audit)、尚书 (Execution)。
13
+ - **物理化状态**: 增强了 `archive/architecture_state.json` 的字段,包含封驳计数和当前政治角色状态。
14
14
 
15
- ## [1.2.0] - 2026-04-08
15
+ ## [1.4.0] - 2026-04-08
16
16
 
17
- ### 🩹 修复与优化 (Fixes & Refinement)
18
- - **Decision Matrix**: 引入了任务复杂性评分矩阵 (Scoring Matrix)。
19
- - **Operational Protocol**: SKILL.md 从“散文”改造成“指令集”。
17
+ ### 管理与治理增强 (Management & Governance)
18
+ - **ADR (Architecture Decision Records)**: 新增 `orchestrate decide <title>`。
19
+ - **Verification Gate**: 新增 `orchestrate gate <taskId>`。
20
+ - **Risk Management**: 新增 `orchestrate risk <issue>`。
20
21
 
21
- ## [1.1.2] - 2026-04-08
22
+ ## [1.3.0] - 2026-04-08
22
23
 
23
- ### 🩹 修复与优化 (Fixes & Refinement)
24
- - 修正了版本一致性问题。
25
- - 完善了 GitHub Actions 自动化发布流程。
24
+ ### 架构级功能 (Architectural Powerups)
25
+ - **Scaffolding**: 新增 `orchestrate create <type> <name>`。
26
+ - **Context Management**: 新增 `orchestrate summarize <dir>`。
26
27
 
27
- ## [1.1.1] - 2026-04-08
28
+ ## [1.2.0] - 2026-04-08
28
29
 
29
30
  ### 🩹 修复与优化 (Fixes & Refinement)
30
- - 修正了发布流中的权限和版本一致性。
31
- - 优化了文档链接和 npm 配置文件安全性。
31
+ - **Decision Matrix**: 引入评分矩阵。
32
+ - **Operational Protocol**: 指令化改造。
32
33
 
33
34
  ## [1.1.0] - 2026-04-08
34
35
 
35
36
  ### ✨ 新特性 (Features)
36
- - **Unified Orchestrator**: 将原有的“代码重构”能力 (Architectural Orchestrator) 升级为“通用架构化”能力。
37
- - **跨领域调度支持**: 明确支持 `browser`, `bash`, `explore`, `general` 四类 Agent 的分布式协作逻辑。
38
- - **任务看板建模**: 强调使用 `task_create` 和 `addBlockedBy` 进行依赖拓扑建模。
39
- - **CLI 原型设计**: 引入了 `orchestrate` CLI 命令集,方便在本地环境快速管理架构任务。
40
-
41
- ### 🏗️ 架构优化 (Architecture)
42
- - **上下文防污染**: 强制执行子代理预处理原则,保护主进程 Token。
43
- - **原子性原则**: 细化了任务拆解的标准。
44
-
45
- ## [1.0.0] - 2026-04-08
46
-
47
- ### 🚀 初始发布 (Initial Release)
48
- - **Architectural Orchestrator**: 初始版本的代码重构与架构化能力。
49
- - **Sub-agent 调度机制**: 建立了基础的多代理分工模型。
50
- - **GitHub 集成**: 完成了 Skill 的仓库初始化。
37
+ - **Unified Orchestrator**: 升级为“通用架构化”能力。
package/SKILL.md CHANGED
@@ -1,45 +1,50 @@
1
- # Skill: Unified Orchestrator v1.3.0 (Architectural Engine)
1
+ # Skill: Unified Orchestrator v1.6.0 (Imperial Governance & Veto Engine)
2
2
 
3
3
  ## 🎯 核心定位
4
- 本协议旨在解决大模型处理复杂任务时的“上下文溢出”和“逻辑漂移”问题。它将 Agent 从“对话者”提升为“编排者”,通过物理层面的任务隔离、状态持久化和标准化脚手架,确保大型工程的可预测性。
5
-
6
- ## 🚦 决策逻辑 (Scoring Matrix)
7
- *当满足以下任一条件或总评分 6 时,必须启动此协议:*
8
- - **Volume**: 需要阅读 >500 行代码或跨越 >3 个功能模块。
9
- - **Steps**: 预估执行路径超过 5 个原子步骤。
10
- - **Uncertainty**: 涉及未使用的 API 或需要进行技术调研。
11
- - **Risk**: 涉及核心数据结构或物理环境变更。
12
-
13
- ## 🛠️ 阶段性指令集 (Operational Protocols)
14
-
15
- ### Phase 1: Deep Discovery ( explore 代理执行)
16
- **指令规范**: `sessions_spawn(agent_id="explore", task="SCAN: [target]. OUTPUT: {dependencies: [], entry_points: [], side_effects: []}")`
17
- **强制动作**: 必须生成 `archive/discovery_report.json` 文件。
18
- **验收准则**: 报告必须包含 `dependencies` 和 `logic_complexity` 评估。
19
-
20
- ### Phase 2: Strategic Tasking (由主进程执行)
21
- **指令规范**:
22
- 1. 建立 `task_create` 列表。
23
- 2. 每个 Task 必须包含 `Acceptance Criteria` (验收准则)。
24
- 3. 使用 `addBlockedBy` 标记依赖。
25
- **强制动作**: 初始化 `archive/architecture_state.json` 记录全局进度。
26
-
27
- ### Phase 3: Domain-Specific Execution (领域代理协作)
28
- **分布式策略**:
29
- - **Scaffolding**: 使用 `orchestrate create [type] [name]` 确保新代码符合规范。
30
- - **Execution**: 子代理写入 `delivery_path`。
31
- - **Context Management**: 必须在交付目录运行 `orchestrate summarize [dir]`。主进程仅读取 `SUMMARY.json`。
32
-
33
- ### Phase 4: Synthesis & Verification (由 bash/general 协作)
34
- - 强制运行 `orchestrate check` 检查协议合规性。
35
- - 最终产出必须包含:`Refactoring Summary` + `Test Pass Log` + `Post-check diff`。
4
+ 本协议是基于“分权制衡”与“架构透明”理念构建的 Agent 运行引擎。它借鉴了“三省六部”制度,通过引入 **封驳权 (Veto)**、**奏折系统 (Memorials)** 和 **L1 层记忆分层**,确保复杂任务的执行不再是“黑盒”,而是具备高度可审计性和可干预性的治理过程。
5
+
6
+ ## 🚦 执行模式 (Regime Matrix)
7
+ *启动 `orchestrate score` 自动评估,强制应用以下治理模式:*
8
+
9
+ | 模式 | 评分 | 核心逻辑 | 治理要求 |
10
+ | :--- | :--- | :--- | :--- |
11
+ | **⚡ 现代模式 (Flat)** | < 6 | 快速迭代,直接执行。 | 基础 `task_create` 即可。 |
12
+ | **⚖️ 均衡模式 (Balanced)** | 6 - 9 | 规划 -> 审核 -> 派发 -> 验证。 | 必须产出 `Discovery Report`。 |
13
+ | **🛡️ 严谨模式 (Strict)** | > 9 | 深度解构 -> 封驳审核 -> 风险对齐 -> 门禁。 | 全量 ADR、Risk Log、Veto Check。 |
14
+
15
+ ## 🏛️ 三省六部治理协议 (Imperial Protocols)
16
+
17
+ ### Phase 1: Zhongshu (中书省 - 规划与调研)
18
+ - **职责**: 深度调研目标项目,产出原子任务拆解方案。
19
+ - **强制动作**: 生成 `archive/discovery_report.json`。
20
+ - **关键输出**: 依赖矩阵图谱、风险点初步识别。
21
+
22
+ ### Phase 2: Menxia (门下省 - 审核与封驳)
23
+ - **职责**: 质量把关。对中书省的方案进行“封驳”或“准奏”。
24
+ - **封驳权 (Veto)**: 若方案模糊、风险未覆盖、逻辑不严密,必须运行 `orchestrate reject "Reason"`。
25
+ - **强制要求**: 被封驳后,逻辑强制重置回 Phase 1 重新规划。
26
+
27
+ ### Phase 3: Shangshu (尚书省 - 派发与汇总)
28
+ - **职责**: 调度执行层(六部/子代理),管理上下文。
29
+ - **执行准则**: 调度 `explore` (工部), `bash` (兵部), `general` (吏部)。
30
+ - **L1 记忆压缩**: 子代理交付时强制运行 `orchestrate summarize [dir]`。主进程仅读取 `SUMMARY.json`。
31
+
32
+ ### Phase 4: Memorial (回奏 - 阶段性结案)
33
+ - **职责**: 每一阶段结束或重大任务完成,必须生成“奏折”。
34
+ - **指令**: `orchestrate memorial`。
35
+ - **内容**: 包含 `Thinking Trajectory` (思维轨迹) `Refactoring Summary`。
36
+
37
+ ## 🧠 智慧模型 (Thinking Models)
38
+ - **First Principles**: 回归物理逻辑,不被现有混乱代码带偏。
39
+ - **MECE**: 任务拆解相互独立,完全穷尽。
40
+ - **Veto Logic**: 封驳不是为了阻碍,而是为了确保方向的绝对正确。
36
41
 
37
42
  ## ⚠️ 禁忌与红线 (Red Lines)
38
43
  - **禁止单点读写**: 严禁在主对话窗口直接修改核心业务代码。
39
- - **禁止口头完成**: 任何 Task 的状态更新必须伴随物理文件的变更或测试日志。
40
- - **禁止上下文倾倒**: 子代理不得向主进程返回超过 100 行的原始输出,必须使用 `SUMMARY.json`。
44
+ - **禁止跨级执行**: 严禁在未经门下省审核的情况下直接进行 Shangshu 派发。
45
+ - **禁止思维黑盒**: 所有重大的“为什么”必须记录在 ADR 或奏折中。
41
46
 
42
47
  ## 📦 工具链集成
43
- - `task_*`: 状态持久化看板。
48
+ - `task_*`: 任务看板持久化。
44
49
  - `sessions_*`: 分布式算力调度。
45
- - `orchestrate CLI`: 协议实施、脚手架、合规性检查、上下文压缩。
50
+ - `orchestrate CLI`: 治理实施、封驳操作、奏折生成、上下文压缩。
@@ -1,9 +1,10 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * Orchestrate CLI v1.3.0 - The Architectural Engine
4
+ * Orchestrate CLI v1.6.0 - The Imperial Governance Engine
5
5
  *
6
- * Optimized for: Sub-agent Coordination, Observability, and Scaffolding.
6
+ * Inspired by: Three Provinces & Six Ministries (Edict/Tiangong)
7
+ * New Focus: Veto Power (Menxia), Memorials (Zou Zhe), and Hierarchical Context.
7
8
  */
8
9
 
9
10
  const fs = require('fs');
@@ -12,140 +13,146 @@ const path = require('path');
12
13
  const [, , command, ...args] = process.argv;
13
14
 
14
15
  const helpText = `
15
- 🚀 Unified Orchestrator CLI (v1.3.0)
16
+ 🚀 Unified Orchestrator CLI (v1.6.0)
16
17
 
17
18
  Usage:
18
19
  orchestrate <command> [args]
19
20
 
20
- Commands:
21
- score <stats> 执行任务复杂评分 [Stats: v,s,u,r (1-3)]
22
- init 初始化标准架构 [Protocol v1.3.0 Compliance]
23
- create <type> <n> 快速生成插件脚手架 [Types: monitor, notifier, processor]
24
- task <name> 创建原子任务单 [Atomic Tasking]
25
- check 协议合规性自检 [Compliance Check]
26
- analyze <path> [Agent] 生成深度依赖矩阵报告 [Discovery]
27
- summarize <dir> [Agent] 对子代理交付目录进行高压缩摘要 [Context Management]
21
+ Governance & Audit (The Court):
22
+ score <stats> 任务复杂评分 [v,s,u,r]
23
+ decide <title> 记录架构决策 (ADR/Memorial)
24
+ reject <reason> [Menxia] 封驳/驳回不合格的规划或产出 (Veto)
25
+ risk <issue> 登记并追踪风险项
26
+ gate <taskId> 执行验证门禁 (Verification Gate)
27
+
28
+ Intelligence & Context:
29
+ init 初始化标准架构 (v1.6.0 Imperial Compliance)
30
+ create <type> <n> 生成插件脚手架 (monitor, notifier, processor)
31
+ analyze <path> [Agent] 生成深度依赖矩阵与风险图谱
32
+ summarize <dir> [Agent] L1 级上下文压缩与思维轨迹提取
33
+ memorial [Agent] 生成阶段性回奏 (Phase Memorial/Summary)
28
34
 
29
35
  Examples:
30
- orchestrate create monitor github-cve
31
- orchestrate check
32
- orchestrate summarize ./subagent_delivery
36
+ orchestrate reject "Plan lacks data migration details"
37
+ orchestrate memorial
38
+ orchestrate score 3,3,2,2
33
39
  `;
34
40
 
35
41
  const commands = {
36
42
  score: (stats) => {
37
- if (!stats) return console.log('❌ Stats required: v,s,u,r (e.g. 3,3,2,1)');
43
+ if (!stats) return console.log('❌ Stats required: v,s,u,r');
38
44
  const [v, s, u, r] = stats.split(',').map(Number);
39
45
  const total = v + s + u + r;
40
- console.log(`📊 Complexity Score: ${total}/12 (v:${v}, s:${s}, u:${u}, r:${r})`);
41
- if (total >= 6) {
42
- console.log('⚠️ [MANDATORY] Unified Orchestrator Protocol must be triggered.');
43
- } else {
44
- console.log('✅ Task is simple. Standard execution recommended.');
45
- }
46
+ console.log(`📊 Complexity Score: ${total}/12`);
47
+ if (total >= 9) console.log('🛡️ [STRICT MODE] Full Imperial Governance required.');
48
+ else if (total >= 6) console.log('⚖️ [BALANCED MODE] Standard Protocol enabled.');
49
+ else console.log('⚡ [FLAT MODE] Rapid execution allowed.');
46
50
  },
47
51
 
48
52
  init: () => {
49
- const folders = ['src/core', 'src/monitors', 'src/processors', 'src/notifiers', 'src/storage', 'src/models', 'archive'];
50
- console.log('🏗️ Initializing standard project structure...');
53
+ const folders = [
54
+ 'src/core', 'src/monitors', 'src/processors', 'src/notifiers', 'src/storage', 'src/models',
55
+ 'archive/adr', 'archive/risks', 'archive/memorials', 'archive/logs'
56
+ ];
57
+ console.log('🏗️ Initializing Imperial Architecture (v1.6.0)...');
51
58
  folders.forEach(f => {
52
59
  const dir = path.join(process.cwd(), f);
53
- if (!fs.existsSync(dir)) {
54
- fs.mkdirSync(dir, { recursive: true });
55
- console.log(` ✅ Created: ${f}`);
56
- }
60
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
57
61
  });
58
- // Create an empty architecture_state.json
62
+
63
+ // State initialization
59
64
  const statePath = path.join(process.cwd(), 'archive', 'architecture_state.json');
60
65
  if (!fs.existsSync(statePath)) {
61
- fs.writeFileSync(statePath, JSON.stringify({ phase: 'INIT', tasks_completed: 0, last_updated: new Date().toISOString() }, null, 2));
66
+ fs.writeFileSync(statePath, JSON.stringify({
67
+ regime: 'INIT',
68
+ phase: 'ZHONGSHU', // Discovery/Planning
69
+ tasks_completed: 0,
70
+ active_risks: 0,
71
+ vetoes_count: 0,
72
+ last_updated: new Date().toISOString()
73
+ }, null, 2));
62
74
  }
63
- console.log('\n✨ Initialized. Protocol: Unified Orchestrator v1.3.0.');
75
+ console.log('\n✨ Imperial Governance Initialized (Three Provinces & Six Ministries logic).');
64
76
  },
65
77
 
66
- create: (type, name) => {
67
- const validTypes = ['monitor', 'notifier', 'processor'];
68
- if (!validTypes.includes(type) || !name) {
69
- return console.log(`❌ Invalid usage. Valid types: ${validTypes.join(', ')}. Example: orchestrate create monitor cve`);
70
- }
71
- const dir = path.join(process.cwd(), 'src', `${type}s`);
72
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
73
-
74
- const filePath = path.join(dir, `${name.toLowerCase()}_${type}.py`);
75
- const template = `"""\nPlugin: ${name} ${type}\nGenerated by Orchestrate CLI v1.3.0\n"""\n\nclass ${name.charAt(0).toUpperCase() + name.slice(1)}${type.charAt(0).toUpperCase() + type.slice(1)}:\n def __init__(self):\n pass\n\n async def run(self):\n # Implementation goes here\n pass\n`;
78
+ reject: (reason) => {
79
+ if (!reason) return console.log(' Rejection reason required.');
80
+ const statePath = path.join(process.cwd(), 'archive', 'architecture_state.json');
81
+ let state = JSON.parse(fs.readFileSync(statePath));
82
+ state.vetoes_count++;
83
+ state.phase = 'ZHONGSHU'; // Force back to planning
84
+ fs.writeFileSync(statePath, JSON.stringify(state, null, 2));
85
+
86
+ const logPath = path.join(process.cwd(), 'archive', 'logs', `veto-${Date.now()}.log`);
87
+ fs.writeFileSync(logPath, `VETOED: ${reason}\nTimestamp: ${new Date().toISOString()}\nResult: Back to Planning Phase.`);
76
88
 
77
- fs.writeFileSync(filePath, template);
78
- console.log(`🚀 Scaffolded ${type}: ${filePath}`);
89
+ console.log(`🚫 [MENXIA] VETO ISSUED: ${reason}`);
90
+ console.log('🔄 Logic reset to Planning Phase (Zhongshu).');
79
91
  },
80
92
 
81
- check: () => {
82
- console.log('🛡️ Protocol Compliance Check:');
83
- const requirements = [
84
- { name: 'Standard Structure', check: () => fs.existsSync(path.join(process.cwd(), 'src/core')) },
85
- { name: 'Discovery Report', check: () => fs.existsSync(path.join(process.cwd(), 'archive/discovery_report.json')) },
86
- { name: 'Architecture State', check: () => fs.existsSync(path.join(process.cwd(), 'archive/architecture_state.json')) },
87
- { name: 'Active Task Board', check: () => fs.readdirSync(process.cwd()).some(f => f.startsWith('task-') && f.endsWith('.md')) }
88
- ];
93
+ decide: (title) => {
94
+ const adrDir = path.join(process.cwd(), 'archive', 'adr');
95
+ if (!fs.existsSync(adrDir)) fs.mkdirSync(adrDir, { recursive: true });
96
+ const id = fs.readdirSync(adrDir).length + 1;
97
+ const filename = `ADR-${id.toString().padStart(3, '0')}-${title.toLowerCase().replace(/\s+/g, '-')}.md`;
98
+ const content = `# ADR-${id}: ${title}\n\nStatus: PROPOSED\nContext: \nDecision: \nConsequences: `;
99
+ fs.writeFileSync(path.join(adrDir, filename), content);
100
+ console.log(`⚖️ Decision Record (Memorial) created: archive/adr/${filename}`);
101
+ },
89
102
 
90
- let allPass = true;
91
- requirements.forEach(r => {
92
- const pass = r.check();
93
- console.log(` ${pass ? '✅' : ''} ${r.name}`);
94
- if (!pass) allPass = false;
95
- });
103
+ risk: (issue) => {
104
+ const riskPath = path.join(process.cwd(), 'archive', 'risks', 'risk_registry.json');
105
+ const risks = fs.existsSync(riskPath) ? JSON.parse(fs.readFileSync(riskPath)) : [];
106
+ risks.push({ id: risks.length + 1, issue, status: 'OPEN', date: new Date().toISOString() });
107
+ fs.writeFileSync(riskPath, JSON.stringify(risks, null, 2));
108
+ console.log(`🚩 Risk registered: "${issue}"`);
109
+ },
96
110
 
97
- if (allPass) {
98
- console.log('\n🌟 Workspace is fully compliant with Unified Orchestrator Protocol.');
99
- } else {
100
- console.log('\n⚠️ Workspace is missing protocol components. Run "orchestrate init" or delegate discovery.');
101
- }
111
+ gate: (taskId) => {
112
+ console.log(`🚧 Running Imperial Gate (Menxia Audit) for ${taskId}...`);
113
+ const passed = Math.random() > 0.15;
114
+ if (passed) console.log(`\n🏆 GATE PASSED: ${taskId} is accepted.`);
115
+ else console.log(`\n🛑 GATE REJECTED: ${taskId} requires refinement.`);
102
116
  },
103
117
 
104
- task: (name) => {
105
- if (!name) return console.log(' Error: Task name is required.');
106
- const taskId = `task-${Date.now().toString().slice(-4)}`;
107
- const content = `# Task: ${name}\n\nID: ${taskId}\nStatus: PENDING\n\n## Description\n\n## Acceptance Criteria\n1. [ ] Code Review Passed\n2. [ ] Unit Test Passed\n3. [ ] No Side Effects\n`;
108
- fs.writeFileSync(`${taskId}.md`, content);
109
- console.log(`📝 Created atomic task: ${taskId}.md`);
118
+ memorial: () => {
119
+ const memorialDir = path.join(process.cwd(), 'archive', 'memorials');
120
+ if (!fs.existsSync(memorialDir)) fs.mkdirSync(memorialDir, { recursive: true });
121
+ const id = fs.readdirSync(memorialDir).length + 1;
122
+ const filename = `MEMORIAL-${id}.md`;
123
+ const content = `# Phase Memorial (Phase Update)\n\nTimestamp: ${new Date().toISOString()}\n\n## Progress Summary\n\n## Thinking Trajectory\n\n## Next Steps\n`;
124
+ fs.writeFileSync(path.join(memorialDir, filename), content);
125
+ console.log(`📝 Memorial generated: archive/memorials/${filename}`);
110
126
  },
111
127
 
112
128
  summarize: (dirPath) => {
113
129
  if (!dirPath || !fs.existsSync(dirPath)) return console.log('❌ Valid directory path required.');
114
- console.log(`📉 Summarizing delivery from: ${dirPath}...`);
115
130
  const files = fs.readdirSync(dirPath);
116
- const summary = {
117
- path: dirPath,
118
- file_count: files.length,
119
- files: files.slice(0, 10).map(f => ({ name: f, size: fs.statSync(path.join(dirPath, f)).size })),
120
- timestamp: new Date().toISOString()
131
+ const summary = {
132
+ path: dirPath,
133
+ file_count: files.length,
134
+ thinking_extract: "Extracted from sub-agent logs...",
135
+ timestamp: new Date().toISOString()
121
136
  };
122
- const summaryPath = path.join(dirPath, 'SUMMARY.json');
123
- fs.writeFileSync(summaryPath, JSON.stringify(summary, null, 2));
124
- console.log(`✅ Compressed context summary saved to: ${summaryPath}`);
125
- console.log(`\n[AGENT TIP] Use this SUMMARY.json to inform the main agent instead of reading all files.`);
137
+ fs.writeFileSync(path.join(dirPath, 'SUMMARY.json'), JSON.stringify(summary, null, 2));
138
+ console.log(`✅ L1 Context Summary saved: ${dirPath}/SUMMARY.json`);
139
+ },
140
+
141
+ create: (type, name) => {
142
+ const dir = path.join(process.cwd(), 'src', `${type}s`);
143
+ if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
144
+ const filePath = path.join(dir, `${name.toLowerCase()}_${type}.py`);
145
+ fs.writeFileSync(filePath, `class ${name}Plugin:\n pass\n`);
146
+ console.log(`🚀 Scaffolded ${type}: ${filePath}`);
126
147
  },
127
148
 
128
149
  analyze: (target) => {
129
- const archiveDir = path.join(process.cwd(), 'archive');
130
- if (!fs.existsSync(archiveDir)) fs.mkdirSync(archiveDir, { recursive: true });
131
-
132
- const reportPath = path.join(archiveDir, 'discovery_report.json');
133
- console.log(`🔍 [AGENT] Deep Scanning ${target || '.'}...`);
134
- const mockReport = {
135
- target: target || '.',
136
- timestamp: new Date().toISOString(),
137
- dependencies: ['requests', 'pyyaml', 'sqlite3'],
138
- entry_points: ['github_cve_monitor.py'],
139
- logic_complexity: 'HIGH',
140
- risks: ['Hardcoded tokens', 'Missing error handling in async context']
141
- };
150
+ const reportPath = path.join(process.cwd(), 'archive', 'discovery_report.json');
151
+ const mockReport = { target: target || '.', dependencies: [], complexity: 'HIGH' };
142
152
  fs.writeFileSync(reportPath, JSON.stringify(mockReport, null, 2));
143
- console.log(`📄 Report saved to: ${reportPath}`);
153
+ console.log(`📄 Discovery Report saved: ${reportPath}`);
144
154
  }
145
155
  };
146
156
 
147
- if (!command || !commands[command]) {
148
- console.log(helpText);
149
- } else {
150
- commands[command](...args);
151
- }
157
+ if (!command || !commands[command]) console.log(helpText);
158
+ else commands[command](...args);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "architectural-orchestrator",
3
- "version": "1.3.0",
3
+ "version": "1.6.0",
4
4
  "description": "A universal architectural task management framework for AI agents.",
5
5
  "main": "index.js",
6
6
  "files": [