Skip to content

refactor(commands): resolve model attribution via normalize_model_name - #733

Merged
jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/address-feedback-model-normalization
Oct 15, 2026
Merged

jflowers merged 2 commits into
unbound-force:mainfrom
jflowers:opsx/address-feedback-model-normalization

Conversation

@jflowers

Copy link
Copy Markdown
Contributor

Summary

Closes #709

Replace the inline six-step prose algorithm for deriving the model
family name in /uf.address-feedback with a single
normalize_model_name tool call, keeping mechanical normalization
out of command prose (determinism-first). The live command and the
scaffold asset are updated in lockstep, with the OpenSpec change
artifacts and review-council Dewey learnings included.

How to Test

  • make test — scaffold drift detection verifies the embedded
    command asset matches the canonical .opencode/commands/ source
  • make plugin-test — TypeScript plugin suite
  • Manual: run /uf.address-feedback on a PR with reviewer feedback
    and confirm attribution resolves via the normalize_model_name
    tool call instead of the inline algorithm

How to Demo

Run /uf.address-feedback <PR> — the attribution footer resolves
via normalize_model_name rather than the prose normalization steps.

Key Files Changed

  • .opencode/commands/uf.address-feedback.md — prose algorithm →
    tool call
  • internal/scaffold/assets/opencode/commands/uf.address-feedback.md
    — scaffold asset updated in lockstep
  • openspec/changes/address-feedback-model-normalization/ —
    proposal, design, spec delta, tasks
  • .uf/dewey/learnings/ — six review-council learnings
  • CHANGELOG.md

Known Issues

This PR was generated by /uf.finale (AI-assisted).

Replace the inline six-step prose algorithm for deriving the
model family name in /uf.address-feedback with a single
normalize_model_name tool call. Mechanical normalization
belongs in an executable tool, not command prose, so all
commands produce identical attribution for the same model ID.

- Update the live command and scaffold asset in lockstep
- Add OpenSpec artifacts for address-feedback-model-
  normalization (proposal, design, spec delta, tasks)
- Add Dewey learnings from the review council session

Assisted-by: unknown-model
Generated with AI assistance (unknown-model)

@jflowers jflowers left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review: refactor(commands): resolve model attribution via normalize_model_name

Verdict: APPROVE WITH ADVISORIES — 2 of 4 council runs succeeded and voted (divisor-adversary heavy, divisor-guard standard, both APPROVE WITH ADVISORIES); divisor-architect and divisor-curator timed out and did not vote.

The migration is correct: Phase 4.2 resolves the Assisted-by: trailer via the tested normalize_model_name tool, the live and scaffold copies are byte-identical (blob 14229266 on both), and all CI checks pass. Issue #709 criteria 1-3 are covered; criterion 4 ("no behavioral change — same model names produced") is not practically satisfied until #732 lands.

Advisories (3)

  1. MEDIUM — spec-record accuracy (design.md D4): the "No inline algorithm remains" scenario has no automated regression guard — drift tests verify byte parity only and pass even if the forbidden prose returns to both copies. Add a negative content clause to command_contract_test.go (the TestCommandContracts pattern), or amend D4 to record manual verification. The proposal's "zero behavioral change" claim should read "behavior pinned to the tested tool" — the tool's digit-guarded -N strip preserves claude-sonnet-4 where the old prose's literal reading yields claude-sonnet.
  2. MEDIUM — CHANGELOG (CHANGELOG.md:109): the entry omits the #732 interim degradation — until #732, every /uf.address-feedback commit carries Assisted-by: unknown-model with a user warning. Add a one-line interim note or sequence the merge after #732.
  3. LOW — known dependency (#732): the normalize_model_name rawModelId parameter is hidden from consuming sessions by a plugin schema bug; the fallback path is safe. Pre-existing, disclosed in the PR body.

CI: no PR-caused or pre-existing failures. Pre-flight (ci-aware): all local tools covered by passing CI.

Dispatch artifact: .uf/artifacts/dispatch/8b66bf1a-09ce-4449-bc1d-61eccc98baa0.json

This review was generated by /uf.review-pr (AI-assisted).

`uf.address-feedback.md` (dedup rules, consolidate
dispatch, tool policy, provenance) do not reference the
normalization prose. No clause additions are needed: the
delta spec's scenarios are enforced by existing drift

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The "No inline algorithm remains" scenario has no automated regression guard. D4 states the delta spec's scenarios are "enforced by existing drift tests plus the existing .opencode/test/uf-workflow.test.ts tool tests," but task42CanonicalAssets and TestSCFR001_CanonicalAssetSurfaceMatchesMirrors verify only live/scaffold byte parity — both copies could carry the forbidden prose and still pass — and the plugin tests pin the tool's algorithm, not the command text. The command-contracts learning shipped in this PR (.uf/dewey/learnings/command-contracts-20261015T150710) reaches the same conclusion: the requirement "needs a negative content assertion."

Two options close the gap:

  • Add a negative clause to internal/scaffold/command_contract_test.go for uf.address-feedback.md (the TestCommandContracts_SpeckitTestReview pattern: assert the command text must not contain YYYYMMDD or "remove everything before"), which makes D4's claim true.
  • Amend D4 to state the content-absence scenario is manually verified (task 3.2) and record the gap.

Related: the proposal's parity claim (proposal.md:37) describes the removed prose rather than the tool. The tool's version-strip guards on a preceding digit (uf-workflow-types.ts:116-119), so .../claude-sonnet-4-20250514@default yields claude-sonnet-4 — the value Scenario 1 asserts — where the prose's literal reading yields claude-sonnet. The tool-extraction learning in this PR recommends the framing "behavior pinned to the tested tool."

Comment thread CHANGELOG.md
replacing the inline 6-step model-name normalization prose;
the warn-user fallback on `unknown-model` is preserved
verbatim and the scaffold mirror was synced byte-identical.
Command markdown only; no tool behavior change. Increment 2

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The CHANGELOG entry omits the #732 interim degradation. The entry reads "Command markdown only; no tool behavior change," but the normalize_model_name parameter schema surfaced to consuming sessions is empty (#732 — reproduced during this review: the in-session call returns {normalized: 'unknown-model', warning: 'Empty rawModelId provided'} even though the plugin source defines rawModelId at .opencode/plugins/uf-workflow/index.ts:414). Until #732 lands, every /uf.address-feedback commit carries Assisted-by: unknown-model with a user warning, which leaves issue #709's acceptance criterion 4 unsatisfied at merge time. A one-line interim note in this entry — or sequencing the merge after #732 — records the actual behavior in the durable changelog.

cannot be determined, use the literal string
`unknown-model` and warn the user (e.g., "Could not
Where `<model>` is the normalized model family name.
Call `normalize_model_name` with your raw model

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This instruction depends on #732 for its input. The plugin schema surfaced to consuming sessions hides the required rawModelId parameter, so until #732 is fixed every invocation returns {normalized: 'unknown-model', warning: 'Empty rawModelId provided'} and commits carry Assisted-by: unknown-model. The fallback clause below handles this safely (warn + literal unknown-model), and the PR body discloses the bug — this note records the dependency so the trailer behavior isn't mistaken for a migration defect. Pre-existing plugin framework issue, not introduced by this change.

@jflowers
jflowers merged commit 1e049e8 into unbound-force:main Oct 15, 2026
16 checks passed
jflowers added a commit to jflowers/unbound-force that referenced this pull request Oct 16, 2026
jflowers added a commit to jflowers/unbound-force that referenced this pull request Oct 17, 2026
jflowers added a commit to jflowers/unbound-force that referenced this pull request Oct 17, 2026
@jflowers
jflowers deleted the opsx/address-feedback-model-normalization branch November 15, 2026 21:36
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.

Migrate uf.address-feedback.md model normalization to normalize_model_name tool

1 participant