Skip to content

Commit 997202f

Browse files
committed
sync(bfmono): docs(gambit): align snippet terminology and publish migration post (+19 more) (bfmono@e59c46b74)
This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit/packages/gambit-core/` - bfmono rev: e59c46b74 Changes: - e59c46b74 docs(gambit): align snippet terminology and publish migration post - 32c05988a chore(gambit): migrate demo and docs built-in URIs to snippets - 0c3283e87 chore(gambit): rename legacy action/test deck keys in examples and docs - e6cee968d chore(gambit-examples): adopt scenario participant snippet in user-turn decks - 898e776f0 feat(gambit): add scenario participant snippet and scaffold adoption - e61fcaa4e feat(gambit-simulator): add previous test run selectors for test and grade - 4f0a61e0c fix(gambit): keep blank test runs and allow assistant starts in a workspace - 5663a6c3e fix(gambit-simulator): prevent overlapping test status polls - c7a262c7d fix(gambit): enable unstable worker options in gambit-core CI tests - 5660b3269 test(gambit): harden codex cli test command config - a9d5438f9 chore(gambit): cut 0.8.5-rc.1 release - d6a149451 test(gambit): harden codex smoke + build stop tests - 6c76075fa fix(gambit-serve): root workspace state in invocation directory - de75a3987 feat(gambit): ship faq openresponses interoperability updates - 11e0477a3 fix(gambit-sim): default test init when workspace has no saved messages - 14df328c7 test(gambit-simulator): cover test tab JSON input gating and payload wiring - 2e833821c feat(gambit-simulator): switch test tab schema inputs to JSON-only - 126087519 fix(simulator-ui): keep activity toggle visible and prevent collapse jump - 0c0366932 feat(simulator-ui): add test chat actions activity card parity - 72bb726e5 fix(gambit): guard artifact restore typing and stabilize reset-abort test Do not edit this repo directly; make changes in bfmono and re-run the sync.
1 parent 1ddf78b commit 997202f

76 files changed

Lines changed: 125 additions & 124 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/external/concepts/hourglass.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ the needed context and tone.
2020

2121
## Applying to Gambit
2222

23-
- Use separate cards for assistant persona, user persona, and behavior; embed
23+
- Use separate snippets for assistant persona, user persona, and behavior; embed
2424
them into the deck body to keep concerns isolated.
2525
- Keep the “pinch” (behavior/constraints) closest to the model call, and keep
2626
personas above it so they influence style without diluting instructions.
@@ -29,11 +29,11 @@ the needed context and tone.
2929
- Keep schemas tight so actions/tools stay aligned with the narrow middle of the
3030
hourglass.
3131

32-
## Skeleton (deck + cards)
32+
## Skeleton (deck + snippets)
3333

3434
```
3535
src/decks/
36-
gambit-assistant.deck.md # root deck embeds the cards below
36+
gambit-assistant.deck.md # root deck embeds the snippets below
3737
cards/
3838
assistant_persona.card.md # who the assistant is
3939
user_persona.card.md # who the user is / goals / constraints
@@ -42,15 +42,15 @@ src/decks/
4242

4343
Deck body outline:
4444

45-
1. Assistant persona card content.
46-
2. User persona card content.
47-
3. Behavior card content: steps/constraints/output shape.
45+
1. Assistant persona snippet content.
46+
2. User persona snippet content.
47+
3. Behavior snippet content: steps/constraints/output shape.
4848
4. (Optional) Examples or edge cases.
4949

5050
## Tips
5151

5252
- Keep the behavior “pinch” short and specific; move narrative/tone into persona
53-
cards.
53+
snippets.
5454
- Declare turn order explicitly (assistant-first vs. user-seeded message).
5555
- Use numbered steps and bullets; avoid long prose in the middle section.
5656
- When adding tools/actions, restate when to call each and what to return after

docs/external/concepts/runtime.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ safe/observable.
2121
- `gambit_context`: sent once when `--context` (formerly `--init`) is provided;
2222
payload is the raw input. Useful for assistant-first flows so the model can
2323
read input without a user turn. `gambit_init` remains as a deprecated alias.
24-
- `gambit_respond`: enable with the `gambit://cards/respond.card.md` marker in
24+
- `gambit_respond`: enable with the `gambit://snippets/respond.md` marker in
2525
Markdown (or `respond: true` in TypeScript decks). Required for LLM decks that
2626
should finish with a structured envelope
2727
`{ payload, status?, message?, code?, meta? }`.
2828
- `gambit_complete`: emitted automatically for child completions and handled
2929
errors so the parent can see
3030
`{ runId, actionCallId, source, status?, payload?, message?, code?, meta? }`.
31-
- `gambit_end`: enable with `![end](gambit://cards/end.card.md)` in Markdown (or
31+
- `gambit_end`: enable with `![end](gambit://snippets/end.md)` in Markdown (or
3232
`allowEnd: true` in TypeScript decks). Calling it returns a sentinel
3333
`{ __gambitEnd: true, payload?, status?, message?, code?, meta? }` so
3434
CLI/scenario loops stop reinjecting the closing assistant turn.

docs/external/examples/agent_with_multi_actions.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ What it shows
44

55
- Routing agent that picks exactly one tool from a mixed set of TS/MD child
66
decks.
7-
- Cards contribute action decks and schema fragments that merge into the root
7+
- Snippets contribute action decks and schema fragments that merge into the root
88
deck.
99

1010
Key files
1111

1212
- `init/examples/advanced/agent_with_multi_actions/agent_with_multi_actions.deck.md`
1313
— root LLM router with brevity rules.
1414
- `init/examples/advanced/agent_with_multi_actions/actions/cards/*.card.md`
15-
cards declare action decks/labels/descriptions.
15+
snippets declare action decks/labels/descriptions.
1616
- `init/examples/advanced/agent_with_multi_actions/actions/decks/*` — child
1717
decks (TS compute and MD LLM) with Zod schemas.
1818
- `init/examples/advanced/agent_with_multi_actions/schemas/*` — shared
1919
input/output schemas for tool calls.
2020

2121
Why it’s structured this way
2222

23-
- Action cards keep action-deck definitions close to their prompts and schemas;
24-
the loader merges them so the model sees a unified tool list.
23+
- Action snippets keep action-deck definitions close to their prompts and
24+
schemas; the loader merges them so the model sees a unified tool list.
2525
- Clear descriptions + strict schemas bias the model toward the right action and
2626
payload shape.
2727
- Root prompt enforces “exactly one action” to avoid tool-chaining and keeps

docs/external/examples/cold_emailer.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ Key files
3232
- `init/examples/advanced/cli_cold_emailer/cards/behavior.card.md` — behavior
3333
rules and output format guidance.
3434
- `init/examples/advanced/cli_cold_emailer/cards/send_email.card.md` — action
35-
card for sending the drafted email.
35+
snippet for sending the drafted email.
3636
- `init/examples/advanced/cli_cold_emailer/cards/log_revision_plan.card.md`
37-
action card for logging the revision plan.
37+
action snippet for logging the revision plan.
3838
- `init/examples/advanced/cli_cold_emailer/lookup_profile.deck.ts` — TypeScript
3939
action with hard-coded demo profile data.
4040
- `init/examples/advanced/cli_cold_emailer/schemas/research_input.zod.ts`

docs/external/examples/handlers_md.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
What it shows
44

55
- Busy/idle/error handlers authored in Markdown decks, paired with TS actions.
6-
- Using `gambit://cards/respond.card.md` in an error handler to force structured
6+
- Using `gambit://snippets/respond.md` in an error handler to force structured
77
completion.
88

99
Key files

docs/external/examples/internal_monolog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ without tool calls) before completing its work.
55

66
- `internal_monolog_parent.deck.md`: root deck that calls the child tool and
77
relays its answer.
8-
- `monolog_child.deck.md`: LLM child with the `gambit://cards/respond.card.md`
8+
- `monolog_child.deck.md`: LLM child with the `gambit://snippets/respond.md`
99
marker that first thinks aloud (monolog), then calls a compute action, then
1010
responds.
1111
- `lookup_fact.deck.ts`: simple compute action the child calls.

docs/external/examples/policy_support_bot.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ support bot grounded entirely in a curated FAQ.
77
Key ideas:
88

99
1. **FAQ ingestion**`cards/faq_knowledge.card.md` is the canonical knowledge
10-
base. The Markdown action deck `actions/search_faq.deck.md` reads that card
11-
directly, selects the best entries, and emits structured matches with manual
12-
confidence scores (no external vector store required).
10+
base. The Markdown action deck `actions/search_faq.deck.md` reads that
11+
snippet directly, selects the best entries, and emits structured matches with
12+
manual confidence scores (no external vector store required).
1313
2. **Policy-aware orchestration**`policy_support_bot.deck.md` embeds persona,
14-
grounding, and refusal cards, calls `search_faq`, enforces citation
15-
formatting, and uses `gambit://cards/respond.card.md` with a schema so the
14+
grounding, and refusal snippets, calls `search_faq`, enforces citation
15+
formatting, and uses `gambit://snippets/respond.md` with a schema so the
1616
UI/CLI always receives structured envelopes.
1717
3. **Tests + demos**`tests/faq_dataset.test.ts` guards the FAQ knowledge base
1818
(category headings, IDs, entry counts), while `demo-script.md` lists prompts

docs/external/examples/voice_front_desk.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ What it shows
44

55
- A modular voice receptionist that mirrors a patient call tree: identity,
66
routing, and specialized task decks.
7-
- Persona/behavior cards that encode the architecture (identity behaviors,
7+
- Persona/behavior snippets that encode the architecture (identity behaviors,
88
routing, scheduling/refill/insurance/billing guidance).
99
- Deterministic TypeScript actions for each flow (patient lookup, new-patient
1010
capture, scheduling, results, billing, refills, insurance, FAQs, transfers,
@@ -22,7 +22,7 @@ Key files
2222
identity, routing, scheduling, results, billing, refills, insurance, FAQs,
2323
transfers, and callback logging.
2424
- `init/examples/advanced/voice_front_desk/cards/*.card.md` — persona, identity,
25-
routing, and per-flow behavior cards that each deck imports as needed.
25+
routing, and per-flow behavior snippets that each deck imports as needed.
2626
- `init/examples/advanced/voice_front_desk/actions/*.deck.ts` — deterministic
2727
TypeScript compute decks for patient lookup, new-patient capture,
2828
scheduling_ops, results_lookup, billing_support, refill_ops, insurance_check,
@@ -37,7 +37,7 @@ Why it’s structured this way
3737
- The modular voice architecture keeps the persona focused on the live caller
3838
while dedicated decks handle structured work such as lookup, scheduling,
3939
refills, or insurance.
40-
- Behavior cards keep identity gathering, routing, and per-flow questions
40+
- Behavior snippets keep identity gathering, routing, and per-flow questions
4141
separate, so you can edit the call tree without touching the deck body.
4242
- Deterministic actions make it easy to test scenarios locally; each tool
4343
exposes a narrow schema with predictable outputs that the assistant can read

docs/external/guides/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
Active guides:
44

5-
- Authoring decks and cards: `./authoring.md`
5+
- Authoring decks and snippets: `./authoring.md`

docs/external/guides/authoring.md

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ verification.
88

99
- Decks are single units of work. They can be LLM-powered (via `modelParams`) or
1010
compute-only (via `run`/`execute`).
11-
- Cards are reusable prompt fragments. Embedding cards merges their deck
12-
references (action/test/grader) and schema fragments into the parent deck.
11+
- Snippets are reusable prompt fragments. Embedding snippets merges their deck
12+
references (action/scenario/grader) and schema fragments into the parent deck.
1313
- Action decks are child decks exposed as model tools. Names must match
1414
`^[A-Za-z_][A-Za-z0-9_]*$` and avoid the `gambit_` prefix (reserved).
1515
- Persona/scenario decks may accept free-form user turns. Use the
@@ -19,12 +19,12 @@ verification.
1919

2020
## Pick a format
2121

22-
- Markdown deck/card: great for quick prompt-first flows. Front matter declares
23-
label/model/actions/scenarios/graders/handlers; body is the prompt. Embeds via
24-
image syntax pull in cards or special markers.
25-
- TypeScript deck/card: best when you need compute logic or co-locate schemas.
26-
Export `defineDeck`/`defineCard` with Zod schemas and a `run`/`execute` for
27-
compute decks.
22+
- Markdown deck/snippet: great for quick prompt-first flows. Front matter
23+
declares label/model/actions/scenarios/graders/handlers; body is the prompt.
24+
Embeds via image syntax pull in snippets or special markers.
25+
- TypeScript deck/snippet: best when you need compute logic or co-locate
26+
schemas. Export `defineDeck`/`defineCard` with Zod schemas and a
27+
`run`/`execute` for compute decks.
2828

2929
## Minimal examples
3030

@@ -36,7 +36,7 @@ label = "hello_world"
3636
modelParams = { model = "openai/gpt-4o-mini", temperature = 0 }
3737
+++
3838

39-
![init](gambit://cards/context.card.md) # seed input if provided via CLI
39+
![init](gambit://snippets/context.md) # seed input if provided via CLI
4040

4141
Rules:
4242

@@ -64,8 +64,8 @@ export default defineDeck({
6464

6565
- Non-root decks must declare `contextSchema` and `responseSchema` (Zod). Roots
6666
default to permissive string-ish input/output if omitted.
67-
- Card `contextFragment`/`responseFragment` merge into the deck’s schemas;
68-
deck-level definitions win on conflicts.
67+
- Snippet `contextFragment`/`responseFragment` values merge into the deck’s
68+
schemas; deck-level definitions win on conflicts.
6969
- LLM outputs are validated against `responseSchema`; compute decks validate
7070
returned payloads as well.
7171

@@ -81,7 +81,7 @@ deno run -A packages/gambit/scripts/migrate-schema-terms.ts <repo-root>
8181

8282
- Add action decks in front matter or TS definitions:
8383
`actions = [{ name = "get_time", path = "./get_time.deck.ts" }]`.
84-
- Action decks defined on embedded cards are merged into the deck; duplicates
84+
- Action decks defined on embedded snippets are merged into the deck; duplicates
8585
are overridden by the deck’s own entries.
8686
- In compute decks, call child decks with `ctx.spawnAndWait({ path, input })`.
8787
- In LLM decks, the model chooses action decks via tool calls. Provide clear
@@ -152,15 +152,16 @@ deno run -A packages/gambit/scripts/migrate-schema-terms.ts <repo-root>
152152
`handlers.onError` point to other decks. Inputs are structured (see
153153
`../reference/handlers.md`); errors inside handlers are swallowed.
154154

155-
## Embeds (cards)
155+
## Embeds (snippets)
156156

157-
- In Markdown, use image syntax to embed:
158-
`![behavior](./cards/behavior.card.md)`. Special markers:
159-
`gambit://cards/context.card.md` hints init tool,
160-
`gambit://cards/respond.card.md` injects respond instructions, and
161-
`gambit://cards/end.card.md` enables the `gambit_end` hang-up tool.
162-
- Cards can also be TS files exported with `defineCard`. They may contain
163-
action/test/grader deck references and schema fragments, but no handlers.
157+
- In Markdown, use image syntax to embed snippets:
158+
`![behavior](./cards/behavior.card.md)`. Local snippet files often still live
159+
under `cards/` with a `.card.md` suffix for legacy compatibility. Special
160+
markers: `gambit://snippets/context.md` hints init tool,
161+
`gambit://snippets/respond.md` injects respond instructions, and
162+
`gambit://snippets/end.md` enables the `gambit_end` hang-up tool.
163+
- Snippets can also be TS files exported with `defineCard`. They may contain
164+
action/scenario/grader deck references and schema fragments, but no handlers.
164165

165166
## Running and debugging
166167

0 commit comments

Comments
 (0)