Skip to content

Commit 2cb7fab

Browse files
committed
feat: publish CAS reference product v0.1
0 parents  commit 2cb7fab

40 files changed

Lines changed: 1049 additions & 0 deletions

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.git
2+
.github
3+
.planning
4+
.venv
5+
__pycache__
6+
.pytest_cache
7+
.ruff_cache
8+
tests
9+
docs
10+

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ENVIRONMENT=local
2+
WORKFLOW_BACKEND=local
3+
# Foundry mode requires non-secret resource identifiers:
4+
# FOUNDRY_PROJECT_ENDPOINT=https://example.services.ai.azure.com/api/projects/example
5+
# FOUNDRY_AGENT_NAME=cas-reference-agent
6+
# APPLICATIONINSIGHTS_CONNECTION_STRING is injected by the deployment environment when used.
7+

.foundry/agent-metadata.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
defaultEnvironment: dev
2+
environments:
3+
dev:
4+
projectEndpoint: https://replace-me.services.ai.azure.com/api/projects/replace-me
5+
agentName: cas-reference-agent-dev
6+
azureContainerRegistry: replace-me.azurecr.io
7+
evaluationSuites:
8+
- id: smoke-core
9+
tags:
10+
tier: smoke
11+
purpose: baseline
12+
stage: seed
13+
dataset: cas-reference-agent-dev-seed
14+
datasetVersion: v1
15+
datasetFile: .foundry/datasets/cas-reference-agent-dev-seed-v1.jsonl
16+
datasetUri: replace-with-foundry-dataset-uri
17+
evaluators:
18+
- name: task_adherence
19+
threshold: 4
20+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
{"query":"Explain the reference workflow.","response":"Describe the local and Foundry adapters, lifecycle events, identity, and observability boundaries."}
2+

.github/workflows/ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
validate:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
16+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
17+
with:
18+
python-version: "3.12"
19+
cache: pip
20+
- run: python -m pip install -e ".[dev]"
21+
- run: python -m ruff check .
22+
- run: python -m mypy
23+
- run: python -m pytest
24+
- run: docker build --platform linux/amd64 -t cas-reference-product:ci .

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.venv/
2+
__pycache__/
3+
.pytest_cache/
4+
.ruff_cache/
5+
.coverage
6+
htmlcov/
7+
dist/
8+
build/
9+
*.egg-info/
10+
.env
11+
.foundry/results/
12+

.planning/PROJECT.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# CAS Reference Product
2+
3+
## What This Is
4+
5+
A public, production-oriented reference application showing how a CAS workload integrates with Microsoft Foundry Next Gen Agents while running on the `cas-platform` Container Apps foundation. It demonstrates canonical lifecycle events, managed identity, observability boundaries, probes, tests, and a safe local workflow without provisioning Azure resources.
6+
7+
## Core Value
8+
9+
Developers can run and inspect one complete, traceable CAS workflow locally, then deploy the same container through the `cas-platform` interface without changing its security model.
10+
11+
## Requirements
12+
13+
### Validated
14+
15+
(None yet - ship to validate)
16+
17+
### Active
18+
19+
- [ ] Expose a useful workflow API with local and Foundry Next Gen modes.
20+
- [ ] Emit canonical `cas-contracts` v0.1 lifecycle records with W3C trace context.
21+
- [ ] Use system-assigned managed identity in Azure and no embedded secrets.
22+
- [ ] Define OpenTelemetry and Application Insights boundaries.
23+
- [ ] Provide health, readiness, tests, Docker, CI, architecture, threat model, and local workflow.
24+
- [ ] Match the workload interface expected by `cas-platform`.
25+
26+
### Out of Scope
27+
28+
- Azure resource deployment - explicitly prohibited for v0.1.
29+
- Classic Assistants APIs - violate the Foundry Next Gen mandate.
30+
- Production authorization and persistence - require product-specific policy and data design.
31+
32+
## Context
33+
34+
`cas-contracts` v0.1 is the authoritative lifecycle contract. `cas-platform` hosts a port-8080 container with a system-assigned managed identity and workspace observability. The application must remain useful without Azure access, while making the cloud integration explicit and testable.
35+
36+
## Constraints
37+
38+
- **Identity**: Managed identity only in Azure; no embedded credentials.
39+
- **Platform**: Linux AMD64 container listening on port 8080.
40+
- **Cloud safety**: No Azure deployment or resource mutation.
41+
- **Public repository**: Examples and defaults contain no sensitive data.
42+
43+
## Key Decisions
44+
45+
| Decision | Rationale | Outcome |
46+
|----------|-----------|---------|
47+
| Python, FastAPI, and Pydantic | Compact public reference with strong contracts and testability | Pending |
48+
| Local deterministic adapter by default | CI and contributors can run without Azure | Pending |
49+
| Foundry project Responses client with agent reference | Demonstrates Next Gen Agent invocation without Classic Assistants | Pending |
50+
| Production uses `ManagedIdentityCredential` | Deterministic system-assigned identity boundary | Pending |
51+
52+
## Evolution
53+
54+
Review requirements, decisions, and scope at each phase transition and milestone.
55+
56+
---
57+
*Last updated: 2026-06-11 after initialization*
58+

.planning/REQUIREMENTS.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Requirements: CAS Reference Product
2+
3+
**Defined:** 2026-06-11
4+
**Core Value:** Run and inspect one complete, traceable CAS workflow locally and deploy the same container through `cas-platform`.
5+
6+
## v0.1 Requirements
7+
8+
- [x] **API-01**: Caller can submit a prompt envelope and receive a workflow result.
9+
- [x] **AGENT-01**: Application supports a Foundry Next Gen agent-reference adapter and a local deterministic adapter.
10+
- [x] **ID-01**: Azure-hosted mode uses system-assigned managed identity and code contains no credentials.
11+
- [x] **CONTRACT-01**: Application emits canonical `PromptEnvelope` and `RunEvent` v0.1 records.
12+
- [x] **OBS-01**: HTTP, workflow, and Foundry boundaries create OpenTelemetry spans and support Application Insights export.
13+
- [x] **OPS-01**: Application exposes liveness and readiness probes.
14+
- [x] **PLAT-01**: Container interface matches `cas-platform` port and environment model.
15+
- [x] **QUAL-01**: Unit, API, contract, static, and container configuration checks run in CI.
16+
- [x] **DOC-01**: Architecture, threat model, operations, and local workflow are documented.
17+
18+
## Out of Scope
19+
20+
| Feature | Reason |
21+
|---------|--------|
22+
| Azure deployment | Explicitly prohibited for v0.1 |
23+
| Classic Assistants integration | Foundry Next Gen only |
24+
| Durable workflow storage | Requires product-specific persistence design |
25+
26+
## Traceability
27+
28+
All v0.1 requirements map to Phase 1 and are complete.
29+
30+
---
31+
*Last updated: 2026-06-11 after v0.1 implementation*
32+

.planning/ROADMAP.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Roadmap: CAS Reference Product
2+
3+
## Phase 1: Public v0.1 Reference Application
4+
5+
**Goal:** Deliver a locally runnable, cloud-ready reference workload without deploying Azure resources.
6+
7+
**Requirements:** API-01, AGENT-01, ID-01, CONTRACT-01, OBS-01, OPS-01, PLAT-01, QUAL-01, DOC-01
8+
9+
**Success criteria:**
10+
- Local workflow request succeeds and returns canonical events.
11+
- Tests, lint, type checks, and Docker build pass.
12+
- Foundry mode uses Next Gen agent references and managed identity.
13+
- Public documentation states deployment and security boundaries.
14+
15+
Status: Complete
16+

.planning/STATE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Project State
2+
3+
## Project Reference
4+
5+
See: `.planning/PROJECT.md`
6+
7+
**Core value:** Run and inspect one complete, traceable CAS workflow locally.
8+
**Current focus:** v0.1 verification and publication
9+
10+
## Status
11+
12+
Phase 1 implemented. Azure resources have not been deployed.
13+

0 commit comments

Comments
 (0)