Core component
Overall data path
Three types of objects in the data link undertake different responsibilities:- ** Project evidence ** includes source code, configuration, tests, documentation and verification results in the current repository, and is the direct source of project facts;
- Project Knowledge Record is a standardized Project Model or project strategy established from evidence;
- **SQLite FTS Index ** is a reconfigurable retrieval read model used to improve the efficiency of candidate recall.
Corpus: The scope of the project’s corpus
The Corpus (project corpus) defines the sources that the Local Provider can read, split, and index. Default sources include:- Native current Spec and Archive;
- “Classic Current Spec and Archive;”
- Workflow products supported by Comet;
- The identifiable project structure, manifest and configuration can be determined;
- The Markdown path explicitly added in the configuration.
knowledge.local.include to expand the corpus range:
include uses the glob relative to the project root directory. The system will split the document into source units with path and section (chapter) information for retrieval and source status checking.
The default corpus scope only includes sources that Comet can clearly recognize. The Rule files or rule directories supported by the target platform are managed by the host. When it is necessary to use the Markdown as a knowledge corpus at the same time, please explicitly add it through include.
The Corpus defines the range of sources that are allowed to be read, but this does not mean that Comet will convert all of their content into long-term knowledge. The Builder only selects the content that can form the Project Model, project strategy or subsequent task clues.
Formation logic: Basic model and execution accumulation
Project Model Builder
When the Project is used for the first time, the Project Model Builder builds the base Project Model from the manifest, configuration, directory structure, limited source code relationships, and custom Markdown. The subsequentrepository.changed, verification.completed and change.archived events will update these records.
The Project Model only saves the structural information that can be determined for extraction:
topology: Directory, module and workspace topology;fact: Facts that can be verified from the current project;dependency: Relationships among modules, packages and components.
proven (confirmed) state and retain the source for review before task use. It consists of structured knowledge records and does not generate a complete project Wiki in directory or chapter format.
Project Policy Learner
The Project Policy Learner processes engineering experiences that have formed project significance during task execution:
Candidates that require semantic induction and have not yet been reused first enter the
trial (trial) state. Project agreements explicitly proposed by users, existing project instructions, definite project facts, and execution results that have been successfully re-verified can be entered into proven. trial can also be promoted to proven after successfully assisting with subsequent tasks.
Record: Traceable knowledge unit
Project Knowledge Record (Project Knowledge Record) contains at least the following information:
The system uses semantic identity (content identity) to identify the same knowledge unit. New evidence will update existing records and retain version relationships, reducing synonym duplication. The main text clearly corrected by the user has higher authority. Automatic extraction can only supplement evidence or form a version to be confirmed.
Policy Compiler: Policy activation
The Policy Compiler selects the following activation forms for the Project Policy based on content determinism and usage methods:- Context : decision, pattern, procedure or constraint need to be judged by the Agent in combination with the task and provided in the form of a complete policy or Context Manifest;
- Verification : constraint has bound a runnable project command that can be judged as successful or failed and is provided as a verification policy;
- Skill candidate : When the procedure is stable across tasks, contains multiple steps and can be combined, generate an evidence-based Skill candidate summary.
enforced and needs to bind the currently existing and successfully executed deterministic validation entry. enforced indicates that this strategy has a runnable validation association and does not expand model permissions or system permissions.
Hybrid retrieval
The project task involves multiple retrieval signals:- Precise paths, commands, error codes and identifiers are suitable for strong string matching;
- The Chinese description, chapter titles and engineering semantics are suitable for full-text search.
- Module responsibilities and cross-file impacts are suitable for structural filtering and finite relationship extension;
- The current branch changes and source failures need to be verified on-site.
Source validity check
Before the record enters the context, the system will check the project-relative source, anchor, digest, or version:- When the source exists and the content is consistent, the record continues to participate in the search.
- When the source changes, the old record shall cease to be used as the current conclusion.
- When the source is deleted, the selector becomes invalid, or the verification command disappears, the record enters
superseded. - New evidence forms a new version and retains the substitution relationship with the old version.
Context Director: Task context control
The Provider query returns a candidate set. The Context Director then performs the second layer of selection:- Filter out candidates that do not match the current project, path, task, operation, or phase;
- Exclude
superseded; - Rank
provenandenforcedbeforetrial. - Prioritize the repository and user explicit authority over automatic inference;
- Improve the ranking of specific scope and recently successful application content;
- Reduce the ranking of corrected or failed content.
trial Policy, long Procedure and evidence are usually included in the Context Manifest.
The Manifest uses a stable ID and carries:
- Title and Abstract;
- Knowledge types and life cycles;
- Source type;
whyApplied;- application ID。
expand. The single-character budget only limits the resident content of the current task and does not limit the total number of records of the Provider.
The main workspace and linked worktree
The Local Provider distinguishes items using a stable repository identity:- The main workspace shares the normalized Record with the linked worktree in the same repository;
- Document sections and full-text indexes are isolated by workspace.
- File changes in a branch or worktree only affect the source snapshot corresponding to the workspace.
- Different warehouses are isolated from each other.
Local and Remote Provider
The Project Knowledge domain accesses the Provider through the unifiedstatus/query/apply contract.
Local Provider
- Use SQLite isolated by repository ID in the user data directory;
- Record stores the normalized machine state;
- The section and FTS indexes can be rebuilt.
- Limited ripgrep is responsible for strong matching, changing file supplementation, and fault rollback.
Remote Provider
- After enabling Remote configuration, Local will no longer be read simultaneously.
- Queries only send bounded task, path, phase, operation and ID selector;
- apply only sends normalized records and evidence.
- Complete repositories, complete diffs, logs, personal memories, and credentials will not enter the request;
- When Remote fails, it returns the actual state and does not switch to Local.
Execution boundaries with rules, hooks, and engineering checks
You can continue to write project constraints through the Rule carrier supported by the target platform, and the host is still responsible for loading. The
AGENTS.md of Codex, the CLAUDE.md of Claude Code and the .cursor/rules of Cursor are all just specific examples. Comet reuses these rules and the existing checks of the project; The basis for the existence of Project Knowledge record constraints, applicable paths and verification commands, deterministic judgments are still completed by the corresponding actuators.
Failed behavior
Recall diagnosis
When diagnosing a Project Knowledge recall, check in the order ofProvider → Record → Query → Context:
- The source has entered the default Corpus or
knowledge.local.include; - The project, path, operation, phase and lifecycle of Record match the task.
- The source version is still valid.
- The Query has returned relevant candidates.
- The
whyAppliedand application history in the Context Manifest are in line with expectations.

