Skip to content

feat(ai): ADR-0033 Phase C — plan-first blueprint authoring#1537

Merged
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-phase-c-blueprint
Jun 2, 2026
Merged

feat(ai): ADR-0033 Phase C — plan-first blueprint authoring#1537
xuyushun441-sys merged 1 commit into
mainfrom
feat/adr-0033-phase-c-blueprint

Conversation

@xuyushun441-sys

Copy link
Copy Markdown
Contributor

What & why

Implements Phase C of ADR-0033plan-first blueprint authoring. Builds on Phase A (#1529).

Real authors say "build me a project-management system," not a field list. For high-level goals the agent must design, not transcribe, and confirm before it builds (ADR §4). This adds that plan-first layer on top of Phase A's draft-gated writes.

What changed

  • SolutionBlueprintSchema (@objectstack/spec/ai) — a simplified proposal shape: objects + fields + relationships (as lookup/master_detail reference fields) + views + dashboards + seed data, with stated assumptions and ≤2 questions. References the real FieldType enum so proposed types are valid.
  • propose_blueprint(goal) — emits the blueprint via generateObject (structured output). Persists nothing. Returns { status:'blueprint_proposed', blueprint, counts, questions }; the agent presents it for conversational confirm.
  • apply_blueprint(blueprint) — only after the human approves, batch-drafts each object/view/dashboard through the Phase A draft path (protocol.saveMetaItem({mode:'draft'})), per-type validated and partial-tolerant (a bad item is reported in failed, the rest still draft). Seed data is reported as proposed — not auto-applied (no runtime dataset type exists).
  • solution_design skill carries the plan-first instructions (propose → confirm → apply; never claim "live"); bound to metadata_assistant alongside metadata_authoring.
  • Exported stageDraft from the metadata tools and reused it — one draft-write path, one error shape.

Two safety gates

  1. Blueprint-confirm (conversational) — guards against mass-generating unreviewed artifacts from a vague prompt.
  2. Draft gate (Phase A) — even after apply, nothing is live until a human publishes the drafted diffs.

Verification

  • @objectstack/spec: 7 new solution-blueprint schema tests (valid parses; bad field type / missing summary / non-snake_case / >2 questions rejected). Full spec/ai suite green (129).
  • @objectstack/service-ai: 12 new blueprint-tool tests — propose persists nothing, apply drafts via mode:'draft' and never calls register, per-item failure isolation, seed reported-not-applied, malformed-blueprint rejection, view-column defaulting. Full suite green (458, was 446).
  • Both packages build + DTS-typecheck clean; new files tsc-clean.

Scope

Phase C only (framework / OSS). Phase B (objectui blueprint review UI) and Phase D (EE) remain out of scope. Flow authoring is explicitly deferred ("flow last").

🤖 Generated with Claude Code

For high-level goals ("build me a project-management system") the metadata
assistant designs before it builds, then confirms before drafting.

- Add SolutionBlueprintSchema (@objectstack/spec/ai): objects + fields +
  relationships + views + dashboards + seed data, with stated assumptions.
- propose_blueprint(goal): structured-output design; persists NOTHING; the
  agent presents it for conversational confirm, asks <=2 questions.
- apply_blueprint(blueprint): only after approval, batch-drafts every artifact
  through the Phase A draft path (mode:'draft'), per-type validated and
  partial-tolerant; seed data reported, not auto-applied.
- New solution_design skill (plan-first instructions) bound to
  metadata_assistant alongside metadata_authoring.
- Export stageDraft from metadata-tools and reuse it — one draft-write path.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@vercel

vercel Bot commented Jun 2, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 2, 2026 9:59am

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation protocol:ai size/xl tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants