Skip to content

chore(governance): add missing governance files#63

Merged
KooshaPari merged 1 commit into
mainfrom
feature/governance-keystone-2026-06-12
Jun 13, 2026
Merged

chore(governance): add missing governance files#63
KooshaPari merged 1 commit into
mainfrom
feature/governance-keystone-2026-06-12

Conversation

@KooshaPari

@KooshaPari KooshaPari commented Jun 13, 2026

Copy link
Copy Markdown
Owner

User description

L1.4 governance keystone per L1 audit 2026-06-12


Note

Low Risk
Documentation and CI policy only; no runtime, auth, or application code changes. Branch-policy job depends on GITHUB_TOKEN and gh availability on the runner.

Overview
Adds L1.4 governance keystone artifacts: a new Governance GitHub Actions workflow, plus SSOT.md and a skeleton ARCHITECTURE.md.

The .github/workflows/governance.yml workflow runs on push/PR to main/master and weekly (Mondays 06:00 UTC). It enforces three policies: a required-files job that fails CI if any of SECURITY.md, .github/dependabot.yml, .github/workflows/scorecard.yml, .editorconfig, cliff.toml, or SSOT.md is missing; conventional commit lint via commitlint when .commitlintrc.json exists (otherwise skipped, job non-blocking); and default branch must be main or master (via gh repo view).

SSOT.md defines canonical sources for build commands, releases, security, dependabot, branch policy (pointing at this workflow), scorecard, editorconfig, architecture, agents, and functional requirements, with a precedence order favoring executable config over markdown.

ARCHITECTURE.md is an initial workspace overview (crates, python, ports, docs) and data-flow sketch, explicitly marked as a placeholder for future detail.

Reviewed by Cursor Bugbot for commit 05b11da. Bugbot is set up for automated code reviews on this repo. Configure here.


CodeAnt-AI Description

Add governance checks and repository source-of-truth docs

What Changed

  • Added a new governance workflow that runs on main branch changes and weekly to check for required repository policy files.
  • The workflow now also checks commit message style when commit rules are present and enforces main or master as the default branch.
  • Added a source-of-truth document that lists which files are authoritative for builds, releases, security, dependency updates, branch policy, and architecture.
  • Added a starter architecture document that outlines the workspace structure and marks areas for future detail.

Impact

✅ Fewer missing governance files
✅ Clearer branch and commit policy checks
✅ Easier finding of repository authority sources

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@codeant-ai

codeant-ai Bot commented Jun 13, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.


Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@KooshaPari, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 49 minutes and 27 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f36abb8c-f809-4862-a768-bc0902d70109

📥 Commits

Reviewing files that changed from the base of the PR and between 813ecb3 and 05b11da.

📒 Files selected for processing (3)
  • .github/workflows/governance.yml
  • ARCHITECTURE.md
  • SSOT.md
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/governance-keystone-2026-06-12
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feature/governance-keystone-2026-06-12

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Jun 13, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Fix All in Cursor

Bugbot Autofix is ON. A cloud agent has been kicked off to fix the reported issues.

Reviewed by Cursor Bugbot for commit 05b11da. Configure here.

default=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo "main")
case "$default" in
main|master) echo "OK: default branch '$default' is governance-approved" ;;
*) echo "::error::Default branch '$default' is not in the approved set (main, master)"; exit 1 ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

API failure bypasses branch check

Medium Severity

In branch-policy, when gh repo view fails, stderr is discarded and the script substitutes main, so the approved-branch check can pass even when the repository default branch is not main or master.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 05b11da. Configure here.

if: hashFiles('.commitlintrc.json') != ''
uses: wagoid/commitlint-github-action@5a18711fb4551c356c12597d399a82599b8e2a39 # v5
with:
configFile: .commitlintrc.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Shallow fetch breaks commitlint

Medium Severity

The commit-policy job checks out only fetch-depth: 50 before wagoid/commitlint-github-action, which needs full history to resolve revision ranges; once .commitlintrc.json exists, lint can error or skip commits on larger PRs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 05b11da. Configure here.

@@ -0,0 +1,79 @@
name: Governance

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Add an explicit AgilePlus spec reference (for example, spec ID in a comment or workflow metadata) to tie this newly introduced governance automation to an approved spec before implementation. [custom_rule]

Severity Level: Minor ⚠️

Why it matters? 🤔

This is a newly introduced workflow file that adds governance automation, and the file contains no AgilePlus spec reference in metadata or comments. The custom rule requires new work to be tied to an approved spec before implementation, so this is a real violation.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** .github/workflows/governance.yml
**Line:** 1:1
**Comment:**
	*Custom Rule: Add an explicit AgilePlus spec reference (for example, spec ID in a comment or workflow metadata) to tie this newly introduced governance automation to an approved spec before implementation.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread ARCHITECTURE.md
@@ -0,0 +1,44 @@
# Architecture

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Move this new Markdown document from the repository root into an approved documentation subdirectory (for example under docs/reference/) because only README.md, CLAUDE.md, and AGENTS.md are allowed as root-level Markdown files. [custom_rule]

Severity Level: Minor ⚠️

Why it matters? 🤔

This file is a new Markdown document created at the repository root. The rule explicitly allows only README.md, CLAUDE.md, and AGENTS.md at the root, so adding ARCHITECTURE.md here violates the repository documentation layout rule.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** ARCHITECTURE.md
**Line:** 1:1
**Comment:**
	*Custom Rule: Move this new Markdown document from the repository root into an approved documentation subdirectory (for example under `docs/reference/`) because only `README.md`, `CLAUDE.md`, and `AGENTS.md` are allowed as root-level Markdown files.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment thread SSOT.md
@@ -0,0 +1,33 @@
# SSOT — Single Source of Truth (phenoAI)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggestion: Move this new governance document under the approved docs directory structure (for example under docs/) instead of creating it at repository root, since only README.md, CLAUDE.md, and AGENTS.md are allowed as new root Markdown files. [custom_rule]

Severity Level: Minor ⚠️

Why it matters? 🤔

The file is a new Markdown document created at the repository root, and the rule only allows new root Markdown files named README.md, CLAUDE.md, or AGENTS.md. Since this file is SSOT.md, the suggestion correctly identifies a real violation.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** SSOT.md
**Line:** 1:1
**Comment:**
	*Custom Rule: Move this new governance document under the approved docs directory structure (for example under `docs/`) instead of creating it at repository root, since only `README.md`, `CLAUDE.md`, and `AGENTS.md` are allowed as new root Markdown files.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
👍 | 👎

Comment on lines +72 to +76
run: |
default=$(gh repo view --json defaultBranchRef -q .defaultBranchRef.name 2>/dev/null || echo "main")
case "$default" in
main|master) echo "OK: default branch '$default' is governance-approved" ;;
*) echo "::error::Default branch '$default' is not in the approved set (main, master)"; exit 1 ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 Architect Review — HIGH

The branch-policy check treats any gh repo view failure as defaulting to "main" and therefore passes, so branch governance is not actually enforced when the CLI/API/auth lookup fails, creating false-positive compliance instead of a real policy gate.

Suggestion: Fail closed for lookup errors: make branch detection deterministic from repository metadata and only pass when the real default branch is verified as main/master. Keep error and policy-failure paths distinct so transient lookup failures cannot be interpreted as compliant state.

Fix in Cursor | Fix in VSCode Claude

(Use Cmd/Ctrl + Click for best experience)

Prompt for AI Agent 🤖
This is an **Architect / Logical Review** comment left during a code review. These reviews are first-class, important findings — not optional suggestions. Do NOT dismiss this as a 'big architectural change' just because the title says architect review; most of these can be resolved with a small, localized fix once the intent is understood.

**Path:** .github/workflows/governance.yml
**Line:** 72:76
**Comment:**
	*HIGH: The branch-policy check treats any `gh repo view` failure as defaulting to `"main"` and therefore passes, so branch governance is not actually enforced when the CLI/API/auth lookup fails, creating false-positive compliance instead of a real policy gate.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
If a suggested approach is provided above, use it as the authoritative instruction. If no explicit code suggestion is given, you MUST still draft and apply your own minimal, localized fix — do not punt back with 'no suggestion provided, review manually'. Keep the change as small as possible: add a guard clause, gate on a loading state, reorder an await, wrap in a conditional, etc. Do not refactor surrounding code or expand scope beyond the finding.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix

@codeant-ai

codeant-ai Bot commented Jun 13, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

@KooshaPari KooshaPari merged commit 1cb1b38 into main Jun 13, 2026
17 of 20 checks passed
@KooshaPari KooshaPari deleted the feature/governance-keystone-2026-06-12 branch June 13, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant