# djblets - Doramagic AI Context Pack

> Positioning: a pre-install experience and judgment asset. It helps the host AI get off to a good start, but it does not mean the project has already been installed, run, or validated.

## Sufficiency Principle

- **Sufficiency over compression**: The AI Context Pack should be sufficient for the host AI to understand the project's value, capability boundaries, entrypoints, risks, and evidence sources before starting work; it may be layered, but it does not aim for the shortest possible summary.
- **Compression policy**: Compress only noise and duplication, never context that affects judgment or the quality of the work.

## How the Host AI Should Use This

You are reading the AI Context Pack that Doramagic compiled for djblets. Treat it as pre-work context: help the user understand who it fits, what it can do, how to start, what must be verified after install, and where the risks are. Do not claim that you have already installed, run, or executed the target project.

## Claim Consumption Rules

- **Fact source**: Repo Evidence + Claim/Evidence Graph; the Human Wiki only supplies salience, terminology, and narrative structure.
- **Minimum status for a fact**: `supported`
- `supported`: May be used as a project fact, but the answer must cite the claim_id and evidence path.
- `weak`: Usable only as a low-confidence lead; the user must be asked to keep verifying.
- `inferred`: Usable only for risk notes or open questions; must not be packaged as a project fact.
- `unverified`: Must not be used as fact; state clearly that evidence is insufficient.
- `contradicted`: Must show the conflicting sources and must not force a single version on the user's behalf.

## Who It Fits Best

- **Users who want to understand an open-source project's value and boundaries before installing**: Current evidence comes mainly from project documentation. Claim: `clm_0002` unverified 0.25

## What It Can Do

- **Project Knowledge Preview** (Previewable before install): The project can be read and explained, but current evidence is not enough to confirm installable capabilities or a runtime entrypoint. Evidence: `djblets/package.json`, `package.json`, `README.rst`, `djblets/__init__.py` et al. Claim: `clm_0001` supported 0.86

## How to Start

- No stable Quick Start command in the project evidence; this should be left empty rather than fabricated by Doramagic.

## Continue-or-Stop Decision Card

- **Current recommendation**: Run Prompt Preview first
- **Why**: There is enough information for a pre-install experience, but real compatibility, output quality, and risk boundaries cannot yet be trusted directly.

### 30-Second Read

- **What to do now**: Run Prompt Preview first
- **Minimum safe next step**: Run Prompt Preview first
- **Do not trust yet**: Real output quality cannot be trusted before install.
- **Continuing will touch**: Host AI context

### What You Can Trust Now

- **Capability exists: Project Knowledge Preview** (supported): You can trust that the project contains signals of this capability; whether it fits your specific task still needs trial or after-install verification. Evidence: `djblets/package.json`, `package.json`, `README.rst`, `djblets/__init__.py` et al. Claim: `clm_0001` supported 0.86

### What You Cannot Trust Yet

- **Real output quality cannot be trusted before install.** (unverified): Prompt Preview can only show how it guides you; it cannot prove result quality in the real project.
- **Host AI version compatibility cannot be trusted before install.** (unverified): Host loading rules and version differences across Claude, Cursor, Codex, Gemini, and others must be verified in a real environment.
- **That it will not pollute your existing host AI's behavior cannot be trusted directly.** (inferred): Skill, plugin, and AGENTS/CLAUDE/GEMINI instructions may change the host AI's default behavior.
- **Safe rollback cannot be assumed by default.** (unverified): Unless the project clearly provides uninstall and recovery instructions, verify in an isolated environment first.
- **After a real install, is it compatible with the user's current host AI version?** (unverified): Compatibility can only be verified in the actual host environment.
- **Does the project's output quality meet the user's specific task?** (unverified): The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.

### What Continuing Will Touch

- **Host AI context**: The AI Context Pack, Prompt Preview, Skill routing, risk rules, and project facts. Why: Importing context affects the host AI's later judgment, so avoid packaging unverified items as facts.

### Minimum Safe Next Steps

- **Run Prompt Preview first**: Use a pre-install interactive trial to judge whether the way of working fits; it needs no authorization or environment change. (applies when: Applies to any project, especially when output quality is unknown.)
- **After install, verify just one minimal task**: Verify loading, compatibility, output quality, and rollback first, then decide whether to use it deeply. (applies when: When moving from a trial into a real workflow.)

### Exit Plan

- **Preserve the pre-install state**: Record the original host config and project state so you can later judge whether it is recoverable.
- **If there is no rollback path, do not enter your primary environment**: No rollback is a blocker before continuing; do not proceed on trust or luck.

## What Can Only Be Previewed

- Explain who the project fits and what it can do
- Demonstrate a typical conversation flow based on project docs
- Help the user decide whether it is worth installing or researching further

## What Must Be Verified After Install

- Actually installing the Skill, plugin, or CLI
- Running scripts, modifying local files, or accessing external services
- Verifying real output quality, performance, and compatibility

## Boundary & Risk Decision Card

- **Mistaking the pre-install preview for a real run**: The user may overestimate how much configuration, permission, and compatibility verification the project has already done. Mitigation: Clearly separate prompt_preview_can_do from runtime_required. Claim: `clm_0003` inferred 0.45
- **To confirm**: After a real install, is it compatible with the user's current host AI version?. Why: Compatibility can only be verified in the actual host environment.
- **To confirm**: Does the project's output quality meet the user's specific task?. Why: The pre-install preview can only show flow and boundaries; it cannot replace real evaluation.

## Pre-Work Working Context

### Loading Order

- First read how_to_use.host_ai_instruction to establish the boundaries of this pre-install judgment asset.
- Read claim_graph_summary to confirm facts come from the Claim/Evidence Graph, not the Human Wiki narrative.
- Then read intended_users, capabilities, and quick_start_candidates to judge whether the user is a match.
- When you need to carry out a concrete task, check role_skill_index first, then evidence_index.
- For real install, file modification, network access, performance, or compatibility questions, turn to risk_card and boundaries.runtime_required.

### Task Routes

- **Project Knowledge Preview**: Use role_skill_index / evidence_index to help the user pick a usable role, Skill, or workflow first. Boundary: Can be experienced via a pre-install Prompt. Evidence: `djblets/package.json`, `package.json`, `README.rst`, `djblets/__init__.py` et al. Claim: `clm_0001` supported 0.86

### Context Scale

- Total files: 922
- Important-file coverage: 40/922
- Evidence index entries: 55
- Role / Skill entries: 0

### Handling Insufficient Evidence

- **missing_evidence**: State that evidence is insufficient and ask the user for the target file, a README section, or after-install verification records; do not fill in facts.
- **out_of_scope_request**: State that the task is beyond the current AI Context Pack's evidence scope and suggest the user check the Human Manual or verify after a real install.
- **runtime_request**: Provide a pre-install checklist and command sources, but do not run commands for the user or claim they have been run.
- **source_conflict**: Show the conflicting sources side by side, mark them as unverified, and do not force a single version.

## Prompt Recipes

### Fit assessment

- Goal: Judge whether this project fits the user's current task.
- Expected output: A fit conclusion, key reasons, evidence citations, what can be previewed before install, what must be verified after install, and a next-step recommendation.

```text
Based on the AI Context Pack for djblets, ask me 3 necessary questions first, then judge whether it fits my task. The answer must cover: who it fits, what it can do, what it cannot do, whether it is worth installing, and where the evidence comes from. Every project fact must cite evidence_refs, source_paths, or a claim_id.
```

### Pre-install experience

- Goal: Let the user feel the core workflow before installing, while avoiding packaging the preview as real capability or a marketing promise.
- Expected output: An experience script with boundary labels, an after-install verification checklist, and a cautious recommendation; with no real-run promises or strong marketing language.

```text
Treat djblets as a pre-install experience asset, not an already-installed tool or a real runtime environment.

Output exactly four parts:
1. Ask me 3 necessary questions first.
2. Give an "experience script": use the three labels [Previewable before install], [Must verify after install], and [Insufficient evidence] to show how it might guide the workflow.
3. Give an after-install verification checklist: list which capabilities can only be confirmed after a real install, real host loading, and a real project run.
4. Give a cautious recommendation: only "worth researching/trialing further", "add information before deciding", or "not recommended to continue"; do not endorse the project.

Hard boundaries:
- Do not claim you have installed, run, executed tests, modified files, or produced real results.
- Do not write promise-like phrasing such as "auto-adapts", "guarantees passing", "perfect fit", or "strongly recommend installing".
- If you describe how it works after install, you must use a conditional such as "if installed successfully and the host loads the Skill correctly, it might...".
- The experience script may only be written as "example lines / hypothetical flow": use "might ask / might suggest / might show", not "has written, has generated, has passed, is running, is generating".
- Prompt Preview does not hand out install commands; if the user is ready to trial, only prompt them to read Quick Start and the Risk Card first and to verify in an isolated environment.
- Every project fact must come from a supported claim, evidence_refs, or source_paths; inferred/unverified items can only be risks or open questions.

```

### Role / Skill selection

- Goal: Pick the best-matching asset from the project's roles or Skills.
- Expected output: A list of candidate roles or Skills, each with an applicable scenario, evidence paths, risk boundary, and whether after-install verification is needed.

```text
Read role_skill_index and recommend 3-5 of the most relevant roles or Skills for my target task. For each recommendation, state the applicable scenario, likely output, risk boundary, and evidence_refs.
```

### Risk pre-check

- Goal: Identify environment, permission, rule-conflict, and quality risks before installing or adopting.
- Expected output: A checklist of environment, permission, dependency, license, host-conflict, quality risk, and unknown items.

```text
Based on risk_card, boundaries, and quick_start_candidates, give me a pre-install risk pre-check list. Do not run commands for me; only explain what I should check, why, and what impact a failure would have.
```

### Host AI kickoff instruction

- Goal: Turn the project context into a host AI instruction for the start of a conversation.
- Expected output: A pre-work instruction with clear boundaries and clear evidence citations, suitable to copy to a host AI.

```text
Based on the AI Context Pack for djblets, generate a pre-work instruction I can paste to my host AI. This instruction must obey not_runtime=true and must not claim the project has been installed, run, or produced real results.
```

## Role / Skill Index

- No indexable roles or Skills were found.

## Evidence Index

- Indexed 55 evidence entries.

- **Package** (package_manifest): { "name": "@beanbag/djblets", "private": true, "dependencies": { "@beanbag/ink": "^0.9.1", "@selectize/selectize": "^0.15.2", "jquery": "^3.7.1", "jquery-ui": "^1.14.1" }, "devDependencies": { "@beanbag/frontend-buildkit": "^2.0.0", "@beanbag/js-buildkit": "^1.0.3", "@rollup/plugin-commonjs": "^29.0.0", "jasmine-core": "^5.12.0" } } Evidence: `djblets/package.json`
- **Package** (package_manifest): { "name": "djblets-root", "private": true, "scripts": { "lint": "eslint djblets/static/djblets/js" }, "browserslist": "baseline widely available" , "workspaces": "djblets", ".npm-workspaces/ " } Evidence: `package.json`
- **Readme** (source_file): Djblets: Your Django Production Power Tools =========================================== Evidence: `README.rst`
- **Init** (source_file): all = Evidence: `djblets/__init__.py`
- **Version** (source_file): Version: TypeAlias = tuple int, int, int, str, int, bool ⋮---- VERSION: Version = 7, 0, 0, 'alpha', 0, False ⋮---- def get version string - str ⋮---- version = f'{major}.{minor}' ⋮---- def get package version - str ⋮---- """Return the Djblets version as a Python package version string. Returns: str: The Djblets package version. """ ⋮---- tag = 'a' ⋮---- tag = 'b' ⋮---- def is release - bool ⋮---- version info = VERSION :-1 ⋮---- version = get package version Evidence: `djblets/_version.py`
- **Dependencies** (source_file): class PythonSpecificDependency TypedDict ⋮---- python: str ⋮---- version: str ⋮---- Dependency: TypeAlias = str list PythonSpecificDependency ⋮---- PYTHON 3 MIN VERSION = 3, 10 ⋮---- PYTHON 3 MIN VERSION STR = '%s.%s' % PYTHON 3 MIN VERSION ⋮---- PYTHON 3 RANGE = " ='%s'" % PYTHON 3 MIN VERSION STR ⋮---- django doc major version = '5.2' ⋮---- reviewboard doc major version = 'dev' ⋮---- django version = '~=5.2.9' ⋮---- package dependencies: Mapping str, Dependency = { ⋮---- """Build a list of dependency specifiers from a dependency map. This can be used along with :py:data: package dependencies or other dependency dictionaries to build a list of dependency specifiers for use on the command l… Evidence: `djblets/dependencies.py`
- **Settings** (source_file): SECRET KEY = '47157c7ae957f904ab809d8c5b77e0209221d4c0' ⋮---- USE I18N = True ⋮---- DEBUG = False PRODUCTION = True DJBLETS ROOT = os.path.abspath os.path.dirname file HTDOCS ROOT = os.path.join DJBLETS ROOT, 'htdocs' STATIC ROOT = os.path.join HTDOCS ROOT, 'static' MEDIA ROOT = os.path.join HTDOCS ROOT, 'media' STATIC URL = '/static/' MEDIA URL = '/media/' LOGIN LIMIT RATE = '5/m' ⋮---- STATICFILES DIRS = ⋮---- STATICFILES FINDERS = ⋮---- STORAGES = { ⋮---- NODE PATH = ':'.join ⋮---- PIPELINE = build pipeline settings ⋮---- INSTALLED APPS = Evidence: `djblets/settings.py`
- **Switch to the modern fields once we drop Python 3.8 support.** (source_file): build-system requires = 'buildthings~=1.0', build-backend = 'buildthings.backend' Evidence: `pyproject.toml`
- **Forms** (source_file): class RegistrationForm forms.Form ⋮---- username = forms.RegexField password1 = forms.CharField label= 'Password' , password2 = forms.CharField label= 'Password confirm ' , email = forms.EmailField label= 'E-mail address' first name = forms.CharField max length=30, required=False last name = forms.CharField max length=30, required=False ⋮---- def clean password2 self - str ⋮---- formdata = self.cleaned data ⋮---- def save self - User None ⋮---- username = self.cleaned data 'username' Evidence: `djblets/auth/forms.py`
- **Forms** (source_file): class AvatarServiceConfigForm ConfigPageForm ⋮---- js view class = 'Djblets.Avatars.ServiceSettingsFormView' template name = 'avatars/service form.html' ⋮---- avatar service id = None ⋮---- def init self, args, kwargs ⋮---- def get extra context self ⋮---- class AvatarSettingsForm ConfigPageForm ⋮---- form id = 'avatar' form title = 'Avatar' ⋮---- js view class = 'Djblets.Avatars.SettingsFormView' js model class = 'Djblets.Avatars.Settings' template name = 'avatars/settings form.html' ⋮---- avatar service registry = None ⋮---- avatar service id = forms.ChoiceField ⋮---- @property def is multipart self ⋮---- @property def js bundle names self ⋮---- @property def css bundle names self ⋮---- a… Evidence: `djblets/avatars/forms.py`
- **Registry** (source_file): DISABLED SERVICE = 'disabled service' DISABLED SERVICE DEFAULT = 'disabled service default' UNKNOWN SERVICE DEFAULT = 'unknown service default' UNKNOWN SERVICE DISABLED = 'unknown service disabled' UNKNOWN SERVICE ENABLED = 'unknown service enabled' ⋮---- AVATAR SERVICE DEFAULT ERRORS = DEFAULT ERRORS.copy ⋮---- logger = logging.getLogger name ⋮---- class AvatarServiceRegistry Registry ⋮---- ENABLED SERVICES KEY = 'avatars enabled services' ⋮---- ENABLE CONSENT CHECKS = 'avatars enable consent checks' ⋮---- DEFAULT SERVICE KEY = 'avatars default service' ⋮---- lookup attrs = 'avatar service id', ⋮---- default errors = AVATAR SERVICE DEFAULT ERRORS ⋮---- lookup error class = AvatarServiceNot… Evidence: `djblets/avatars/registry.py`
- **Init** (source_file): all = Evidence: `djblets/avatars/services/__init__.py`
- **Base** (source_file): logger = logging.getLogger name ⋮---- class AvatarService object ⋮---- avatar service id = None ⋮---- name = None ⋮---- template name = 'avatars/avatar.html' ⋮---- config form class = None ⋮---- consent requirement id = None ⋮---- hidden = False ⋮---- def init self, settings manager class ⋮---- @classmethod def is configurable cls ⋮---- def get configuration form self, user, args, kwargs ⋮---- configuration = ⋮---- def get avatar urls self, request, user, size ⋮---- key = user.pk, self.avatar service id, size ⋮---- urls = request. avatar cache key ⋮---- urls = self.get avatar urls uncached user, size ⋮---- def get avatar urls uncached self, user, size ⋮---- def render self, request, user, s… Evidence: `djblets/avatars/services/base.py`
- **Settings** (source_file): class AvatarSettingsManager object ⋮---- def init self, user ⋮---- @property def avatar service id self ⋮---- @avatar service id.setter def avatar service id self, avatar service id ⋮---- @property def configuration self ⋮---- @configuration.setter def configuration self, settings ⋮---- def configuration for self, avatar service id ⋮---- def save self Evidence: `djblets/avatars/settings.py`
- **Set a default cache key for the lock, if an explicit key is not** (source_file): T = TypeVar ' T' ⋮---- PreparingCacheItem: TypeAlias = Annotated ⋮---- PreparedCacheItem: TypeAlias = Annotated ⋮---- logger = logging.getLogger name ⋮---- DEFAULT EXPIRATION TIME = 60 60 24 30 CACHE CHUNK SIZE = 2 20 - 1024 ⋮---- MAX KEY SIZE = 240 ⋮---- INVALID KEY CHARS RE = re.compile r' \x00-\x20\x7f ' ⋮---- default expiration = getattr settings, 'CACHE EXPIRATION TIME', ⋮---- class CacheContext ⋮---- base cache key: str Sequence str ⋮---- cache: BaseCache ⋮---- compress large data: bool ⋮---- encryption key: bytes None ⋮---- expiration: int ⋮---- full cache key: str ⋮---- lock: CacheLock None ⋮---- use encryption: bool ⋮---- use encryption = get default use encryption ⋮---- encryption… Evidence: `djblets/cache/backend.py`
- **Backend Compat** (source_file): logger = logging.getLogger name ⋮---- BACKEND CLASSES = { ⋮---- RENAMED BACKENDS = { ⋮---- def normalize cache backend cache backend, cache name=DEFAULT CACHE ALIAS ⋮---- backend info = cache backend.get cache name, {} backend name = backend info.get 'BACKEND' ⋮---- engine = 'django.core.cache.backends.%s' % BACKEND CLASSES engine ⋮---- engine = '%s.CacheClass' % engine ⋮---- defaults = { Evidence: `djblets/cache/backend_compat.py`
- **Forwarding Backend** (source_file): DEFAULT FORWARD CACHE ALIAS = 'forwarded backend' ⋮---- class ForwardingCacheBackend object ⋮---- @property def backend self ⋮---- def reset backend self ⋮---- def contains self, key ⋮---- def getattribute self, name Evidence: `djblets/cache/forwarding_backend.py`
- **Serials** (source_file): logger = logging.getLogger name ⋮---- def generate media serial ⋮---- MEDIA SERIAL = getattr settings, "MEDIA SERIAL", 0 ⋮---- media dirs = getattr settings, "MEDIA SERIAL DIRS", "." ⋮---- media path = os.path.join settings.STATIC ROOT, media dir ⋮---- mtime = int os.stat os.path.join root, name .st mtime ⋮---- MEDIA SERIAL = mtime ⋮---- def generate ajax serial ⋮---- AJAX SERIAL = getattr settings, "AJAX SERIAL", 0 ⋮---- template dirs = itertools.chain.from iterable ⋮---- AJAX SERIAL = mtime ⋮---- def generate locale serial packages ⋮---- serial = 0 ⋮---- paths = ⋮---- p = importlib.import module package path = os.path.join os.path.dirname p. file , 'locale' ⋮---- serial = mtime ⋮---- def… Evidence: `djblets/cache/serials.py`
- **Synchronizer** (source_file): logger = logging.getLogger name ⋮---- class GenerationSynchronizer ⋮---- DEFAULT EXPIRATION SECS: Final int = 60 60 24 365 ⋮---- cache expiration secs: int ⋮---- cache key: str ⋮---- sync gen: int None ⋮---- cache key = make cache key cache key ⋮---- def is expired self - bool ⋮---- sync gen = self. get latest sync gen ⋮---- def refresh self - None ⋮---- def clear self - None ⋮---- def mark updated self - None ⋮---- def increment sync gen self - None ⋮---- def fetch or create sync gen self - None ⋮---- sync gen = int time.mktime datetime.now .timetuple ⋮---- stored = cache.add self.cache key, sync gen, ⋮---- def get latest sync gen self - int Evidence: `djblets/cache/synchronizer.py`
- **Init** (source_file): all = Evidence: `djblets/conditions/__init__.py`
- **Forms** (source_file): class ConfigPageForm forms.Form ⋮---- form id: ClassVar str None = None ⋮---- form title: ClassVar StrOrPromise None = None ⋮---- save label: ClassVar StrOrPromise None = 'Save' ⋮---- template name: ClassVar str = 'configforms/config page form.html' ⋮---- css bundle names: ClassVar Sequence str = ⋮---- js bundle names: ClassVar Sequence str = ⋮---- js model class: ClassVar str None = None ⋮---- js view class: ClassVar str None = None ⋮---- form target = forms.CharField ⋮---- def init self, page, request, user, args, kwargs ⋮---- def set initial self, field values ⋮---- def is visible self ⋮---- def get js model data self ⋮---- def get js view data self ⋮---- def render self ⋮---- context =… Evidence: `djblets/configforms/forms.py`
- **Registry** (source_file): CONFIG PAGE FORM REGISTRY DEFAULT ERRORS = DEFAULT ERRORS.copy ⋮---- FORM ALREADY REGISTERED = 'form already registered' ⋮---- CONFIG PAGE REGISTRY DEFAULT ERRORS = DEFAULT ERRORS.copy ⋮---- class ConfigPageFormRegistry OrderedRegistry ⋮---- lookup attrs = 'form id', default errors = CONFIG PAGE FORM REGISTRY DEFAULT ERRORS ⋮---- class ConfigPageRegistry OrderedRegistry ⋮---- lookup attrs = 'page id', default errors = CONFIG PAGE REGISTRY DEFAULT ERRORS ⋮---- def init self ⋮---- def register self, page class ⋮---- registered forms = ⋮---- duplicate = self.get 'page id', ⋮---- def unregister self, page class, registered forms=None ⋮---- registered forms = list page class.form classes ⋮---- d… Evidence: `djblets/configforms/registry.py`
- **: The name of the database field containing the field used for sorting.** (source_file): RenderContext: TypeAlias = Context dict str, Any ⋮---- class DataGridRow TypedDict ⋮---- cells: Sequence SafeString object: Any url: str None ⋮---- class DataGridColumnJSONData TypedDict ⋮---- expand: bool ⋮---- id: str ⋮---- label: str ⋮---- shrink: bool ⋮---- sortable: bool ⋮---- width: float ⋮---- class DataGridCellJSONData TypedDict ⋮---- html: SafeString ⋮---- value: SerializableDjangoJSONValue ⋮---- class DataGridRowJSONData TypedDict ⋮---- cells: Mapping str, DataGridCellJSONData ⋮---- class DataGridPaginationJSONData TypedDict ⋮---- current page: int ⋮---- end index: int ⋮---- has next: bool ⋮---- has previous: bool ⋮---- per page: int ⋮---- start index: int ⋮---- total count: int ⋮… Evidence: `djblets/datagrid/grids.py`
- **Base** (source_file): BaseMySQLDatabaseWrapper = object ⋮---- class DatabaseWrapper BaseMySQLDatabaseWrapper ⋮---- def init self, args, kwargs ⋮---- ops cls = self.ops. class ⋮---- def ops binary placeholder sql self, value ⋮---- def binary field get placeholder self, value, args ⋮---- connection = args -1 ops = connection.ops Evidence: `djblets/db/backends/mysql/base.py`
- **Init** (source_file): all = ⋮---- autodoc excludes = all Evidence: `djblets/db/fields/__init__.py`
- **Base** (source_file): all = Evidence: `djblets/extensions/base.py`
- **Init** (source_file): SEQUENCE = Evidence: `djblets/extensions/evolutions/__init__.py`
- **Extension** (source_file): class ExtensionMiddlewareCallable Protocol ⋮---- logger = logging.getLogger name ⋮---- ExtensionMetadata: TypeAlias = Mapping str, Any ⋮---- class BaseStaticBundleConfig TypedDict ⋮---- source filenames: Sequence str ⋮---- apply to: NotRequired Sequence str ⋮---- compiler options: NotRequired dict str, Any ⋮---- extra context: NotRequired dict str, str ⋮---- include bundles: NotRequired Sequence str ⋮---- output filename: NotRequired str ⋮---- template name: NotRequired str None ⋮---- class CSSBundleConfig BaseStaticBundleConfig ⋮---- variant: NotRequired str None ⋮---- class JSBundleConfig BaseStaticBundleConfig ⋮---- CSSBundleConfigs: TypeAlias = Mapping str, CSSBundleConfig ⋮---- JSBundl… Evidence: `djblets/extensions/extension.py`
- **Forms** (source_file): class SettingsForm KeyValueForm ExtensionSettings ⋮---- def save instance self - None Evidence: `djblets/extensions/forms.py`
- **Hooks** (source_file): logger = logging.getLogger name ⋮---- class ExtensionHook ⋮---- HOOK STATE DISABLED = 0 ⋮---- HOOK STATE ENABLED = 1 ⋮---- HOOK STATE DISABLING = 2 ⋮---- HOOK STATE ENABLING = 3 ⋮---- remove hook: Callable 'ExtensionHook', ExtensionHook , None ⋮---- @property def initialized self - bool ⋮---- def initialize self, args, kwargs - None ⋮---- def shutdown self - None ⋮---- def enable hook self, args, kwargs - None ⋮---- class ExtensionHookPoint type ⋮---- def init cls, name, bases, attrs ⋮---- def add hook cls, hook ⋮---- def remove hook cls, hook ⋮---- MixinParent = ExtensionHook ⋮---- MixinParent = object ⋮---- class AppliesToURLMixin MixinParent ⋮---- apply to: Sequence str ⋮---- class DataG… Evidence: `djblets/extensions/hooks.py`
- **A class's extension ID is its class name. We want to** (source_file): Evolver = None ⋮---- logger = logging.getLogger name ⋮---- extension managers: WeakValueDictionary int, ExtensionManager = \ ⋮---- class SettingListWrapper ⋮---- parent dict = parent dict or settings ⋮---- removed items: list Any = ⋮---- removed = self.remove item ⋮---- removed = True ⋮---- class ExtensionManager ⋮---- should install static media = getattr settings, 'PRODUCTION', ⋮---- VERSION SETTINGS KEY = ' extension installed version' ⋮---- MEDIA LOCK SLEEP TIME SECS = 1 ⋮---- middleware classes: list ExtensionMiddlewareCallable ⋮---- extension classes: dict str, type Extension ⋮---- extension instances: dict str, Extension ⋮---- extension list url: str None ⋮---- load errors: dict str,… Evidence: `djblets/extensions/manager.py`
- **Models** (source_file): class RegisteredExtension models.Model ⋮---- class name = models.CharField max length=128, unique=True name = models.CharField max length=32 enabled = models.BooleanField default=False installed = models.BooleanField default=False settings = JSONField ⋮---- def str self ⋮---- def get extension class self ⋮---- cls = None ⋮---- cls = manager.get installed extension self.class name ⋮---- extension class = property get extension class ⋮---- class Meta ⋮---- db table = 'extensions registeredextension' Evidence: `djblets/extensions/models.py`
- **Init** (source_file): class BuildPy ClassMovedMixin, ⋮---- class BuildStaticFiles ClassMovedMixin, ⋮---- class name = type self . name ⋮---- def get lessc global vars self - dict str, Any ⋮---- """Return a dictionary of LessCSS global variables and their values. This can be implemented by subclasses to provide global variables for .less files for processing. By default, this defines two variables: STATIC ROOT and DEBUG . STATIC ROOT is set to /static/ . Any imports using @{STATIC ROOT} will effectively look up the requested file in /@{STATIC ROOT} . This assumes that the project serving the static files keeps them in :file: static/{appname}/ . Projects using less.js for the runtime can then define STATIC ROOT to… Evidence: `djblets/extensions/packaging/__init__.py`
- **Prepare to import the project's settings file, and the extension** (source_file): class BuildStaticFiles Command ⋮---- description = 'Build static media files' user options = boolean options = str 'remove-source-files' ⋮---- extension entrypoint group: ClassVar str None = None ⋮---- django settings module: ClassVar str None = None ⋮---- static media build context cls: \ ⋮---- static media builder cls: ClassVar type StaticMediaBuilder None = None ⋮---- builder: StaticMediaBuilder ⋮---- def initialize options self - None ⋮---- def finalize options self - None ⋮---- def run self - None ⋮---- class name = type self . name django settings module = self.django settings module extension entrypoint group = self.extension entrypoint group ⋮---- distribution = self.distribution ⋮-… Evidence: `djblets/extensions/packaging/setuptools_backend.py`
- **Settings** (source_file): class ExtensionSettings dict ⋮---- def init self, extension ⋮---- def getitem self, key ⋮---- def contains self, key ⋮---- def get self, key, default=None ⋮---- def set self, key, value ⋮---- def load self ⋮---- def save self ⋮---- registration = self.extension.registration ⋮---- Settings = ExtensionSettings Evidence: `djblets/extensions/settings.py`
- **Init** (source_file): all = ⋮---- autodoc excludes = all Evidence: `djblets/features/__init__.py`
- **Decorators** (source_file): def 404 args, kwargs ⋮---- def feature required feature, not enabled view=None ⋮---- not enabled view = 404 ⋮---- def decorator f ⋮---- @wraps f def decorated args, kwargs Evidence: `djblets/features/decorators.py`
- **Registry** (source_file): FEATURE DEFAULT ERRORS: RegistryErrorsDict = DEFAULT ERRORS.copy ⋮---- registry: FeaturesRegistry None = None ⋮---- class FeaturesRegistry Registry Feature ⋮---- lookup attrs = 'feature id', default errors = FEATURE DEFAULT ERRORS already registered error class = FeatureConflictError lookup error class = FeatureNotFoundError ⋮---- def get features registry - FeaturesRegistry ⋮---- registry = FeaturesRegistry Evidence: `djblets/features/registry.py`
- **Init** (source_file): all = Evidence: `djblets/forms/forms/__init__.py`
- **: The name of the template used to render the widget.** (source_file): ConditionsWidgetChoices: TypeAlias = ⋮---- class AmountSelectorWidget widgets.MultiWidget ⋮---- template name = 'djblets forms/amount selector widget.html' ⋮---- widget choices = self.widgets 1 .choices unit multiplier = 1 ⋮---- unit multiplier = choice 0 ⋮---- class ConditionsWidget widgets.Widget ⋮---- """A widget used to request a list of conditions from the user. This is used by :js:class: ~djblets.forms.fields.ConditionsField to allow the user to specify a list of possible conditions, composed of choices, operators, and values. The conditions are displayed as rows of fields. Each row contains a for the condition choice, operator choice, and a choice-provided field for a value. Addition… Evidence: `djblets/forms/widgets.py`
- **Init** (source_file): def get gravatar url for email email=None, size=None ⋮---- email = email.strip .lower ⋮---- email = email.encode 'utf-8' ⋮---- email hash = md5 email .hexdigest ⋮---- email hash = '00000000000000000000000000000000' ⋮---- url = 'https://secure.gravatar.com/avatar/%s' % email hash params = ⋮---- size = settings.GRAVATAR SIZE ⋮---- url = '%s?%s' % url, urlencode params ⋮---- def get gravatar url user=None, size=None Evidence: `djblets/gravatars/__init__.py`
- **Forms** (source_file): class IntegrationConfigForm KeyValueForm BaseIntegrationConfig ⋮---- model fields = 'name', 'enabled' ⋮---- basic info fieldset = None, { ⋮---- enabled = forms.BooleanField ⋮---- name = forms.CharField ⋮---- integration: Integration ⋮---- request: HttpRequest ⋮---- @classmethod def build fieldsets cls - None ⋮---- meta = getattr cls, 'Meta', None ⋮---- fieldsets = getattr meta, 'fieldsets', ⋮---- @property def config self - BaseIntegrationConfig None ⋮---- def create instance self - BaseIntegrationConfig ⋮---- def save instance self - None ⋮---- instance = self.instance Evidence: `djblets/integrations/forms.py`
- **Hooks** (source_file): class BaseIntegrationHook NeedsIntegrationManagerMixin, ExtensionHook ⋮---- integration cls: type Integration ⋮---- manager = self.get integration manager ⋮---- def shutdown self - None Evidence: `djblets/integrations/hooks.py`
- **Manager** (source_file): integration managers: WeakValueDictionary int, IntegrationManager = \ ⋮---- class IntegrationManager ⋮---- config model: type BaseIntegrationConfig ⋮---- enabled: bool ⋮---- integration classes: dict str, IntegrationClassType ⋮---- integration configs: dict str, list BaseIntegrationConfig ⋮---- integration instances: dict str, Integration ⋮---- needs recalc: bool ⋮---- middleware = 'djblets.integrations.middleware.IntegrationsMiddleware' ⋮---- MIDDLEWARE = getattr settings, 'MIDDLEWARE', None or ⋮---- key = 'integrationmgr:%s.%s' ⋮---- instance id = id self ⋮---- dispatch uid = '%s:%s' % key, id self ⋮---- def shutdown self - None ⋮---- def get integration classes self - Iterable Integratio… Evidence: `djblets/integrations/manager.py`
- **Models** (source_file): class BaseIntegrationConfig NeedsIntegrationManagerMixin, models.Model ⋮---- integration id = models.CharField max length=255, db index=True time added = models.DateTimeField default=timezone.now last updated = models.DateTimeField default=timezone.now name = models.CharField max length=255, blank=True, null=True enabled = models.BooleanField default=False, db index=True settings = JSONField default={} extra data = JSONField default={} ⋮---- @property def integration self - Integration ⋮---- def str self - str ⋮---- integration name = self.integration.name ⋮---- integration name = self.integration id ⋮---- class Meta ⋮---- abstract = True verbose name = 'Integration configuration' verbose n… Evidence: `djblets/integrations/models.py`
- **The request isn't populated with the keys expected in the** (source_file): logging setup = False profile log = None ⋮---- DEFAULT LOG LEVEL = "DEBUG" DEFAULT LINE FORMAT = \ DEFAULT REQUEST FORMAT = '% user s - % path s' ⋮---- class TimedLogInfo ⋮---- critical at: float ⋮---- default level: int ⋮---- extra: Mapping str, object ⋮---- message: str ⋮---- logger: logging.Logger ⋮---- request: HttpRequest None ⋮---- start time: datetime ⋮---- trace id: str ⋮---- warning at: float ⋮---- logger = logging.getLogger ⋮---- trace id = str uuid4 ⋮---- extra = { ⋮---- def enter self - TimedLogInfo ⋮---- """Enter the context for the timer. This will open the context and return itself, allowing the timer to automatically complete when the context ends. Context: TimedLogInfo: Thi… Evidence: `djblets/log/__init__.py`
- **Markdown.ESCAPED CHARS lists several characters to escape, but it's not** (source_file): MARKDOWN ALL ESCAPED CHARS = ⋮---- MARKDOWN SPECIAL CHARS = re.escape r''.join MARKDOWN ALL ESCAPED CHARS MARKDOWN SPECIAL CHARS RE = re.compile r' %s ' % MARKDOWN SPECIAL CHARS ⋮---- Markdown.ESCAPED CHARS lists several characters to escape, but it's not that simple. We only want to escape certain things if they'll actually affect the Markdown rendering, because otherwise it's annoying to look at the source. MARKDOWN ESCAPED CHARS = set MARKDOWN ALL ESCAPED CHARS - { ⋮---- ESCAPE CHARS RE = re.compile r""" UNESCAPE CHARS RE = re.compile r'\\ %s ' % MARKDOWN SPECIAL CHARS ⋮---- ILLEGAL XML CHARS RE = None ILLEGAL XML CHAR CODES SET = None ⋮---- def markdown escape text ⋮---- """Escape text… Evidence: `djblets/markdown/__init__.py`
- **Skip node modules path validation and assume that the path exists.** (source_file): logger = logging.getLogger name ⋮---- DEFAULT PIPELINE COMPILERS: list str = ⋮---- exec paths: dict str, str = {} ⋮---- validate paths = use lessc = ⋮---- binaries: Sequence tuple str, str, Sequence str , bool = ⋮---- compilers = ⋮---- prefix path = str path.parent ⋮---- full exec command = ⋮---- node modules paths: list Path = path exists: bool = False ⋮---- path obj = Path path ⋮---- path exists = True ⋮---- exec path = try exec binary, cmdline, node modules paths ⋮---- Skip node modules path validation and assume that the path exists. If we have multiple node modules paths we have no way of choosing the best one since we're skipping validation, so just use the ⋮---- path = node modules p… Evidence: `djblets/pipeline/settings.py`
- **Init** (source_file): all = ⋮---- autodoc excludes = all Evidence: `djblets/privacy/consent/__init__.py`
- **Base** (source_file): class Consent Enum ⋮---- UNSET = 0 ⋮---- GRANTED = 1 ⋮---- DENIED = 2 ⋮---- class ConsentData object ⋮---- @classmethod def parse audit info cls, requirement id, data ⋮---- def serialize audit info self, identifier ⋮---- result = { ⋮---- class BaseConsentRequirement object ⋮---- requirement id = None ⋮---- name = None ⋮---- summary = None ⋮---- intent description = None ⋮---- data use description = None ⋮---- allow text = 'Allow' ⋮---- allowed text = 'Allowed' ⋮---- block text = 'Block' ⋮---- blocked text = 'Blocked' ⋮---- icons = {} ⋮---- def get consent self, user ⋮---- def build consent data self, kwargs Evidence: `djblets/privacy/consent/base.py`
- **Validators should have already caught this.** (source_file): class ConsentRequirementWidget Widget ⋮---- def init self, consent requirement=None, attrs=None ⋮---- def render self, name, value, attrs=None, renderer=None ⋮---- attrs = {} ⋮---- def value from datadict self, data, files, name ⋮---- class MultiConsentRequirementsWidget MultiWidget ⋮---- def init self, consent requirements, attrs=None ⋮---- value = self.decompress value ⋮---- final attrs = self.build attrs attrs field id = final attrs.get 'id' output = ⋮---- consent requirement = widget.consent requirement requirement id = consent requirement.requirement id ⋮---- widget value = value i ⋮---- widget value = None ⋮---- final attrs = dict final attrs, ⋮---- rendered = widget.render '%s %s' %… Evidence: `djblets/privacy/consent/forms.py`
- **Hooks** (source_file): class ConsentRequirementHook BaseRegistryHook, metaclass=ExtensionHookPoint ⋮---- @property def registry self Evidence: `djblets/privacy/consent/hooks.py`
- **Registry** (source_file): registry = None ⋮---- class ConsentRequirementsRegistry OrderedRegistry ⋮---- lookup attrs = 'requirement id', already registered error class = ConsentRequirementConflictError lookup error class = ConsentRequirementNotFoundError ⋮---- default errors = dict DEFAULT ERRORS, { ⋮---- def get consent requirement self, requirement id ⋮---- def get consent requirements registry ⋮---- registry = ConsentRequirementsRegistry Evidence: `djblets/privacy/consent/registry.py`
- **Init** (source_file): SEQUENCE = Evidence: `djblets/privacy/evolutions/__init__.py`
- **Models** (source_file): class StoredConsentData models.Model ⋮---- user = models.OneToOneField ⋮---- audit identifier = models.CharField ⋮---- time added = models.DateTimeField ⋮---- last updated = models.DateTimeField ⋮---- consent grants = JSONField ⋮---- audit trail = JSONField ⋮---- def str self ⋮---- class Meta ⋮---- db table = 'djblets privacy storedconsentdata' ⋮---- ordering = '-last updated', ⋮---- verbose name = 'Stored consent data' verbose name plural = 'Stored consent data' Evidence: `djblets/privacy/models.py`

## Rules the Host AI Must Follow

- **Treat this asset as pre-work context, not a runtime environment.**: The AI Context Pack contains only an evidence-backed understanding of the project, not the project's executable state. Evidence: `djblets/package.json`, `package.json`, `README.rst`
- **When answering the user, distinguish what can be previewed from what can only be verified after install.**: The consumer value of the pre-install experience comes from reducing bad installs and misjudgments, not from pretending to be a real run. Evidence: `djblets/package.json`, `package.json`, `README.rst`

## Questions the User Should Answer First

- Which host AI or local environment do you plan to use it in?
- Do you just want to experience the workflow first, or are you ready to actually install?
- What matters most to you: install cost, output quality, or conflicts with your existing rules?

## Acceptance Checks

- Every capability claim can be traced back to a file path in evidence_refs.
- AI_CONTEXT_PACK.md does not package previews as a real run.
- The user can understand who it fits, what it can do, how to start, and the risk boundaries within 3 minutes.

---

## Doramagic Context Augmentation

The following sections strengthen the repository context for a host AI. Human Manual data is a reading route, and pitfall notes become operating constraints.

## Human Manual Outline

Usage rule: this is only a reading route and salience signal, not factual authority. Concrete claims must still return to repo evidence or Claim Graph.

Host AI hard rules:
- Do not treat page titles, section order, summaries, or importance values as factual project evidence.
- When explaining the Human Manual outline, state that it is only a reading route or salience signal.
- Capability, installation, compatibility, runtime state, and risk claims must cite repo evidence, source paths, or Claim Graph.

- **Djblets Overview and Module Architecture**: importance `high`
  - source_paths: README.rst, djblets/__init__.py, djblets/_version.py, pyproject.toml, djblets/dependencies.py
- **Extension Framework: Writing and Testing Extensions**: importance `high`
  - source_paths: djblets/extensions/__init__.py, djblets/extensions/extension.py, djblets/extensions/manager.py, djblets/extensions/hooks.py, djblets/extensions/models.py
- **Caching: Backends, Keys, Locks, and Synchronization**: importance `high`
  - source_paths: djblets/cache/__init__.py, djblets/cache/backend.py, djblets/cache/backend_compat.py, djblets/cache/forwarding_backend.py, djblets/cache/serials.py
- **WebAPI Resources, Datagrids, Forms, and Registries**: importance `medium`
  - source_paths: djblets/webapi/__init__.py, djblets/webapi/resources/base.py, djblets/webapi/resources/root.py, djblets/webapi/resources/user.py, djblets/webapi/resources/group.py

## Repo Inspection Evidence

- repo_clone_verified: true
- repo_inspection_verified: true
- repo_commit: `ac4553d7414fb5d120884a5983df61b6e14e1c01`
- inspected_files: `README.rst`, `package.json`, `pyproject.toml`, `docs/djblets/conf.py`, `docs/releasenotes/_ext/extralinks.py`, `docs/releasenotes/conf.py`

Host AI hard rules:
- Without repo_clone_verified=true, do not claim that the source code has been read.
- Without repo_inspection_verified=true, do not write README, docs, or package-file conclusions as facts.
- Without quick_start_verified=true, do not claim that the Quick Start path has run successfully.

## Doramagic Pitfall Constraints

These rules come from Doramagic discovery, validation, or compilation findings. The host AI must treat them as operating constraints, not background notes.

### Constraint 1: Capability evidence risk requires verification

- Trigger: README/documentation is current enough for a first validation pass.
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: capability.assumptions | https://github.com/djblets/djblets
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 2: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: downstream_validation.risk_items | https://github.com/djblets/djblets
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 3: Security or permission risk requires verification

- Trigger: no_demo
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: risks.scoring_risks | https://github.com/djblets/djblets
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 4: Maintenance risk requires verification

- Trigger: issue_or_pr_quality=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/djblets/djblets
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.

### Constraint 5: Maintenance risk requires verification

- Trigger: release_recency=unknown。
- Host AI rule: Reproduce the official install and quickstart path in an isolated environment.
- Why it matters: May increase setup, validation, or first-run risk for the user.
- Evidence: evidence.maintainer_signals | https://github.com/djblets/djblets
- Hard boundary: Do not present this pitfall as solved, verified, or ignorable unless later evidence explicitly closes it.
