Skip to content

self-development: distill recurring conventions from PR review feedback#786

Open
kelos-bot[bot] wants to merge 6 commits intomainfrom
kelos-config-update-latest
Open

self-development: distill recurring conventions from PR review feedback#786
kelos-bot[bot] wants to merge 6 commits intomainfrom
kelos-config-update-latest

Conversation

@kelos-bot
Copy link
Copy Markdown

@kelos-bot kelos-bot Bot commented Mar 24, 2026

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

Distills eleven recurring conventions from recent PR review feedback and propagates them across AGENTS.md, the shared and worker AgentConfigs, and the reviewer prompts. All changes are backed by specific PR review findings — no speculative rules.

1. Never use os.Getenv() for secrets as Go flag defaults

  • Evidence: PR Remove token-refresher sidecar, generate tokens in-process #971 — P1 security findings in cmd/kelos-webhook-server/main.go and cmd/ghproxy/main.go where os.Getenv("GITHUB_TOKEN") was used as flag.StringVar default, leaking the secret in --help output.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new security checklist item).

2. Fail fast on invalid configuration

  • Evidence: PR Remove token-refresher sidecar, generate tokens in-process #971 — multiple P1/P2 findings where invalid GitHub App credentials, missing token resolvers, or failed token refreshes caused silent degradation (unauthenticated requests, skipped reporting) instead of erroring out.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new correctness checklist item).

3. Keep API surfaces minimal

  • Evidence: PR feat(api): Add generic webhook source for arbitrary event-driven task spawning #902 — repeated maintainer feedback on the generic webhook API: "API is hard to fix, so I'd like to find the best way to design it" / "Can we defer these fields for now?" / "Let's make the minimal API for this PR."
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-api-reviewer.yaml (new compatibility checklist item).

4. API changes must preserve backward compatibility for existing manifests

  • Evidence: PR feat: add bodyPattern and excludeBodyPatterns regex filters for GitHub webhooks #1058 — three distinct findings on the same PR:
    • Greptile P1: "Breaking schema change: BodyContains scalar → array" — existing in-cluster resources with bodyContains: "/kelos" (scalar) would fail Kubernetes structural-schema validation after the CRD update; the repo itself had at least 9 YAMLs in self-development/ and examples/ still using the old scalar form.
    • Maintainer (gjkim42) asked twice: "Is this backward-compatible? Does setting +kubebuilder:validation:MinLength=1 allow empty BodyPattern?" and "I just want to make sure that the existing YAMLs that don't have bodyPattern (because it's a newly introduced field) can be applied. can we just remove minLength here?"
    • Agreed resolution thread: add new fields and mark the old one +deprecated rather than remove it ("Why don't we add BodyPattern and ExcludeBodyPatterns and mark BodyContains deprecated here so that I can remove BodyContains later?").
  • This is distinct from "Keep API surfaces minimal" — minimal API is about scope of new additions; backward compatibility is about preserving existing manifests across CRD updates.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-api-reviewer.yaml (two new bullets under "API compatibility and evolution": one on validation tightening / kind changes, one on sweeping stale YAMLs).

5. Docs must match implementation, not aspiration

  • Evidence:
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new "Documentation accuracy" checklist subsection).

6. TaskSpawner conventions

  • Evidence: PR self-development: add kelos-api-reviewer TaskSpawner #965 — three distinct corrections from maintainer (gjkim42): use webhook-based triggers over poll-based; handle empty {{.Branch}} for issue events; design issue_comment prompts for both issue and PR contexts. PR Add API contract validation example (example 12) #974 — P2: "Remove the manual PR branch checkout instruction; Kelos already handles PR branch checkout automatically."
  • Applied to: agentconfig.yaml, kelos-workers.yaml. README template-variable table corrected from "Usually PR head branch" to "PR head branch; empty for issue events".

7. Don't use Gomega's global Expect() inside Eventually polling blocks

  • Evidence: PR test(e2e): poll Task phase via WaitForTaskPhase to fix flake #1084 — flagged independently by Greptile (P2) and cubic-dev-ai (P2). The original GetTaskPhase helper called Expect(err).NotTo(HaveOccurred()), which propagates the panic and short-circuits Eventually's polling on the first transient API error instead of retrying. Other WaitFor* helpers in the framework already guard against this by returning a zero-value on error. The fix was to introduce WaitForTaskPhase that inlines the API call and returns "" on error.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new bullet under the reviewer's Tests checklist).

8. /kind cleanup for self-development/-only PRs (new in latest commit)

  • Evidence: PR self-development: prevent kelos-bot from triggering self-development spawners #1100 (Greptile P2) — agent-generated PR modified only files under self-development/ but used /kind bug because the change was framed as a recursion-prevention bug fix. CLAUDE.md/AGENTS.md (line 34) already states the rule, but it was not echoed into the agent's agentsMD (where the other PR conventions are duplicated) nor in the reviewer's project-conventions checklist, so the worker missed it at PR-creation time and the kelos-reviewer pass did not flag it before merge.
  • Applied to: agentconfig.yaml, kelos-workers.yaml (echoed under Project Conventions); kelos-reviewer.yaml (new project-conventions checklist item with explicit P2 severity hint and the framing "classify by file location, not by problem nature").

9. CLI error messages must name the resource (new in latest commit)

  • Evidence: PR fix(cli): exit non-zero on failed task in 'run -w' #1101 (greptile-apps P2) on internal/cli/run.go:371: "The error string \"task failed\" omits the task name, so when Cobra prints the error in a pipeline (Error: task failed) it is ambiguous — especially if tooling invokes kelos run for multiple named tasks. Including name gives operators an actionable signal." The fix fmt.Errorf("task %s failed", name) was accepted.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new bullet under the reviewer's Code quality checklist).

10. Test the happy path, not only early-return guards (new in latest commit)

  • Evidence: PR feat(slack): post welcome message when bot is added to a channel #1096 — flagged independently by kelos-bot[bot] (P3) and greptile-apps[bot] on internal/slack/handler_test.go:352. kelos-bot: "Both new tests exercise only the early-return branches (non-bot user, empty message). The success path — that PostMessageContext is invoked with evt.Channel and h.joinMessage when the bot itself joins — has no coverage. … Injecting a small posting seam (interface/func field) or a fake HTTP transport for goslack.Client would let a positive test verify the call args." Sharpens the existing "always try to add or improve tests" rule by being specific: the agent has a recurring pattern of writing only the no-op branch tests because they're trivial without dependency injection, and skipping the happy path because the production code lacks a seam. The rule now requires building the seam.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new bullet under the reviewer's Tests checklist).

11. Avoid vacuous substring assertions in printer/formatter tests (new in latest commit)

  • Evidence: PR fix(cli): show source for generic webhook taskspawners #1106 (greptile-apps P2) on internal/cli/printer_test.go:619: "The \"sentry\" check passes vacuously because the fixture's Name is \"sentry-fixer\", which already contains the substring. If the Webhook Source line were accidentally omitted, this assertion would still pass, giving a false sense of coverage. A combined check for the full label + value string is the correct way to verify the field is present with the right value." The agent maintains a wide family of printTaskSpawner*, printTask*, printWorkspace* tests that all use strings.Contains(output, ...) and is at risk of the same trap (Name contains the value) recurring.
  • Applied to: AGENTS.md, agentconfig.yaml, kelos-workers.yaml, kelos-reviewer.yaml (new bullet under the reviewer's Tests checklist).

Also fixes the kelos-reviewer TaskSpawner branch field to use the safe {{with index . "Branch"}}{{.}}{{else}}main{{end}} fallback form instead of bare {{.Branch}}. Flagged P2 by Greptile in this PR's prior review (#786): the spawner listens on issue_comment, so a /kelos review triggered on a plain issue would land on whatever default state Kelos falls back to rather than main.

Aligns the documented Branch fallback form with the canonical form (addresses Greptile P2 on this PR): the convention text in agentconfig.yaml:41 and kelos-workers.yaml:40 previously prescribed {{if .Branch}}{{.Branch}}{{else}}main{{end}}, but the spawner YAMLs all use {{with index . "Branch"}}{{.}}{{else}}main{{end}}. The new "Docs must match implementation" rule applies to itself — updated the documented example to match the deployed form.

Sweeps the convention into kelos-squash-commits.yaml (addresses second Greptile P2 on this PR): the prior review noted that kelos-squash-commits.yaml listens on issue_comment without commentOn: PullRequest and uses bare {{.Branch}}, so /kelos squash-commits typed on a plain issue would fire the spawner with empty {{.Branch}} — and the prompt then runs git push --force-with-lease, which is unsafe to execute against an arbitrary branch fallback. Fixed by adding commentOn: PullRequest on the issue_comment filter, matching the pattern in kelos-pr-responder.yaml.

Which issue(s) this PR is related to:

N/A

Special notes for your reviewer:

This PR has been rebased onto current main. All changes are documentation/configuration; no runtime code changes.

Does this PR introduce a user-facing change?

NONE

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

No issues found across 4 files

@kelos-bot kelos-bot Bot changed the title Add pre-push verification and cross-surface update conventions Add deploy-dev sync, controller migration, and release note conventions Mar 28, 2026
kelos-bot Bot pushed a commit that referenced this pull request Mar 29, 2026
Add three new agent conventions from recent PR review feedback:

1. Per-TaskSpawner configuration should be CRD fields, not controller
   flags (PR #838 - gjkim42 review)
2. CRD API backward compatibility - never rename JSON field tags
   (PR #838 - P1 review finding)
3. Gate optional CRDs behind Helm values flags (PR #821 - PodMonitoring
   broke installs on clusters without monitoring.googleapis.com)

Also includes previously proposed conventions from PR #786:
- Consistent guidance across surfaces
- Provider-agnostic API design
- Idiomatic Helm values
- Deploy-dev workflow sync
- Controller-driven migration
- Release note user action requirements

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from bcdeef3 to 7ade17e Compare March 29, 2026 18:06
@kelos-bot kelos-bot Bot changed the title Add deploy-dev sync, controller migration, and release note conventions Add CRD design, API compatibility, and Helm gating conventions Mar 29, 2026
@gjkim42
Copy link
Copy Markdown
Collaborator

gjkim42 commented Mar 30, 2026

/kelos pick-up
rebase on origin/main

@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Mar 30, 2026

🤖 Kelos Task Status

Task kelos-pr-responder-786 has succeeded. ✅

@kelos-bot kelos-bot Bot added kind/cleanup and removed needs-kind Indicates an issue or PR lacks a kind/* label labels Mar 30, 2026
@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented Mar 30, 2026

🤖 Kelos Agent @gjkim42

/kelos needs-input

Rebased on origin/main (was already up to date). Added kind/cleanup label to fix check-pr-labels CI check. Updated PR body formatting.

The only failing CI check is comment-label — this is a repo-level permissions issue (kelos-bot[bot] lacks write access), not related to this PR. All core checks (build, test, verify, e2e, integration) passed on the current commit.

Ready for re-review.

@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 7ade17e to 782ce1c Compare March 30, 2026 18:13
@kelos-bot kelos-bot Bot changed the title Add CRD design, API compatibility, and Helm gating conventions Add Helm CRD escaping, Docker pinning, and Go safety conventions Mar 30, 2026
@kelos-bot kelos-bot Bot changed the title Add Helm CRD escaping, Docker pinning, and Go safety conventions Add test synchronization, RBAC, and Go safety conventions Apr 1, 2026
@kelos-bot kelos-bot Bot changed the title Add test synchronization, RBAC, and Go safety conventions Sync worker agent conventions and broaden K8s comparison rule Apr 2, 2026
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 0871329 to 6379545 Compare April 3, 2026 18:15
@kelos-bot kelos-bot Bot changed the title Sync worker agent conventions and broaden K8s comparison rule Add new agent conventions from PR review feedback and sync worker agent Apr 3, 2026
@kelos-bot kelos-bot Bot changed the title Add new agent conventions from PR review feedback and sync worker agent Propagate conventions to all agents and add new rules from PR reviews Apr 4, 2026
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 6f6241c to 41ed5c4 Compare April 7, 2026 18:06
@kelos-bot kelos-bot Bot changed the title Propagate conventions to all agents and add new rules from PR reviews Add consistent parallel paths convention and fix workers prompt bug Apr 7, 2026
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 41ed5c4 to 5f6baa8 Compare April 8, 2026 18:08
@kelos-bot kelos-bot Bot changed the title Add consistent parallel paths convention and fix workers prompt bug Add testing conventions, parallel paths, and fix agent prompt bugs Apr 8, 2026
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 5f6baa8 to 675ac75 Compare April 9, 2026 18:12
@kelos-bot kelos-bot Bot changed the title Add testing conventions, parallel paths, and fix agent prompt bugs Add API surface convention, sync agent configs, and fix prompt bugs Apr 9, 2026
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from eb7fce3 to f472430 Compare April 12, 2026 18:10
@kelos-bot kelos-bot Bot changed the title Add API surface convention, sync agent configs, and fix prompt bugs Add secret-in-flag-defaults convention and clarify Branch template variable Apr 12, 2026
kelos-bot Bot pushed a commit that referenced this pull request Apr 14, 2026
…eedback

Adds conventions learned from recent PR reviews:

1. Fail fast on invalid configuration (PR #971): three P1 and four P2
   issues flagged silent degradation when credentials or config were
   invalid, falling back to unauthenticated requests instead of
   erroring.

2. No manual PR branch checkout in TaskSpawner prompts (PR #974): Kelos
   already checks out the PR branch automatically; manual checkout
   instructions are redundant and confusing.

Also carries forward the previously proposed changes from PR #786:
- os.Getenv() secret-in-flag-defaults convention (PR #971)
- TaskSpawner creation conventions (PR #965)
- Branch template variable documentation fix (PR #965)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 1d88c65 to 0d360ce Compare April 14, 2026 18:07
@kelos-bot kelos-bot Bot changed the title Add secret-in-flag-defaults convention and clarify Branch template variable Add fail-fast convention, no-manual-checkout rule, and secret-in-flag-defaults Apr 14, 2026
@kelos-bot kelos-bot Bot changed the title Add fail-fast convention, no-manual-checkout rule, and secret-in-flag-defaults Add fail-fast, no-manual-checkout, secret-flag-default, and docs-accuracy conventions Apr 30, 2026
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 30, 2026

Greptile Summary

This PR distills eight recurring conventions surfaced by recent PR review feedback and propagates them across AGENTS.md, the shared and worker AgentConfig specs, and the reviewer prompt checklists. It also fixes two concrete spawner bugs: the bare {{.Branch}} reference in kelos-reviewer.yaml (replaced with the safe {{with index . "Branch"}} fallback) and the missing commentOn: PullRequest guard in kelos-squash-commits.yaml (preventing the force-push workflow from firing on plain issue comments).

  • Convention rollout: nine new rules added to AGENTS.md and mirrored verbatim into agentconfig.yaml/kelos-workers.yaml; kelos-reviewer.yaml and kelos-api-reviewer.yaml gain corresponding checklist items for the reviewer agent to enforce.
  • Branch fallback fix: kelos-reviewer.yaml branch field updated from {{.Branch}} to {{with index . "Branch"}}{{.}}{{else}}main{{end}}, and README.md corrects the variable description to reflect that it is empty for issue-only events.
  • Squash-commits guard: commentOn: PullRequest added to the issue_comment filter in kelos-squash-commits.yaml, preventing git push --force-with-lease from running against an undefined branch when triggered from a plain issue.

Confidence Score: 5/5

Documentation and configuration-only changes; no runtime Go code is modified. The spawner fixes are conservative and correct.

All changes are YAML configuration and Markdown. The branch-fallback fix in kelos-reviewer.yaml and the commentOn: PullRequest guard in kelos-squash-commits.yaml both narrow the attack surface of their respective spawners. Convention text is additive and consistent across all four files it touches.

kelos-squash-commits.yaml retains a bare {{.Branch}} that does not match the newly documented convention, though it is functionally safe given the commentOn: PullRequest guard.

Important Files Changed

Filename Overview
AGENTS.md Adds nine new engineering conventions covering secrets handling, fail-fast config, API surface, backward compatibility, docs accuracy, Gomega polling, CLI errors, happy-path testing, and substring assertions.
self-development/agentconfig.yaml Propagates all new conventions from AGENTS.md into the shared AgentConfig, including the TaskSpawner convention block with the corrected branch fallback form.
self-development/kelos-reviewer.yaml Branch field fixed from bare {{.Branch}} to safe fallback form; reviewer checklist expanded with new correctness, tests, security, docs-accuracy, and project-convention items.
self-development/kelos-squash-commits.yaml Adds commentOn: PullRequest guard to prevent firing on plain issues; branch field still uses bare {{.Branch}} rather than the safe fallback form being documented in this PR.
self-development/kelos-workers.yaml Propagates new conventions from AGENTS.md into the worker AgentConfig spec, including the TaskSpawner conventions block.
self-development/kelos-api-reviewer.yaml Extends the API compatibility checklist with three new bullets covering minimal API surface, backward compatibility (kind changes, validation tightening, deprecation-first), and stale manifest sweep.
self-development/README.md Corrects the {{.Branch}} description from 'Usually PR head branch' to 'PR head branch; empty for issue events' to match runtime behaviour.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[issue_comment / pull_request_review webhook] --> B{Spawner filter}
    B -->|kelos-reviewer\nissue_comment or pr_review| C[Branch fallback\nwith index Branch\nelse main]
    B -->|kelos-squash-commits\nissue_comment + commentOn:PullRequest\nor pull_request_review| D[branch: .Branch\nalways populated\nPR-only context]
    B -->|kelos-workers\nissue_comment + commentOn:Issue| E[branch: kelos-task-N\nstatic, no fallback needed]
    C --> F[Reviewer task\ngh pr review]
    D --> G[Squash task\ngit push --force-with-lease]
    E --> H[Worker task\ncreate/update PR]
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
self-development/kelos-squash-commits.yaml:55
The `branch` field in `kelos-squash-commits.yaml` still uses the bare `{{.Branch}}` form, which conflicts with the TaskSpawner convention being added in this very PR. While the new `commentOn: PullRequest` guard makes this functionally safe (branch is always populated from a PR), the convention text added to `agentconfig.yaml` and `kelos-workers.yaml` prescribes the `{{with index . "Branch"}}{{.}}{{else}}main{{end}}` form when the spawner listens on `issue_comment` — and the `pull_request_review` filter also exists here, making consistent defensive templating worthwhile.

```suggestion
    branch: '{{with index . "Branch"}}{{.}}{{else}}main{{end}}'
```

Reviews (7): Last reviewed commit: "self-development: add CLI error message ..." | Re-trigger Greptile

@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 7aff731 to 6a74ec3 Compare May 1, 2026 18:09
kelos-bot Bot pushed a commit that referenced this pull request May 1, 2026
Adds five conventions distilled from recent PR reviews and applies them
across AGENTS.md, the shared and worker AgentConfigs, and the reviewer
prompts.

1. Never use os.Getenv() for secrets as Go flag defaults (PR #971)
   — flag prints defaults in --help output, leaking secret values.

2. Fail fast on invalid configuration (PR #971) — do not silently fall
   back to unauthenticated/degraded behavior when credentials or config
   are missing.

3. Keep API surfaces minimal (PR #902) — only fields immediately needed,
   no speculative additions; API is hard to change once shipped.

4. Docs must match implementation, not aspiration (PRs #1035, #1056) —
   describe only what the code actually does; verify enforcement before
   documenting a contract.

5. TaskSpawner conventions (PRs #965, #974):
   - Prefer webhook-based triggers over poll-based.
   - {{.Branch}} is empty for issue-only events; use the
     {{if .Branch}}{{.Branch}}{{else}}main{{end}} fallback form.
   - issue_comment fires for both issues and PRs; design prompts to
     detect and handle both contexts.
   - Do not include manual PR branch checkout instructions — Kelos
     checks out the PR branch automatically.

Also fixes the kelos-reviewer TaskSpawner branch field to use the safe
fallback form (was using bare {{.Branch}}, which is empty for issue
events; flagged P2 in PR #786 review).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@kelos-bot kelos-bot Bot changed the title Add fail-fast, no-manual-checkout, secret-flag-default, and docs-accuracy conventions self-development: distill recurring conventions from PR review feedback May 1, 2026
@cubic-dev-ai
Copy link
Copy Markdown

cubic-dev-ai Bot commented May 2, 2026

You're iterating quickly on this pull request. To help protect your rate limits, cubic has paused automatic reviews on new pushes for now—when you're ready for another review, comment @cubic-dev-ai review.

gjkim42 and others added 3 commits May 3, 2026 18:03
Adds five conventions distilled from recent PR reviews and applies them
across AGENTS.md, the shared and worker AgentConfigs, and the reviewer
prompts.

1. Never use os.Getenv() for secrets as Go flag defaults (PR #971)
   — flag prints defaults in --help output, leaking secret values.

2. Fail fast on invalid configuration (PR #971) — do not silently fall
   back to unauthenticated/degraded behavior when credentials or config
   are missing.

3. Keep API surfaces minimal (PR #902) — only fields immediately needed,
   no speculative additions; API is hard to change once shipped.

4. Docs must match implementation, not aspiration (PRs #1035, #1056) —
   describe only what the code actually does; verify enforcement before
   documenting a contract.

5. TaskSpawner conventions (PRs #965, #974):
   - Prefer webhook-based triggers over poll-based.
   - {{.Branch}} is empty for issue-only events; use the
     {{if .Branch}}{{.Branch}}{{else}}main{{end}} fallback form.
   - issue_comment fires for both issues and PRs; design prompts to
     detect and handle both contexts.
   - Do not include manual PR branch checkout instructions — Kelos
     checks out the PR branch automatically.

Also fixes the kelos-reviewer TaskSpawner branch field to use the safe
fallback form (was using bare {{.Branch}}, which is empty for issue
events; flagged P2 in PR #786 review).

Co-Authored-By: Claude Opus 4.7 <[email protected]>
PR #1058 surfaced a recurring API-change pattern not covered by the
existing "Keep API surfaces minimal" rule:

- A scalar -> array kind change on an existing CRD field (BodyContains)
  was flagged P1 because existing in-cluster resources would fail
  structural-schema validation; the repo itself had ~9 stale YAMLs
  in self-development/ and examples/ still using the old scalar form.
- The maintainer asked twice about backward compatibility on a newly
  added BodyPattern field, and required removing
  +kubebuilder:validation:MinLength=1 because it would reject existing
  YAMLs that don't yet have the field.
- The agreed migration path was to add new fields and mark the old one
  +deprecated rather than remove it.

Adds the convention to AGENTS.md (and CLAUDE.md via symlink), to the
shared agentconfig.yaml and kelos-workers.yaml, and to the
kelos-api-reviewer prompt as an explicit checklist item under "API
compatibility and evolution".

Co-Authored-By: Claude Opus 4.7 <[email protected]>
…ing convention

Greptile flagged a P2 inconsistency on PR #786 itself: the convention
text in agentconfig.yaml and kelos-workers.yaml prescribed
{{if .Branch}}{{.Branch}}{{else}}main{{end}}, but the canonical form
used in the spawner YAMLs (kelos-reviewer.yaml, kelos-api-reviewer.yaml)
is {{with index . "Branch"}}{{.}}{{else}}main{{end}}. The new
"Docs must match implementation" rule applies to itself — fix the
documented example to match the deployed form.

PR #1084 fixed an e2e flake caused by GetTaskPhase calling the global
Expect(err).NotTo(HaveOccurred()) inside an Eventually polling loop;
Gomega does not retry on Expect failures, so a transient API error
short-circuits the poller. Both Greptile and cubic-dev-ai flagged the
same anti-pattern. Capture the lesson in AGENTS.md, the shared and
worker AgentConfigs, and add a reviewer checklist item so future
WaitFor* helpers either return a zero-value on error or use the
Eventually(func(g Gomega) { ... }) form.
@kelos-bot kelos-bot Bot force-pushed the kelos-config-update-latest branch from 2d628c4 to bdbd438 Compare May 3, 2026 18:05
@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 3, 2026

🤖 Kelos Agent @gjkim42

Pushed two new updates:

  1. Aligned the documented Branch fallback form with the canonical form used in the spawner YAMLs ({{with index . "Branch"}}{{.}}{{else}}main{{end}}). Addresses Greptile's P2 finding on this PR — the new "Docs must match implementation" rule applies to itself.

  2. Added a new convention distilled from PR test(e2e): poll Task phase via WaitForTaskPhase to fix flake #1084's reviews: don't use Gomega's global Expect() inside Eventually polling blocks (Gomega does not retry on Expect failures). Both Greptile and cubic-dev-ai flagged the same anti-pattern. Captured in AGENTS.md, the shared and worker AgentConfigs, and the reviewer's Tests checklist.

Branch was rebased on origin/main before pushing.

…y PRs

PR #1100 was an agent-generated PR that modified only self-development/
files but used /kind bug. Greptile flagged it P2 against the existing
CLAUDE.md/AGENTS.md rule:

  PRs that only modify files under self-development/ are internal agent
  improvements — use /kind cleanup and write NONE in the release-note
  block.

The rule lives in the project's AGENTS.md but was not echoed into the
agent's own agentsMD (where most other PR conventions are duplicated)
nor surfaced in the reviewer's project-conventions checklist. So the
worker missed it at PR-creation time, and the kelos-reviewer pass did
not catch it before merge.

Echo the rule into the shared and worker AgentConfigs, and add an
explicit reviewer checklist item with a P2 severity hint so a /review
pass on a self-development/-only PR will flag a wrong /kind label.

The framing emphasizes "classify by file location, not by problem
nature" — the failure mode in PR #1100 was the agent picking the label
from the change's semantic intent (recursion-prevention bug fix) rather
than from the directory scope.
@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 4, 2026

🤖 Kelos Agent @gjkim42

Pushed one new commit (cea8c90):

/kind cleanup rule for self-development/-only PRs — distilled from PR #1100's Greptile P2. The convention exists in AGENTS.md (line 34) but was missed by the worker at PR-creation time and not surfaced in the reviewer's project-conventions checklist. Echoed it into the shared and worker AgentConfigs and added a P2 reviewer checklist item with the framing "classify by file location, not by problem nature".

Branch was rebased on origin/main before pushing. PR description updated to include the new convention.

Adds commentOn: PullRequest to the issue_comment filter in
kelos-squash-commits.yaml. Without this guard, /kelos squash-commits
typed on a plain issue triggers the spawner with empty {{.Branch}};
the prompt then runs git push --force-with-lease against whatever
branch fallback Kelos uses, which is unsafe for a destructive
operation. This matches the existing pattern in
kelos-pr-responder.yaml and is the same convention captured in the
shared agentconfig.

Reported by Greptile P2 on PR #786 ("kelos-squash-commits.yaml
(outside diff) still uses bare {{.Branch}} without a PR-only filter
and should be updated in a follow-up").
@kelos-bot
Copy link
Copy Markdown
Author

kelos-bot Bot commented May 5, 2026

🤖 Kelos Agent @gjkim42

Pushed one new commit (dcc3fff):

Sweeps the new convention into kelos-squash-commits.yaml — addresses Greptile P2 on this PR ("self-development/kelos-squash-commits.yaml (outside diff) still uses bare {{.Branch}} without a PR-only filter and should be updated in a follow-up"). Adds commentOn: PullRequest on the issue_comment filter, matching the pattern in kelos-pr-responder.yaml. Without this guard, /kelos squash-commits typed on a plain issue would fire the spawner with empty {{.Branch}}, and the prompt would then git push --force-with-lease against whatever branch fallback Kelos uses — unsafe for a destructive operation.

Branch is one commit behind origin/main (#1101 merged after the previous push). Did not rebase here because the PR cumulatively touches many of the files that have evolved in main and the conflict resolution is non-trivial; happy to handle that on /kelos pick-up.

Distills three additional conventions from review feedback on recent
PRs (#1101, #1106, #1096):

- CLI error messages must name the failing resource (PR #1101 P2)
- Tests must cover the happy path, not only early-return guards
  (PR #1096 P3, flagged by both kelos-bot and greptile-apps)
- Avoid vacuous substring assertions in printer/formatter tests
  (PR #1106 P2)

Applied to AGENTS.md (and via symlink CLAUDE.md), agentconfig.yaml,
kelos-workers.yaml, and the reviewer prompt's Tests / Code quality
checklists.
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.

1 participant