Skip to content

fix(#223): sort the review row's badges into verdicts and context chips - #355

Merged
justinjoy merged 2 commits into
semantic-reasoning:mainfrom
SeoyunL:issue-223-review-badge-priority
Jul 26, 2026
Merged

fix(#223): sort the review row's badges into verdicts and context chips#355
justinjoy merged 2 commits into
semantic-reasoning:mainfrom
SeoyunL:issue-223-review-badge-priority

Conversation

@SeoyunL

@SeoyunL SeoyunL commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

A review row could carry up to 11 badges, all competing for attention at the same visual weight, so nothing read as the verdict.

Now two tiers. One trust verdict per row, picked by priority conflicted > accept recommended > corroborated, rendered badge verdict trust-*; the label promoted to the verdict is dropped from the chip run so it is not said twice. Everything else — remaining trust labels, source count, canonical alias, typed value, blocked-accept reasons, evidence kind — renders badge chip with no palette class. The standalone conflict badge is gone; it and the conflicted label came from the same summary.

verinote/web/app.py is untouched — the row context (f, trust, recommendation) already carried everything needed.

app.css is a 7-line pure insertion at 120-126 (.badge.verdict { font-weight: 700 }, .badge.chip { font-weight: 400; font-size: .72rem; color: var(--muted) }); nothing else in the file moved.

Compatibility: the status badge in .row-meta gets verdict appended after the status class, so the literal badge badge-superseded that tests/test_review_actions.py:94 asserts still appears verbatim. The superseded branch of the actions cell is untouched, so PR #348 is unaffected — verified by merging the two branches and running the suite (1538 passed).

1508 passed, 7 skipped (baseline 1502 + 6 new). ruff check clean.

⚠️ Behaviour change worth reviewing

evidence missing and unsupported now render grey, because the priority the issue specifies does not rank them. That is a real change: a row whose evidence is missing no longer carries a coloured badge for it. Worth deciding whether such a row still reads as alarming enough, or whether the priority list should be extended.

On the guard

It never asserts that a rule or declaration exists — that kind of assertion always has an ineffective preimage, which is how UI guards were broken in #294, #221, #225 and #220. Instead it names the family of non-colour channels that could honestly carry the tier (font-weight/size/style/variant, text-transform, letter-spacing, opacity, border-style/width/radius, padding, text-decoration-line, filter, plus the drawn half of a ::before glyph), each with its CSS initial value, resolves both tiers through .badge to concrete values, and requires a difference. So font-style: normal resolves to normal on both sides and buys nothing, and content: "" / "" resolves to the empty glyph.

test_the_guard_accepts_other_honest_implementations runs the reverse check in-test: five alternative implementations (uppercase, smaller chip, faded chip, dotted chip border, verdict glyph) must all register, and three no-op mutants must all not.

Not done

The issue's +N overflow fold for long chip runs is not implemented — it needs a disclosure element and was judged out of scope against three concurrent lanes. Hence Part of.

Worth a human's eye

Whether font-weight: 700 + .72rem chips separate enough at real badge size, or chips need to go further (lighter border, less padding); and that chips still wrap acceptably in the cell.

Part of #223

@justinjoy justinjoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 PR은 현재 상태로는 변경이 필요합니다.

현재 priority ladder는 conflicted > accept recommended > corroborated만 trust verdict로 승격하고, 그 외 trust.trust_labels는 모두 grey .chip으로 렌더링합니다. 이 때문에 evidence_missing / unsupported 같은 행은 기존에는 위험 신호로 보이던 trust 상태가 status badge 옆의 회색 context chip으로 내려갑니다.

unsupportedevidence_missing은 단순한 부가 정보가 아니라 review queue와 dashboard에서 사용자가 주의해야 하는 상태입니다. 이 상태가 verdict 없이 회색 chip으로만 표시되면, 신뢰 판단이 필요한 행이 일반 context처럼 읽힐 수 있습니다.

요구사항:

  • unsupported / evidence_missing 행이 적절한 trust verdict를 갖도록 priority rule을 확장하십시오. 또는 이 상태를 의도적으로 context로 낮추는 제품 정책 변경이라면 그 결정을 명시하고, 기존 사용자가 놓치지 않도록 다른 비색상 채널로 충분히 강조하십시오.
  • 해당 상태가 verdict 또는 명확한 경고 신호로 렌더링되는지 rendered-output 테스트로 고정하십시오.
  • 가능하면 accept recommended, corroborated, unsupported/evidence_missing 각각의 branch가 기대 tier로 렌더링되는 테스트를 분리해 추가하십시오.

추가로 .badge.chip 안의 nested code는 기존 code 색상 때문에 accent 색을 유지할 수 있습니다. “grey means context” 규칙을 강하게 가져가려면 chip 내부 code 색상도 함께 검토해 주십시오. 이 부분은 위 trust verdict 문제보다는 덜 급하지만, 현재 CSS guard가 놓치는 시각적 불일치입니다.

@SeoyunL
SeoyunL force-pushed the issue-223-review-badge-priority branch from 26c1c96 to 0a5d807 Compare July 26, 2026 03:58
@SeoyunL

SeoyunL commented Jul 26, 2026

Copy link
Copy Markdown
Contributor Author

리뷰 반영했습니다. origin/main 위로 리베이스했고 커밋 2개입니다 — 10b4580 (원 작업), 0a5d807 (재작업).

요구사항별 대응

1. unsupported / evidence_missing 을 verdict 로 승격
ladder 를 확장했습니다:

conflicted > evidence_missing > unsupported > accept recommended > corroborated

규칙은 green verdict 가 warning 을 억누르면 안 된다 입니다. 그래서 caution 세 가지가 reassurance 두 가지보다 위입니다. evidence_missingunsupported 보다 위인 것은 app.css 가 이미 두 상태를 --danger / --warn 으로 순위 매기고 있어서입니다 — ladder 와 팔레트가 어느 쪽이 더 큰 소리인지에 대해 어긋나지 않게 했습니다.

강등은 삭제가 아닙니다. 승격된 라벨만 chip 목록에서 빠지고, caution 에 밀린 accept recommendation 은 chip 으로 재발행됩니다. 그래서 "근거 앵커 없음, 그러나 규칙상 수락 대상" 이라는 행이 이제 표현 가능합니다 — 이전에는 말할 수 없던 상태입니다.

2·3. rung 별 분리 테스트
accept recommended, corroborated, unsupported, evidence_missing 각각 그 rung 에만 도달하는 픽스처로 분리했습니다. 회귀가 나면 어느 rung 인지 이름이 말합니다.

trust_labels 조합 162개를 렌더해 불변식을 확인했습니다 — 모든 라벨이 정확히 한 번 렌더되고, 모든 배지가 verdict / chip 중 정확히 하나입니다. 중복 발행도 조용한 소실도 없습니다.

4. chip 내부 code 색상
.badge.chip code { color: inherit; } 을 추가했습니다. 전역 code { color: var(--accent) } 는 엘리먼트 규칙이라 chip 이 상속시키는 회색을 이깁니다. 그래서 canonical <code>established_on</code> 같은 context 배지가 절반만 accent 로 나와 verdict 처럼 읽혔습니다.

추가로 처리한 것

verdict 슬롯이 이제 5가지(경고 3 / 안심 2)를 담게 되면서, --danger/--warn--ok 라는 색 하나가 두 반쪽을 가르는 유일한 채널이 됐습니다. 이건 #226 이 status banner 에서 막 고친 결함과 같은 것이라, caution 쪽에 그 배너들과 같은 방식으로 마커를 달았습니다:

.badge.verdict.risk::before { content: "⚠" / ""; margin-right: .3rem; font-size: .92em; }

/ "".ask-verdict::before / .ok-note::before 관례를 따른 pseudo-element alt text 입니다 — 배지가 이미 상태를 말로 적고 있으므로 "경고 표시"를 앞에 덧붙이면 같은 말을 두 번 하게 됩니다.

가드 강도

이 레포의 CSS 가드가 무효과 선언에 반복적으로 뚫린 이력이 있어(#220 은 네 라운드), 이번에는 선언 집합 비교를 쓰지 않고 cascade 로 해석한 신호 채널 값을 직접 비교했습니다. 확인 결과:

뮤턴트 결과
evidence_missing 을 ladder 아래로 KILLED (4개 테스트)
unsupported 를 verdict 에서 제외 KILLED (2개)
risk 마커를 안심 verdict 에도 부착 KILLED
content: "⚠" / ""content: "" / "" KILLED
chip 내부 code 를 accent 로 회귀 KILLED
font-style: normal / 0폭 테두리 / letter-spacing: 0 추가 SURVIVED (의도대로 — 과잉 제약 없음)

네 번째 줄이 과거 가드를 뚫던 수법이고, 마지막 줄은 정당한 무효과 선언이 여전히 통과한다는 반대 방향 확인입니다.

@justinjoy justinjoy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

이 PR은 병합 전에 수정이 필요합니다.

single_source는 신뢰 요약에서 주의가 필요한 상태이지만, 현재 verdict priority에는 포함되지 않아 다른 상위 상태가 없을 때 grey .chip으로만 렌더링됩니다. 근거는 유효하지만 출처가 하나뿐인 fact가 기존의 경고 표시를 잃고 일반 context처럼 보이게 됩니다.

요구사항:

  • single_source를 caution/trust verdict 정책에 포함하여, 단일 출처 상태가 context chip으로만 표현되지 않도록 하십시오. 다른 caution과 함께 있을 때의 우선순위도 명시하십시오.
  • 유효한 evidence를 가지지만 source가 하나인 row가 warning verdict 및 비색상 경고 신호로 렌더링되는 테스트를 추가하십시오.
  • 더 높은 caution이 있을 때 single_source가 중복 표시 없이 chip으로 강등되는지, 또는 선택한 우선순위에 따라 올바르게 표시되는지도 테스트로 고정하십시오.

SeoyunL and others added 2 commits July 27, 2026 06:21
…ts and context chips

A row could emit eleven badges at one weight, so a contradiction read like a
source count. Colour now means a verdict -- the fact's status plus one trust
verdict picked by conflicted > accept recommended > corroborated -- and every
other signal is a grey chip. The duplicate 'conflict' badge is folded into the
'conflicted' verdict, since both came from the same summary.

Weight and size, not hue, carry the tier, so the row still sorts itself in
greyscale. The guard resolves both tiers to concrete values against the CSS
initials and accepts any member of a family of visual channels, so a
no-op declaration cannot keep it green and an honest alternative
implementation cannot break it.

Part of semantic-reasoning#223 -- the '+N' overflow fold for long chip runs is not done here.
@justinjoy
justinjoy force-pushed the issue-223-review-badge-priority branch from 0a5d807 to cb34d16 Compare July 26, 2026 21:21
@justinjoy

Copy link
Copy Markdown
Contributor

The remaining requested behavior is now addressed: single_source is a caution verdict with a non-color marker; the priority is conflicted > evidence_missing > unsupported > single_source > accept recommended > corroborated; higher cautions demote lower signals to exactly one context chip. The original +N metadata-overflow requirement is also implemented with native details/summary, preserving two visible context chips and exposing the rest without duplication. Focused badge tests pass (14).

@justinjoy
justinjoy merged commit d8b7fdb into semantic-reasoning:main Jul 26, 2026
4 checks 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.

2 participants