Skip to content

fix(introspection): Add 'schemas' layer to known_layers list (40→41 l…#19

Merged
MarcoPolo483 merged 1 commit intomainfrom
fix/layer-count-41-session30
Mar 6, 2026
Merged

fix(introspection): Add 'schemas' layer to known_layers list (40→41 l…#19
MarcoPolo483 merged 1 commit intomainfrom
fix/layer-count-41-session30

Conversation

@MarcoPolo483
Copy link
Contributor

…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

…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
Copilot AI review requested due to automatic review settings March 6, 2026 15:30
@MarcoPolo483 MarcoPolo483 merged commit f2b4329 into main Mar 6, 2026
2 checks passed
@MarcoPolo483 MarcoPolo483 deleted the fix/layer-count-41-session30 branch March 6, 2026 15:30
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 schemas to the known_layers list used by GET /model/layers.
  • Ensure /model/layers reports 41 layers instead of 40.

Comment on lines 264 to 266
"services", "personas", "feature_flags", "containers", "endpoints",
"screens", "literals", "agents", "infrastructure", "requirements",
"schemas", "screens", "literals", "agents", "infrastructure", "requirements",
"planes", "connections", "environments", "cp_skills", "cp_agents",
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 263 to 266
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",
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 262 to 266
# 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",
Copy link

Copilot AI Mar 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants