Skip to content

Commit f2840b3

Browse files
anandgupta42claude
andcommitted
fix: keep the cost rule out of the forbidden root AGENTS.md
The upstream guard tests forbid a root `AGENTS.md`. The rule now lives in `packages/opencode/AGENTS.md` and, repo-wide, in `CONTRIBUTING.md`; `REVIEW.md` keeps the review bots checking every PR. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 464335c commit f2840b3

4 files changed

Lines changed: 28 additions & 18 deletions

File tree

‎.github/pull_request_template.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Please provide a description of the issue, the changes you made to fix it, and w
1717

1818
### How did you verify your code works?
1919

20-
<!-- altimate_change start — required cost side-effects section (see AGENTS.md) -->
20+
<!-- altimate_change start — required cost side-effects section (see CONTRIBUTING.md) -->
2121
### Cost side effects
2222

2323
_Does this change add model calls, warehouse queries or cloud resources whose cost grows with user data (rows, files, items)? Describe each one and how it is capped, estimated and confirmed, or write "None"._
@@ -31,7 +31,7 @@ _If this is a UI change, please include a screenshot or recording._
3131

3232
- [ ] I have tested my changes locally
3333
- [ ] I have not included unrelated changes in this PR
34-
<!-- altimate_change start — cost side-effects check (see AGENTS.md) -->
34+
<!-- altimate_change start — cost side-effects check (see CONTRIBUTING.md) -->
3535
- [ ] I checked for cost side effects (model calls, queries or cloud resources that grow with user data) and described them, or wrote "none"
3636
<!-- altimate_change end -->
3737

‎AGENTS.md‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

‎CONTRIBUTING.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ Some debug methods that can be problematic:
204204

205205
With that said, you may want to try these methods, as they might work for you.
206206

207+
## Cost side effects
208+
209+
Check every feature for spend that grows with user data instead of with the conversation, and flag it in the PR template's "Cost side effects" section, even when the answer is "None". The PR-standards check flags a missing or empty section on contributor PRs (it skips team members), and the review bots check every PR against `REVIEW.md` focus area 12. Examples: model calls per row, batch, file or item inside a tool; hidden model calls (sub-calls in tools, background or automatic calls); unbounded warehouse queries, scans or exports; starting cloud resources. Users' tables can hold millions of rows, so a per-row design that looks cheap in a test can cost thousands of dollars per question.
210+
211+
Such a path must be:
212+
213+
- Off by default, or bounded by a hard cap that does not scale with data size.
214+
- Above the cap, shown as a cost estimate and run only after the user confirms.
215+
- On the cheapest adequate model by default, with no prompt-cache breakpoint on one-off content (a cache write costs more than uncached input and is never read back).
216+
- Counted in session cost and traces, so its spend is visible.
217+
218+
Bulk labeling of text through the session model is the cautionary case: on by default, it cost about 7x the agent sessions themselves on one evaluation day, and none of it appeared in traces.
219+
207220
## AI Contributions Policy
208221

209222
We welcome contributions from developers who use AI tools as part of their workflow. However, we require that all contributions reflect genuine understanding and effort from the contributor.

‎packages/opencode/AGENTS.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,19 @@
1212
- Capture the current TUI output with: `tmux capture-pane -pt opencode-dev`.
1313
- Stop the session explicitly when done: `tmux kill-session -t opencode-dev`.
1414

15+
# Cost side effects
16+
17+
Check every feature for spend that grows with user data instead of with the conversation, and flag it in the PR template's "Cost side effects" section, even when the answer is "None". The PR-standards check flags a missing or empty section on contributor PRs (it skips team members), and the review bots check every PR against `REVIEW.md` focus area 12. Examples: model calls per row, batch, file or item inside a tool; hidden model calls (sub-calls in tools, background or automatic calls); unbounded warehouse queries, scans or exports; starting cloud resources. Users' tables can hold millions of rows, so a per-row design that looks cheap in a test can cost thousands of dollars per question.
18+
19+
Such a path must be:
20+
21+
- Off by default, or bounded by a hard cap that does not scale with data size.
22+
- Above the cap, shown as a cost estimate and run only after the user confirms.
23+
- On the cheapest adequate model by default, with no prompt-cache breakpoint on one-off content (a cache write costs more than uncached input and is never read back).
24+
- Counted in session cost and traces, so its spend is visible.
25+
26+
Bulk labeling of text through the session model is the cautionary case: on by default, it cost about 7x the agent sessions themselves on one evaluation day, and none of it appeared in traces.
27+
1528
# Module shape
1629

1730
Do not use `export namespace Foo { ... }` for module organization. It is not

0 commit comments

Comments
 (0)