-
Notifications
You must be signed in to change notification settings - Fork 511
[research] Describe embeds and snippets
#3733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| # PR Draft: Snippets + Legacy Applications (Entity-Specific Design Pass) | ||
|
|
||
| Status: draft | ||
| Last updated: 2026-02-11 | ||
|
|
||
| ## Title | ||
|
|
||
| `chore(docs): define snippet/application compatibility contract for legacy-backed entities` | ||
|
|
||
| ## Why | ||
|
|
||
| This branch already contains snippet-aware behavior in multiple code paths, but the contract is implicit and spread across router/service/UI layers. | ||
|
|
||
| This PR documents the implementation reality and proposed compatibility contract before further code changes. | ||
|
|
||
| ## What Changed in This PR | ||
|
|
||
| - Added design docs under `docs/designs/snippets/`. | ||
| - Tightened `RFC.md` to be implementation-specific with concrete file-level behavior. | ||
| - Added explicit snippet format contract in RFC (embed shapes, token grammar, path precedence, resolution flow, guardrails). | ||
| - Kept `PRD.md` intentionally higher-level for later product iteration. | ||
|
|
||
| ## Files Added/Updated | ||
|
|
||
| - `docs/designs/snippets/README.md` | ||
| - `docs/designs/snippets/PRD.md` | ||
| - `docs/designs/snippets/RFC.md` | ||
| - `docs/designs/snippets/PR.md` | ||
|
|
||
| ## Implementation Evidence Captured in RFC | ||
|
|
||
| 1. **Type system** | ||
| `AppType.SNIPPET` exists and is tagged as `snippet`. | ||
| Source: `api/oss/src/models/shared_models.py:68` | ||
|
|
||
| 2. **API surface** | ||
| `GET /apps` accepts `snippets=exclude|include|only` (default `exclude`). | ||
| Source: `api/oss/src/routers/app_router.py:352` | ||
|
|
||
| 3. **DB behavior** | ||
| `exclude` and `only` are implemented as explicit `AppType.SNIPPET` filters. | ||
| Source: `api/oss/src/services/db_manager.py:1858` | ||
|
|
||
| 4. **Resolver aliasing** | ||
| Embed references support snippet/application alias pairs across artifact, variant, and revision keys. | ||
| Source: `api/oss/src/services/embeds_service.py:816` | ||
|
|
||
| 5. **Legacy fallback** | ||
| Revision references may backfill variant references for compatibility. | ||
| Source: `api/oss/src/services/embeds_service.py:849` | ||
|
|
||
| 6. **Boundary detail** | ||
| Internal fetch boundaries still pass `artifact_ref` as `application_ref`. | ||
| Source: `api/oss/src/services/embeds_service.py:148` | ||
|
|
||
| 7. **UI behavior** | ||
| Endpoint code snippet generation is functionally compatible but still app-first in route/copy. | ||
| Source: `web/oss/src/pages/w/[workspace_id]/p/[project_id]/apps/[app_id]/endpoints/index.tsx:11` | ||
|
|
||
| 8. **Format + resolver contract** | ||
| RFC now documents exact snippet format and embed dereferencing behavior used by `/variants/configs/fetch` and `/variants/configs/resolve`. | ||
| Source: `api/oss/src/routers/variants_router.py:786` | ||
|
|
||
| ## Scope of This PR | ||
|
|
||
| - Documentation and design alignment only. | ||
| - No runtime logic changes. | ||
| - No API schema changes. | ||
|
|
||
| ## Suggested Follow-Up Code PRs (Separate) | ||
|
|
||
| 1. Add contract tests for alias mapping and fallback behavior. | ||
| 2. Add telemetry around alias family usage and fallback-path usage. | ||
| 3. Harden user-facing naming in UI copy where safe, without breaking routes. | ||
|
|
||
| ## Reviewer Checklist | ||
|
|
||
| - Validate that RFC accurately reflects current branch implementation. | ||
| - Confirm compatibility contract matches intended near-term behavior. | ||
| - Confirm open questions are the right ones before implementation PRs. | ||
|
|
||
| ## Open Questions | ||
|
|
||
| - Should `snippets` default stay `exclude` or eventually move to `include`? | ||
| - Should revision-only alias fallback remain permissive or become strict over time? | ||
| - Which SDK/client versions require explicit compatibility/deprecation communication? | ||
| - What is the minimum telemetry period before deciding on deprecation milestones? | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,176 @@ | ||||||||||||||||||||||
| # PRD: Composable Config Embedding + Snippets Profile | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Status: draft | ||||||||||||||||||||||
| Owner: TBD | ||||||||||||||||||||||
| Last updated: 2026-02-11 | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Product Intent | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Enable composable configurations where teams can define reusable building blocks once (instructions, guardrails, model presets, schemas, tool settings, message snippets, subagent configs), commit and test them independently, and compose them by reference into higher-level configurations. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Composition must support both pinned-version references and floating/latest references, with clear UX to inspect and safely change what is being referenced. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Context and Opportunity | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Teams want to: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - centralize shared configuration content instead of copy/pasting across apps, | ||||||||||||||||||||||
| - evolve nested pieces independently with their own lifecycle, | ||||||||||||||||||||||
| - compose larger behaviors from smaller tested components, | ||||||||||||||||||||||
| - choose whether a reference tracks latest or a specific version. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| This is not only for snippet-like text content; it applies to any reusable configuration object. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Problem Statement | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Without a productized embedding system, users cannot reliably compose configurations across string and JSON contexts with predictable dereferencing, insertion, and resolution semantics. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| Without strong reference UX, users also cannot safely understand or change composition over time: | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| - they need to see the reference itself and what it resolves to, | ||||||||||||||||||||||
| - they need to compare current target vs candidate target before applying a change, | ||||||||||||||||||||||
| - they need multiple views for editing/debugging (raw/pretty, resolved/unresolved). | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Scope Split (Design Framing) | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Track A: Embedding System | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| A product-level contract for reference declaration, selector semantics, dereference, insertion, and resolution for any embeddable configuration object. | ||||||||||||||||||||||
|
|
||||||||||||||||||||||
| ## Track B: Snippets Profile | ||||||||||||||||||||||
|
Comment on lines
+36
to
+40
|
||||||||||||||||||||||
| ## Track A: Embedding System | |
| A product-level contract for reference declaration, selector semantics, dereference, insertion, and resolution for any embeddable configuration object. | |
| ## Track B: Snippets Profile | |
| ### Track A: Embedding System | |
| A product-level contract for reference declaration, selector semantics, dereference, insertion, and resolution for any embeddable configuration object. | |
| ### Track B: Snippets Profile |
Copilot
AI
Feb 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The document structure has inconsistent heading levels. Sections "A) Generic Embedding System Requirements", "B) Reference UX Requirements", and "C) Snippets Profile Requirements" (lines 79, 103, 119) appear as level-2 headings (##) but are subsections of "Product Requirements" (line 77). Consider changing these to level-3 headings (###) for better document hierarchy.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # Snippets Design Docs | ||
|
|
||
| Status: draft | ||
| Last updated: 2026-02-11 | ||
|
|
||
| ## Purpose | ||
|
|
||
| This folder contains iterative design docs for the `poc/snippets-using-legacy-apps` work. | ||
| The branch uses older naming and entities in several places; these docs focus on intent and direction rather than strict legacy naming fidelity. | ||
|
|
||
| ## Documents | ||
|
|
||
| - `PRD.md`: product goals, user problems, requirements, and success criteria. | ||
| - `RFC.md`: technical contract, including snippet embed format, dereferencing, and resolver behavior. | ||
| - `PR.md`: draft pull request narrative/checklist for implementation review. | ||
|
|
||
| ## Where To Find Snippet Format | ||
|
|
||
| - Canonical format and resolver contract: `RFC.md` -> `Snippet Format (Normative for This Branch)` | ||
|
|
||
| ## Scope | ||
|
|
||
| - Define how "snippets" should behave as first-class artifacts. | ||
| - Preserve backward compatibility with legacy "application" terms and flows where needed. | ||
| - Capture unresolved decisions to drive follow-up iterations. | ||
|
|
||
| ## Open Questions | ||
|
|
||
| - Should "snippet" eventually replace "application" in all user-visible surfaces, or remain an alias? | ||
| - Do we want a hard migration timeline away from legacy entities, or long-term dual support? | ||
| - Which compatibility guarantees are required for existing API clients and SDK users? |
Uh oh!
There was an error while loading. Please reload this page.