Skip to content

fix(planning): make planning_batch and outcome refinement schemas self-contained - #9263

Open
loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-plan-w0-schema-ergonomics-20261122
Open

loopx-agent wants to merge 1 commit into
mainfrom
codex/fix-plan-w0-schema-ergonomics-20261122

Conversation

@loopx-agent

@loopx-agent loopx-agent commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Makes initial task planning (planning_batch) and goal-acceptance refine schema constraints self-contained and immediately diagnosable without requiring callers to inspect LoopX source files:

  1. Self-contained planning_batch CLI & prompt (benchmark/runtime/planning_batch.py, benchmark/runtime/RUNTIME.md):

    • Replaced raw sys.argv[1] file open (which crashed on --help) with argparse supporting --help and --schema (planning_batch_schema()), printing exact required/optional JSON keys, length bounds, opaque identifier regex, action_kind token pattern, and a minimal example payload.
    • Updated planning_batch_guidance() to inline the exact nested JSON shape (outcome.{objective, requirements:[{id,description}], source:{ref,summary}}, todos:[{text, action_kind, target_key?}]), explicitly state the opaque ASCII identifier rule (1..128 chars matching ^[A-Za-z0-9][A-Za-z0-9_.:@-]*$, no / paths or spaces) on outcome.source.ref and requirements[*].id, reference --schema, and clarify that a successful status="ready" batch result can be returned directly without extra todo list / goal-acceptance inspect calls.
    • Added upfront field-path validation (_request, _record, _text, _opaque_id, _action_kind reusing normalize_todo_action_kind / TODO_ACTION_KIND_PATTERN from loopx/control_plane/todos/contract.py) before spawning any LoopX subprocess, rejecting invalid field shapes, unsupported keys (by count + allowed list without echoing caller values/keys), length overflows, and invalid identifiers/tokens in milliseconds.
    • Added PlanningBatchCommandError so subprocess failures preserve structured error_detail, error_code, stage, and current_provider_revision in the returned JSON receipt rather than dropping error_detail.
  2. Actionable, leak-free GoalOutcomeValidationError diagnostics (loopx/control_plane/goals/outcome_requirements.ts):

    • Enriched text(), id(), keys(), and list() diagnostics with exact rule reasons, observed lengths/counts, limits, missing required field names, and allowed field lists while strictly preserving public-error hygiene (fixed rule text, validator-owned field names, and integer counts only — zero caller strings or caller keys echoed).
    • Preserved exact opaque-identifier error messages for short malformed IDs while reporting both char-count limits (got N chars, max 128) and opaque-ID character rules together when an ID/source ref exceeds 128 characters.
  3. goal-acceptance --help declaration schema (loopx/cli_commands/goal_acceptance.py):

    • Added an explicit Outcome declaration (refine): section to goal-acceptance --help documenting the refine JSON document shape, opaque ID pattern, and character/item limits.

Verification

  • npm run typecheck:control-plane — passed (tsc --project tsconfig.control-plane.json --noEmit)
  • node --no-warnings --experimental-sqlite --experimental-strip-types --test tests/control_plane_ts/goal_outcome_refinement.test.ts tests/control_plane_ts/goal_outcome_capacity.test.ts tests/control_plane_ts/goal_acceptance_authority.test.ts — 105 passed, 0 failed (27 skipped PostgreSQL integration cases without PG env)
  • ruff check benchmark/runtime/planning_batch.py loopx/cli_commands/goal_acceptance.py tests/control_plane/test_goal_outcome_diagnostics.py tests/control_plane/test_benchmark_planning_batch.py + git diff --check — passed
  • pytest -q -rs tests/control_plane/test_benchmark_planning_batch.py tests/control_plane/test_goal_outcome_diagnostics.py — 37 passed (0 skipped, 0 failed)
  • pytest -q -rs benchmark/tests/test_task_entry.py tests/control_plane/test_goal_outcome_refinement.py — 94 passed, 54 skipped (harbor optional package not installed in local venv, 0 failed)
  • python -m loopx.cli --format json --runtime-root <runtime-root> check --scan-path . — ok: true, errors: 0
  • python -m loopx.cli --format json --runtime-root <runtime-root> canary premerge --from-git-diff --git-diff-base origin/main — direct_checks: 4/4 passed, python_compile: 1/1 passed, catalog_canaries: 10/10 passed, risk_profile_smokes: 8/8 passed, failures: 0 (gate.status: manual_review_required, manual_hold_count: 1)

…f-contained

Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · Gemini · Google · self_reported

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

动机 / Motivation

使用 loopx-planned 初始规划阶段(w0)或直接调用 goal-acceptance refine / benchmark.runtime.planning_batch 声明目标成果要求与初始 Todo 的模型规划者及基准运行时调用方。

在基准分支(main)上,planning_batch 引导语缺少完整嵌套键结构与 opaque ID 正则、planning_batch --help 直接因读取文件失败报错、且 GoalOutcomeValidationError 与子进程错误包装会隐藏字符上限和缺失键详情,导致模型不得不多次读取源码试错;本 PR 将完整 schema 与约束自包含到提示词、--help/--schema 与校验报错中,在零源码探测前提下即可定位或一次写对。

真实长程基准执行观察表明,w0 规划阶段此前常因不知道 outcome.source.ref 不能带路径斜杠/空格且上限 128 字符、不知道 planning_batch 不支持 --help(原实现直接以 sys.argv[1] 读文件触发 FileNotFoundError)、以及 goal-acceptance refine 只返回泛化错误 "outcome fields are missing or unsupported" / "source ref must be bounded nonempty text" 且 planning_batch 丢弃 error_detail,迫使模型耗费数十轮工具调用去 cat/rg LoopX 内部 .py/.ts 源码反推字段。

已验证:planning_batch --help 与 --schema 均正常返回 0 并给出完整字段契约;planning_batch_guidance() 内联嵌套 JSON、128 字符 opaque ID 规则、action_kind 约束与 status="ready" 直接返回指引;非法提案在调用任何 LoopX CLI 前即以路径+规则+实测长度失败,且 TypeScript GoalOutcomeValidationError 与 PlanningBatchCommandError 均输出确切字节/条目超限及允许字段列表而不回显任何调用方输入值或私有键名。

不放宽任何既有成果字节上限(131072 B)、字段容量(32 项要求 / 1024 / 2000 / 512 / 128 字符)或 opaque ID 校验规则,不引入基准特定硬编码捷径,也不改动 todo plan 契约与执行期唤醒提示。

改动思路 / Approach

flowchart LR
  P[规划模型读取 planning_batch_guidance<br/>或 --help / --schema] --> B[planning_batch.py _request 前置校验]
  B -- 字段/长度/ID/action_kind 非法 --> E1[立即退出 rc=1<br/>输出路径+规则+整数计数<br/>零 CLI 子进程, 零值回显]
  B -- 结构合法 --> L[loopx goal-acceptance refine & todo add]
  L -- TS outcome_requirements.ts 拒绝 --> E2[GoalOutcomeValidationError<br/>保留 error_code 与固定规则 error_detail<br/>PlanningBatchCommandError 原样透传]
  L -- 写入成功 & readback 通过 --> OK[退出 rc=0<br/>直接返回 status='ready' + todo_ids]
Loading

说明:以上流程基于评审头 9263@bd5e0a566701cb5ecc1dbf5d1cf8603c0a8ebc5e 源码(benchmark/runtime/planning_batch.py、loopx/control_plane/goals/outcome_requirements.ts、loopx/cli_commands/goal_acceptance.py)绘制(说明性示意,非容器渲染采集;界面视觉检查不适用)。

  • 分层与职责归属:
    1. 提示词与 CLI 自描述(benchmark/runtime/planning_batch.py、loopx/cli_commands/goal_acceptance.py、benchmark/runtime/RUNTIME.md):将原先分散在 .ts/.py 源码中的嵌套键名、字符与数量上限、opaque ASCII ID 正则、action_kind 规则以及“成功即直接返回 status="ready"”说明收敛进 planning_batch_guidance()、--help/--schema 与 goal-acceptance --help。
    2. 前置拦截与错误保真(benchmark/runtime/planning_batch.py):通过 argparse 替代裸 sys.argv[1],避免 --help 崩溃;在调用任何 LoopX CLI 前对字段集合、字符串规则、opaque ID 与 action_kind(直接复用 loopx/control_plane/todos/contract.py 的 normalize_todo_action_kind 与 TODO_ACTION_KIND_PATTERN)进行无副作用校验;当下游 CLI 仍返回错误时,新增 PlanningBatchCommandError 保留 error_detail、error_code、stage 与 current_provider_revision。
    3. 服务端公开报错可诊断性与脱敏守恒(loopx/control_plane/goals/outcome_requirements.ts):describeTextFailure、id()、keys() 与 list() 在保持 GoalOutcomeValidationError 零调用方字符串/键名回显红线的前提下,补齐实际字符/条目计数、上限、缺失必选键与允许键集合;其中超过 128 字符的 ID 同时告知长度超限和字符集限制。
  • 架构与边界评估:在生产端保持所有核心校验与持久状态权威仍在 TypeScript outcome_requirements.ts 与 Python todos/contract.py;planning_batch.py 复用 TODO_ACTION_KIND_PATTERN/normalize_todo_action_kind 并在 CLI 入口做前置结构诊断与错误字段透传,outcome_requirements.ts 仅增强静态规则提示而不改变错误码或写入语义,总体增量精准服务目标且易独立回退。覆盖 benchmark/runtime/{planning_batch.py,RUNTIME.md}、loopx/control_plane/goals/outcome_requirements.ts、loopx/cli_commands/goal_acceptance.py 及三组配套双语/双栈(TS+Python)回归测试。

具体改动 / Changes

精确 diff(d38052695c2c..bd5e0a566701)共 7 个文件,+609 / -52 行:

文件 变更行数 角色
benchmark/runtime/planning_batch.py +291 / -41 argparse (--help/--schema)、完整 planning_batch_guidance()、前置契约校验与 PlanningBatchCommandError
loopx/control_plane/goals/outcome_requirements.ts +41 / -9 增强 GoalOutcomeValidationError 文本/ID/键/数组容量诊断(零输入值泄露)
loopx/cli_commands/goal_acceptance.py +6 / -0 在 goal-acceptance --help 补充 Outcome declaration (refine) 文档与限额
benchmark/runtime/RUNTIME.md +2 / -1 文档同步补充 planning_batch --schema 入口
tests/control_plane/test_benchmark_planning_batch.py +180 / -0 --help/--schema/引导语、前置无 CLI 拒绝与无泄露、及上游 error_detail 保真测试
tests/control_plane/test_goal_outcome_diagnostics.py +55 / -1 更新合并后的超长+非法字符报错预期,新增缺失/额外键与超限总结无泄露断言
tests/control_plane_ts/goal_outcome_refinement.test.ts +34 / -0 TS 单元测试覆盖 GoalOutcomeValidationError 字符数、缺失键、数组容量及无敏感值回显

关键代码讲解

  1. planning_batch_schema / planning_batch_guidance / _build_parser(benchmark/runtime/planning_batch.py#L41-L150,#L400-L452)
    将 planning_batch 的提案 JSON 结构与规则(input_digest、expected_provider_revision、outcome、todos)以机械可解析的 benchmark_planning_batch_proposal_v1 字典和简洁 CLI/提示语同时呈现,并修复原 sys.argv[1] 裸读导致 --help 直接 FileNotFoundError 的缺陷;保留原有 optional、LOOPX_PLANNING_RESULT、断点原样重放及非空 frontier 走普通流程等约束条款。
  2. _record / _opaque_id / _action_kind / _request(benchmark/runtime/planning_batch.py#L153-L271)
    与上游 outcome_requirements.ts 及 todos/contract.py 逐项对齐(128/1024/2000/32/512/64 上限及 ^[A-Za-z0-9][A-Za-z0-9_.:@-]*$),在本地直接过滤非对象、缺漏或多余字段(仅返回 unsupported field count 与允许键集合)、超长或非法字符,减少失败子进程往返。
  3. PlanningBatchCommandError 与错误透传(benchmark/runtime/planning_batch.py#L33-L39,#L340-L355,#L441-L450)
    不再吞掉 LoopX CLI JSON 返回中的 error_detail、error_code 与 current_provider_revision,而是结构化合并到 planning_batch 退出 1 的 stdout JSON 载荷,便于调用方按真实原因修正或使用当前 revision 重试。
  4. describeTextFailure / id / keys / list(loopx/control_plane/goals/outcome_requirements.ts#L35-L88)
    保留既有 GoalOutcomeValidationError 类与 goal_acceptance_invalid_request 错误码(见 acceptance_authority.ts#L655-L657),把原固定泛化文案升级为“规则 + 校验器实测数值/缺失键/允许列表”,严格禁止输出调用方字符串内容或未授权键名。

规范对照(spec_basis):引用已接受契约文档 docs/reference/goal-acceptance-observations.md(revision e1f1d6607b2cb704c076e4a1e30d8f63955b62af):

criterion_id 契约要求摘要 本头部状态 验证依据
ERROR-DETAIL-HYGIENE error_detail 仅包含固定规则文本、校验器标签与实测数字,绝不回显调用方输入值、多余键名或 provider/IO 上下文 implemented (outcome_requirements.ts#L42-L88, planning_batch.py#L161-L214) test_goal_outcome_diagnostics.py, goal_outcome_refinement.test.ts, test_benchmark_planning_batch.py, run_cf_9263.py
REJECT-NO-WRITE 校验失败不得写入或更改 Goal 状态,修正后沿用同操作/当前 revision 可成功提交 implemented (outcome_requirements.ts#L176-L286) test_goal_outcome_diagnostics.py (test_native_rejection_then_corrected_same_operation)
STABLE-ERROR-CODE goal-acceptance 与 refresh-state 拒绝继续返回既有稳定 error_code(goal_acceptance_invalid_request) implemented (acceptance_authority.ts#L655-L657) test_goal_outcome_diagnostics.py, run_cf_9263.py

对主干的风险 / Risks

  • 阻断性发现:无阻塞发现(no blocking finding)。
  • 负向与契约风险核对:
    • 长程与隐私泄露风险:核对了 _record()、keys()、describeTextFailure()、_opaque_id() 与 id() 全分支:超出长度只输出整数长度,不支持键仅输出整型计数 unsupported field count: N,非法字符串永不拼入错误文本。
    • planning_batch 提示词变更与现有行为隔离(default_off_isolation / observable_semantics):planning_batch_guidance() 仅注入到 LOOPX_TASK_STAGE=plan 的 loopx-planned 启动输入(benchmark/runtime/planning.py#L28-L36),不影响执行期 heartbeat/Turn 提示或非 loopx-planned 模式;保留全部现有中断重放与阻塞回退语义,新增 when it exits 0 with status="ready", do not make extra todo list or goal-acceptance calls 与 planning.py#L73-L114(validate_plan_readback)一致且无过早绕过风险;实测 cli-output-budget-regression-smoke.py 在 base 与 head 均通过。
    • 跨语言边界重复权衡:benchmark/runtime/planning_batch.py 存在与 TS outcome_requirements.ts 对应的整型上限镜像(128 / 1024 / 2000 / 32 / 512 / 64);鉴于 Python 内核 loopx/control_plane/goals/acceptance.py 本身不复制 TS schema 常量且跨语言无法直接 import .ts,由双边单元测试与 canary premerge 共同守护一致性的做法代价合理且比额外搭建代码生成层更轻量;仅需未来调整 TS 上限时同步更新 planning_batch.py 与 goal_acceptance.py 帮助文案(非阻断维护注意事项)。
    • scope_fit 与 authority_semantics:planning_batch_guidance() 与 planning_batch.py 由 benchmark/runtime/planning.py 生产调用,_action_kind 复用现有 todos/contract.py 规范化函数,无未调用模块、无新增授权或角色词汇。

语义与 CI 对齐

本 PR 复用既有词汇(reuse_existing),未新增共享持久化状态字段或控制面枚举;outcome_requirements.ts 与 goal-acceptance --help 沿用已接受文档 docs/reference/goal-acceptance-observations.md 定义的 error_detail 规则与 goal_acceptance_invalid_request 错码;planning_batch --schema 输出本地辅助版本标识 benchmark_planning_batch_proposal_v1 仅供人类/模型只读自省。所有本地静态检查、TS/Py 单元测试与 cli-output-budget 回归烟雾已于本机实测核验(远程 GitHub CI 按 wait_for_ci: false 不作为等待门禁)。

  • 本地验证与对照矩阵(wait_for_ci: false):
检查项 范围与条件 状态 观察结果
npm run typecheck:control-plane & node --test TS 控制面类型检查 + 3 组 goal_outcome_* / goal_acceptance_authority 测试 PASS tsc 0 错;105 passed, 0 failed(27 条 PostgreSQL 用例因本机无 PG 环境跳过)
Targeted pytest -rs (5 suites) test_benchmark_planning_batch.py, test_goal_outcome_diagnostics.py, test_task_entry.py, test_goal_outcome_refinement.py, test_goal_acceptance_cli.py PASS 171 passed, 54 skipped(688.37s;54 skips 均为 .venv 缺失可选 harbor 包引起的 test_task_entry.py importorskip)
ruff / git diff --check / mypy --strict / loopx check 修改文件 + 17 个 pyproject.toml strict 内核模块 + 边界扫描 PASS ruff 0 错;git diff --check 干净;mypy --strict 17 文件 0 错;loopx check errors=0
examples/control_plane/cli-output-budget-regression-smoke.py .venv/bin/python 在 Base (d38052695c2c) 与 Head (bd5e0a566701) 实跑 PASS Base (BASE_EC=0) 与 Head (HEAD_EC=0) 均输出 cli-output-budget-regression-smoke ok
loopx canary premerge --from-git-diff --git-diff-base d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d DIAGNOSTIC direct_checks 4/4、py_compile 1/1、risk_profile_smokes 8/8 及 9/10 catalog canaries 均通过;cli-output-budget-regression-smoke.py 因系统 python3.12 缺 pytest (ModuleNotFoundError) 在 0.081s 失败,上述 .venv 直接验证已证实通过(manual_hold_count: 1 benchmark_sensitive)
独立反事实对照(run_cf_9263.py) Base (d38052695c2c) vs Head (bd5e0a566701) 对比 9 个 CLI/规划路径 PASS Base:--help/--schema rc=1、planning_batch_guidance 缺嵌套结构/regex/直返提示、goal-acceptance --help 缺 schema、非法 source.ref 调用 CLI 且丢 error_detail;Head:--help/--schema rc=0、非法提案零 CLI 调用且零敏感路径回显、真实 refine 返回精确字符/键/计数诊断且零回显、有效 planning_batch 端到端产出 status="ready" 绑定 Todo ID、上游错误保留 stage
  • 最缺失的残留验证(非阻断):本地 .venv 未安装 harbor(54 个 test_task_entry.py 集成用例跳过),且实际线上容器内模型能否真正将 w0 耗时从 ~15m 降至 1–2 次调用需下一轮 live loopx-planned benchmark 试验观察。

我的整体评价 / Verdict

  • 长程与用户体验评估(outcome_impact):long_horizon = improved——显著消除初始规划 w0 因缺少契约自描述导致的反复源码摸索与多轮试错开销,同时保持全部现有唤醒与断点重放不变量;user_experience = preserved——CLI --help/--schema 与错误诊断更清晰,且无额外人工确认负担。
  • 视觉审查(visual_review):本 PR 仅涉及 CLI 帮助文本、JSON Schema 引导、前置字段校验与报错文案优化,不改变任何前端页面或可视化渲染表面。(unverified_scope: none)。
  • 契约与变更体量评估:本 PR reuses existing vocabulary(沿用 docs/reference/goal-acceptance-observations.md 与 todos/contract.py);code_volume = necessary、compatibility_assessment = retain、change_proportionality = proportionate、default_off_isolation = isolated、authority_semantics = not_applicable。
  • Exact-Head Freshness & Verdict:已复核远程精准头 9263@bd5e0a566701cb5ecc1dbf5d1cf8603c0a8ebc5e(基于 main@d38052695c2c8a2e67cdb2c1eb6f4c6651eabd4d)为 OPEN、MERGEABLE 且无未解决线程。

English Verdict: APPROVE — Self-contained schema guidance, upfront validation, --help/--schema ergonomics, and non-leaking GoalOutcomeValidationError diagnostics cleanly eliminate w0 planning schema guesswork at 9263@bd5e0a566701cb5ecc1dbf5d1cf8603c0a8ebc5e.

@loopx-agent loopx-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewer: model_agent · gpt-6.2-sol · OpenAI · runtime_reported · xhigh
Request changes conclusion (author-owned PR; GitHub blocks formal self-review)

动机 / Motivation

运行初始规划的调用者需要按 CLI 自带的 schema 准备提案,在任何 owner 调用前获得准确错误。 原初始规划把实际 acceptance 长度检查交给现有 Goal owner,缺少可发现的前置 schema。 Python 按 Unicode 码点计数。File 和 SQLite 的真实 CLI 各接受 513 个非 BMP 字符的 objective、1,001 个字符的 requirement description、257 个字符的 source summary 进入 refine,TS 分别按 1,026、2,002、514 个 UTF-16 code units 拒绝。有界字段的 schema、前置检查和最终验收三处需要说明同一单位。 当前头增加 --schema 和 --help、Python 前置校验与保留上游诊断的 receipt。 本轮只测源码和隔离的两个 provider,未作模型调用、正式安装或 CI 查询。

改动思路 / Approach

Python 继续协调初始批次,TypeScript 保留 Goal outcome 验证。两端要使用同一字段规则或明确重用一个 validator。 现有 Goal owner 决定最终接受。本地 schema 合同承诺相同约束,不能有第二个不同字符预算。 采用 Goal owner 当前计数单位可保留已发布接受条件。不要为修复 CLI 帮助随意改变已有存储契约。

具体改动 / Changes

逐项检查当前头 bd5e0a5 和 merge base d380526,7 个文件,+609/-52。7 个文件覆盖终端帮助、实际批次、typed diagnostics 和测试。 评审依据为 d380526。 目标规范

关键代码讲解

  • planning_batch_schema 将三个有界说明字段标为 chars。 schema
  • _text 用 Python 计数;apply_initial_plan 之后才进入原 acceptance 提交。 前置检查 · 原入口
  • text 按 JS string length 即 UTF-16 code units 给出实际验证。 owner
  • schema-owner-parity 的说明字段计数不一致。 planning-replay 当前实证仍按原稳定操作重试。

对主干的风险 / Risks

[P2] 计划 schema 与 Goal owner 对 Unicode 长度的判定不一致。 Python 按 Unicode 码点计数。File 和 SQLite 的真实 CLI 各接受 513 个非 BMP 字符的 objective、1,001 个字符的 requirement description、257 个字符的 source summary 进入 refine,TS 分别按 1,026、2,002、514 个 UTF-16 code units 拒绝。有界字段的 schema、前置检查和最终验收三处需要说明同一单位。 让 Python 和 TS 使用同一明确计量规则,并在 --schema、--help 和错误文本写明单位。给三个字段添加刚好在限额与超过限额的非 BMP 输入对照。 以上三个字段的拒绝均发生在下游,原 typed 错误完整保留。另将同一准确头与后来主干做三方合并验证,受影响入口和规则文件保持同一 blob。

256 个同样的字符恰为 512 UTF-16 code units,File 和 SQLite 均返回 ready,且只有一个实际 Todo。257 个字符的六次拒绝均没写入 Todo,保留上游 typed 错误。 独立运行 Python(72 passed)、TypeScript(105 通过,27 跳过),类型检查和 Ruff 通过。预合并 6 项直接检查、18 项选中检查通过。 未验证 PostgreSQL 或隔离环境之外的运行项目。预合并资格状态为 quality_receipt_missing。

我的整体评价 / Verdict

请求修改。Python 继续协调初始批次,TypeScript 保留 Goal outcome 验证。两端要使用同一字段规则或明确重用一个 validator。 现有 Goal owner 决定最终接受。本地 schema 合同承诺相同约束,不能有第二个不同字符预算。 前置化功能缺少与共享 owner 的 Unicode 边界一致性。 保留有用的结构化错误,再让真实提交与显示的边界一致。 变更位于 CLI 和技术参考。

English verdict: REQUEST_CHANGES at bd5e0a5. Use one explicit character-length unit in schema, preflight, and Goal validation. File and SQLite each reject three schema-valid non-BMP inputs only after an upstream refine call. Both accept the 512-code-unit control.

raise ValueError(f"Planning proposal requires non-empty text at {path}")
if not strip and value != value.strip():
raise ValueError(f"Planning proposal forbids leading/trailing whitespace at {path}")
if max_chars is not None and len(normalized) > max_chars:

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] 计划 schema 与 Goal owner 对 Unicode 长度的判定不一致。Python 按 Unicode 码点计数。File 和 SQLite 的真实 CLI 各接受 513 个非 BMP 字符的 objective、1,001 个字符的 requirement description、257 个字符的 source summary 进入 refine,TS 分别按 1,026、2,002、514 个 UTF-16 code units 拒绝。有界字段的 schema、前置检查和最终验收三处需要说明同一单位。 让 Python 和 TS 使用同一明确计量规则,并在 --schema、--help 和错误文本写明单位。给三个字段添加刚好在限额与超过限额的非 BMP 输入对照。

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant