agentic-flow-kit 1.1.6 → 1.1.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-flow-kit",
3
- "version": "1.1.6",
3
+ "version": "1.1.7",
4
4
  "description": "AI-Native 闭环工作流 + wiki 知识层脚手架——flow-kit init 一条命令为新项目装好 .agents 工作流引擎(阶段命令/角色契约/门禁钩子/kb 检索/看板/规则面预算)+ workflow 文档闭环 + wiki 知识库,装完自包含、零运行时依赖",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -520,7 +520,12 @@ for (const inc of docFiles('incidents')) {
520
520
  {
521
521
  const cmdFiles = () => (readdirOrNull(path.join(ROOT, '.agents', 'commands')) || [])
522
522
  .filter((f) => f.endsWith('.md')).map((f) => `.agents/commands/${f}`);
523
- const textOf = (rel) => linesOf(path.join(ROOT, rel)) || [];
523
+ // existsSync 守卫(2026-10-06-check19-entry-enoent 同类):AGENTS.md 等可合法缺失(调用方按空数组
524
+ // 判定本就预期缺失态),fail-loud fs 读下按缺省跳过、不再响亮出账;其余调用方路径另有上游守卫
525
+ const textOf = (rel) => {
526
+ const p = path.join(ROOT, rel);
527
+ return fs.existsSync(p) ? (linesOf(p) || []) : [];
528
+ };
524
529
  for (const role of ['implementer', 'independent-reviewer', 'ui-verifier']) {
525
530
  const rolePath = `.agents/roles/${role}.md`;
526
531
  if (!fs.existsSync(path.join(ROOT, rolePath))) {
@@ -572,7 +577,10 @@ for (const inc of docFiles('incidents')) {
572
577
  // --- 6. 阶段索引同步 [warning] ---
573
578
  for (const cmd of ['plan', 'design', 'build', 'test', 'deploy', 'maintain', 'review']) {
574
579
  for (const doc of ['AGENTS.md', '.agents/commands/new-task.md']) {
575
- const text = linesOf(path.join(ROOT, doc));
580
+ // existsSync 守卫(2026-10-06-check19-entry-enoent 同类):两文件可合法缺失(下方 text 判空本就
581
+ // 预期缺失态),fail-loud fs 读下按空跳过、不再响亮出账
582
+ const docPath = path.join(ROOT, doc);
583
+ const text = fs.existsSync(docPath) ? linesOf(docPath) : null;
576
584
  if (text && !text.some((l) => l.includes(`.agents/commands/${cmd}.md`))) {
577
585
  warnings.push(`- [WARN 阶段索引漂移] ${doc} 缺 ${cmd} 指令索引(两处阶段表须同步维护)`);
578
586
  }
@@ -1209,7 +1217,12 @@ runCheck16({ ROOT, ENUMS, docFiles, fmGet, inSet, isTracked, linesOf, readdirOrN
1209
1217
  // 协作道豁免(2026-09-30 hybrid-governance-risk-lanes):入口 L0/L1 的审批顺序倒置(如 plan 先于
1210
1218
  // intent approved——「动手后确认」)是异步审计泳道语义,非流程违规;入口文件缺失(纯台账历史行 /
1211
1219
  // incident 侧)不豁免,维持既有判据。
1212
- const ilvlB = fmGet(path.join(ROOT, WF, 'intents', `${base}.md`), '级别');
1220
+ // existsSync 守卫(2026-10-06-check19-entry-enoent):incident 闭环主题无同名 intent,「读空判级」
1221
+ // 惯用法(缺文件→级别空→不豁免,判定面不变)在 fail-loud fs 读(2026-10-05-gitout-fail-open)下
1222
+ // 每次推送响亮出账 N 条 ENOENT 噪声——守卫跳过读取,语义与上注释一致;同款先例 entryConfirmed19
1223
+ // 与下方 spec 读取。
1224
+ const iabsB = path.join(ROOT, WF, 'intents', `${base}.md`);
1225
+ const ilvlB = fs.existsSync(iabsB) ? fmGet(iabsB, '级别') : '';
1213
1226
  if (ilvlB === 'L0' || ilvlB === 'L1') continue;
1214
1227
  const earliest = seq.map((k) => rec[k]).sort()[0];
1215
1228
  if (!(earliest.slice(0, 10) >= since)) continue;
@@ -2636,5 +2636,31 @@ w(T, 'workflow/intents/2026-09-12-deep.md', INTENT('deep', '状态: draft\n级
2636
2636
  rmfix(T);
2637
2637
  }
2638
2638
 
2639
+ // ---- 场景:检查 19 判据 B——台账 approved 行在、入口 intent 缺件(incident 闭环主题)→ 无 ENOENT 出账,顺序判定不放松(2026-10-06-check19-entry-enoent)----
2640
+ {
2641
+ const ledgerRows = (specTs, planTs) => [
2642
+ { doc: 'workflow/specs/2026-10-06-noent.md', stage: 'approved', ts: specTs },
2643
+ { doc: 'workflow/plans/2026-10-06-noent.md', stage: 'approved', ts: planTs },
2644
+ ];
2645
+ // ① 顺序合规(specs 先于 plans):exit 0,且裸 fixture 全程无「文档读取异常(ENOENT)」出账——
2646
+ // 修复前「读空判级」惯用法在 fail-loud fs 读下对缺件主题每次响亮出账(实仓 12 条/推送);
2647
+ // 同类读空点(AGENTS.md / new-task.md,检查 6)一并被裸 fixture 钉住
2648
+ const T = mkfix();
2649
+ w(T, '.agents/kit.json', JSON.stringify({ policyVersion: 2 }));
2650
+ writeLedger(T, ledgerRows('2026-10-06T10:00:00Z', '2026-10-06T11:00:00Z'));
2651
+ let r = run(T);
2652
+ check('检查 19 判据 B:入口 intent 缺件 → 无 ENOENT 噪声且 exit 0',
2653
+ r.status === 0 && !outOf(r).includes('文档读取异常'), `exit=${r.status}\n${outOf(r)}`);
2654
+ rmfix(T);
2655
+ // ② 顺序倒置(plans 先于 specs):入口缺件不豁免,照报「审批顺序倒置」——守卫不放松判定
2656
+ const T2 = mkfix();
2657
+ w(T2, '.agents/kit.json', JSON.stringify({ policyVersion: 2 }));
2658
+ writeLedger(T2, ledgerRows('2026-10-06T11:00:00Z', '2026-10-06T10:00:00Z'));
2659
+ r = run(T2);
2660
+ check('检查 19 判据 B:入口 intent 缺件 → 顺序倒置照报(守卫不放松判定)',
2661
+ r.status === 0 && outOf(r).includes('审批顺序倒置'), `exit=${r.status}\n${outOf(r)}`);
2662
+ rmfix(T2);
2663
+ }
2664
+
2639
2665
  console.log(`\n合计: PASS ${pass} / FAIL ${fail}`);
2640
2666
  process.exit(fail ? 1 : 0);