Skip to content

Remove alpha from Teal lexicon namespace - #68

Merged
mmattbtw merged 3 commits into
mainfrom
agent/remove-alpha-namespace
Aug 13, 2026
Merged

Remove alpha from Teal lexicon namespace#68
mmattbtw merged 3 commits into
mainfrom
agent/remove-alpha-namespace

Conversation

@mmattbtw

@mmattbtw mmattbtw commented Jul 28, 2026

Copy link
Copy Markdown
Member

Coauthored by GPT 5.6 Luna

Summary

  • Updated the vendored production play lexicons and regenerated the Go API/CBOR encoders.
  • Updated Piper producer mappings to emit the canonical originUri and musicServiceUri fields as absolute HTTPS URIs.
  • Kept OAuth scopes and all record writes on the production fm.teal.* namespace.

Behavior and compatibility

Piper is a scrobbler/producer and does not consume existing listens, so it does not need dual alpha/production read support. New submissions use fm.teal.feed.play; legacy alpha records are not rewritten.

Validation

  • make lexicon
  • go test ./...
  • git diff --check
  • Byte-for-byte comparison of lexicons/teal/feed/play.json and lexicons/teal/feed/defs.json against Teal main
  • Confirmed no stale alpha namespace or old play-field references remain

Canonical source: teal-fm/teal main merge commit 82ea66cadbde3f1aee9c72b05f372c6543a4b3f6, merged PR #110.

Summary by CodeRabbit

  • New Features
    • Finalized Teal actor and feed APIs under their standard namespace.
    • Added URI-based fields for content origins and music services.
    • Music service values are now normalized to HTTPS URIs.
  • Bug Fixes
    • Updated playback and status publishing to use finalized schemas.
    • Clarified playback times as playback-start timestamps.
  • Refactor
    • Renamed API types and methods to remove legacy alpha naming.
    • Updated OAuth scopes and record submission for the finalized APIs.

@mmattbtw
mmattbtw marked this pull request as ready for review July 28, 2026 04:30
@mmattbtw
mmattbtw requested a review from espeon July 28, 2026 04:31
@mmattbtw

Copy link
Copy Markdown
Member Author

related: teal-fm/teal#110

@mmattbtw

mmattbtw commented Aug 4, 2026

Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1dd66e8038

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread oauth/atproto/atproto.go
fmt.Println(clientId, callbackUrl)

scopes := []string{"atproto", "repo:fm.teal.alpha.feed.play", "repo:fm.teal.alpha.actor.status"}
scopes := []string{"atproto", "repo:fm.teal.feed.play", "repo:fm.teal.actor.status"}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Reauthorize sessions for the renamed collections

On an upgrade, sessions issued before this commit still contain only the persisted repo:fm.teal.alpha.feed.play and repo:fm.teal.alpha.actor.status grants; changing the scopes requested by new login flows cannot add permissions to those existing tokens. Because GetATProtoClient resumes the stored session while submission and playing-now now write exclusively to the renamed collections, existing users will receive authorization errors until they manually authenticate again. Detect stale scopes and force reauthorization or provide a compatible migration path.

Useful? React with 👍 / 👎.

@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 3790b8f5-5f37-4f51-8536-d59ed734a825

📥 Commits

Reviewing files that changed from the base of the PR and between cc82ba9 and e0362b3.

📒 Files selected for processing (1)
  • models/constants.go

📝 Walkthrough

Walkthrough

The PR migrates TEAL lexicons and generated APIs from fm.teal.alpha to fm.teal, renames exported types, replaces URL fields with URI fields, updates CBOR serialization, and adjusts submission, playing-now, OAuth, and formatting integrations.

Changes

TEAL namespace migration

Layer / File(s) Summary
Schema contracts and generated records
lexicons/teal/..., api/teal/actordefs.go, api/teal/actorprofile.go, api/teal/actorstatus.go, api/teal/feeddefs.go, api/teal/feedplay.go
TEAL schema identifiers and references remove the alpha namespace. Generated actor and feed types use finalized names. OriginUrl and MusicServiceBaseDomain become OriginUri and MusicServiceUri.
Generated bindings and CBOR serialization
api/teal/actorget*.go, api/teal/actorsearchActors.go, api/teal/feedget*.go, api/teal/cbor_gen.go, cmd/lexgen/main.go
XRPC functions, output types, registrations, and CBOR marshal/unmarshal methods use finalized identifiers and fields.
Service record integration and URI formatting
models/lexicon_format.go, models/lexicon_format_test.go, service/atproto/submission.go, service/playingnow/*, oauth/atproto/atproto.go, service/spotify/spotify.go, models/constants.go
Submission and playing-now flows create finalized TEAL records. Music-service values are normalized with HTTPS prefixes. OAuth scopes, the Spotify annotation, and the submission agent use finalized values.

Estimated code review effort: 4 (Complex) | ~45 minutes

Mergeability Score: 🟠 High · up to e0362

The PR changes the production lexicon and generated record handling, but it still risks silently losing metadata from previously written records and can create invalid play views when clearing status. These correctness issues should be fixed before merge.

Suggested reviewers: espeon

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 43.75% 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 clearly and concisely describes the primary change: removing the alpha namespace from Teal lexicons and generated APIs.
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.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch agent/remove-alpha-namespace

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
api/teal/cbor_gen.go (1)

2503-2521: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Preserve read compatibility for renamed fields.

The previous lexicon defined originUrl and musicServiceBaseDomain. Both decoders now accept only originUri and musicServiceUri. Old fields are consumed and discarded without an error. If existing PDS records use the previous names, add a dual-read or backfill path before deployment. Apply this to the FeedPlay decoders at Lines 783-801 and 1000-1018.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/teal/cbor_gen.go` around lines 2503 - 2521, Update the FeedPlay decoders,
including the paths around the originUri/musicServiceUri cases and the
corresponding sections at the earlier decoder locations, to also recognize the
legacy originUrl and musicServiceBaseDomain field names. Decode those values
into the current FeedPlay fields (or otherwise backfill them when the new names
are absent), while preserving existing handling for current names and unknown
fields.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@service/playingnow/playingnow.go`:
- Around line 172-175: Update the actor-status schema and the emptyPlayView
construction in the surrounding playing-now flow so the cleared state is
schema-valid instead of using an empty TrackName. Either model an explicit
cleared state in the schema or make the item optional and omit it, then
regenerate the API and CBOR bindings and update callers to use the generated
representation.

---

Outside diff comments:
In `@api/teal/cbor_gen.go`:
- Around line 2503-2521: Update the FeedPlay decoders, including the paths
around the originUri/musicServiceUri cases and the corresponding sections at the
earlier decoder locations, to also recognize the legacy originUrl and
musicServiceBaseDomain field names. Decode those values into the current
FeedPlay fields (or otherwise backfill them when the new names are absent),
while preserving existing handling for current names and unknown fields.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ad75db14-69c5-47fb-9b75-ab605aa5be6d

📥 Commits

Reviewing files that changed from the base of the PR and between f766806 and cc82ba9.

📒 Files selected for processing (29)
  • api/teal/actordefs.go
  • api/teal/actorgetProfile.go
  • api/teal/actorgetProfiles.go
  • api/teal/actorprofile.go
  • api/teal/actorsearchActors.go
  • api/teal/actorstatus.go
  • api/teal/cbor_gen.go
  • api/teal/feeddefs.go
  • api/teal/feedgetActorFeed.go
  • api/teal/feedgetPlay.go
  • api/teal/feedplay.go
  • cmd/lexgen/main.go
  • lexicons/teal/actor/defs.json
  • lexicons/teal/actor/getProfile.json
  • lexicons/teal/actor/getProfiles.json
  • lexicons/teal/actor/profile.json
  • lexicons/teal/actor/searchActors.json
  • lexicons/teal/actor/status.json
  • lexicons/teal/feed/defs.json
  • lexicons/teal/feed/getActorFeed.json
  • lexicons/teal/feed/getPlay.json
  • lexicons/teal/feed/play.json
  • models/lexicon_format.go
  • models/lexicon_format_test.go
  • oauth/atproto/atproto.go
  • service/atproto/submission.go
  • service/playingnow/playingnow.go
  • service/playingnow/playingnow_test.go
  • service/spotify/spotify.go

Comment on lines +172 to 175
emptyPlayView := &teal.FeedDefs_PlayView{
TrackName: "", // Empty track indicates no current playing
Artists: []*teal.AlphaFeedDefs_Artist{},
Artists: []*teal.FeedDefs_Artist{},
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift

Define a schema-valid cleared status.

Line 173 sets TrackName to "". lexicons/teal/feed/defs.json requires trackName with minLength: 1. This clear record contains an invalid FeedDefs_PlayView.

Model a cleared state in the actor-status schema, or make item optional before omitting it here. Regenerate the API and CBOR bindings after the schema change.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@service/playingnow/playingnow.go` around lines 172 - 175, Update the
actor-status schema and the emptyPlayView construction in the surrounding
playing-now flow so the cleared state is schema-valid instead of using an empty
TrackName. Either model an explicit cleared state in the schema or make the item
optional and omit it, then regenerate the API and CBOR bindings and update
callers to use the generated representation.

@mmattbtw
mmattbtw merged commit 41bc823 into main Aug 13, 2026
1 of 2 checks 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.

1 participant