Skip to content
Open
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 @@ -212,12 +212,14 @@ FR-096 and the quire-cli relation-report requirement, where they are evaluated o
| FR-025-AC-7 | The module loads with the six starter rules and the nine remediations. A copy of the module whose rule has `any_of: [medical]` on `regulated_categories` fails to load, and the error names the rule and the value `medical`. A copy whose remediation has `value: encrypt-in-transt` fails to load naming the remediation. | Test |
| FR-025-AC-8 | `Safeguard.json` has exactly the seven members listed, and no `unknown`, `none`, `obtain-processor-agreement` or `remove-from-sink` member. A control with `safeguards: [encrypt-in-transit]` validates; one with `safeguards: [shield]`, `safeguards: [remove-from-sink]`, `safeguards: []` or a duplicated member fails validation with a located message. A control without the field validates and its record has no `safeguards` key. The `Control` schema carries no `default` for `safeguards`. | Test |
| FR-025-AC-9 | The `control` manifest entry lists `connection` and `data_sink` in `allowed_links.protects`; a `control` that `protects` a `connection` and one that `protects` a `data_sink` each validate without a link diagnostic. The `safeguards` locator has `required: false` and no `multiple: true`, and the `control` skeleton shows `safeguards` and validates with zero errors. | Test |
| FR-025-AC-10 | The remediation names are the seven `Safeguard` members plus `obtain-processor-agreement` and `remove-from-sink`. Every remediation a starter rule names matches that rule under FR-096: an `adds` matches an `unless_any` condition, a `sets` matches a zero-step `unless_any` condition, and no starter rule names a `removes`. | Inspection |
| FR-025-AC-10 | The remediation names are the seven `Safeguard` members plus `obtain-processor-agreement` and `remove-from-sink`. The first seven each declare an incoming `protects` edge from `control` with the matching `safeguards` value; `obtain-processor-agreement` sets `processor_agreement` to `covered`; `remove-from-sink` removes an incoming `delivers_to` edge. Every remediation a starter rule names matches that rule under FR-096: an `adds` matches an `unless_any` condition, a `sets` matches a zero-step `unless_any` condition, and no starter rule names a `removes`. | Test |
| FR-025-AC-11 | `ControlFrontmatter.json` and `DataClassificationFrontmatter.json` exist and are open schemas. The first holds `safeguards` as a `Safeguard[]` and the second holds `regulated_categories` as a `RegulatedDataCategory[]`; the `control` and `data_classification` manifest entries reference them through `frontmatter_schema_ref`. Every starter-rule `any_of` value and every remediation `value` is a member of the enum of its field in the frontmatter schema of the end archetype that the module declares. | Test |
| FR-025-AC-12 | Each starter rule's `check` equals its `name`, and each carries a non-empty `rationale`. Each rule's `remediations` are in the nine. | Test |
| FR-025-AC-13 | A `data_sink` of `kind: llm_prompt` that receives `health` data, with `processor_agreement: not_covered` and no protecting control, is denied under both `trace:regulated-data-to-uncovered-processor` and `trace:health-in-llm-prompt-or-tool-call`, each naming the sink. A `kind: log` sink receiving only `personal` data, with `processor_agreement: covered`, yields no denial from any starter rule; with `processor_agreement: not_covered` it is denied under `trace:regulated-data-to-uncovered-processor` and not under `trace:health-in-log`. | Test |
| FR-025-AC-14 | The manifest declares no rule for transfer regions and no per-role purpose rule. The README records the per-role purpose gap. No remediation or rule text claims that a change makes a system compliant, and no rule text, rationale or README names or quotes a paywalled standard. | Inspection |

> **CR-003 note (2026-11-16):** PLAT-1479 adds the nine remediation declarations required by FR-025-AC-10. `restrict-region` is represented as a control safeguard, matching the closed `Safeguard` vocabulary; it does not set a region field. `remove-from-sink` describes removal of the sink's incoming first-step `delivers_to` relationship and does not imply that other paths or sink rules are cleared.

## Dependencies

- **Upstream**: [FR-004](./FR-004-role-schemas.md), [FR-023](./FR-023-regulated-data-categories-on-data-classification.md);
Expand Down
3 changes: 2 additions & 1 deletion spec/tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ the Python package only: neither Node script is measured by it.
| NFR-003 | NFR-003-AC-1..2, NFR-003-M-1..2 | TC-204, TC-205 | ✅ |
| FR-023 | FR-023-AC-1..10 | TC-206..TC-217 | ✅ AC-7 is an inspection |
| FR-024 | FR-024-AC-1..7 | TC-220..TC-223 | ✅ |
| FR-025 | FR-025-AC-8..9, FR-025-AC-11 | TC-244..TC-247 | 🚧 AC-11 starter-rule enum coverage remains with PLAT-1540; other FR-025 criteria remain with their owning tickets |
| FR-025 | FR-025-AC-8..11 | TC-244..TC-247, TC-256 | 🚧 AC-11 starter-rule enum coverage remains with PLAT-1540; other FR-025 criteria remain with their owning tickets |
| NFR-004 | NFR-004-AC-1..3, NFR-004-M-1..2 | TC-207, TC-211, TC-213, TC-214 | ✅ |
| FR-017 | FR-017-AC-1..7 | TC-175..TC-186 | ✅ `quire clauses` loads strictly and cannot load the real module (the object-type edges come from another module), so TC-181, TC-183, TC-185 and TC-186 evaluate a module that holds only the set files |
| FR-026 | FR-026-AC-1..7, FR-026-AC-9..10 | TC-224..TC-236, TC-242..TC-243 | ✅ |
Expand Down Expand Up @@ -372,6 +372,7 @@ the Python package only: neither Node script is measured by it.
| TC-245 | Control safeguards are optional authored frontmatter, are extracted when present, and the skeleton validates | Integration | P0 | FR-025-AC-8, FR-025-AC-9 | ✅ |
| TC-246 | A control protects a connection and a data sink without a disallowed-target diagnostic | Integration | P0 | FR-025-AC-9 | ✅ |
| TC-247 | Control and data-classification manifests reference their open frontmatter schemas and declare the field locators | Unit | P0 | FR-025-AC-9, FR-025-AC-11 | ✅ |
| TC-256 | The nine remediation declarations have the exact action, direction, field, value, description and order required by FR-025 | Unit | P0 | FR-025-AC-10 | ✅ |
| TC-248 | Controller activity has scalar controller details, required context, and a valid covers connection | Integration | P0 | FR-028-AC-1 | ✅ |
| TC-249 | Processor activity accepts its own identity, a non-empty controller list, and home regions without controller-only context | Unit | P0 | FR-028-AC-2 | ✅ |
| TC-250 | Missing controller context or processor identity/controller-list requirements are rejected with field-named diagnostics | Unit | P0 | FR-028-AC-3 | ✅ |
Expand Down
28 changes: 28 additions & 0 deletions spec_objects_security/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,34 @@ traceability:
to: []
direction: outgoing
check: threat-model-covers-nothing
remediations:
- name: encrypt-in-transit
description: Add a control with this safeguard protecting the affected connection.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: encrypt-in-transit}
- name: encrypt-at-rest
description: Add a control with this safeguard protecting the affected sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: encrypt-at-rest}
- name: anonymize
description: Add a control with this safeguard protecting the affected connection or sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: anonymize}
- name: pseudonymize
description: Add a control with this safeguard protecting the affected connection or sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: pseudonymize}
- name: obtain-consent
description: Add a control with this safeguard protecting the affected connection or sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: obtain-consent}
- name: restrict-region
description: Add a control with this safeguard protecting the affected connection or sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: restrict-region}
- name: validate-before-display
description: Add a control with this safeguard protecting the affected connection or sink.
adds: {edge: protects, direction: incoming, from: control, field: safeguards, value: validate-before-display}
- name: obtain-processor-agreement
description: Set the affected sink's processor_agreement field to covered.
sets: {field: processor_agreement, value: covered}
- name: remove-from-sink
description: Remove the connection's delivers_to relationship to this sink when it is the first path step.
removes: {edge: delivers_to, direction: incoming}
#
# A risk that transitively arises from itself states nothing, and no
# per-document check can see it: the defect is a property of the graph.
Expand Down
42 changes: 42 additions & 0 deletions tests/test_control_safeguards.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,45 @@ def test_manifest_declares_safeguard_and_classification_frontmatter():
"path": ["regulated_categories"],
"required": False,
}


@pytest.mark.trace("TC-256", "FR-025-AC-10")
def test_manifest_declares_the_nine_remediations_with_exact_changes():
import yaml

manifest = yaml.safe_load((PACKAGE_ROOT / "manifest.yaml").read_text())
remediations = manifest["traceability"]["remediations"]
expected_safeguards = (
"encrypt-in-transit",
"encrypt-at-rest",
"anonymize",
"pseudonymize",
"obtain-consent",
"restrict-region",
"validate-before-display",
)
assert [entry["name"] for entry in remediations] == [
*expected_safeguards,
"obtain-processor-agreement",
"remove-from-sink",
]
for name in expected_safeguards:
entry = next(item for item in remediations if item["name"] == name)
assert entry["adds"] == {
"edge": "protects",
"direction": "incoming",
"from": "control",
"field": "safeguards",
"value": name,
}
assert not ({"sets", "removes"} & entry.keys())
agreement = next(
item for item in remediations if item["name"] == "obtain-processor-agreement"
)
assert agreement["sets"] == {"field": "processor_agreement", "value": "covered"}
assert not ({"adds", "removes"} & agreement.keys())
remove = next(item for item in remediations if item["name"] == "remove-from-sink")
assert remove["removes"] == {"edge": "delivers_to", "direction": "incoming"}
assert not ({"adds", "sets"} & remove.keys())
assert all(item.get("description", "").strip() for item in remediations)
assert "first path step" in remove["description"]
Loading