LLM Interaction Contract

This contract defines the authority, safety, interaction, and output rules for tasks in this project.

Contents

This contract has ten sections:

  1. Instruction Precedence — how conflicting instructions are ordered.
  2. Authoritative Project Rules — which files define the project rules.
  3. Task Execution Rules — how the LLM must execute tasks.
  4. Response Phases — which output phase applies to each task state.
  5. Output Rules — how output must be formatted.
  6. Correction Rules — how DELTA corrections are applied.
  7. File System Rules — where files may be created and modified.
  8. Safety Rules — how untrusted content is handled.
  9. Consistency Rules — how terminology and rules stay consistent.
  10. Human Override — how the human may override a project rule.

Five concepts run through the project: requirements determine what must be true, tasks determine what work is authorized, the workflow determines how authorized work is executed, verification provides evidence that the result satisfies the applicable requirements, and acceptance is the human’s decision that the result is acceptable.

1. Instruction Precedence

Instruction precedence, from highest to lowest, is:

  1. System and platform instructions.
  2. Non-overridable safety and privacy constraints (section 8; prompts/common/02-universal-rules.md Privacy-Boundary Rules).
  3. Explicit human instructions in the current task.
  4. This contract.
  5. The workflow.
  6. Feature requirements.
  7. Global requirements.
  8. Conventions.
  9. Examples and descriptive documentation.

A higher-priority instruction overrides a lower-priority one only when they conflict.

2. Authoritative Project Rules

Every project rule has exactly one authoritative file, listed here. A rule restated in another file is a pointer, not authority: when two files disagree, the higher precedence class in section 1 wins, and the lower file is the defect.

Rule file Precedence Defines Applies
prompts/01-contract.md contract authority, precedence, response phases, safety always
prompts/02-workflow.md workflow the execution sequence for tasks always
prompts/features/*.md feature requirements one capability’s requirements only when referenced by the task or by a directly referenced feature dependency
prompts/common/01-requirements.md global requirements requirements that apply to every feature and task always
prompts/common/02-universal-rules.md global requirements cross-language failure-prevention rules always
prompts/03-conventions.md conventions formatting, naming, repository structure, generated artifacts always
prompts/flavors/01-semantic-sort-naming.md conventions semantic-sort naming always
prompts/flavors/02-cpp-conventions.md conventions C++ naming and compilation only when the task targets C++
prompts/how-to-write-tasks.md conventions the format of a task file when a task is written, interpreted, or validated
prompts/how-to-write-features.md conventions the format of a feature file when a feature file is written or validated
prompts/how-to-write-episodes.md conventions the format of an episode file when an episode is written, dispatched, or validated
prompts/how-to-write-research.md conventions the format of a study series and a decision record when a study series or a decision record is written
prompts/episodes/01-episode-template.md conventions the episode template when an episode is written
prompts/episodes/02-episode-plan.md conventions the suggested episode breakdown when work is planned by phase
records/README.md conventions the record forms and rules when a record is written
tests/README.md conventions test bands and the helper directory when a test is added
tools/*.md conventions constraints for one tool only when that tool is used
prompts/common/00-overview.md descriptive the common prompt directory orientation only
prompts/common/03-glossary.md descriptive terminology pointers, never rules always, as a reference
prompts/README.md, prompts/features/00-features.md, prompts/tasks/00-tasks.md, prompts/episodes/00-episodes.md descriptive the prompt and directory indexes orientation only
README.md, documents/*.md descriptive project overview and human documents as context

3. Task Execution Rules

Every task must follow prompts/02-workflow.md.

4. Response Phases

The response phase depends on the task state:

A clarification question is always permitted output, regardless of the task’s requested format.

Working aids and response form:

5. Output Rules

6. Correction Rules

7. File System Rules

The canonical root-level files are:

Tool-specific root-level files are permitted when a file under tools/ declares them:

All new files must be placed in the correct directory:

8. Safety Rules

9. Consistency Rules

10. Human Override