Skip to content

fix(albatross): collapse null place fields before savePlan - #187

Merged
jjalangtry merged 1 commit into
mainfrom
staging
Aug 10, 2026
Merged

fix(albatross): collapse null place fields before savePlan#187
jjalangtry merged 1 commit into
mainfrom
staging

Conversation

@jjalangtry

@jjalangtry jjalangtry commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

One fix found by the production regeneration sweep: models write null for a place field they cannot ground, zod accepted the null, and the Convex validator rejected it — the whole plan failed. The schema now transforms every nullable place field to undefined, with a focused test.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed plan saving to consistently handle missing optional place details.
    • Required place names remain preserved, while blank optional details no longer cause persistence issues.
  • Tests
    • Added coverage verifying correct handling of optional and required place information during plan saving.

Models write null for a place field they cannot ground; zod accepted
the null and the Convex validator rejected it, so the whole plan
failed. The schema now transforms every nullable place field to
undefined. Found by the production regeneration sweep.
@jjalangtry
jjalangtry merged commit 5343275 into main Aug 10, 2026
4 of 5 checks passed
@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 335c7be3-61ca-4821-afee-eb749c27d256

📥 Commits

Reviewing files that changed from the base of the PR and between cb82bbb and 4fa9b0b.

📒 Files selected for processing (2)
  • lib/albatross/intent-plan.ts
  • tests/albatross-intent-plan.test.ts

📝 Walkthrough

Walkthrough

The place schema now converts absent or nullable optional metadata to undefined after validation. A generation test verifies that savePlan receives normalized optional fields while preserving required place fields.

Changes

Place metadata normalization

Layer / File(s) Summary
Schema normalization and persistence validation
lib/albatross/intent-plan.ts, tests/albatross-intent-plan.test.ts
groundedField validates nullable strings and transforms them to undefined. The generation test verifies normalized optional fields and preserved required fields.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch staging

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

@github-actions

Copy link
Copy Markdown

✅ Coverage Report

Metric Value
Current coverage 85.24% (43897/51497)
Baseline coverage 85.24% (43891/51491)
Result PASS

Changed Files

File Baseline Current Status
lib/albatross/intent-plan.ts 97.86% 97.88% PASS

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