Skip to content

feat(view): readable approval view with channel labels, mention kinds and embeds as text - #52

Merged
chaodu-agent merged 4 commits into
mainfrom
view-render
Nov 28, 2026
Merged

chaodu-agent merged 4 commits into
mainfrom
view-render

Conversation

@chaodu-agent

Copy link
Copy Markdown
Contributor

What changed

  • Optional channel label config, validated at load time; the label is shown next to the canonical channel id.
  • Mention tokens are rendered by kind. @everyone / @here carry a warning. No lookup is performed.
  • Embeds are rendered as inert, escaped text.
  • Bounds on rendered output, with a visible truncated marker.
  • WYSIWYS invariant test: what the approver sees is what is forwarded.
  • Two or three lines added to docs/runbooks/muse-stage2.md.

What did not change

Telegram push, authentication, view token, nonce, hold, start claim, audit, notifier, polling route, approval behavior.

Tests (macmini, clean clone at 843ec9b, umask 022)

  • cargo fmt --all -- --check: exit 0
  • cargo clippy --workspace --all-targets -- -D warnings: exit 0
  • cargo test --workspace: exit 0 (all suites passed, 0 failed; no known pre-existing reds appeared)

Refs #50

The held-request view page shows the message as text: an optional
[passthrough].channel_labels label next to the channel id from the path,
mentions marked in place (user/role/channel, @everyone/@here warning, no
lookup), embed title/description/fields as inert escaped text, bounded with
a truncated marker, raw JSON in Details unchanged. Telegram push, auth,
CSP, hold and approval behaviour are unchanged.

Verified on macmini (arm64), clone $HOME/work/auth-proxy-view-render
(rsync of the worktree, umask 022):
- cargo fmt --all -- --check: exit 0
- cargo clippy --workspace --all-targets -- -D warnings: exit 0
- cargo test --workspace: exit 0, no failures (no pre-existing reds seen,
  so none needed a base comparison)
- labels: explicit safe character set (letters, digits, space, - _ . , : # + / ( ) @); refuses control, format (bidi, zero-width), U+2028/2029, quotes, < > &
- labels are read from the policy in force at each page render, so a label-only reload shows on pending holds
- extra-fields banner lists at most 16 names of at most 64 chars, with a 'more not listed' / truncated marker
- cut embeds and embed fields show an 'N more ... omitted' marker
- runbook keeps only the short label note

Verification: rustfmt applied on macmini (skip_children); cargo build and tests not run here, they run on macmini in the next step.
Each embed block now ends with 'not shown here: <key names>' for keys other than
title, description and fields (max 8 names, 32 chars each, '+N more'; names escaped,
values never shown). Tests: embed_keys_that_are_not_rendered_are_named_without_their_values,
the_unshown_keys_note_is_bounded_and_escaped, an_embed_with_only_title_description_and_fields_has_no_unshown_note.
Previous commit 31cb853 failed cargo fmt --all -- --check on macmini (exit 1); formatted only.
@chaodu-agent
chaodu-agent marked this pull request as ready for review November 28, 2026 14:04
@chaodu-agent
chaodu-agent merged commit 9e5f17b into main Nov 28, 2026
1 check passed
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