---
title: "Core Concepts"
source: "https://edawise.com/docs/cli/concepts/"
---

# Core Concepts

`deccy` models architectural and implementation knowledge as a directed acyclic graph of plain files under `.deccy/`. Everything `deccy` reports—ownership, staleness, drift, and structural validity—is computed directly from the files on disk.

---

## 1. Nodes: Decisions and Connectors

Every node in the graph has a stable **ID**, a **kind** (`decision` or `connector`), a free-form **type**, a one-line **title**, an optional **rationale** file pointer, and a map of file **claims**.

### Decisions (`--kind decision` / `-d`)

A **decision** represents a choice made in the project: an invariant, an API boundary, a storage format, or an implementation rule.

- Decisions can own files via **claims** and carry long-form prose via a **rationale**.
- Decisions never carry `head` or `tail` pins.

### Connectors (`--kind connector` / `-c`)

A **connector** wires nodes together and states what relates or verifies them (for example, a review criterion, an EARS requirement, or a test contract).

- A connector adds two pin sets: **`tail`** and **`head`**.
- Both `tail` and `head` are **AND-sets**: a connector relates all of its `tail` nodes to all of its `head` nodes.
- Either end (or both) can be empty when a connector is created as a **skeleton** and filled in later with `deccy link`.
- Connectors can also own files (such as test files) via `claims` and carry a `rationale`.

---

## 2. Node IDs and Prefix Lookup

Every node is identified by a 128-bit ID encoded as **32 reverse-hex characters** using the alphabet `zyxwvutsrqponmlk` (`0 → z`, `15 → k`), matching the visual style of `jj` change IDs:

```text
ktvsvszpzoxlzrsoqpvsuztsstmyvqvp
```

- **IDs are identity; digests are versions.** A node's ID never changes when its title, rationale, claims, or pins are edited.
- **Prefix resolution:** Any command that takes an `<id>` accepts either the full 32-character ID or a unique prefix of **at least 8 characters** (e.g. `ktvsvszp`).
  - Prefix shorter than 8 characters → refused immediately.
  - Prefix matching multiple nodes → refused with a list of every matching full ID.

---

## 3. Free-Form `type`

Every node has a `type` field—a single non-empty line such as `text`, `ears`, `adr`, `review-criteria`, or `invariant`.

`deccy` deliberately does **not** restrict `type` to a built-in enum. Your team or workflow defines the vocabulary.

---

## 4. Rationales

A node's JSON record stays compact by storing long-form prose in a separate file under `.deccy/rationale/`:

- When unwritten, `"rationale": null` in the record.
- When written via `deccy new -r` or `deccy rationale --file`, `deccy` writes `.deccy/rationale/<id>.md` by default and stores `"rationale": "rationale/<id>.md"` in the record.
- You can use any filename or extension inside `rationale/` via `deccy rationale <id> --path rationale/custom.txt`.
- `deccy` never parses or reformats rationale files—it hashes their raw bytes into the node's digest and outputs them verbatim on `deccy show <id> --rationale`.

---

## 5. Claims and Drift

A **claim** pairs a repository-relative file path with the BLAKE3 digest of that file's contents:

```json
"claims": {
  "src/store.rs": "9c1f2a40e8d1..."
}
```

- **Exclusive ownership:** Each claimed file should belong to a single node. `deccy new` and `deccy claim` refuse to claim a file already owned by another node.
- **Whole regular files only:** Directories, symlinks, paths outside the working directory, and paths inside `.deccy/` cannot be claimed.
- **Drift:** When you edit a claimed file on disk, its current hash no longer matches the recorded snapshot in `claims`.
  - `deccy status` reports this as `drift <path> expected <8-hex> has <8-hex>`.
  - Drift is **not** a validation error—code is expected to move as you work.
  - Running `deccy claim <id> --refresh` re-snapshots the node's claimed files and clears drift.
- **Destructive removal:** Because a node owns its claimed files, `deccy remove <id>` deletes the claimed files along with the node's rationale and record. To keep a file while removing its node, release the claim first with `deccy claim <id> --release <path>`.

---

## 6. Digests, Pins, and Staleness

### Node Digest

Every node's version is its **content-defined digest**, computed on the fly from:

1. The compact **canonical JSON** of its record, and
2. The raw bytes of its **rationale** file (empty if `rationale` is `null`).

Reformatting whitespace in a node's JSON file does not change its canonical form or digest. Editing any field, claim hash, pin, or rationale byte produces a new digest.

### Pins and Staleness

When a connector links to a node in `tail` or `head`, it stores a **pin** containing both the target node's `id` and its digest `at` the time of linking:

```json
{"at": "04ef2ce7...", "id": "ktvsvszpzoxlzrsoqpvsuztsstmyvqvp"}
```

If the target node is later edited (its title changes, its rationale is updated, or its claims are refreshed), the target's current digest changes. The connector's pin is now **stale**:

- `deccy status` reports stale pins with both 8-character digests:
  ```text
  connector qonutznvlyssluxyzysswxltlztxlwro
    tail ktvsvszpzoxlzrsoqpvsuztsstmyvqvp expects 04ef2ce7 has 9c1f2a40
  ```
- Like drift, staleness is a **work item** in `status`, not a structural error in `validate`.
- Once you verify that the connector still holds for the updated target, run `deccy link <connector> --repin` to update its pins to the targets' current digests.

---

## 7. `status` vs. `validate`

`deccy` separates **ongoing work items** from **structural faults**:

| Category | Reported by `status`? | Fails `validate` (exit 1)? | Meaning |
| :--- | :---: | :---: | :--- |
| `stale` | Yes | No | A connector's pin digest lags behind its target's current digest. |
| `drift` | Yes | No | A claimed file's bytes on disk differ from the hash recorded in `claims`. |
| `orphans` | Yes | No | A decision not named by any connector, or a connector with both ends empty. |
| `no-rationale` | Yes | No | A node whose `rationale` field is `null`. |
| `conflicted` | Yes | **Yes** | A node file reported as conflicted by `jj` or `git`. |
| `broken` | Yes | **Yes** | An unreadable/invalid JSON record or a stray file in `.deccy/nodes/`. |
| `collision` | Yes | **Yes** | Two or more nodes claim the same file path. |
| `dangling` | Yes | **Yes** | A connector pin names a node ID that does not exist in `.deccy/nodes/`. |
| `cycle` | Yes | **Yes** | Connector pins form a directed cycle across `head`/`tail` edges. |
| `missing-claims` | Yes | **Yes** | A claimed file is missing on disk or is no longer a regular file. |
| `missing-rationales` | Yes | **Yes** | A record's `rationale` pointer names a missing or unreadable file. |
| `unpinned` | Yes | **Yes** | A hand-edited pin has `"at": "current"` instead of a 64-char hex digest. |

- `deccy status` always exits `0` (unless the store itself cannot be inspected).
- `deccy validate` exits `0` when `problems == 0` and exits `1` when any structural problem (or merge error under `--merge` / `--since`) is found.
