@tea-agent/loop-agent 0.23.1 → 0.24.1
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 +61 -1
- package/README.md +1 -1
- package/bin/agent-worker.js +0 -0
- package/dist/commands/init.js +2 -2
- package/dist/executors/shell-executor.js +20 -7
- package/dist/shared/operator/capabilities.js +475 -2
- package/dist/task/dag-source-paths.js +50 -0
- package/dist/task/frontend-project-capability.js +316 -0
- package/dist/task/task-demand-routing.js +432 -0
- package/dist/worker/console/app-data.js +2 -0
- package/dist/worker/console/chat/artifact-card.js +23 -0
- package/dist/worker/console/chat/chat-event-store.js +495 -0
- package/dist/worker/console/chat/chat-ui-policy.js +25 -0
- package/dist/worker/console/chat/compaction-errors.js +64 -0
- package/dist/worker/console/chat/composer-draft-store.js +45 -0
- package/dist/worker/console/chat/context-panel.js +54 -0
- package/dist/worker/console/chat/contract-apply-receipt-store.js +174 -0
- package/dist/worker/console/chat/explore-tools.js +299 -0
- package/dist/worker/console/chat/human-gate-card.js +37 -0
- package/dist/worker/console/chat/interview-adapter.js +149 -0
- package/dist/worker/console/chat/operation-card.js +23 -0
- package/dist/worker/console/chat/pi-console-config.js +158 -0
- package/dist/worker/console/chat/pi-runtime.js +581 -43
- package/dist/worker/console/chat/repo-browser.js +140 -0
- package/dist/worker/console/chat/repo-walk.js +116 -0
- package/dist/worker/console/chat/resource-loader.js +18 -17
- package/dist/worker/console/chat/routes.js +1359 -65
- package/dist/worker/console/chat/runtime-context.js +24 -0
- package/dist/worker/console/chat/runtime-selection.js +37 -0
- package/dist/worker/console/chat/session-store.js +210 -11
- package/dist/worker/console/chat/shortcuts.js +15 -0
- package/dist/worker/console/chat/tool-adapter.js +81 -194
- package/dist/worker/console/chat/tools.js +72 -48
- package/dist/worker/console/chat/usage.js +37 -0
- package/dist/worker/console/chat/workspace-landing.js +56 -0
- package/dist/worker/console/dag-confirmation.js +42 -8
- package/dist/worker/console/human-gate-token.js +130 -0
- package/dist/worker/console/interview/grill-me.js +28 -5
- package/dist/worker/console/mutation-gate-receipt-store.js +184 -0
- package/dist/worker/console/operation-runner.js +6 -2
- package/dist/worker/console/operation-sse.js +26 -0
- package/dist/worker/console/operator-actions.js +420 -7
- package/dist/worker/console/server.js +14 -2
- package/dist/worker/console/static/assets/index-Cv68Ge5n.js +27 -0
- package/dist/worker/console/static/assets/index-Dp_2sKGk.css +1 -0
- package/dist/worker/console/static/index.html +2 -2
- package/dist/worker/observe/routes.js +8 -4
- package/dist/workflows/dag/backend-test-intake-context.js +10 -12
- package/dist/workflows/dag/backend-test-markdown-workflow.js +232 -47
- package/dist/workflows/dag/backend-test-result-contract.js +233 -0
- package/dist/workflows/dag/frontend-implementation-contract.js +23 -17
- package/dist/workflows/dag/frontend-lint-baseline.js +4 -4
- package/dist/workflows/dag/frontend-project-capability.js +1 -316
- package/dist/workflows/dag/frontend-worktree-diff.js +4 -1
- package/dist/workflows/dag/init-hybrid.js +46 -43
- package/dist/workflows/dag/rerun-plan.js +6 -10
- package/dist/workflows/dag/task-demand-routing.js +1 -383
- package/docs/README.md +1 -1
- package/docs/architecture/README.md +5 -5
- package/docs/architecture/evolution.md +4 -4
- package/docs/architecture/worker-and-feature.md +1 -1
- package/docs/templates/backend-test-dag.json +2 -2
- package/docs/templates/frontend-implementation-contract.schema.json +1 -1
- package/harness.json +1 -1
- package/package.json +1 -1
- package/skills/frontend-implementation/SKILL.md +7 -0
- package/skills/frontend-implementation/references/node-contracts.md +1 -1
- package/skills/frontend-verification/SKILL.md +4 -3
- package/skills/loop-agent/references/hybrid-dag.md +1 -1
- package/dist/worker/console/static/assets/index-DVl7Jxt5.js +0 -25
- package/dist/worker/console/static/assets/index-lVcIr9Ju.css +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,67 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
### 改进
|
|
6
|
+
|
|
7
|
+
- 夜间自动发布固定为 patch 通道(当前 `0.x.y` 上 +0.0.1,例如 `0.24.1 -> 0.24.2`),不再因 `feat:` 自动跳到 `0.x.0`。
|
|
8
|
+
- 新增人工主版本工作流 `manual-minor-release.yml`,仅在显式触发时强制 bump minor,产出 `v0.x.0`。
|
|
9
|
+
- 发布通道可将文档版本钉死/漂移降为告警(`LOOP_AGENT_DOC_VERSION_REFS=warn`),避免 nightly/prepublish 被安装文档旧精确串误阻塞;结构性文档治理仍 fail-closed。
|
|
10
|
+
|
|
11
|
+
### 修复
|
|
12
|
+
|
|
13
|
+
- 发布流程不再被合法的旧版本引用误阻塞:文档 catalog 现可用 `current`/`floating`/`minimum`/`range`/`historical` 五类语义声明版本引用,审查时基线等历史证据保留当时真实精确版本并通过检查,仅当前安装入口的精确钉死仍判为漂移。
|
|
14
|
+
- Nightly Release 现在在版本号与 CHANGELOG 准备完成之后、push/打 tag/发布 npm/创建 GitHub Release 之前运行最终 release tree 门禁(测试、构建、仓库治理、`npm pack` 干跑),避免在未通过最终门禁的发布树产生远端副作用。
|
|
15
|
+
- Nightly Release 的 commit/tag、npm publish、GitHub Release 三步现支持幂等恢复:重跑时探测目标对象是否存在,一致则跳过、冲突则 fail closed(不 force-push、不重写 tag、不重复发布),可补齐半发布状态。
|
|
16
|
+
- 文档版本治理的 `minimum`/`range` 声明现会校验文档正文实际出现的精确版本串与声明门槛/范围一致;仅元数据通过而正文钉死低于门槛或不满足范围的版本时仍判失败,避免安装入口借 minimum/range 声明悄悄钉死旧版本。
|
|
17
|
+
|
|
18
|
+
## [0.24.1] - 2026-07-27
|
|
19
|
+
|
|
20
|
+
### 重点更新
|
|
21
|
+
|
|
22
|
+
- 后端测试 HTML 报告全面升级,采用更清晰的可折叠用例卡片设计,直观展示脱敏的请求与响应详情。
|
|
23
|
+
- 彻底修复了 Windows 环境下因 cmd.exe 与 bash 嵌套引号转义不当,导致前端与初始化测试固件执行失败的问题。
|
|
24
|
+
- 前端实现 DAG 大幅优化,复用现有 run-owned canonical artifacts,有效精简了常规全绿路径的直接依赖节点数量。
|
|
25
|
+
|
|
26
|
+
### 新增
|
|
27
|
+
|
|
28
|
+
- 后端测试第 7 节点现使用 pytest-html 生成自包含报告,并新增解析器从其 JSON island 提取每条用例的结果与日志。
|
|
29
|
+
- 后端测试生成的 pytest 文件名现可与 Markdown 模块建立一对一清晰映射。
|
|
30
|
+
|
|
31
|
+
### 改进
|
|
32
|
+
|
|
33
|
+
- 后端测试 HTML 报告对齐 R04 模板样式:改用全 inline style 设计,包含渐变 banner、可折叠用例卡片、状态胶囊以及请求参数与响应结果分块展示。
|
|
34
|
+
- 前端 canonical implementation contract 允许纯逻辑修改使用空的 UI state,不再强制虚构,并会确定性移除不适用状态下的空输出。
|
|
35
|
+
- 前端实现 DAG 的多个节点(如 frontend-implement-pi、frontend-review-pi 等)直接依赖得到收敛,不再重复读取完整任务源或上游冗余文本。
|
|
36
|
+
|
|
37
|
+
### 修复
|
|
38
|
+
|
|
39
|
+
- 修复后端测试 HTML 报告中请求参数显示为空的问题:渲染器现已兼容 payload= 键或 JSON request_record 格式的请求摘要。
|
|
40
|
+
- 修复后端测试报告无法获取请求/响应日志的问题:兼容 HTTP_REQUEST 与 HTTP REQUEST 两种日志前缀,并在解析前正确解码 HTML 实体。
|
|
41
|
+
- 修复 shell-executor 在 Windows 环境下因反斜杠路径导致 runDir 损坏的问题,确保路径注入稳定。
|
|
42
|
+
- 修复前端 worktree baseline 解析 git status 时因提前 trim 导致未暂存文件路径丢失首字符的解析缺陷。
|
|
43
|
+
- 统一 DAG 任务源路径生成与运行时解析基准,解决 freshness、rerun 与预览共享不一致的问题。
|
|
44
|
+
- 修复前端项目在需求未显式提及 UI 时被误判保留为标准任务的问题,提升了基于工程证据与交互语义的任务类型推断准确度。
|
|
45
|
+
- 修复前端 lint baseline 在 Windows 下因路径解析逻辑缺陷,拒绝相对路径输出导致评估误报为不可用的问题。
|
|
46
|
+
- 修复多个测试固件在 Windows 下因嵌套 Shell 引号剥离导致命令执行输出为空或报错的问题(涉及 composite-shell 与 init-command)。
|
|
47
|
+
|
|
48
|
+
## [0.24.0] - 2026-07-27
|
|
49
|
+
|
|
50
|
+
### 新增
|
|
51
|
+
|
|
52
|
+
- align chat workspace with pi web UX
|
|
53
|
+
- operator chat workspace UX + async runtime race guards
|
|
54
|
+
- operator chat M3-M7 (draft interview, human-gate, input context, artifacts, branching, landing)
|
|
55
|
+
- pytest-html report + filename mapping + Windows path fix (#71)
|
|
56
|
+
|
|
57
|
+
### 改进
|
|
58
|
+
|
|
59
|
+
- style(console): 收紧 Operator Chat 工作台密度与侧栏体验
|
|
60
|
+
- style(console): prettier-format Operator Chat + keep UI-contract text intact
|
|
61
|
+
|
|
62
|
+
### 修复
|
|
63
|
+
|
|
64
|
+
- operator chat M2 closure tracer + code review followups
|
|
65
|
+
|
|
5
66
|
## [0.23.1] - 2026-07-26
|
|
6
67
|
|
|
7
68
|
### 重点更新
|
|
@@ -69,7 +130,6 @@
|
|
|
69
130
|
- Console Phase 4 Chat P1 审查修复:`createSessionFromServices` 显式传 `tools:[bash,read,grep,find,ls]`(SDK 默认 builtin 不含 grep/find/ls,否则 setActiveToolsByName 静默 no-op);schema↔dispatcher 契约对齐(contractValidate/Diff 用 draftJson、workerTaskRetry 补 featureId、动态发现 fail-closed);server.close() 先 chatRuntime.disposeAll();resource-loader/system prompt 统一到 widening(hasBash:true)
|
|
70
131
|
- CI 治理:7 个 versionConsumer 文档版本漂移 0.22.0→0.23.0;check-task-pool-root.sh allowlist 增补 codify-constraints.md
|
|
71
132
|
|
|
72
|
-
|
|
73
133
|
## [0.22.0] - 2026-07-24
|
|
74
134
|
|
|
75
135
|
### 重点更新
|
package/README.md
CHANGED
|
@@ -100,7 +100,7 @@ agent-worker console doctor --repo .
|
|
|
100
100
|
|
|
101
101
|
```
|
|
102
102
|
|
|
103
|
-
访问 Console <http://127.0.0.1:8790
|
|
103
|
+
访问 Console <http://127.0.0.1:8790/>;**Operator Chat Official** 是 Console 内的主引导交互。构建时设置 `VITE_OPERATOR_CHAT_DEFAULT_LANDING=chat` 可将 Chat 作为默认 landing;flag 未开启时仍默认进入 Tasks,旧 Task Ops tab 始终保留。顶部「检视」以及 `/inspect/` 提供只读 Dashboard、DAG、时间线与 artifacts;`loop-agent …` / `agent-worker …` CLI direct path 仍是受治理 fallback。当前状态为 **code ready, dogfood pending/unmet**,不宣称已替代 openCode 或其他外部主会话。
|
|
104
104
|
|
|
105
105
|
## 核心边界
|
|
106
106
|
|
package/bin/agent-worker.js
CHANGED
|
File without changes
|
package/dist/commands/init.js
CHANGED
|
@@ -2049,8 +2049,8 @@ function buildTargetFeatureWorkflow(input) {
|
|
|
2049
2049
|
"",
|
|
2050
2050
|
"## Specialized Task Kinds",
|
|
2051
2051
|
"",
|
|
2052
|
-
"- standard tasks are classified conservatively
|
|
2053
|
-
"-
|
|
2052
|
+
"- standard tasks are classified conservatively by combining the task title, `source/需求.md`, structured `allowedPaths`, strong React/Next/Vue project evidence, and user-visible interaction/state semantics.",
|
|
2053
|
+
"- An implicit frontend demand selects the frontend DAG only when project or frontend-path evidence is paired with product-delivery semantics; framework evidence alone is insufficient. Backend, mixed, negated, documentation/test maintenance, and unknown demands keep the template selected by the normal governance profile.",
|
|
2054
2054
|
"- `frontend-mock-assess-pi` reads Mock/API/schema evidence and selects `native|browser-intercept|request-adapter|not-needed|blocked` before frontend planning; its deterministic gate rejects blocked or malformed output, while the existing frontend implementer remains the only writer.",
|
|
2055
2055
|
"- Mock-backed verification never proves real API integration. When the backend was not exercised, closeout must retain the gap and name `<task-id>-real-api-integration-verify`; that follow-up is explicitly created/run after backend readiness, never automatic.",
|
|
2056
2056
|
"- Automatic frontend classification never replaces a supervised template selected by an explicit profile, workflowPolicy, or the supervised quality gate.",
|
|
@@ -17,7 +17,7 @@ import { formatFrontendReviewContextStdout, runFrontendReviewContextGate, } from
|
|
|
17
17
|
import { materializeFrontendLintAssessment, materializeFrontendLintBaseline, } from "../workflows/dag/frontend-lint-baseline.js";
|
|
18
18
|
import { formatTraceabilityGateStdout, materializeBackendTestCaseManifest, runBackendTestTraceabilityGate, } from "../workflows/dag/backend-test-case-manifest.js";
|
|
19
19
|
import { materializeBackendTestExecutionContract } from "../workflows/dag/backend-test-execution-contract.js";
|
|
20
|
-
import { materializeBackendTestResultFromRunDir,
|
|
20
|
+
import { materializeBackendTestResultFromRunDir, parsePytestHtmlReport } from "../workflows/dag/backend-test-result-contract.js";
|
|
21
21
|
import { collectBackendTestHumanCaseCatalog, collectBackendTestMappedPytestScripts, hasBlockingBackendMarkdownSafetyFindings, inspectBackendTestEnvironment, requiredBackendMarkdownCaseAcIds, renderBackendTestFacts, renderBackendTestHtml, redactBackendTestOutput, validateBackendMarkdownCases, validateBackendMarkdownTraceability, writeRunReport, } from "../workflows/dag/backend-test-markdown-workflow.js";
|
|
22
22
|
import { buildBackendTestCanonicalResultFromInitialShellSnippet, materializeBackendTestClassification, } from "../workflows/dag/backend-test-classification-contract.js";
|
|
23
23
|
import { backendTestSemanticReviewSchema, materializeBackendTestSemanticReview, } from "../workflows/dag/backend-test-semantic-review-contract.js";
|
|
@@ -102,7 +102,12 @@ export async function executeShellCommand(input) {
|
|
|
102
102
|
const startedAt = Date.now();
|
|
103
103
|
const injectedEnv = input.dagRunMeta
|
|
104
104
|
? {
|
|
105
|
-
|
|
105
|
+
// Git Bash treats backslashes as escape characters inside double
|
|
106
|
+
// quotes. On Windows, path.join() produces backslash runDirs like
|
|
107
|
+
// D:\\...\\active\\<runId>, which corrupt "${HARNESS_DAG_RUN_DIR}/..."
|
|
108
|
+
// expansions. Normalize to POSIX separators so bash sees a stable
|
|
109
|
+
// path regardless of host platform.
|
|
110
|
+
HARNESS_DAG_RUN_DIR: input.dagRunMeta.runDir.replaceAll(path.sep, "/"),
|
|
106
111
|
HARNESS_DAG_RUN_ID: input.dagRunMeta.runId,
|
|
107
112
|
}
|
|
108
113
|
: undefined;
|
|
@@ -384,10 +389,18 @@ async function executeBackendTestPipeline(input, meta) {
|
|
|
384
389
|
'mkdir -p "${HARNESS_DAG_RUN_DIR}/reports"',
|
|
385
390
|
'PYTHON_BIN="$(command -v python || command -v python3 || true)"',
|
|
386
391
|
'if [ -z "${PYTHON_BIN}" ]; then echo "python/python3 is required for backend-test execution" >&2; exit 127; fi',
|
|
387
|
-
|
|
392
|
+
// Run pytest exactly once and emit the native pytest-html
|
|
393
|
+
// self-contained report. The HTML/facts renderers read per-case
|
|
394
|
+
// captured stdout (HTTP_REQUEST/HTTP_RESPONSE) directly from the
|
|
395
|
+
// pytest-html data-jsonblob island, so a JUnit XML report is no
|
|
396
|
+
// longer generated.
|
|
397
|
+
`PYTHONUTF8=1 PYTHONIOENCODING=utf-8 PYTHONDONTWRITEBYTECODE=1 "\${PYTHON_BIN}" -m pytest ${pytestTargets} -v -p no:cacheprovider --html="\${HARNESS_DAG_RUN_DIR}/reports/backend-test.html" --self-contained-html`,
|
|
388
398
|
"STATUS=$?",
|
|
389
399
|
'printf "%s" "${STATUS}" > "${HARNESS_DAG_RUN_DIR}/reports/backend-test-pytest-exit.txt"',
|
|
390
|
-
|
|
400
|
+
// exit 0 (all pass) or 1 (assertion failures) with a valid
|
|
401
|
+
// pytest-html report are reportable; collection errors / crashes
|
|
402
|
+
// (exit >= 2) or a missing report surface as a pipeline error below.
|
|
403
|
+
'if { [ "${STATUS}" -eq 0 ] || [ "${STATUS}" -eq 1 ]; } && [ -s "${HARNESS_DAG_RUN_DIR}/reports/backend-test.html" ]; then exit 0; fi',
|
|
391
404
|
'exit "${STATUS}"',
|
|
392
405
|
].join("; ");
|
|
393
406
|
const results = await executePipelineCommands(input, meta, [pytestCommand]);
|
|
@@ -396,11 +409,11 @@ async function executeBackendTestPipeline(input, meta) {
|
|
|
396
409
|
return { ok: false, stdout: results.map((result) => result.stdout).join("\n"), stderr: failure.stderr, failureCategory: failure.failureCategory, durationMs: Date.now() - started };
|
|
397
410
|
}
|
|
398
411
|
const reportsDir = path.join(meta.runDir, "reports");
|
|
399
|
-
const
|
|
412
|
+
const pytestHtmlContent = await readFile(path.join(reportsDir, "backend-test.html"), "utf8");
|
|
400
413
|
const pytestExitCode = Number.parseInt((await readFile(path.join(reportsDir, "backend-test-pytest-exit.txt"), "utf8")).trim(), 10);
|
|
401
414
|
if (![0, 1].includes(pytestExitCode))
|
|
402
415
|
throw new Error(`pytest did not complete with a reportable exit code: ${pytestExitCode}`);
|
|
403
|
-
const parsed =
|
|
416
|
+
const parsed = parsePytestHtmlReport(pytestHtmlContent);
|
|
404
417
|
const cases = await collectBackendTestHumanCaseCatalog(input.cwd);
|
|
405
418
|
const caseValidationSummary = await readRequiredRunReport(reportsDir, "backend-md-case-validation.md");
|
|
406
419
|
const traceabilitySummary = await readRequiredRunReport(reportsDir, "backend-test-traceability.md");
|
|
@@ -413,7 +426,7 @@ async function executeBackendTestPipeline(input, meta) {
|
|
|
413
426
|
traceabilitySummary,
|
|
414
427
|
});
|
|
415
428
|
const htmlPath = await writeRunReport(meta.runDir, "backend-test.html", htmlContent);
|
|
416
|
-
const facts = renderBackendTestFacts({ parsed, cases, pytestExitCode,
|
|
429
|
+
const facts = renderBackendTestFacts({ parsed, cases, pytestExitCode, htmlRelativePath: "reports/backend-test.html", htmlContent, caseValidationSummary, traceabilitySummary });
|
|
417
430
|
const markdownPath = await writeRunReport(meta.runDir, "backend-test.md", facts);
|
|
418
431
|
const factsPath = await writeRunReport(meta.runDir, "backend-test-facts.md", facts);
|
|
419
432
|
const sanitizedOutputs = results.map((result) => redactBackendTestOutput(result.stdout));
|