Skip to content

fix(goal-channel): publish a fixed validation code, never request text - #6743

Closed
loopx-agent wants to merge 2 commits into
mainfrom
codex/goal-channel-op-reason-code
Closed

loopx-agent wants to merge 2 commits into
mainfrom
codex/goal-channel-op-reason-code

Conversation

@loopx-agent

Copy link
Copy Markdown
Collaborator

Follow-up to #6726 (already merged) for the review comment on the merged head.

Problem

The merged version echoed the ValueError message into details.validation_reason. That message is derived from the incoming request, so it cannot be published under a public-safe packet even when it looks benign — the reviewer's [P2] point.

Change

  • Replace the free-text echo with a fixed allowlist of typed-operation validator messages mapped to public-safe reason codes (operation_executor_binding_invalid, operation_payload_digest_mismatch, operation_projection_fields_unavailable, …).
  • Anything unknown falls back to unclassified_validation_error; no request-derived text reaches the packet.
  • Packet now carries details.validation_reason_code only.

Verification

/Users/huangruiteng/Developer/loopx/.venv/bin/python -m pytest tests/extensions/test_lark_goal_channel_operation.py -q
42 passed

Includes a full CLI regression: prepare-operation with a mismatched payload digest yields blocker=invalid_configuration with details.validation_reason_code=operation_payload_digest_mismatch, and the rendered packet contains neither the validator message nor a request payload marker.

Review follow-up: the first head echoed the ValueError message into the
packet. That message is derived from the incoming request, so it cannot be
published under a public-safe packet even when it looks benign.

Map the known typed-operation validator messages to fixed public-safe reason
codes and fall back to unclassified_validation_error for anything unknown. The
packet now carries details.validation_reason_code only, so neither a path nor
request-derived text can leak through this field.

Adds a full CLI regression: prepare-operation with a mismatched payload digest
yields blocker=invalid_configuration with
details.validation_reason_code=operation_payload_digest_mismatch, and the
rendered packet contains neither the validator message nor the payload marker.

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

mergify Bot commented Oct 17, 2026

Copy link
Copy Markdown

Hi @loopx-agent, the DCO Sign-off check did not pass. Please inspect
its details first: checkout, fetch, timeout or infrastructure errors
need their own recovery, not a rewrite of otherwise signed commits.

If the log confirms a missing Signed-off-by trailer, amend the
affected commit with git commit --amend -s; for multiple commits,
use an interactive rebase against the current base from the correct
base-repository remote and sign off each affected commit. Push the
rewritten PR branch with git push --force-with-lease origin HEAD.

@loopx-agent

Copy link
Copy Markdown
Collaborator Author

Closing: not needed. The merged #6726 behaviour is kept as-is (validator message with path redaction); this follow-up is not pursued.

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