# Programs page

1. **File tree** where the code is; each Program appears once
2. **Call tree or graph** `survey_pipeline`, selected `literature_review`, direct `paper_search`, transitive

Direction of calls, not folder containment. Tree and graph share the same relationship data, derived from source (static Program imports and Agentic Programming calls). Code: `apps/web/components/programs/programs-page.tsx`.

| Area | Shows |
| --- | --- |
| File tree | Folders, files, counts and Git state (clean, modified) |
| Detail header | Path, description, kind, HEAD state, signature, direct and transitive Workflow counts, branch and commit |
| Call row | Name, relationship, how it is reached |

## Catalog and form launching

| Case | Behaviour |
| --- | --- |
| Catalog | One callable catalog for the Programs page, favorites bar and parameter forms; HTTP refreshes and WebSocket updates feed one store |
| Refresh fails | Keeps the last good cache |
| Stale response | Cannot overwrite a newer one |
| Use | Only opens the form |
| Missing function | Refreshes the catalog and shows an explicit error |
| Chat switch | Cancels the previous form request |

Contract: [Workflow package](https://fzkuji.github.io/OpenProgram/docs/reference/design/runtime/workflows/workflow.html).

### Tab ownership

The launcher captures selected tab and chat before resolving a Program. An older request, cancellation, chat switch or tab switch opens nothing in another view.

| Selected view | On success |
| --- | --- |
| Active session | Keeps its draft and running task |
| New-tab page | Becomes a draft session in place |
| Any other view | Opens a separate draft and keeps its tab |

The draft is selected and initialized before its form opens. A catalog failure leaves the view intact with an error. Nothing runs or submits until an explicit send.

**Verification**

- Click a real sidebar favorite on a new-tab page, edit its task field and close without submitting.
- Preserve another active task and its draft. Cancel catalog resolution when the tab changes.
- Program launcher unit tests, rendered launcher browser tests, Web unit and source checks, TypeScript, production export, repository contracts, documentation links. Installed-App acceptance is a separate gate.
- Runtime and browser APIs are retained; external product parity and dependency upgrades are excluded.
