Skip to content

fix: one counter-example no longer turns offers into writes - #423

Merged
znat merged 1 commit into
mainfrom
fix/portrait-one-counter
Nov 8, 2026
Merged

znat merged 1 commit into
mainfrom
fix/portrait-one-counter

Conversation

@znat

@znat znat commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

One counter-example could turn a term's offers into writes. Now a term with a floor needs 3 counters before the counter comparison replaces the floor.

A counter centre built from one row has tightness 1.0, so its score was never scaled. Against it, the term's own sentences always read closer. On the pack-100 replay, one "So how" counter on Hono raised Hono writes from 7 to 24.

Evidence
  • scripts/check-counter-portrait.sh gains a "one counter per term" arm. It must give exactly the floor arm's verdicts. On main that arm writes 9 wrong words out of 24 cases (7 of 20 held out), for example "versatile" -> Vercel, "praise" -> Praisy, "Gwen" -> Qwen. With this change it passes, and the comparison arm still makes 0 held-out errors.
  • Pack-100 replay (100 dev terms, floor 0.60): the arm with one "So how" counter now gives the same Hono proposals as the arm without it (2 writes, 4 offers).
  • The fingerprint rule string changes (…/cut1/gate1), so stored summaries are rebuilt.
  • Qwen in the fixture has 2 counters. It is now read by the floor, with the same verdicts on its 4 cases.
  • CodeRabbit CLI: 0 findings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Jptb12ieonqTHyXStMVCt7

A counter centre of one row has tightness 1.0, so its score was never
scaled. Against it the term's own sentences always read closer, and one
"So how" counter turned Hono offers into writes (7 -> 24 on pack-100).

With a floor, the comparison now waits for floorMinimum counters. The
fingerprint rule changes, so stored summaries are rebuilt.
check-counter-portrait.sh gains a one-counter arm. It must give the same
verdicts as the floor arm.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Jptb12ieonqTHyXStMVCt7
Signed-off-by: Nathan Zylbersztejn <[email protected]>
@greptile-apps

greptile-apps Bot commented Nov 8, 2026

Copy link
Copy Markdown

Automatic reviews are disabled for this repository. Configure in Code Review Settings.

@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The portrait read path now requires counter rows before it uses a counter centre: at least one row without a floor, or at least floorMinimum rows when a floor exists. The fingerprint rule string now includes gate1. The check script adds a mode that retains only the first counter-example per term and checks its verdicts against the counter-stripped floor arm.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

  • znat/parrotflow#386: It removes the same portrait code and check script paths changed here, so landing it would remove the behavior updated by this PR.
Merge Risk: Minimal · up to a42fe

No merge-blocking issue is established; the change is ready for normal checks.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description covers the change and what a reviewer should check. It explains the floor-based rule (a term with a floor now needs 3 counters before the counter comparison replaces the floor), gives … Add the three checklist items from the repository template and mark their status: (1) confirm that make test passes; (2) confirm the prompt or pattern change is scored, and keep the case set, score before, and score after in the evidence …
Passed Passed checks: 4 passed

Check name Status Explanation
Title check Passed The title "fix: one counter-example no longer turns offers into writes" follows Conventional Commits and matches the main change in the changeset. The PR objectives state that a single counter on a te…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix: one counter-example no longer turns offers into writes" follows Conventional Commits and matches the main change in the changeset. The PR objectives state that a single counter on a term with a floor no longer replaces the floor, and the raw summary shows TermPortrait.read now requires floorMinimum rows before the counter centre is used. The title names the bug and its user-visible effect, so a reader of the changelog understands the change without the diff.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.

Full details: Description check

Explanation

The description covers the change and what a reviewer should check. It explains the floor-based rule (a term with a floor now needs 3 counters before the counter comparison replaces the floor), gives the reason (a one-row counter centre had tightness 1.0 and was not scaled), and states the measured effect (Hono writes went from 7 to 24 on the pack-100 replay, now 2 writes and 4 offers). It has an Evidence block with before and after numbers for the check script, the replay, the fingerprint change, and the Qwen fixture. The template's three checkboxes are not present, so the required items for make test, the scored prompt or pattern change, and the signed-off commits are not confirmed. The description also does not say whether a setting or default applies, though the change appears to be unconditional. The evidence section does not include the commit sign-off status.

Resolution

Add the three checklist items from the repository template and mark their status: (1) confirm that make test passes; (2) confirm the prompt or pattern change is scored, and keep the case set, score before, and score after in the evidence block (this change touches the counter-comparison rule, so the template expects these numbers); (3) confirm every commit is signed off with git commit -s. Also state whether the change sits behind a setting. If so, name the setting and its default. If not, say that it applies unconditionally. Keep the description to three to six plain-text sentences above the details block.

Finishing Touches

Generate docstrings

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 91a25740-fd18-41f6-a812-fd4f2370dc3d
Commits

Reviewing files that changed from the base of the PR and between debf397 and a42fec5.

Files selected for processing: 2

  • Sources/ParrotFlow/TermPortrait.swift
  • scripts/check-counter-portrait.sh

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@znat
znat merged commit d21c74d into main Nov 8, 2026
6 checks passed
@znat
znat deleted the fix/portrait-one-counter branch November 8, 2026 07:04
@znat znat mentioned this pull request Nov 9, 2026
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