Skip to content

Feedback UI for per-sentence model advice: synthetic demo block, counts first, registration identity - #42

Merged
Jeffreyliu0131 merged 13 commits into
mainfrom
claude/149-model-advice-ui
Oct 12, 2026
Merged

Jeffreyliu0131 merged 13 commits into
mainfrom
claude/149-model-advice-ui

Conversation

@Jeffreyliu0131

Copy link
Copy Markdown
Collaborator

Feedback UI line of the model-reception wave (task book 143, line 149; merges in the same batch as 148 or right after it). The v4 feedback page section "理由与证据的支持关系" now shows 148's per-sentence relation advice, which closes 148's user-visible gap: until this line, a synthetic registration showed "模型建议失败". The 2026-10-12 decisions apply here:

  • A synthetic registration shows labels and evidence, and the whole block is marked "合成机制演示".
  • The UI leads with sentences. After review 156 the user confirmed that the folded first screen shows per-sentence counts first and the work-level conclusion after, in lighter text.
  • The read side re-checks the work-level conclusion against the conservative aggregation rule.

Per-criterion advice for the 14 items (UI-03) is out of scope by the 10-12 cut.

What changes

  • Reading (readRegisteredAdvice, signature unchanged, optional fields only):
    • It reads units, aggregation, and the identity fields kind, dataset, components, fusion and weights_stage.
    • Labels and evidence are accepted only when status=synthetic_mechanism_only and the registration scope is synthetic_fixture. An external registration with a synthetic status, or a synthetic registration with completed, is rejected.
    • Invariants:
      • Failed or unavailable advice may carry no label, at work or sentence level.
      • Counts must match the units: labels counted by label, abstentions and failures by status.
      • The work-level label must equal a conservative re-aggregation of the sentences.
      • Units and counts come as a pair, and sentence indexes are unique.
      • Every reference belongs to this session.
      • Fusion members are in fixed left/right order with weights left 1−alpha and right alpha. Without a fusion record, member weights must sum to 1.
      • alpha and the threshold lie in [0, 1].
      • A criterion task, criteria, rubric_version or reconciliation is rejected.
    • A violation drops only that item to unavailable/model_prediction_invalid; other advice, rule results and the stored feedback are untouched. Read objects carry no request_id, job_id, input_hash or unit_hash.
  • Folded first screen (updateRegisteredAdvice, signature unchanged):
    • Lines: title, synthetic notice, non-zero per-sentence counts, then the work-level conclusion in lighter text. Example: "合成机制演示 / 合成或未训练权重,不是模型判断,不计分。/ 逐句:支持 1 · 矛盾 1 · 证据不足 4 / 作品整体:存在矛盾". In English: "Synthetic mechanism demo / … / By sentence: supported 1 · contradicted 1 · insufficient evidence 4 / Whole work: contradiction found".
    • Title priority: "模型建议失败" (load failure) → "模型调用超时" → "模型未判断任何句子" → "合成机制演示" → "模型建议(不计分)" (external candidate) → the existing waiting and pending states.
  • Expanded view:
    • Failure reason and "no advice adopted" first.
    • An ordered sentence list: quote truncated at 120 characters, result, and evidence buttons labelled with object and version ("材料 policy · 第 1 版", replacing the 64-hex evidence id; the id stays in data-model-reference). An evidence button opens the source in the side panel.
    • The note "按规则切句,不是陈述抽取", plus skipped-short and over-budget counts.
    • Registration identity: model, kind, version, training data with label tiers (e.g. "G2v 模型复核标签", never "human labels"), weights stage, fusion members with weights, alpha, and whether dev showed a fusion gain. External candidates add "外部候选;模型质量尚未验证".
  • Failure states (load failure, timeout, nothing judged) show no label and no evidence button, and say "未采用任何模型建议;原作品与已核实的规则结果都保留".
  • "评价模型:…" line above the block: read only from the JUDGE slot recorded in this feedback's provenance ("未接入" when unconfigured, "未记录" when missing); the support model is added only when configured separately; no model name is hard-coded.
  • Copy: all module copy lives in the paired table MODEL_ADVICE_COPY (model-advice-copy.ts), with identical zh/en keys and placeholders. Focus is restored per item, sentence, evidence and reference. Only existing v4 color variables are used, dark mode follows automatically, and there is no motion.
  • MODEL-02 browser check now expects "Synthetic mechanism demo" and the notice instead of "Mechanism validation"; the three protected meanings are kept: not shown as a model judgment, folded by default, zero calls.
  • Files only under apps/web/src/features/feedback-native/. No backend, contract, 144 or 148 file changed. contracts-v2.ts is byte-identical to the generator output for manifest bdeee6db….

Review and verification

  • Independent review 080-review-149.md (156) on 592cab8: 可合入, no P1 or P2, 9 P3.
    • The reviewer walked the normal entry in zh and en with a synthetic linear registration, and with a 145 fusion at alpha 0.75 on a tree merged with 148 ebc6238; the member weights 0.25 / 0.75 displayed correctly.
    • 25 hand-built invalid inputs each fell back on their own.
    • 18 mutations all went red.
    • The merge preview with 148 ebc6238 was conflict-free.
  • After the review the user confirmed P3-1 (counts first, conclusion after and lighter), P3-2 (re-aggregate the work-level label on read) and P3-3 (member weights sum to 1 without a fusion record). These landed in 2e56be1, the final head; no separate re-check of that commit is recorded.
  • 50 new test IDs: v4-slot.test.ts 24, model-advice.test.ts 12, model-advice.browser.mjs 14. MODEL-02 was updated. Reds were taken on the base (node-base-red-full.txt, browser-base-red.txt, p3-base-red.txt), and 22 mutations on the final code all went red.
  • Line checks on 2e56be1:
    • Targeted backend: 525 passed.
    • Frontend vitest: 440 passed / 7 skipped / 0 failed; against the base's 411 front-end IDs, 0 missing, 0 regressed, 36 new.
    • 72 state checks; build; lint 0 new.
    • Module browser check: 27 passed.
    • tsc --noEmit passes.
  • Normal serve + worker + v4 run (2e56be1, synthetic linear registration, zh and en, 18 screenshots):
    • The folded screen reads as above. The rule range line "规则已定标部分:0–45 分(适用项共 45 分,满分 100)" is unchanged.
    • Six sentences expand with the expected results, and the policy evidence button opens "差旅住宿与交通政策 · v1" (en "Travel policy: hotels and taxis · v1").
    • No horizontal scroll at 390px.
    • HTTP re-reads were byte-identical, and the 12 journal files were unchanged.
  • The controlled page (26 screenshots) covers six states: external, fusion, synthetic, load failure, timeout, all abstained. Each is shown in zh and en, desktop light and 390 dark, plus keyboard shots.
  • Full gate ran once on the integration tree 11e53dd7… (146 b765c88 → 145 23fb9df → 147 1e2b85c → 148 261118e → 149 2e56be1, integration branch HEAD 855b366; 157 receipt).

Not claimed / registered

  • UI-03 (14-item advice and conflict display) not built, by the 10-12 scope cut. A criterion entry would currently read as invalid and turn the block title into "模型建议失败" (P3-4). This is unreachable today because criterion_advice is always None; when §8 resumes, skip such entries instead.
  • Shown only on the controlled page, built by changing states on recorded 148 output with identities from 145/146 registrations:
    • external candidate;
    • fusion and encoder identity lines;
    • load failure, timeout and all-abstained states.
  • The normal-entry registration is a W01 linear bundle that publishes only four legacy identity fields, so kind, training data and components do not appear there. Normal-entry walks of fusion, encoder, drift, and the evaluation model under a loopback JUDGE slot (FLOW-03/04/05) belong to 150.
  • Real model quality not verified; only synthetic registrations were used.
  • P3 registered:
    • docs/design/frontend-style.md §2.1 forbids model IDs and "training" wording, which conflicts with the required identity display; 150 registers the exception.
    • Copy details: the English "every sentence supported" overstates when short sentences were skipped; n=1 plurals; only 3 abstention codes are mapped.
    • Evidence buttons show object ids, and config items open with no body text.
    • The coverage line still shows a percentage, contrary to 10-12 item 3; this belongs to W05, not this line.
  • Not owned here: docs/modules/expansion-v3/W08.md still says "机制验证" and hard-codes port 19810. The replacement text is in the receipt, for 150.

Receipt: 完成回执/claude-coordination/149-反馈界面模型建议显示.md.

…ation

Split each work subject by the r2-support-units-v1 rules, journal one advice
request per sentence and aggregate: any contradicted sentence decides the
work, all sentences supported gives SUPPORTED, everything else INSUFFICIENT.
Synthetic registrations now show their labels and evidence as a mechanism
demonstration (143 section 5.1 item 2).
Sentence units and synthetic labels change the advice semantics by design;
request, job, whole-work input hash, registration and advisory flags stay
byte-identical to the pre-move recording.
Each sentence request measures its input with the loaded model first; one
over the registered token budget is journaled as abstained with
unit_exceeds_encoder_limit and its measured size, and is never predicted.
…hanism labels

Normal HTTP and worker runs with constructed marker weights: short and
over-budget sentences are counted, insufficient sentences never make a
supported work, one contradicted sentence decides it, a restarted job reads
journaled sentences back, Chinese and English versions of one fact conclude
alike, sentence inputs carry no probe, gold or rule derivations, and synthetic
labels stay a marked mechanism that never changes scoring.
Each call checks the registration file hash and the size, mtime, ctime and
inode of every registered file; any change means full verification again, so
file drift still reaches new feedback as model_files_changed.
…s in feedback

Read the new advice fields (sentence units, counts, kind, training data,
fusion members, weights stage) and accept a synthetic registration's
mechanism labels and evidence (2026-10-12 decision 2). The block is titled
"Synthetic mechanism demo" for synthetic registrations, names the
work-level conclusion and one line of sentence counts, lists each sentence
with its own result and evidence, and names load failure, timeout and
all-abstained states without adopting any result. The support section names
the recorded evaluation model. Copy moves into a paired table.
…eck the conclusion and member weights on read

The folded first screen now leads with the sentence counts and follows with
the work-level conclusion in a lighter colour (2026-10-12 decision 5: the
interface leads with sentences). Reading recomputes the work-level relation
from the sentences by 148's conservative rule and drops a suggestion whose
recorded conclusion differs; fusion member weights must be one alpha's two
shares even without the fusion record.
@Jeffreyliu0131
Jeffreyliu0131 merged commit 92aa0eb into main Oct 12, 2026
1 check failed
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