ciso-assistant-api 2.3.6__tar.gz → 2.3.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. {ciso_assistant_api-2.3.6/ciso_assistant_api.egg-info → ciso_assistant_api-2.3.8}/PKG-INFO +4 -4
  2. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/README.md +1 -1
  3. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/__init__.py +17 -0
  4. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/connector_sources.py +0 -20
  5. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp_server.py +22 -16
  6. ciso_assistant_api-2.3.8/ciso_assistant_api/skills/ciso-assistant-api-development/SKILL.md +106 -0
  7. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8/ciso_assistant_api.egg-info}/PKG-INFO +4 -4
  8. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api.egg-info/SOURCES.txt +1 -0
  9. ciso_assistant_api-2.3.8/ciso_assistant_api.egg-info/entry_points.txt +8 -0
  10. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api.egg-info/requires.txt +3 -3
  11. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/pyproject.toml +5 -9
  12. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_credential_refs.py +2 -4
  13. ciso_assistant_api-2.3.8/tests/test_default_content_surfaces.py +110 -0
  14. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_fleet_name.py +1 -1
  15. ciso_assistant_api-2.3.8/tests/test_publication_workflow.py +120 -0
  16. ciso_assistant_api-2.3.6/ciso_assistant_api.egg-info/entry_points.txt +0 -14
  17. ciso_assistant_api-2.3.6/tests/test_default_content_surfaces.py +0 -43
  18. ciso_assistant_api-2.3.6/tests/test_publication_workflow.py +0 -73
  19. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/LICENSE +0 -0
  20. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/MANIFEST.in +0 -0
  21. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/__main__.py +0 -0
  22. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/__init__.py +0 -0
  23. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/_operation_manifest.py +0 -0
  24. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_analytics_metrology.py +0 -0
  25. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_assets.py +0 -0
  26. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_auth_users.py +0 -0
  27. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_base.py +0 -0
  28. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_chat.py +0 -0
  29. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_compliance.py +0 -0
  30. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_crq.py +0 -0
  31. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_ebios_rm.py +0 -0
  32. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_evidence.py +0 -0
  33. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_frameworks_libraries.py +0 -0
  34. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_governance.py +0 -0
  35. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_incidents.py +0 -0
  36. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_integrations.py +0 -0
  37. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_privacy.py +0 -0
  38. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_resilience.py +0 -0
  39. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_risk_management.py +0 -0
  40. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_security_findings.py +0 -0
  41. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_settings.py +0 -0
  42. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_tasks_timeline.py +0 -0
  43. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api/api_client_third_party.py +0 -0
  44. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/api_client.py +0 -0
  45. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/auth.py +0 -0
  46. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/bundled_mcp.json +0 -0
  47. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ciso_assistant_models.py +0 -0
  48. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/connectors/__init__.py +0 -0
  49. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/kg_ingest.py +0 -0
  50. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/kg_media.py +0 -0
  51. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/__init__.py +0 -0
  52. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_analytics_metrology.py +0 -0
  53. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_assets.py +0 -0
  54. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_auth_users.py +0 -0
  55. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_chat.py +0 -0
  56. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_compliance.py +0 -0
  57. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_crq.py +0 -0
  58. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_custom_api.py +0 -0
  59. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_ebios_rm.py +0 -0
  60. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_evidence.py +0 -0
  61. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_frameworks_libraries.py +0 -0
  62. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_governance.py +0 -0
  63. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_incidents.py +0 -0
  64. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_integrations.py +0 -0
  65. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_kg_ingest.py +0 -0
  66. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_privacy.py +0 -0
  67. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_resilience.py +0 -0
  68. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_risk_management.py +0 -0
  69. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_security_findings.py +0 -0
  70. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_settings.py +0 -0
  71. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_tasks_timeline.py +0 -0
  72. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/mcp/mcp_third_party.py +0 -0
  73. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/__init__.py +0 -0
  74. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/certification.json +0 -0
  75. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/ciso.ttl +0 -0
  76. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/fixtures/records.json +0 -0
  77. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/mappings/source.yaml +0 -0
  78. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/migrations/manifest.json +0 -0
  79. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/ontology/shapes/connector.shacl.ttl +0 -0
  80. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/prompts/__init__.py +0 -0
  81. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/prompts/grc_specialist.json +0 -0
  82. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/__init__.py +0 -0
  83. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/ciso-assistant-compliance-audit/SKILL.md +0 -0
  84. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/ciso-assistant-incident-evidence/SKILL.md +0 -0
  85. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/ciso-assistant-operations/SKILL.md +0 -0
  86. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/ciso-assistant-operations/agents/openai.yaml +0 -0
  87. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/skills/ciso-assistant-risk-management/SKILL.md +0 -0
  88. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api/specs/ciso_assistant.json +0 -0
  89. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api.egg-info/dependency_links.txt +0 -0
  90. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/ciso_assistant_api.egg-info/top_level.txt +0 -0
  91. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/scripts/generate_from_openapi.py +0 -0
  92. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/scripts/security_sanitizer.py +0 -0
  93. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/setup.cfg +0 -0
  94. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/__init__.py +0 -0
  95. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/characterization/test_cxa_fl_cisoassistantapi_01_routing.py +0 -0
  96. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/characterization/test_cxa_fl_cisoassistantapi_02_routing.py +0 -0
  97. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/characterization/test_cxa_fl_cisoassistantapi_03_routing.py +0 -0
  98. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/conftest.py +0 -0
  99. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_auth.py +0 -0
  100. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_ciso_assistant_brute_force_coverage.py +0 -0
  101. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_ciso_assistant_coverage.py +0 -0
  102. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_kg_ingest.py +0 -0
  103. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_kg_media.py +0 -0
  104. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_mcp_server.py +0 -0
  105. {ciso_assistant_api-2.3.6 → ciso_assistant_api-2.3.8}/tests/test_startup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ciso-assistant-api
3
- Version: 2.3.6
3
+ Version: 2.3.8
4
4
  Summary: CISO Assistant API + MCP Server — 100% API coverage
5
5
  Author: Knuckles-Team
6
6
  License: MIT
@@ -12,13 +12,13 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
15
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6
16
16
  Requires-Dist: python-dotenv>=1.2.4
17
17
  Requires-Dist: requests>=2.34.2
18
18
  Provides-Extra: mcp
19
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
19
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "mcp"
20
20
  Provides-Extra: all
21
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "all"
21
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "all"
22
22
  Provides-Extra: test
23
23
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
24
24
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -14,4 +14,4 @@ One multi-stage `docker/Dockerfile` builds the MCP-only image (`--target mcp`):
14
14
  | `${CISO_ASSISTANT_MCP_IMAGE}` | `--target mcp` | `ciso-assistant-api[mcp]` — MCP + `epistemic-graph[full]`, no agent runtime | `ciso-assistant-mcp` |
15
15
 
16
16
  ```bash
17
- docker build --target mcp -t "${CISO_ASSISTANT_MCP_IMAGE}" docker/
17
+ docker build --target mcp -t "${CISO_ASSISTANT_MCP_IMAGE}" docker/
@@ -60,3 +60,20 @@ Python CISO Assistant API client + MCP server + A2A agent with 100% API coverage
60
60
 
61
61
  CONCEPT:AU-ECO.connector.ciso-assistant — CISO Assistant GRC connector (api-client + MCP + A2A).
62
62
  """
63
+
64
+
65
+ from agent_connector_sdk.connector import Connector
66
+ from agent_connector_sdk.connector_hooks import RegistrationContext
67
+
68
+
69
+ def _register_legacy_surface(context: RegistrationContext) -> None:
70
+ """Reuse the existing server registrations through the public SDK hook."""
71
+ from ciso_assistant_api.mcp_server import register_server_surface
72
+
73
+ context.settings._ciso_registered_tags = register_server_surface(context.server)
74
+
75
+
76
+ connector = Connector(
77
+ instructions="CISO Assistant MCP Server",
78
+ extra_registrations=(_register_legacy_surface,),
79
+ )
@@ -7,7 +7,6 @@ Served live as ``connector://resources``. Regenerate by editing the declarations
7
7
  from __future__ import annotations
8
8
 
9
9
  from agent_connector_sdk.ingest.live_declaration import source_meta
10
- from agent_connector_sdk.ingest.sources import IngestSourceDeclaration, IngestSourceSpec
11
10
 
12
11
  CONNECTOR = "ciso-assistant-mcp"
13
12
 
@@ -245,22 +244,3 @@ RESOURCES = (
245
244
  "name": "Vulnerability",
246
245
  },
247
246
  )
248
-
249
-
250
- def declaration() -> IngestSourceDeclaration:
251
- """The declaration the server assembles from this module."""
252
- specs = []
253
- for item in SOURCES:
254
- for entry in item["connector_sources"]:
255
- body = {k: v for k, v in entry.items() if k not in ("tool", "mapping")}
256
- specs.append(
257
- IngestSourceSpec.model_validate({**body, "tools": (entry["tool"],)})
258
- )
259
- return IngestSourceDeclaration.model_validate(
260
- {
261
- "connector": CONNECTOR,
262
- "sources": specs,
263
- "schema_mappings": SCHEMA_MAPPINGS,
264
- "resources": RESOURCES,
265
- }
266
- )
@@ -2,10 +2,11 @@
2
2
 
3
3
  import logging
4
4
  import sys
5
- from typing import Any
5
+ from typing import Any, NamedTuple
6
6
 
7
7
  from agent_connector_sdk.config import load_config, setting
8
- from agent_connector_sdk.mcp.server import create_mcp_server
8
+ from agent_connector_sdk.connector import build_server
9
+ from agent_connector_sdk.connector_identity import connector_version
9
10
  from agent_connector_sdk.mcp.tool_surface import register_tool_surface
10
11
  from fastmcp import FastMCP
11
12
  from fastmcp.utilities.logging import get_logger
@@ -14,7 +15,7 @@ from ciso_assistant_api.api._operation_manifest import OPERATIONS
14
15
  from ciso_assistant_api.api_client import Api
15
16
  from ciso_assistant_api.auth import get_client
16
17
 
17
- __version__ = "2.3.6"
18
+ __version__ = connector_version("ciso_assistant_api")
18
19
 
19
20
  # Redirect logging to stderr to prevent MCP stdout corruption
20
21
  logger = get_logger(name="ciso_assistant_mcp")
@@ -28,16 +29,8 @@ def register_prompts(mcp: FastMCP):
28
29
  return f"Please help with '{query}' using CISO Assistant"
29
30
 
30
31
 
31
- def get_mcp_instance() -> tuple[Any, Any, Any, Any]:
32
- """Initialize and return the CISO Assistant MCP instance, args, and middlewares."""
33
- load_config()
34
-
35
- args, mcp, middlewares = create_mcp_server(
36
- name="CISO Assistant MCP",
37
- version=__version__,
38
- instructions="CISO Assistant MCP Server",
39
- )
40
-
32
+ def register_server_surface(mcp: FastMCP):
33
+ """Register the existing API, ingestion and prompt surface unchanged."""
41
34
  # One central call selects the surface per MCP_TOOL_MODE: condensed gates each
42
35
  # generated TOOL_REGISTRY domain via setting("<TAG>TOOL", True); verbose adds
43
36
  # the fully-typed 1:1 tools sourced from the OpenAPI manifest (OPERATIONS).
@@ -64,10 +57,23 @@ def get_mcp_instance() -> tuple[Any, Any, Any, Any]:
64
57
 
65
58
  register_prompts(mcp)
66
59
 
67
- for mw in middlewares:
68
- mcp.add_middleware(mw)
60
+ return registered_tags
61
+
69
62
 
70
- return mcp, args, middlewares, registered_tags
63
+ class ServerComponents(NamedTuple):
64
+ """Preserve the legacy startup tuple while naming its collaborators."""
65
+
66
+ server: FastMCP[Any]
67
+ args: Any
68
+ middlewares: list[Any]
69
+ registered_tags: Any
70
+
71
+
72
+ def get_mcp_instance(*, command_args=None) -> ServerComponents:
73
+ """Build the declared SDK server after loading the legacy CLI configuration."""
74
+ load_config()
75
+ args, mcp = build_server("ciso_assistant_api", command_args=command_args)
76
+ return ServerComponents(mcp, args, list(mcp.middleware), args._ciso_registered_tags)
71
77
 
72
78
 
73
79
  def mcp_server():
@@ -0,0 +1,106 @@
1
+ ---
2
+ name: ciso-assistant-api-development
3
+ skill_type: skill
4
+ description: >-
5
+ Develop and verify ciso-assistant-api as a connector-owned package while
6
+ preserving its generated CISO Assistant client, action-routed MCP tools,
7
+ SDK authentication boundary, packaged content, and spec-delivery contract.
8
+ ---
9
+
10
+ # CISO Assistant API Development
11
+
12
+ Use this skill for changes to the `ciso-assistant-api` connector. The package
13
+ owns CISO Assistant API calls, mappings, MCP tools, and connector content; it
14
+ does not own the connector SDK, Arbora admission, the shared Pages renderer, or
15
+ Pipelines hooks.
16
+
17
+ ## Repository map and runtime boundary
18
+
19
+ - `ciso_assistant_api/specs/*.json` are the vendored OpenAPI sources. The
20
+ generator emits the domain clients, operation manifest, and generated MCP
21
+ modules; change the generator or source spec before regenerating those files.
22
+ - `ciso_assistant_api/api_client.py` composes the generated API domains, while
23
+ `api/api_client_base.py`, `auth.py`, and `mcp/mcp_custom_api.py` contain the
24
+ hand-authored client, authentication, and custom surface. Preserve the SDK
25
+ `Connector` registration in `__init__.py`.
26
+ - `mcp_server.py` registers the action-routed generated tool domains, typed
27
+ verbose operations, opt-in KG ingestion, and prompts. Keep the
28
+ `MCP_TOOL_MODE` and `KG_INGESTTOOL` boundaries intact when changing tools.
29
+ - `ciso_assistant_api/ontology/`, `prompts/`, and `skills/` are packaged
30
+ connector content. The package-data table includes these trees; inspect a
31
+ built wheel when changing them.
32
+ - `auth.py` resolves `CISO_ASSISTANT_URL`, referenced credentials, delegation,
33
+ and the named CISO Assistant TLS profile. Keep secret values out of source,
34
+ tests, logs, and durable connector configuration.
35
+
36
+ ## Rapid delivery: the 5-minute contract
37
+
38
+ 1. Read the owning `specs/` row and this repository's `AGENTS.md` before
39
+ editing.
40
+ 2. Inspect the active generated client or MCP registration path and its
41
+ focused tests before changing API behavior, auth, ontology content, or
42
+ packaged skills.
43
+ 3. Prefer the smallest connector-owned change. Preserve generated-file
44
+ provenance, action names, parameter schemas, SDK `Connector` wiring, CISO
45
+ Assistant authentication, and package-data declarations.
46
+ 4. Run focused tests through the narrow test-slot wrapper, then run the
47
+ repository pre-commit and pre-push gates without bypasses.
48
+ 5. For public packaged content, update the patch version and `uv.lock`
49
+ together; inspect the built wheel for the new skill.
50
+ 6. Treat Pages as a separate proof: after the exact main SHA has a successful
51
+ Pages run, check `/spec-delivery/`, its `index.html`, and `snapshot.json`
52
+ over HTTPS and record the revision from the snapshot.
53
+
54
+ ## Focused development commands
55
+
56
+ From the repository root:
57
+
58
+ ```bash
59
+ uv sync --locked
60
+
61
+ /var/tmp/arbora-delivery/scale/run-narrow-test-slot.sh \
62
+ uv run --locked --extra test pytest -q \
63
+ tests/test_publication_workflow.py \
64
+ tests/test_default_content_surfaces.py \
65
+ tests/test_mcp_server.py
66
+
67
+ uvx pre-commit run --all-files
68
+ uvx pre-commit run --all-files --hook-stage pre-push
69
+ ```
70
+
71
+ These checks cover the publication contract, packaged content, and MCP server
72
+ surface. Keep tests credential-free and do not replace them with a live CISO
73
+ Assistant call.
74
+
75
+ ## Pages and package publication
76
+
77
+ `.github/workflows/pages.yml` is the one Pages caller. It invokes the shared
78
+ Pipelines `pages_pipeline.yml@main` workflow with the dashboard enabled and
79
+ keeps the docs, specs, dashboard configuration, and workflow path filters.
80
+ After a merge, verify the exact main SHA in the successful Pages run and probe:
81
+
82
+ ```bash
83
+ curl -fsSI https://knuckles-team.github.io/ciso-assistant-api/
84
+ curl -fsSI https://knuckles-team.github.io/ciso-assistant-api/spec-delivery/
85
+ curl -fsSI https://knuckles-team.github.io/ciso-assistant-api/spec-delivery/index.html
86
+ curl -fsS https://knuckles-team.github.io/ciso-assistant-api/spec-delivery/snapshot.json
87
+ ```
88
+
89
+ Keep package and container publication on their shared Pipelines workflows.
90
+ Inspect generated output and the built wheel before making a public release
91
+ claim; a local build does not prove Pages or registry publication.
92
+
93
+ ## Change discipline
94
+
95
+ - Keep CISO Assistant API calls, request models, ontology mappings, and MCP
96
+ schemas under this repository's `CONN-CISO-ASSISTANT-API-*` boundary. The
97
+ connector SDK and shared Pipelines behavior belong to their owner repositories.
98
+ - Do not hand-edit generated API clients, operation manifests, or generated MCP
99
+ modules. Use `scripts/generate_from_openapi.py` and inspect the resulting diff.
100
+ - Use `CISO_ASSISTANT_TOKEN_REF` or the username/password reference settings
101
+ only through the runtime credential boundary. Preserve TLS verification and
102
+ the named profile path.
103
+ - Keep KG ingestion opt-in and preserve its privacy, tenant, provenance, and
104
+ attachment policy. Do not claim graph persistence from a local mock.
105
+ - For mutations, inspect current state first and require operator approval
106
+ where the existing connector procedure calls for it.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ciso-assistant-api
3
- Version: 2.3.6
3
+ Version: 2.3.8
4
4
  Summary: CISO Assistant API + MCP Server — 100% API coverage
5
5
  Author: Knuckles-Team
6
6
  License: MIT
@@ -12,13 +12,13 @@ Classifier: Programming Language :: Python :: 3
12
12
  Requires-Python: <3.15,>=3.12
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1
15
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6
16
16
  Requires-Dist: python-dotenv>=1.2.4
17
17
  Requires-Dist: requests>=2.34.2
18
18
  Provides-Extra: mcp
19
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "mcp"
19
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "mcp"
20
20
  Provides-Extra: all
21
- Requires-Dist: agent-connector-sdk[mcp]<1.0.0,>=0.4.1; extra == "all"
21
+ Requires-Dist: scion-sdk[mcp]<1.0.0,>=0.5.6; extra == "all"
22
22
  Provides-Extra: test
23
23
  Requires-Dist: pytest-xdist>=3.8.0; extra == "test"
24
24
  Requires-Dist: pytest>=9.1.1; extra == "test"
@@ -73,6 +73,7 @@ ciso_assistant_api/ontology/shapes/connector.shacl.ttl
73
73
  ciso_assistant_api/prompts/__init__.py
74
74
  ciso_assistant_api/prompts/grc_specialist.json
75
75
  ciso_assistant_api/skills/__init__.py
76
+ ciso_assistant_api/skills/ciso-assistant-api-development/SKILL.md
76
77
  ciso_assistant_api/skills/ciso-assistant-compliance-audit/SKILL.md
77
78
  ciso_assistant_api/skills/ciso-assistant-incident-evidence/SKILL.md
78
79
  ciso_assistant_api/skills/ciso-assistant-operations/SKILL.md
@@ -0,0 +1,8 @@
1
+ [agent_connector_sdk.connector]
2
+ ciso-assistant-mcp = ciso_assistant_api:connector
3
+
4
+ [agent_connector_sdk.prompt_providers]
5
+ ciso-assistant-api = ciso_assistant_api.prompts
6
+
7
+ [console_scripts]
8
+ ciso-assistant-mcp = ciso_assistant_api.mcp_server:mcp_server
@@ -1,12 +1,12 @@
1
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
1
+ scion-sdk[mcp]<1.0.0,>=0.5.6
2
2
  python-dotenv>=1.2.4
3
3
  requests>=2.34.2
4
4
 
5
5
  [all]
6
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
6
+ scion-sdk[mcp]<1.0.0,>=0.5.6
7
7
 
8
8
  [mcp]
9
- agent-connector-sdk[mcp]<1.0.0,>=0.4.1
9
+ scion-sdk[mcp]<1.0.0,>=0.5.6
10
10
 
11
11
  [test]
12
12
  pytest-xdist>=3.8.0
@@ -4,12 +4,12 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ciso-assistant-api"
7
- version = "2.3.6"
7
+ version = "2.3.8"
8
8
  description = "CISO Assistant API + MCP Server — 100% API coverage"
9
9
  readme = "README.md"
10
10
  classifiers = [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Environment :: Console", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 3",]
11
11
  requires-python = ">=3.12, <3.15"
12
- dependencies = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0", "python-dotenv>=1.2.4", "requests>=2.34.2",]
12
+ dependencies = [ "scion-sdk[mcp]>=0.5.6,<1.0.0", "python-dotenv>=1.2.4", "requests>=2.34.2",]
13
13
  [[project.authors]]
14
14
  name = "Knuckles-Team"
15
15
 
@@ -17,26 +17,22 @@ name = "Knuckles-Team"
17
17
  text = "MIT"
18
18
 
19
19
  [project.optional-dependencies]
20
- mcp = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0",]
21
- all = [ "agent-connector-sdk[mcp]>=0.4.1,<1.0.0",]
20
+ mcp = [ "scion-sdk[mcp]>=0.5.6,<1.0.0",]
21
+ all = [ "scion-sdk[mcp]>=0.5.6,<1.0.0",]
22
22
  test = [
23
23
  "pytest-xdist>=3.8.0", "pytest>=9.1.1", "pytest-asyncio>=1.4.0", "pytest-cov>=7.1.0",]
24
24
 
25
25
  [project.scripts]
26
26
  ciso-assistant-mcp = "ciso_assistant_api.mcp_server:mcp_server"
27
27
 
28
- [project.entry-points."agent_connector_sdk.skill_providers"]
29
- ciso-assistant-api = "ciso_assistant_api.skills"
30
28
 
31
- [project.entry-points."agent_connector_sdk.ontology_providers"]
32
- ciso-assistant-api = "ciso_assistant_api.ontology"
33
29
 
34
30
  [project.entry-points."agent_connector_sdk.prompt_providers"]
35
31
  ciso-assistant-api = "ciso_assistant_api.prompts"
36
32
 
37
33
  # The one declared connector identity: the fleet name (SDK-CONNECTOR-CONTROL-R071).
38
34
  [project.entry-points."agent_connector_sdk.connector"]
39
- ciso-assistant-mcp = "ciso_assistant_api"
35
+ ciso-assistant-mcp = "ciso_assistant_api:connector"
40
36
 
41
37
  [tool.uv.workspace]
42
38
  members = ["."]
@@ -11,12 +11,10 @@ from ciso_assistant_api.api_client import Api
11
11
  @pytest.mark.spec("CONN-CISO-ASSISTANT-API-R001")
12
12
  def test_sdk_floor_is_declared():
13
13
  text = (Path(__file__).parent.parent / "pyproject.toml").read_text()
14
- floors = re.findall(
15
- r"agent-connector-sdk(?:\[[^\]]*\])?>=(\d+)\.(\d+)\.(\d+)", text
16
- )
14
+ floors = re.findall(r"scion-sdk(?:\[[^\]]*\])?>=(\d+)\.(\d+)\.(\d+)", text)
17
15
  assert floors
18
16
  for floor in floors:
19
- assert tuple(map(int, floor)) >= (0, 3, 10)
17
+ assert tuple(map(int, floor)) >= (0, 5, 6)
20
18
 
21
19
 
22
20
  @pytest.mark.spec("CONN-CISO-ASSISTANT-API-R002")
@@ -0,0 +1,110 @@
1
+ """CONN-CISO-ASSISTANT-API-CONNECTOR-CONTENT-R001: the server lists its packaged skills, ontology and prompts by default."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import asyncio
6
+ import importlib
7
+ from pathlib import Path
8
+
9
+ import pytest
10
+ from fastmcp import Client
11
+
12
+ PACKAGE = "ciso_assistant_api"
13
+ ROOT = Path(list(importlib.import_module(PACKAGE).__path__)[0])
14
+
15
+ pytestmark = pytest.mark.spec("CONN-CISO-ASSISTANT-API-CONNECTOR-CONTENT-R001")
16
+
17
+
18
+ def _server():
19
+ from ciso_assistant_api.mcp_server import get_mcp_instance
20
+
21
+ return get_mcp_instance(
22
+ command_args=["--transport", "stdio", "--auth-type", "none"]
23
+ )[0]
24
+
25
+
26
+ async def _assert_packaged_resources(client, resources):
27
+ for uri in resources:
28
+ if uri.startswith(("ontology://", "shapes://")):
29
+ directory = ROOT / "ontology"
30
+ if uri.startswith("shapes://"):
31
+ directory /= "shapes"
32
+ actual = await client.read_resource(uri)
33
+ assert (
34
+ actual[0].text.encode()
35
+ == (directory / uri.rsplit("/", 1)[-1]).read_bytes()
36
+ )
37
+
38
+
39
+ async def _listings():
40
+ async with Client(_server()) as client:
41
+ resources = {str(r.uri) for r in await client.list_resources()}
42
+ prompts = {p.name for p in await client.list_prompts()}
43
+ await _assert_packaged_resources(client, resources)
44
+ return resources, prompts
45
+
46
+
47
+ def test_default_content_surfaces() -> None:
48
+ resources, prompts = asyncio.run(_listings())
49
+ if list(ROOT.glob("skills/*/SKILL.md")):
50
+ assert any(u.startswith("skill://") for u in resources)
51
+ if list(ROOT.glob("ontology/*.ttl")):
52
+ assert any(u.startswith("ontology://ciso-assistant-mcp/") for u in resources)
53
+ for path in ROOT.glob("prompts/*.json"):
54
+ if not path.name.startswith("_"):
55
+ assert path.stem in prompts
56
+
57
+
58
+ @pytest.fixture(autouse=True)
59
+ def _no_outbound_network(monkeypatch):
60
+ import socket
61
+
62
+ def refuse(*args, **kwargs):
63
+ raise AssertionError("content construction must not contact an external system")
64
+
65
+ monkeypatch.setenv("MCP_FLEET_REGISTRATION", "false")
66
+ monkeypatch.setattr(socket.socket, "connect", refuse)
67
+
68
+
69
+ def test_production_pack_binds_packaged_ontology_and_shapes():
70
+ import hashlib
71
+ from importlib.metadata import version
72
+
73
+ from agent_connector_sdk.artifacts.pack import build_content_pack
74
+ from agent_connector_sdk.artifacts.resources import ResourceArtifactKind
75
+ from agent_connector_sdk.ports.session import TransportEndpoint
76
+ from agent_connector_sdk.transports.mcp import McpTransport
77
+
78
+ async def capture():
79
+ async with McpTransport().session(
80
+ TransportEndpoint(in_process=_server())
81
+ ) as session:
82
+ return await build_content_pack(
83
+ session, connector="ciso-assistant-mcp", kinds=(ResourceArtifactKind(),)
84
+ )
85
+
86
+ pack = asyncio.run(capture())
87
+ assert pack.server_package_version == version("ciso-assistant-api")
88
+ entries = {str(entry.uri): entry for entry in pack.archive.entries}
89
+ assert "connector://resources" in entries
90
+ for path in ROOT.glob("ontology/**/*.ttl"):
91
+ scheme = "shapes" if path.parent.name == "shapes" else "ontology"
92
+ uri = f"{scheme}://ciso-assistant-mcp/{path.name}"
93
+ assert entries[uri].body.sha256 == hashlib.sha256(path.read_bytes()).hexdigest()
94
+
95
+
96
+ def test_public_sdk_floor_supports_the_served_descriptor_protocol():
97
+ import tomllib
98
+ from packaging.requirements import Requirement
99
+
100
+ project = tomllib.loads((ROOT.parent / "pyproject.toml").read_text())["project"]
101
+ declared = list(project["dependencies"])
102
+ for extra in project.get("optional-dependencies", {}).values():
103
+ declared.extend(extra)
104
+ requirements = [
105
+ Requirement(value) for value in declared if value.startswith("scion-sdk")
106
+ ]
107
+ assert requirements
108
+ for requirement in requirements:
109
+ assert requirement.specifier.contains("0.5.6")
110
+ assert not requirement.specifier.contains("0.5.5")
@@ -35,7 +35,7 @@ def _call_connectors(path: Path) -> list[str]:
35
35
  def test_connector_name_is_the_fleet_name() -> None:
36
36
  pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
37
37
  assert pyproject["project"]["entry-points"]["agent_connector_sdk.connector"] == {
38
- FLEET: "ciso_assistant_api"
38
+ FLEET: "ciso_assistant_api:connector"
39
39
  }
40
40
  assert connector_name("ciso_assistant_api") == FLEET
41
41
  for module in sorted(PACKAGE.glob("*.py")):
@@ -0,0 +1,120 @@
1
+ """Keep docs pushes separate from guarded package publication."""
2
+
3
+ from fnmatch import fnmatchcase
4
+ from pathlib import Path
5
+
6
+ import pytest
7
+ import yaml
8
+
9
+ ROOT = Path(__file__).resolve().parents[1]
10
+ CONTRACT = "main"
11
+
12
+
13
+ def _workflow(name):
14
+ return yaml.safe_load((ROOT / ".github/workflows" / name).read_text())
15
+
16
+
17
+ def _push_matches(workflow, ref):
18
+ # PyYAML's YAML 1.1 reader represents the Actions "on" key as True.
19
+ push = workflow[True]["push"]
20
+ kind, name = ref.removeprefix("refs/").split("/", 1)
21
+ filters = push.get({"heads": "branches", "tags": "tags"}[kind], [])
22
+ return any(fnmatchcase(name, pattern) for pattern in filters)
23
+
24
+
25
+ @pytest.mark.parametrize(
26
+ "ref, expected",
27
+ [
28
+ ("refs/heads/main", True),
29
+ ("refs/heads/docs-update", False),
30
+ ("refs/tags/v2.1.0", False),
31
+ ],
32
+ )
33
+ def test_only_main_starts_package_publication(ref, expected):
34
+ assert _push_matches(_workflow("pipeline.yml"), ref) is expected
35
+
36
+
37
+ def test_each_package_publisher_uses_the_shared_pipelines():
38
+ jobs = _workflow("pipeline.yml")["jobs"]
39
+ assert set(jobs) == {"publish-pypi"}
40
+ assert jobs["publish-pypi"]["uses"].endswith("/python_pipeline.yml@main")
41
+ assert _workflow("pipeline.yml")[True]["push"]["paths-ignore"] == [
42
+ "docker/Dockerfile",
43
+ ".bumpversion.cfg",
44
+ ]
45
+ container = _workflow("container-release.yml")
46
+ assert container[True]["push"] == {
47
+ "branches": ["main"],
48
+ "paths": ["docker/Dockerfile"],
49
+ }
50
+ assert container["jobs"]["publish-docker"]["needs"] == "verify-public-wheel"
51
+ assert container["jobs"]["publish-docker"]["uses"].endswith(
52
+ "/container_pipeline.yml@main"
53
+ )
54
+ for publisher in (jobs["publish-pypi"], container["jobs"]["publish-docker"]):
55
+ assert "if" not in publisher
56
+ assert not publisher.get("continue-on-error", False)
57
+ guard = container["jobs"]["verify-public-wheel"]["steps"][-1]
58
+ assert guard["with"] == {
59
+ "mode": "published-wheel",
60
+ "distribution": "ciso-assistant-api",
61
+ "module": "ciso_assistant_api",
62
+ }
63
+
64
+
65
+ def test_pages_keeps_shared_main_and_spec_triggers():
66
+ workflow = _workflow("pages.yml")
67
+ publisher = workflow["jobs"]["publish-pages"]
68
+ assert publisher["uses"].endswith("/pages_pipeline.yml@main")
69
+ assert publisher["with"]["spec_dashboard_enabled"] is True
70
+ assert "specs/**" in workflow[True]["push"]["paths"]
71
+ assert ".github/spec-dashboard.json" in workflow[True]["push"]["paths"]
72
+
73
+
74
+ def test_release_hook_inherits_catalogue_policy():
75
+ config = yaml.safe_load((ROOT / ".pre-commit-config.yaml").read_text())
76
+ matches = [
77
+ (repo, hook)
78
+ for repo in config["repos"]
79
+ for hook in repo["hooks"]
80
+ if hook["id"] == "dependency-readiness"
81
+ ]
82
+ assert len(matches) == 1
83
+ repo, hook = matches[0]
84
+ assert repo["repo"] == "https://github.com/Knuckles-Team/pipelines"
85
+ assert repo["rev"] == CONTRACT
86
+ assert hook == {"id": "dependency-readiness"}
87
+
88
+
89
+ def test_spec_delivery_uses_canonical_aggregate_and_development_skill():
90
+ config = yaml.safe_load((ROOT / ".pre-commit-config.yaml").read_text())
91
+ pipelines = next(
92
+ repo
93
+ for repo in config["repos"]
94
+ if repo["repo"] == "https://github.com/Knuckles-Team/pipelines"
95
+ )
96
+ assert pipelines["rev"] == CONTRACT
97
+ assert [hook["id"] for hook in pipelines["hooks"]].count("spec") == 1
98
+
99
+ skill = (
100
+ ROOT / "ciso_assistant_api/skills/ciso-assistant-api-development/SKILL.md"
101
+ ).read_text()
102
+ assert "name: ciso-assistant-api-development" in skill
103
+ assert "## Rapid delivery: the 5-minute contract" in skill
104
+
105
+
106
+ @pytest.mark.parametrize(
107
+ "path, expected",
108
+ [
109
+ ("docker/Dockerfile", False),
110
+ (".bumpversion.cfg", False),
111
+ ("pyproject.toml", True),
112
+ ("uv.lock", True),
113
+ ("ciso_assistant_api/mcp_server.py", True),
114
+ ("README.md", True),
115
+ (".github/workflows/pipeline.yml", True),
116
+ ],
117
+ )
118
+ def test_package_publication_skips_only_container_pin_refresh(path, expected):
119
+ ignores = _workflow("pipeline.yml")[True]["push"]["paths-ignore"]
120
+ assert (not any(fnmatchcase(path, pattern) for pattern in ignores)) is expected
@@ -1,14 +0,0 @@
1
- [agent_connector_sdk.connector]
2
- ciso-assistant-mcp = ciso_assistant_api
3
-
4
- [agent_connector_sdk.ontology_providers]
5
- ciso-assistant-api = ciso_assistant_api.ontology
6
-
7
- [agent_connector_sdk.prompt_providers]
8
- ciso-assistant-api = ciso_assistant_api.prompts
9
-
10
- [agent_connector_sdk.skill_providers]
11
- ciso-assistant-api = ciso_assistant_api.skills
12
-
13
- [console_scripts]
14
- ciso-assistant-mcp = ciso_assistant_api.mcp_server:mcp_server
@@ -1,43 +0,0 @@
1
- """CONN-CISO-ASSISTANT-API-CONNECTOR-CONTENT-R001: the server lists its packaged skills, ontology and prompts by default."""
2
-
3
- from __future__ import annotations
4
-
5
- import asyncio
6
- import importlib
7
- from pathlib import Path
8
-
9
- import pytest
10
- from fastmcp import Client
11
-
12
- PACKAGE = "ciso_assistant_api"
13
- ROOT = Path(list(importlib.import_module(PACKAGE).__path__)[0])
14
-
15
- pytestmark = pytest.mark.spec("CONN-CISO-ASSISTANT-API-CONNECTOR-CONTENT-R001")
16
-
17
-
18
- def _server():
19
- namespace = {"__name__": PACKAGE + ".mcp_server"}
20
- exec(
21
- "from agent_connector_sdk.mcp.server import create_mcp_server\n"
22
- "result = create_mcp_server('ciso-assistant-mcp', version='0', command_args=[])",
23
- namespace,
24
- )
25
- return namespace["result"][1]
26
-
27
-
28
- async def _listings():
29
- async with Client(_server()) as client:
30
- resources = {str(r.uri) for r in await client.list_resources()}
31
- prompts = {p.name for p in await client.list_prompts()}
32
- return resources, prompts
33
-
34
-
35
- def test_default_content_surfaces() -> None:
36
- resources, prompts = asyncio.run(_listings())
37
- if list(ROOT.glob("skills/*/SKILL.md")):
38
- assert any(u.startswith("skill://") for u in resources)
39
- if list(ROOT.glob("ontology/*.ttl")):
40
- assert any(u.startswith("ontology://ciso-assistant-mcp/") for u in resources)
41
- for path in ROOT.glob("prompts/*.json"):
42
- if not path.name.startswith("_"):
43
- assert path.stem in prompts
@@ -1,73 +0,0 @@
1
- """Keep docs pushes separate from guarded package publication."""
2
-
3
- from fnmatch import fnmatchcase
4
- from pathlib import Path
5
-
6
- import pytest
7
- import yaml
8
-
9
- ROOT = Path(__file__).resolve().parents[1]
10
- CONTRACT = "ed8ea8ac5989cbc883c149843b311aeecb44e6a2"
11
-
12
-
13
- def _workflow(name):
14
- return yaml.safe_load((ROOT / ".github/workflows" / name).read_text())
15
-
16
-
17
- def _push_matches(workflow, ref):
18
- # PyYAML's YAML 1.1 reader represents the Actions "on" key as True.
19
- push = workflow[True]["push"]
20
- kind, name = ref.removeprefix("refs/").split("/", 1)
21
- filters = push.get({"heads": "branches", "tags": "tags"}[kind], [])
22
- return any(fnmatchcase(name, pattern) for pattern in filters)
23
-
24
-
25
- @pytest.mark.parametrize(
26
- "ref, expected",
27
- [
28
- ("refs/heads/main", True),
29
- ("refs/heads/docs-update", False),
30
- ("refs/tags/v2.1.0", False),
31
- ],
32
- )
33
- def test_only_main_starts_package_publication(ref, expected):
34
- assert _push_matches(_workflow("pipeline.yml"), ref) is expected
35
-
36
-
37
- def test_each_package_publisher_uses_the_shared_pipelines():
38
- jobs = _workflow("pipeline.yml")["jobs"]
39
- assert set(jobs) == {"publish-pypi", "publish-docker"}
40
- for job, workflow in [
41
- ("publish-pypi", "python_pipeline"),
42
- ("publish-docker", "container_pipeline"),
43
- ]:
44
- assert jobs[job]["uses"] == (
45
- f"Knuckles-Team/pipelines/.github/workflows/{workflow}.yml@main"
46
- )
47
- assert "if" not in jobs[job]
48
- assert not jobs[job].get("continue-on-error", False)
49
- assert jobs["publish-docker"]["needs"] == "publish-pypi"
50
-
51
-
52
- def test_pages_keeps_shared_main_and_spec_triggers():
53
- workflow = _workflow("pages.yml")
54
- publisher = workflow["jobs"]["publish-pages"]
55
- assert publisher["uses"].endswith("/pages_pipeline.yml@main")
56
- assert publisher["with"]["spec_dashboard_enabled"] is True
57
- assert "specs/**" in workflow[True]["push"]["paths"]
58
- assert ".github/spec-dashboard.json" in workflow[True]["push"]["paths"]
59
-
60
-
61
- def test_release_hook_inherits_catalogue_policy():
62
- config = yaml.safe_load((ROOT / ".pre-commit-config.yaml").read_text())
63
- matches = [
64
- (repo, hook)
65
- for repo in config["repos"]
66
- for hook in repo["hooks"]
67
- if hook["id"] == "dependency-readiness"
68
- ]
69
- assert len(matches) == 1
70
- repo, hook = matches[0]
71
- assert repo["repo"] == "https://github.com/Knuckles-Team/pipelines"
72
- assert repo["rev"] == CONTRACT
73
- assert hook == {"id": "dependency-readiness"}