feat(cli): agentdiff init — zero-config wizard - #34
Merged
Merged
Conversation
…illar 2) Severity-aware gate evaluation shared by CLI, assertions, and suites: HARD violations block CI (exit 1); SOFT warnings render everywhere but never flip the exit code. New cyclical-tool-loop invariant (identical inputs + stagnant outputs, non-consecutive included, on by default) and opt-in max-tool-repeats cap. Path drift renders as a non-blocking note. Provenance (G7) and threshold flagging (G6) cover the new knobs.
…, commutative equivalence (Pillar 1) Baselines capture N >= 2 runs into a versioned envelope artifact (schema 2.0.0, additive — AgentTrace schema untouched). Statistical compare judges a candidate against normal variance: min-TDI-of-N alignment, step-count and cost bands (mean ± k·sigma, cost ceiling = max of relative cap and variance band), divergence ceiling. Hard invariants flow through. v1 single-trace baselines load as strict envelopes — full back-compat. Topological equivalence: independent same-work reorders ([A->B] vs [B->A]) merge to matched_commutative with zero TDI penalty; dependent swaps, changed args, and changed outcomes stay real divergence. [scenario.*] config (PRD v0.5 spec), record --runs N, rolling-window envelope rotation, N=3/5 benchmarks (cost linear in N).
Detects the agent framework (LangGraph, CrewAI, OpenAI Agents SDK, OpenTelemetry/OpenInference, or generic) from installed packages and writes a production-ready agentdiff.toml (v0.5 statistical spec) plus a GitHub Actions gate workflow. Idempotent (--force to overwrite); --adapter/--scenario/--runs parameterize the output. Next-steps output closes the loop: record envelope -> commit -> open a PR.
3 tasks done
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.
What
Pillar 4 of 0.5.0:
agentdiff initauto-detects the agent framework (LangGraph → CrewAI → OpenAI Agents SDK → OpenTelemetry/OpenInference → generic) from installed packages and writes a production-readyagentdiff.toml(v0.5 statistical spec:[scenario.*]+ hard invariants + tolerances) plus a GitHub Actions gate workflow — a working gate in seconds.Why
PRD pain point P4: hand-writing TOML + workflow YAML before first value is an onboarding wall. The PRD's Pillar 4 promises a production-ready setup in <10s;
initis the front door for the whole release.How
init_wizard.py:detect_framework()probesimportlib.util.find_specin moat-priority order;write_config()renders the TOML + workflow templates (GitHub expressions escaped correctly);FileExistsErrorwithout--force(idempotent, never clobbers silently)initsubcommand:--scenario,--runs,--adapteroverride,--force; prints detection verdict + next steps (record envelope → commit → open PR)pull_requesttrigger,--fail-on-regressiongate, PR report step, record target marked EDIT ME (init cannot know the user's callable)Testing
test_init_wizard.py): detection priority/fallback/override, file generation, valid-TOML parse, GitHub-expression survival, clobber protection,--force, CLI exit codesmake lintcleanChecklist
make lint+ full suite green[Unreleased]entryLinks to
context/ROADMAP.mdPhase M / 0.5.0 (SPEC-0.5.0 Pillar 4). Stacked on #33 (which is stacked on #32).