Skip to content

OSAC-3557: Add AI-assisted development infrastructure to mono-repo - #104

Merged
openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
eranco74:feat/OSAC-3557-ai-ready-v2
Aug 3, 2026
Merged

openshift-merge-bot[bot] merged 2 commits into
osac-project:mainfrom
eranco74:feat/OSAC-3557-ai-ready-v2

Conversation

@eranco74

@eranco74 eranco74 commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add root CLAUDE.md/AGENTS.md with cross-cutting project coordination (component table, change order, git workflow, deployment, enhancement proposals, Jira conventions)
  • Add .claude/ infrastructure: settings.json (permissions, SessionStart hook, statusline), 4 auto-loaded rules, session hooks
  • Add tools/bootstrap.sh to install flightctl/ai-workflows (bugfix, implement, prd, design, e2e)
  • OSAC-specific skills (create-pr, jira, release, reviews, etc.) will be installed from a separate repo

No content is duplicated from component-level AGENTS.md files — the root docs cover only cross-component coordination that no single component doc has.

Jira

https://redhat.atlassian.net/browse/OSAC-3557

What's included

File Purpose
CLAUDE.md Entry point — loads @AGENTS.md
AGENTS.md Cross-cutting coordination (60 lines)
.claude/settings.json Permissions, SessionStart hook, statusline
.claude/rules/ (4 files) Architecture patterns, CLI UX, networking design alignment, request path tracing
.claude/hooks/ (2 files) Session auto-sync and statusline
tools/bootstrap.sh ai-workflows installer
.gitignore Excludes installed skills/commands/agents

Test plan

  • No hardcoded user-specific paths
  • No content duplicated from component AGENTS.md files
  • Component-level CLAUDE.md and .claude/ files untouched
  • tools/bootstrap.sh installs ai-workflows

Assisted-by: Claude Code noreply@anthropic.com

Summary by CodeRabbit

  • New Features

    • Added automated project synchronization and repository status reporting.
    • Added a bootstrap script for installing AI workflow skills.
    • Added configurable session-start hooks, status display, and approved command settings.
  • Documentation

    • Added architecture, CLI, networking, request-tracing, and repository guidance.
    • Documented component relationships and cross-component change order.
  • Chores

    • Added ignore rules for generated AI workflow files.

@openshift-ci-robot

openshift-ci-robot commented Aug 3, 2026 •

Copy link
Copy Markdown

@eranco74: This pull request references OSAC-3557 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Add root CLAUDE.md/AGENTS.md with cross-cutting project coordination (component table, change order, git workflow, deployment, enhancement proposals, Jira conventions)
  • Add .claude/ infrastructure: settings.json (permissions, SessionStart hook, statusline), 4 auto-loaded rules, session hooks
  • Add tools/bootstrap.sh to install flightctl/ai-workflows (bugfix, implement, prd, design, e2e)
  • OSAC-specific skills (create-pr, jira, release, reviews, etc.) will be installed from a separate repo

No content is duplicated from component-level AGENTS.md files — the root docs cover only cross-component coordination that no single component doc has.

Jira

https://redhat.atlassian.net/browse/OSAC-3557

What's included

File Purpose
CLAUDE.md Entry point — loads @AGENTS.md
AGENTS.md Cross-cutting coordination (60 lines)
.claude/settings.json Permissions, SessionStart hook, statusline
.claude/rules/ (4 files) Architecture patterns, CLI UX, networking design alignment, request path tracing
.claude/hooks/ (2 files) Session auto-sync and statusline
tools/bootstrap.sh ai-workflows installer
.gitignore Excludes installed skills/commands/agents

Test plan

  • No hardcoded user-specific paths
  • No content duplicated from component AGENTS.md files
  • Component-level CLAUDE.md and .claude/ files untouched
  • tools/bootstrap.sh installs ai-workflows

Assisted-by: Claude Code noreply@anthropic.com

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested review from amito and tzvatot August 3, 2026 09:35
@openshift-ci openshift-ci Bot added the approved label Aug 3, 2026
@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@eranco74, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 20 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

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.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: d80e619e-5409-4bb8-beea-9774946626fa

📥 Commits

Reviewing files that changed from the base of the PR and between ad969c7 and 131809c.

📒 Files selected for processing (11)
  • .claude/hooks/statusline.sh
  • .claude/hooks/update-ai-context.sh
  • .claude/rules/architecture-patterns.md
  • .claude/rules/cli-ux.md
  • .claude/rules/networking-design-alignment.md
  • .claude/rules/request-path-tracing.md
  • .claude/settings.json
  • .gitignore
  • AGENTS.md
  • CLAUDE.md
  • tools/bootstrap.sh

Walkthrough

Added Claude session hooks, workflow bootstrap configuration, repository synchronization status reporting, and OSAC development guidance.

Changes

AI workflow integration

Layer / File(s) Summary
Workflow setup and Claude wiring
tools/bootstrap.sh, .claude/settings.json, .gitignore
Adds workflow installation, Claude hook and statusline configuration, permitted commands, and ignore rules for generated AI files.
Session context synchronization
.claude/hooks/update-ai-context.sh
Fetches repositories, rebases eligible branches, reports divergence, and aborts failed or interrupted rebases.
Repository status reporting
.claude/hooks/statusline.sh
Runs the configured statusline command and reports branch and synchronization status for both repositories.
Repository and development rules
AGENTS.md, CLAUDE.md, .claude/rules/*
Adds repository structure, architecture, CLI, networking, request-path, and integration-testing guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Claude
  participant update-ai-context.sh
  participant ProjectRepository
  participant AIWorkflows
  Claude->>update-ai-context.sh: Start session
  update-ai-context.sh->>ProjectRepository: Fetch and rebase eligible branch
  update-ai-context.sh->>AIWorkflows: Fetch and rebase main branch
  update-ai-context.sh-->>Claude: Report synchronization status
Loading

Possibly related PRs

Suggested reviewers: amito, tzvatot


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error)

Check name Status Explanation Resolution
No-Injection-Vectors ❌ Error statusline.sh line 11 passes USER_STATUSLINE_CMD from ~/.claude/settings.json to bash -c, enabling arbitrary shell evaluation of user-configured data. Avoid bash -c on the configuration value. Invoke a fixed executable with quoted arguments, or strictly validate and allowlist supported statusline commands.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the addition of AI-assisted development infrastructure to the OSAC mono-repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed The PR adds no API keys, tokens, passwords, private-key material, credential-bearing URLs, or base64/hex blobs over 32 characters.
No-Weak-Crypto ✅ Passed The complete PR diff adds no MD5, SHA1, DES, RC4, Blowfish, ECB, custom crypto, or secret-comparison code.
Container-Privileges ✅ Passed The PR adds no container or Kubernetes manifests, and its full diff contains none of the flagged privilege settings or capabilities.
No-Sensitive-Data-In-Logs ✅ Passed PR output contains only fixed sync messages, repository branch names, and local workflow paths; no passwords, tokens, keys, PII, session IDs, customer data, or sensitive literals are logged.
Ai-Attribution ✅ Passed AI use is declared in the PR and both PR commits with Assisted-by: Claude Code <noreply@anthropic.com>; no AI Co-Authored-By trailer appears.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Comment thread AGENTS.md Outdated

## Git Workflow

- **Fork-based**: push to `fork` remote, never to `origin`. PRs go from `fork/<branch>` to `origin/main`

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment as in the previous PR.
These are per developer configurations, no need to include it.

Or, since we have a chance now, consider adopting a more common pattern:

  • origin = fork
  • upstream = the main repo

This is the convention I've personally always used, and it is also what github documents for example.

This way the rule will not be needed as well

Always push to fork, never to origin

because you can push to origin normally.

But I don't think the agents.md should assume the dev's configuration and/or dictate it.

Comment thread AGENTS.md Outdated

PRD and design workflows publish to the separate `enhancement-proposals` repo (clone as sibling at `../enhancement-proposals/`). Feature directory: `enhancements/<jira-key>-<feature-slug>/` with `prd.md` and `design.md`. Push to `fork` remote.

## Jira Conventions

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

We don't need references to jira in the upstream repo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't mind starting without it.
Note that claude won't know how to access jira or what's the jira project without it.

We can call it "upstream repo", The osac team is using Jira for task management; it makes sense to allow the AI tools to know how to access it

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It is usually defined in the skill being used, or it's enough to just say "use jira cli" - that works for me as well. For example report-bug covers it, and I think some others as well

Comment thread AGENTS.md Outdated
- **AI attribution**: `Assisted-by: Claude Code <noreply@anthropic.com>` — never `Co-Authored-By` for AI tools (Red Hat attribution standard)
- **Commit message**: `OSAC-XXXXX: description` (Jira key) or `NO-ISSUE: description`

## Deployment Coordination

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think we need a separate file for deployment concerns. It doesn't have to be loaded on every session

Comment thread AGENTS.md Outdated
- OSAC uses Jira **Tasks** (not Stories) for implementation work
- Use `jira` CLI for Jira access (e.g., `jira issue view OSAC-1234 --plain`), not Jira MCP

## AI-Assisted Workflows

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One time operation, I don't think we need this on every session start as well

Comment thread AGENTS.md Outdated
| `bare-metal-fulfillment-operator/` | Kubernetes operator for bare-metal host pools |
| `osac-csi-driver/` | CSI meta-driver aggregating vendor storage drivers |

External repos (clone as siblings for cross-repo workflows):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

It would be nice to add a few words about what these repos are and when they are needed. Similar to the components section

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You can send a follow-up PR adding a few nice words about these repos, I want to get us going.

Comment thread AGENTS.md

OSAC (Open Sovereign AI Cloud) is a fulfillment system for provisioning Kubernetes clusters, compute instances, bare-metal hosts, and networking. This mono-repo contains six components, each with its own `CLAUDE.md`/`AGENTS.md` — **read the component's docs before making changes in it** (progressive disclosure).

## Components

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

Comment thread AGENTS.md Outdated
Comment thread AGENTS.md Outdated

## Enhancement Proposals

PRD and design workflows publish to the separate `enhancement-proposals` repo (clone as sibling at `../enhancement-proposals/`). Feature directory: `enhancements/<jira-key>-<feature-slug>/` with `prd.md` and `design.md`. Push to `fork` remote.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Comment thread .gitignore
Comment thread .claude/hooks/update-ai-context.sh Outdated
trap - INT TERM
}

fetch_and_rebase "$REPO_DIR" "osac" true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So this will run each time I'm on main and start a claude session? I don’t think that’s always desirable assuming it touches local files

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You are right, we needed that when we had the meta repo.
I'll update it

Comment thread .claude/settings.json

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/hooks/update-ai-context.sh:
- Around line 50-51: Update the fetch_and_rebase invocation for
"${HOME}/.ai-workflows" to pass the only_on_main argument as true, matching the
existing osac call so feature branches are not force-rebased. If rebasing every
branch is intentional instead, document that behavior in the hook’s existing
comment.

In `@tools/bootstrap.sh`:
- Line 22: Update the AI_WORKFLOWS_DIR assignment in bootstrap.sh to use
realpath instead of readlink -f, matching the existing SCRIPT_DIR and
PROJECT_ROOT path-resolution commands.
- Around line 21-42: Extract the repeated fetch-and-rebase sequence from the two
ai-workflows branches into a parameterized function, following the existing
fetch_and_rebase pattern in update-ai-context.sh. Have the function accept the
workflow directory and context-specific log text, preserve fetch failure, rebase
failure with abort, manual recovery guidance, and success messages, then call it
from both branches.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 178c61b3-34a4-402a-abb3-a10e6b1155c5

📥 Commits

Reviewing files that changed from the base of the PR and between 4f0205d and ad969c7.

📒 Files selected for processing (11)
  • .claude/hooks/statusline.sh
  • .claude/hooks/update-ai-context.sh
  • .claude/rules/architecture-patterns.md
  • .claude/rules/cli-ux.md
  • .claude/rules/networking-design-alignment.md
  • .claude/rules/request-path-tracing.md
  • .claude/settings.json
  • .gitignore
  • AGENTS.md
  • CLAUDE.md
  • tools/bootstrap.sh

Comment thread .claude/hooks/update-ai-context.sh Outdated
Comment on lines +50 to +51
fetch_and_rebase "$REPO_DIR" "osac" true
fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Ai-workflows checkout is always force-rebased, even on non-main branches.

Line 50 passes true for only_on_main, so osac is only rebased when the branch is main; on other branches it only reports divergence. Line 51 omits this argument for ai-workflows, so only_on_main defaults to false and the guard at line 14 never applies.

As a result, if a developer checks out a feature branch inside ~/.ai-workflows (for example, to test or contribute a change), this SessionStart hook silently rebases that branch onto origin/main on every session start, rewriting local commit history. This does not match the safety behavior already established for osac.

🔧 Proposed fix
-fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows"
+fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" true
If a full rebase is intentional for `ai-workflows` on every branch, clarify this in the comment on line 2-3.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
fetch_and_rebase "$REPO_DIR" "osac" true
fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows"
fetch_and_rebase "$REPO_DIR" "osac" true
fetch_and_rebase "${HOME}/.ai-workflows" "ai-workflows" true
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/hooks/update-ai-context.sh around lines 50 - 51, Update the
fetch_and_rebase invocation for "${HOME}/.ai-workflows" to pass the only_on_main
argument as true, matching the existing osac call so feature branches are not
force-rebased. If rebasing every branch is intentional instead, document that
behavior in the hook’s existing comment.

Comment thread tools/bootstrap.sh
Comment thread tools/bootstrap.sh
# --- ai-workflows (flightctl) ---

if [[ -d "${HOME}/.ai-workflows" ]]; then
AI_WORKFLOWS_DIR="$(readlink -f "${HOME}/.ai-workflows")"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔵 Trivial | 💤 Low value

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'Repo files matching bootstrap:\n'
fd -a 'bootstrap\.sh$' . | sed 's#^\./##'

printf '\nGit diff/stat if available:\n'
git diff --stat || true

printf '\ntools/bootstrap.sh outline and relevant lines:\n'
if [ -f tools/bootstrap.sh ]; then
  wc -l tools/bootstrap.sh
  sed -n '1,60p' tools/bootstrap.sh | cat -n
  printf '\nOccurrences of readlink/realpath in tools/bootstrap.sh:\n'
  rg -n 'readlink|realpath|AI_WORKFLOWS_DIR|AI_PROJECTS_DIR' tools/bootstrap.sh || true
fi

printf '\nSystem command availability/docs:\n'
command -v realpath || true
command -v readlink || true
( [ -x "$(command -v realpath)" ] && realpath --version 2>&1 | head -5 ) || true
( [ -x "$(command -v readlink)" ] && readlink --help 2>/dev/null | sed -n '1,12p' ) || true

Repository: osac-project/osac

Length of output: 4823


Use realpath here for consistency.

tools/bootstrap.sh already resolves SCRIPT_DIR and PROJECT_ROOT with realpath; use the same command for AI_WORKFLOWS_DIR instead of mixing in readlink -f.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/bootstrap.sh` at line 22, Update the AI_WORKFLOWS_DIR assignment in
bootstrap.sh to use realpath instead of readlink -f, matching the existing
SCRIPT_DIR and PROJECT_ROOT path-resolution commands.

Add root CLAUDE.md/AGENTS.md with cross-cutting project coordination
(component table, change order, git workflow, deployment, enhancement
proposals, Jira conventions). Add .claude/ infrastructure (settings,
4 auto-loaded rules, session hooks) and tools/bootstrap.sh to install
flightctl/ai-workflows. OSAC-specific skills will be installed from
a separate repo.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Eran Cohen <eranco@redhat.com>
…ange order only

Remove git workflow, Jira conventions, deployment coordination,
enhancement proposals, and bootstrap instructions. Add descriptions
to external repos table.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Eran Cohen <eranco@redhat.com>

@amito amito left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm
Small comment on duplication that can be deferred to separate PR, does not block approval.

Comment thread tools/bootstrap.sh
echo " ai-workflows up to date"
fi
elif [[ -d "${PROJECT_ROOT}/.ai-workflows" ]]; then
AI_WORKFLOWS_DIR="${PROJECT_ROOT}/.ai-workflows"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

That's pretty much the same code as in lines 22-31, only with a different path.

@openshift-ci openshift-ci Bot added the lgtm label Aug 3, 2026
@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amito, eranco74

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

This branch was previously deployed

1 inactive deployment
e2e-test — 131809c0 Deployed Aug 3, 2026 by eranco74 via e2e-vmaas-full-install / e2e #333
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants