|
| 1 | +<!-- Auto-generated by `rivet init --agents`. Re-run to update after artifact changes. --> |
| 2 | +# AGENTS.md — Rivet Project Instructions |
| 3 | + |
| 4 | +> This file was generated by `rivet init --agents`. Re-run the command |
| 5 | +> any time artifacts change to keep this file current. |
| 6 | +
|
| 7 | +## Project Overview |
| 8 | + |
| 9 | +This project uses **Rivet** for SDLC artifact traceability. |
| 10 | +- Config: `rivet.yaml` |
| 11 | +- Schemas: common, dev, aspice, stpa, aadl |
| 12 | +- Artifacts: 221 across 3 types |
| 13 | +- Validation: `rivet validate` (current status: 21 errors) |
| 14 | + |
| 15 | +## Available Commands |
| 16 | + |
| 17 | +| Command | Purpose | Example | |
| 18 | +|---------|---------|---------| |
| 19 | +| `rivet validate` | Check link integrity, coverage, required fields | `rivet validate --format json` | |
| 20 | +| `rivet list` | List artifacts with filters | `rivet list --type requirement --format json` | |
| 21 | +| `rivet stats` | Show artifact counts by type | `rivet stats --format json` | |
| 22 | +| `rivet add` | Create a new artifact | `rivet add -t requirement --title "..." --link "satisfies:SC-1"` | |
| 23 | +| `rivet link` | Add a link between artifacts | `rivet link SOURCE -t satisfies --target TARGET` | |
| 24 | +| `rivet serve` | Start the dashboard | `rivet serve --port 3000` | |
| 25 | +| `rivet export` | Generate HTML reports | `rivet export --format html --output ./dist` | |
| 26 | +| `rivet impact` | Show change impact | `rivet impact --since HEAD~1` | |
| 27 | +| `rivet coverage` | Show traceability coverage | `rivet coverage --format json` | |
| 28 | +| `rivet diff` | Compare artifact versions | `rivet diff --base path/old --head path/new` | |
| 29 | + |
| 30 | +## Artifact Types |
| 31 | + |
| 32 | +| Type | Count | Description | |
| 33 | +|------|------:|-------------| |
| 34 | +| `design-decision` | 46 | An architectural or design decision with rationale | |
| 35 | +| `feature` | 90 | A user-visible capability or feature | |
| 36 | +| `requirement` | 85 | A functional or non-functional requirement | |
| 37 | +| `aadl-analysis-result` | 0 | Output of a spar analysis pass | |
| 38 | +| `aadl-component` | 0 | AADL component type or implementation imported from spar | |
| 39 | +| `aadl-flow` | 0 | End-to-end flow with latency bounds | |
| 40 | +| `aadl-tool` | 0 | An AADL ecosystem tool — captures what it does, what makes it unique, and what capabilities spar could adopt from it. | |
| 41 | +| `control-action` | 0 | An action issued by a controller to a controlled process or another controller. | |
| 42 | +| `controlled-process` | 0 | A process being controlled — the physical or data transformation acted upon by controllers. | |
| 43 | +| `controller` | 0 | A system component (human or automated) responsible for issuing control actions. Each controller has a process model — its internal beliefs about the state of the controlled process. | |
| 44 | +| `controller-constraint` | 0 | A constraint on a controller's behavior derived by inverting a UCA. Specifies what the controller must or must not do. | |
| 45 | +| `hazard` | 0 | A system state or set of conditions that, together with worst-case environmental conditions, will lead to a loss. | |
| 46 | +| `loss` | 0 | An undesired or unplanned event involving something of value to stakeholders. Losses define what the analysis aims to prevent. | |
| 47 | +| `loss-scenario` | 0 | A causal pathway describing how a UCA could occur or how the control action could be improperly executed, leading to a hazard. | |
| 48 | +| `stakeholder-req` | 0 | Stakeholder requirement (SYS.1) | |
| 49 | +| `sub-hazard` | 0 | A refinement of a hazard into a more specific unsafe condition. | |
| 50 | +| `sw-arch-component` | 0 | Software architectural element (SWE.2) | |
| 51 | +| `sw-detail-design` | 0 | Software detailed design or unit specification (SWE.3) | |
| 52 | +| `sw-integration-verification` | 0 | Software component and integration verification measure (SWE.5 — Software Component Verification and Integration Verification) | |
| 53 | +| `sw-req` | 0 | Software requirement (SWE.1) | |
| 54 | +| `sw-verification` | 0 | Software verification measure against SW requirements (SWE.6 — Software Verification) | |
| 55 | +| `sys-integration-verification` | 0 | System integration and integration verification measure (SYS.4 — System Integration and Integration Verification) | |
| 56 | +| `sys-verification` | 0 | System verification measure against system requirements (SYS.5 — System Verification) | |
| 57 | +| `system-arch-component` | 0 | System architectural element (SYS.3) | |
| 58 | +| `system-constraint` | 0 | A condition or behavior that must be satisfied to prevent a hazard. Each constraint is the inversion of a hazard. | |
| 59 | +| `system-req` | 0 | System requirement derived from stakeholder needs (SYS.2) | |
| 60 | +| `uca` | 0 | An Unsafe Control Action — a control action that, in a particular context and worst-case environment, leads to a hazard. Four types (provably complete): 1. Not providing the control action leads to a hazard 2. Providing the control action leads to a hazard 3. Providing too early, too late, or in the wrong order 4. Control action stopped too soon or applied too long | |
| 61 | +| `unit-verification` | 0 | Unit verification measure (SWE.4 — Software Unit Verification) | |
| 62 | +| `verification-execution` | 0 | A verification execution run against a specific version | |
| 63 | +| `verification-verdict` | 0 | Pass/fail verdict for a single verification measure in an execution run | |
| 64 | + |
| 65 | +## Working with Artifacts |
| 66 | + |
| 67 | +### File Structure |
| 68 | +- Artifacts are stored as YAML files in: `artifacts`, `safety/stpa`, `safety/stpa/requirements.yaml`, `safety/stpa/architecture.yaml`, `safety/stpa/validation.yaml` |
| 69 | +- Schema definitions: `schemas/` directory |
| 70 | +- Documents: `docs` |
| 71 | + |
| 72 | +### Creating Artifacts |
| 73 | +```bash |
| 74 | +rivet add -t requirement --title "New requirement" --status draft --link "satisfies:SC-1" |
| 75 | +``` |
| 76 | + |
| 77 | +### Validating Changes |
| 78 | +Always run `rivet validate` after modifying artifact YAML files. |
| 79 | +Use `rivet validate --format json` for machine-readable output. |
| 80 | + |
| 81 | +### Link Types |
| 82 | + |
| 83 | +| Link Type | Description | Inverse | |
| 84 | +|-----------|-------------|--------| |
| 85 | +| `acts-on` | Control action acts on a process or controller | `acted-on-by` | |
| 86 | +| `allocated-to` | Source is allocated to the target (e.g. requirement to architecture component) | `allocated-from` | |
| 87 | +| `caused-by-uca` | Loss scenario is caused by an unsafe control action | `causes-scenario` | |
| 88 | +| `constrained-by` | Source is constrained by the target | `constrains` | |
| 89 | +| `constrains-controller` | Constraint applies to a specific controller | `controller-constrained-by` | |
| 90 | +| `depends-on` | Source depends on target being completed first | `depended-on-by` | |
| 91 | +| `derives-from` | Source is derived from the target | `derived-into` | |
| 92 | +| `implements` | Source implements the target | `implemented-by` | |
| 93 | +| `inverts-uca` | Controller constraint inverts (is derived from) an UCA | `inverted-by` | |
| 94 | +| `issued-by` | Control action or UCA is issued by a controller | `issues` | |
| 95 | +| `leads-to-hazard` | UCA or loss scenario leads to a hazard | `hazard-caused-by` | |
| 96 | +| `leads-to-loss` | Hazard leads to a specific loss | `loss-caused-by` | |
| 97 | +| `mitigates` | Source mitigates or prevents the target | `mitigated-by` | |
| 98 | +| `modeled-by` | An architecture component is modeled by an AADL component | `models` | |
| 99 | +| `part-of-execution` | Verification verdict belongs to a verification execution run | `contains-verdict` | |
| 100 | +| `prevents` | Constraint prevents a hazard | `prevented-by` | |
| 101 | +| `refines` | Source is a refinement or decomposition of the target | `refined-by` | |
| 102 | +| `result-of` | Verification verdict is the result of executing a verification measure | `has-result` | |
| 103 | +| `satisfies` | Source satisfies or fulfils the target | `satisfied-by` | |
| 104 | +| `traces-to` | General traceability link between any two artifacts | `traced-from` | |
| 105 | +| `verifies` | Source verifies or validates the target | `verified-by` | |
| 106 | + |
| 107 | +## Conventions |
| 108 | + |
| 109 | +- Artifact IDs follow the pattern: PREFIX-NNN (e.g., REQ-001, FEAT-042) |
| 110 | +- Use `rivet add` to create artifacts (auto-generates next ID) |
| 111 | +- Always include traceability links when creating artifacts |
| 112 | +- Run `rivet validate` before committing |
0 commit comments