fix(introspection): Add 'schemas' layer to known_layers list (40→41 l…#19
fix(introspection): Add 'schemas' layer to known_layers list (40→41 l…#19MarcoPolo483 merged 1 commit intomainfrom
Conversation
…ayers) Issue: /model/layers endpoint showed 40 layers instead of 41 Root cause: 'schemas' layer missing from known_layers list in introspection.py Fix: - Added 'schemas' between 'endpoints' and 'screens' (matches _LAYER_FILES order) - Now returns 41 layers as documented Note: Session 30 layers (deployment_policies, testing_policies, validation_rules) show 0 objects in production because Cosmos DB needs re-seeding from updated JSON files. Next step: Deploy + seed production database. Related: DPDCA-AGENT-API-READINESS.md, PR #18
There was a problem hiding this comment.
Pull request overview
Fixes /model/layers introspection returning an incorrect layer count by adding the missing schemas layer to the router's known_layers list, aligning the response with documented layer totals and existing admin layer ordering.
Changes:
- Add
schemasto theknown_layerslist used byGET /model/layers. - Ensure
/model/layersreports 41 layers instead of 40.
| "services", "personas", "feature_flags", "containers", "endpoints", | ||
| "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "schemas", "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "planes", "connections", "environments", "cp_skills", "cp_agents", |
There was a problem hiding this comment.
Adding 'schemas' fixes the layer count, but introspection still cannot locate a JSON Schema file for the 'schemas' layer (schema/schemas.schema.json or schema/schema.schema.json is not present, and _get_schema_path has no special-case mapping). As a result, /model/layers will report has_schema=false for 'schemas' and /model/schema-def/schemas will 404; either add the schema file or extend _get_schema_path mappings so this layer can be introspected like the others.
| known_layers = [ | ||
| "services", "personas", "feature_flags", "containers", "endpoints", | ||
| "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "schemas", "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "planes", "connections", "environments", "cp_skills", "cp_agents", |
There was a problem hiding this comment.
This regression (40 vs 41 layers) would be easy to catch with a small API test. Please add a test that calls GET /model/layers and asserts that 'schemas' is present (and optionally that summary.total_layers matches the expected count) to prevent future drift.
| # List of all known layers (from layers.py + Session 28-30 additions) | ||
| known_layers = [ | ||
| "services", "personas", "feature_flags", "containers", "endpoints", | ||
| "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "schemas", "screens", "literals", "agents", "infrastructure", "requirements", | ||
| "planes", "connections", "environments", "cp_skills", "cp_agents", |
There was a problem hiding this comment.
known_layers is hard-coded here and appears to duplicate the authoritative layer list in api/routers/admin.py:_LAYER_FILES. This drift already caused the missing 'schemas' regression; consider building known_layers from _LAYER_FILES.keys() (and only appending truly non-file-backed layers) to keep /model/layers in sync automatically.
…ayers)
Issue: /model/layers endpoint showed 40 layers instead of 41
Root cause: 'schemas' layer missing from known_layers list in introspection.py
Fix:
Note: Session 30 layers (deployment_policies, testing_policies, validation_rules) show 0 objects in production because Cosmos DB needs re-seeding from updated JSON files. Next step: Deploy + seed production database.
Related: DPDCA-AGENT-API-READINESS.md, PR #18