# Changelog

## 0.9.0 — One faithful engine: generator convergence (Phase 4c)

Phase 4c completes the faithful-port: the six standalone `/assets/*`
generators (release-notes, architecture-walkthrough, changes-since,
onboarding-doc, refactoring-report, ask) now run through the ONE faithful
`runForgeGeneration` engine. The parallel `forgesmith/src/generators/*` engine
surface is no longer the product's generation path — FORGE runs one engine,
faithful to the original Atlas FORGE's single-engine design.

### Added
- **Generator templates** — `lib/forge/generatorTemplates.ts` expresses each
  of the six generators as engine config: a `sections`-shaped `ForgeTemplate`
  with a 4-axis tuple (channel × audience × intent × format + modality),
  exactly as the original FORGE shaped every content type. `LocalForgeStorage`
  seeds all six alongside the 8 bundled fixtures + 2 presentation templates
  (idempotent backfill for pre-Phase-4c projects).
- **Generator signal adapters** — `lib/forge/generatorSignal.ts` builds a
  generator-specific `brief` signal for each generator (walkthrough leads with
  the architectural core, refactoring-report with coupling hot spots + import
  cycles, onboarding-doc with folders + entry points, release-notes with what
  shipped). AMBER + GREEN layer context folds in as in Phase 4b.
- **Sections renderer** — `lib/forge/sectionsRender.ts` renders the engine's
  schema-validated section JSON back into the single markdown `text` blob the
  Free-tier `/assets/*` UI expects. Behind-the-scenes convergence — the UX is
  unchanged.
- **Shared engine runner** — `lib/forge/generatorEngineRun.ts` is the thin
  glue every `/assets/*` route now calls: persist signal → `runForgeGeneration`
  → render sections → report token usage (via a token-capturing provider).

### Changed
- All six `app/api/forge/*/route.ts` generator routes now produce their output
  by calling `runForgeGeneration` — the bespoke `generateReleaseNotes`,
  `generateArchitectureWalkthrough`, `generateChangesSince`,
  `generateOnboardingDoc`, `generateRefactoringReport` and
  `generateAskDrivenAsset` pipelines are retired. No app code imports the
  `forgesmith/src/generators/*` layer any more.
- release-notes additionally supports the `git_range` faithful path (the
  original FORGE sourced release notes from git_range signals).
- Free-tier generation quota, watermark, and tier gating behavior unchanged.

## 0.8.0 — Presentations, AMBER + GREEN, Git-log (Phase 4b)

Three pieces to reach original-FORGE parity, all on the faithful
`runForgeGeneration` engine — no engine changes, only the input layer.

### Added
- **Presentations** — `lib/forge/presentationTemplates.ts` ports the original
  Migration-029 templates `presentation_single` (single 16:9 / 1920×1080 slide)
  and `presentation_deck` (3–10 slide deck, per-slide widgets, animated).
  `LocalForgeStorage` seeds both alongside the 8 bundled fixtures (idempotent
  backfill for pre-Phase-4b projects). Decks are a generatable, schema-validated
  output kind — `validateAgainstTemplateSchema` checks the `slides` shape, and
  `buildDeckSlideWidgets` derives one per-slide widget per slide.
- **AMBER + GREEN consumption** — `lib/forge/amberLayer.ts` /
  `lib/forge/greenLayer.ts` read `.prism/blueprint/amber-layer.json` (business
  capabilities) and `green-layer.json` (cross-layer insights). Faithful ports
  of the original `amberCapabilityRef` / `greenInsightRef` resolvers (same
  `renderAmberCapabilityBlock` / `renderGreenInsightBlock` / claim-derivation
  shape), adapted to the explorer-written file contract.
  `lib/forge/layerContext.ts` folds capability docs + cross-layer insight
  summaries into the `brief` signal body, so they enter the grounded
  ProductTruth claims that shape generation.
- **Git-log input** — `lib/forge/gitSummary.ts` is a faithful port of the
  original `git-summary/runner.ts` (read-only `git log` + `git diff --stat`,
  arg-sanitised, 3 s timeout). `POST /api/forge/generate` accepts an optional
  `gitRange` — when set, the engine generates from a `git_range` signal
  (release notes from a commit range) instead of the BLUE blueprint. The
  `git_range` signal kind was already in the types but unreachable; this makes
  it work. `/forge/engine` exposes from/to ref inputs.

### Notes
- The faithful engine (`runForgeGeneration`) is **unchanged** — it is a pure,
  storage-adapter engine in the npm `forgesmith` package. The original engine
  resolved AMBER/GREEN inside the engine and injected Markdown via the prompt's
  `contextBlocks`; the standalone resolves them in the app layer and routes
  them through the signal body, which lands in the same assembled user prompt.
- No live AI was exercised for Phase 4b verification: the `~/vector` project
  has no Settings API key configured. Verification ran structurally with a
  mock provider against `~/vector`'s real BLUE + AMBER + GREEN layers and real
  git history — engine + grounding are exact, only the model call is mocked.

## 0.7.0 — Faithful FORGE Engine (Phase 4a)

### Added
- **`/forge/engine` + `/api/forge/generate`** — the faithful FORGE pipeline is
  now a live product path. Runs `runForgeGeneration` from `forgesmith`:
  signal → distill → schema-prompt → validate → persist, over the 4-axis model
  (channel × audience × intent × format). Output is schema-validated JSON shaped
  by a `forge_template`, not free text. Includes an honest dry-run mode.
- **`lib/forge/blueprintSignal.ts`** — Blueprint → `ForgeSignal` adapter. Reads
  the BLUE blueprint (`.prism/blueprint/snapshot.json`), normalizes it into a
  fully-shaped object (no `undefined`/`NaN`/zeroed fields — recomputes
  `categories` from `files[].category` when the snapshot ships a zeroed block),
  and renders a grounded, fact-only `brief` signal that `distill()` consumes.
- The faithful engine persists `ForgeOutput` rows to local `.forge/outputs/`
  via the existing `LocalForgeStorage` — no database introduced.

### Notes
- The `/assets/*` generators (`release-notes`, `ask`, `architecture-walkthrough`,
  …) are unchanged and remain the Free-tier surface. The new engine path is
  additive — the template/audience CRUD pages now drive a live generation path.
- AI calls use the Settings/keychain API key via `DirectLlmProvider`, never
  `process.env` for the model key.

## 0.6.0 — Launch Polish + Full Feature Set (#6-#8)

### Added
- **`/forge/from-prism`** — Prism blueprint integration (Feature #6): auto-detects `.prism/` blueprint, 5 generation presets, focus picker, auto-poll every 5s. Simple + Expert dual-view. Spectrum: zone tree, context inspector, expert prism view.
- **`/assets/history` + Refine Chat** — Content history extension (Feature #7): append-only asset versioning, inline LLM refine chat with 8 suggestion chips (1 free refine / unlimited Pro). Version drawer with line diff, revert. Spectrum: side-by-side diff, multi-version compare, system-prompt toggle.
- **`/forge/schedule`** — Content calendar (Feature #8): local-only schedule (no auto-posting), drag-to-reschedule, cascading bulk scheduling from dispatch. Export: Buffer CSV, iCalendar, Hypefury CSV (Spectrum). 5-entry free limit, unlimited Pro.
- **`/api/forge/schedule`** routes — GET/POST/PATCH/DELETE + bulk + export endpoints.
- **4 new feature gates**: `canViewAssetVersionHistory`, `canRefineAsset`, `canScheduleEntry`, `canExportSchedule`, `canUseCalendarView`, `canUseExpertScheduleFeatures`.
- **`robots.txt`** — SEO: allows `/` and `/pricing`, blocks `/settings` and `/api/`.
- **`/sitemap`** — Next.js file-based sitemap for forge0x2b.dev.
- **Custom 404** — friendly not-found page replacing Next.js default.

### Fixed
- Settings page: API key input hidden on marketing/demo host (Vercel/forge0x2b.dev).
- `POST /api/config` returns 403 on marketing host (prevents config mutation from public URL).
- Smell-test clean: removed all "Atlas Design System" references from design-token comments; renamed `ATLAS` color token → `PLATFORM`; moved `lib/atlas/` → `lib/design-tokens/`.

### Dependencies
- `forgesmith` bumped to `^0.6.0`

## 0.5.0 — Asset History + Ask-Driven Generation

### Added
- **`/assets/ask`** — ask-driven content generator: enter any natural-language question about your codebase and get a grounded response in 6 formats (markdown, blog, social, email, slack, slide) across 4 tones (professional, casual, technical, executive). Powered by `forgesmith.generateAskDrivenAsset` + Blueprint dependency graph.
- **`/assets/history`** — browse all previously generated assets, sortable by date, filterable by type. One-click delete.
- **`/assets/history/[id]`** — asset detail view with Copy, Download (.md), Regenerate (reruns with same opts), and Delete actions.
- **`/api/forge/ask`** — POST endpoint for ask-driven generation; free-trial counter applies; saves to `.forge/assets/ask/<id>.json`.
- **`/api/forge/assets`** — GET endpoint listing all assets from `.forge/assets/` across all type directories.
- **`/api/forge/assets/[id]`** — GET/DELETE for individual assets.
- **Dashboard**: Ask + Asset History cards added to `DashboardHome` grid.
- **Landing**: 6th asset type "Ask" added to showcase grid; heading updated to "6 ways to narrate your codebase".

### Dependencies
- `forgesmith` bumped to `^0.3.0`

## 0.4.0 — Marketing Landing + Pricing Page + Vercel Deploy

### Added
- **Marketing landing page** — full-featured with Hero, Pair Story, Asset Types showcase, How it Works, Pricing snippet, FAQ, and CTA sections. Renders on `*.vercel.app` / `forge0x2b.dev` via `useDemoMode` context detection.
- **`/pricing` route** — 3-tier comparison (Free / forge0x2B Pro / Spectrum 0x55 Bundle), monthly/yearly toggle (−17% yearly), full feature comparison table, billing FAQ.
- **Context detection** — `app/page.tsx` renders `MarketingLanding` on hosted URLs, `DashboardHome` on localhost. Zero routing changes needed.
- **OG image** — `app/opengraph-image.tsx` generates copper-themed 1200×630 social card.
- **SEO metadata** — full `Metadata` object in `app/layout.tsx`: title, description, keywords, OpenGraph, Twitter card, robots.
- **Cross-product links** — landing links to prism0x2A, Spectrum Bundle CTAs throughout.
- **`DashboardHome` component** — extracted from previous `app/page.tsx` into `components/dashboard/DashboardHome.tsx`.
- **`MarketingLanding` component** — `components/landing/MarketingLanding.tsx` with copy button on install command.

## 0.2.0 — Lemonsqueezy Integration + Free-Trial Counter

### Added

- **Lemonsqueezy license validation** — port from prism0x2A v0.7.1, adapted for forge-specific tiers
- **5-state Settings License Section** — free (with trial counter) / activating / active / error / loading
- **Free-trial counter** — 3 generations per installation tracked in `.forge/usage.json`
- **Watermark on free-tier content** — appended to generated text for free users
- **Upgrade CTAs** — shown at trial-limit on both Settings and /assets/release-notes pages
- **`POST /api/forge/release-notes`** — now tier-gated: returns 402 when free trial exhausted
- **`GET /api/license`** + **`POST /api/license/activate`** + **`POST /api/license/validate`** + **`POST /api/license/deactivate`** — full LS license management
- **`GET /api/usage`** — trial counter endpoint
- **Lemonsqueezy client** (`lib/forge/lemonsqueezy/client.ts`) — activate/validate/deactivate
- **Tier mapping** (`lib/forge/lemonsqueezy/tierMapping.ts`) — forge-specific: only forge0x2B Pro + Spectrum 0x55

### Pricing

- Free: 3 trial generations (with watermark)
- forge0x2B Pro: €29/m — unlimited, no watermark (LS product 1066668)
- Spectrum 0x55 Bundle: €49/m — forge + prism0x2A Pro (LS product 1066695)

## 0.1.0 — Real implementation (bumped from 0.0.1 stub)

- Next.js 16 dashboard with forge brand (copper/orange accents, JetBrains Mono for `0x2B`)
- Landing page with navigation
- `/settings` — Anthropic API key + prism folder path configuration
- `/assets/release-notes` — generate release notes via forgesmith
- `GET /api/config` + `POST /api/config` — config API
- `POST /api/forge/release-notes` — generation API
- `.forge/config.json` persistence (chmod 600)
- `.forge/assets/release-notes/` — asset history
- `bin/forge.js` CLI — `forge dev|init|--version|--help`
- License foundation skeleton (free/forge-pro/spectrum tiers)
