openfeel 1.5.4 → 1.5.5

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,7 +10,7 @@
10
10
 
11
11
  OpenFeel 是一个 TypeScript CLI 工具,为 AI Agent 开发提供端到端的流程治理。核心理念:**「提示词瘦身,流程入工具」** —— Agent 不靠读长文本理解流程,而是通过 `flow.json` 获取当前状态和下一步指令。
12
12
 
13
- > 📦 **最新版本 v1.5.4**(批次:日志摘要 + 快照 revision/stale + 指标 + 闸门滥用提示) — ① `flow log` 追加阶段摘要(最近转换 / 失败 / resume);② `feel_status`/`feel_next` 返回快照 `revision`/`stale`;③ `flow metrics` 观测日志体积;④ `plan_pending` >10 分钟提示空转。无 JSON 契约变更;发布仍为批次制。版本能力概览见 [docs/VERSIONS.md](docs/VERSIONS.md)。
13
+ > 📦 **最新版本 v1.5.5**(批次:preflight 账本 + 适配器补闸 + 禁止 shell 写状态 + 审查独立性) — ① `flow next`/`flow status` 记录 preflight,写命令校验 10 分钟窗口;② DSH 适配器默认 strict,`feel_status`/`feel_next` 返回 `preflight`;③ 提示段禁止 shell 写状态命令、要求独立审查(自审标 `self-review`)。无 JSON 契约变更;批次发布。版本能力概览见 [docs/VERSIONS.md](docs/VERSIONS.md)。
14
14
 
15
15
  > 📌 本项目基于 [AI_Prompt](https://github.com/Liuary/AI_Prompt) 开发,参考了 [OpenSpec](https://github.com/Fission-AI/OpenSpec) 等工具的设计思路。
16
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/commands/flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA8nF1D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAE9G"}
1
+ {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/commands/flow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBpC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA2oF1D;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,aAAa,EAAE,OAAO,EAAE,iBAAiB,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAE9G"}
@@ -12,6 +12,7 @@ import { addReviewEntry } from '../core/view/entry.js';
12
12
  import { failCli, failInternal, failRefusal, handleAddStageError, handleConcurrentConflict } from './shared/errors.js';
13
13
  import { withSchemaVersion, isJsonMode, emitJson } from './shared/json-output.js'; // JSON 契约助手(stage-95 op-001/op-002)
14
14
  import { t, getCliLang } from '../core/i18n.js';
15
+ import { preflightGate, recordPreflight } from '../core/preflight.js';
15
16
  import { getDevStatus, isSyncNodePhase, syncDevStatus } from '../core/dev-status.js';
16
17
  import { ARCHIVE_SCHEMA_VERSION } from '../core/flow-archive/archive-file.js';
17
18
  import { listArchivableCandidates, listBlockingOpenRevsForVersion, splitForArchive } from '../core/flow-archive/grouping.js';
@@ -32,6 +33,8 @@ export function registerFlowCommand(program) {
32
33
  .action((options) => {
33
34
  const lang = getCliLang(process.cwd());
34
35
  const mgr = createManager();
36
+ if (mgr.isLoaded())
37
+ recordPreflight(process.cwd());
35
38
  // B1-1:--json 分支须为首行输出且纯 JSON 单文档(不打印标题/颜色/提示行)
36
39
  if (options.json) {
37
40
  console.log(JSON.stringify(buildStatusJson(mgr), null, 2));
@@ -158,6 +161,7 @@ export function registerFlowCommand(program) {
158
161
  return;
159
162
  }
160
163
  const data = mgr.getData();
164
+ recordPreflight(process.cwd());
161
165
  const rawStage = data.pipeline.current.stage || '';
162
166
  // 双键回退(与 core resolveCurrentPhase / advanceStagePhase 同范式):归一化键优先,其次原始键
163
167
  const normalized = rawStage ? (normalizeStageId(rawStage) ?? rawStage) : '';
@@ -920,6 +924,17 @@ export function registerFlowCommand(program) {
920
924
  failCli({ code: 'NO_INIT', message, detail: null, stderrLines: [message] });
921
925
  return;
922
926
  }
927
+ // v1.5.5:先读状态再写状态(strict 拒绝;warn 仅 TTY 提示)
928
+ const preflight = preflightGate(process.cwd(), t('flow.preflightRequiredTmpl', lang));
929
+ if (!preflight.ok) {
930
+ failCli({
931
+ code: 'INVALID_ARGUMENT',
932
+ message: preflight.message,
933
+ detail: { reason: 'preflight-required', hint: 'openfeel flow next --json' },
934
+ stderrLines: [preflight.message],
935
+ });
936
+ return;
937
+ }
923
938
  // REV-005:命令层归一化(短名 → 全名),与 plan.ts / flow.ts 其它 stage 解析点同范式
924
939
  const stageArg = normalizeStageId(options.stage) ?? options.stage;
925
940
  // P1-4:双开关**显式**组合不一致 → 显式告警(仅「auto + auto_advance=disabled」这一静默无效组合;