Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ One PR. A single requirement gains two sentences.

## 3. Close out

- [ ] 3.1 Archive the change
- [x] 3.1 Archive the change. Archiving is what promotes the delta into the standing spec, so until this ran the coverage statement lived only in the change directory and `openspec/specs/cli-rule-reconciliation/spec.md` did not carry it
18 changes: 17 additions & 1 deletion openspec/specs/cli-rule-reconciliation/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,21 @@ before the **first** `;` is the algoVersion and SHALL be read up to that one del
detect the version (and therefore the normalization procedure and hash algorithm) before
any `key=value` parameters are parsed. Signatures SHALL be compared as whole strings.

The algoVersion SHALL also determine **what the signature covers**. A signature at
algoVersion `1` covers exactly one file: the engine's `ruleFile` from the rule layout
table, which is `check.ts` for the runtime engine. An engine that requires more than one
file to be signed SHALL do so under a later algoVersion.

**Rationale.** Coverage is a property of the signature scheme, not of the delivery that
carries a signature. Stating it on the version keeps a payload from having to say which
of its files is the signed one, and gives a future multi-file scheme a mechanism that
already exists rather than a new payload shape. Leaving it unstated is what let both
teams hold the same binding as a private assumption.

#### Scenario: Envelope is emitted for algoVersion 1

- **WHEN** the CLI computes a signature for a rule file's bytes using algoVersion 1
- **THEN** the result SHALL be a string `1;h=sha-256;d=<hex>` with `<hex>` lowercase
- **THEN** the signature SHALL be the string `1;h=sha-256;d=<hex>` for that file's normalized bytes

#### Scenario: Version is read before parameters

Expand All @@ -31,6 +42,11 @@ any `key=value` parameters are parsed. Signatures SHALL be compared as whole str
- **WHEN** the CLI compares two signatures for equality
- **THEN** it SHALL compare the full envelope strings, not the bare digests

#### Scenario: A v1 signature covers the engine's rule file

- **WHEN** a runtime rule carries a signature at algoVersion 1
- **THEN** that signature SHALL be over `check.ts` and over no other file in the rule directory

### Requirement: Signature normalization procedure (algoVersion 1)

The CLI SHALL compute an algoVersion-1 digest as `SHA-256( normalize(fileText) )`,
Expand Down
Loading