Skip to content

feat(llm-core): add andThen and pipe auth combinators#466

Open
quangdang46 wants to merge 3 commits into
masterfrom
feat/A1-auth-trait-combinators
Open

feat(llm-core): add andThen and pipe auth combinators#466
quangdang46 wants to merge 3 commits into
masterfrom
feat/A1-auth-trait-combinators

Conversation

@quangdang46

Copy link
Copy Markdown
Owner

Summary

Adds sequential chaining (andThen) and fluent transformation (pipe) to the Auth trait, matching opencode's auth.ts combinator surface.

Reference: /tmp/feature-research/opencode/packages/llm/src/route/auth.ts (andThen, pipe, orElse)

Plan: docs/pr-plans/A1-auth-trait-combinators.md

Changes

  • AndThenAuth struct — runs first auth then second; short-circuits on first failure
  • dyn Auth::and_then() — chain two auths sequentially
  • dyn Auth::pipe() — apply a function for fluent transformations
  • 5 new tests covering all code paths
  • Fixes pre-existing failing tests in lib.rs, route.rs, schema.rs

Test Results

  • cargo test -p jcode-llm-core: 61 passed, 0 failed
  • cargo check -p jcode-llm-core: clean

Files Changed

File Change
crates/jcode-llm-core/src/auth.rs +AndThenAuth struct + dyn Auth methods + 5 tests
crates/jcode-llm-core/src/lib.rs Fix stale test_auth_works()
crates/jcode-llm-core/src/route.rs Remove stale generic type annotations
crates/jcode-llm-core/src/schema.rs Add PartialEq/Eq to ModelRef
PARITY.md Mark A1 Auth as ✅
docs/PR_BACKLOG.md Update A1 status to ✅ PR Open
docs/pr-plans/A1-auth-trait-combinators.md Plan file (new)

Add consolidated PR backlog from 13 reference repos (A-J, ~80 features)
and supporting docs (MASTER_GOAL_PROMPT, GOAL_DRIVEN_PROMPT, CONSOLIDATED_FINDINGS).
Adds sequential chaining and fluent transformation to the Auth trait,
matching opencode's auth.ts combinator surface.

Changes:
- AndThenAuth struct: runs first auth, then second; short-circuits on failure
- dyn Auth::and_then() method: Box<dyn Auth> -> Box<dyn Auth>
- dyn Auth::pipe() method: fluent transformation via closure
- 5 new tests: both_succeed, first_fails, second_fails, describe, pipe
- Fix stale lib.rs test (wrong API usage)
- Fix stale route.rs test generics (Route no longer generic)
- Add PartialEq/Eq to ModelRef for test assertions
- PARITY.md §IX: mark A1 Auth as implemented
- PR_BACKLOG.md: update A1 status to PR Open

Refs: docs/pr-plans/A1-auth-trait-combinators.md
@quangdang46 quangdang46 added the enhancement New feature or request label Jun 30, 2026
…atuses

After systematic audit of the codebase:
- A2-A5, B1: already implemented on master (backlog was wrong)
- A6: indeed stub-only (real gap)
- A7, A9: already implemented (backlog was wrong)
- A8: missing (real gap)
- A10: partially implemented
- Added Sections D-J with remaining features from reference repos
- P0 is 100% complete
- Reorganized statuses to reflect reality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant