Files
PaperClipAI/.greptile/files.json
DottaandClaude b5f62b3384 docs(rules): correct the scope of the API route and company-scope rules (#20596)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - `rules/*.mdc` holds the architecture rules that reviewers and agents
apply to a change
> - Pull request #20585 added two rules: API route expectations and
company-scope exceptions
> - Review found that both rules state more than is true for the current
code
> - A rule that is too broad makes reviewers flag correct code and can
make an agent add a wrong check
> - This pull request corrects the scope of both rules and fixes one
stale pointer
> - The benefit is rules that match the code they describe

## Linked Issues or Issue Description

Refs #20585

**Issue type**

Incorrect contributor documentation.

**Where is the issue?**

`rules/api-route-expectations.mdc`,
`rules/company-scope-exceptions.mdc`, `AGENTS.md` section 8, and
`.agents/skills/honeycomb-tracing/SKILL.md`.

**What's wrong?**

- The API route rule said that every route checks company access.
Instance-level routes such as `health.ts`, `liveness.ts`, `ready.ts`,
`public-mcp.ts` and `org-chart-svg.ts` do not, and must not.
- The API route rule told reviewers to flag each status code outside a
list of seven. `429` and `503` are correct in some routes.
- The company-scope rule said that it lists the only instance-wide data.
`user_sidebar_preferences` is instance-wide and was not in the list.
- The company-scope rule said that it applies to new files that its
`globs` cannot match.
- The `honeycomb-tracing` skill pointed to `AGENTS.md` for the Telemetry
workflow. That text is now in `rules/data-paths.mdc`.

**Suggested fix**

Limit each rule to what is true, and repoint the skill.

## What Changed

- The API route rule and `AGENTS.md` section 8 now apply to routes that
read or write company data.
- The API route rule names the instance-level routes and says not to add
a company check to them.
- The status code list is now a list of common codes. Reviewers flag an
incorrect code, not an unlisted code.
- The company-scope rule lists the sidebar company order as an
instance-wide exception, in the text, the `globs`, and the Greptile
scope.
- The company-scope rule says "known data" and no longer claims to match
new files.
- The `honeycomb-tracing` skill points to `rules/data-paths.mdc`.

## Verification

- Read the two rules and confirm that each named file exists. A local
script checked the `globs` and the route names.
- Confirm that `.greptile/files.json` is valid JSON and that its scope
matches the rule `globs`.
- No source code changed. No test suite ran locally.

## Risks

- Low risk. The change is documentation only.
- The list of instance-level routes can go out of date when a route is
added.

## Model Used

- Claude (Anthropic), in Claude Code with tool use.
- `claude-fable-5-2`.

## 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
- [ ] 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
- [ ] All Paperclip CI gates are green
- [ ] Greptile is 5/5 with no open P2s, recommendations, or follow-ups
- [x] I will address all Greptile and reviewer comments before
requesting merge

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
2026-11-10 11:19:31 -06:00

167 lines
7.3 KiB
JSON

{
"files": [
{
"path": "AGENTS.md",
"description": "Repository contributor instructions and routing to scoped architecture rules."
},
{
"path": "docs/api/agents.md",
"description": "Agent API documentation retained from the existing Greptile agent-file context. This is API reference material, not contributor instructions."
},
{
"path": "rules/pull-request-review.mdc",
"description": "Existing Paperclip review guidance for PR descriptions, UI evidence, and growth of large source files."
},
{
"path": "rules/product-harness-responsibility.mdc",
"description": "Product requirements and review criteria for harness responsibility, minimal user-facing internals, truthful progress, and human decisions."
},
{
"path": "rules/module-boundaries.mdc",
"description": "Module ownership, justification of shared contract changes, delivery scope, and verification across affected consumers."
},
{
"path": "rules/feature-map-scope.mdc",
"description": "Limit feature-map additions to substantial new user capabilities; avoid minor-update churn and keep factual corrections minimal.",
"scope": [
"maps/**"
]
},
{
"path": "rules/runtime-dependency-boundaries.mdc",
"description": "Dependency cost, responsiveness, and verification requirements for changed server, adapter, and runner execution paths.",
"scope": [
"server/src/**",
"packages/adapter-utils/src/**",
"packages/adapters/*/src/**",
"packages/paperclip-runner/src/**",
"packages/paperclip-runner/runner/**"
]
},
{
"path": "rules/chat-channel-platform-boundaries.mdc",
"description": "Architecture requirements and review criteria for separating chat channel platform implementations from shared orchestration.",
"scope": [
"server/src/services/chat-channels/**",
"server/src/services/chat-channels.ts"
]
},
{
"path": "rules/heartbeat-execution-boundaries.mdc",
"description": "Heartbeat module ownership and review criteria for admission, cancellation, recovery, cleanup, and durable execution evidence.",
"scope": [
"server/src/services/heartbeat.ts",
"server/src/services/heartbeat/**",
"server/src/services/heartbeat-*.ts",
"server/src/__tests__/heartbeat-*.test.ts"
]
},
{
"path": "rules/database-migration-snapshots.mdc",
"description": "Snapshot retention requirements for migration generation, rebases, and review; preserve SQL migrations and journal history.",
"scope": [
"packages/db/src/schema/**",
"packages/db/src/migrations/**",
"packages/db/package.json",
"packages/db/drizzle.config.ts"
]
},
{
"path": "rules/sleep-aware-background-work.mdc",
"description": "Prevent new idle polling; require event-driven producers, real scheduler deadlines, obligation-based recovery, and lifecycle verification without forcing unrelated legacy migrations.",
"scope": [
"server/src/**",
"packages/db/src/**",
"packages/adapter-utils/src/**",
"packages/adapters/*/src/**",
"packages/plugins/*/src/**",
"packages/paperclip-runner/src/**",
"packages/paperclip-runner/runner/**"
]
},
{
"path": "rules/acpx-profile-identity.mdc",
"description": "ACPX provider identity model: provider digests attest upstream releases, the pack contract digest covers Runner source and the shared ACPX layer, and profile versions change only for deliberate resets.",
"scope": [
"packages/paperclip-runner/acpx-profiles.json",
"packages/paperclip-runner/cursor-contract.json",
"packages/paperclip-runner/cursor-distributions.json",
"packages/paperclip-runner/antigravity-distributions.json",
"packages/paperclip-runner/scripts/acpx-release-attestations.mjs",
"packages/paperclip-runner/scripts/generate-acpx-profiles.mjs",
"packages/paperclip-runner/scripts/contracts/**",
"packages/paperclip-runner/src/drivers/acpx/**",
"packages/paperclip-runner/src/providers/**",
"packages/paperclip-runner/protocol/**"
]
},
{
"path": "rules/ui-render-cost.mdc",
"description": "Render cost of UI components and hooks over large collections: no nested scans, stable memo dependencies, and realistic-size tests for changed large-collection paths.",
"scope": [
"ui/src/**/*.tsx",
"ui/src/**/use*.ts"
]
},
{
"path": "rules/upgrade-safe-run-state.mdc",
"description": "Upgrade safety for persisted run, session, launch, and pack state: state saved by the previous release resumes or fails with a permanent, named code, with old-saved/new-resumed and mid-run deploy tests.",
"scope": [
"server/src/services/native-runtime/**",
"server/src/services/recovery/**",
"server/src/services/heartbeat/session-preparation.ts",
"server/src/services/heartbeat/run-state.ts",
"server/src/services/runner-revision-mismatch.ts",
"server/src/services/sandbox-provider-runtime.ts",
"packages/paperclip-runner/**",
"packages/adapter-utils/src/acpx-engine/**",
"docker/daytona-runner/**",
"packages/db/src/schema/native_*.ts",
"packages/db/src/schema/agent_task_sessions.ts",
"packages/db/src/schema/run_identity_contexts.ts"
]
},
{
"path": "rules/data-paths.mdc",
"description": "Separation of Telemetry, Observability, and the run log, with the review level each path requires.",
"scope": [
"packages/shared/src/telemetry/**",
"server/src/instrumentation.ts",
"doc/observability.md",
"packages/adapter-utils/src/duplex-observability.ts",
"server/src/services/duplex-observability-recorder.ts",
"packages/adapter-utils/src/acpx-engine/startup-timing.ts",
"doc/run-log-events.md",
"packages/db/src/schema/heartbeat_run_events.ts",
"server/src/services/heartbeat.ts"
]
},
{
"path": "rules/api-route-expectations.mdc",
"description": "Company access checks, actor permissions, activity logging for mutations, and consistent HTTP errors on API routes.",
"scope": [
"server/src/routes/**"
]
},
{
"path": "rules/company-scope-exceptions.mdc",
"description": "The known instance-wide data (announcement dismissals, publication-ID registry, personal workspace preferences, sidebar company order) and the conditions that keep company boundaries intact.",
"scope": [
"packages/db/src/schema/announcement_dismissals.ts",
"packages/shared/src/announcements.ts",
"server/src/routes/announcements.ts",
"server/src/services/announcements.ts",
"server/src/services/announcement-feed.ts",
"packages/db/src/schema/user_workspace_preferences.ts",
"packages/shared/src/workspace-preferences.ts",
"server/src/routes/workspace-preferences.ts",
"server/src/services/workspace-preferences.ts",
"packages/db/src/schema/user_sidebar_preferences.ts",
"packages/shared/src/types/sidebar-preferences.ts",
"server/src/routes/sidebar-preferences.ts",
"server/src/services/sidebar-preferences.ts"
]
}
]
}