Skip to content

Commit 1311352

Browse files
authored
feat: integrate reference product workload contract
Implements the public reference product deployment contract with optional project-scoped Foundry RBAC and verified non-deploying what-if behavior.
1 parent 2d6ab06 commit 1311352

19 files changed

Lines changed: 321 additions & 39 deletions

.github/workflows/validate.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ jobs:
1818
timeout-minutes: 15
1919
steps:
2020
- name: Checkout
21-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
21+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
2222
with:
2323
persist-credentials: false
2424

2525
- name: Validate
2626
shell: pwsh
2727
run: ./scripts/validate.ps1
28-

.planning/REQUIREMENTS.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@
3535

3636
## v2 Requirements
3737

38+
- [x] **INT-01**: Platform injects the reference product non-secret configuration contract.
39+
- [x] **INT-02**: Platform configures reference product liveness and readiness probes.
40+
- [x] **INT-03**: Foundry RBAC is optional and requires explicit project scope and role definition inputs.
41+
- [x] **INT-04**: Contract tests prove workload identity, configuration, probes, ingress, and RBAC boundaries.
3842
- **NET-01**: Operator can enable private networking and controlled egress.
3943
- **GOV-01**: Operator can apply Azure Policy and compliance reporting.
4044
- **DEL-01**: Authorized workload identity can promote reviewed infrastructure.
@@ -57,9 +61,10 @@
5761
| SEC-01, SEC-02, SEC-03, SEC-04 | Phase 1 | Complete |
5862
| OPS-01, OPS-02, OPS-03, OPS-04 | Phase 1 | Complete |
5963
| QUAL-01, QUAL-02, QUAL-03, QUAL-04 | Phase 1 | Complete |
64+
| INT-01, INT-02, INT-03, INT-04 | Phase 2 | Complete |
65+
| NET-01, GOV-01 | Phase 3 | Pending landing-zone contract |
6066

61-
**Coverage:** 16 v1 requirements, 16 mapped, 0 unmapped.
67+
**Coverage:** 16 v1 requirements and 4 integration requirements complete.
6268

6369
---
64-
*Last updated: 2026-06-11 after v0.1 foundation*
65-
70+
*Last updated: 2026-06-12 after reference product integration*

.planning/ROADMAP.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,23 @@ through OPS-04, QUAL-01 through QUAL-04.
1313
3. Architecture and threat model accurately describe residual risk.
1414
4. Repository can be created publicly and CI can validate the foundation.
1515

16-
## Phase 2: Network and Policy Guardrails
16+
## Phase 2: Reference Product Integration
17+
18+
Implement the public reference product deployment contract: non-secret
19+
configuration, health probes, system-assigned identity boundaries, and
20+
optional project-scoped Foundry RBAC.
21+
22+
## Phase 3: Network and Policy Guardrails
1723

1824
Add private networking, controlled egress, Azure Policy, and compliance
19-
reporting after target subscription architecture is agreed.
25+
reporting only after target subscription architecture is agreed.
2026

21-
## Phase 3: Federated Delivery
27+
## Phase 4: Federated Delivery
2228

2329
Add OIDC/managed-identity deployment workflows, approvals, evidence retention,
2430
and safe promotion between environments.
2531

26-
## Phase 4: Production Operations
32+
## Phase 5: Production Operations
2733

2834
Add alerts, SLOs, dashboards, incident routing, release attestations, and
2935
recovery exercises.
30-

.planning/STATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@
55
See `.planning/PROJECT.md`.
66

77
**Core value:** An operator can confidently understand and validate a secure CAS Azure environment before deploying it.
8-
**Current focus:** Phase 2 - Network and Policy Guardrails
8+
**Current focus:** Phase 3 - Network and Policy Guardrails
99

1010
## Status
1111

1212
- Phase 1 v0.1 foundation implemented and locally verified.
13+
- Phase 2 reference product integration implemented and locally verified.
1314
- No Azure resources deployed.
15+
- Private networking and policy deferred until a landing-zone contract exists.
1416
- Next planned phase: Network and Policy Guardrails.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Phase 2 Plan: Reference Product Integration
2+
3+
## Goal
4+
5+
Implement the public `cas-reference-product` deployment interface without
6+
deploying Azure resources or assuming a landing-zone topology.
7+
8+
## Tasks
9+
10+
1. Inject the required non-secret workload configuration from Bicep.
11+
2. Configure port 8080, internal ingress, system-assigned identity, and health
12+
probes matching the public workload interface.
13+
3. Add optional Foundry RBAC gated by explicit project resource and role
14+
definition resource IDs, scoped only to that project.
15+
4. Add contract tests and documentation covering the integration boundary.
16+
5. Build all Bicep and parameter files, run Pester, and retain non-deploying
17+
what-if behavior.
18+
19+
## Guardrails
20+
21+
- Do not deploy Azure resources.
22+
- Do not add private networking or Azure Policy without a target landing-zone
23+
contract.
24+
- Do not select a broad built-in role on the operator's behalf.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Phase 2 Summary: Reference Product Integration
2+
3+
Implemented the reference product configuration and health contract in the
4+
Container App module. Application Insights configuration flows directly from
5+
the observability module. Foundry role assignment is disabled by default and
6+
can only be enabled with both an explicit Foundry project resource ID and an
7+
explicit approved role definition resource ID; its scope is the project.
8+
9+
Private networking and Azure Policy were reviewed but not added because no
10+
landing-zone topology, DNS, egress, or policy ownership contract exists.
11+
12+
No Azure resources were deployed.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Phase 2 Verification
2+
3+
**Status:** Passed locally
4+
5+
## Evidence
6+
7+
- `az bicep build --file infra/main.bicep --stdout`: passed.
8+
- All dev, test, and prod Bicep parameter builds: passed.
9+
- `scripts/validate.ps1`: passed.
10+
- Pester infrastructure contract tests: 10 passed, 0 failed.
11+
- `scripts/what-if.ps1 -Environment dev -Location northeurope`: succeeded
12+
with only expected creates and no deployment. The preview proved internal
13+
ingress, port 8080, system-assigned identity, required environment settings,
14+
both health probes, and no default Foundry role assignment.
15+
- Tests prove required environment injection, probes, port 8080, internal
16+
ingress default, system-assigned identity, principal output, optional RBAC
17+
gating, project scope, and non-deploying what-if commands.
18+
- No Azure resources deployed.

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Production-oriented Azure infrastructure foundation for the Coding Autopilot
44
System (CAS). It provides environment-isolated Container Apps hosting,
55
workspace-based observability, system-assigned managed identity, budgets, and
6-
safe validation tooling without storing secrets.
6+
safe validation tooling without storing secrets. The workload module implements
7+
the public `cas-reference-product` deployment interface.
78

89
## v0.1 foundation
910

@@ -13,6 +14,8 @@ safe validation tooling without storing secrets.
1314
- Log Analytics, Application Insights, diagnostic settings, tags, and budgets.
1415
- Dev, test, and production parameter sets.
1516
- Local and CI validation plus a non-deploying Azure `what-if` script.
17+
- Reference-product configuration injection and liveness/readiness probes.
18+
- Optional Foundry project RBAC requiring an explicit project scope and role.
1619

1720
## Validate locally
1821

@@ -40,6 +43,18 @@ az login
4043
The script only invokes `az deployment sub what-if`. It never invokes a create
4144
or deploy command.
4245

46+
## Reference product configuration
47+
48+
The Container App injects `ENVIRONMENT`, `WORKFLOW_BACKEND`,
49+
`FOUNDRY_PROJECT_ENDPOINT`, `FOUNDRY_AGENT_NAME`, and
50+
`APPLICATIONINSIGHTS_CONNECTION_STRING`. Local mode is the safe default.
51+
Foundry mode requires a project endpoint and Next Gen agent name.
52+
53+
Foundry RBAC is disabled unless both `foundryProjectResourceId` and
54+
`foundryRoleDefinitionResourceId` are explicitly supplied. The assignment is
55+
created only at that Foundry project resource. Select and approve the minimum
56+
role externally; the template does not assume a broad built-in role.
57+
4358
## Architecture
4459

4560
See [architecture](docs/architecture.md), [threat model](docs/threat-model.md),
@@ -48,6 +63,7 @@ kept under `.planning/`.
4863

4964
## Security
5065

51-
Public ingress is disabled by default. No secrets, credentials, connection
52-
strings, or access keys are accepted by the templates. Runtime access to future
53-
dependencies must use managed identity with narrowly scoped RBAC.
66+
Public ingress is disabled by default. No secrets, credentials, or access keys
67+
are accepted by the templates. Runtime access to dependencies uses managed
68+
identity with narrowly scoped RBAC. Private networking and Azure Policy remain
69+
deferred until a target landing-zone contract defines topology and ownership.

docs/architecture.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,24 @@ environment, identity boundary, and budget.
2929

3030
## Identity and networking
3131

32-
The Container App receives a system-assigned managed identity. v0.1 has no
33-
dependent data plane resources, so it deliberately creates no role
34-
assignments. Future modules must grant the identity only the minimum data-plane
35-
roles at the narrowest resource scope.
32+
The Container App receives a system-assigned managed identity. Foundry access
33+
is optional and creates no role assignment by default. When both an explicit
34+
Foundry project resource ID and an approved role definition resource ID are
35+
provided, the platform assigns that role only at the project resource scope.
36+
Subscription-wide workload roles are not supported.
3637

3738
External ingress defaults to disabled. Enabling it is an explicit parameter
3839
decision and requires a threat-model review. The v0.1 baseline does not claim
39-
private networking; that is planned as a later hardened topology.
40+
private networking. That topology remains deferred until a target landing-zone
41+
contract identifies required subnets, DNS, firewall, and egress ownership.
42+
43+
## Reference product contract
44+
45+
The workload module follows the public `cas-reference-product` deployment
46+
interface: Linux container image, port 8080, internal ingress by default,
47+
system-assigned identity, `/health/live` and `/health/ready` probes, and
48+
non-secret workload configuration. Application Insights configuration is
49+
injected directly from the observability module.
4050

4151
## Observability
4252

@@ -50,4 +60,3 @@ are output.
5060
Normal changes flow through build, lint, contract tests, and subscription
5161
`what-if`. Resource naming is deterministic. Renaming workload, environment, or
5262
location can replace resource boundaries and must be treated as a migration.
53-

docs/operations.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@ sets. Production deployment is intentionally not implemented in v0.1. Add it
1515
only after workload identity, approvals, policy, and rollback ownership are
1616
defined.
1717

18+
## Reference product modes
19+
20+
Parameter files default to `WORKFLOW_BACKEND=local`. To validate Foundry mode,
21+
provide the non-secret project endpoint and Next Gen agent name. RBAC remains
22+
disabled unless the operator also supplies both the exact Foundry project
23+
resource ID and an approved role definition resource ID. Review the resulting
24+
project-scoped role assignment in what-if before any deployment authorization.
25+
26+
Health probes call `/health/live` and `/health/ready` on port 8080. Readiness
27+
checks configuration only; it does not invoke Foundry.
28+
1829
## Rollback
1930

2031
Bicep redeployment can restore configuration but does not restore deleted data
@@ -26,4 +37,3 @@ Never rely on changing a resource name as a rollback mechanism.
2637
Query the environment Log Analytics workspace for platform and application
2738
logs. Application Insights is available for workload instrumentation when the
2839
application is configured without exposing credentials.
29-

0 commit comments

Comments
 (0)