Skip to content

feat(avatar): compatible optional speech mouth layers - #7

Merged
DoodleBears merged 1 commit into
mainfrom
codex/1143-speech-mouth
Oct 8, 2026
Merged

DoodleBears merged 1 commit into
mainfrom
codex/1143-speech-mouth

Conversation

@DoodleBears

@DoodleBears DoodleBears commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Closes #6 · Consumer #1143 · Agent claim · Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269

Why the change

Consumers can animate simple speech mouths without changing saved pixel identities or rebuilding the entire character on each text step.

Special things to note

  • Merge risk: two-way door, reverting requires no saved-data repair; small blast radius, only explicit mouthLayers: true requests produce new markup. Review exact default/golden compatibility and every-yaw feature-layer composition.
  • Avatar package 0.2.0 is published; no new pixel-morph release was needed. saved recipe/schema/rig versions remain unchanged. The four groups include shared brows/nose/cheeks to preserve original paint order; eyes, blink and glasses stay independent. Text pacing and motion policy belong to the consumer.
  • Release workflow 37736838417 succeeded after explicit Human approval. The official npm tarball was downloaded and integrity-verified; its JS and declarations are byte-identical to the qualified candidate. The real DSH message path belongs to consumer #1143 / Draft PR #1169, whose visual/interaction acceptance remains pending.

Change outline

 pixelAvatarSvg(recipe, options) → pixelFigure(recipe, yaw, options)
+ mouthLayers?: boolean (default: false)
+ every pose: [data-avatar-mouth="saved|closed|half-open|open"]
+ exported PixelFigureOptions / PixelMouthState
 unchanged recipe validation, saved cells, default SVG and golden hashes

Show one group in each yaw at a time, then restore saved after speech/cancellation. No avatar concepts enter pixel-morph and no runtime dependency is added.

Actual public-package rendering — 900 × 640, identical recipes

Before uses the installed @botharness/pixel-avatar@0.1.0; After uses candidate build be024f2. The pure SVG package has no standalone UI. These images are direct renders of its public exports, not DSH screenshots or a substitute for the consumer's runtime evidence. Each row uses the same recipe. Backgrounds belong to the comparison canvas; the busts themselves are transparent.

Before — light, saved face only

mouth-light-before

After — light, saved / closed / half-open / open

mouth-light-after

Before — dark

mouth-dark-before

After — dark

mouth-dark-after

Validation

  • pnpm verify passed: formatting, lint, typechecking and 31 tests. Existing unrelated morph lint warning remains. Production build passed.
  • The new public mouth contract failed before implementation and passed afterward. Neutral restoration is byte-for-byte equal across the mouth catalog, all poses, presets and detailed geometry; existing golden fixtures were not regenerated.
  • Both required code-review axes are clean against latest owning-repo origin/main (df53fc8). The consumer now pins the qualified published 0.2.0 dependency.

Issue: #6

Consumer: BotHarness/DeepSeekBot#1143

Agent-Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269
@coderabbitai

coderabbitai Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2f666aa2-3997-4318-b175-28c6a674aa69
📥 Commits

Reviewing files that changed from the base of the PR and between df53fc8 and be024f2.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • README.zh.md
  • packages/avatar/package.json
  • packages/avatar/src/figure.ts
  • packages/avatar/src/index.ts
  • packages/avatar/src/svg.ts
  • packages/avatar/test/speech.test.ts

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


📝 Walkthrough

Walkthrough

The avatar package adds opt-in mouthLayers support to pixelFigure and pixelAvatarSvg. Enabled output includes four mouth states at each head pose, with the saved state initially visible. The default output and recipe serialization remain unchanged.

Changes

Speech Mouth Layers

Layer / File(s) Summary
Public options and SVG wiring
packages/avatar/src/figure.ts, packages/avatar/src/index.ts, packages/avatar/src/svg.ts
Adds public mouth-state and figure-option types. Adds the mouthLayers option and passes it to base and turn figures.
Mouth-state composition
packages/avatar/src/figure.ts
Builds saved, closed, half-open, and open mouth compositions from existing facial features. The saved composition supplies returned pixel cells and remains the default output.
Compatibility tests and release documentation
packages/avatar/test/speech.test.ts, README.md, README.zh.md, CHANGELOG.md, packages/avatar/package.json
Tests enabled and default SVG output, recipe serialization, and saved-mouth compatibility. Documents the option and updates the package version to 0.2.0.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Merge Risk: ⚪ Minimal · up to be024

No actionable issue is identified in the optional mouth-layer change; it is mergeable after normal checks.

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (4 skipped: 4… 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 clearly identifies the avatar feature and the optional speech mouth layers. It accurately summarizes the main change and is concise.
Linked Issues check ✅ Passed [#6] The PR adds opt-in mouthLayers support to pixelFigure and pixelAvatarSvg. The public exports include PixelFigureOptions and PixelMouthState. The SVG includes saved, closed, `half-op…
Out of Scope Changes check ✅ Passed The changes stay within [#6]. Source changes implement the optional mouth contract and preserve default output. Tests verify the required compatibility behavior. README and README.zh.md document the p…
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · 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

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

@DoodleBears

Copy link
Copy Markdown
Contributor Author

Closes #6 · Consumer #1143 · Agent claim · Task: codex/local/01a11734-bb09-7f01-9d45-adc0f5df6269

Why the change

Consumers can animate simple speech mouths without changing saved pixel identities or rebuilding the entire character on each text step.

Special things to note

  • Merge risk: two-way door, reverting requires no saved-data repair; small blast radius, only explicit mouthLayers: true requests produce new markup. Review exact default/golden compatibility and every-yaw feature-layer composition.
  • Avatar package candidate is 0.2.0; saved recipe/schema/rig versions remain unchanged. The four groups include shared brows/nose/cheeks to preserve original paint order; eyes, blink and glasses stay independent. Text pacing and motion policy belong to the consumer.
  • Package release and the real DSH message path are separate delivery steps in consumer #1143; this PR does not claim that end-to-end behavior is complete or that a version has been published.

Change outline

 pixelAvatarSvg(recipe, options) → pixelFigure(recipe, yaw, options)
+ mouthLayers?: boolean (default: false)
+ every pose: [data-avatar-mouth="saved|closed|half-open|open"]
+ exported PixelFigureOptions / PixelMouthState
 unchanged recipe validation, saved cells, default SVG and golden hashes

Show one group in each yaw at a time, then restore saved after speech/cancellation. No avatar concepts enter pixel-morph and no runtime dependency is added.

Actual public-package rendering — 900 × 640, identical recipes

Before uses the installed @botharness/pixel-avatar@0.1.0; After uses candidate build be024f2. The pure SVG package has no standalone UI. These images are direct renders of its public exports, not DSH screenshots or a substitute for the consumer's runtime evidence. Each row uses the same recipe. Backgrounds belong to the comparison canvas; the busts themselves are transparent.

Before — light, saved face only

mouth-light-before

After — light, saved / closed / half-open / open

mouth-light-after

Before — dark

mouth-dark-before

After — dark

mouth-dark-after

Validation

  • pnpm verify passed: formatting, lint, typechecking and 31 tests. Existing unrelated morph lint warning remains. Production build passed.
  • The new public mouth contract failed before implementation and passed afterward. Neutral restoration is byte-for-byte equal across the mouth catalog, all poses, presets and detailed geometry; existing golden fixtures were not regenerated.
  • Both required code-review axes are clean against latest owning-repo origin/main (df53fc8). Normal package release must precede finalizing the consumer dependency.

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