Skip to content

Commit 1fb020d

Browse files
committed
sync(bfmono): feat(gambit): align scaffolds with product command and hourglass policies (+19 more) (bfmono@cae381f00)
This PR is an automated gambitmono sync of bfmono Gambit packages. - Source: `packages/gambit/` - Core: `packages/gambit-core/` - bfmono rev: cae381f00 Changes: - cae381f00 feat(gambit): align scaffolds with product command and hourglass policies - 5faa48b35 feat(gambit): move bot policy to folder and enforce policy summarizer flow - 9a36c4a7e fix(gambit): align env loading with init and block .gambit env writes - dbe7c54ca feat(gambit-bot): add file actions and scenario deck structure - 855784d6b docs(gambit): add public permissions guide and API jsdoc - 8f0ca0a85 feat(gambit): trace effective permission layers at runtime - 90b4b5071 feat(gambit-core): add phase-1 permission contract primitives - df9280f6a fix(gambit): restore build-bot deck path compatibility - daca46555 feat(simulator-ui): wire build, test, and grade to workspace sessions - e404a17d7 feat(gambit): add workspace-backed serve and bot sandbox flow - 5f4fa86b9 feat(gambit): scaffold workspace defaults in init - cf9b23778 feat(gambit-core): add schema guards and model param passthrough - d0e5a9617 [gambit] move chat message into transcript so it scrolls - 5c6125d99 feat(simulator-ui): open workbench drawer by default - 7c9cd05f8 feat(simulator): gate chat accordion by env flag - a2599068e feat(simulator-ui): add build chat history loading - 9911dae22 feat(simulator-ui): add workbench chat drawer accordion - 8cab8ec1f feat(simulator-ui): dock calibrate drawer and sync updates - d41ba101d Add AAR for phase 3.1.5 deck format build tab - b1b5e2a7e Prefer PROMPT.md after build scaffolds Do not edit this repo directly; make changes in bfmono and re-run the sync.
1 parent 300467a commit 1fb020d

5 files changed

Lines changed: 114 additions & 3 deletions

File tree

src/decks/gambit-bot/policy/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ Use this folder as the policy source of truth for Gambit Bot.
1212
creation).
1313
- [`safety-reliability.md`](./safety-reliability.md): Safety checks and fallback
1414
behavior when workflows may break or model/runtime setup is invalid.
15+
- [`product-command.md`](./product-command.md): Product Command operating rules
16+
for deck creation and updates (ship small, focus impact, keep structure
17+
stable).
18+
- [`hourglass.md`](./hourglass.md): How to apply Hourglass structure when
19+
creating or updating `PROMPT.md`, especially system prompt/body sections
20+
(`Assistant Persona`, `User Persona`, `Behavior`).
1521
- [`frontmatter-guardrails.md`](./frontmatter-guardrails.md): Rules and
1622
checklist for safe frontmatter and schema editing.
1723
- [`deck-format-1.0.md`](./deck-format-1.0.md): Full Deck Format v1.0
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Hourglass Policy
2+
3+
## Purpose
4+
5+
- Define how Gambit Bot should structure prompt guidance so behavior is
6+
predictable and easy to edit.
7+
- Keep deck prompts understandable by separating broad context from strict
8+
execution constraints.
9+
- Ensure updates preserve a clear "narrow middle" where tool usage, formatting,
10+
and step-by-step behavior are unambiguous.
11+
12+
## Policy
13+
14+
- Use Hourglass structure for bot authoring guidance:
15+
- Wide context: assistant/user framing.
16+
- Narrow middle: concrete behavior constraints, tool rules, output
17+
requirements.
18+
- Controlled widen-out: practical response guidance for the user.
19+
- Keep the narrow middle explicit and actionable (numbered steps, hard
20+
constraints, escalation conditions).
21+
- When updating prompts, preserve clarity of the narrow middle before expanding
22+
persona/detail sections.
23+
- For deck edits that touch behavior, ensure policy summaries include how the
24+
"narrow middle" should change (or remain stable).
25+
26+
- `Assistant Persona` (wide context):
27+
- Define who the assistant is, its core goals, and tone boundaries.
28+
- Keep this stable so behavior changes do not rewrite identity each time.
29+
- `User Persona` (wide context):
30+
- Describe who the user is, what they are trying to achieve, and key fears or
31+
constraints.
32+
- Use this to guide prioritization and language, not to add execution rules.
33+
- `Behavior` (narrow middle):
34+
- Define concrete steps, decision rules, tool usage expectations, and output
35+
constraints.
36+
- This is the most important control surface; keep it specific, testable, and
37+
easy to diff.
38+
39+
Tooling note:
40+
41+
- `[[actions]]` in frontmatter defines which tools are available to the deck.
42+
- Those tool definitions are populated automatically into the runtime tool set.
43+
- Do not duplicate full tool inventories in the initial system/body prompt
44+
unless there is a specific reason to add extra guardrails for one tool.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Product Command Policy
2+
3+
## Purpose
4+
5+
- Keep Gambit Bot aligned with Product Command for deck creation and updates.
6+
- Prioritize user-visible progress, fast iteration, and clear deck structure.
7+
8+
## Policy
9+
10+
- Build less, ship more:
11+
- Prefer the smallest runnable change that advances the user's goal.
12+
- Avoid speculative abstractions or broad rewrites unless requested.
13+
- Focus on impact:
14+
- Prioritize edits that improve user-facing bot behavior and reliability.
15+
- Defer non-blocking internal cleanup when it does not unblock shipping.
16+
- Keep Deck Format v1.0 structure stable:
17+
- `PROMPT.md` remains canonical.
18+
- `INTENT.md` and `policy/*.md` are guidance surfaces, not executable prompts.
19+
- Be explicit about tradeoffs:
20+
- Call out what is intentionally deferred.
21+
- Escalate only when safety/reliability or format correctness is at risk.
22+
23+
Every `INTENT.md` should explicitly answer these 8 questions:
24+
25+
1. `Purpose`: Why does this scope exist?
26+
2. `End State`: What conditions define success?
27+
3. `Constraints`: What must not happen?
28+
4. `Tradeoffs`: Which decisions are already made?
29+
5. `Risk tolerance`: How bold can this effort be?
30+
6. `Escalation conditions`: When should we pause or escalate?
31+
7. `Verification steps`: What signals/commands prove success?
32+
8. `Activation / revalidation`: When does this intent start/stop governing
33+
decisions, and what triggers review?
34+
35+
`INTENT.md` maintenance expectations:
36+
37+
- `INTENT.md` should match the user's stated goals, constraints, risk posture,
38+
and success criteria as they are expressed in the session.
39+
- Treat `INTENT.md` as a living alignment artifact expected to change frequently
40+
during build/edit loops, not a one-time static document.
41+
42+
## Application to deck updates
43+
44+
- If a default scaffold echo bot is detected, overwrite it by default unless the
45+
user asks to preserve it.
46+
- Prefer iterative edits over multi-file rewrites when both can satisfy the
47+
request.
48+
- Keep scenario/grader coverage runnable after each substantial change.

src/decks/gambit-init.deck.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ Rules:
4040

4141
- Keep the conversation lightweight and opinionated.
4242
- Use Deck Format 1.0 (`PROMPT.md` with TOML frontmatter).
43+
- Use Hourglass structure in the root `PROMPT.md` body:
44+
1. assistant persona context,
45+
2. user persona context,
46+
3. explicit behavior constraints/steps (the narrow middle).
4347
- Do not overwrite existing files; rely on tool errors if a path exists.
4448
- Create `scenarios/default/` and `graders/default/` with `mkdir` before writing
4549
files.

src/workspace.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,18 @@ description = "Simple grader to start."
3939
4040
You are the default deck for a new Gambit workspace.
4141
42-
Rules:
42+
## Assistant Persona
43+
44+
- You are a practical starter assistant for quickly validating the workspace
45+
loop.
46+
- You keep responses plain and easy to replace as the bot evolves.
47+
48+
## User Persona
49+
50+
- The user is trying to confirm the deck runs end-to-end before customizing.
51+
- They want predictable behavior and clear output.
52+
53+
## Behavior
4354
4455
- If the conversation does not yet contain a user utterance, reply exactly
4556
"Welcome to Gambit! What should we build?"
@@ -136,15 +147,13 @@ export async function createWorkspaceScaffoldAtRoot(
136147

137148
const rootDeckPath = path.join(resolvedRoot, "PROMPT.md");
138149
const intentPath = path.join(resolvedRoot, "INTENT.md");
139-
const policyPath = path.join(resolvedRoot, "POLICY.md");
140150
const scenariosDir = path.join(resolvedRoot, "scenarios", "default");
141151
const gradersDir = path.join(resolvedRoot, "graders", "default");
142152
const scenarioPromptPath = path.join(scenariosDir, "PROMPT.md");
143153
const graderPromptPath = path.join(gradersDir, "PROMPT.md");
144154

145155
await ensureEmptyPath(rootDeckPath);
146156
await ensureEmptyPath(intentPath);
147-
await ensureEmptyPath(policyPath);
148157
await ensureEmptyPath(scenarioPromptPath);
149158
await ensureEmptyPath(graderPromptPath);
150159

0 commit comments

Comments
 (0)