@tea-agent/loop-agent 0.16.20 → 0.16.21

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
@@ -35,6 +35,12 @@
35
35
  - Pi SDK 执行长推理或大段结构化输出时不再把高频流式增量事件无界累积到内存;同一响应在多个生命周期事件中重复出现的 Token 用量只统计一次,避免 `Invalid string length` 和成本数据虚高。
36
36
  - 后端测试复合执行节点继续保持 clean environment、失败分类和 fail-closed outcome,并为唯一 JUnit/initial Result、canonical Result、traceability 与 Observe 投影保留结构化运行证据。
37
37
 
38
+ ## [0.16.21] - 2026-07-21
39
+
40
+ ### 修复
41
+
42
+ - DAG `sourceBinding.requirementIds` 优先取任务 `需求.md` 的 `## Acceptance References`(TaskSpec `acceptance_refs`),不再把 Feature 整份 `acceptance.yaml` 的兄弟 AC 扫进本任务。修复 frontend-test 用例全绿却因 `AC-CONTRACT-*` missing 判 incomplete 的假失败。
43
+
38
44
  ## [0.16.20] - 2026-07-21
39
45
 
40
46
  ### 修复
@@ -899,6 +899,22 @@ function extractExplicitRequirementIds(...markdownInputs) {
899
899
  }
900
900
  return ids;
901
901
  }
902
+ /**
903
+ * Prefer TaskSpec-scoped acceptance refs from the derived 需求.md section when
904
+ * present. Full Feature acceptance.yaml may list sibling ACs that this task is
905
+ * not responsible for covering (e.g. FE-TEST must not require AC-CONTRACT-*).
906
+ */
907
+ export function extractTaskScopedRequirementIds(requirementMarkdown, ...fallbackMarkdown) {
908
+ // Only the explicit TaskSpec-derived section is authoritative for scope.
909
+ // Without it, preserve legacy full-scan behavior (requirement + references).
910
+ const sectionMatch = requirementMarkdown.match(/(?:^|\n)##\s*Acceptance References\s*\n([\s\S]*?)(?=\n##\s+|\n#\s+|$)/i);
911
+ if (sectionMatch?.[1]) {
912
+ const fromSection = extractExplicitRequirementIds(sectionMatch[1]);
913
+ if (fromSection.length > 0)
914
+ return fromSection;
915
+ }
916
+ return extractExplicitRequirementIds(requirementMarkdown, ...fallbackMarkdown);
917
+ }
902
918
  function buildDagSourceBinding(sources) {
903
919
  const sourceEntries = [
904
920
  {
@@ -931,7 +947,7 @@ function buildDagSourceBinding(sources) {
931
947
  .update(source.markdown, "utf8")
932
948
  .digest("hex"),
933
949
  })),
934
- requirementIds: extractExplicitRequirementIds(sources.requirementMarkdown, sources.constraintMarkdown, ...(sources.referenceDocuments ?? []).map((reference) => reference.markdown)),
950
+ requirementIds: extractTaskScopedRequirementIds(sources.requirementMarkdown, sources.constraintMarkdown, ...(sources.referenceDocuments ?? []).map((reference) => reference.markdown)),
935
951
  };
936
952
  }
937
953
  function buildBackendTestAnalysisSourceBindingContract(sources) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tea-agent/loop-agent",
3
- "version": "0.16.20",
3
+ "version": "0.16.21",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "loop-agent": "bin/loop-agent.js",