Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PoC/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# 🧪 OpenFoundry PoCs — index

> **Status:** documentation ready. None of the PoCs is being executed yet — we are waiting for the OpenFoundry MVP to reach a viable level. Each PoC is governed by its own Foundry-native contract: user-visible behavior must match how the equivalent workflow would be built in Palantir Foundry. **The PoC dictates the contract; OpenFoundry adapts.**
> **Status (as of 2026-05-21):** documentation ready. None of the PoCs is being executed yet, but **the platform side has moved**: the Phase 1 closure on 2026-05-20 closed B02 (ontology + outbox), B04 (LLM catalog), and the in-scope half of B06 (Iceberg E2E), and largely closed B01 (Workshop backend — `apps` / `app_versions` persistence, publish lifecycle, branch column shipped). The remaining work to put any PoC on a screen is now **PoC-specific content** (ontology materialization, demo Workshop modules, data fixtures, last-mile action-type wiring), **not** platform rewrites. See the *Current severity (post 2026-05-20)* column inside [`aviacion/blockers/README.md`](aviacion/blockers/README.md) and the *Status as of 2026-05-20* sections inside each `B0X-*.md` file for the per-blocker evidence trail. Each PoC is governed by its own Foundry-native contract: user-visible behavior must match how the equivalent workflow would be built in Palantir Foundry. **The PoC dictates the contract; OpenFoundry adapts.**

Each PoC lives in its own folder. The first three follow the 14-document structure (00 → 13) plus an internal `blockers/` directory cataloging the service-level gaps that prevent end-to-end execution today. The fourth and fifth, [`defence-supply-chain/`](defence-supply-chain/) and [`multidomain-cop/`](multidomain-cop/), are **academic** PoCs that target a real Palantir Foundry tenancy (not OpenFoundry) and therefore follow a different `docs/00 → 15` layout — see their READMEs for the rationale.

Expand Down
92 changes: 79 additions & 13 deletions PoC/aviacion/blockers/B01-workshop-backend.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,32 @@
# B01 — Workshop backend (application-composition-service) is a stub

> Severity: **Critical** — blocks PoC Act 4 (Workshop App de aviación).
> Without this backend, the rich React Workshop editor in the frontend has
> no service to persist, version, or publish modules to.
> **Scope revised 2026-05-20.** The earlier framing of this file claimed
> the persistence layer was in-memory and the publish lifecycle did not
> exist. A scrupulous read of the code shows
> `services/application-composition-service/` has 8 Postgres migrations
> (`apps`, `app_versions`, `composition_views`, `app_audit_events`, …),
> 989 LOC in `internal/repo/repo.go`, a real `PublishApp` HTTP handler,
> a public `GetPublishedApp` runtime endpoint, and per-branch isolation
> via migration `20260520120000_app_branches.sql`. The "Current
> OpenFoundry surface" table below has been rewritten and a *Status as
> of 2026-05-20* section has been added at the bottom; the original
> framing is preserved in the *Gap to close* and *Acceptance criteria*
> sections so the parity contract stays auditable.
>
> Severity: **Medium** (down from Critical) — what remains is **AC#6
> action-button → action-type wiring** and **AC#7 the aviation demo
> module itself**; both are PoC-content tasks, not service rewrites.
>
> ### Naming note (Foundry ↔ OpenFoundry)
>
> The Foundry-native vocabulary used throughout this file —
> "**module**" / "**module versions**" — maps 1-to-1 onto the
> OpenFoundry codebase as "**app**" / "**app version**". The tables in
> Postgres are `apps` and `app_versions`; the handlers are
> `CreateApp` / `PublishApp` / `GetPublishedApp`; the REST surface lives
> under `/api/v1/apps`. A reader who `grep`s for `modules` will find
> only this file — that is by design (the file talks Foundry, the
> code talks OpenFoundry).

## Identity

Expand Down Expand Up @@ -45,11 +69,28 @@ The author never writes bespoke React for the common case.

| Layer | File | State |
|---|---|---|
| Service main | [services/application-composition-service/cmd/application-composition-service/main.go](../../../services/application-composition-service/cmd/application-composition-service/main.go) | 75 lines, boots a router but the persistence layer is in-memory |
| Handlers | [services/application-composition-service/internal/handlers/](../../../services/application-composition-service/internal/handlers/) | 8 handlers; create/read shapes exist but no transactional save/publish |
| Migrations | [services/application-composition-service/internal/repo/migrations/](../../../services/application-composition-service/internal/repo/migrations/) | Directory exists; no real persistence of module versions |
| Frontend (works) | [apps/web/src/routes/apps/runtime/](../../../apps/web/src/routes/apps/) (`/apps/runtime/:slug`) | ~4.7k LOC, drag-drop, 15 widget types — fully built |
| Frontend ↔ backend bridge | [apps/web/src/lib/api/](../../../apps/web/src/lib/api/) (search for module/workshop) | Calls land on stub handlers that don't persist |
| Service main | [services/application-composition-service/cmd/application-composition-service/main.go](../../../services/application-composition-service/cmd/application-composition-service/main.go) | Real bootstrap (pgxpool, JWT, tracing, metrics, graceful shutdown) |
| Handlers (apps CRUD + publish) | [services/application-composition-service/internal/handlers/apps.go](../../../services/application-composition-service/internal/handlers/apps.go) | 427 LOC: `CreateApp`, `GetApp`, `UpdateApp`, `PublishApp`, `PromoteVersion`, `GetPublishedApp` (public, no-auth read) |
| Handlers (workshop endpoints) | [services/application-composition-service/internal/handlers/workshop_endpoints.go](../../../services/application-composition-service/internal/handlers/workshop_endpoints.go) | 259 LOC: widget catalog version + schema headers |
| Repo | [services/application-composition-service/internal/repo/repo.go](../../../services/application-composition-service/internal/repo/repo.go) | 989 LOC, pgx-backed Postgres persistence behind the `Store` interface |
| Migrations | [services/application-composition-service/internal/repo/migrations/](../../../services/application-composition-service/internal/repo/migrations/) | 8 SQL files: `apps` + `app_versions` + `app_templates` + `composition_views` + `composition_bindings` + `developer_applications` + `developer_releases` + `app_audit_events` + `managed_workspaces` + `custom_endpoints` + `app_branches` (`branch` column on `apps` and `app_versions`, migration `20260520120000_app_branches.sql`) |
| Integration test | [services/application-composition-service/internal/repo/repo_integration_test.go](../../../services/application-composition-service/internal/repo/repo_integration_test.go) | Persists a real `apps` + `app_versions` round-trip against testcontainers Postgres |
| Frontend (editor + runtime) | [apps/web/src/routes/apps/](../../../apps/web/src/routes/apps/) | Drag-drop editor + `/apps/runtime/:slug` renderer, fully built |
| Frontend ↔ backend bridge | [apps/web/src/lib/api/](../../../apps/web/src/lib/api/) | Calls land on the real `apps` CRUD + publish endpoints |

**What is still missing for the PoC** (after Phase 1 platform closure):

- **AC#6 — Button Group → Action Type resolution.** `apps.go` and
`repo.go` do not yet reference `actionType` / `actionTypeId` lookups
against `ontology-actions-service`. A Button Group widget with
`actionTypeId=X` is persisted but the runtime payload that the
frontend needs (action schema + parameters) is not resolved.
- **AC#7 — Aviation demo module.** No aviation-specific module is
authored anywhere (search `apps/web/src/routes/` for
`aviacion` / `aviation` / `fleet` / `skywise` returns nothing).
- **Widget JSON schema enforcement** (AC#4). The catalog version
headers are emitted, but a hard schema rejection of malformed widget
JSON has not been validated end-to-end.

## Gap to close

Expand Down Expand Up @@ -89,16 +130,41 @@ The author never writes bespoke React for the common case.
can be authored in the editor, saved, published, and re-opened from a
fresh tab.

## Status as of 2026-05-20 (Phase 1 closure)

| Acceptance criterion | Status | Evidence |
|---|---|---|
| 1. Module persists with stable ID; survives restart | ✅ Done | `apps` table (migration `20260422101500_app_builder_foundation.sql`) + `CreateApp` / `GetApp` in [internal/handlers/apps.go](../../../services/application-composition-service/internal/handlers/apps.go). Round-trip exercised in [`repo_integration_test.go`](../../../services/application-composition-service/internal/repo/repo_integration_test.go) against testcontainers Postgres. |
| 2. `POST /modules/{id}/versions` creates immutable versions | ✅ Done | `app_versions` table with `UNIQUE (app_id, version_number)` (same migration). |
| 3. `POST /modules/{id}/publish` + runtime read endpoint | ✅ Done | `PublishApp` (apps.go:166) flips `published_version_id`; `GetPublishedApp` (apps.go:306) is the public, no-auth runtime read at `/apps/{slug}/published`. |
| 4. Widget JSON schema validation | ⚠️ Partial | Catalog version + schema-version headers emitted by `workshop_endpoints.go`; hard rejection of malformed widget JSON not yet exercised by an integration test. |
| 5. `?branch={branchName}` accepted on every verb | ✅ Done | Migration `20260520120000_app_branches.sql` adds `branch` column + composite unique index `apps_slug_branch_uniq`; handlers thread the branch through. |
| 6. Button Group → action-type wire-through | ❌ Open | No matches for `actionType` / `actionTypeId` in `internal/handlers/` or `internal/repo/`. Last-mile wiring against `ontology-actions-service` not done. |
| 7. Aviation demo module authored end-to-end | ❌ Open | No aviation-named route under `apps/web/src/routes/`; no seed module under `tools/` or `PoC/aviacion/`. This is PoC content, not platform work. |

## Deferred to PoC execution

(Phase 1 closed for the platform. The two remaining items — AC#6 and
AC#7 — are PoC-content tasks owned by the demo author and tracked here
so they do not get lost. They are scoped against the same Foundry
parity references as the platform work.)

## Implementation pointers

> The *Implementation pointers* below were written against the original
> "stub" framing. They are kept verbatim for traceability. The items
> already shipped are crossed-referenced in *Status as of 2026-05-20*
> above; only AC#6 (button → action-type) and AC#7 (aviation demo
> module) remain.

1. Promote the in-memory store to a `modules` + `module_versions` table in
Postgres; add Goose migrations under `services/application-composition-service/internal/repo/migrations/`.
2. Add a `branch` column on both tables; default to `main`.
3. Introduce a `WidgetSchema` registry; validate on save.
Postgres; add Goose migrations under `services/application-composition-service/internal/repo/migrations/`. *(Done — tables shipped under the OpenFoundry-native names `apps` + `app_versions`; the eight migration files are listed in *Current OpenFoundry surface*.)*
2. Add a `branch` column on both tables; default to `main`. *(Done — migration `20260520120000_app_branches.sql`.)*
3. Introduce a `WidgetSchema` registry; validate on save. *(Partial — catalog version + schema-version headers; hard schema rejection still open.)*
4. Add a `publish` endpoint that copies the latest draft to a `published`
row and emits a `module.published` event on the bus.
row and emits a `module.published` event on the bus. *(Done — `PublishApp` + `GetPublishedApp` in `apps.go`; bus-event emission is the same outbox pattern shipped for B02 and can be lifted in.)*
5. Wire the frontend `lib/api/workshop.ts` (or equivalent) to the new
endpoints, keeping the existing widget editor untouched.
endpoints, keeping the existing widget editor untouched. *(Done — `apps/web/src/lib/api/` already calls the real apps endpoints.)*
6. Cross-reference unimplemented items against
[foundry-workshop-pipeline-1to1-checklist.md](../../../docs/migration/foundry-workshop-pipeline-1to1-checklist.md)
and mark them as `done` only after a `_test.go` covers them.
12 changes: 12 additions & 0 deletions PoC/aviacion/blockers/B02-ontology-definition.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,18 @@ because the platform emits **schema-change events** on the data bus.

## Current OpenFoundry surface (evidence)

> ⚠️ **Historical snapshot — superseded.** This section describes the
> service **as it was when this file was first written, before the
> outbox + Debezium work landed**. It is preserved so a future reader
> can audit the gap-closure trail. For the **current** state of the
> service — outbox table, Debezium connector, integration tests,
> action-type CRUD lifted into `ontology-actions-service`, OpenAPI
> spec — jump to *Status as of 2026-05-20 (Phase 1 closure)* further
> down this file. Every row of the table below whose state the
> Phase 1 work touches is annotated there with the migration / file /
> test that closes it.


| Layer | File | State |
|---|---|---|
| Service main | [services/ontology-definition-service/cmd/ontology-definition-service/main.go](../../../services/ontology-definition-service/cmd/ontology-definition-service/main.go) | 75 LOC, real bootstrap: pgxpool, JWT, tracing, metrics, probes, server |
Expand Down
Loading
Loading