Gate native AI Credits pipeline processing#141
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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(defaultfalse) torunPipeline, 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
enableNativeAiCreditsProcessingtorunPipeline, defaulting tofalse.Commit summary
feat: gate native AI Credits pipelineValidation
npm test -- --run src/pipeline- passed, 144 testsnpm run lint- passednpm run build- passed