Commit Graph
4 Commits
Author SHA1 Message Date
Nicky LeachandPaperclip c4e80ccdc8 chore(db): prune obsolete migration snapshots and document retention (#16194)
## Thinking Path

> - Paperclip uses versioned PostgreSQL migrations to preserve
application data.
> - Drizzle uses schema snapshots to generate future migrations.
> - The database package already prunes snapshots to the five newest
files.
> - PR #15749 added three snapshots but left eight in the resulting
tree.
> - This PR removes the three excess files and documents the retention
requirements.
> - Coding agents and Greptile receive the same scoped rule for future
migration changes.

## Linked Issues or Issue Description

Refs #15749. Related: #16191 includes overlapping snapshot cleanup with
its new migration. This PR isolates the existing excess and the
repository rule; it has no dependency on that feature.

**What happened?**

The migration metadata directory contains snapshots 0331–0338. The
existing pruning script retains only the newest five, but the older
three were left in master.

**Expected behavior**

Keep snapshots 0334–0338. Commit snapshot pruning alongside additions
and recheck the combined tree after rebases or merges. Preserve all SQL
migrations and journal entries.

**Steps to reproduce**

At master commit e3029c632, list
`packages/db/src/migrations/meta/*_snapshot.json`. There are eight
files. Run `pnpm --filter @paperclipai/db prune:snapshots`; snapshots
0331–0333 are removed.

**Paperclip version or commit**

e3029c632. Repository maintenance; deployment mode is not applicable.

## What Changed

- Remove snapshots 0331–0333 using the existing pruning script.
- Add `rules/database-migration-snapshots.mdc` with retention,
generation, rebase, preservation, and review requirements.
- Register the rule in `.greptile/files.json` with matching scope
patterns.

## Verification

- Existing `prune:snapshots` script completed successfully via `npm run
--prefix packages/db prune:snapshots`.
- Existing migration numbering and safety checks passed, run with the
available tsx loader. Safety reported only baseline-covered historical
findings.
- A local assertion check confirmed exactly snapshots 0334–0338 remain,
with retained snapshots and journal byte-for-byte equal to the base. SQL
migrations are unchanged.
- A local assertion check verified that rule globs equal the Greptile
scope, all manifest paths exist, representative migration/schema files
match, and unrelated server/UI files do not match.
- `node scripts/check-maps.mjs` and `git diff --check` passed.
- Full application typecheck, test suite, and build were not run for
this metadata and review-rule-only change. No runtime code, schema, SQL,
or dependencies changed.

## Risks

Low risk. The five newest schema snapshots remain unchanged. Database
migration history is preserved. The rule supplies agent and review
guidance; it does not add a new CI enforcement gate. Recheck retention
if another migration merges first.

## Model Used

OpenAI GPT-6 via Codex, with reasoning and shell/file tools. The exact
runtime 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
- [ ] 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

Co-authored-by: Paperclip <noreply@paperclip.ing>
2026-10-13 09:08:04 -07:00
DottaandPaperclip 9cb3e157b3 docs: keep routine product work in the harness (#16193)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - The runtime and server handle routine execution and recovery.
> - Product flows can expose internal steps that the system can handle
safely.
> - Users then have to operate infrastructure to achieve their original
goal.
> - This pull request adds a short rule that assigns this work to the
harness.
> - The benefit is a calm product experience with useful details and
real choices.

## Linked Issues or Issue Description

**Issue type**

Missing documentation.

**Where is the issue?**

`rules/` and the repository review configuration.

**What's wrong?**

The repository has no shared product rule for harness responsibility and
useful user-facing detail. Recovery can become a user checklist even
when the system knows the next safe step. Related implementation:
#15824.

**Suggested fix**

Require the harness to perform routine work within its existing
authority. Require visible controls and details to serve a real decision
or useful outcome. Keep progress truthful and apply the rule to changed
flows.

## What Changed

- Add the short product rule in
`rules/product-harness-responsibility.mdc`.
- Register it as a repository-wide review rule in
`.greptile/files.json`.
- Link the rule from `rules/README.md`.

## Verification

- `git diff --check origin/master...HEAD` passed.
- Node assertions passed for rule frontmatter, unique reviewer
registration, repository-wide scope, all registered file paths and the
README link.
- The diff contains only three rule/documentation files. No application
behavior changes. Application typecheck, tests and build were not run
for this documentation change.
- Review the rule's scope and read its four product requirements and
review criterion. All applicable CI checks passed on head `89803a6cd7`.
Greptile gave 5/5 with no unresolved findings.

## Risks

The rule affects future product design and review. It applies to changed
flows and does not require unrelated redesigns. Existing permissions,
approvals and runtime safeguards remain in force. No migration or
deployment is required.

## Model Used

OpenAI Codex, GPT-6, with repository inspection, tool use and code
execution. The exact serving model ID and context-window size were not
exposed in this session. The user edited and approved the final short
rule.

## 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>
2026-10-13 10:50:03 -05:00
DottaandPaperclip e67db42dc9 docs: define heartbeat execution design principles (#16190)
## Thinking Path

> - Paperclip coordinates AI agents and their work.
> - Heartbeat controls when that work starts, who owns execution, and
how it settles.
> - The extracted modules need shared architectural guidance as they
evolve.
> - Rules should protect those boundaries without freezing the current
implementation.
> - This PR adds scoped heartbeat principles for contributors and
reviewers.
> - The rule helps future changes preserve execution authority and
recoverable work.

## Linked Issues or Issue Description

**Issue type**

Missing documentation.

**Where is the issue?**

The heartbeat service has a module map but no scoped architectural rule
under `rules/`.

**What's wrong?**

Changes span admission, execution, completion, and recovery. Reviewers
need shared principles for authority, ownership, and settlement across
these boundaries.

**Suggested fix**

Add a concise heartbeat rule, route contributors to it from `AGENTS.md`,
and register the same scope for Greptile. Keep implementation details in
the code and existing developer documentation.

Related: #16172 established scoped repository rules. #15984 completed
the latest heartbeat extraction. Searches found no duplicate
heartbeat-guidelines PR.

## What Changed

- Add `rules/heartbeat-execution-boundaries.mdc` with a folder guide, a
concise map of existing module responsibilities, and six design
principles.
- Keep `heartbeat.ts` focused on coordination: extend an existing owner
or extract cohesive modules when new behavior would substantially grow
it, with tests and explicit contracts.
- Cover current execution authority, explicit ownership, distinct
completion obligations, recovery intent, durable state, and visible
uncertainty.
- Register matching paths in `.greptile/files.json` and link the rule
from `AGENTS.md` and `doc/DEVELOPING.md`.
- Include behavioral review criteria and flag substantial coordinator
growth or mixed responsibilities while allowing justified cohesion and
ordering exceptions.

## Verification

- Parsed the rule YAML and Greptile JSON. Confirmed that the rule globs
exactly match the Greptile scope.
- Checked 14 positive and negative scope cases with Node's
`path.matchesGlob`, including nested heartbeat modules, sibling
services, regression tests, and unrelated paths.
- Verified local links and heading anchors, including the existing
heartbeat module map, and confirmed all 20 named modules exist. Reviewed
their responsibility descriptions against the current code and developer
documentation.
- `git diff origin/master --check` passed after rebasing onto current
master.
- Reviewed the principles against the current heartbeat code and tests.
The diff changes four documentation and review-configuration files.
- Application typecheck, runtime tests, and build were not run locally.
This worktree has no installed dependencies. CI and review status are
tracked below.

- CI passed on `a17f5a2cc82b7bb7e4629d4a2d9e3a766e27c5c0`: 55 successful
checks, two skipped, no failures or pending checks. This includes
typecheck, build, server/runner tests, and browser tests.
- Greptile reviewed the same commit at 5/5 with no findings or
unresolved review threads.

## Risks

The rule can influence later implementation and review decisions. It
applies to changed heartbeat behavior and permits justified contract
changes with tests. The scoped globs exclude unrelated subsystems. This
PR does not change application behavior. Hosted loading of the new rule
has not been demonstrated by the local configuration checks.

## Model Used

OpenAI GPT-6 Astra (`gpt-6-astra`) via Codex, with repository
inspection, file editing, and command execution. The context-window size
was not exposed to 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 (scoped rule/configuration
checks described above)
- [x] I have added or updated tests where applicable
(documentation/configuration validation; no runtime changes)
- [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>
2026-10-13 10:48:17 -05:00
DottaandPaperclip 7ac0354b51 docs: track chat channel rules and Greptile configuration (#16172)
## Thinking Path

> - Paperclip is the open source app people use to manage AI agents for
work.
> - Chat channels connect shared task workflows to several platforms.
> - Recent refactors moved platform behavior into named channel folders.
> - Authors and reviewers need a durable rule that preserves these
boundaries.
> - Review settings also need version control and an explicit source of
rules.
> - This pull request adds scoped MDC rules and a staged migration of
supported Greptile settings into Git.

## Linked Issues or Issue Description

**Issue type**

Missing documentation and versioned review configuration.

**Where is the issue?**

Root contributor instructions, chat channel architecture guidance, and
Greptile configuration for this repository.

**What's wrong?**

The channel folder boundary is established in the refactor but has no
focused rule for future changes. Greptile settings and custom context
are maintained in the dashboard.

**Suggested fix**

Keep canonical rule bodies under `rules/`. Route coding agents through
`AGENTS.md` and load matching rules through `.greptile/files.json`.
Preserve supported review settings in `.greptile/config.json` and
document the remaining dashboard controls.

Related work: #15823 and #16080. A search for related rule PRs found no
duplicate configuration change.

## What Changed

- Add `rules/chat-channel-platform-boundaries.mdc`. Its scope covers
`server/src/services/chat-channels/**` and the sibling
`chat-channels.ts` entry point.
- Define provider folder ownership, shared workflow boundaries, typed
dependencies, behavior-preserving extraction, and dispatch exceptions.
- Add rule-loading instructions to root `AGENTS.md` and
`.greptile/rules.md`.
- Add explicit, scoped context references in `.greptile/files.json`.
- Record observed review triggers, the Dependabot exclusion, Base tier,
High strictness, summary options, fix prompts, status checks, and
disabled auto-approval in `.greptile/config.json`.
- Move existing PR-description, source-file growth, and
repository-specific screenshot guidance into
`rules/pull-request-review.mdc`.
- Document supported settings, remaining dashboard controls, and the
staged cutover. The dashboard was inspected read-only; no settings or
saved rules were changed.

## Verification

- Parse both MDC headers with Ruby `YAML.safe_load`: passed.
- Parse both Greptile JSON files and verify documented field types and
observed values: passed.
- Verify all four context references resolve to repository files:
passed.
- Compare scoped MDC globs with the corresponding Greptile scope:
passed.
- Check ten positive and negative scope cases with Node
`path.matchesGlob`: passed. Includes the service entry point, nested
provider files, and unrelated runner, connection, and UI paths.
- Verify the scope covers all 101 tracked chat-channel files: passed.
- `git diff --check`: passed.
- Application typecheck, `pnpm test:run`, and build were not run
locally. This change contains only guidance and reviewer configuration,
and this worktree has no installed application dependencies. No runtime
behavior or application tests changed.
- Greptile reviewed commit `32647dfd001289a297b9d43c381371da8575df38`:
5/5, eight files reviewed, zero comments. Hosted CI is still running.

## Risks

- Instructions depend on agent and reviewer compliance; these files are
not deterministic lint rules.
- The new MDC directory is explicitly routed through `AGENTS.md` and
Greptile. Cursor does not automatically discover arbitrary `rules/`
directories.
- This preserves the observed High strictness setting, which the
dashboard says omits P2 comments. It does not change that review policy.
- Dashboard instructions and custom rules remain additive. Their copies
were not disabled during read-only inspection. The repository-specific
no-screenshot rule explicitly takes precedence over the conflicting
older organization instruction.
- Draft review, the required 5/5 status threshold, image badges, and
other controls without documented config equivalents remain in the
dashboard. See `.greptile/README.md` for the inventory and cutover
limitations.

## Model Used

OpenAI Codex based on GPT-6. The exact runtime model ID and
context-window size are not exposed in this session. Used reasoning,
repository inspection, shell validation, official documentation, and
read-only browser inspection.

## 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 (configuration parsing and
scope checks described above; application suites were not run)
- [x] I have added or updated tests where applicable (no runtime change;
checked configuration directly)
- [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
- [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>
2026-10-13 08:59:27 -05:00