Skip to content

Latest commit

 

History

History
54 lines (40 loc) · 4.47 KB

AGENTS.md

File metadata and controls

54 lines (40 loc) · 4.47 KB

AI Agent Guidelines

Version Control

  • Commits: Use conventional commits (e.g., fix:, feat:, refactor:).

UI Conventions

  • Permission gating: gate every write/delete control on a named gate from OrganizationsService (canWriteProject, canAdminOrg, …), never an inline scope list. The backend enforces access regardless; gating keeps users from clicking actions that will 403.
    • Missing permission → hide with @if (canXxx()). If that empties a card, hide the card or render its data read-only.
    • Transient state → [disabled] (in-flight request, missing prerequisite), never for permission.
    • A blocked action shows its reason as visible text, with the control disabled beside it or hidden; never a tooltip-only reason.
    • Write and admin are different scopes. Deletes usually need the admin gate; check the endpoint's @org_scoped scopes in the backend.
    • Re-word copy that points at a hidden control ("press Create Team") so it doesn't render when the control is gated away.
    • Multi-org views can't use these gates: they derive from the one selected organization.

Local Development

  • Backend: sibling repo glitchtip-backend. Start with docker compose up -d from that repo; API is served on http://localhost:8000.
  • Frontend: npm start in this repo; dev server at http://localhost:4200 proxies API calls to the backend.
  • Test login: the backend's first-run bootstrap prints a seeded admin user (email and password) in the web container logs — inspect with docker compose logs web in the backend repo to retrieve current credentials before logging in via the UI.
  • API token for seeding: the bootstrap also seeds a full-scope API token on the test user (label bootstrap_dev). Query it with docker compose exec web python manage.py shell -c "from apps.api_tokens.models import APIToken; print(APIToken.objects.first().token)" and use Authorization: Bearer <token> against http://localhost:8000/api/0/... to create orgs/projects/events/transactions. Prefer this over driving sessions via curl or clicking through the UI when generating test data.

Licensing — Clean Room Development

GlitchTip is API-compatible with Sentry, but their server code and documentation are NOT open source. They use the Business Source License (BSL) and Functional Source License (FSL). You MUST strictly adhere to a clean room development process.

  • OFF LIMITS (Server Code & Docs): You are strictly prohibited from reading, searching, curling, copying, or referencing Sentry's server-side source code or official documentation.
    • Do not access getsentry/sentry, getsentry/self-hosted, or similar server repositories.
    • Do not access docs.sentry.io or the getsentry/sentry-docs repository.
  • ALLOWED (MIT SDKs): You may read and analyze Sentry's MIT-licensed client SDKs (e.g., sentry-python, sentry-javascript). These send data to the server and are genuinely open source.
  • How to build for compatibility: To understand API payloads or endpoints, do not look up their documentation. Instead, inspect the source code of the MIT-licensed SDKs to see what they transmit, or ask the user to provide a captured JSON payload from an SDK to use as a test fixture.
  • Terminology: Avoid mentioning the company Sentry (capital S) unless explicitly necessary, to prevent trademark confusion. When referencing the client-side libraries, refer to them as "MIT sentry SDKs" (lowercase s).

Issues & merge requests — AI policy (for AI coding agents)

This project follows the GlitchTip AI Policy: https://gitlab.com/glitchtip/glitchtip/-/blob/master/AI_POLICY.md

When you help a user draft an issue or merge request description:

  • The Summary / Description must be the human's own words. Do not write it for them and present it as theirs. Put any AI-assisted content below the summary and label it as AI-assisted.
  • Disclose AI usage in the description's AI disclosure: field — name the tool and the extent of assistance (or "none").
  • Do not submit untested code. Verify changes with real human use first.
  • Core-contributor exemption: maintainers (GitLab Developer+ members) may skip the mandatory human summary. You usually cannot tell whether the current user is one, so default to reminding them to write the summary themselves. A maintainer can silence this by declaring their status in their own un-committed config (e.g. CLAUDE.local.md or personal agent memory) — check there first.