Skip to content

Commit 5348d27

Browse files
committed
Update ad generation logic to support company and product concepts. Adjusted the ad run structure to include a minimum of three company ads followed by one to three product ads. Enhanced documentation to reflect changes in ad generation, including updates to the README and context definitions. Updated package dependencies for improved functionality.
1 parent 27bb8b3 commit 5348d27

24 files changed

Lines changed: 1741 additions & 382 deletions

‎CONTEXT.md‎

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,36 @@
11
# Branda
22

3-
Branda turns one Brand domain into a fixed Ad Run of on-brand images. This glossary names the planning, rendering, and Gallery concepts shared by the browser and server modules.
3+
Branda turns one Brand domain into a bounded Ad Run of on-brand company and Product images. This glossary names the planning, rendering, and Gallery concepts shared by the browser and server modules.
44

55
## Language
66

77
**Brand**:
88
The organization or product whose public site supplies the identity and source material for an Ad Run.
99

1010
**Brief**:
11-
The normalized Brand facts and descriptive visual attributes used throughout one Ad Run.
11+
The normalized Brand facts and descriptive visual attributes used throughout one Ad Run. Its palette comes from the extracted styleguide, and its font family is present only when the styleguide identifies a referenced Google Font.
1212
_Avoid_: Prompt, brand data
1313

14+
**Product**:
15+
A distinct offering fact-grounded in the Brand's public site. Products are extracted through Context.dev `web.extract` using JSON Schema generated from a Zod schema.
16+
_Avoid_: Invented offering, generic product
17+
1418
**Creative Direction**:
1519
A named visual treatment with a dedicated prompt implementation.
1620
_Avoid_: Style, template
1721

1822
**Planned Concept**:
19-
One Creative Direction paired with Brand-grounded copy and an Image Model for an Ad Slot.
23+
One Creative Direction paired with fact-grounded copy, a company-or-Product subject, and an Image Model for an Ad Slot.
2024
_Avoid_: Creative Direction
2125

26+
**Company Planned Concept**:
27+
A Planned Concept whose subject is the Brand as a company.
28+
29+
**Product Planned Concept**:
30+
A Planned Concept whose subject is one extracted Product.
31+
2232
**Ad Run**:
23-
A set of exactly six Planned Concepts generated together from one Brief.
33+
An ordered set of four to six Planned Concepts generated together from one Brief: exactly three Company Planned Concepts followed by one to three Product Planned Concepts for distinct Products.
2434
_Avoid_: Campaign, batch
2535

2636
**Ad Slot**:
@@ -35,21 +45,25 @@ A catalogued image generator with a placement tier and declared raster-logo capa
3545
_Avoid_: Provider
3646

3747
**Gallery**:
38-
The browser view of an Ad Run and the current state of its six Ad Slots.
48+
The browser view of an Ad Run and the current state of its four to six Ad Slots.
3949

4050
## Relationships
4151

42-
- A **Brand** supplies exactly one **Brief** for an **Ad Run**.
43-
- An **Ad Run** contains exactly six distinct **Planned Concepts**.
52+
- A **Brand** supplies exactly one **Brief** and one to three distinct extracted **Products** for an **Ad Run**.
53+
- An **Ad Run** contains exactly three **Company Planned Concepts** followed by one to three **Product Planned Concepts**.
54+
- Each **Product Planned Concept** targets a different extracted **Product**.
4455
- A **Planned Concept** selects exactly one **Creative Direction** and one **Image Model**.
56+
- Every **Planned Concept** in an **Ad Run** uses a distinct **Creative Direction** and **Image Model**.
57+
- The three **Company Planned Concepts** use the three primary **Image Models**; the **Product Planned Concepts** use one to three secondary **Image Models**.
4558
- Each **Planned Concept** owns exactly one **Ad Slot**.
4659
- An **Ad Slot** may produce one **Rendered Ad** at a time.
4760
- A **Gallery** presents exactly one active **Ad Run**.
4861

4962
## Module map
5063

51-
- `src/lib/ad-run-policy.ts` owns the fixed Ad Run size and shared field limits.
64+
- `src/lib/ad-run-policy.ts` owns Ad Run composition, ordering, and shared field limits.
5265
- `src/lib/ad-run.ts` owns Ad Run validation and canonical HTTP codecs.
66+
- `src/lib/context.ts` owns Context.dev Brand/styleguide research and fact-grounded Product extraction through `web.extract` and a Zod-derived JSON Schema.
5367
- `src/lib/generate/planner.ts` owns Brand research policy and produces validated Ad Runs.
5468
- `src/lib/generate/renderer.ts` owns Image Model retry and raster-logo downgrade behavior.
5569
- `src/lib/public-raster.ts` owns DNS-pinned loading of untrusted public raster URLs.
@@ -58,9 +72,10 @@ The browser view of an Ad Run and the current state of its six Ad Slots.
5872
## Example dialogue
5973

6074
> **Dev:** "Can two Ad Slots in an Ad Run use the same Creative Direction?"
61-
> **Domain expert:** "No. Every Planned Concept uses a distinct Creative Direction and Image Model, although a failed Ad Slot may retry its same plan."
75+
> **Domain expert:** "No. Every Planned Concept uses a distinct Creative Direction and Image Model. The first three advertise the company with primary models; the remaining one to three each advertise a distinct extracted Product with secondary models. A failed Ad Slot may retry its same plan."
6276
6377
## Flagged ambiguities
6478

6579
- "concept" previously meant both a reusable visual treatment and a run-specific plan; use **Creative Direction** for the reusable treatment and **Planned Concept** for the copy-and-model assignment.
6680
- "creative" previously meant both a plan and its image; use **Planned Concept** before rendering and **Rendered Ad** after rendering.
81+
- "product" means a fact-grounded **Product** extracted from the Brand's site, not a generic object inferred solely for an image composition.

0 commit comments

Comments
 (0)