<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2026 Southeast University.
This program is free software, you can redistribute it and/or modify it under the terms and conditions of
CANN Open Software License Agreement Version 2.0 (the "License").
Please refer to the License for details. You may not use this file except in compliance with the License.
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
See LICENSE in the root of the software repository for the full text of the License.
-->

<configuration>
    <oatconfig>
        <licensefile></licensefile>

        <policylist>
            <policy name="projectPolicy" desc="Open-source compliance policy for SimNPU">
                <policyitem
                    type="license"
                    name="CANN-2.0"
                    path=".*"
                    rule="may"
                    group="defaultGroup"
                    filefilter="defaultPolicyFilter"
                    desc="Self-developed files use CANN Open Software License Agreement Version 2.0"/>

                <policyitem
                    type="copyright"
                    name="Southeast University"
                    path=".*"
                    rule="may"
                    group="defaultGroup"
                    filefilter="copyrightPolicyFilter"
                    desc="Self-developed files are copyrighted by Southeast University"/>

                <policyitem
                    type="filetype"
                    name="!binary"
                    path=".*"
                    rule="must"
                    group="defaultGroup"
                    filefilter="binaryFileTypePolicyFilter"
                    desc="Binary files are prohibited except documented project image resources"/>
            </policy>
        </policylist>

        <filefilterlist>
            <filefilter
                name="defaultPolicyFilter"
                desc="Files excluded from compatibility and license-header policies">
                <filteritem
                    type="filename"
                    name="LICENSE"
                    desc="The repository license file contains the complete license text"/>
                <filteritem
                    type="filepath"
                    name="data/.*\.json"
                    desc="Strict JSON configuration files do not support comments"/>
                <filteritem
                    type="filepath"
                    name="data/.*\.csv"
                    desc="CSV measurement and matrix-shape data files do not use source-code license headers"/>
                <filteritem
                    type="filepath"
                    name="image/.*"
                    desc="Image resources cannot contain source-code license headers"/>
            </filefilter>

            <filefilter
                name="copyrightPolicyFilter"
                desc="Files excluded from copyright-header policies">
                <filteritem
                    type="filename"
                    name="LICENSE"
                    desc="The repository license file must retain the complete license text"/>
                <filteritem
                    type="filepath"
                    name="data/.*\.json"
                    desc="Strict JSON configuration files do not support comments"/>
                <filteritem
                    type="filepath"
                    name="data/.*\.csv"
                    desc="CSV measurement and matrix-shape data files do not use source-code copyright headers"/>
                <filteritem
                    type="filepath"
                    name="image/.*"
                    desc="Image resources cannot contain source-code copyright headers"/>
            </filefilter>

            <filefilter
                name="licenseFileNamePolicyFilter"
                desc="Filters for repository LICENSE file policies">
            </filefilter>

            <filefilter
                name="readmeFileNamePolicyFilter"
                desc="Filters for repository README file policies">
            </filefilter>

            <filefilter
                name="readmeOpenSourcefileNamePolicyFilter"
                desc="Filters for README.OpenSource file policies">
            </filefilter>

            <filefilter
                name="binaryFileTypePolicyFilter"
                desc="Documented binary resources allowed in the repository">
                <filteritem
                    type="filepath"
                    name="image/.*"
                    desc="Documentation diagrams and result images maintained by the project"/>
            </filefilter>
        </filefilterlist>

        <licensematcherlist>
            <licensematcher
                name="CANN License"
                desc="License text matcher for CANN Open Software License Agreement Version 2.0">
                <licensetext name="
                    This program is free software, you can redistribute it and/or modify it under the terms and conditions of
                    CANN Open Software License Agreement Version 2.0 (the &quot;License&quot;).
                    Please refer to the License for details. You may not use this file except in compliance with the License.
                    THIS SOFTWARE IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR IMPLIED,
                    INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE.
                    See LICENSE in the root of the software repository for the full text of the License.
                " desc=""/>
            </licensematcher>
        </licensematcherlist>
    </oatconfig>
</configuration>