Make extractor strategy a deploy-time choice (single_pass | agentic)#34
Merged
Conversation
Terraform Plan ·
|
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.
Makes the extraction strategy a deploy-time choice via a new
extractor_flavorvariable (single_pass|agentic, defaultsingle_pass), so any environment can run either the single structured LLM call or theAgenticExtractorReAct loop by flipping one variable. Single-pass stays the default everywhere; prod gains the agentic capability without reverting anything. See ADR-0016.What changed
Handler —
_extractor()readsEXTRACTOR_FLAVORand builds eitherSinglePassExtractororAgenticExtractor(modality="text", max_iterations=…). Return type widens to theExtractor[NDA]protocol; both flavors' failures (including the agentic non-terminationExtractionError) flow through the existing broadexcept→batchItemFailuresredrive path unchanged.Infra — A flavor-keyed
flavor_profilein the root module drives the whole parameter envelope so re-parametrization is a one-variable flip. Only two knobs actually move with the flavor:max_iterations:nullfor single-pass (no loop, var omitted from the function env),30for agentic.maxReceiveCount:3single-pass,2agentic — agentic failures are mostly logic, not transient, so retrying an expensive doomed run buys nothing.Timeout, visibility timeout, modality, and concurrency cap hold across both. Per-env
tfvarsset staging + local toagentic, prod tosingle_pass. Newextractor_flavorTerraform output exposes the deployed strategy.Load harness — Reads
extractor_flavorfrom the live stack so SLO 4 (latency) reports rather than gates for agentic (slow by design); flavor now appears in the report header and artifact.Tests — Unit tests covering single-pass default, agentic construction, and the
max_iterationsenv default.Docs — ADR-0016 (new) plus ADR-0015 post-run corrections; README queue / extractor / alarm tables updated for flavor-dependent values; quality-gates CI badge + workflow rename.
Notes
The agentic staging characterization run (the deployed agency-premium measurement) is user-triggered and still pending — this PR ships the capability, not the run.