Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/governance/006_INDEX_CI_RULES.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CI Policy Rules
Comment thread
tomtastisch marked this conversation as resolved.
<!-- NOTE: This file should be named `CI_POLICY.MD` (uppercase extension) to be picked up by governance tooling that globs for `*.MD`. -->

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

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

The NOTE about needing to name this file CI_POLICY.MD to be picked up by governance tooling appears incorrect/misleading: tooling already scans all docs/**/*.MD files (e.g., tools/check-doc-consistency.py uses DOCS_DIR.rglob("*.MD")), and the policy ROC tooling looks specifically for filenames containing POLICY (see tools/check-policy-roc.py). Please update or remove this NOTE so it accurately reflects how the repository’s governance tooling discovers markdown files.

Suggested change
<!-- NOTE: This file should be named `CI_POLICY.MD` (uppercase extension) to be picked up by governance tooling that globs for `*.MD`. -->

Copilot uses AI. Check for mistakes.

| rule_id | file |
| --- | --- |
| `CI-ARTIFACT-000` | `tools/ci/policies/rules/artifact_contract.yaml` |
| `CI-DOCS-000` | `tools/ci/policies/rules/docs_drift.yaml` |
| `CI-NAMING-000` | `tools/ci/policies/rules/naming_snt.yaml` |
| `CI-SHELL-000` | `tools/ci/policies/rules/shell_safety.yaml` |
| `CI-VERSION-000` | `tools/ci/policies/rules/versioning_svt.yaml` |
2 changes: 1 addition & 1 deletion tools/ci/checks/PolicyRunner/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ static bool IsConfiguredBinaryPath(string path, IReadOnlyList<string> configured
var unknownRootKeys = root.Children.Keys
.OfType<YamlScalarNode>()
.Select(static x => x.Value ?? string.Empty)
.Where(key => key is not ("rules_schema_version" or "rules"))
.Where(key => key is not ("rule_id" or "rules_schema_version" or "rules"))
.OrderBy(static x => x, StringComparer.Ordinal)
.ToList();
if (unknownRootKeys.Count > 0)
Expand Down
1 change: 1 addition & 0 deletions tools/ci/policies/rules/artifact_contract.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rule_id: CI-ARTIFACT-000
rules_schema_version: 1
rules:
- rule_id: CI-ARTIFACT-001
Expand Down
1 change: 1 addition & 0 deletions tools/ci/policies/rules/docs_drift.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rule_id: CI-DOCS-000
rules_schema_version: 1
rules:
- rule_id: CI-DOCS-001
Expand Down
1 change: 1 addition & 0 deletions tools/ci/policies/rules/naming_snt.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rule_id: CI-NAMING-000
rules_schema_version: 1
rules:
- rule_id: CI-NAMING-001
Expand Down
1 change: 1 addition & 0 deletions tools/ci/policies/rules/shell_safety.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rule_id: CI-SHELL-000
rules_schema_version: 1
rules:
- rule_id: CI-SHELL-001
Expand Down
1 change: 1 addition & 0 deletions tools/ci/policies/rules/versioning_svt.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rule_id: CI-VERSION-000
rules_schema_version: 1
rules:
- rule_id: CI-VERSION-001
Expand Down
25 changes: 22 additions & 3 deletions tools/ci/policies/schema/rules.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,16 @@
"$id": "tools/ci/policies/schema/rules.schema.json",
"type": "object",
"additionalProperties": false,
"required": ["rules_schema_version", "rules"],
"required": [
"rules_schema_version",
"rules"
],
"properties": {
"rule_id": {
"type": "string",
"description": "Rule collection identifier (file-level). Optional.",
"pattern": "^CI-[A-Z0-9_-]+-[0-9]{3}$"
},
"rules_schema_version": {
"type": "integer",
"const": 1
Expand All @@ -15,7 +23,15 @@
"items": {
"type": "object",
"additionalProperties": false,
"required": ["rule_id", "policy_type", "severity", "title", "description", "applies_to", "params"],
"required": [
"rule_id",
"policy_type",
"severity",
"title",
"description",
"applies_to",
"params"
],
"properties": {
"rule_id": {
"type": "string",
Expand All @@ -36,7 +52,10 @@
},
"severity": {
"type": "string",
"enum": ["warn", "fail"]
"enum": [
"warn",
"fail"
]
},
"title": {
"type": "string",
Expand Down
Loading