Skip to content

Gate native AI Credits pipeline processing#141

Merged
asizikov merged 1 commit into
mainfrom
asizikov/gated-native-pipeline
Jun 6, 2026
Merged

Gate native AI Credits pipeline processing#141
asizikov merged 1 commit into
mainfrom
asizikov/gated-native-pipeline

Conversation

@asizikov
Copy link
Copy Markdown
Member

@asizikov asizikov commented Jun 6, 2026

Native AI Credits reports are still blocked for normal uploads, but internal tests need an end-to-end path to exercise native adapter parsing, metadata, and included-credit policy behavior. This keeps the public/default path rejected while adding an explicit opt-in pipeline flag for controlled processing.

Summary

  • Adds enableNativeAiCreditsProcessing to runPipeline, defaulting to false.
  • Threads an internal native validation override through report adapter selection without marking native reports as supported.
  • Uses native parsing during included-credit context analysis when native metadata is active, including date normalization for policy selection.
  • Adds focused tests for default rejection before aggregator hooks, flagged native metadata/row processing, native-format aggregation, and summer vs September included-credit allocation.

Commit summary

Commit Change
feat: gate native AI Credits pipeline Adds the internal opt-in native pipeline path while preserving default rejection and UI behavior

Validation

  • npm test -- --run src/pipeline - passed, 144 tests
  • npm run lint - passed
  • npm run build - passed

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 6, 2026 15:34
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds an explicit opt-in flag to allow end-to-end pipeline processing of native AI Credits reports for internal/testing scenarios, while keeping the default upload path rejecting native reports as unsupported. It also ensures included-credit policy selection uses native parsing (including date normalization) when native metadata is active.

Changes:

  • Added enableNativeAiCreditsProcessing (default false) to runPipeline, threading it into report-format validation to bypass the “unsupported native” rejection only when explicitly enabled.
  • Updated adapter validation to accept a validation override for native format without marking native reports as generally supported.
  • Updated included-credits context analysis to use native parsing when native metadata is in effect, with tests covering default rejection, opt-in processing, aggregation behavior, and policy boundary behavior.
Show a summary per file
File Description
src/pipeline/runPipeline.ts Adds an opt-in pipeline flag and passes validation options into format validation.
src/pipeline/runPipeline.test.ts Adds tests for default native rejection and enabled native processing/aggregation/policy selection.
src/pipeline/reportAdapters.ts Introduces validation options and gates native first-record rejection behind an explicit allow flag.
src/pipeline/aicIncludedCredits.ts Switches included-credits context parsing to native parsing when native metadata is active.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 4/4 changed files
  • Comments generated: 0

@asizikov asizikov merged commit 7cee69d into main Jun 6, 2026
10 checks passed
@asizikov asizikov deleted the asizikov/gated-native-pipeline branch June 6, 2026 15:38
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.

2 participants