HYPERFLEET-930 - docs: rewrite CLAUDE.md as AGENTS.md#168
Conversation
…ttern Rewrite agent instructions from scratch based on codebase audit. CLAUDE.md now imports from AGENTS.md via @import for multi-tool compatibility. Extract CEL and logging conventions into separate files under docs/conventions/ to reduce token cost per session.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR consolidates HyperFleet Adapter documentation by establishing AGENTS.md as the central agent reference document with verification commands, CLI subcommand details, two-config-file override model, code conventions including error-handling patterns, operational gotchas, and internal package directory structure. CLAUDE.md is replaced with a redirect to AGENTS.md. Two new convention documentation files are added: logging.md standardizes slog usage with context.Context-first signatures and structured field propagation; cel.md defines CEL expression conventions, injected variables, custom functions (now(), toJson(), dig()), string extension methods, and links to evaluator and validator implementations. Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
Risk Score: 1 —
|
| Signal | Detail | Points |
|---|---|---|
| PR size | 410 lines (>200) | +1 |
| Sensitive paths | none | +0 |
Computed by hyperfleet-risk-scorer
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@AGENTS.md`:
- Line 17: Add a short note to AGENTS.md near the development/setup section
(around the `make install-hooks` mention) explaining that the repository's
`.pre-commit-config.yaml` may reference internal hooks (for example
`rh-pre-commit`) that external contributors cannot access, and instruct them to
either comment out or remove those internal hook entries or run `pre-commit
install --forbid-protected-refs`/use `SKIP=` env var before installation;
reference the exact files/entries `.pre-commit-config.yaml` and the internal
hook name `rh-pre-commit` so readers can locate and edit the config.
🪄 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: Central YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: 1ddc679d-94c6-4bf0-bbeb-bae7c3d67955
📒 Files selected for processing (65)
.golangci.yml.pre-commit-config.yamlAGENTS.mdCLAUDE.mdMakefilecmd/adapter/main.godocs/conventions/cel.mddocs/conventions/logging.mdinternal/configloader/loader.gointernal/configloader/types.gointernal/configloader/validator_test.gointernal/criteria/cel_evaluator.gointernal/criteria/cel_evaluator_test.gointernal/criteria/evaluator_scenarios_test.gointernal/criteria/evaluator_test.gointernal/criteria/evaluator_version_test.gointernal/dryrun/dryrun_api_client_test.gointernal/dryrun/recording_transport_client.gointernal/dryrun/recording_transport_client_test.gointernal/dryrun/trace_test.gointernal/executor/executor.gointernal/executor/executor_test.gointernal/executor/handler.gointernal/executor/param_extractor.gointernal/executor/post_action_executor_test.gointernal/executor/resource_executor.gointernal/executor/resource_executor_test.gointernal/executor/types.gointernal/executor/utils_test.gointernal/generation/generation.gointernal/generation/generation_test.gointernal/hyperfleetapi/client.gointernal/hyperfleetapi/client_test.gointernal/k8sclient/apply.gointernal/k8sclient/apply_test.gointernal/k8sclient/client.gointernal/k8sclient/discovery.gointernal/k8sclient/interface.gointernal/k8sclient/mock.gointernal/maestroclient/client.gointernal/maestroclient/client_test.gointernal/maestroclient/interface.gointernal/maestroclient/ocm_logger_adapter.gointernal/maestroclient/operations.gointernal/maestroclient/operations_test.gointernal/manifest/generation.gointernal/manifest/generation_test.gointernal/manifest/render.gointernal/transportclient/interface.gopkg/health/metrics.gopkg/health/metrics_test.gopkg/health/server_test.gopkg/logger/stack_trace.gopkg/logger/with_error_field_test.gopkg/telemetry/otel.gopkg/telemetry/otel_test.gotest/integration/config-loader/loader_template_test.gotest/integration/executor/executor_integration_test.gotest/integration/executor/executor_k8s_integration_test.gotest/integration/executor/main_test.gotest/integration/executor/setup_test.gotest/integration/k8sclient/helper_selector.gotest/integration/maestroclient/client_integration_test.gotest/integration/maestroclient/client_tls_config_integration_test.gotest/integration/maestroclient/client_tls_integration_test.go
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/conventions/cel.md (1)
40-40:⚠️ Potential issue | 🟡 Minor | ⚡ Quick winClarify the reference to separate registration locations.
The reference combines two distinct registrations (custom functions and
ext.Strings()) under a single line number, which is misleading:
ext.Strings()is registered inbuildCELOptions()around line 67- Custom functions (
now,toJson,dig) are registered incustomCELFunctions()starting around line 71Developers looking up the implementation may be confused about where to find each component.
📝 Suggested clarification
-- Custom functions registered: `internal/criteria/cel_evaluator.go:71` (`ext.Strings()`) +- Custom functions and string extensions: `internal/criteria/cel_evaluator.go` (see `customCELFunctions()` and `buildCELOptions()`)Alternatively, to avoid line-number drift, reference the functions by name rather than line numbers.
🤖 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 `@docs/conventions/cel.md` at line 40, Update the documentation line that currently lumps registrations together by splitting the references: state that ext.Strings() is registered via buildCELOptions() and that the custom CEL functions now, toJson, and dig are registered via customCELFunctions() in internal/criteria/cel_evaluator.go; remove the specific line numbers and reference the registration functions and function names instead so readers can locate buildCELOptions(), customCELFunctions(), ext.Strings(), now, toJson, and dig directly.
🤖 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.
Outside diff comments:
In `@docs/conventions/cel.md`:
- Line 40: Update the documentation line that currently lumps registrations
together by splitting the references: state that ext.Strings() is registered via
buildCELOptions() and that the custom CEL functions now, toJson, and dig are
registered via customCELFunctions() in internal/criteria/cel_evaluator.go;
remove the specific line numbers and reference the registration functions and
function names instead so readers can locate buildCELOptions(),
customCELFunctions(), ext.Strings(), now, toJson, and dig directly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: ASSERTIVE
Plan: Enterprise
Run ID: da23348d-adeb-45d9-91ca-fde9219afdac
📒 Files selected for processing (1)
docs/conventions/cel.md
…s doc adapter metadata fields were wrong (name, status). Actual fields: executionStatus, resourcesSkipped, skipReason, errorReason, errorMessage, executionError, resourceErrors. Fix examples to use real expressions from adapter-task-config-template.yaml.
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rafabene The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
bcd847c
into
openshift-hyperfleet:main
Summary
Test Plan
make test-allpassesmake lintpassesmake test-helm(if applicable)