← Back to Pull requests

feat(commands): settle the try-flow project from getDefaultProject #70

Open
unknown opened this pull request with 650 lines diff across 8 files
View on GitHub
unknown unknown commented on Oct 19, 2026 13:37 UTC
Author

Both try commands decided which project to use with a two-way branch: is default in catalyst_list_projects, yes or no. The platform answers a richer question — three outcomes over six reasons — in the getDefaultProject part of catalyst_whoami that step 1 already fetches and step 2 discarded.

Step 2 now branches on that outcome, and the skills key their "do not create a project" rule on it too. The control-plane behaviour behind this, and one change it would need on the cloudgrid side, are at the bottom.

What step 2 does now

  • ready → use the project it names.

  • pending → say so, wait ~5s, call catalyst_whoami again, up to five times. Never create anything while pending.

  • unavailable → name the reason, then use otherProjects (same response, no second call), or offer to create one.
  • Creation is guarded three ways: the name may not collide with an existing project; dry_run goes first, because catalyst_apply replaces a same-named project and a field left out is dropped, which cannot be undone; and a project-limit refusal is reported plainly instead of worked around. A new project's spec sets defaultPubsubEnabled, defaultKVStoreEnabled and defaultWorkflowStoreEnabled to true, with spec.region omitted because it is immutable once set.

    Whichever project is settled on — including one the user picks from their own list — step 2 confirms status.defaultWorkflowStoreEnabled before step 3. That closes the hole where a hand-made project silently produces runs that never appear.

    Skills

    catalyst-setup gains section 5, a table of the five situations and what each one means. catalyst-agent-scaffold, catalyst-workflow-scaffold, catalyst-workflow-from-diagram and catalyst-develop keyed their rule on a project listing; they now key it on the outcome, with the try-flow exception scoped to unavailable.

    Evals

  • starter-no-project-creates-one — the create path, graded on enabling all three managed stores and on asking before creating.

  • starter-pending-project-waits — new, and the one that matters: it fails any response that offers to create a project, sends the user to the console, or treats a pending project as permanently absent.
  • Line endings

    .gitattributes pins LF. The install component test read files raw, so its LF-only frontmatter regex failed on a Windows checkout under core.autocrlf=true and passed on the ubuntu runners; it now normalises on read. npm test goes 11/12 → 12/12 on Windows.

    Verification

    check_mcp_surface.py, build_install_data.py --check, lint_skills.py, npm test (12/12), 14 evals with valid frontmatter, both command/eval pairs byte-identical.

    Suggestion: the cloudgrid edge case behind this

    Nothing below is changed by this PR — it is the control-plane behaviour this flow was adapted to, and one suggested change to it. Worth a second opinion from whoever owns defaultproject.

    getDefaultProject is a trigger as well as a report. In services/cloudgrid/internal/app/catalyst/service/project_default.go, EnsureDefaultProject calls RequestResync on the organization whenever the reason is ready or transient — so asking is what makes the operator get on with bootstrapping, and a new organization converges from the same call that discovers it has not converged yet.

    That produces outcome: pending, classified in services/cloudgrid/internal/app/catalyst/defaultproject/reason.go as no_region or region_not_connected, with the instruction built in instruction.go saying "Wait a few seconds and repeat the same call."

    Why the old flow got this wrong, and why it is expensive. Step 2 called catalyst_list_projects, whose tool wiring in services/catalyst/mcp/internal/toolset/tools.go is Ops: []string{"listProject"} — it carries no outcome, no reason, no instruction. So a pending project and a permanently absent one are indistinguishable from that call, and the flow read both as "there is no default project":

  • This is the single most likely path for the audience these commands target. A /catalyst-ai:try- command opens with "I'm new to Diagrid Catalyst." A brand-new organization is precisely the one whose project is still being created. The flow's worst case was its most common one.

  • The cost is permanent and it is a quota slot. services/cloudgrid/products.yaml sets number_of_projects to 3 per cloud region on cra:free (5 on cra:plus, 3 on cra:enterprise). An agent that reads pending as absent and creates a project spends one of three on a duplicate of a project that arrives seconds later. reason.go and instruction.go both call this out in their package comments as the failure the package exists to prevent.

  • The old remedy was a dead end anyway. It sent the user to the console to create a project by hand. A console project is not default: per the Project schema none of the managed infrastructure is on unless the spec asks for it, so the user would most likely land on a project with no workflow store and discover it three steps later, when the crash-and-resume demo produces runs that never appear.
  • The suggested change

    instruction.go appends " Do not create a project." to every instruction, unconditionally, for all six reasons — its doc comment calls that "the point… No combination may leave that unsaid" — and the catalyst_whoami tool description in tools.go repeats it.

    Step 2 now agrees with that everywhere except one narrow case: unavailable, with no otherProjects, and headroom available. There, the instruction tells the agent to ask the user to go and create a project by hand, which is the dead end above. Suggestion: let the instruction for that one case permit a create, or say what a hand-made project must enable. Until then this flow is contradicted at runtime in exactly that case.

    Worth noting the platform's own hosted quickstart already takes the other side in hostedquickstart.go, refusing a non-empty project with "hosted quickstart requires an empty project -- create a new one"*.

    Files read

    | File | What it establishes |
    | --- | --- |
    | services/cloudgrid/internal/app/catalyst/defaultproject/reason.go | the six reasons, which two are transient |
    | services/cloudgrid/internal/app/catalyst/defaultproject/instruction.go | the instruction text, and the unconditional "Do not create a project." |
    | services/cloudgrid/internal/app/catalyst/defaultproject/result.go | outcome / reason / otherProjects / instruction shape |
    | services/cloudgrid/internal/app/catalyst/service/project_default.go | the resync trigger, and default_deleted being permanent |
    | services/cloudgrid/internal/app/catalyst/service/hostedquickstart.go | the platform's own quickstart telling users to create a project |
    | services/cloudgrid/products.yaml | 3 / 5 / 3 / 200 projects per region by plan |
    | services/catalyst/mcp/internal/toolset/tools.go | catalyst_list_projects carries none of this |
    | services/catalyst/mcp/internal/toolset/resources.go | Project is creatable via apply; the prohibition is advisory prose only |

    🤖 Generated with Claude Code

    Diff: 650 lines (+487 / -163) across 8 files Reviewer: sicoyle Review duration: 17267m
    All Vouch review confidence checks passed
    Residual risk 0.28 = Change Risk (0.52) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.344
    Real PR Conversation Timeline
    1 comments
    "Review active on #70"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 27.7% · Safe to merge
    27.7%