Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions docs/reference/required-work-context.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,14 @@ model retention. These separate boundaries prevent transport loss from becoming
either a repeated full-input loop or permission to act on missing requirements.
No token savings or accepted outcome gains follow from instruction delivery alone.

Reader commands emitted by native quota, saved-context projection, bounded
settlement results and a running `context-read` keep the explicit CLI selection,
or the current Python interpreter when no CLI was specified. This covers initial
navigation, complete reads, continuations and rejected-selection recovery.
Capture bytes, digests, cursors and authority are unchanged; native full/delta
byte comparisons include this reader command metadata. Existing in-process
reference constructors keep their default command route.

An enabled native **full or delta** reference for a recognized decision can include
`first_read_command`, reading its current full capture without an older baseline.
It batches current admission/stop facts, the current action, the selected task,
Expand Down Expand Up @@ -272,6 +280,10 @@ reader,不重新运行首读导航;后续导航改变不能替换原选读
及显式文件首读游标在选读摘要变化时仍拒绝,沿同一完整原 capture 引用恢复,不重新
准入或改写旧描述文件。退役这些 legacy reader 前仍须对账原未完成 Turn;本切片
保留历史解码与完整捕获恢复。
原生 quota、已保存上下文投影、有界结算结果和实际运行的 `context-read` 生成读取
命令时,保留显式指定的 CLI;未指定 CLI 则使用当前 Python 解释器。首读导航、
完整读取、续页及选读拒绝恢复均沿用该程序。捕获正文、摘要、游标和权限不变,原生
full/delta 字节比较计入这些 reader 命令元数据;既有进程内引用构造器保留默认路由。
首读可把已经完整选中的同级内容合并为其完整父节点,减少地址重复;任何未选中的
可选或未知内容都会阻止合并;若数组合并会恢复原元素顺序、覆盖 owner 的读取优先级,
该数组及其祖先也不合并。选中事实和义务不变。显式选读和索引仍保留原地址。
Expand Down
13 changes: 7 additions & 6 deletions loopx/cli_commands/quota.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,9 @@ def _emit_quota_result(
print_payload: PrintPayload,
) -> int:
"""Capture the full decision before projecting and printing the CLI view."""
from ..command_invocation import current_loopx_cli_argv

reader_argv = current_loopx_cli_argv()
# Compose optional capability guidance after recovery has chosen the plan,
# before capture/compaction. The quota decision owner stays capability-neutral.
cli = (payload.get("interaction_contract") or {}).get("cli_channel")
Expand All @@ -341,7 +344,7 @@ def _emit_quota_result(
and getattr(args, "max_page_output_bytes", None) is not None):
try:
view = budgeted_settlement_result(payload, runtime_root=context.runtime_root,
output_bytes=args.max_page_output_bytes)
output_bytes=args.max_page_output_bytes, reader_argv=reader_argv)
except QuotaDecisionTransportError as exc:
# Transport failure cannot replace an already evaluated refusal or
# committed receipt. Preserve unknown controls as well as identity;
Expand All @@ -367,10 +370,8 @@ def _emit_quota_result(
delivery_request = None
decision_identity = ("", "")
if capture_directory is not None and payload.get("replan_action_packet"):
from ..command_invocation import current_loopx_cli_argv

payload = {**payload, "replan_read_path": str(capture_directory / "decision.json"),
"replan_read_argv": current_loopx_cli_argv()}
"replan_read_argv": reader_argv}
if args.quota_command == "should-run" and context is not None:
# Capture the one liveness observation with the decision that produced
# it. Presentation and evidence recovery must not record it again.
Expand Down Expand Up @@ -452,8 +453,8 @@ def _emit_quota_result(
# The original authority decision remains separately captured.
payload = native_context_capture_view(payload, capture_directory, context_directory=directory,
metadata={"capture_sha256": capture_id, **({"recovery": recovery} if recovery is not None else {})},
max_page_output_bytes=getattr(args, "max_page_output_bytes", None))
payload = model_context_reference(payload)
max_page_output_bytes=getattr(args, "max_page_output_bytes", None), reader_argv=reader_argv)
payload = model_context_reference(payload, reader_argv=reader_argv)
except (QuotaDecisionTransportError, OSError, ValueError) as exc:
if not isinstance(exc, QuotaDecisionTransportError):
exc = QuotaDecisionTransportError(
Expand Down
Loading
Loading