## Thinking Path
> - Paperclip manages agents in instances that can be idle between
tasks.
> - Recurring empty database and network checks can keep idle instances
and databases awake.
> - Worker migrations already use events, transaction-aware signals, and
shared deadlines.
> - New features can still add idle scans unless contributors and code
reviewers share an explicit rule.
> - This PR makes that rule discoverable through the repository rule
loader and Greptile.
> - The rule applies to added or expanded behavior without requiring
unrelated legacy polling to be removed.
## Linked Issues or Issue Description
Refs #15625, #17000, #17094, #17106, and #17129.
**Current behavior**
The repository has module ownership and runtime dependency rules, but no
explicit review requirement against new idle polling. A new duty in a
heartbeat tick can undo the benefits of previous worker migrations.
**Proposed behavior**
Require events for changed state, transaction-aware signals for
database-produced work, and shared scheduling for real deadlines. Reject
recurring empty scans, including scans disguised as scheduler callbacks.
Review narrow polling exceptions against concrete obligations and sleep
impact.
**Reason and benefit**
Make sleep-aware design a default review expectation. Preserve delivery,
ambiguous-commit recovery, drain/resume, and external wake correctness
while preventing new permanent idle traffic. Existing unrelated polling
stays outside the requested change.
## What Changed
- Add rules/sleep-aware-background-work.mdc for server, database,
adapter, plugin, and runner background paths, including
server/src/index.ts.
- Require concrete triggers, pending-work predicates, quiet conditions,
actual deadlines, and lifecycle evidence.
- Describe narrow exceptions for active operations and external sources,
with required scope, stop conditions, and sleep limitations.
- Distinguish in-process scheduling from durable Cloud wake coverage.
- Register the matching scopes in .greptile/files.json and link the rule
from rules/README.md.
- Reuse the existing module-boundary rule for ownership instead of
duplicating provider policy.
## Verification
- Passed: JSON parsing, required rule metadata, exact parity between
frontmatter globs and Greptile scopes, and all repository links.
- Passed: 15 representative path matches, including server startup,
nested service workers, producer routes, tests, database signals,
adapters, plugins, and both runner source trees. UI, CLI, docs, and
workflow paths remain outside this rule's glob scope.
- Passed: git diff --check.
- Manually checked contrasting review cases: reject a new empty queue
interval; reject an always-rescheduled empty scan; allow an actual retry
deadline; allow a bounded active readiness probe with lifecycle cleanup;
leave untouched legacy loops alone; reject sleep approval based only on
an internal timer.
- No runtime code changed. Application builds and tests were not rerun
for this rules-only change. This validates rule structure and intended
interpretation, not future reviewer compliance or deployed sleep.
- Greptile: 5/5 on 0b95bbd38a, with no
findings or unresolved threads. Full hosted CI passed on the same head:
https://github.com/paperclipai/paperclip/actions/runs/39664730299.
- An additional audit of existing rule scopes initially assumed all YAML
glob strings were quoted. The audit was corrected to accept the existing
unquoted form; all rule-to-manifest mappings then passed without changes
to those rules.
## Risks
- Broad source globs can surface the rule on unrelated edits. Its body
limits enforcement to new or materially changed background behavior and
explicitly excludes unrelated legacy migration demands.
- A blanket ban on every timer would reject legitimate active
operations. Narrow exceptions require evidence and do not exempt
permanent empty scans.
- Greptile and agent rule loading provide review guidance, not a
mechanical proof that no polling exists. No regex timer ban or new
runtime behavior is introduced.
## Model Used
OpenAI GPT-6 through Codex with reasoning, source and session
inspection, editing, and structural validation. Exact serving model ID
and context-window size are not exposed in this session.
## Checklist
- [x] I have included a thinking path that traces from project context
to this change
- [x] I have specified the model used (with version and capability
details)
- [x] I have checked ROADMAP.md and confirmed this PR does not duplicate
planned core work
- [x] I have searched GitHub for duplicate or related PRs and linked
them above
- [x] I have either (a) linked existing issues with `Fixes: #` / `Closes
#` / `Refs #` OR (b) described the issue in-PR following the relevant
issue template
- [x] I have not referenced internal/instance-local Paperclip issues or
links (only public GitHub `#NNN` / `github.com/paperclipai/paperclip`
URLs)
- [x] My branch name describes the change (e.g. `docs/...`, `fix/...`)
and contains no internal Paperclip ticket id or instance-derived details
- [x] I have run tests locally and they pass
- [x] I have added or updated tests where applicable
- [x] I have updated relevant documentation to reflect my changes
- [x] I have considered and documented any risks above
- [x] All Paperclip CI gates are green
- [x] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge
Co-authored-by: Paperclip <noreply@paperclip.ing>
Greptile configuration
This directory tracks the supported review configuration for
paperclipai/paperclip. It was prepared from a read-only dashboard inventory
on 2026-10-13. No dashboard settings or custom context were changed.
config.jsonrecords the observed review settings supported by Greptile's documented file schema.files.jsonloads repository context and scopes architectural rule files.rules.mdexplains how to apply the canonical Markdown rules inrules/.
Settings migrated to Git
| Dashboard setting | Repository configuration |
|---|---|
| Automatic reviews on all events | autoReview: ["open", "push", "rebase"] |
Exclude dependabot[bot]; remaining reviews use Base |
excludeAuthors, effort: "base" |
| High strictness (dashboard says it does not comment on P2s) | strictness: 3 |
| Do not replace the PR description | shouldUpdateDescription: false |
| Include PR summary, confidence score, and findings; no sequence diagram | The four section settings in config.json |
| Summary is not collapsible; default-open option is off | summarySection.collapsible and defaultOpen are false |
| Include a prompt to fix findings | fixWithAI: true |
| Status checks and status comments enabled | statusCheck and statusCommentsEnabled are true |
| Auto-approval disabled; stored risk ceiling is Low | autoApprove.enabled: false, riskCeiling: "low" |
The existing PR-description and 1,000-line growth guidance is in
rules/pull-request-review.mdc. That file also preserves the active,
repository-specific rule not to request UI screenshots. This resolves the
contradiction with the older organization instruction asking for screenshots.
The active dashboard pattern **/[Aa][Gg][Ee][Nn][Tt][Ss].md reported two files:
AGENTS.md and docs/api/agents.md. Both are explicit references in
files.json; the latter remains API context, not contributor policy. Future
context files need explicit manifest entries. The inactive Contribution
guidelines context remains inactive; it is not added as a separate context
file. Rules scoped to other repositories are not copied here.
Settings still managed in Greptile
The following observed controls do not have equivalents in the published
.greptile/ schema used for this migration. They remain dashboard settings:
- Review draft pull requests: enabled.
- Required confidence to pass the status check: 5/5.
- Image badges: enabled.
- Comment header: empty.
- Default coding-agent badges: no agents shown.
Repository enablement, provider authentication, billing, integrations, and learned memory also remain service settings. Auto-approval risk instructions, if used later, are explicitly dashboard-only in Greptile's reference. Do not invent config keys for unsupported controls.
Cutover and maintenance
Greptile reads committed configuration from the reviewed branch. No reindex is required. Local changes alone are not visible to the hosted reviewer.
File-based review settings override dashboard defaults, but dashboard rules and instructions are additive. The existing dashboard copies are still active. This is a staged migration, not a completed dashboard cleanup. After a hosted review verifies the configuration, an authorized maintainer can retire duplicate dashboard context scoped to this repository. Do not remove shared organization instructions while other repositories still depend on them.
Keep each policy's body in rules/; update the files.json scope together with
the rule's MDC frontmatter. The chat-channel rule includes both the directory
and its sibling service entry point. See rules/README.md for authoring steps.
References: configuration and precedence, supported fields and file references.