Skip to content

feat(ratchet): add --verbose flag to score subcommand#49

Merged
Konan69 merged 1 commit into
Flow-Research:mainfrom
spiderocious:feat/26-ratchet-score-verbose
Jun 6, 2026
Merged

feat(ratchet): add --verbose flag to score subcommand#49
Konan69 merged 1 commit into
Flow-Research:mainfrom
spiderocious:feat/26-ratchet-score-verbose

Conversation

@spiderocious

@spiderocious spiderocious commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a --verbose flag to ratchet.py score that prints a per-variable
breakdown of the composite metric.

score already prints f/p/q/r by default, so --verbose surfaces what
isn't shown today: each variable's weight (the layer's exponent) and its
weighted contribution (base ** exponent), plus the raw aggregate counts
that were previously only available via --json.

Closes #26

Changes

tools/flow-install/skills/_shared/ratchet.py (display-only, +35/-0):

  • parse_args() — added --verbose to the score subparser (optional,
    action="store_true").
  • command_score() — when --verbose is set (and not --json), print a
    breakdown: variable | raw | weight | weighted contribution for each active
    variable (f/p/q/r, plus h/c at layer 2), followed by the raw aggregates.

No change to the metric, compute_score, JSON output, or any other
subcommand. The breakdown reuses the in-file DEFAULT_CONFIG exponents and
mirrors compute_score's (1 - x) inversion for r/h/c, so the printed
contributions multiply back to the reported score.

Acceptance criteria

  • score --skill issue-flow --verbose prints per-variable details
  • Flag is optional and does not affect normal output when omitted
  • Output includes variable name, raw value, weight, and weighted contribution

Testing

This repo has no pytest gate for ratchet.py, so I verified by runtime output
(same approach as #45):

python3 -c "import ast; ast.parse(open('tools/flow-install/skills/_shared/ratchet.py').read())"  # OK
python3 ratchet.py score --skill issue-flow --verbose            # breakdown renders (layer 1)
python3 ratchet.py score --skill issue-flow --layer 2 --verbose  # includes h, c
python3 ratchet.py score --skill issue-flow --verbose --json     # --json wins, no breakdown
python3 ratchet.py score --skill issue-flow                      # byte-identical to main

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

* **New Features**
  * Added `--verbose` flag to the score command, providing detailed breakdowns of individual metrics, their weights, and weighted contributions for enhanced insights into scoring results.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

@spiderocious spiderocious marked this pull request as ready for review June 2, 2026 11:55
@Konan69

Konan69 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b9a12a0-3889-4b64-a2de-a626f39ca441

📥 Commits

Reviewing files that changed from the base of the PR and between 002e39e and f83d6f1.

📒 Files selected for processing (1)
  • tools/flow-install/skills/_shared/ratchet.py

📝 Walkthrough

Walkthrough

This PR adds an optional --verbose flag to ratchet.py score that prints detailed per-variable scoring breakdowns. The parser configuration enables the flag, and the score command's output logic conditionally displays raw metrics, layer weights, contributions, and aggregates when invoked.

Changes

Verbose Score Output

Layer / File(s) Summary
Score verbose flag and breakdown display
tools/flow-install/skills/_shared/ratchet.py
Parser adds --verbose boolean option to the score subcommand. command_score() conditionally prints a detailed "Breakdown" section when args.verbose is true, showing per-variable raw values, layer exponents, weighted contributions, and raw aggregate totals.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding a --verbose flag to the ratchet score subcommand.
Linked Issues check ✅ Passed All acceptance criteria from issue #26 are met: the --verbose flag is implemented, it prints per-variable breakdown with raw values and weights, the flag is optional, and output includes variable name, raw value, weight, and weighted contribution.
Out of Scope Changes check ✅ Passed All changes are directly related to implementing the --verbose flag for the score subcommand as specified in issue #26; no unrelated modifications are present.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@Konan69 Konan69 merged commit 9f76352 into Flow-Research:main Jun 6, 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.

Add --verbose flag to ratchet.py

2 participants