From 011860db2587c292efbc2438deea8783e453fb87 Mon Sep 17 00:00:00 2001 From: Agent IX Date: Mon, 16 Nov 2026 03:35:31 -0800 Subject: [PATCH 1/3] Add the FR-025 remediation vocabulary --- ...ntrol-safeguards-and-starter-flow-rules.md | 4 +- spec/tests.md | 3 +- spec_objects_security/manifest.yaml | 28 +++++++++++++ tests/test_control_safeguards.py | 42 +++++++++++++++++++ 4 files changed, 75 insertions(+), 2 deletions(-) diff --git a/spec/functional/FR-025-control-safeguards-and-starter-flow-rules.md b/spec/functional/FR-025-control-safeguards-and-starter-flow-rules.md index d4e97f3..eb66ffe 100644 --- a/spec/functional/FR-025-control-safeguards-and-starter-flow-rules.md +++ b/spec/functional/FR-025-control-safeguards-and-starter-flow-rules.md @@ -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); diff --git a/spec/tests.md b/spec/tests.md index 332ce34..6534d57 100644 --- a/spec/tests.md +++ b/spec/tests.md @@ -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-248 | 🚧 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 | ✅ | @@ -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-248 | 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 | ✅ | diff --git a/spec_objects_security/manifest.yaml b/spec_objects_security/manifest.yaml index 838573f..15db0dc 100644 --- a/spec_objects_security/manifest.yaml +++ b/spec_objects_security/manifest.yaml @@ -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 incoming delivers_to connection from the affected sink's first-step path. + 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. diff --git a/tests/test_control_safeguards.py b/tests/test_control_safeguards.py index bfcc047..7fad405 100644 --- a/tests/test_control_safeguards.py +++ b/tests/test_control_safeguards.py @@ -205,3 +205,45 @@ def test_manifest_declares_safeguard_and_classification_frontmatter(): "path": ["regulated_categories"], "required": False, } + + +@pytest.mark.trace("TC-248", "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-step" in remove["description"] From a84c3b21d1b137105f78749a33fa9be9aca54a20 Mon Sep 17 00:00:00 2001 From: Agent IX Date: Mon, 16 Nov 2026 03:57:02 -0800 Subject: [PATCH 2/3] Clarify remove-from-sink authorship --- spec_objects_security/manifest.yaml | 2 +- tests/test_control_safeguards.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec_objects_security/manifest.yaml b/spec_objects_security/manifest.yaml index 15db0dc..b188952 100644 --- a/spec_objects_security/manifest.yaml +++ b/spec_objects_security/manifest.yaml @@ -911,7 +911,7 @@ traceability: description: Set the affected sink's processor_agreement field to covered. sets: {field: processor_agreement, value: covered} - name: remove-from-sink - description: Remove the incoming delivers_to connection from the affected sink's first-step path. + 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 diff --git a/tests/test_control_safeguards.py b/tests/test_control_safeguards.py index 7fad405..1180063 100644 --- a/tests/test_control_safeguards.py +++ b/tests/test_control_safeguards.py @@ -246,4 +246,4 @@ def test_manifest_declares_the_nine_remediations_with_exact_changes(): 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-step" in remove["description"] + assert "first path step" in remove["description"] From 3ee72067bafe118de050af3fcd11fde97c4c161a Mon Sep 17 00:00:00 2001 From: Agent IX Date: Mon, 16 Nov 2026 04:19:04 -0800 Subject: [PATCH 3/3] Give remediation test a unique TC identifier --- spec/tests.md | 4 ++-- tests/test_control_safeguards.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/tests.md b/spec/tests.md index 6534d57..71113b9 100644 --- a/spec/tests.md +++ b/spec/tests.md @@ -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..11 | TC-244..TC-248 | 🚧 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 | ✅ | @@ -372,7 +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-248 | 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-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 | ✅ | diff --git a/tests/test_control_safeguards.py b/tests/test_control_safeguards.py index 1180063..de213d4 100644 --- a/tests/test_control_safeguards.py +++ b/tests/test_control_safeguards.py @@ -207,7 +207,7 @@ def test_manifest_declares_safeguard_and_classification_frontmatter(): } -@pytest.mark.trace("TC-248", "FR-025-AC-10") +@pytest.mark.trace("TC-256", "FR-025-AC-10") def test_manifest_declares_the_nine_remediations_with_exact_changes(): import yaml