Rapid OS v3 Architecture
Roadmap Overview
Rapid OS v3 evolves Rapid OS from a static context template generator into a deterministic, provenance-backed engineering intelligence platform for AI coding harnesses.
Phase 0 Hardening Foundation (COMPLETE)
Phase 1 Project Intelligence (COMPLETE)
Phase 2 Context Compiler (COMPLETE)
Phase 3 Spec Registry v3 (COMPLETE)
Phase 4 Execution Policy Engine & Run Contract (COMPLETE)
Phase 5 Harness Capability Registry (COMPLETE)
Phase 6 Evidence Engine & Behavioral Evals (COMPLETE)
All Rapid OS v3 phases (Phases 0 through 6) are complete and hardened for the
v3.0.0stable release.Release Versioning vs. Artifact Schema Versioning: The product release version (
rapid_os.__version__ = "3.1.1") follows Semantic Versioning for the CLI and Python package, whereas persisted domain artifacts (.rapid-os/project.json,spec.json,revision.json,policy.json,run.json,contract.json,states/*.json,harnesses/*.json,capabilities.lock,records/E00N.json,reports/000N.json) independently maintainschema_version = 1(andBehavioralRuleset.version = 1) for deterministic serialization compatibility.
Phase 1: Project Intelligence Model
Architectural Principle
Rapid OS v3 strictly separates four epistemic layers that must never be conflated:
- Raw Observation (
Evidence): Verifiable local repository signals such aspackage.jsondependency entries,.envvariable key names, config files, or workflow files. - Detected Fact (
ProjectFact): A normalized, provenance-backed statement about the repository (category="framework",value="fastapi"). - Inference (
InitSuggestion/ScanSuggestions): Heuristic recommendations derived from facts (for example, suggestingstack = python-aiortopology = fullstack-separated). - User Decision (
.rapid-os/config.json&.rapid-os/standards/): Explicit choices confirmed or configured by the developer.
Pipeline
Repository
↓
Detectors (rapid_os.domain.scanner)
↓
ProjectFact (raw facts with Evidence + SourceType + detector ID)
↓
normalize_facts() (consolidation, deduplication, confidence promotion, deterministic sort)
↓
ProjectModel (canonical, immutable, serializable v3 intelligence model)
↓
Validation (RAPID600–RAPID604) & Optional Snapshot (.rapid-os/project.json)
Canonical Domain Entities (rapid_os.domain.project)
Confidence
Ordered enum (LOW = "low", MEDIUM = "medium", HIGH = "high") representing certainty for a fact or suggestion. Always serialized as lowercase strings.
SourceType
Enum classifying how an observation was obtained:
filemanifestconfigdirectoryenvironment-keydependencyworkflow
Evidence
Immutable record (path, reason, source_type, optional detector) proving why a fact was emitted:
pathis normalized to a relative POSIX path inside the project root (package.json,apps/api/pyproject.toml). Absolute host paths and..path traversal segments are rejected.reasonis human-readable and never contains secret values from.envfiles.
ProjectFact
Immutable fact (category, value, confidence, evidence, detector):
detectoris a stable domain identifier (language.python,framework.fastapi,database.postgres,testing.pytest,deploy.vercel) decoupled from internal private function names.- Performs no I/O, mutates no files, and contains no CLI presentation logic.
normalize_facts
Deterministic consolidation pass over emitted facts:
- Facts sharing
(category, value)are merged into a singleProjectFact. ProjectFact.detectoris resolved to the canonical detector identifiercanonical_detector_id(category, value)independent of input order.Evidence.detectorpreserves the concrete detector/producer provenance for each observation.Evidenceentries are deduplicated and sorted by(path, reason, source_type, detector or "").- The highest
Confidenceacross merged detections is preserved. - Distinct values within the same category (such as
nextjsandfastapiinframeworkfor a monorepo) are preserved as separate facts. - Output facts are sorted deterministically by
(category, value).
ProjectModel
Canonical container (schema_version = 1, root = ".", facts: tuple[ProjectFact, ...]) with:
- Query helpers:
values(category),has(category, value=None),facts_for(category),fact(category, value),by_category(), andcategories(). - Round-trip deterministic serialization:
to_dict(),to_json(),from_dict(), andfrom_json().
Compatibility Facade (ProjectScan)
ProjectScan in rapid_os.domain.scanner wraps ProjectModel without duplicating state:
scan_project(root)callsbuild_project_model(root)and returnsProjectScan(model=model).scan.detectionsandscan.factsboth returnmodel.facts.scan.to_model()returns the underlyingProjectModel.suggest_init_choices()accepts eitherProjectModelorProjectScan, keepingrapid initcompatible while operating directly onProjectFactdata.
Optional Snapshot Persistence (rapid_os.adapters.project_snapshot)
- By default, scanning (
scan_project(),build_project_model(),rapid scan,rapid scan --json, andrapid init) is read-only and does not write.rapid-os/project.json. - When explicitly requested via
rapid scan --write(orwrite_project_snapshot()), Rapid OS writes.rapid-os/project.jsonusingsafe_write_text(..., backup=True)and validates containment viaensure_path_within_root().
Snapshot Validation (RAPID6xx in rapid_os.domain.validation)
When .rapid-os/project.json is present, rapid validate and rapid doctor verify its integrity:
RAPID600(INFO): Valid project intelligence snapshot loaded.RAPID601(ERROR): Invalid JSON in.rapid-os/project.json.RAPID602(ERROR): Unreadable.rapid-os/project.json.RAPID603(ERROR): Unsupported or invalidschema_version.RAPID604(ERROR): Corrupt structure or invalidProjectFact/Evidenceentry.
CLI Surface (rapid scan)
rapid scan: Runs local detectors and prints a human-readable summary of detected facts grouped by category (value,confidence, anddetector) without writing any files or runningsuggest_init_choices().rapid scan --verbose: Includes per-factEvidenceentries (path,reason, andsource_type) in the human-readable output.rapid scan --json: Emits only the serializedProjectModelJSON tostdout(no banners or decorative text) for machine consumption.rapid scan --write: Persists the canonicalProjectModelsnapshot to.rapid-os/project.jsonwith atomic write and.bakbackup protection.rapid scan --json --write: Writes.rapid-os/project.jsonand emits the exact same JSON document tostdout.
Phase 2: Context Compiler
Architectural Principle
Whereas Project Intelligence answers "What exists in the project?", the Context Compiler answers "What does the agent actually need to know to execute this specific task?".
Instead of dumping all standards and raw scan facts indiscriminately, the Context Compiler resolves, ranks, budgets, and compiles task-relevant context with full provenance and explainability.
Pipeline
ProjectModel + Project Standards + Spec Registry / Task Intent (ContextRequest) + ContextPolicy
↓
ContextSourceLoader (rapid_os.adapters.context_sources)
↓
ContextResolver (selection, precedence, budget enforcement, conflict detection)
↓
ContextCompiler (deterministic Markdown rendering + ContextManifest generation)
↓
CompiledContext (schema_version = 1, content + manifest)
Canonical Domain Entities (rapid_os.domain.context)
ContextSourceKind & Precedence Order
Explicit precedence hierarchy where user-confirmed constraints and rules always take priority over lower-level defaults and detected project facts:
task_constraintssecuritybusinessarchitecturetopologytech_stackcoding_rulesspectasksacceptancedesignreferencecustomproject_intelligence
ContextPriority
Ordered integer enum (LOW = 10, MEDIUM = 50, HIGH = 80, CRITICAL = 100).
ContextMode
Task execution modes (feature, bugfix, refactor, hardening, research, general), each defining mode-preferred source kinds and task-relevant ProjectModel fact filtering.
ContextSource & ContextFragment
Immutable, validated units of context with stable public identifiers (task.constraints, standard.security, standard.business, standard.tech-stack, spec.<id>.requirements, spec.scope, project.intelligence), portable POSIX paths, tags, selection reasons, and end-to-end portable provenance preserved through ContextSource → ContextFragment → ManifestEntry → ContextManifest.
- File-backed standards/specs record their relative POSIX path (e.g.,
.rapid-os/standards/security.md). - Explicit task constraints (
ContextRequest.constraints) are promoted to a first-class canonical source (id="task.constraints",kind=ContextSourceKind.TASK_CONSTRAINTS,priority=ContextPriority.CRITICAL,required=True,provenance="ContextRequest.constraints"). - Project Intelligence distinguishes snapshot provenance (
snapshot:.rapid-os/project.json) from live scan provenance (scan:live), and fails explicitly withRAPID704if.rapid-os/project.jsonexists on disk but is corrupt or invalid (never silently falling back to a live scan).
ContextRequest & ContextPolicy
ContextRequest captures task intent (mode, harness, objective, affected_paths, tags, max_chars, constraints, spec_id, spec_revision). ContextPolicy (DEFAULT_CONTEXT_POLICY, max_chars = 24000) governs required kinds, mode preferences, priorities, and precedence order.
Budget Enforcement, Required Sources & Non-Truncation Guarantee
- Budget (
max_chars) is enforced against the final compiled Markdown output (len(compiled.content) <= max_chars). - Required fragments (including
task.constraintsand mode-required kinds such assecurityinhardeningmode) are included first. If required fragments alone exceedmax_chars,ContextBudgetExceededErroris raised (RAPID702) without silently truncating rules. - If a required source or mode-required kind is missing after resolution,
ContextCompiler.compile()raisesContextRequiredSourceMissingError(RAPID701) andrapid contextexits non-zero without emitting invalid compiled context tostdout(ContextResolver.resolve()retainsmissing_required_kindsonContextSelectionfor low-level inspection). - Optional fragments are evaluated in deterministic rank order (
-priority,-relevance_score,precedence_rank,source_id,fragment_id). Any optional fragment that would exceed the remaining budget is skipped in its entirety withreason="skipped: source exceeds remaining budget".
Conflict Detection (ContextConflict)
Detects structural contradictions across effectively selected fragments and ProjectModel facts (such as conflicting database declarations across task.constraints, standard.business, standard.tech-stack, and project.intelligence) and records the winning source according to ContextPolicy precedence. Sources skipped due to budget or relevance never participate in or win conflicts.
ContextManifest & CompiledContext
CompiledContext (schema_version = 1) bundles the deterministic compiled Markdown (content) with a machine-readable ContextManifest (selected, skipped, conflicts, compiled_chars, max_chars, content_digest), supporting full to_dict(), to_json(), from_dict(), and from_json() round-trip serialization (preserving provenance on every ManifestEntry).
Context Validation Diagnostics (RAPID7xx in rapid_os.domain.validation)
RAPID700(INFO): Context compiled successfully.RAPID701(ERROR): Required context source missing (ContextRequiredSourceMissingError).RAPID702(ERROR): Context budget exceeded by required sources (ContextBudgetExceededError).RAPID703(WARNING): Context conflict detected across selected sources.RAPID704(ERROR): Context source or.rapid-os/project.jsonsnapshot unreadable or invalid.RAPID705(ERROR): InvalidContextRequestor duplicate/invalid source identifiers.
CLI Surface (rapid context)
rapid context(orrapid context compile): Compiles and prints the task-relevant context in read-only mode (never writes files, never prompts, never makes network calls).rapid context --mode <mode>: Selects task mode (feature,bugfix,refactor,hardening,research,general).rapid context --harness <harness>: Selects target harness (validate_harness_id: built-inscursor,claude,codex,vscode,antigravity, or any syntactically valid customharness_idmatching^[a-z0-9][a-z0-9-]{0,62}$, while keeping the Context Compiler pure with respect to the Harness Registry).rapid context --objective "...": Provides task objective for relevance scoring and task header rendering.rapid context --spec <spec-id> [--spec-revision <n>]: Injects areadyspec (current or pinned revision) from.rapid-os/specs/<spec-id>/into the Context Compiler and suppresses root singletonSPECS.md/TASKS.md/ACCEPTANCE.mdfiles to prevent ambiguity.rapid context --max-chars <n>: Sets explicit character budget.rapid context --manifest: Prints human-readable manifest (SELECTED,SKIPPED, andCONFLICTS).rapid context --json: Emits pureCompiledContextJSON (schema_version = 1,manifest,content) tostdout.rapid inspect-contextandcompose_project_context()remain intact for v2 compatibility.
Phase 3: Spec Registry v3
Architectural Principle
Whereas legacy rapid scope overwrote three singleton root files (SPECS.md, TASKS.md, ACCEPTANCE.md) with no stable identity, concurrent spec support, revision history, or authoring lifecycle, the Spec Registry makes Spec-Driven Development (SDD) canonical, addressable, and immutable.
A Spec answers: "What must be built and how will we know it is properly defined?".
It strictly separates authoring state (draft, ready, archived) from execution state (which belongs to Phase 4+).
Pipeline & Filesystem Layout
Scope / Spec Input
↓
Canonical Spec Model (SpecRecord + SpecRevision in rapid_os.domain.specs)
↓
SpecRegistry (.rapid-os/specs/<spec-id>/)
├── spec.json (schema_version = 1, id, status, current_revision)
└── revisions/
├── 0001/
│ ├── revision.json (schema_version = 1, structured fields + digests)
│ ├── requirements.md
│ ├── tasks.md
│ └── acceptance.md
└── 0002/
└── ...
↓
Context Compiler (rapid context --spec <spec-id> [--spec-revision <n>])
- No Duplicate Index: Specs are discovered deterministically by scanning
.rapid-os/specs/*/spec.jsonin lexical order. - Immutable Revisions, Historical Continuity & Atomic Commit Point: Existing
revisions/<rev>/directories (format_revision_dir_name:0001..9999,10000, ...) are never modified in place, and every historical revision1..current_revisionmust remain present and valid. Creating or revising a spec validates the model, writesrequirements.md,tasks.md,acceptance.md, andrevision.json, verifies revision completeness and SHA-256 digests, and updatesspec.json(current_revision) last.
Canonical Domain Entities (rapid_os.domain.specs)
SPEC_SCHEMA_VERSION = 1 & SPEC_REVISION_SCHEMA_VERSION = 1
Independent schema versions governing spec.json and revision.json.
SpecStatus
Authoring lifecycle enum (DRAFT = "draft", READY = "ready", ARCHIVED = "archived"):
- Allowed transitions:
draft → ready,draft → archived,ready → draft,ready → archived. archivedis terminal in Phase 3.
SpecMode
Canonical authoring mode (FEATURE = "feature", BUGFIX = "bugfix", REFACTOR = "refactor", HARDENING = "hardening", RESEARCH = "research"), with compatibility mapping from legacy rapid scope modes (new feature → feature, legacy hardening → hardening).
SpecRecord
Immutable record (schema_version, id, status, current_revision) persisted in .rapid-os/specs/<spec-id>/spec.json. Contains no timestamps, no UUIDs, no host paths, and no execution state.
SpecRevision
Immutable structured revision (schema_version, spec_id, revision, title, mode, business_objective, problem_statement, scope, out_of_scope, actors_users, main_flow, edge_cases, business_rules, technical_constraints, affected_paths, data_impact, acceptance_criteria, testing_strategy, implementation_tasks, tags):
- Preserves exact user-authored ordering across all semantic tuple fields (
main_flow,implementation_tasks,acceptance_criteria, etc.); onlytagsare normalized, deduplicated, and sorted lowercase. - Strictly validates persisted
revision.jsonkeys againstCANONICAL_SPEC_REVISION_KEYS(RAPID803), rejecting unknown or execution-state fields (execution_status,run_id,agent). - Deterministically renders
requirements.md,tasks.md, andacceptance.md, and computesartifact_digests(requirements.md,tasks.md,acceptance.md) pluscontent_digest(<sha256-hex>). - Provides explicit compatibility converters
spec_revision_from_scope()andscope_spec_from_revision()so legacyScopeSpecacts strictly as an authoring DTO.
Context Compiler Integration
When ContextRequest.spec_id is provided (rapid context --spec <id>):
- The target spec must have
status == SpecStatus.READY(loading adraftorarchivedspec fails withRAPID805). ContextSourceLoaderemits three canonical sources with portable repository-relative POSIX path provenance (.rapid-os/specs/<id>/revisions/<rev>/<artifact>):spec.<id>.requirements(ContextSourceKind.SPEC,HIGHpriority,provenance=".rapid-os/specs/<id>/revisions/<rev>/requirements.md")spec.<id>.tasks(ContextSourceKind.TASKS,MEDIUMpriority,provenance=".rapid-os/specs/<id>/revisions/<rev>/tasks.md")spec.<id>.acceptance(ContextSourceKind.ACCEPTANCE,MEDIUMpriority,provenance=".rapid-os/specs/<id>/revisions/<rev>/acceptance.md")
- Root legacy singletons (
SPECS.md,TASKS.md,ACCEPTANCE.md) are automatically excluded when--specis active. - Without
--spec,rapid contextpreserves backward compatibility by reading root singletons if present and ignoring.rapid-os/specs/to avoid multi-spec ambiguity.
Spec Registry Validation (RAPID8xx in rapid_os.domain.validation)
validate_spec_registry(root) is integrated into rapid validate and rapid doctor:
RAPID800(INFO): Spec registry valid.RAPID801(ERROR): Invalid persistedspec.jsonrecord/schema (InvalidSpecRecordError: invalid JSON, unsupportedschema_version, unknown fields, or invalid persisted record/status value).RAPID802(ERROR): Missingrevisions/directory or missing required historical/current revision directory (1..current_revision,CurrentRevisionMissingError).RAPID803(ERROR): Invalid persistedrevision.jsonmanifest/schema (InvalidRevisionManifestError: invalid JSON, unsupportedschema_version, unknown fields, or invalid revision fields).RAPID804(ERROR): Missingrequirements.md,tasks.md, oracceptance.mdartifact, or SHA-256 digest drift (SpecArtifactDriftError).RAPID805(ERROR): Invalid lifecycle transition or spec lifecycle prevents requested operation (SpecLifecycleError, e.g.draft/archivedspec requested by operational context compilation).RAPID806(ERROR): Invalidspec_id, duplicate spec identity, or directory/record ID mismatch (DuplicateSpecIdentityError).RAPID807(ERROR): Referenced spec or revision not found (SpecNotFoundError).RAPID808(ERROR): Unsafe spec path, symlink escape, or unreadable spec entry (UnsafeSpecPathError).RAPID809(WARNING): Orphan or unreferenced revision entry insiderevisions/(revision > current_revisionor non-canonical entry).
CLI Surface (rapid spec)
rapid spec create: Creates a new spec (--title,--id,--mode,--objective,--problem,--scope,--out-of-scope,--actor,--main-flow/--flow,--edge-case,--business-rule/--rule,--technical-constraint/--constraint,--affected-path,--data-impact,--acceptance,--testing,--task,--tag,--status {draft,ready},--export-legacy,--json). Interactive wizard when flags are omitted.rapid spec list [--status {draft,ready,archived}] [--json]: Lists specs in deterministic ID order without writing files.rapid spec show <spec-id> [--revision <n>] [--json]: Displays a spec and its current or pinned revision in read-only mode.rapid spec revise <spec-id> [--json] [...]: Creates immutable revisioncurrent_revision + 1, inheriting unspecified fields fromcurrent_revisionand resetting status todraft.rapid spec status <spec-id> <status> [--json]: Transitions authoring status (draft,ready,archived).rapid spec export-legacy <spec-id> [--revision <n>]: Explicitly exports a spec revision to rootSPECS.md,TASKS.md, andACCEPTANCE.mdwith.bakbackup protection.rapid scope [--register] [--spec-id <id>] [--status {draft,ready}]: Preserves legacy root file generation while optionally registering the spec in.rapid-os/specs/.
Phase 4: Execution Policy Engine & Run Contract
Architectural Principle
Phase 4 answers: "Given an exact Spec revision and its compiled context, under what execution contract, risk classification, workspace requirement, and gates is work allowed to happen?"
Rapid OS v3 strictly separates:
- Spec: WHAT must be built (authoring lifecycle in
.rapid-os/specs/). - Context: WHAT the agent needs to know (
CompiledContext). - Policy: UNDER WHAT RULES work may happen (
ExecutionPolicy→PolicyDecision). - Run: ONE concrete execution attempt pinned to an immutable
ExecutionContractand append-onlyRunStatesnapshots in.rapid-os/runs/<run-id>/. - Evidence (Phase 6): PROOF of what actually happened (
RunEvidence&EvaluationReport).
Rapid OS does not act as an autonomous agent runtime: it never invokes external LLM CLIs, never runs shell commands, never creates git worktrees automatically, and never mutates application source code.
Pipeline & Filesystem Layout
ProjectModel + SpecRevision (status == ready) + CompiledContext + ExecutionPolicy
↓
ExecutionPolicyEvaluator (rapid_os.domain.policy)
↓
PolicyDecision (ExecutionClass, RiskLevel, RiskSignals, WorkspaceRequirement, GateRequirements, reasons)
↓
ExecutionContract (contract.json: immutable contract + SHA-256 digests)
↓
RunRegistry (.rapid-os/runs/<run-id>/)
├── run.json (schema_version = 1, id, spec_id, spec_revision, contract_digest, current_state_revision)
├── contract.json (schema_version = 1, immutable ExecutionContract)
├── context.md (immutable compiled context snapshot)
├── context-manifest.json (immutable ContextManifest snapshot)
└── states/
├── 0001.json (initial RunState: status=prepared, tasks=pending, gates=pending)
├── 0002.json (append-only state transition)
└── ...
- No Duplicate Index: Runs are discovered deterministically by scanning
.rapid-os/runs/*/run.jsonin lexical order. - Deterministic Run IDs: Default run IDs follow
<spec-id>-r<spec-revision>-run-<NNN>(001..999,1000, ...) with no timestamps, random UUIDs, or host paths. - Immutable Contract & Append-Only State History:
contract.json,context.md,context-manifest.json, and existingstates/<NNNN>.jsonfiles are never modified in place. Every transition writesstates/<next>.jsonfirst, verifies its schema and invariants, and updatesrun.json(current_state_revision) last.
Canonical Domain Entities (rapid_os.domain.policy & rapid_os.domain.execution)
ExecutionClass
Classification of execution scope (SPIKE = "spike", BOUNDED = "bounded", ARCHITECTURAL = "architectural"):
spike:SpecMode.RESEARCHwithout architectural signals.bounded:FEATURE,BUGFIX, orREFACTORwithout architectural signals.architectural:SpecMode.HARDENING, architectural tags/paths (migration,schema,infra,deployment,security,auth,ci,architecture), or non-emptydata_impact.
RiskLevel & RiskSignal
Ordered risk enum (LOW = 10, MEDIUM = 50, HIGH = 80, CRITICAL = 100) paired with structured RiskSignal records (id, level, reason, source).
- Neither project policy nor CLI overrides (
--classification,--risk) may downgrade the calculatedExecutionClassorRiskLevel; any downgrade attempt fails withRAPID1006.
WorkspaceRequirement
Declarative workspace rule (CURRENT_ALLOWED = "current_allowed", ISOLATED_REQUIRED = "isolated_required"):
LOW/MEDIUMdefault tocurrent_allowed.HIGH/CRITICALrequireisolated_required.
GateKind, GatePhase, & GateRequirement
Canonical execution gates evaluated across PRE_EXECUTION (gate.workspace-isolation, gate.baseline, gate.manual-approval) and POST_EXECUTION (gate.tests, gate.architecture (only when the project has an architecture rule), gate.review, gate.security-review, gate.migration-review, gate.final-verification):
- Ordered deterministically by
CANONICAL_GATE_ORDERwithout duplicates. - At
CRITICALrisk, no gate is waivable. BelowCRITICAL, only gates listed inpolicy.waivable_gate_ids(gate.review,gate.testsby default) may be waived, and waiving always requires a non-emptyreason.
ExecutionPolicy (.rapid-os/policy.json)
Optional project-level policy configuration (EXECUTION_POLICY_SCHEMA_VERSION = 1) defining minimum_classification, minimum_risk, architectural_tags, architectural_path_prefixes, high_risk_tags, critical_risk_tags, workspace_by_risk, waivable_gate_ids, and extra_required_gate_ids.
- If
.rapid-os/policy.jsondoes not exist,DEFAULT_EXECUTION_POLICYis used (source="default"). - If
.rapid-os/policy.jsonexists, it is validated strictly (source=".rapid-os/policy.json"); corrupt or invalid policy files fail explicitly withRAPID1005orRAPID1006without falling back to defaults. - Programmatically injected custom policies require an explicit truthful
policy_source("injected") and cannot claim"default"(RAPID1005).
TaskContract & ExecutionContract
ExecutionContract (EXECUTION_CONTRACT_SCHEMA_VERSION = 1) pins schema_version, run_id, spec_id, spec_revision, spec_content_digest, harness, context_digest, context_manifest_digest, project_model_digest, policy_source, policy_digest, decision, classification, risk, risk_signals, workspace, gates, tasks (T001, T002, ... derived deterministically from SpecRevision.implementation_tasks), and contract_digest.
contract_digestis computed over the semantic contract payload (excludingrun_idandcontract_digest), so identical inputs produce identicalcontract_digestvalues across runs.
RunStatus, TaskStatus, GateDisposition, & RunState
RunState (RUN_STATE_SCHEMA_VERSION = 1) records the state revision (1..current_state_revision):
- Initial snapshot (
states/0001.json) invariant:revision = 1,status = prepared, all taskspending(empty reason), all gatespending(empty reason), andchange_kind = "run.prepared"(RAPID1012). - Sequential history verification (
s1 → s2 → ... → current): every consecutive snapshot must advancerevisionby 1, mutate exactly one category (run status,1 task, or1 gate), matchchange_kind, and satisfy all phase boundary preconditions (RAPID1012). RunStatustransitions:prepared → active | cancelled,active → blocked | finished | failed | cancelled,blocked → active | failed | cancelled.finished,failed, andcancelledare terminal (RAPID1009).- Phase boundaries (
RAPID1014):PRE_EXECUTIONgates can only change whilestatus = prepared.- Precondition for
prepared → active: all requiredPRE_EXECUTIONgates must beacknowledgedorwaived. - Tasks can only change while
status = active. POST_EXECUTIONgates can only change whilestatus = activeand after all tasks are terminal (doneorskipped).- Precondition for
active → finished: all tasks must bedoneorskippedand all requiredPOST_EXECUTIONgates must beacknowledgedorwaived.
TaskStatustransitions:pending → in_progress | skipped,in_progress → done | blocked | skipped,blocked → in_progress | skipped.doneandskippedare terminal (RAPID1010).
Execution Policy & Run Registry Validation (RAPID1000–RAPID1019 in rapid_os.domain.validation)
validate_execution_policy(rapid_dir, root) and validate_run_registry(rapid_dir, root) are integrated into rapid validate and rapid doctor:
RAPID1000(INFO): Execution policy and run registry valid.RAPID1001(ERROR): Invalidrun.jsonrecord or schema (InvalidRunRecordError).RAPID1002(ERROR): Invalidcontract.jsonor contract digest mismatch (InvalidExecutionContractError).RAPID1003(ERROR): Invalid spec binding (InvalidSpecBindingError— missing spec/revision, spec notready, orspec_content_digestmismatch).RAPID1004(ERROR): Context snapshot or digest mismatch (ContextSnapshotMismatchError).RAPID1005(ERROR): Invalid execution policy schema (InvalidExecutionPolicyError).RAPID1006(ERROR): Policy violation or forbidden risk/classification downgrade (PolicyViolationError).RAPID1007(ERROR): Run identity error or referenced run not found (DuplicateRunIdentityError,RunNotFoundError).RAPID1008(ERROR): Unsafe run/policy path or symlink escape (UnsafeRunPathError).RAPID1009(ERROR): Invalid run status transition (InvalidRunTransitionError).RAPID1010(ERROR): Invalid task status transition (InvalidTaskTransitionError).RAPID1011(ERROR/WARNING): Run state history gap or missingstates/directory (ERROR,RunStateHistoryGapError); unreferenced future staterevision > current_state_revisionor non-canonical entry instates/(WARNING).RAPID1012(ERROR): InvalidRunStateschema, digest, contract alignment, initial state invariant, or semantic state transition history (InvalidRunStateError).RAPID1013(ERROR): Invalid gate disposition transition or invalid waiver (InvalidGateTransitionError).RAPID1014(ERROR): Run lifecycle or phase boundary precondition not satisfied (ExecutionPreconditionError).RAPID1015–RAPID1019: Reserved for future execution policy diagnostics.
CLI Surface (rapid policy & rapid run)
rapid policy show [--json]: Displays active execution policy (defaultor.rapid-os/policy.json) in read-only mode.rapid policy init [--json]: Writes default.rapid-os/policy.json(fails withRAPID1005if.rapid-os/policy.jsonalready exists).rapid run create --spec <spec-id> [--spec-revision <n>] [--id <run-id>] [--harness <harness>] [--classification <class>] [--risk <risk>] [--json]: Evaluates policy, compiles context, and creates an immutable run contract and initial state0001.json.rapid run list [--status <status>] [--json]: Lists runs in deterministic ID order without mutating files.rapid run show <run-id> [--state-revision <n>] [--json]: Displays run record, contract, risk signals, tasks, gates, and current or historical state in read-only mode.rapid run status <run-id> <status> [--reason "..."] [--json]: Appends a new state revision transitioning run status after verifying gate/task preconditions.rapid run task <run-id> <task-id> <status> [--reason "..."] [--json]: Appends a new state revision transitioning a task (T001, ...).rapid run gate <run-id> <gate-id> <disposition> [--reason "..."] [--json]: Appends a new state revision acknowledging or waiving a gate.
Phase 5: Harness Capability Registry
Architectural Principle
Phase 5 answers:
"Given an immutable
ExecutionContract, can the selected harness satisfy the capabilities required to execute that contract?"
Repository
↓
ProjectModel
↓
SpecRevision + CompiledContext
↓
ExecutionPolicy
↓
ExecutionContract
↓
HarnessProfile + CapabilityRequirementResolver
↓
CapabilityResolution
Fundamental Boundary & Product Truth
A capability declaration says what a harness is expected to support. It does not prove that the harness actually exercised that capability.
Phase 5 manages:
- Harness identity validation (
validate_harness_id,HARNESS_ID_RE = ^[a-z0-9][a-z0-9-]{0,62}$) - Canonical capability catalog (
CANONICAL_CAPABILITY_DEFINITIONS, 11 canonical capability IDs) - Declarative harness profiles (
HarnessProfile,HARNESS_PROFILE_SCHEMA_VERSION = 1) - Built-in vs. project-overridden profiles (
.rapid-os/harnesses/<id>.jsonwith full replacement semantics and no silent fallback on corrupt profiles) - Capability requirement derivation from
ExecutionContract(CapabilityRequirementResolver) - Compatibility resolution (
CapabilityResolver→CapabilityResolution) - Deterministic capability lock snapshots (
.rapid-os/capabilities.lock,CAPABILITY_LOCK_SCHEMA_VERSION = 1)
Phase 5 does not manage:
- Agent or LLM invocation
- Shell execution (
subprocess,os.system,Popen,shell=True) - Git command execution or worktree creation
- Subagent or MCP runtime invocation
- Evidence collection or behavioral evaluation (handled by Phase 6)
- Mutation of Phase 4 run artifacts (
run.json,contract.json,context.md,context-manifest.json,states/*.json)
Canonical Domain Entities (rapid_os.domain.harnesses & rapid_os.domain.capabilities)
Harness Identity (validate_harness_id)
- Validated by
HARNESS_ID_RE = re.compile(r"^[a-z0-9][a-z0-9-]{0,62}$"). - Rejects uppercase characters, whitespace, null bytes, path separators, traversal segments (
..), and Windows drive prefixes (RAPID1104,HarnessIdentityError). - Built-in harness IDs:
codex,claude,cursor,vscode,antigravity. ContextRequest,ContextManifest, andExecutionContract(EXECUTION_CONTRACT_SCHEMA_VERSION = 1unchanged) accept any syntactically validharness_id. The Context Compiler remains pure with respect to the Harness Registry.ExecutionContract.harnessis the single source of truth for capability resolution (profile.id == contract.harness); the harness is selected when creating a Run (rapid run create --harness <id>).
Capability Catalog (CapabilityCategory & CapabilityDefinition)
First-class canonical catalog with 8 categories (context, repository, workspace, execution, testing, git, integration, delegation) and 11 canonical capability IDs:
context.consume(context)repository.read(repository)repository.write(repository)workspace.current(workspace)workspace.isolated(workspace)shell.execute(execution)tests.execute(testing)git.inspect(git)git.modify(git)mcp.invoke(integration)subagents.delegate(delegation)
Unknown or out-of-catalog capability IDs are rejected with RAPID1101 (InvalidCapabilityIdError).
Capability Support (CapabilitySupportStatus & CapabilitySupport)
CapabilitySupportStatus:SUPPORTED = "supported",UNSUPPORTED = "unsupported",UNKNOWN = "unknown".- Critical invariant:
UNKNOWN != SUPPORTED. Anunknowncapability never satisfies a required capability. CapabilitySupport(capability_id, status, reason)requires a non-emptyreason, is deduplicated, and is sorted deterministically bycapability_id. Invalid or duplicate support declarations fail withRAPID1106(InvalidCapabilitySupportError).
HarnessProfile (HARNESS_PROFILE_SCHEMA_VERSION = 1)
- Immutable profile (
schema_version,id,capabilities,content_digest). - Strict persisted schema (
schema_version,id,capabilities, optionalcontent_digeston authoring input; unknown fields likeagent_status,model,last_seen, orexecution_resultare rejected withRAPID1102,InvalidHarnessProfileError). content_digestis the SHA-256 hex digest of the canonical JSON payload excludingcontent_digest. Ifcontent_digestis present in persisted JSON, it is strictly verified (RAPID1102); if omitted in hand-authored JSON, it is computed deterministically on load and always emitted on serialization.
Conservative Built-in Profiles & Project Override Semantics (rapid_os.adapters.harness_registry)
- Built-in profiles (
builtin:<id>) follow a conservative policy:context.consume:supportedrepository.read:supportedworkspace.current:supported- All other canonical capabilities (
repository.write,workspace.isolated,shell.execute,tests.execute,git.inspect,git.modify,mcp.invoke,subagents.delegate):unknown
- Project profiles live in
.rapid-os/harnesses/<id>.json(source = ".rapid-os/harnesses/<id>.json"). - Full Replacement Semantics: When
.rapid-os/harnesses/<id>.jsonexists, it completely replacesbuiltin:<id>(any canonical capability omitted from the JSON file defaults tounknownon that profile rather than merging from the built-in profile). - No Silent Fallback: If
.rapid-os/harnesses/<id>.jsonexists on disk but is corrupt, unreadable, has an ID/filename mismatch, or fails schema/digest validation,HarnessRegistryraises aHarnessCapabilityError(RAPID1102/RAPID1104/RAPID1105/RAPID1106) and never falls back tobuiltin:<id>.
Requirement Derivation (CapabilityRequirementResolver)
Derives required capabilities deterministically from an ExecutionContract (plus optional explicit --require <capability-id> requirements):
- Always required:
context.consume(source="contract.context")repository.read(source="contract.repository")
- Tasks rule:
- If
contract.tasksis not empty →repository.write(source="contract.tasks") - (
SPIKEwith tasks requiresrepository.write;ARCHITECTURALwithout tasks does not automatically requirerepository.write.)
- If
- Workspace rule (derived solely from
contract.workspace):workspace == current_allowed→workspace.current(source="contract.workspace")workspace == isolated_required→workspace.isolated(source="contract.workspace")
- Gate rule (technical harness capabilities only; human/governance gates like
gate.review,gate.manual-approval,gate.security-review,gate.migration-review,gate.final-verification, andgate.workspace-isolationdo not derive additional technical harness capabilities):- Required
gate.tests→tests.execute(source="contract.gate.tests")
- Required
- Extra explicit CLI/API requirements:
--require <capability-id>→source="cli.require"
Explicit extra requirements are additive only. They never remove, downgrade or replace contract-derived requirements.
Compatibility Resolution (CapabilityResolver & CapabilityResolution)
Evaluates required capabilities against a HarnessProfile (CAPABILITY_RESOLUTION_SCHEMA_VERSION = 1, enforcing profile.id == contract.harness):
SUPPORTED→satisfiedUNSUPPORTED→missingUNKNOWN(or absent from profile) →unknown- Compatibility rules:
- Any
missing(UNSUPPORTED) →CompatibilityStatus.INCOMPATIBLE - Else any
unknown(UNKNOWN) →CompatibilityStatus.UNRESOLVED - Else (all
SUPPORTED) →CompatibilityStatus.COMPATIBLE
- Any
CapabilityResolutionis completely read-only and never modifies.rapid-os/runs/<run-id>/.
Capability Lock (.rapid-os/capabilities.lock)
- Optional deterministic snapshot (
CAPABILITY_LOCK_SCHEMA_VERSION = 1) written only viarapid harness lock. - Pins every active profile (
builtin+ project overrides) sorted byharness_id(id,source,profile_digest,profile) and records a top-level canonicalcontent_digest. rapid harness resolve --run <id> --lockedresolves against the exactHarnessProfilesnapshot stored inside.rapid-os/capabilities.lock(failing withRAPID1111if.rapid-os/capabilities.lockis missing or invalid, orRAPID1103if the harness is not present in the lock).
Harness Capability Validation (RAPID1100–RAPID1119 in rapid_os.domain.validation)
validate_harness_registry(rapid_dir, root) and validate_capability_lock(rapid_dir, root) are integrated into rapid validate and rapid doctor:
RAPID1100(INFO): Harness capability registry / lock valid.RAPID1101(ERROR): Invalid or unknowncapability_id(InvalidCapabilityIdError).RAPID1102(ERROR): InvalidHarnessProfileschema/content/digest (InvalidHarnessProfileError).RAPID1103(ERROR):HarnessProfilenot found (HarnessProfileNotFoundError).RAPID1104(ERROR): Invalid harness identity / filename-ID mismatch (HarnessIdentityError, includingvalidate_harness_id()).RAPID1105(ERROR): Unsafe profile/registry/lock path or symlink (UnsafeHarnessPathError).RAPID1106(ERROR): Invalid capability support declaration (InvalidCapabilitySupportError).RAPID1107(ERROR): InvalidCapabilityRequirement(InvalidCapabilityRequirementError).RAPID1108(ERROR): InvalidCapabilityResolution(InvalidCapabilityResolutionError).RAPID1109(ERROR):CapabilityResolutiondigest mismatch (CapabilityResolutionDigestMismatchError).RAPID1110(ERROR): Strict compatibility requirement not satisfied (IncompatibleHarnessError— applies to bothincompatibleandunresolvedunder--require-compatible).RAPID1111(ERROR): Invalid or missingcapabilities.lock(InvalidCapabilityLockError).RAPID1112(WARNING):capabilities.lockstale relative to active profiles.RAPID1113–RAPID1119: Reserved for future harness capability diagnostics.
CLI Surface (rapid harness)
rapid harness list [--json]: Lists active harness profiles (builtinand project overrides) in deterministicharness_idorder without writing files.rapid harness show <harness-id> [--json]: Displays a resolved harness profile, provenance (source),content_digest, and capability statuses in read-only mode.rapid harness init <harness-id> [--json]: Materializes a built-in harness profile to.rapid-os/harnesses/<harness-id>.jsonwithout overwriting existing files (RAPID1102if file exists;RAPID1103for custom IDs without a built-in profile).rapid harness lock [--json]: Writes deterministic.rapid-os/capabilities.lockacross all active profiles.rapid harness resolve --run <run-id> [--locked] [--require <capability-id>] [--require-compatible] [--json]: Resolves an immutable run'sExecutionContract(contract.harness) against the active (or--locked) harness profile in read-only mode. Default mode is informational (exit 0oncompatible,incompatible, orunresolved);--require-compatibleenforces gate mode (exit 0only oncompatible,RAPID1110andexit 1onincompatibleorunresolved).
Phase 6: Evidence Engine & Behavioral Evals
Architectural Principle & Four-Layer Separation
Phase 6 answers:
"What observable evidence exists for what actually happened, and what deterministic conclusions can Rapid derive from that evidence?"
Rapid OS v3 strictly separates four distinct layers that must never be conflated:
Phase 4 RunState
DECLARES lifecycle and gate disposition
Phase 5 CapabilityResolution
EVALUATES declared harness capability compatibility
Phase 6 RunEvidence
RECORDS immutable observations and artifact digests
Phase 6 EvaluationReport
DERIVES deterministic behavioral conclusions
- Declaration is not Verification:
GateDisposition.ACKNOWLEDGEDin Phase 4 means someone declared that the gate was addressed; without qualifyingRunEvidence, Phase 6 evaluates the gate assertion asUNVERIFIED(neverPASS). - Immutability of Phase 4 and Phase 5: Phase 6 never mutates
.rapid-os/runs/<run-id>/(run.json,contract.json,context.md,context-manifest.json,states/*.json), never auto-acknowledges gates, never auto-completes runs, and never mutates.rapid-os/harnesses/or.rapid-os/capabilities.lock. - Offline & Runtime-Agnostic: Phase 6 contains zero
subprocess,os.system,Popen,shell=True, or LLM-as-a-judge calls. - Evidence Authenticity Boundary: The Evidence Registry verifies local integrity (
content_digest, copied artifact SHA-256 digests, byte sizes, sequence continuity, and Run/Contract/RunStatebinding), not cryptographic external attestation.
Pipeline & Filesystem Layout
ExecutionContract + RunState + RunEvidence[] + BehavioralRuleset (v1)
↓
EvidenceRegistry (.rapid-os/evidence/<run-id>/)
├── records/
│ ├── E001.json (schema_version = 1, immutable RunEvidence + content_digest)
│ ├── E002.json
│ └── ...
└── artifacts/
├── E001/
│ └── unittest-output.txt (copied immutable artifact verified by SHA-256 + byte size)
└── E002/
└── ...
↓
BehavioralEvaluator (rapid_os.domain.evals)
↓
EvalRegistry (.rapid-os/evals/<run-id>/)
└── reports/
├── 0001.json (schema_version = 1, immutable EvaluationReport + report_digest)
├── 0002.json
└── ...
Canonical Domain Entities (rapid_os.domain.evidence & rapid_os.domain.evals)
RunEvidence (RUN_EVIDENCE_SCHEMA_VERSION = 1) & EvidenceArtifact
- Canonical
RunEvidencefields:schema_version,id,run_id,contract_digest,state_revision,state_digest,kind,producer,summary,task_ids,gate_ids,capability_ids,payload,artifacts,content_digest(contains no wall-clock timestamps, preserving deterministic content digests). - Canonical
EvidenceArtifactfields:path,sha256,size_bytes. - Deterministic append-only evidence IDs (
E001..E999,E1000, ...;EVIDENCE_ID_RE = ^E\d{3,}$). - Bound to exact
run_id,contract_digest, historicalstate_revision, andstate_digest. - If
producerstarts withharness:<id>,<id>must equalExecutionContract.harness(RAPID1203). - Validates
task_idsagainstcontract.tasks,gate_idsagainstcontract.gates, andcapability_idsagainstCANONICAL_CAPABILITY_IDS(RAPID1207). - Supporting artifacts are copied into
.rapid-os/evidence/<run-id>/artifacts/<evidence-id>/<filename>before committingrecords/<evidence-id>.json, isolating evidence from external file modifications or deletions (RAPID1205). - Crash-orphan & sequence integrity: a single trailing
artifacts/E00N/directory atmax_record_ordinal + 1withoutrecords/E00N.jsonis reported asRAPID1209 WARNING(never auto-deleted) and blocksrapid evidence add(RAPID1211) until resolved so it cannot advance toE00(N+1). Any missing record at or beforemax_record_ordinal(even ifartifacts/E00K/exists) is a historical sequence gap (RAPID1208 ERROR). compute_evidence_set_digest(run_id, records)computes the canonical SHA-256 digest over(id, content_digest)sorted by ordinal.
EvidenceKind & Structured Payload Schemas
Nine canonical evidence kinds with strict per-kind payload validation (RAPID1206) and secret-value rejection:
command_result:{"label": "<str>", "exit_code": <int>}.test_result:{"suite": "<str>", "exit_code": <int>, "passed": <int >= 0>, "failed": <int >= 0>, "skipped": <int >= 0>}.file_change:{"paths": ["<rel-posix-path>", ...]}(non-empty, sorted, deduplicated relative POSIX paths).git_result:{"operation": "inspect" | "modify"}.workspace:{"mode": "current" | "isolated"}.review:{"review_type": "peer" | "security" | "migration" | "manual" | "final", "outcome": "approved" | "changes_requested" | "rejected", "reviewer": "<str>"}.tool_invocation:{"tool_id": "<str>", "outcome": "success" | "failure"}.delegation:{"target": "<str>", "outcome": "success" | "failure"}.artifact:{"label": "<str>"}— requires at least one copiedEvidenceArtifact.
BehavioralRuleset (BEHAVIORAL_RULESET_VERSION = 1), EvalAssertion, & EvaluationReport (EVALUATION_REPORT_SCHEMA_VERSION = 1)
- Canonical
EvaluationReportfields:schema_version,run_id,contract_digest,state_revision,state_digest,evidence_set_digest,ruleset_version,ruleset_digest,extra_capability_ids,verdict,assertions,summary,report_digest. extra_capability_ids: tuple[str, ...]is validated againstCANONICAL_CAPABILITY_IDS, deduplicated, sorted, and included inreport_digest.- Mandatory semantic replay: when loading or validating any persisted
EvaluationReport,EvalRegistryreconstructs the evaluation viaBehavioralEvaluator.evaluate(contract, historical_state, historical_evidence_prefix, extra_capability_requirements=report.extra_capability_ids)and requires exact equality ofassertions,verdict,ruleset_digest,evidence_set_digest,extra_capability_ids, andreport_digest(RAPID1223on any semantic mismatch, even ifreport_digestwas recomputed after tampering). DEFAULT_BEHAVIORAL_RULESETdefines 10 versioned, deterministic rules withcompute_ruleset_digest().BehavioralEvaluator.evaluate()evaluates four categories ofEvalAssertion:- Run Lifecycle (
run.lifecycle):FINISHED → PASS,FAILED | CANCELLED → FAIL,PREPARED | ACTIVE | BLOCKED → UNVERIFIED. - Task Evidence (
task.<task-id>.evidence):DONEwith non-failing execution evidence (COMMAND_RESULT,TEST_RESULT,FILE_CHANGE,GIT_RESULT,TOOL_INVOCATION,DELEGATION,ARTIFACT) →PASS;DONEwith failing evidence →FAIL;DONEwithout evidence →UNVERIFIED;SKIPPED→NOT_APPLICABLE(required=False). - Gate Evidence (
gate.<gate-id>.evidence):PENDING→UNVERIFIED(even if evidence exists).WAIVED→WAIVED.ACKNOWLEDGEDwithout qualifying evidence →UNVERIFIED.IMPLEMENTATION_TESTS(gate.tests): requires artifact-backedTEST_RESULTwithexit_code == 0andfailed == 0(FAILifexit_code != 0orfailed > 0).BASELINE_CHECK(gate.baseline): requires artifact-backedCOMMAND_RESULTorTEST_RESULTwithexit_code == 0(andfailed == 0).WORKSPACE_ISOLATION(gate.workspace-isolation): requiresWORKSPACEwithmode == "isolated".- Review gates (
PEER_REVIEW → peer,SECURITY_REVIEW → security,MIGRATION_REVIEW → migration,MANUAL_APPROVAL → manual,FINAL_VERIFICATION → final): requireREVIEWwith matchingreview_typeandoutcome == "approved"(FAILonchanges_requestedorrejected). - Conservative multi-evidence policy: any
FAIL→FAIL; else anyPASS→PASS; elseUNVERIFIED.
- Capability Observation (
capability.<capability-id>.observed):- Reuses Phase 5
CapabilityRequirementResolver(plus optional additive--require <capability-id>persisted inextra_capability_ids). - Non-observable capabilities in v1 (
context.consume,repository.read) emitNOT_APPLICABLE(required=False) with reason"not objectively observable by Evidence Engine v1". - Observable capabilities (
repository.write,workspace.current,workspace.isolated,tests.execute,shell.execute,git.inspect,git.modify,mcp.invoke,subagents.delegate) are evaluated against matching evidence records.
- Reuses Phase 5
- Run Lifecycle (
- Verdict Precedence (
EvaluationVerdict:pass,pass_with_waivers,fail,unverified):run.lifecycle == FAILor any required assertion== FAIL→FAIL(fail)- Else any required assertion
== UNVERIFIED→UNVERIFIED(unverified) - Else any required assertion
== WAIVED→PASS_WITH_WAIVERS(pass_with_waivers) - Else →
PASS(pass)
EvaluationVerdict.PASSProduct Truth:EvaluationVerdict.PASSmeans the configured Phase 6 evidence rules are satisfied by the exact recorded evidence set. It does not mathematically prove that the software has no bugs, that security is perfect, or that production deployment is safe.
Evidence & Behavioral Eval Validation (RAPID1200–RAPID1239 in rapid_os.domain.validation)
validate_evidence_registry(rapid_dir, root) and validate_eval_registry(rapid_dir, root) are integrated into rapid validate and rapid doctor:
RAPID1200(INFO): Evidence Registry valid.RAPID1201(ERROR): Invalid evidence ID (InvalidEvidenceIdError).RAPID1202(ERROR): InvalidRunEvidenceschema orcontent_digest(InvalidRunEvidenceError).RAPID1203(ERROR): Evidence Run / Contract /RunState/ harness producer binding mismatch (EvidenceBindingMismatchError).RAPID1204(ERROR): Unsafe evidence path or symlink (UnsafeEvidencePathError).RAPID1205(ERROR): Evidence artifact missing, digest mismatch, or size mismatch (EvidenceArtifactIntegrityError).RAPID1206(ERROR): InvalidEvidenceKindor payload (InvalidEvidencePayloadError).RAPID1207(ERROR): Invalid task, gate, or capability reference (InvalidEvidenceReferenceError).RAPID1208(ERROR): Evidence sequence gap or duplicate identity (EvidenceSequenceGapError).RAPID1209(WARNING): Trailing crash-orphan evidence artifact directory (artifacts/E00Nwithoutrecords/E00N.jsonatmax_record_ordinal + 1; never auto-deleted and blocksrapid evidence add).RAPID1210(ERROR): Evidence not found (EvidenceNotFoundError).RAPID1211(ERROR): Append-only evidence overwrite violation (EvidenceOverwriteError).RAPID1212–RAPID1219: Reserved for Evidence diagnostics.RAPID1220(INFO): Eval Registry valid.RAPID1221(ERROR): InvalidEvaluationReportschema (InvalidEvaluationReportError).RAPID1222(ERROR):EvaluationReportdigest mismatch (EvaluationReportDigestMismatchError).RAPID1223(ERROR): Evaluation Run / state / evidence binding or semantic replay mismatch (EvaluationBindingMismatchError).RAPID1224(ERROR): Unsafe eval path or symlink (UnsafeEvaluationPathError).RAPID1225(ERROR): EvaluationUNVERIFIEDwhen--require-pass(EvaluationUnverifiedError).RAPID1226(ERROR): EvaluationFAILwhen--require-pass(EvaluationFailedError).RAPID1227(WARNING): StoredEvaluationReportis stale relative to currentRunState,evidence_set_digest, orruleset_digest.RAPID1228(ERROR):EvaluationReportnot found (EvaluationReportNotFoundError).RAPID1229(ERROR): Append-only evaluation report overwrite violation (EvaluationOverwriteError).RAPID1230–RAPID1239: Reserved for Eval diagnostics.
Core v3 Governance Loop & Architectural Invariant
Full v3 Architecture Flow
Repository
↓
Project Intelligence
↓
ProjectModel
Scope / Spec Authoring
↓
Spec Registry
↓
SpecRevision
ProjectModel + Standards + SpecRevision
↓
Context Compiler
↓
CompiledContext
Spec + Context + Policy
↓
Execution Policy
↓
ExecutionContract
↓
Run Ledger
ExecutionContract
↓
Harness Capability Registry
↓
CapabilityResolution
Actual external execution
↓
RunEvidence
↓
Evidence Registry
↓
BehavioralEvaluator
↓
EvaluationReport
Core v3 Governance Loop
WHAT EXISTS?
Project Intelligence
WHAT SHOULD BE BUILT?
Spec Registry
WHAT DOES THE AGENT NEED TO KNOW?
Context Compiler
UNDER WHAT RULES MAY IT WORK?
Execution Policy
WHAT EXACT ATTEMPT ARE WE GOVERNING?
Run Contract
CAN THE HARNESS DECLARE THE REQUIRED CAPABILITIES?
Harness Capability Registry
WHAT ACTUALLY HAPPENED?
Evidence Engine
WHAT CAN WE CONCLUDE FROM THAT EVIDENCE?
Behavioral Evals
Architectural Invariant
Governed AI Development
=
Project Intelligence
+
Context
+
Spec
+
Policy
+
Capability
+
Evidence
+
Evaluation