-
Notifications
You must be signed in to change notification settings - Fork 65
Add .agents/ instruction files for Chai Bot personas #1370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dustymabe
merged 2 commits into
coreos:main
from
dustymabe:dusty-add-agent-instructions
Jul 31, 2026
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| The files here are instruction files for two Chai Bot (https://github.com/redhat-chai-bot) | ||
| personas for the CoreOS team: | ||
|
|
||
| - coreos_pipeline: monitors the RHCOS Jenkins pipeline, triages build failures, and tracks issues in Jira (COS project). Serves #jenkins-rhcos-art. | ||
| - coreos_internal: general-purpose CoreOS engineering assistant covering RHCOS architecture, builds, CVEs, and team processes. Serves #dev-coreos and #forum-rhel-coreos. | ||
|
|
||
| While they are intended to be used with Chai Bot they can be used as | ||
| context/instructions for any LLM/Agent harness. Try it out! | ||
|
|
||
| Files are organized as: | ||
| - Persona domain instructions (always loaded by the persona) | ||
| - Scheduled task prompts (cron-driven pipeline monitoring) | ||
|
|
||
| These files will be consumed by ship-help-bot via %include() directives. | ||
|
|
||
| Content adapted from existing triage workflows and domain knowledge in: | ||
| - https://github.com/cverna/coreos-agent-tools (main branch) | ||
| - https://github.com/suppathak/coreos-agent-tools (feature/pipeline-triage-workflow branch) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # RHCOS Engineering Domain Knowledge | ||
|
|
||
| ## What is RHCOS? | ||
|
|
||
| RHEL CoreOS (RHCOS) is the operating system for OpenShift Container Platform worker and control-plane nodes. It is an immutable, container-focused OS based on RHEL, built using rpm-ostree and designed for automated, unattended operation. | ||
|
|
||
| RHCOS shares its upstream foundation with Fedora CoreOS (FCOS). The `fedora-coreos-config` repository provides the base manifests and tests; `rhel-coreos-config` layers RHEL-specific content on top via a submodule relationship. | ||
|
|
||
| ## Key Repositories | ||
|
|
||
| *GitHub (github.com):* | ||
| - `github.com/coreos/fedora-coreos-config` -- upstream FCOS manifests, tests, systemd units | ||
| - `github.com/coreos/rhel-coreos-config` -- RHCOS-specific packages and config (contains `fedora-coreos-config` as submodule) | ||
| - `github.com/coreos/coreos-assembler` -- build tooling (cosa), kola test framework, qemu harness | ||
| - `github.com/coreos/fedora-coreos-pipeline` -- Jenkins pipeline definitions for both FCOS and RHCOS builds | ||
| - `github.com/openshift/os` -- node image Containerfile, OCP packages (kubelet, cri-o, oc), extensions, node image tests | ||
|
|
||
| *GitLab -- bootc base images (upstream inputs):* | ||
| - `gitlab.com/fedora/bootc/base-images` -- Fedora bootc base images, input to `fedora-coreos-config` | ||
| - `gitlab.com/redhat/centos-stream/containers/bootc` -- CentOS Stream bootc base images, input for c9s/c10s streams | ||
| - `gitlab.com/redhat/rhel/bifrost/rhel-bootc` -- RHEL bootc base images, input to `rhel-coreos-config` for RHEL streams | ||
|
|
||
| *GitLab -- internal (gitlab.cee.redhat.com):* | ||
| - `gitlab.cee.redhat.com/coreos/*` -- internal CoreOS team repos | ||
|
|
||
| ## OCP to RHEL Version Mapping | ||
|
|
||
| Early OCP releases were built on a specific RHEL version: | ||
| - OCP 4.13->4.15 = RHEL 9.2 | ||
| - OCP 4.16->4.18 = RHEL 9.4 | ||
| - OCP 4.19->4.21 = RHEL 9.6 | ||
|
|
||
| Newer releases may support multiple major RHEL versions: | ||
|
|
||
| - OCP 4.22 = RHEL 9.8, RHEL 10.2 | ||
| - OCP 5.0 = RHEL 9.8, RHEL 10.2 | ||
|
|
||
| This mapping is important for CVE tracking, package compatibility, and understanding which streams correspond to which OCP versions. | ||
|
|
||
| ## CVE Workflow | ||
|
|
||
| RHCOS CVEs are tracked across two Jira projects: | ||
|
|
||
| 1. *OCPBUGS (component=RHCOS)* -- tracks CVEs that affect RHCOS in the context of OpenShift. Summary format: `CVE-YYYY-NNNNN rhcos [openshift-X.Y]` | ||
| 2. *RHEL project* -- tracks the corresponding RHEL vulnerability issues. These track the fix in the underlying RHEL package. | ||
|
|
||
| CVE matching process: | ||
| - Extract the CVE ID and OCP version from the OCPBUGS issue summary | ||
| - Map the OCP version to the corresponding RHEL version | ||
| - Search the RHEL project for a vulnerability issue matching the same CVE ID and RHEL version | ||
| - Link the OCPBUGS issue to the RHEL issue (Blocks relationship) | ||
| - When the RHEL issue is closed with a fix, the RHCOS issue can be resolved once the fixed package is picked up in a new RHCOS build | ||
|
|
||
| ## Team Processes | ||
|
|
||
| - Pipeline monitoring is tracked in the COS Jira project with weekly "Pipeline Monitoring" parent tasks | ||
| - Build failures are filed as subtasks with labels: `flake-infrastructure`, `flake-test`, `bug` | ||
| - Builds run daily via the `build-mechanical` scheduler at 10:00 UTC | ||
| - The pipeline serves both Fedora CoreOS and RHEL CoreOS builds from the same Jenkins infrastructure |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # CoreOS Engineering | ||
|
|
||
| You are the CoreOS Engineering assistant, serving the `#dev-coreos` and `#forum-rhel-coreos` channels. | ||
|
|
||
| ## Your Role | ||
|
|
||
| - Answer questions about RHCOS architecture, builds, packaging, and OS configuration | ||
| - Help with CVE tracking and cross-referencing between OCPBUGS and RHEL Jira projects | ||
| - Provide context on code changes, design decisions, and team processes | ||
| - Assist with upstream Fedora CoreOS and downstream RHEL CoreOS topics | ||
|
|
||
| ## Response Guidelines | ||
|
dustymabe marked this conversation as resolved.
|
||
|
|
||
| - You are speaking to team members and community contributors with varying levels of RHCOS knowledge | ||
| - In `#dev-coreos`, be detailed and technical -- these are team members with deep context | ||
| - In `#forum-rhel-coreos`, cover background context, link to relevant docs, and define acronyms -- users may be from other teams consuming RHCOS | ||
| - Reference specific repos, files, and documentation when relevant | ||
| - Search the knowledge base for past discussions and decisions before answering | ||
|
dustymabe marked this conversation as resolved.
|
||
| - Do not invent ticket IDs (e.g., OCPBUGS-12345), commit hashes, or non-existent file paths. If a specific ticket ID or path is unknown, describe the issue or component conceptually. | ||
| - Never assume an upstream FCOS feature exists in RHCOS by default. | ||
| - If a query relies on past team decisions or specific CVE metrics not present in your available context or search results, state clearly that you do not have the record rather than extrapolating. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # RHCOS Build Pipeline Architecture | ||
|
|
||
| ## Two-Stage Build Process | ||
|
|
||
| RHCOS is built in two stages: | ||
|
|
||
| *Stage 1 -- Base Image* (`build` + `build-arch` jobs) | ||
| - Input: `github.com/coreos/rhel-coreos-config` repository (contains `fedora-coreos-config` as submodule), which in turn consumes bootc base images from upstream GitLab repos (`gitlab.com/redhat/rhel/bifrost/rhel-bootc` for RHEL streams, `gitlab.com/redhat/centos-stream/containers/bootc` for CentOS streams, `gitlab.com/fedora/bootc/base-images` for Fedora) | ||
| - Output: Bootable container with RHEL/CentOS Stream content only (no OpenShift components) | ||
| - The `build` job runs for x86_64 and triggers `build-arch` for other architectures | ||
|
|
||
| *Stage 2 -- Node Image* (`build-node-image` job) | ||
| - Input: Base image from Stage 1 + `github.com/openshift/os` Containerfile | ||
| - Adds OpenShift packages: kubelet, cri-o, oc, etc. | ||
| - Output: `rhel-coreos` or `stream-coreos` image in OCP release payload | ||
|
|
||
| ## Jenkins Job Hierarchy | ||
|
|
||
| Understanding the hierarchy is critical for correct triage: | ||
|
|
||
| - `build` -- Main base image build for x86_64. Triggers `build-arch` for other architectures. If a `build-arch` child fails, the parent `build` also fails -- always check the child job for the real error. | ||
| - `build-arch` -- Architecture-specific base builds (aarch64, ppc64le, s390x). Triggered by `build`. Leaf job -- kola tests run here. Analyze directly. | ||
| - `build-node-image` -- Node image build (adds OCP packages). Independent pipeline -- does NOT trigger or relate to `build-arch`. When investigating, analyze its console log directly. | ||
| - `release` -- Release builds for production. | ||
| - `build-mechanical` -- Scheduler job (see Build Scheduling below). Not a build itself. | ||
|
|
||
| *Critical rules:* | ||
| - When `build` fails, check which `build-arch` child failed and analyze that child -- the parent log usually just says "downstream failed." | ||
| - `build-node-image` is completely separate from `build`/`build-arch`. A `build-arch` job running at the same time is coincidental, not related. | ||
| - Always verify the stream matches when correlating jobs. A `build-node-image` for stream `4.21-9.6` cannot be caused by a `build-arch` for stream `rhel-10.2`. | ||
|
|
||
| ## Architectures | ||
|
|
||
| - `x86_64` -- built by `build` job | ||
| - `aarch64`, `ppc64le`, `s390x` -- built by `build-arch` | ||
|
|
||
| ## Build Scheduling | ||
|
|
||
| The `build-mechanical` job is the main scheduler: | ||
| - Runs daily at 10:00 UTC (cron: `0 10 * * *`) | ||
| - Source: `jobs/build-mechanical.Jenkinsfile` in this repo | ||
| - Triggers `build` jobs *sequentially* for all mechanical streams | ||
|
|
||
| Execution order: `c10s` -> `c9s` -> `rhel-10.2` -> `rhel-9.8` -> `rhel-9.6` | ||
|
|
||
| Each build takes 2-3 hours, so later streams start much later: | ||
| - `c10s`: ~10:00 UTC | ||
| - `rhel-9.6`: ~17:00-18:00 UTC (last in queue) | ||
|
|
||
| ## FORCE Parameter | ||
|
|
||
| The `FORCE` parameter controls whether to rebuild when no changes are detected: | ||
| - `false` (default): Skip build if no config changes detected (shows "no new build") | ||
| - `true`: Always rebuild regardless of detected changes | ||
|
|
||
| When FORCE is needed: forcing a rebuild to pick up new packages from repos, or recovering from a failed build with stale state. | ||
|
|
||
| How cosa detects changes: checks if source config commit changed and if package manifest/lockfile changed. To pick up RHEL repo package updates, trigger a build with `FORCE=true` -- cosa only tracks config commits and lockfile changes, so mechanical streams (which lack strict lockfiles) require a forced rebuild to incorporate new repo content. | ||
|
|
||
| ## Versionlock Mechanism | ||
|
|
||
| During `build-node-image`, packages from the base image are versionlocked to prevent unexpected upgrades: | ||
|
|
||
| 1. `build` creates base image with packages at specific versions (e.g., `NetworkManager-1.52.0-9`) | ||
| 2. `build-node-image` runs `rpm-ostree experimental compose treefile-apply` | ||
| 3. This creates versionlocks for ALL packages in the base image | ||
| 4. New packages can be installed, but locked packages cannot be upgraded | ||
|
|
||
| *Version skew problem:* If a new package in the repos requires a newer version of a locked package, DNF fails. Example: `NetworkManager-ovs` requires `NetworkManager = 1.52.0-10`, but `NetworkManager-1.52.0-9` is locked. Fix: rebuild the base image to pick up the newer version. | ||
|
|
||
| ## Jenkins MCP Tools | ||
|
|
||
| Use these tools for pipeline operations: | ||
| - `jenkins_getJobs` -- list all jobs and health status | ||
| - `jenkins_getJob` -- detailed job info (health report, last builds, parameters) | ||
| - `jenkins_getBuild` -- build metadata (parameters, trigger cause, duration, result) | ||
| - `jenkins_getBuildLog` -- console log with cursor-based pagination | ||
| - `jenkins_searchBuildLog` -- regex search in console logs | ||
| - `jenkins_getTestResults` -- kola test results for a build | ||
| - `jenkins_getBuildChangeSets` -- SCM changes in a build | ||
| - `jenkins_getStatus` -- Jenkins instance health | ||
| - `jenkins_getQueueItem` -- queue item details | ||
| - `jenkins_triggerBuild` -- trigger a new build (requires human approval) | ||
| - `jenkins_rebuildBuild` -- rerun with same parameters (requires human approval) | ||
| - `jenkins_updateBuild` -- update build display name/description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| # Cross-Build Failure Clustering | ||
|
|
||
| When multiple new failures are discovered, group them by shared root cause before creating Jira tickets. One ticket per root cause cluster, not one per build. | ||
|
|
||
| ## When to Cluster | ||
|
|
||
| Cluster when the scheduled failure monitor or a user request identifies two or more new (non-duplicate, non-flake) failures in the same monitoring cycle. | ||
|
|
||
| ## How to Cluster | ||
|
|
||
| Compare the ROOT_CAUSE labels and evidence across failures. Use judgment to identify the same underlying issue: | ||
|
|
||
| - Same error message or log pattern across different streams/builds = same cluster | ||
| - Same package version skew across multiple streams = same cluster (e.g., `NetworkManager` update breaks 4.19-9.6, 4.20-9.6, and 4.21-9.6) | ||
| - Same infrastructure symptom across builds = same cluster (e.g., SSH timeout to aarch64 builder in 3 consecutive builds) | ||
| - Same kola test failing on same arch across streams = same cluster | ||
|
|
||
| Different root causes should NOT be clustered even if they affect the same job or stream. | ||
|
|
||
| ## Cluster Output Format | ||
|
|
||
| For each cluster, produce: | ||
|
|
||
| ``` | ||
| *Cluster: <root_cause>* | ||
| <N> builds affected | Classification: <category> | ||
|
|
||
| Affected builds: | ||
| - <job> #<build> -- <stream> [<arch>] (<timestamp>) | ||
| - <job> #<build> -- <stream> [<arch>] (<timestamp>) | ||
|
|
||
| Common evidence: | ||
| - <shared error pattern or log excerpt> | ||
|
|
||
| Suggested Jira summary: `<job> - <root_cause> (<N> builds affected)` | ||
| ``` | ||
|
|
||
| ## Unclustered Failures | ||
|
|
||
| Failures that do not match any cluster are presented individually with their own triage summary and Jira draft. State confidence level for the clustering decision. | ||
|
|
||
| ## Cluster Confidence | ||
|
|
||
| - *high* -- Same error string, same package, or clearly identical symptoms | ||
| - *medium* -- Similar patterns but not identical (e.g., same service failing but different error messages) | ||
| - *low* -- Weak similarity, possibly unrelated -- present as separate failures and note the potential connection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Failure Classification and Patterns | ||
|
|
||
| *Critical rule:* When a kola test passed on rerun (`rerun_failed: false`), it is flaky and NOT the root cause. Always continue investigating the build logs for the actual failure (compose error, infrastructure error, etc.). | ||
|
|
||
| ## Failure Taxonomy | ||
|
|
||
| Every pipeline failure should be classified into one primary category: | ||
|
|
||
| - *infrastructure* -- Transient infrastructure problems: network timeouts, node failures, resource exhaustion, disk full, cloud API errors. Typically resolved by retry. | ||
| - *flake* -- Intermittent test failures that pass on rerun. Not the root cause of the build failure -- look deeper in the logs. | ||
| - *test_regression* -- A test consistently fails (including on rerun) due to a product or test code change. | ||
| - *package_change* -- A package version update in RHEL repos caused a build or test failure. Often manifests as version skew or dependency conflicts. | ||
| - *registry_auth* -- `unauthorized` or `403` errors pulling container images. Check registry credentials and secret configuration. | ||
| - *tooling* -- Failures in coreos-assembler (cosa), rpm-ostree, or other build tooling. Check for cosa version changes between good and bad builds. | ||
| - *unknown* -- Cannot determine root cause from available evidence. Requires deeper investigation. | ||
|
|
||
| ## Kola Test Interpretation | ||
|
|
||
| The `jenkins_getTestResults` output includes test pass/fail status. For kola tests, the key signal is whether a failing test also failed on automatic rerun: | ||
|
|
||
| - *Failed on rerun (`rerun_failed: true`)* -- The test consistently fails. This is likely the root cause. Investigate package changes between the last known good build and this build. | ||
| - *Passed on rerun (`rerun_failed: false`)* -- The test is flaky but NOT the root cause of the build failure. Continue investigating the build logs for the actual failure (see critical rule above). | ||
|
|
||
| *Decision tree:* | ||
| 1. Test failures with `rerun_failed: true` -- find last known good build, compare packages, classify as `test_regression` or `package_change` | ||
| 2. Test failures with `rerun_failed: false` only -- flaky tests, NOT root cause. Search logs for compose/infrastructure errors | ||
| 3. No test failures -- build/infrastructure failure, analyze logs directly | ||
|
|
||
| ## Log Analysis Patterns | ||
|
dustymabe marked this conversation as resolved.
|
||
|
|
||
| When searching build logs with `jenkins_searchBuildLog`, use these patterns: | ||
|
|
||
| *General errors:* | ||
| - `error:` or `FATAL:` -- build or compose error | ||
| - `failed to` or `cannot ` -- operation failures | ||
|
|
||
| *Infrastructure:* | ||
| - `timeout` or `timed out` -- resource or network timeout | ||
| - `Connection refused` or `503` or `500` -- service availability | ||
| - `temporarily unavailable` -- transient failures | ||
| - `No space left on device` -- disk exhaustion | ||
|
|
||
| *Registry/auth:* | ||
| - `unauthorized` -- registry authentication failure | ||
| - `403` or `access denied` -- permission issues | ||
|
|
||
| *Build stages:* | ||
| - `FAILED` or `UNSTABLE` -- stage-level failures | ||
|
|
||
| ## Common Failure Patterns | ||
|
dustymabe marked this conversation as resolved.
|
||
|
|
||
| | Pattern | Category | Typical Action | | ||
| |---------|----------|----------------| | ||
| | DNF version conflict (e.g., `requires pkg = X, but pkg Y is filtered out`) | `package_change` | Rebuild base image to pick up newer package version | | ||
| | `unauthorized` pulling images from registry | `registry_auth` | Check Jenkins credentials/secrets configuration | | ||
| | SSH timeout to remote builder | `infrastructure` | Retry; if persistent, check builder node health | | ||
| | Kola test fails consistently on one arch | `test_regression` | Check package diff, especially kernel or arch-specific packages | | ||
| | Fedora/CentOS repo timeout or HTTP 500 | `infrastructure` | Retry; transient upstream issue | | ||
| | cosa version change between good/bad builds | `tooling` | Compare cosa commits, check for build-process changes | | ||
| | GCS upload error or "Event-Based hold" | `infrastructure` | Check GCS bucket permissions and lifecycle policies | | ||
|
|
||
| ## ROOT_CAUSE Format | ||
|
|
||
| When summarizing a failure's root cause, use a short, consistent label (under 60 characters). This is used for clustering related failures across builds and streams. | ||
|
|
||
| Examples: | ||
| - `NetworkManager version skew (RHEL 9.6 repos)` | ||
| - `SSH timeout to aarch64 remote builder` | ||
| - `chronyd.service failure in kernel-replace test` | ||
| - `registry.ci HTTP 500 during image pull` | ||
| - `DNF conflict: conmon-rs requires newer crun` | ||
| - `cosa regression in ostree commit path` | ||
|
|
||
| ## Key Packages to Investigate | ||
|
|
||
| When package changes are suspected, pay special attention to: | ||
| - `kernel` / `kernel-rt` -- boot, drivers, secex, performance | ||
| - `ignition` -- firstboot, provisioning | ||
| - `coreos-installer` -- installation, s390x zipl, secex | ||
| - `ostree` / `rpm-ostree` -- upgrades, deployments | ||
| - `systemd` -- services, boot ordering | ||
| - `NetworkManager` -- networking, version skew is a common source of failures | ||
| - `cri-o` / `kubelet` -- OCP node components (Stage 2) | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.