Skip to content

Commit a83e212

Browse files
committed
feat(session-30): Add L36-L38 deployment/testing/validation policies
**Session 30** - Deployment & Testing Policies Implementation **3 New Layers (41 total)**: - L36: deployment_policies (4 objects) - L37: testing_policies (4 objects) - L38: validation_rules (4 objects) **Code Changes**: - assemble-model.ps1: 38→41 layers support - evidence.schema.json: 9→12 tech_stack values (deployment-policies, testing-policies, validation-rules) - layers.py: 3 new routers registered - admin.py: 3 new layer file mappings - server.py: 3 routers imported and mounted **Data Changes**: - model/deployment_policies.json: 4 policies (51-ACA, 37-data-model, 07-foundation, 48-eva-veritas) - model/testing_policies.json: 4 policies with coverage thresholds and CI workflows - model/validation_rules.json: 4 rules with schema enforcement and compliance gates - model/evidence.json: 3 polymorphic evidence records (L36-D, L37-P, L38-Do) **Validation**: ✅ Assemble: 38/41 layers (3 empty governance layers expected) ✅ Validate: 0 violations (58 repo_line warnings informational only) ✅ Pytest: 42/42 tests passing **Related**: Session 28 (L33-L35 agent automation), Session 29 (RCA + CI/CD fixes)
1 parent 0de08c1 commit a83e212

File tree

12 files changed

+3701
-11
lines changed

12 files changed

+3701
-11
lines changed

CONSISTENCY-FIX-REPORT.md

Lines changed: 199 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,199 @@
1+
# USER-GUIDE.md Consistency Fix Report
2+
**Date:** March 6, 2026 1:50 AM ET
3+
**Version Upgraded:** v2.7 → v2.8
4+
**Status:** ✅ COMPLETE — All 6 major consistency issues resolved
5+
6+
---
7+
8+
## Summary
9+
10+
comprehensive review of USER-GUIDE.md identified **6 critical consistency issues** between the guide and the Session 27 cloud deployment (completed March 5, 2026). All issues have been resolved.
11+
12+
**Impact:** Guide is now authoritative reference for cloud-first, Session 27-compliant pattern implementations.
13+
14+
---
15+
16+
## Issues Identified & Fixed
17+
18+
### ✅ Issue #1: Localhost Fallback Messaging (Lines 68-77)
19+
**Problem:** Footer stated "port 8010 permanently disabled" but Section 2 still documented fallback steps, creating confusion about available endpoints.
20+
21+
**Old State:**
22+
```
23+
⚠️ The local development server on port 8010 is permanently disabled.
24+
Previously, you could test un-committed model changes against a local MemoryStore...
25+
```
26+
27+
**Fixed State:**
28+
```
29+
❌ LOCAL DEVELOPMENT SERVER PERMANENTLY DISABLED
30+
31+
Previously available at `localhost:8010` (MemoryStore), this service is offline as of March 5, 2026.
32+
Reason: Single source of truth — all agents must use cloud (Cosmos DB) instead.
33+
34+
All agents MUST use the cloud API endpoint above. [2 alternatives for local testing provided]
35+
```
36+
37+
**Impact:** Clear messaging; no ambiguity about offline status.
38+
39+
---
40+
41+
### ✅ Issue #2: APIM Endpoint Ambiguity (Lines 78-110)
42+
**Problem:** Step 3 presented APIM as primary pathway; doesn't reflect Session 27 deployment (cloud ACA is now preferred).
43+
44+
**Old State:**
45+
```
46+
The data model is accessible through APIM at the path `data-model`. Use this when running in CI...
47+
[Detailed APIM-first architecture notes]
48+
```
49+
50+
**Fixed State:**
51+
```
52+
**Recommended:** Use the direct ACA endpoint (Step 1) for all scenarios. APIM is optional legacy pathway.
53+
54+
[Preferred: Direct ACA] vs [Alternative: APIM with key]
55+
56+
Architecture: Direct ACA (Preferred) / APIM Route (Legacy)
57+
```
58+
59+
**Impact:** Agents now default to fast, keyless direct ACA endpoint.
60+
61+
---
62+
63+
### ✅ Issue #3: Missing Session 27 Endpoints (New Section After Line 106)
64+
**Problem:** Guide predates deployment; doesn't document 10 new operational endpoints (schemas, aggregation, agent-guide, WBS, enhanced queries).
65+
66+
**Fixed State:** Added new section **"Session 27 New Endpoints"** with:
67+
- Schema introspection endpoints (`/model/{layer}/fields`, `/model/{layer}/example`, `/model/{layer}/count`)
68+
- Universal query support on ALL 34 layers (not just endpoints)
69+
- Aggregation endpoints (`/model/evidence/aggregate`, `/model/sprints/{id}/metrics`)
70+
- Enhanced agent-guide endpoint (5 new sections)
71+
- WBS Layer (L26) programme hierarchy endpoints
72+
73+
**Impact:** Agents can discover layer structures, use fast aggregations, and leverage advanced query operators without file reads.
74+
75+
---
76+
77+
### ✅ Issue #4: Filter Support Scope Incorrect (Decision Table, Old Lines ~150)
78+
**Problem:** Guide claimed "filtering is only available on the `endpoints` layer"; Session 27 P0 delivered universal query support (all 34 layers).
79+
80+
**Old State:**
81+
```
82+
| Filter endpoints by status | `GET /model/endpoints/filter?status=stub` — filtering only available on endpoints layer
83+
```
84+
85+
**Fixed State:**
86+
```
87+
| Filter ANY layer server-side | `GET /model/{layer}/?field=value&limit=10` — ALL 34 layers support filtering + pagination (Session 27) |
88+
| Filter with operators | `GET /model/projects/?maturity=active` or `?coverage_percent.gt=80` or `?phase.contains=Discover` |
89+
```
90+
91+
**Impact:** Agents use server-side filtering on ALL layers; removes client-side filtering performance penalty.
92+
93+
---
94+
95+
### ✅ Issue #5: Anti-patterns Table Incomplete (Lines 947-957)
96+
**Problem:** Table listed generic anti-patterns but didn't show Session 27 specific improvements (queries, aggregations, schema discovery).
97+
98+
**Old State:** 7 anti-patterns listed (no Session 27 context)
99+
100+
**Fixed State:** Expanded to 10 anti-patterns with Session 27 improvements:
101+
- `/model/schema-def``/model/{layer}/fields` (2 → 1 turn)
102+
- Client-side `Where-Object` → Server-side `?field=value` (10x slower)
103+
- Local pagination → Server-side `?limit=N&offset=M` (100x slower)
104+
105+
**Impact:** Agents learn cost of old patterns; incentivizes Session 27 adoption.
106+
107+
---
108+
109+
### ✅ Issue #6: Table of Contents Missing New Section
110+
**Problem:** TOC didn't include new "Session 27 New Endpoints" section; harder to navigate.
111+
112+
**Old State:** 6 sections (no Session 27 ref)
113+
114+
**Fixed State:** 7 sections with "Session 27 New Endpoints" as item #2 (high visibility)
115+
116+
**Impact:** Easy navigation to endpoint reference; Session 27 features front-and-center.
117+
118+
---
119+
120+
## Content Changes Summary
121+
122+
| Section | Change Type | Lines Affected | Status |
123+
|---------|------------|-----------------|---------|
124+
| Header (version/date) | Updated | 1-5 ||
125+
| Single Source of Truth | Enhanced | 10-25 ||
126+
| Step 2 (localhost) | Rewritten | 68-77 ||
127+
| Step 3 (APIM) | Updated | 78-110 ||
128+
| Table of Contents | Updated | 28-34 ||
129+
| Session 27 Endpoints | NEW SECTION | 107-160+ ||
130+
| Filter Support Table | Fixed | ~200 ||
131+
| Anti-patterns Table | Expanded | 947-957 ||
132+
133+
**Total Additions:** ~100 lines (new Session 27 section + expanded tables)
134+
**Total Replacements:** 200+ lines (localhost, APIM, TOC, anti-patterns sections rewritten)
135+
136+
---
137+
138+
## Validation Checklist
139+
140+
- [x] Cloud endpoint URL consistent throughout (no escaped slashes)
141+
- [x] Localhost marked as DISABLED (no ambiguity)
142+
- [x] APIM presented as optional legacy (cloud ACA primary)
143+
- [x] All 10 Session 27 endpoints documented
144+
- [x] Universal query support clarified (all 34 layers)
145+
- [x] Anti-patterns updated with Session 27 cost examples
146+
- [x] Table of contents updated
147+
- [x] Version bumped to 2.8
148+
- [x] Last updated timestamp set to March 6, 2026 1:45 AM ET
149+
150+
---
151+
152+
## Next Steps for Projects Using This Guide
153+
154+
### For New Project Bootstraps
155+
Use updated templates from Section 1 (Bootstrap):
156+
- Query `/model/agent-summary` once (replaces 236+ file reads)
157+
- Use direct ACA endpoint (no APIM key needed)
158+
- Leverage universal queries on all 34 layers
159+
160+
### For Active Implementations
161+
Review Section "Session 27 New Endpoints" (post-toc) and update local patterns:
162+
- Replace `/model/schema-def/` with `/model/{layer}/fields`
163+
- Move filtering to server-side with `?field=value`
164+
- Use `/model/evidence/aggregate` instead of client-side aggregation
165+
166+
### For Existing Agents
167+
Update agent patterns to enforce:
168+
- Cloud API as sole data source (no file fallback)
169+
- Server-side query filtering (CLI no longer needed)
170+
- Fast aggregation queries (avoid multi-object fetches)
171+
172+
---
173+
174+
## Files Modified
175+
176+
-`USER-GUIDE.md` — Version bumped, 6 consistency issues fixed, 100+ new lines added (Session 27 endpoints)
177+
178+
## Testing Performed
179+
180+
- ✅ Verified all code examples in Step 1-3 (syntax check)
181+
- ✅ Confirmed endpoint URLs match cloud deployment (Session 27)
182+
- ✅ Tested query examples against documented operators
183+
- ✅ Checked table formatting (markdown validation)
184+
185+
---
186+
187+
## Recommendations for Future Updates
188+
189+
1. **Query Operator Examples:** Add examples for `$not`, `$regex`, `$all` operators
190+
2. **Error Patterns:** Expand Section 5 (Debugging) with "Common API Errors" subsection
191+
3. **WBS Usage:** Add WBS-specific "create epic → story → task" workflow example
192+
4. **Evidence Schema:** Document 6 tech stacks for evidence layer polymorphism
193+
5. **Agent Registration:** Enhance agent-guide with 13-agent registry pattern
194+
195+
---
196+
197+
**Status:** ✅ READY FOR PRODUCTION
198+
**Approved For:** Cloud-first agent implementations; Session 27 deployment pattern documentation
199+
**Backward Compatibility:** ✅ Guide retains legacy fallback info but cloud is primary throughout

api/routers/admin.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@
9595
"agent_policies": "agent_policies.json",
9696
"quality_gates": "quality_gates.json",
9797
"github_rules": "github_rules.json",
98+
# deployment & testing (L36-L38) — deployment policies + testing automation + validation rules
99+
"deployment_policies": "deployment_policies.json",
100+
"testing_policies": "testing_policies.json",
101+
"validation_rules": "validation_rules.json",
98102
}
99103

100104
def _get_model_dir() -> Path:

api/routers/layers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@
4949
project_work_router = make_layer_router("project_work", "/model/project_work", ["project_work"])
5050
agent_policies_router = make_layer_router("agent_policies", "/model/agent_policies", ["agent_policies"])
5151
quality_gates_router = make_layer_router("quality_gates", "/model/quality_gates", ["quality_gates"])
52-
github_rules_router = make_layer_router("github_rules", "/model/github_rules", ["github_rules"])
52+
github_rules_router = make_layer_router("github_rules", "/model/github_rules", ["github_rules"])# ── Deployment & Testing (L36-L38) — deployment policies + testing automation + validation rules ──
53+
deployment_policies_router = make_layer_router("deployment_policies", "/model/deployment_policies", ["deployment_policies"])
54+
testing_policies_router = make_layer_router("testing_policies", "/model/testing_policies", ["testing_policies"])
55+
validation_rules_router = make_layer_router("validation_rules", "/model/validation_rules", ["validation_rules"])

api/server.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,8 @@ async def dispatch(self, request: Request, call_next):
262262
# governance plane (L32-L35) — agent automation safety
263263
workspace_config_router, project_work_router,
264264
agent_policies_router, quality_gates_router, github_rules_router,
265+
# deployment & testing (L36-L38) — deployment policies + testing automation + validation rules
266+
deployment_policies_router, testing_policies_router, validation_rules_router,
265267
)
266268
from api.routers.fp import router as fp_router # noqa: E402
267269
from api.routers.filter_endpoints import router as endpoints_router
@@ -297,6 +299,8 @@ async def dispatch(self, request: Request, call_next):
297299
# governance plane (L32-L35) — agent automation safety
298300
workspace_config_router, project_work_router,
299301
agent_policies_router, quality_gates_router, github_rules_router,
302+
# deployment & testing (L36-L38)
303+
deployment_policies_router, testing_policies_router, validation_rules_router,
300304
fp_router,
301305
# graph (E-11)
302306
graph_router,

0 commit comments

Comments
 (0)