Files
PaperClipAI/rules/data-paths.mdc
T
DottaandClaude b004519fde docs(agents): shorten AGENTS.md and move data-path detail to a scoped rule (#20557)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work
> - `AGENTS.md` is the instruction file that each human and AI
contributor reads before a change
> - The file had 311 lines, and most of the text applied to only a few
areas of the repository
> - The file told each contributor to read five documents before every
change and to treat `doc/SPEC-implementation.md` as the build contract
> - The file listed 4 of the 12 rules in `rules/`, so the list was
already out of date
> - This pull request states contributor ownership, makes the code and
tests the source of truth, and moves path-specific detail into a scoped
rule
> - The benefit is a shorter file that agents load on every session,
with detail that loads only for the files it applies to

## Linked Issues or Issue Description

**Issue type**

Outdated or unclear contributor documentation.

**Where is the issue?**

`AGENTS.md` at the repository root.

**What's wrong?**

- The file told contributors to read five documents in order before each
change.
- The file made `doc/SPEC-implementation.md` the build contract and part
of the definition of done. The maintainer considers that document
outdated.
- The file kept a manual list of scoped rules. The list named 4 of the
12 rules.
- Rule 7 (the three data paths) used about 40 lines. The rule applies
only to telemetry, observability, and run-log files.
- The agent preflight instruction was in the verification section, not
in the setup section.
- The design system section had no number and came after the definition
of done.

**Suggested fix**

Keep in `AGENTS.md` only the text that applies to every change. Move
path-specific text to `rules/` and point to `doc/` for detail.

## What Changed

- Added an ownership statement at the top of `AGENTS.md`.
- Section 1 now says that the code and tests are the source of truth.
The spec documents are background.
- Removed the spec from the definition of done and from rule 4.
- Section 2 is now a table that maps a type of change to the document to
read.
- Removed the manual rule list. The instruction to read each matching
rule in `rules/*.mdc` stays.
- Moved agent preflight to section 4. The database reset step now says
that it deletes local data.
- Rule 7 is now a short summary. The full text is in the new
`rules/data-paths.mdc`.
- Added `rules/data-paths.mdc` to `.greptile/files.json` with the same
scope as the rule globs.
- `CONTRIBUTING.md` now links to the new rule.
- Section 7 is now the default command and six labelled rules. Maps and
Storybook are one subsection.
- The design system text is now a subsection of section 9.
- Section numbers did not change, because code comments cite `AGENTS.md
§5.7` and `§6`.

## Verification

- Open `AGENTS.md` and confirm that each link and each path resolves. A
local script checked this.
- Compare `rules/data-paths.mdc` with the old rule 7 text. The
definitions and review levels are the same.
- Confirm that `.greptile/files.json` is valid JSON and that the new
scope matches the rule globs.
- No source code changed. No test suite ran locally.

## Risks

- Contributors no longer treat the spec as a requirement. A change can
now differ from the spec without an update to the spec.
- An agent that does not read scoped rules gets only the summary of the
three data paths. The summary keeps the review level for each path.
- Two Storybook instructions now live only in `maps/README.md` and
`maps/storybook-map/README.md`.

## Model Used

- Claude (Anthropic), in Claude Code with tool use.
- `claude-opus-5-5` added the ownership line and did the first review.
- `claude-fable-5-2` wrote the restructure and this pull request.

## 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 09:19:10 -06:00

71 lines
3.5 KiB
Plaintext

---
description: Keep Telemetry, Observability, and the run log distinct, and apply the review level that matches the path a change touches.
globs: "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"
alwaysApply: false
---
# Three data paths
## Scope and purpose
This repo has three separate data paths. Do not confuse them. Match a change to
a path by its file path, not by the word "observability" or "telemetry" alone.
This rule also applies to any file that adds or changes a caller of
`packages/shared/src/telemetry/events.ts` or
`packages/shared/src/telemetry/client.ts`, even when that file is outside the
globs above.
## The paths
- **Telemetry** is the Paperclip first-party event system. It is opt-out and it
sends data to a Paperclip endpoint by default. Its paths are:
- `packages/shared/src/telemetry/`
- the generated contract `packages/shared/src/telemetry/generated/paperclip-telemetry.ts`
- each caller of `packages/shared/src/telemetry/events.ts` or `packages/shared/src/telemetry/client.ts`
- **Observability** is the OpenTelemetry trace path. An operator must set an
OTLP endpoint. Until an operator sets the endpoint, the tracer is a
no-operation. Its paths are:
- `server/src/instrumentation.ts`
- `doc/observability.md`
- `packages/adapter-utils/src/duplex-observability.ts`
- `server/src/services/duplex-observability-recorder.ts`
- the span attributes in `packages/adapter-utils/src/acpx-engine/startup-timing.ts`
- **The run log** holds rows in the local `heartbeat_run_events` table. The data
stays in the instance database. Its paths are:
- `doc/run-log-events.md`
- `packages/db/src/schema/heartbeat_run_events.ts`
- the append path `appendRunEvent` in `server/src/services/heartbeat.ts`
## Requirements
Apply a review level that matches the path:
- **Telemetry change (strict review).** The author updates the generated
contract first. The author updates `packages/shared/src/telemetry/README.md`
in the same pull request. The author requests a privacy review. Reason: a
Telemetry event goes to a Paperclip endpoint by default, so a mistake sends
data immediately.
- **Observability change (lighter review).** The operator endpoint gate stays in
place. The no-operation behaviour stays when no endpoint is set. A privacy
review is not necessary while the change stays inside the closed
span-attribute allowlist.
- **Run-log change (no extra review).** A run-log change needs neither review
level above, because the data stays in the instance database. Update
`doc/run-log-events.md` when an event is added or changed.
## Exclusion
The word "observability" in a file such as
`server/src/services/recovery-observability.ts` names a different concept. Apply
this rule by path, not by word match.
## Review criteria
Identify which path each changed file belongs to. Flag a Telemetry change that
lacks the generated-contract update, the README update, or a privacy review
request. Flag an Observability change that emits without the operator endpoint
or adds a span attribute outside the allowlist. Flag data described as
"telemetry" or "observability" that is actually written to a different path. Do
not request a privacy review for a run-log-only change.