Skip to content

Commit 90bd6ee

Browse files
smellslikemlsalma-remyxclaude
authored
outrider setup-local: --two-tier flag with live-fetched templates (#47)
* feat(outrider): --two-tier flag for setup-local, templates fetched from remyxai/outrider@v1 Adds an opt-in --two-tier flag to `remyxai outrider setup-local`. When set, installs the drafter/refiner companion workflows alongside the existing outrider.yml: * outrider.yml — workflow_dispatch only, no cron (manual + refiner target) * outrider-daily.yml — drafter role, daily cron, Anthropic Haiku 4.5, publish=branch, maintain-state=true, staged-synthesis=false * outrider-weekly-refine.yml — refiner orchestrator, weekly cron, picks candidate from past 7 days + generates gap analysis via Sonnet 4.6 + dispatches Opus refinement with lead-content inline Templates are FETCHED live from remyxai/outrider@v1 at install time (via gh api) rather than embedded inline in the CLI. Design rationale: treat the outrider repo as the canonical source of truth for the workflow shape so template refinements propagate to new customer installs automatically without requiring a CLI release. --two-tier currently opts in; default install behavior is unchanged (single-file outrider.yml with the legacy weekly cron). A follow-up CLI release can flip the default once the templates on remyxai/outrider@v1 have accumulated a few production weeks. Dry-run mode renders all three files when --two-tier is set so customers can preview before opting in. 15 existing tests still pass (no regression). Fetch-based render path is a new code path; a follow-up should add a test that mocks the gh api response for both templates and asserts the substitution + write ordering. * fix(outrider two-tier): make drafter/refiner install actually run on target repos Addresses review feedback on #47: * Drafter `uses: ./` rewrite (blocking). The @v1 drafter references the action locally; on a customer repo that resolves to their root (no action.yml). _render_drafter_workflow now rewrites `uses: ./` → `uses: remyxai/outrider@v1`, guarded like the interest-id rewrite. * Runner declares the refiner's dispatch inputs (blocking). The refiner dispatches outrider.yml with mode/publish/start-from-ref/lead-content/ staged-synthesis, which GitHub rejected as unknown workflow_dispatch keys. _render_local_workflow now declares + forwards all five; defaults match the action's own so scheduled/manual runs are unchanged. * Document the fork schedule caveat (note). Two-tier PR body + plan output now note that `schedule:` triggers don't self-run on forks; wires up the previously-unused PR_TITLE_TWO_TIER. Also fixes _fetch_outrider_template passing a stray leading "api" arg to _gh_api_json (which already prepends `gh api`), which produced `gh api api repos/...` and broke every two-tier fetch. Refiner over-selection (note 4) is already resolved upstream in remyxai/outrider (drafter-known-branch enumeration) and propagates via the live @v1 fetch — no CLI change needed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * feat(outrider two-tier): optional per-stage model flags for setup-local Adds --drafter-model / --refiner-model / --refine-model (+ --zai-key) so the two-tier install can retune any stage's model — including routing it at z.ai's GLM — without hand-editing the fetched workflow files. Defaults are unchanged: omit the flags and all three stages stay single-provider on Anthropic, so an install still needs only ANTHROPIC_API_KEY. Provider is inferred from the model name (glm-* -> z.ai Bearer auth via ZAI_API_KEY; claude-* -> Anthropic). When any stage selects a GLM model the CLI resolves a z.ai key (--zai-key / $ZAI_API_KEY / $Z_AI_KEY / prompt) and sets it as the ZAI_API_KEY repo secret. The transforms mirror the manual edits exactly: drafter env/base-url swap, refiner gap-analysis endpoint+auth swap, and the refiner's dispatch provider/model flags. Structural rewrites are guarded so a template shape change fails loud rather than silently skipping. Reproduces the previously-manual GLM-drafter + GLM-refiner + Opus-refine config as a one-liner: setup-local --two-tier --drafter-model glm-5.2 --refiner-model glm-5.2 \ --refine-model claude-opus-4-8 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> --------- Co-authored-by: salma-remyx <salma@remyx.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 1a7c865 commit 90bd6ee

3 files changed

Lines changed: 598 additions & 10 deletions

File tree

remyxai/cli/commands.py

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,44 @@ def outrider_init(
702702
"call-site claims on real paths. See outrider's "
703703
"docs/environments.md for the rationale."
704704
))
705+
@click.option("--two-tier", "two_tier", is_flag=True, default=False,
706+
help=(
707+
"Install the two-tier drafter/refiner setup (recommended "
708+
"default for repos where continuous exploration + weekly "
709+
"promotion is wanted). Writes outrider-daily.yml (drafter, "
710+
"Anthropic Haiku 4.5, publish=branch, daily cron) and "
711+
"outrider-weekly-refine.yml (refiner orchestrator, weekly "
712+
"cron, picks candidate + generates gap analysis via Sonnet "
713+
"4.6 + dispatches Opus refinement) alongside a manual-"
714+
"dispatch outrider.yml. Templates are fetched from "
715+
"remyxai/outrider@v1 at install time. See remyxai/outrider "
716+
"docs/customization.md §5 for the design rationale."
717+
))
718+
@click.option("--drafter-model", "drafter_model", default=None,
719+
help=(
720+
"Optional model for the two-tier drafter (outrider-daily.yml). "
721+
"e.g. glm-5.2, claude-sonnet-4-6. A GLM model routes the stage "
722+
"at z.ai (needs a ZAI_API_KEY). Omit to keep the single-provider "
723+
"default (Haiku 4.5). Requires --two-tier."
724+
))
725+
@click.option("--refiner-model", "refiner_model", default=None,
726+
help=(
727+
"Optional model for the two-tier refiner's gap-analysis call "
728+
"(outrider-weekly-refine.yml). GLM routes at z.ai. Omit for the "
729+
"default (Sonnet 4.6). Requires --two-tier."
730+
))
731+
@click.option("--refine-model", "refine_model", default=None,
732+
help=(
733+
"Optional model the refiner dispatches for the final refinement "
734+
"run. GLM routes at z.ai (via the runner's provider mapping). "
735+
"Omit for the default (Opus 4.8). Requires --two-tier."
736+
))
737+
@click.option("--zai-key", "zai_key", default=None,
738+
help=(
739+
"z.ai GLM Coding Plan API key, set as the ZAI_API_KEY repo "
740+
"secret. Only needed when a --*-model selects a GLM model; "
741+
"falls back to $ZAI_API_KEY / $Z_AI_KEY, else prompts."
742+
))
705743
@click.option("--bulk-repos", "bulk_repos", type=click.Path(), default=None,
706744
help=(
707745
"Path to a TSV mapping repos to ResearchInterest UUIDs "
@@ -717,7 +755,8 @@ def outrider_init(
717755
help="Skip the confirmation prompt (default is opt-in).")
718756
def outrider_setup_local(
719757
repo, interest_id, auto_interest, mode, anthropic_key,
720-
no_cron, no_cocoindex, bulk_repos, pace_s, dry_run, skip_confirm,
758+
no_cron, no_cocoindex, two_tier, drafter_model, refiner_model, refine_model,
759+
zai_key, bulk_repos, pace_s, dry_run, skip_confirm,
721760
):
722761
"""
723762
Set up Outrider WITHOUT the Remyx GitHub App.
@@ -762,6 +801,11 @@ def outrider_setup_local(
762801
dry_run=dry_run,
763802
no_cron=no_cron,
764803
no_cocoindex=no_cocoindex,
804+
two_tier=two_tier,
805+
drafter_model=drafter_model,
806+
refiner_model=refiner_model,
807+
refine_model=refine_model,
808+
zai_key=zai_key,
765809
),
766810
pace_s=pace_s,
767811
)
@@ -776,6 +820,11 @@ def outrider_setup_local(
776820
dry_run=dry_run,
777821
no_cron=no_cron,
778822
no_cocoindex=no_cocoindex,
823+
two_tier=two_tier,
824+
drafter_model=drafter_model,
825+
refiner_model=refiner_model,
826+
refine_model=refine_model,
827+
zai_key=zai_key,
779828
)
780829

781830

0 commit comments

Comments
 (0)